semaphor 0.0.47 → 0.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/dashboard-plus-CiMeIZCS.js +205 -0
- package/dist/chunks/dashboard-plus-upSoeQoI.js +4258 -0
- package/dist/chunks/index-71zNxWPN.js +53652 -0
- package/dist/chunks/index-O9LcZUoj.js +421 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +63 -2
- package/dist/types/main.d.ts +561 -12
- package/dist/types/surfboard.d.ts +63 -2
- package/dist/types/types.d.ts +63 -2
- package/package.json +5 -1
- package/dist/chunks/dashboard-plus-1eyVwWds.js +0 -228
- package/dist/chunks/dashboard-plus-k_LsKxv1.js +0 -10751
- package/dist/chunks/index-J6hHt1a9.js +0 -43449
- package/dist/chunks/index-gGj_6O-g.js +0 -364
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
"use strict";var D6=Object.defineProperty;var T6=(e,t,n)=>t in e?D6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var De=(e,t,n)=>(T6(e,typeof t!="symbol"?t+"":t,n),n),Nv=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ne=(e,t,n)=>(Nv(e,t,"read from private field"),n?n.call(e):t.get(e)),We=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Le=(e,t,n,r)=>(Nv(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var uh=(e,t,n,r)=>({set _(o){Le(e,t,o,n)},get _(){return ne(e,t,r)}}),bt=(e,t,n)=>(Nv(e,t,"access private method"),n);const m=require("react"),Fo=require("react-dom");function iO(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 pe=iO(m),k6=iO(Fo);var ms=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sx(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 p0={exports:{}},iu={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.development.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var bC;function M6(){return bC||(bC=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function x($){if($===null||typeof $!="object")return null;var J=v&&$[v]||$[b];return typeof J=="function"?J:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _($){{for(var J=arguments.length,ce=new Array(J>1?J-1:0),Ce=1;Ce<J;Ce++)ce[Ce-1]=arguments[Ce];S("error",$,ce)}}function S($,J,ce){{var Ce=w.ReactDebugCurrentFrame,je=Ce.getStackAddendum();je!==""&&(J+="%s",ce=ce.concat([je]));var He=ce.map(function(Ne){return String(Ne)});He.unshift("Warning: "+J),Function.prototype.apply.call(console[$],console,He)}}var R=!1,E=!1,O=!1,k=!1,M=!1,D;D=Symbol.for("react.module.reference");function I($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===i||M||$===o||$===c||$===u||k||$===g||R||E||O||typeof $=="object"&&$!==null&&($.$$typeof===p||$.$$typeof===f||$.$$typeof===s||$.$$typeof===a||$.$$typeof===l||$.$$typeof===D||$.getModuleId!==void 0))}function z($,J,ce){var Ce=$.displayName;if(Ce)return Ce;var je=J.displayName||J.name||"";return je!==""?ce+"("+je+")":ce}function j($){return $.displayName||"Context"}function Q($){if($==null)return null;if(typeof $.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof $=="function")return $.displayName||$.name||null;if(typeof $=="string")return $;switch($){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof $=="object")switch($.$$typeof){case a:var J=$;return j(J)+".Consumer";case s:var ce=$;return j(ce._context)+".Provider";case l:return z($,$.render,"ForwardRef");case f:var Ce=$.displayName||null;return Ce!==null?Ce:Q($.type)||"Memo";case p:{var je=$,He=je._payload,Ne=je._init;try{return Q(Ne(He))}catch{return null}}}return null}var U=Object.assign,B=0,K,H,q,Z,T,V,X;function N(){}N.__reactDisabledLog=!0;function se(){{if(B===0){K=console.log,H=console.info,q=console.warn,Z=console.error,T=console.group,V=console.groupCollapsed,X=console.groupEnd;var $={configurable:!0,enumerable:!0,value:N,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}B++}}function ae(){{if(B--,B===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},$,{value:K}),info:U({},$,{value:H}),warn:U({},$,{value:q}),error:U({},$,{value:Z}),group:U({},$,{value:T}),groupCollapsed:U({},$,{value:V}),groupEnd:U({},$,{value:X})})}B<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=w.ReactCurrentDispatcher,fe;function oe($,J,ce){{if(fe===void 0)try{throw Error()}catch(je){var Ce=je.stack.trim().match(/\n( *(at )?)/);fe=Ce&&Ce[1]||""}return`
|
|
10
|
+
`+fe+$}}var ee=!1,ie;{var be=typeof WeakMap=="function"?WeakMap:Map;ie=new be}function G($,J){if(!$||ee)return"";{var ce=ie.get($);if(ce!==void 0)return ce}var Ce;ee=!0;var je=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var He;He=ue.current,ue.current=null,se();try{if(J){var Ne=function(){throw Error()};if(Object.defineProperty(Ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ne,[])}catch(dn){Ce=dn}Reflect.construct($,[],Ne)}else{try{Ne.call()}catch(dn){Ce=dn}$.call(Ne.prototype)}}else{try{throw Error()}catch(dn){Ce=dn}$()}}catch(dn){if(dn&&Ce&&typeof dn.stack=="string"){for(var Me=dn.stack.split(`
|
|
11
|
+
`),Ot=Ce.stack.split(`
|
|
12
|
+
`),nt=Me.length-1,it=Ot.length-1;nt>=1&&it>=0&&Me[nt]!==Ot[it];)it--;for(;nt>=1&&it>=0;nt--,it--)if(Me[nt]!==Ot[it]){if(nt!==1||it!==1)do if(nt--,it--,it<0||Me[nt]!==Ot[it]){var Ut=`
|
|
13
|
+
`+Me[nt].replace(" at new "," at ");return $.displayName&&Ut.includes("<anonymous>")&&(Ut=Ut.replace("<anonymous>",$.displayName)),typeof $=="function"&&ie.set($,Ut),Ut}while(nt>=1&&it>=0);break}}}finally{ee=!1,ue.current=He,ae(),Error.prepareStackTrace=je}var In=$?$.displayName||$.name:"",Xs=In?oe(In):"";return typeof $=="function"&&ie.set($,Xs),Xs}function me($,J,ce){return G($,!1)}function _e($){var J=$.prototype;return!!(J&&J.isReactComponent)}function Pe($,J,ce){if($==null)return"";if(typeof $=="function")return G($,_e($));if(typeof $=="string")return oe($);switch($){case c:return oe("Suspense");case u:return oe("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case l:return me($.render);case f:return Pe($.type,J,ce);case p:{var Ce=$,je=Ce._payload,He=Ce._init;try{return Pe(He(je),J,ce)}catch{}}}return""}var $e=Object.prototype.hasOwnProperty,Ve={},Fe=w.ReactDebugCurrentFrame;function ke($){if($){var J=$._owner,ce=Pe($.type,$._source,J?J.type:null);Fe.setExtraStackFrame(ce)}else Fe.setExtraStackFrame(null)}function Ge($,J,ce,Ce,je){{var He=Function.call.bind($e);for(var Ne in $)if(He($,Ne)){var Me=void 0;try{if(typeof $[Ne]!="function"){var Ot=Error((Ce||"React class")+": "+ce+" type `"+Ne+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[Ne]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ot.name="Invariant Violation",Ot}Me=$[Ne](J,Ne,Ce,ce,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(nt){Me=nt}Me&&!(Me instanceof Error)&&(ke(je),_("%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).",Ce||"React class",ce,Ne,typeof Me),ke(null)),Me instanceof Error&&!(Me.message in Ve)&&(Ve[Me.message]=!0,ke(je),_("Failed %s type: %s",ce,Me.message),ke(null))}}}var ct=Array.isArray;function kt($){return ct($)}function Dt($){{var J=typeof Symbol=="function"&&Symbol.toStringTag,ce=J&&$[Symbol.toStringTag]||$.constructor.name||"Object";return ce}}function cn($){try{return de($),!1}catch{return!0}}function de($){return""+$}function Se($){if(cn($))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dt($)),de($)}var Ie=w.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},Je,Gt,Jt;Jt={};function un($){if($e.call($,"ref")){var J=Object.getOwnPropertyDescriptor($,"ref").get;if(J&&J.isReactWarning)return!1}return $.ref!==void 0}function Pn($){if($e.call($,"key")){var J=Object.getOwnPropertyDescriptor($,"key").get;if(J&&J.isReactWarning)return!1}return $.key!==void 0}function or($,J){if(typeof $.ref=="string"&&Ie.current&&J&&Ie.current.stateNode!==J){var ce=Q(Ie.current.type);Jt[ce]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Q(Ie.current.type),$.ref),Jt[ce]=!0)}}function Zt($,J){{var ce=function(){Je||(Je=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",J))};ce.isReactWarning=!0,Object.defineProperty($,"key",{get:ce,configurable:!0})}}function hn($,J){{var ce=function(){Gt||(Gt=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",J))};ce.isReactWarning=!0,Object.defineProperty($,"ref",{get:ce,configurable:!0})}}var On=function($,J,ce,Ce,je,He,Ne){var Me={$$typeof:t,type:$,key:J,ref:ce,props:Ne,_owner:He};return Me._store={},Object.defineProperty(Me._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Me,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ce}),Object.defineProperty(Me,"_source",{configurable:!1,enumerable:!1,writable:!1,value:je}),Object.freeze&&(Object.freeze(Me.props),Object.freeze(Me)),Me};function Ze($,J,ce,Ce,je){{var He,Ne={},Me=null,Ot=null;ce!==void 0&&(Se(ce),Me=""+ce),Pn(J)&&(Se(J.key),Me=""+J.key),un(J)&&(Ot=J.ref,or(J,je));for(He in J)$e.call(J,He)&&!qe.hasOwnProperty(He)&&(Ne[He]=J[He]);if($&&$.defaultProps){var nt=$.defaultProps;for(He in nt)Ne[He]===void 0&&(Ne[He]=nt[He])}if(Me||Ot){var it=typeof $=="function"?$.displayName||$.name||"Unknown":$;Me&&Zt(Ne,it),Ot&&hn(Ne,it)}return On($,Me,Ot,je,Ce,Ie.current,Ne)}}var Et=w.ReactCurrentOwner,Pt=w.ReactDebugCurrentFrame;function Wt($){if($){var J=$._owner,ce=Pe($.type,$._source,J?J.type:null);Pt.setExtraStackFrame(ce)}else Pt.setExtraStackFrame(null)}var yn;yn=!1;function fr($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function hi(){{if(Et.current){var $=Q(Et.current.type);if($)return`
|
|
14
|
+
|
|
15
|
+
Check the render method of \``+$+"`."}return""}}function zc($){{if($!==void 0){var J=$.fileName.replace(/^.*[\\\/]/,""),ce=$.lineNumber;return`
|
|
16
|
+
|
|
17
|
+
Check your code at `+J+":"+ce+"."}return""}}var Ws={};function ll($){{var J=hi();if(!J){var ce=typeof $=="string"?$:$.displayName||$.name;ce&&(J=`
|
|
18
|
+
|
|
19
|
+
Check the top-level render call using <`+ce+">.")}return J}}function Us($,J){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var ce=ll(J);if(Ws[ce])return;Ws[ce]=!0;var Ce="";$&&$._owner&&$._owner!==Et.current&&(Ce=" It was passed a child from "+Q($._owner.type)+"."),Wt($),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ce,Ce),Wt(null)}}function qs($,J){{if(typeof $!="object")return;if(kt($))for(var ce=0;ce<$.length;ce++){var Ce=$[ce];fr(Ce)&&Us(Ce,J)}else if(fr($))$._store&&($._store.validated=!0);else if($){var je=x($);if(typeof je=="function"&&je!==$.entries)for(var He=je.call($),Ne;!(Ne=He.next()).done;)fr(Ne.value)&&Us(Ne.value,J)}}}function jc($){{var J=$.type;if(J==null||typeof J=="string")return;var ce;if(typeof J=="function")ce=J.propTypes;else if(typeof J=="object"&&(J.$$typeof===l||J.$$typeof===f))ce=J.propTypes;else return;if(ce){var Ce=Q(J);Ge(ce,$.props,"prop",Ce,$)}else if(J.PropTypes!==void 0&&!yn){yn=!0;var je=Q(J);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",je||"Unknown")}typeof J.getDefaultProps=="function"&&!J.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Gs($){{for(var J=Object.keys($.props),ce=0;ce<J.length;ce++){var Ce=J[ce];if(Ce!=="children"&&Ce!=="key"){Wt($),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ce),Wt(null);break}}$.ref!==null&&(Wt($),_("Invalid attribute `ref` supplied to `React.Fragment`."),Wt(null))}}function Ys($,J,ce,Ce,je,He){{var Ne=I($);if(!Ne){var Me="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(Me+=" 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 Ot=zc(je);Ot?Me+=Ot:Me+=hi();var nt;$===null?nt="null":kt($)?nt="array":$!==void 0&&$.$$typeof===t?(nt="<"+(Q($.type)||"Unknown")+" />",Me=" Did you accidentally export a JSX literal instead of a component?"):nt=typeof $,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",nt,Me)}var it=Ze($,J,ce,je,He);if(it==null)return it;if(Ne){var Ut=J.children;if(Ut!==void 0)if(Ce)if(kt(Ut)){for(var In=0;In<Ut.length;In++)qs(Ut[In],$);Object.freeze&&Object.freeze(Ut)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else qs(Ut,$)}return $===r?Gs(it):jc(it),it}}function Ks($,J,ce){return Ys($,J,ce,!0)}function Bc($,J,ce){return Ys($,J,ce,!1)}var Vc=Bc,Hc=Ks;iu.Fragment=r,iu.jsx=Vc,iu.jsxs=Hc}()),iu}var su={};/**
|
|
20
|
+
* @license React
|
|
21
|
+
* react-jsx-runtime.production.min.js
|
|
22
|
+
*
|
|
23
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the MIT license found in the
|
|
26
|
+
* LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/var yC;function A6(){if(yC)return su;yC=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},p=null,g=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(g=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:p,ref:g,props:f,_owner:o.current}}return su.Fragment=n,su.jsx=s,su.jsxs=s,su}process.env.NODE_ENV==="production"?p0.exports=A6():p0.exports=M6();var P=p0.exports;function sO(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=sO(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Pp(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=sO(e))&&(r&&(r+=" "),r+=t);return r}const I6=Object.freeze(Object.defineProperty({__proto__:null,clsx:Pp,default:Pp},Symbol.toStringTag,{value:"Module"})),ax="-";function N6(e){const t=F6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(ax);return a[0]===""&&a.length!==1&&a.shift(),aO(a,t)||L6(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function aO(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?aO(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(ax);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const xC=/^\[(.+)\]$/;function L6(e){if(xC.test(e)){const t=xC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function F6(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return j6(Object.entries(e.classGroups),n).forEach(([i,s])=>{g0(s,r,i,t)}),r}function g0(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:wC(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(z6(o)){g0(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{g0(s,wC(t,i),n,r)})})}function wC(e,t){let n=e;return t.split(ax).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function z6(e){return e.isThemeGetter}function j6(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function B6(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const lO="!";function V6(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let b=0;b<s.length;b++){let x=s[b];if(l===0){if(x===r&&(n||s.slice(b,b+o)===t)){a.push(s.slice(c,b)),c=b+o;continue}if(x==="/"){u=b;continue}}x==="["?l++:x==="]"&&l--}const f=a.length===0?s:s.substring(c),p=f.startsWith(lO),g=p?f.substring(1):f,v=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}}}function H6(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function W6(e){return{cache:B6(e.cacheSize),splitModifiers:V6(e),...N6(e)}}const U6=/\s+/;function q6(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(U6).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let f=r(u?c.substring(0,u):c),p=!!u;if(!f){if(!u)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};p=!1}const g=H6(a).join(":");return{isTailwindClass:!0,modifierId:l?g+lO:g,classGroupId:f,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(f=>i.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function G6(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=cO(t))&&(r&&(r+=" "),r+=n);return r}function cO(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=cO(e[r]))&&(n&&(n+=" "),n+=t);return n}function Y6(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,f)=>f(u),e());return n=W6(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=q6(l,n);return o(l,u),u}return function(){return i(G6.apply(null,arguments))}}function tn(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const uO=/^\[(?:([a-z-]+):)?(.+)\]$/i,K6=/^\d+\/\d+$/,X6=new Set(["px","full","screen"]),Q6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,J6=/\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$/,Z6=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,e9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function $o(e){return wa(e)||X6.has(e)||K6.test(e)}function os(e){return $c(e,"length",l9)}function wa(e){return!!e&&!Number.isNaN(Number(e))}function dh(e){return $c(e,"number",wa)}function au(e){return!!e&&Number.isInteger(Number(e))}function t9(e){return e.endsWith("%")&&wa(e.slice(0,-1))}function gt(e){return uO.test(e)}function is(e){return Q6.test(e)}const n9=new Set(["length","size","percentage"]);function r9(e){return $c(e,n9,dO)}function o9(e){return $c(e,"position",dO)}const i9=new Set(["image","url"]);function s9(e){return $c(e,i9,u9)}function a9(e){return $c(e,"",c9)}function lu(){return!0}function $c(e,t,n){const r=uO.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function l9(e){return J6.test(e)}function dO(){return!1}function c9(e){return Z6.test(e)}function u9(e){return e9.test(e)}function d9(){const e=tn("colors"),t=tn("spacing"),n=tn("blur"),r=tn("brightness"),o=tn("borderColor"),i=tn("borderRadius"),s=tn("borderSpacing"),a=tn("borderWidth"),l=tn("contrast"),c=tn("grayscale"),u=tn("hueRotate"),f=tn("invert"),p=tn("gap"),g=tn("gradientColorStops"),v=tn("gradientColorStopPositions"),b=tn("inset"),x=tn("margin"),w=tn("opacity"),_=tn("padding"),S=tn("saturate"),R=tn("scale"),E=tn("sepia"),O=tn("skew"),k=tn("space"),M=tn("translate"),D=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",gt,t],j=()=>[gt,t],Q=()=>["",$o,os],U=()=>["auto",wa,gt],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],q=()=>["start","end","center","between","around","evenly","stretch"],Z=()=>["","0",gt],T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[wa,dh],X=()=>[wa,gt];return{cacheSize:500,separator:":",theme:{colors:[lu],spacing:[$o,os],blur:["none","",is,gt],brightness:V(),borderColor:[e],borderRadius:["none","","full",is,gt],borderSpacing:j(),borderWidth:Q(),contrast:V(),grayscale:Z(),hueRotate:X(),invert:Z(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[t9,os],inset:z(),margin:z(),opacity:V(),padding:j(),saturate:V(),scale:V(),sepia:Z(),skew:X(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",gt]}],container:["container"],columns:[{columns:[is]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),gt]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],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",au,gt]}],basis:[{basis:z()}],"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:Z()}],shrink:[{shrink:Z()}],order:[{order:["first","last","none",au,gt]}],"grid-cols":[{"grid-cols":[lu]}],"col-start-end":[{col:["auto",{span:["full",au,gt]},gt]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[lu]}],"row-start-end":[{row:["auto",{span:[au,gt]},gt]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"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",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",gt,t]}],"min-w":[{"min-w":["min","max","fit",gt,$o]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[is]},is,gt]}],h:[{h:[gt,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",$o,gt]}],"max-h":[{"max-h":[gt,t,"min","max","fit"]}],"font-size":[{text:["base",is,os]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",dh]}],"font-family":[{font:[lu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",gt]}],"line-clamp":[{"line-clamp":["none",wa,dh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$o,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":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$o,os]}],"underline-offset":[{"underline-offset":["auto",$o,gt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:j()}],"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":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),o9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",r9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},s9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...K(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:K()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...K()]}],"outline-offset":[{"outline-offset":[$o,gt]}],"outline-w":[{outline:[$o,os]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[$o,os]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",is,a9]}],"shadow-color":[{shadow:[lu]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":H()}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",is,gt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",gt]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",gt]}],delay:[{delay:X()}],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:[au,gt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",gt]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",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":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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:[$o,os,dh]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const f9=Y6(d9);class h9 extends Error{}h9.prototype.name="InvalidTokenError";function Ee(...e){return f9(Pp(e))}async function p9(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 Kd(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(i=>{throw console.log(i.detail||"Unknown error occurred"),new Error((i==null?void 0:i.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function g9(e){var t;if(navigator.clipboard&&e.current)navigator.clipboard.writeText(e.current.innerText).then(()=>console.log("Content copied to clipboard")).catch(n=>console.error("Failed to copy: ",n));else{const n=document.createElement("textarea");n.value=((t=e==null?void 0:e.current)==null?void 0:t.innerText)??"",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),console.log("Content copied to clipboard")}}function fO(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>m9(i,t))}function m9(e,t){const n=t==null?void 0:t.find(r=>r.name===e);return n?`(${n.sql}) as ${n.name}`:(console.log(e),`'${e}_table'`)}function v9(e){return e.charAt(0).toUpperCase()+e.slice(1)}const fp="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";var b9={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const _C=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const f=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(p=>p(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(b9?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,a),a},y9=e=>e?_C(e):_C;var m0={exports:{}},Lv={},fh={exports:{}},Fv={};/**
|
|
28
|
+
* @license React
|
|
29
|
+
* use-sync-external-store-shim.development.js
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/var SC;function x9(){return SC||(SC=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var R=arguments.length,E=new Array(R>1?R-1:0),O=1;O<R;O++)E[O-1]=arguments[O];r("error",S,E)}}function r(S,R,E){{var O=t.ReactDebugCurrentFrame,k=O.getStackAddendum();k!==""&&(R+="%s",E=E.concat([k]));var M=E.map(function(D){return String(D)});M.unshift("Warning: "+R),Function.prototype.apply.call(console[S],console,M)}}function o(S,R){return S===R&&(S!==0||1/S===1/R)||S!==S&&R!==R}var i=typeof Object.is=="function"?Object.is:o,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,u=!1,f=!1;function p(S,R,E){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var O=R();if(!f){var k=R();i(O,k)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var M=s({inst:{value:O,getSnapshot:R}}),D=M[0].inst,I=M[1];return l(function(){D.value=O,D.getSnapshot=R,g(D)&&I({inst:D})},[S,O,R]),a(function(){g(D)&&I({inst:D});var z=function(){g(D)&&I({inst:D})};return S(z)},[S]),c(O),O}function g(S){var R=S.getSnapshot,E=S.value;try{var O=R();return!i(E,O)}catch{return!0}}function v(S,R,E){return R()}var b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!b,w=x?v:p,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;Fv.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Fv}var zv={};/**
|
|
36
|
+
* @license React
|
|
37
|
+
* use-sync-external-store-shim.production.min.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/var CC;function w9(){if(CC)return zv;CC=1;var e=m;function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(f,p){var g=p(),v=r({inst:{value:g,getSnapshot:p}}),b=v[0].inst,x=v[1];return i(function(){b.value=g,b.getSnapshot=p,l(b)&&x({inst:b})},[f,g,p]),o(function(){return l(b)&&x({inst:b}),f(function(){l(b)&&x({inst:b})})},[f]),s(g),g}function l(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!n(f,g)}catch{return!0}}function c(f,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return zv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,zv}var EC;function lx(){return EC||(EC=1,process.env.NODE_ENV==="production"?fh.exports=w9():fh.exports=x9()),fh.exports}/**
|
|
44
|
+
* @license React
|
|
45
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the MIT license found in the
|
|
50
|
+
* LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/var RC;function _9(){return RC||(RC=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=lx();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,f,p,g,v){var b=i(null),x;b.current===null?(x={hasValue:!1,value:null},b.current=x):x=b.current;var w=a(function(){var E=!1,O,k,M=function(j){if(!E){E=!0,O=j;var Q=g(j);if(v!==void 0&&x.hasValue){var U=x.value;if(v(U,Q))return k=U,U}return k=Q,Q}var B=O,K=k;if(r(B,j))return K;var H=g(j);return v!==void 0&&v(K,H)?K:(O=j,k=H,H)},D=p===void 0?null:p,I=function(){return M(f())},z=D===null?void 0:function(){return M(D())};return[I,z]},[f,p,g,v]),_=w[0],S=w[1],R=o(u,_,S);return s(function(){x.hasValue=!0,x.value=R},[R]),l(R),R}Lv.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Lv}var jv={};/**
|
|
52
|
+
* @license React
|
|
53
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
54
|
+
*
|
|
55
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the MIT license found in the
|
|
58
|
+
* LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/var PC;function S9(){if(PC)return jv;PC=1;var e=m,t=lx();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 jv.useSyncExternalStoreWithSelector=function(c,u,f,p,g){var v=i(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=a(function(){function w(O){if(!_){if(_=!0,S=O,O=p(O),g!==void 0&&b.hasValue){var k=b.value;if(g(k,O))return R=k}return R=O}if(k=R,r(S,O))return k;var M=p(O);return g!==void 0&&g(k,M)?k:(S=O,R=M)}var _=!1,S,R,E=f===void 0?null:f;return[function(){return w(u())},E===null?void 0:function(){return w(E())}]},[u,f,p,g]);var x=o(c,v[0],v[1]);return s(function(){b.hasValue=!0,b.value=x},[x]),l(x),x},jv}process.env.NODE_ENV==="production"?m0.exports=S9():m0.exports=_9();var C9=m0.exports;const E9=Oc(C9);var hO={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:R9}=m,{useSyncExternalStoreWithSelector:P9}=E9;let OC=!1;function O9(e,t=e.getState,n){(hO?"production":void 0)!=="production"&&n&&!OC&&(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"),OC=!0);const r=P9(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return R9(r),r}const $C=e=>{(hO?"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"?y9(e):e,n=(r,o)=>O9(t,r,o);return Object.assign(n,t),n},pO=e=>e?$C(e):$C;var gO=Symbol.for("immer-nothing"),DC=Symbol.for("immer-draftable"),eo=Symbol.for("immer-state"),$9=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 Er(e,...t){if(process.env.NODE_ENV!=="production"){const n=$9[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 dc=Object.getPrototypeOf;function fc(e){return!!e&&!!e[eo]}function ja(e){var t;return e?mO(e)||Array.isArray(e)||!!e[DC]||!!((t=e.constructor)!=null&&t[DC])||mg(e)||vg(e):!1}var D9=Object.prototype.constructor.toString();function mO(e){if(!e||typeof e!="object")return!1;const t=dc(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)===D9}function Gu(e,t){gg(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function gg(e){const t=e[eo];return t?t.type_:Array.isArray(e)?1:mg(e)?2:vg(e)?3:0}function v0(e,t){return gg(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vO(e,t,n){const r=gg(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function T9(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function mg(e){return e instanceof Map}function vg(e){return e instanceof Set}function pa(e){return e.copy_||e.base_}function b0(e,t){if(mg(e))return new Map(e);if(vg(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&mO(e))return dc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[eo];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(dc(e),n)}function cx(e,t=!1){return bg(e)||fc(e)||!ja(e)||(gg(e)>1&&(e.set=e.add=e.clear=e.delete=k9),Object.freeze(e),t&&Gu(e,(n,r)=>cx(r,!0))),e}function k9(){Er(2)}function bg(e){return Object.isFrozen(e)}var M9={};function Ba(e){const t=M9[e];return t||Er(0,e),t}var Yu;function bO(){return Yu}function A9(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function TC(e,t){t&&(Ba("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function y0(e){x0(e),e.drafts_.forEach(I9),e.drafts_=null}function x0(e){e===Yu&&(Yu=e.parent_)}function kC(e){return Yu=A9(Yu,e)}function I9(e){const t=e[eo];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function MC(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[eo].modified_&&(y0(t),Er(4)),ja(e)&&(e=Op(t,e),t.parent_||$p(t,e)),t.patches_&&Ba("Patches").generateReplacementPatches_(n[eo].base_,e,t.patches_,t.inversePatches_)):e=Op(t,n,[]),y0(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gO?e:void 0}function Op(e,t,n){if(bg(t))return t;const r=t[eo];if(!r)return Gu(t,(o,i)=>AC(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return $p(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),Gu(i,(a,l)=>AC(e,r,o,a,l,n,s)),$p(e,o,!1),n&&e.patches_&&Ba("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function AC(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Er(5),fc(o)){const a=i&&t&&t.type_!==3&&!v0(t.assigned_,r)?i.concat(r):void 0,l=Op(e,o,a);if(vO(n,r,l),fc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(ja(o)&&!bg(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Op(e,o),(!t||!t.scope_.parent_)&&$p(e,o)}}function $p(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&cx(t,n)}function N9(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:bO(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=ux;n&&(o=[r],i=Ku);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var ux={get(e,t){if(t===eo)return e;const n=pa(e);if(!v0(n,t))return L9(e,n,t);const r=n[t];return e.finalized_||!ja(r)?r:r===Bv(e.base_,t)?(Vv(e),e.copy_[t]=_0(r,e)):r},has(e,t){return t in pa(e)},ownKeys(e){return Reflect.ownKeys(pa(e))},set(e,t,n){const r=yO(pa(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Bv(pa(e),t),i=o==null?void 0:o[eo];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(T9(n,o)&&(n!==void 0||v0(e.base_,t)))return!0;Vv(e),w0(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 Bv(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Vv(e),w0(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=pa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Er(11)},getPrototypeOf(e){return dc(e.base_)},setPrototypeOf(){Er(12)}},Ku={};Gu(ux,(e,t)=>{Ku[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ku.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Er(13),Ku.set.call(this,e,t,void 0)};Ku.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Er(14),ux.set.call(this,e[0],t,n,e[0])};function Bv(e,t){const n=e[eo];return(n?pa(n):e)[t]}function L9(e,t,n){var o;const r=yO(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function yO(e,t){if(!(t in e))return;let n=dc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=dc(n)}}function w0(e){e.modified_||(e.modified_=!0,e.parent_&&w0(e.parent_))}function Vv(e){e.copy_||(e.copy_=b0(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var F9=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"&&Er(6),r!==void 0&&typeof r!="function"&&Er(7);let o;if(ja(t)){const i=kC(this),s=_0(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?y0(i):x0(i)}return TC(i,r),MC(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===gO&&(o=void 0),this.autoFreeze_&&cx(o,!0),r){const i=[],s=[];Ba("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Er(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){ja(e)||Er(8),fc(e)&&(e=z9(e));const t=kC(this),n=_0(e,void 0);return n[eo].isManual_=!0,x0(t),n}finishDraft(e,t){const n=e&&e[eo];(!n||!n.isManual_)&&Er(9);const{scope_:r}=n;return TC(r,t),MC(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=Ba("Patches").applyPatches_;return fc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function _0(e,t){const n=mg(e)?Ba("MapSet").proxyMap_(e,t):vg(e)?Ba("MapSet").proxySet_(e,t):N9(e,t);return(t?t.scope_:bO()).drafts_.push(n),n}function z9(e){return fc(e)||Er(10,e),xO(e)}function xO(e){if(!ja(e)||bg(e))return e;const t=e[eo];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=b0(e,t.scope_.immer_.useStrictShallowCopy_)}else n=b0(e,!0);return Gu(n,(r,o)=>{vO(n,r,xO(o))}),t&&(t.finalized_=!1),n}var to=new F9,j9=to.produce;to.produceWithPatches.bind(to);to.setAutoFreeze.bind(to);to.setUseStrictShallowCopy.bind(to);to.applyPatches.bind(to);to.createDraft.bind(to);to.finishDraft.bind(to);const B9=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?j9(o):o;return t(a,i,...s)},e(r.setState,n,r)),wO=B9;var S0,hh=Fo;if(process.env.NODE_ENV==="production")S0=hh.createRoot,hh.hydrateRoot;else{var IC=hh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;S0=function(e,t){IC.usingClientEntryPoint=!0;try{return hh.createRoot(e,t)}finally{IC.usingClientEntryPoint=!1}}}var _O={},SO={},dx={exports:{}},nn=String,CO=function(){return{isColorSupported:!1,reset:nn,bold:nn,dim:nn,italic:nn,underline:nn,inverse:nn,hidden:nn,strikethrough:nn,black:nn,red:nn,green:nn,yellow:nn,blue:nn,magenta:nn,cyan:nn,white:nn,gray:nn,bgBlack:nn,bgRed:nn,bgGreen:nn,bgYellow:nn,bgBlue:nn,bgMagenta:nn,bgCyan:nn,bgWhite:nn}};dx.exports=CO();dx.exports.createColors=CO;var V9=dx.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(V9);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(f=>console.warn(l,"-",f)))}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])}}})(SO);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(SO);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}}})(_O);let Hv=_O;var H9=(Hv.__esModule?Hv:{default:Hv}).default;const zt=Oc(H9),EO=`import pandas as pd
|
|
60
|
+
df = pd.DataFrame(data) # 'data' contains the query result
|
|
61
|
+
result = df.to_dict('records') # must return 'result' as [dict] type
|
|
62
|
+
`,C0=[{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"}],W9=[{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)"}]}],RO=["lg","md","sm","xs","xxs"],E0={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[zt.blue[500],zt.teal[500],zt.amber[500],zt.red[500],zt.indigo[500],zt.green[500]],borderColor:[zt.blue[500],zt.teal[500],zt.amber[500],zt.red[500],zt.indigo[500],zt.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:NC},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:[zt.blue[500],zt.teal[500],zt.amber[500],zt.red[500],zt.indigo[500],zt.green[500]],borderColor:[zt.blue[500],zt.teal[500],zt.amber[500],zt.red[500],zt.indigo[500],zt.green[500]],datalables:{color:NC}},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:zt.slate[800]}},y:{grid:{display:!0,color:zt.slate[800]}}}}}}};function NC(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=Xu()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Xu()),Qu(n)}function Xu(){return Te.getState().theme==="dark"?"#000000":"#FFFFFF"}function Qu(e){let t=0,n=0,r=0,o=0;const i=u=>{const f=u.replace("#",""),p=parseInt(f.substring(0,2),16),g=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=p,n+=g,r+=v,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 yg=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],hc=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],Xd=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],fx=["boolean"];function hx(e){return e.match(/[A-Z]/)?`"${e}"`:e}function U9(e,t,n){const{measures:r,dimensions:o}=e,i=r==null?void 0:r.map(c=>`${c.calc}(${c.name}) as ${c.calc}_${c.name.replace(/"/g,"")}`).join(", "),s=(o==null?void 0:o.join(", "))||"";let a="";const l=PO(t,n);if(i&&s)return a=`SELECT ${s}, COUNT(*), ${i} FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(!i&&s)return a=`SELECT ${s}, COUNT(*) FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(i&&!s)return a=`SELECT ${i} FROM ${l}`,a}function q9(e,t,n="AVG"){var i,s,a,l;let r={};const o=hx(e.column_name);return yg.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),hc.includes(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function Dp(e){return yg.includes(e.dataType)?"string":hc.includes(e.dataType)?"number":Xd.includes(e.dataType)?"date":fx.includes(e.dataType)?"boolean":"string"}function G9(e){let t;const n=e.data_type.toLowerCase();return yg.includes(n)?t="T":hc.includes(n)?t="#":Xd.includes(n)?t="D":fx.includes(n)?t="B":t="?",t}function Y9(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 PO(e,t){return t==="api"||e===hx("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const K9=e=>{const t=new Date(e);return!isNaN(t.getTime())},X9=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Ju=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?K9(e)?t="date":X9(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function Q9({get:e,dataPoint:t,card:n}){var p;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,f={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:Ju(u),operation:"=",values:[u]};if(l!=null&&l.find(g=>g.id===n.id)){const g=n.id;if(u==null){a(n),i(g);return}else s(f)}o(n),r(f)}var Tp={exports:{}};/**
|
|
63
|
+
* @license
|
|
64
|
+
* Lodash <https://lodash.com/>
|
|
65
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
66
|
+
* Released under MIT license <https://lodash.com/license>
|
|
67
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
68
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
69
|
+
*/Tp.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__",f=1,p=2,g=4,v=1,b=2,x=1,w=2,_=4,S=8,R=16,E=32,O=64,k=128,M=256,D=512,I=30,z="...",j=800,Q=16,U=1,B=2,K=3,H=1/0,q=9007199254740991,Z=17976931348623157e292,T=NaN,V=4294967295,X=V-1,N=V>>>1,se=[["ary",k],["bind",x],["bindKey",w],["curry",S],["curryRight",R],["flip",D],["partial",E],["partialRight",O],["rearg",M]],ae="[object Arguments]",ue="[object Array]",fe="[object AsyncFunction]",oe="[object Boolean]",ee="[object Date]",ie="[object DOMException]",be="[object Error]",G="[object Function]",me="[object GeneratorFunction]",_e="[object Map]",Pe="[object Number]",$e="[object Null]",Ve="[object Object]",Fe="[object Promise]",ke="[object Proxy]",Ge="[object RegExp]",ct="[object Set]",kt="[object String]",Dt="[object Symbol]",cn="[object Undefined]",de="[object WeakMap]",Se="[object WeakSet]",Ie="[object ArrayBuffer]",qe="[object DataView]",Je="[object Float32Array]",Gt="[object Float64Array]",Jt="[object Int8Array]",un="[object Int16Array]",Pn="[object Int32Array]",or="[object Uint8Array]",Zt="[object Uint8ClampedArray]",hn="[object Uint16Array]",On="[object Uint32Array]",Ze=/\b__p \+= '';/g,Et=/\b(__p \+=) '' \+/g,Pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wt=/&(?:amp|lt|gt|quot|#39);/g,yn=/[&<>"']/g,fr=RegExp(Wt.source),hi=RegExp(yn.source),zc=/<%-([\s\S]+?)%>/g,Ws=/<%([\s\S]+?)%>/g,ll=/<%=([\s\S]+?)%>/g,Us=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qs=/^\w*$/,jc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gs=/[\\^$.*+?()[\]{}|]/g,Ys=RegExp(Gs.source),Ks=/^\s+/,Bc=/\s/,Vc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Hc=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,Ce=/\\(\\)?/g,je=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,He=/\w*$/,Ne=/^[-+]0x[0-9a-f]+$/i,Me=/^0b[01]+$/i,Ot=/^\[object .+?Constructor\]$/,nt=/^0o[0-7]+$/i,it=/^(?:0|[1-9]\d*)$/,Ut=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,In=/($^)/,Xs=/['\n\r\u2028\u2029\\]/g,dn="\\ud800-\\udfff",S5="\\u0300-\\u036f",C5="\\ufe20-\\ufe2f",E5="\\u20d0-\\u20ff",G1=S5+C5+E5,Y1="\\u2700-\\u27bf",K1="a-z\\xdf-\\xf6\\xf8-\\xff",R5="\\xac\\xb1\\xd7\\xf7",P5="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",O5="\\u2000-\\u206f",$5=" \\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",X1="A-Z\\xc0-\\xd6\\xd8-\\xde",Q1="\\ufe0e\\ufe0f",J1=R5+P5+O5+$5,Rm="['’]",D5="["+dn+"]",Z1="["+J1+"]",Cf="["+G1+"]",e_="\\d+",T5="["+Y1+"]",t_="["+K1+"]",n_="[^"+dn+J1+e_+Y1+K1+X1+"]",Pm="\\ud83c[\\udffb-\\udfff]",k5="(?:"+Cf+"|"+Pm+")",r_="[^"+dn+"]",Om="(?:\\ud83c[\\udde6-\\uddff]){2}",$m="[\\ud800-\\udbff][\\udc00-\\udfff]",cl="["+X1+"]",o_="\\u200d",i_="(?:"+t_+"|"+n_+")",M5="(?:"+cl+"|"+n_+")",s_="(?:"+Rm+"(?:d|ll|m|re|s|t|ve))?",a_="(?:"+Rm+"(?:D|LL|M|RE|S|T|VE))?",l_=k5+"?",c_="["+Q1+"]?",A5="(?:"+o_+"(?:"+[r_,Om,$m].join("|")+")"+c_+l_+")*",I5="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",N5="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",u_=c_+l_+A5,L5="(?:"+[T5,Om,$m].join("|")+")"+u_,F5="(?:"+[r_+Cf+"?",Cf,Om,$m,D5].join("|")+")",z5=RegExp(Rm,"g"),j5=RegExp(Cf,"g"),Dm=RegExp(Pm+"(?="+Pm+")|"+F5+u_,"g"),B5=RegExp([cl+"?"+t_+"+"+s_+"(?="+[Z1,cl,"$"].join("|")+")",M5+"+"+a_+"(?="+[Z1,cl+i_,"$"].join("|")+")",cl+"?"+i_+"+"+s_,cl+"+"+a_,N5,I5,e_,L5].join("|"),"g"),V5=RegExp("["+o_+dn+G1+Q1+"]"),H5=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,W5=["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"],U5=-1,en={};en[Je]=en[Gt]=en[Jt]=en[un]=en[Pn]=en[or]=en[Zt]=en[hn]=en[On]=!0,en[ae]=en[ue]=en[Ie]=en[oe]=en[qe]=en[ee]=en[be]=en[G]=en[_e]=en[Pe]=en[Ve]=en[Ge]=en[ct]=en[kt]=en[de]=!1;var Yt={};Yt[ae]=Yt[ue]=Yt[Ie]=Yt[qe]=Yt[oe]=Yt[ee]=Yt[Je]=Yt[Gt]=Yt[Jt]=Yt[un]=Yt[Pn]=Yt[_e]=Yt[Pe]=Yt[Ve]=Yt[Ge]=Yt[ct]=Yt[kt]=Yt[Dt]=Yt[or]=Yt[Zt]=Yt[hn]=Yt[On]=!0,Yt[be]=Yt[G]=Yt[de]=!1;var q5={À:"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"},G5={"&":"&","<":"<",">":">",'"':""","'":"'"},Y5={"&":"&","<":"<",">":">",""":'"',"'":"'"},K5={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},X5=parseFloat,Q5=parseInt,d_=typeof ms=="object"&&ms&&ms.Object===Object&&ms,J5=typeof self=="object"&&self&&self.Object===Object&&self,Vn=d_||J5||Function("return this")(),Tm=t&&!t.nodeType&&t,Qs=Tm&&!0&&e&&!e.nodeType&&e,f_=Qs&&Qs.exports===Tm,km=f_&&d_.process,io=function(){try{var te=Qs&&Qs.require&&Qs.require("util").types;return te||km&&km.binding&&km.binding("util")}catch{}}(),h_=io&&io.isArrayBuffer,p_=io&&io.isDate,g_=io&&io.isMap,m_=io&&io.isRegExp,v_=io&&io.isSet,b_=io&&io.isTypedArray;function kr(te,ge,he){switch(he.length){case 0:return te.call(ge);case 1:return te.call(ge,he[0]);case 2:return te.call(ge,he[0],he[1]);case 3:return te.call(ge,he[0],he[1],he[2])}return te.apply(ge,he)}function Z5(te,ge,he,ze){for(var ot=-1,Mt=te==null?0:te.length;++ot<Mt;){var $n=te[ot];ge(ze,$n,he($n),te)}return ze}function so(te,ge){for(var he=-1,ze=te==null?0:te.length;++he<ze&&ge(te[he],he,te)!==!1;);return te}function eN(te,ge){for(var he=te==null?0:te.length;he--&&ge(te[he],he,te)!==!1;);return te}function y_(te,ge){for(var he=-1,ze=te==null?0:te.length;++he<ze;)if(!ge(te[he],he,te))return!1;return!0}function Ki(te,ge){for(var he=-1,ze=te==null?0:te.length,ot=0,Mt=[];++he<ze;){var $n=te[he];ge($n,he,te)&&(Mt[ot++]=$n)}return Mt}function Ef(te,ge){var he=te==null?0:te.length;return!!he&&ul(te,ge,0)>-1}function Mm(te,ge,he){for(var ze=-1,ot=te==null?0:te.length;++ze<ot;)if(he(ge,te[ze]))return!0;return!1}function fn(te,ge){for(var he=-1,ze=te==null?0:te.length,ot=Array(ze);++he<ze;)ot[he]=ge(te[he],he,te);return ot}function Xi(te,ge){for(var he=-1,ze=ge.length,ot=te.length;++he<ze;)te[ot+he]=ge[he];return te}function Am(te,ge,he,ze){var ot=-1,Mt=te==null?0:te.length;for(ze&&Mt&&(he=te[++ot]);++ot<Mt;)he=ge(he,te[ot],ot,te);return he}function tN(te,ge,he,ze){var ot=te==null?0:te.length;for(ze&&ot&&(he=te[--ot]);ot--;)he=ge(he,te[ot],ot,te);return he}function Im(te,ge){for(var he=-1,ze=te==null?0:te.length;++he<ze;)if(ge(te[he],he,te))return!0;return!1}var nN=Nm("length");function rN(te){return te.split("")}function oN(te){return te.match(J)||[]}function x_(te,ge,he){var ze;return he(te,function(ot,Mt,$n){if(ge(ot,Mt,$n))return ze=Mt,!1}),ze}function Rf(te,ge,he,ze){for(var ot=te.length,Mt=he+(ze?1:-1);ze?Mt--:++Mt<ot;)if(ge(te[Mt],Mt,te))return Mt;return-1}function ul(te,ge,he){return ge===ge?mN(te,ge,he):Rf(te,w_,he)}function iN(te,ge,he,ze){for(var ot=he-1,Mt=te.length;++ot<Mt;)if(ze(te[ot],ge))return ot;return-1}function w_(te){return te!==te}function __(te,ge){var he=te==null?0:te.length;return he?Fm(te,ge)/he:T}function Nm(te){return function(ge){return ge==null?n:ge[te]}}function Lm(te){return function(ge){return te==null?n:te[ge]}}function S_(te,ge,he,ze,ot){return ot(te,function(Mt,$n,qt){he=ze?(ze=!1,Mt):ge(he,Mt,$n,qt)}),he}function sN(te,ge){var he=te.length;for(te.sort(ge);he--;)te[he]=te[he].value;return te}function Fm(te,ge){for(var he,ze=-1,ot=te.length;++ze<ot;){var Mt=ge(te[ze]);Mt!==n&&(he=he===n?Mt:he+Mt)}return he}function zm(te,ge){for(var he=-1,ze=Array(te);++he<te;)ze[he]=ge(he);return ze}function aN(te,ge){return fn(ge,function(he){return[he,te[he]]})}function C_(te){return te&&te.slice(0,O_(te)+1).replace(Ks,"")}function Mr(te){return function(ge){return te(ge)}}function jm(te,ge){return fn(ge,function(he){return te[he]})}function Wc(te,ge){return te.has(ge)}function E_(te,ge){for(var he=-1,ze=te.length;++he<ze&&ul(ge,te[he],0)>-1;);return he}function R_(te,ge){for(var he=te.length;he--&&ul(ge,te[he],0)>-1;);return he}function lN(te,ge){for(var he=te.length,ze=0;he--;)te[he]===ge&&++ze;return ze}var cN=Lm(q5),uN=Lm(G5);function dN(te){return"\\"+K5[te]}function fN(te,ge){return te==null?n:te[ge]}function dl(te){return V5.test(te)}function hN(te){return H5.test(te)}function pN(te){for(var ge,he=[];!(ge=te.next()).done;)he.push(ge.value);return he}function Bm(te){var ge=-1,he=Array(te.size);return te.forEach(function(ze,ot){he[++ge]=[ot,ze]}),he}function P_(te,ge){return function(he){return te(ge(he))}}function Qi(te,ge){for(var he=-1,ze=te.length,ot=0,Mt=[];++he<ze;){var $n=te[he];($n===ge||$n===u)&&(te[he]=u,Mt[ot++]=he)}return Mt}function Pf(te){var ge=-1,he=Array(te.size);return te.forEach(function(ze){he[++ge]=ze}),he}function gN(te){var ge=-1,he=Array(te.size);return te.forEach(function(ze){he[++ge]=[ze,ze]}),he}function mN(te,ge,he){for(var ze=he-1,ot=te.length;++ze<ot;)if(te[ze]===ge)return ze;return-1}function vN(te,ge,he){for(var ze=he+1;ze--;)if(te[ze]===ge)return ze;return ze}function fl(te){return dl(te)?yN(te):nN(te)}function Eo(te){return dl(te)?xN(te):rN(te)}function O_(te){for(var ge=te.length;ge--&&Bc.test(te.charAt(ge)););return ge}var bN=Lm(Y5);function yN(te){for(var ge=Dm.lastIndex=0;Dm.test(te);)++ge;return ge}function xN(te){return te.match(Dm)||[]}function wN(te){return te.match(B5)||[]}var _N=function te(ge){ge=ge==null?Vn:hl.defaults(Vn.Object(),ge,hl.pick(Vn,W5));var he=ge.Array,ze=ge.Date,ot=ge.Error,Mt=ge.Function,$n=ge.Math,qt=ge.Object,Vm=ge.RegExp,SN=ge.String,ao=ge.TypeError,Of=he.prototype,CN=Mt.prototype,pl=qt.prototype,$f=ge["__core-js_shared__"],Df=CN.toString,Bt=pl.hasOwnProperty,EN=0,$_=function(){var d=/[^.]+$/.exec($f&&$f.keys&&$f.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),Tf=pl.toString,RN=Df.call(qt),PN=Vn._,ON=Vm("^"+Df.call(Bt).replace(Gs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kf=f_?ge.Buffer:n,Ji=ge.Symbol,Mf=ge.Uint8Array,D_=kf?kf.allocUnsafe:n,Af=P_(qt.getPrototypeOf,qt),T_=qt.create,k_=pl.propertyIsEnumerable,If=Of.splice,M_=Ji?Ji.isConcatSpreadable:n,Uc=Ji?Ji.iterator:n,Js=Ji?Ji.toStringTag:n,Nf=function(){try{var d=ra(qt,"defineProperty");return d({},"",{}),d}catch{}}(),$N=ge.clearTimeout!==Vn.clearTimeout&&ge.clearTimeout,DN=ze&&ze.now!==Vn.Date.now&&ze.now,TN=ge.setTimeout!==Vn.setTimeout&&ge.setTimeout,Lf=$n.ceil,Ff=$n.floor,Hm=qt.getOwnPropertySymbols,kN=kf?kf.isBuffer:n,A_=ge.isFinite,MN=Of.join,AN=P_(qt.keys,qt),Dn=$n.max,Kn=$n.min,IN=ze.now,NN=ge.parseInt,I_=$n.random,LN=Of.reverse,Wm=ra(ge,"DataView"),qc=ra(ge,"Map"),Um=ra(ge,"Promise"),gl=ra(ge,"Set"),Gc=ra(ge,"WeakMap"),Yc=ra(qt,"create"),zf=Gc&&new Gc,ml={},FN=oa(Wm),zN=oa(qc),jN=oa(Um),BN=oa(gl),VN=oa(Gc),jf=Ji?Ji.prototype:n,Kc=jf?jf.valueOf:n,N_=jf?jf.toString:n;function L(d){if(mn(d)&&!st(d)&&!(d instanceof Ct)){if(d instanceof lo)return d;if(Bt.call(d,"__wrapped__"))return LS(d)}return new lo(d)}var vl=function(){function d(){}return function(h){if(!pn(h))return{};if(T_)return T_(h);d.prototype=h;var y=new d;return d.prototype=n,y}}();function Bf(){}function lo(d,h){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}L.templateSettings={escape:zc,evaluate:Ws,interpolate:ll,variable:"",imports:{_:L}},L.prototype=Bf.prototype,L.prototype.constructor=L,lo.prototype=vl(Bf.prototype),lo.prototype.constructor=lo;function Ct(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=V,this.__views__=[]}function HN(){var d=new Ct(this.__wrapped__);return d.__actions__=hr(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=hr(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=hr(this.__views__),d}function WN(){if(this.__filtered__){var d=new Ct(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function UN(){var d=this.__wrapped__.value(),h=this.__dir__,y=st(d),C=h<0,A=y?d.length:0,F=r7(0,A,this.__views__),W=F.start,Y=F.end,re=Y-W,ve=C?Y:W-1,ye=this.__iteratees__,we=ye.length,Ae=0,Be=Kn(re,this.__takeCount__);if(!y||!C&&A==re&&Be==re)return sS(d,this.__actions__);var Ke=[];e:for(;re--&&Ae<Be;){ve+=h;for(var pt=-1,Xe=d[ve];++pt<we;){var _t=ye[pt],Rt=_t.iteratee,Nr=_t.type,ar=Rt(Xe);if(Nr==B)Xe=ar;else if(!ar){if(Nr==U)continue e;break e}}Ke[Ae++]=Xe}return Ke}Ct.prototype=vl(Bf.prototype),Ct.prototype.constructor=Ct;function Zs(d){var h=-1,y=d==null?0:d.length;for(this.clear();++h<y;){var C=d[h];this.set(C[0],C[1])}}function qN(){this.__data__=Yc?Yc(null):{},this.size=0}function GN(d){var h=this.has(d)&&delete this.__data__[d];return this.size-=h?1:0,h}function YN(d){var h=this.__data__;if(Yc){var y=h[d];return y===l?n:y}return Bt.call(h,d)?h[d]:n}function KN(d){var h=this.__data__;return Yc?h[d]!==n:Bt.call(h,d)}function XN(d,h){var y=this.__data__;return this.size+=this.has(d)?0:1,y[d]=Yc&&h===n?l:h,this}Zs.prototype.clear=qN,Zs.prototype.delete=GN,Zs.prototype.get=YN,Zs.prototype.has=KN,Zs.prototype.set=XN;function pi(d){var h=-1,y=d==null?0:d.length;for(this.clear();++h<y;){var C=d[h];this.set(C[0],C[1])}}function QN(){this.__data__=[],this.size=0}function JN(d){var h=this.__data__,y=Vf(h,d);if(y<0)return!1;var C=h.length-1;return y==C?h.pop():If.call(h,y,1),--this.size,!0}function ZN(d){var h=this.__data__,y=Vf(h,d);return y<0?n:h[y][1]}function e3(d){return Vf(this.__data__,d)>-1}function t3(d,h){var y=this.__data__,C=Vf(y,d);return C<0?(++this.size,y.push([d,h])):y[C][1]=h,this}pi.prototype.clear=QN,pi.prototype.delete=JN,pi.prototype.get=ZN,pi.prototype.has=e3,pi.prototype.set=t3;function gi(d){var h=-1,y=d==null?0:d.length;for(this.clear();++h<y;){var C=d[h];this.set(C[0],C[1])}}function n3(){this.size=0,this.__data__={hash:new Zs,map:new(qc||pi),string:new Zs}}function r3(d){var h=eh(this,d).delete(d);return this.size-=h?1:0,h}function o3(d){return eh(this,d).get(d)}function i3(d){return eh(this,d).has(d)}function s3(d,h){var y=eh(this,d),C=y.size;return y.set(d,h),this.size+=y.size==C?0:1,this}gi.prototype.clear=n3,gi.prototype.delete=r3,gi.prototype.get=o3,gi.prototype.has=i3,gi.prototype.set=s3;function ea(d){var h=-1,y=d==null?0:d.length;for(this.__data__=new gi;++h<y;)this.add(d[h])}function a3(d){return this.__data__.set(d,l),this}function l3(d){return this.__data__.has(d)}ea.prototype.add=ea.prototype.push=a3,ea.prototype.has=l3;function Ro(d){var h=this.__data__=new pi(d);this.size=h.size}function c3(){this.__data__=new pi,this.size=0}function u3(d){var h=this.__data__,y=h.delete(d);return this.size=h.size,y}function d3(d){return this.__data__.get(d)}function f3(d){return this.__data__.has(d)}function h3(d,h){var y=this.__data__;if(y instanceof pi){var C=y.__data__;if(!qc||C.length<o-1)return C.push([d,h]),this.size=++y.size,this;y=this.__data__=new gi(C)}return y.set(d,h),this.size=y.size,this}Ro.prototype.clear=c3,Ro.prototype.delete=u3,Ro.prototype.get=d3,Ro.prototype.has=f3,Ro.prototype.set=h3;function L_(d,h){var y=st(d),C=!y&&ia(d),A=!y&&!C&&rs(d),F=!y&&!C&&!A&&wl(d),W=y||C||A||F,Y=W?zm(d.length,SN):[],re=Y.length;for(var ve in d)(h||Bt.call(d,ve))&&!(W&&(ve=="length"||A&&(ve=="offset"||ve=="parent")||F&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||yi(ve,re)))&&Y.push(ve);return Y}function F_(d){var h=d.length;return h?d[nv(0,h-1)]:n}function p3(d,h){return th(hr(d),ta(h,0,d.length))}function g3(d){return th(hr(d))}function qm(d,h,y){(y!==n&&!Po(d[h],y)||y===n&&!(h in d))&&mi(d,h,y)}function Xc(d,h,y){var C=d[h];(!(Bt.call(d,h)&&Po(C,y))||y===n&&!(h in d))&&mi(d,h,y)}function Vf(d,h){for(var y=d.length;y--;)if(Po(d[y][0],h))return y;return-1}function m3(d,h,y,C){return Zi(d,function(A,F,W){h(C,A,y(A),W)}),C}function z_(d,h){return d&&Bo(h,Nn(h),d)}function v3(d,h){return d&&Bo(h,gr(h),d)}function mi(d,h,y){h=="__proto__"&&Nf?Nf(d,h,{configurable:!0,enumerable:!0,value:y,writable:!0}):d[h]=y}function Gm(d,h){for(var y=-1,C=h.length,A=he(C),F=d==null;++y<C;)A[y]=F?n:Pv(d,h[y]);return A}function ta(d,h,y){return d===d&&(y!==n&&(d=d<=y?d:y),h!==n&&(d=d>=h?d:h)),d}function co(d,h,y,C,A,F){var W,Y=h&f,re=h&p,ve=h&g;if(y&&(W=A?y(d,C,A,F):y(d)),W!==n)return W;if(!pn(d))return d;var ye=st(d);if(ye){if(W=i7(d),!Y)return hr(d,W)}else{var we=Xn(d),Ae=we==G||we==me;if(rs(d))return cS(d,Y);if(we==Ve||we==ae||Ae&&!A){if(W=re||Ae?{}:OS(d),!Y)return re?Y3(d,v3(W,d)):G3(d,z_(W,d))}else{if(!Yt[we])return A?d:{};W=s7(d,we,Y)}}F||(F=new Ro);var Be=F.get(d);if(Be)return Be;F.set(d,W),rC(d)?d.forEach(function(Xe){W.add(co(Xe,h,y,Xe,d,F))}):tC(d)&&d.forEach(function(Xe,_t){W.set(_t,co(Xe,h,y,_t,d,F))});var Ke=ve?re?hv:fv:re?gr:Nn,pt=ye?n:Ke(d);return so(pt||d,function(Xe,_t){pt&&(_t=Xe,Xe=d[_t]),Xc(W,_t,co(Xe,h,y,_t,d,F))}),W}function b3(d){var h=Nn(d);return function(y){return j_(y,d,h)}}function j_(d,h,y){var C=y.length;if(d==null)return!C;for(d=qt(d);C--;){var A=y[C],F=h[A],W=d[A];if(W===n&&!(A in d)||!F(W))return!1}return!0}function B_(d,h,y){if(typeof d!="function")throw new ao(s);return ru(function(){d.apply(n,y)},h)}function Qc(d,h,y,C){var A=-1,F=Ef,W=!0,Y=d.length,re=[],ve=h.length;if(!Y)return re;y&&(h=fn(h,Mr(y))),C?(F=Mm,W=!1):h.length>=o&&(F=Wc,W=!1,h=new ea(h));e:for(;++A<Y;){var ye=d[A],we=y==null?ye:y(ye);if(ye=C||ye!==0?ye:0,W&&we===we){for(var Ae=ve;Ae--;)if(h[Ae]===we)continue e;re.push(ye)}else F(h,we,C)||re.push(ye)}return re}var Zi=pS(jo),V_=pS(Km,!0);function y3(d,h){var y=!0;return Zi(d,function(C,A,F){return y=!!h(C,A,F),y}),y}function Hf(d,h,y){for(var C=-1,A=d.length;++C<A;){var F=d[C],W=h(F);if(W!=null&&(Y===n?W===W&&!Ir(W):y(W,Y)))var Y=W,re=F}return re}function x3(d,h,y,C){var A=d.length;for(y=ut(y),y<0&&(y=-y>A?0:A+y),C=C===n||C>A?A:ut(C),C<0&&(C+=A),C=y>C?0:iC(C);y<C;)d[y++]=h;return d}function H_(d,h){var y=[];return Zi(d,function(C,A,F){h(C,A,F)&&y.push(C)}),y}function Hn(d,h,y,C,A){var F=-1,W=d.length;for(y||(y=l7),A||(A=[]);++F<W;){var Y=d[F];h>0&&y(Y)?h>1?Hn(Y,h-1,y,C,A):Xi(A,Y):C||(A[A.length]=Y)}return A}var Ym=gS(),W_=gS(!0);function jo(d,h){return d&&Ym(d,h,Nn)}function Km(d,h){return d&&W_(d,h,Nn)}function Wf(d,h){return Ki(h,function(y){return xi(d[y])})}function na(d,h){h=ts(h,d);for(var y=0,C=h.length;d!=null&&y<C;)d=d[Vo(h[y++])];return y&&y==C?d:n}function U_(d,h,y){var C=h(d);return st(d)?C:Xi(C,y(d))}function ir(d){return d==null?d===n?cn:$e:Js&&Js in qt(d)?n7(d):g7(d)}function Xm(d,h){return d>h}function w3(d,h){return d!=null&&Bt.call(d,h)}function _3(d,h){return d!=null&&h in qt(d)}function S3(d,h,y){return d>=Kn(h,y)&&d<Dn(h,y)}function Qm(d,h,y){for(var C=y?Mm:Ef,A=d[0].length,F=d.length,W=F,Y=he(F),re=1/0,ve=[];W--;){var ye=d[W];W&&h&&(ye=fn(ye,Mr(h))),re=Kn(ye.length,re),Y[W]=!y&&(h||A>=120&&ye.length>=120)?new ea(W&&ye):n}ye=d[0];var we=-1,Ae=Y[0];e:for(;++we<A&&ve.length<re;){var Be=ye[we],Ke=h?h(Be):Be;if(Be=y||Be!==0?Be:0,!(Ae?Wc(Ae,Ke):C(ve,Ke,y))){for(W=F;--W;){var pt=Y[W];if(!(pt?Wc(pt,Ke):C(d[W],Ke,y)))continue e}Ae&&Ae.push(Ke),ve.push(Be)}}return ve}function C3(d,h,y,C){return jo(d,function(A,F,W){h(C,y(A),F,W)}),C}function Jc(d,h,y){h=ts(h,d),d=kS(d,h);var C=d==null?d:d[Vo(fo(h))];return C==null?n:kr(C,d,y)}function q_(d){return mn(d)&&ir(d)==ae}function E3(d){return mn(d)&&ir(d)==Ie}function R3(d){return mn(d)&&ir(d)==ee}function Zc(d,h,y,C,A){return d===h?!0:d==null||h==null||!mn(d)&&!mn(h)?d!==d&&h!==h:P3(d,h,y,C,Zc,A)}function P3(d,h,y,C,A,F){var W=st(d),Y=st(h),re=W?ue:Xn(d),ve=Y?ue:Xn(h);re=re==ae?Ve:re,ve=ve==ae?Ve:ve;var ye=re==Ve,we=ve==Ve,Ae=re==ve;if(Ae&&rs(d)){if(!rs(h))return!1;W=!0,ye=!1}if(Ae&&!ye)return F||(F=new Ro),W||wl(d)?ES(d,h,y,C,A,F):e7(d,h,re,y,C,A,F);if(!(y&v)){var Be=ye&&Bt.call(d,"__wrapped__"),Ke=we&&Bt.call(h,"__wrapped__");if(Be||Ke){var pt=Be?d.value():d,Xe=Ke?h.value():h;return F||(F=new Ro),A(pt,Xe,y,C,F)}}return Ae?(F||(F=new Ro),t7(d,h,y,C,A,F)):!1}function O3(d){return mn(d)&&Xn(d)==_e}function Jm(d,h,y,C){var A=y.length,F=A,W=!C;if(d==null)return!F;for(d=qt(d);A--;){var Y=y[A];if(W&&Y[2]?Y[1]!==d[Y[0]]:!(Y[0]in d))return!1}for(;++A<F;){Y=y[A];var re=Y[0],ve=d[re],ye=Y[1];if(W&&Y[2]){if(ve===n&&!(re in d))return!1}else{var we=new Ro;if(C)var Ae=C(ve,ye,re,d,h,we);if(!(Ae===n?Zc(ye,ve,v|b,C,we):Ae))return!1}}return!0}function G_(d){if(!pn(d)||u7(d))return!1;var h=xi(d)?ON:Ot;return h.test(oa(d))}function $3(d){return mn(d)&&ir(d)==Ge}function D3(d){return mn(d)&&Xn(d)==ct}function T3(d){return mn(d)&&ah(d.length)&&!!en[ir(d)]}function Y_(d){return typeof d=="function"?d:d==null?mr:typeof d=="object"?st(d)?Q_(d[0],d[1]):X_(d):mC(d)}function Zm(d){if(!nu(d))return AN(d);var h=[];for(var y in qt(d))Bt.call(d,y)&&y!="constructor"&&h.push(y);return h}function k3(d){if(!pn(d))return p7(d);var h=nu(d),y=[];for(var C in d)C=="constructor"&&(h||!Bt.call(d,C))||y.push(C);return y}function ev(d,h){return d<h}function K_(d,h){var y=-1,C=pr(d)?he(d.length):[];return Zi(d,function(A,F,W){C[++y]=h(A,F,W)}),C}function X_(d){var h=gv(d);return h.length==1&&h[0][2]?DS(h[0][0],h[0][1]):function(y){return y===d||Jm(y,d,h)}}function Q_(d,h){return vv(d)&&$S(h)?DS(Vo(d),h):function(y){var C=Pv(y,d);return C===n&&C===h?Ov(y,d):Zc(h,C,v|b)}}function Uf(d,h,y,C,A){d!==h&&Ym(h,function(F,W){if(A||(A=new Ro),pn(F))M3(d,h,W,y,Uf,C,A);else{var Y=C?C(yv(d,W),F,W+"",d,h,A):n;Y===n&&(Y=F),qm(d,W,Y)}},gr)}function M3(d,h,y,C,A,F,W){var Y=yv(d,y),re=yv(h,y),ve=W.get(re);if(ve){qm(d,y,ve);return}var ye=F?F(Y,re,y+"",d,h,W):n,we=ye===n;if(we){var Ae=st(re),Be=!Ae&&rs(re),Ke=!Ae&&!Be&&wl(re);ye=re,Ae||Be||Ke?st(Y)?ye=Y:xn(Y)?ye=hr(Y):Be?(we=!1,ye=cS(re,!0)):Ke?(we=!1,ye=uS(re,!0)):ye=[]:ou(re)||ia(re)?(ye=Y,ia(Y)?ye=sC(Y):(!pn(Y)||xi(Y))&&(ye=OS(re))):we=!1}we&&(W.set(re,ye),A(ye,re,C,F,W),W.delete(re)),qm(d,y,ye)}function J_(d,h){var y=d.length;if(y)return h+=h<0?y:0,yi(h,y)?d[h]:n}function Z_(d,h,y){h.length?h=fn(h,function(F){return st(F)?function(W){return na(W,F.length===1?F[0]:F)}:F}):h=[mr];var C=-1;h=fn(h,Mr(Ye()));var A=K_(d,function(F,W,Y){var re=fn(h,function(ve){return ve(F)});return{criteria:re,index:++C,value:F}});return sN(A,function(F,W){return q3(F,W,y)})}function A3(d,h){return eS(d,h,function(y,C){return Ov(d,C)})}function eS(d,h,y){for(var C=-1,A=h.length,F={};++C<A;){var W=h[C],Y=na(d,W);y(Y,W)&&eu(F,ts(W,d),Y)}return F}function I3(d){return function(h){return na(h,d)}}function tv(d,h,y,C){var A=C?iN:ul,F=-1,W=h.length,Y=d;for(d===h&&(h=hr(h)),y&&(Y=fn(d,Mr(y)));++F<W;)for(var re=0,ve=h[F],ye=y?y(ve):ve;(re=A(Y,ye,re,C))>-1;)Y!==d&&If.call(Y,re,1),If.call(d,re,1);return d}function tS(d,h){for(var y=d?h.length:0,C=y-1;y--;){var A=h[y];if(y==C||A!==F){var F=A;yi(A)?If.call(d,A,1):iv(d,A)}}return d}function nv(d,h){return d+Ff(I_()*(h-d+1))}function N3(d,h,y,C){for(var A=-1,F=Dn(Lf((h-d)/(y||1)),0),W=he(F);F--;)W[C?F:++A]=d,d+=y;return W}function rv(d,h){var y="";if(!d||h<1||h>q)return y;do h%2&&(y+=d),h=Ff(h/2),h&&(d+=d);while(h);return y}function vt(d,h){return xv(TS(d,h,mr),d+"")}function L3(d){return F_(_l(d))}function F3(d,h){var y=_l(d);return th(y,ta(h,0,y.length))}function eu(d,h,y,C){if(!pn(d))return d;h=ts(h,d);for(var A=-1,F=h.length,W=F-1,Y=d;Y!=null&&++A<F;){var re=Vo(h[A]),ve=y;if(re==="__proto__"||re==="constructor"||re==="prototype")return d;if(A!=W){var ye=Y[re];ve=C?C(ye,re,Y):n,ve===n&&(ve=pn(ye)?ye:yi(h[A+1])?[]:{})}Xc(Y,re,ve),Y=Y[re]}return d}var nS=zf?function(d,h){return zf.set(d,h),d}:mr,z3=Nf?function(d,h){return Nf(d,"toString",{configurable:!0,enumerable:!1,value:Dv(h),writable:!0})}:mr;function j3(d){return th(_l(d))}function uo(d,h,y){var C=-1,A=d.length;h<0&&(h=-h>A?0:A+h),y=y>A?A:y,y<0&&(y+=A),A=h>y?0:y-h>>>0,h>>>=0;for(var F=he(A);++C<A;)F[C]=d[C+h];return F}function B3(d,h){var y;return Zi(d,function(C,A,F){return y=h(C,A,F),!y}),!!y}function qf(d,h,y){var C=0,A=d==null?C:d.length;if(typeof h=="number"&&h===h&&A<=N){for(;C<A;){var F=C+A>>>1,W=d[F];W!==null&&!Ir(W)&&(y?W<=h:W<h)?C=F+1:A=F}return A}return ov(d,h,mr,y)}function ov(d,h,y,C){var A=0,F=d==null?0:d.length;if(F===0)return 0;h=y(h);for(var W=h!==h,Y=h===null,re=Ir(h),ve=h===n;A<F;){var ye=Ff((A+F)/2),we=y(d[ye]),Ae=we!==n,Be=we===null,Ke=we===we,pt=Ir(we);if(W)var Xe=C||Ke;else ve?Xe=Ke&&(C||Ae):Y?Xe=Ke&&Ae&&(C||!Be):re?Xe=Ke&&Ae&&!Be&&(C||!pt):Be||pt?Xe=!1:Xe=C?we<=h:we<h;Xe?A=ye+1:F=ye}return Kn(F,X)}function rS(d,h){for(var y=-1,C=d.length,A=0,F=[];++y<C;){var W=d[y],Y=h?h(W):W;if(!y||!Po(Y,re)){var re=Y;F[A++]=W===0?0:W}}return F}function oS(d){return typeof d=="number"?d:Ir(d)?T:+d}function Ar(d){if(typeof d=="string")return d;if(st(d))return fn(d,Ar)+"";if(Ir(d))return N_?N_.call(d):"";var h=d+"";return h=="0"&&1/d==-H?"-0":h}function es(d,h,y){var C=-1,A=Ef,F=d.length,W=!0,Y=[],re=Y;if(y)W=!1,A=Mm;else if(F>=o){var ve=h?null:J3(d);if(ve)return Pf(ve);W=!1,A=Wc,re=new ea}else re=h?[]:Y;e:for(;++C<F;){var ye=d[C],we=h?h(ye):ye;if(ye=y||ye!==0?ye:0,W&&we===we){for(var Ae=re.length;Ae--;)if(re[Ae]===we)continue e;h&&re.push(we),Y.push(ye)}else A(re,we,y)||(re!==Y&&re.push(we),Y.push(ye))}return Y}function iv(d,h){return h=ts(h,d),d=kS(d,h),d==null||delete d[Vo(fo(h))]}function iS(d,h,y,C){return eu(d,h,y(na(d,h)),C)}function Gf(d,h,y,C){for(var A=d.length,F=C?A:-1;(C?F--:++F<A)&&h(d[F],F,d););return y?uo(d,C?0:F,C?F+1:A):uo(d,C?F+1:0,C?A:F)}function sS(d,h){var y=d;return y instanceof Ct&&(y=y.value()),Am(h,function(C,A){return A.func.apply(A.thisArg,Xi([C],A.args))},y)}function sv(d,h,y){var C=d.length;if(C<2)return C?es(d[0]):[];for(var A=-1,F=he(C);++A<C;)for(var W=d[A],Y=-1;++Y<C;)Y!=A&&(F[A]=Qc(F[A]||W,d[Y],h,y));return es(Hn(F,1),h,y)}function aS(d,h,y){for(var C=-1,A=d.length,F=h.length,W={};++C<A;){var Y=C<F?h[C]:n;y(W,d[C],Y)}return W}function av(d){return xn(d)?d:[]}function lv(d){return typeof d=="function"?d:mr}function ts(d,h){return st(d)?d:vv(d,h)?[d]:NS(Nt(d))}var V3=vt;function ns(d,h,y){var C=d.length;return y=y===n?C:y,!h&&y>=C?d:uo(d,h,y)}var lS=$N||function(d){return Vn.clearTimeout(d)};function cS(d,h){if(h)return d.slice();var y=d.length,C=D_?D_(y):new d.constructor(y);return d.copy(C),C}function cv(d){var h=new d.constructor(d.byteLength);return new Mf(h).set(new Mf(d)),h}function H3(d,h){var y=h?cv(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.byteLength)}function W3(d){var h=new d.constructor(d.source,He.exec(d));return h.lastIndex=d.lastIndex,h}function U3(d){return Kc?qt(Kc.call(d)):{}}function uS(d,h){var y=h?cv(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.length)}function dS(d,h){if(d!==h){var y=d!==n,C=d===null,A=d===d,F=Ir(d),W=h!==n,Y=h===null,re=h===h,ve=Ir(h);if(!Y&&!ve&&!F&&d>h||F&&W&&re&&!Y&&!ve||C&&W&&re||!y&&re||!A)return 1;if(!C&&!F&&!ve&&d<h||ve&&y&&A&&!C&&!F||Y&&y&&A||!W&&A||!re)return-1}return 0}function q3(d,h,y){for(var C=-1,A=d.criteria,F=h.criteria,W=A.length,Y=y.length;++C<W;){var re=dS(A[C],F[C]);if(re){if(C>=Y)return re;var ve=y[C];return re*(ve=="desc"?-1:1)}}return d.index-h.index}function fS(d,h,y,C){for(var A=-1,F=d.length,W=y.length,Y=-1,re=h.length,ve=Dn(F-W,0),ye=he(re+ve),we=!C;++Y<re;)ye[Y]=h[Y];for(;++A<W;)(we||A<F)&&(ye[y[A]]=d[A]);for(;ve--;)ye[Y++]=d[A++];return ye}function hS(d,h,y,C){for(var A=-1,F=d.length,W=-1,Y=y.length,re=-1,ve=h.length,ye=Dn(F-Y,0),we=he(ye+ve),Ae=!C;++A<ye;)we[A]=d[A];for(var Be=A;++re<ve;)we[Be+re]=h[re];for(;++W<Y;)(Ae||A<F)&&(we[Be+y[W]]=d[A++]);return we}function hr(d,h){var y=-1,C=d.length;for(h||(h=he(C));++y<C;)h[y]=d[y];return h}function Bo(d,h,y,C){var A=!y;y||(y={});for(var F=-1,W=h.length;++F<W;){var Y=h[F],re=C?C(y[Y],d[Y],Y,y,d):n;re===n&&(re=d[Y]),A?mi(y,Y,re):Xc(y,Y,re)}return y}function G3(d,h){return Bo(d,mv(d),h)}function Y3(d,h){return Bo(d,RS(d),h)}function Yf(d,h){return function(y,C){var A=st(y)?Z5:m3,F=h?h():{};return A(y,d,Ye(C,2),F)}}function bl(d){return vt(function(h,y){var C=-1,A=y.length,F=A>1?y[A-1]:n,W=A>2?y[2]:n;for(F=d.length>3&&typeof F=="function"?(A--,F):n,W&&sr(y[0],y[1],W)&&(F=A<3?n:F,A=1),h=qt(h);++C<A;){var Y=y[C];Y&&d(h,Y,C,F)}return h})}function pS(d,h){return function(y,C){if(y==null)return y;if(!pr(y))return d(y,C);for(var A=y.length,F=h?A:-1,W=qt(y);(h?F--:++F<A)&&C(W[F],F,W)!==!1;);return y}}function gS(d){return function(h,y,C){for(var A=-1,F=qt(h),W=C(h),Y=W.length;Y--;){var re=W[d?Y:++A];if(y(F[re],re,F)===!1)break}return h}}function K3(d,h,y){var C=h&x,A=tu(d);function F(){var W=this&&this!==Vn&&this instanceof F?A:d;return W.apply(C?y:this,arguments)}return F}function mS(d){return function(h){h=Nt(h);var y=dl(h)?Eo(h):n,C=y?y[0]:h.charAt(0),A=y?ns(y,1).join(""):h.slice(1);return C[d]()+A}}function yl(d){return function(h){return Am(pC(hC(h).replace(z5,"")),d,"")}}function tu(d){return function(){var h=arguments;switch(h.length){case 0:return new d;case 1:return new d(h[0]);case 2:return new d(h[0],h[1]);case 3:return new d(h[0],h[1],h[2]);case 4:return new d(h[0],h[1],h[2],h[3]);case 5:return new d(h[0],h[1],h[2],h[3],h[4]);case 6:return new d(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new d(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var y=vl(d.prototype),C=d.apply(y,h);return pn(C)?C:y}}function X3(d,h,y){var C=tu(d);function A(){for(var F=arguments.length,W=he(F),Y=F,re=xl(A);Y--;)W[Y]=arguments[Y];var ve=F<3&&W[0]!==re&&W[F-1]!==re?[]:Qi(W,re);if(F-=ve.length,F<y)return wS(d,h,Kf,A.placeholder,n,W,ve,n,n,y-F);var ye=this&&this!==Vn&&this instanceof A?C:d;return kr(ye,this,W)}return A}function vS(d){return function(h,y,C){var A=qt(h);if(!pr(h)){var F=Ye(y,3);h=Nn(h),y=function(Y){return F(A[Y],Y,A)}}var W=d(h,y,C);return W>-1?A[F?h[W]:W]:n}}function bS(d){return bi(function(h){var y=h.length,C=y,A=lo.prototype.thru;for(d&&h.reverse();C--;){var F=h[C];if(typeof F!="function")throw new ao(s);if(A&&!W&&Zf(F)=="wrapper")var W=new lo([],!0)}for(C=W?C:y;++C<y;){F=h[C];var Y=Zf(F),re=Y=="wrapper"?pv(F):n;re&&bv(re[0])&&re[1]==(k|S|E|M)&&!re[4].length&&re[9]==1?W=W[Zf(re[0])].apply(W,re[3]):W=F.length==1&&bv(F)?W[Y]():W.thru(F)}return function(){var ve=arguments,ye=ve[0];if(W&&ve.length==1&&st(ye))return W.plant(ye).value();for(var we=0,Ae=y?h[we].apply(this,ve):ye;++we<y;)Ae=h[we].call(this,Ae);return Ae}})}function Kf(d,h,y,C,A,F,W,Y,re,ve){var ye=h&k,we=h&x,Ae=h&w,Be=h&(S|R),Ke=h&D,pt=Ae?n:tu(d);function Xe(){for(var _t=arguments.length,Rt=he(_t),Nr=_t;Nr--;)Rt[Nr]=arguments[Nr];if(Be)var ar=xl(Xe),Lr=lN(Rt,ar);if(C&&(Rt=fS(Rt,C,A,Be)),F&&(Rt=hS(Rt,F,W,Be)),_t-=Lr,Be&&_t<ve){var wn=Qi(Rt,ar);return wS(d,h,Kf,Xe.placeholder,y,Rt,wn,Y,re,ve-_t)}var Oo=we?y:this,_i=Ae?Oo[d]:d;return _t=Rt.length,Y?Rt=m7(Rt,Y):Ke&&_t>1&&Rt.reverse(),ye&&re<_t&&(Rt.length=re),this&&this!==Vn&&this instanceof Xe&&(_i=pt||tu(_i)),_i.apply(Oo,Rt)}return Xe}function yS(d,h){return function(y,C){return C3(y,d,h(C),{})}}function Xf(d,h){return function(y,C){var A;if(y===n&&C===n)return h;if(y!==n&&(A=y),C!==n){if(A===n)return C;typeof y=="string"||typeof C=="string"?(y=Ar(y),C=Ar(C)):(y=oS(y),C=oS(C)),A=d(y,C)}return A}}function uv(d){return bi(function(h){return h=fn(h,Mr(Ye())),vt(function(y){var C=this;return d(h,function(A){return kr(A,C,y)})})})}function Qf(d,h){h=h===n?" ":Ar(h);var y=h.length;if(y<2)return y?rv(h,d):h;var C=rv(h,Lf(d/fl(h)));return dl(h)?ns(Eo(C),0,d).join(""):C.slice(0,d)}function Q3(d,h,y,C){var A=h&x,F=tu(d);function W(){for(var Y=-1,re=arguments.length,ve=-1,ye=C.length,we=he(ye+re),Ae=this&&this!==Vn&&this instanceof W?F:d;++ve<ye;)we[ve]=C[ve];for(;re--;)we[ve++]=arguments[++Y];return kr(Ae,A?y:this,we)}return W}function xS(d){return function(h,y,C){return C&&typeof C!="number"&&sr(h,y,C)&&(y=C=n),h=wi(h),y===n?(y=h,h=0):y=wi(y),C=C===n?h<y?1:-1:wi(C),N3(h,y,C,d)}}function Jf(d){return function(h,y){return typeof h=="string"&&typeof y=="string"||(h=ho(h),y=ho(y)),d(h,y)}}function wS(d,h,y,C,A,F,W,Y,re,ve){var ye=h&S,we=ye?W:n,Ae=ye?n:W,Be=ye?F:n,Ke=ye?n:F;h|=ye?E:O,h&=~(ye?O:E),h&_||(h&=~(x|w));var pt=[d,h,A,Be,we,Ke,Ae,Y,re,ve],Xe=y.apply(n,pt);return bv(d)&&MS(Xe,pt),Xe.placeholder=C,AS(Xe,d,h)}function dv(d){var h=$n[d];return function(y,C){if(y=ho(y),C=C==null?0:Kn(ut(C),292),C&&A_(y)){var A=(Nt(y)+"e").split("e"),F=h(A[0]+"e"+(+A[1]+C));return A=(Nt(F)+"e").split("e"),+(A[0]+"e"+(+A[1]-C))}return h(y)}}var J3=gl&&1/Pf(new gl([,-0]))[1]==H?function(d){return new gl(d)}:Mv;function _S(d){return function(h){var y=Xn(h);return y==_e?Bm(h):y==ct?gN(h):aN(h,d(h))}}function vi(d,h,y,C,A,F,W,Y){var re=h&w;if(!re&&typeof d!="function")throw new ao(s);var ve=C?C.length:0;if(ve||(h&=~(E|O),C=A=n),W=W===n?W:Dn(ut(W),0),Y=Y===n?Y:ut(Y),ve-=A?A.length:0,h&O){var ye=C,we=A;C=A=n}var Ae=re?n:pv(d),Be=[d,h,y,C,A,ye,we,F,W,Y];if(Ae&&h7(Be,Ae),d=Be[0],h=Be[1],y=Be[2],C=Be[3],A=Be[4],Y=Be[9]=Be[9]===n?re?0:d.length:Dn(Be[9]-ve,0),!Y&&h&(S|R)&&(h&=~(S|R)),!h||h==x)var Ke=K3(d,h,y);else h==S||h==R?Ke=X3(d,h,Y):(h==E||h==(x|E))&&!A.length?Ke=Q3(d,h,y,C):Ke=Kf.apply(n,Be);var pt=Ae?nS:MS;return AS(pt(Ke,Be),d,h)}function SS(d,h,y,C){return d===n||Po(d,pl[y])&&!Bt.call(C,y)?h:d}function CS(d,h,y,C,A,F){return pn(d)&&pn(h)&&(F.set(h,d),Uf(d,h,n,CS,F),F.delete(h)),d}function Z3(d){return ou(d)?n:d}function ES(d,h,y,C,A,F){var W=y&v,Y=d.length,re=h.length;if(Y!=re&&!(W&&re>Y))return!1;var ve=F.get(d),ye=F.get(h);if(ve&&ye)return ve==h&&ye==d;var we=-1,Ae=!0,Be=y&b?new ea:n;for(F.set(d,h),F.set(h,d);++we<Y;){var Ke=d[we],pt=h[we];if(C)var Xe=W?C(pt,Ke,we,h,d,F):C(Ke,pt,we,d,h,F);if(Xe!==n){if(Xe)continue;Ae=!1;break}if(Be){if(!Im(h,function(_t,Rt){if(!Wc(Be,Rt)&&(Ke===_t||A(Ke,_t,y,C,F)))return Be.push(Rt)})){Ae=!1;break}}else if(!(Ke===pt||A(Ke,pt,y,C,F))){Ae=!1;break}}return F.delete(d),F.delete(h),Ae}function e7(d,h,y,C,A,F,W){switch(y){case qe:if(d.byteLength!=h.byteLength||d.byteOffset!=h.byteOffset)return!1;d=d.buffer,h=h.buffer;case Ie:return!(d.byteLength!=h.byteLength||!F(new Mf(d),new Mf(h)));case oe:case ee:case Pe:return Po(+d,+h);case be:return d.name==h.name&&d.message==h.message;case Ge:case kt:return d==h+"";case _e:var Y=Bm;case ct:var re=C&v;if(Y||(Y=Pf),d.size!=h.size&&!re)return!1;var ve=W.get(d);if(ve)return ve==h;C|=b,W.set(d,h);var ye=ES(Y(d),Y(h),C,A,F,W);return W.delete(d),ye;case Dt:if(Kc)return Kc.call(d)==Kc.call(h)}return!1}function t7(d,h,y,C,A,F){var W=y&v,Y=fv(d),re=Y.length,ve=fv(h),ye=ve.length;if(re!=ye&&!W)return!1;for(var we=re;we--;){var Ae=Y[we];if(!(W?Ae in h:Bt.call(h,Ae)))return!1}var Be=F.get(d),Ke=F.get(h);if(Be&&Ke)return Be==h&&Ke==d;var pt=!0;F.set(d,h),F.set(h,d);for(var Xe=W;++we<re;){Ae=Y[we];var _t=d[Ae],Rt=h[Ae];if(C)var Nr=W?C(Rt,_t,Ae,h,d,F):C(_t,Rt,Ae,d,h,F);if(!(Nr===n?_t===Rt||A(_t,Rt,y,C,F):Nr)){pt=!1;break}Xe||(Xe=Ae=="constructor")}if(pt&&!Xe){var ar=d.constructor,Lr=h.constructor;ar!=Lr&&"constructor"in d&&"constructor"in h&&!(typeof ar=="function"&&ar instanceof ar&&typeof Lr=="function"&&Lr instanceof Lr)&&(pt=!1)}return F.delete(d),F.delete(h),pt}function bi(d){return xv(TS(d,n,jS),d+"")}function fv(d){return U_(d,Nn,mv)}function hv(d){return U_(d,gr,RS)}var pv=zf?function(d){return zf.get(d)}:Mv;function Zf(d){for(var h=d.name+"",y=ml[h],C=Bt.call(ml,h)?y.length:0;C--;){var A=y[C],F=A.func;if(F==null||F==d)return A.name}return h}function xl(d){var h=Bt.call(L,"placeholder")?L:d;return h.placeholder}function Ye(){var d=L.iteratee||Tv;return d=d===Tv?Y_:d,arguments.length?d(arguments[0],arguments[1]):d}function eh(d,h){var y=d.__data__;return c7(h)?y[typeof h=="string"?"string":"hash"]:y.map}function gv(d){for(var h=Nn(d),y=h.length;y--;){var C=h[y],A=d[C];h[y]=[C,A,$S(A)]}return h}function ra(d,h){var y=fN(d,h);return G_(y)?y:n}function n7(d){var h=Bt.call(d,Js),y=d[Js];try{d[Js]=n;var C=!0}catch{}var A=Tf.call(d);return C&&(h?d[Js]=y:delete d[Js]),A}var mv=Hm?function(d){return d==null?[]:(d=qt(d),Ki(Hm(d),function(h){return k_.call(d,h)}))}:Av,RS=Hm?function(d){for(var h=[];d;)Xi(h,mv(d)),d=Af(d);return h}:Av,Xn=ir;(Wm&&Xn(new Wm(new ArrayBuffer(1)))!=qe||qc&&Xn(new qc)!=_e||Um&&Xn(Um.resolve())!=Fe||gl&&Xn(new gl)!=ct||Gc&&Xn(new Gc)!=de)&&(Xn=function(d){var h=ir(d),y=h==Ve?d.constructor:n,C=y?oa(y):"";if(C)switch(C){case FN:return qe;case zN:return _e;case jN:return Fe;case BN:return ct;case VN:return de}return h});function r7(d,h,y){for(var C=-1,A=y.length;++C<A;){var F=y[C],W=F.size;switch(F.type){case"drop":d+=W;break;case"dropRight":h-=W;break;case"take":h=Kn(h,d+W);break;case"takeRight":d=Dn(d,h-W);break}}return{start:d,end:h}}function o7(d){var h=d.match(Hc);return h?h[1].split($):[]}function PS(d,h,y){h=ts(h,d);for(var C=-1,A=h.length,F=!1;++C<A;){var W=Vo(h[C]);if(!(F=d!=null&&y(d,W)))break;d=d[W]}return F||++C!=A?F:(A=d==null?0:d.length,!!A&&ah(A)&&yi(W,A)&&(st(d)||ia(d)))}function i7(d){var h=d.length,y=new d.constructor(h);return h&&typeof d[0]=="string"&&Bt.call(d,"index")&&(y.index=d.index,y.input=d.input),y}function OS(d){return typeof d.constructor=="function"&&!nu(d)?vl(Af(d)):{}}function s7(d,h,y){var C=d.constructor;switch(h){case Ie:return cv(d);case oe:case ee:return new C(+d);case qe:return H3(d,y);case Je:case Gt:case Jt:case un:case Pn:case or:case Zt:case hn:case On:return uS(d,y);case _e:return new C;case Pe:case kt:return new C(d);case Ge:return W3(d);case ct:return new C;case Dt:return U3(d)}}function a7(d,h){var y=h.length;if(!y)return d;var C=y-1;return h[C]=(y>1?"& ":"")+h[C],h=h.join(y>2?", ":" "),d.replace(Vc,`{
|
|
70
|
+
/* [wrapped with `+h+`] */
|
|
71
|
+
`)}function l7(d){return st(d)||ia(d)||!!(M_&&d&&d[M_])}function yi(d,h){var y=typeof d;return h=h??q,!!h&&(y=="number"||y!="symbol"&&it.test(d))&&d>-1&&d%1==0&&d<h}function sr(d,h,y){if(!pn(y))return!1;var C=typeof h;return(C=="number"?pr(y)&&yi(h,y.length):C=="string"&&h in y)?Po(y[h],d):!1}function vv(d,h){if(st(d))return!1;var y=typeof d;return y=="number"||y=="symbol"||y=="boolean"||d==null||Ir(d)?!0:qs.test(d)||!Us.test(d)||h!=null&&d in qt(h)}function c7(d){var h=typeof d;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?d!=="__proto__":d===null}function bv(d){var h=Zf(d),y=L[h];if(typeof y!="function"||!(h in Ct.prototype))return!1;if(d===y)return!0;var C=pv(y);return!!C&&d===C[0]}function u7(d){return!!$_&&$_ in d}var d7=$f?xi:Iv;function nu(d){var h=d&&d.constructor,y=typeof h=="function"&&h.prototype||pl;return d===y}function $S(d){return d===d&&!pn(d)}function DS(d,h){return function(y){return y==null?!1:y[d]===h&&(h!==n||d in qt(y))}}function f7(d){var h=ih(d,function(C){return y.size===c&&y.clear(),C}),y=h.cache;return h}function h7(d,h){var y=d[1],C=h[1],A=y|C,F=A<(x|w|k),W=C==k&&y==S||C==k&&y==M&&d[7].length<=h[8]||C==(k|M)&&h[7].length<=h[8]&&y==S;if(!(F||W))return d;C&x&&(d[2]=h[2],A|=y&x?0:_);var Y=h[3];if(Y){var re=d[3];d[3]=re?fS(re,Y,h[4]):Y,d[4]=re?Qi(d[3],u):h[4]}return Y=h[5],Y&&(re=d[5],d[5]=re?hS(re,Y,h[6]):Y,d[6]=re?Qi(d[5],u):h[6]),Y=h[7],Y&&(d[7]=Y),C&k&&(d[8]=d[8]==null?h[8]:Kn(d[8],h[8])),d[9]==null&&(d[9]=h[9]),d[0]=h[0],d[1]=A,d}function p7(d){var h=[];if(d!=null)for(var y in qt(d))h.push(y);return h}function g7(d){return Tf.call(d)}function TS(d,h,y){return h=Dn(h===n?d.length-1:h,0),function(){for(var C=arguments,A=-1,F=Dn(C.length-h,0),W=he(F);++A<F;)W[A]=C[h+A];A=-1;for(var Y=he(h+1);++A<h;)Y[A]=C[A];return Y[h]=y(W),kr(d,this,Y)}}function kS(d,h){return h.length<2?d:na(d,uo(h,0,-1))}function m7(d,h){for(var y=d.length,C=Kn(h.length,y),A=hr(d);C--;){var F=h[C];d[C]=yi(F,y)?A[F]:n}return d}function yv(d,h){if(!(h==="constructor"&&typeof d[h]=="function")&&h!="__proto__")return d[h]}var MS=IS(nS),ru=TN||function(d,h){return Vn.setTimeout(d,h)},xv=IS(z3);function AS(d,h,y){var C=h+"";return xv(d,a7(C,v7(o7(C),y)))}function IS(d){var h=0,y=0;return function(){var C=IN(),A=Q-(C-y);if(y=C,A>0){if(++h>=j)return arguments[0]}else h=0;return d.apply(n,arguments)}}function th(d,h){var y=-1,C=d.length,A=C-1;for(h=h===n?C:h;++y<h;){var F=nv(y,A),W=d[F];d[F]=d[y],d[y]=W}return d.length=h,d}var NS=f7(function(d){var h=[];return d.charCodeAt(0)===46&&h.push(""),d.replace(jc,function(y,C,A,F){h.push(A?F.replace(Ce,"$1"):C||y)}),h});function Vo(d){if(typeof d=="string"||Ir(d))return d;var h=d+"";return h=="0"&&1/d==-H?"-0":h}function oa(d){if(d!=null){try{return Df.call(d)}catch{}try{return d+""}catch{}}return""}function v7(d,h){return so(se,function(y){var C="_."+y[0];h&y[1]&&!Ef(d,C)&&d.push(C)}),d.sort()}function LS(d){if(d instanceof Ct)return d.clone();var h=new lo(d.__wrapped__,d.__chain__);return h.__actions__=hr(d.__actions__),h.__index__=d.__index__,h.__values__=d.__values__,h}function b7(d,h,y){(y?sr(d,h,y):h===n)?h=1:h=Dn(ut(h),0);var C=d==null?0:d.length;if(!C||h<1)return[];for(var A=0,F=0,W=he(Lf(C/h));A<C;)W[F++]=uo(d,A,A+=h);return W}function y7(d){for(var h=-1,y=d==null?0:d.length,C=0,A=[];++h<y;){var F=d[h];F&&(A[C++]=F)}return A}function x7(){var d=arguments.length;if(!d)return[];for(var h=he(d-1),y=arguments[0],C=d;C--;)h[C-1]=arguments[C];return Xi(st(y)?hr(y):[y],Hn(h,1))}var w7=vt(function(d,h){return xn(d)?Qc(d,Hn(h,1,xn,!0)):[]}),_7=vt(function(d,h){var y=fo(h);return xn(y)&&(y=n),xn(d)?Qc(d,Hn(h,1,xn,!0),Ye(y,2)):[]}),S7=vt(function(d,h){var y=fo(h);return xn(y)&&(y=n),xn(d)?Qc(d,Hn(h,1,xn,!0),n,y):[]});function C7(d,h,y){var C=d==null?0:d.length;return C?(h=y||h===n?1:ut(h),uo(d,h<0?0:h,C)):[]}function E7(d,h,y){var C=d==null?0:d.length;return C?(h=y||h===n?1:ut(h),h=C-h,uo(d,0,h<0?0:h)):[]}function R7(d,h){return d&&d.length?Gf(d,Ye(h,3),!0,!0):[]}function P7(d,h){return d&&d.length?Gf(d,Ye(h,3),!0):[]}function O7(d,h,y,C){var A=d==null?0:d.length;return A?(y&&typeof y!="number"&&sr(d,h,y)&&(y=0,C=A),x3(d,h,y,C)):[]}function FS(d,h,y){var C=d==null?0:d.length;if(!C)return-1;var A=y==null?0:ut(y);return A<0&&(A=Dn(C+A,0)),Rf(d,Ye(h,3),A)}function zS(d,h,y){var C=d==null?0:d.length;if(!C)return-1;var A=C-1;return y!==n&&(A=ut(y),A=y<0?Dn(C+A,0):Kn(A,C-1)),Rf(d,Ye(h,3),A,!0)}function jS(d){var h=d==null?0:d.length;return h?Hn(d,1):[]}function $7(d){var h=d==null?0:d.length;return h?Hn(d,H):[]}function D7(d,h){var y=d==null?0:d.length;return y?(h=h===n?1:ut(h),Hn(d,h)):[]}function T7(d){for(var h=-1,y=d==null?0:d.length,C={};++h<y;){var A=d[h];C[A[0]]=A[1]}return C}function BS(d){return d&&d.length?d[0]:n}function k7(d,h,y){var C=d==null?0:d.length;if(!C)return-1;var A=y==null?0:ut(y);return A<0&&(A=Dn(C+A,0)),ul(d,h,A)}function M7(d){var h=d==null?0:d.length;return h?uo(d,0,-1):[]}var A7=vt(function(d){var h=fn(d,av);return h.length&&h[0]===d[0]?Qm(h):[]}),I7=vt(function(d){var h=fo(d),y=fn(d,av);return h===fo(y)?h=n:y.pop(),y.length&&y[0]===d[0]?Qm(y,Ye(h,2)):[]}),N7=vt(function(d){var h=fo(d),y=fn(d,av);return h=typeof h=="function"?h:n,h&&y.pop(),y.length&&y[0]===d[0]?Qm(y,n,h):[]});function L7(d,h){return d==null?"":MN.call(d,h)}function fo(d){var h=d==null?0:d.length;return h?d[h-1]:n}function F7(d,h,y){var C=d==null?0:d.length;if(!C)return-1;var A=C;return y!==n&&(A=ut(y),A=A<0?Dn(C+A,0):Kn(A,C-1)),h===h?vN(d,h,A):Rf(d,w_,A,!0)}function z7(d,h){return d&&d.length?J_(d,ut(h)):n}var j7=vt(VS);function VS(d,h){return d&&d.length&&h&&h.length?tv(d,h):d}function B7(d,h,y){return d&&d.length&&h&&h.length?tv(d,h,Ye(y,2)):d}function V7(d,h,y){return d&&d.length&&h&&h.length?tv(d,h,n,y):d}var H7=bi(function(d,h){var y=d==null?0:d.length,C=Gm(d,h);return tS(d,fn(h,function(A){return yi(A,y)?+A:A}).sort(dS)),C});function W7(d,h){var y=[];if(!(d&&d.length))return y;var C=-1,A=[],F=d.length;for(h=Ye(h,3);++C<F;){var W=d[C];h(W,C,d)&&(y.push(W),A.push(C))}return tS(d,A),y}function wv(d){return d==null?d:LN.call(d)}function U7(d,h,y){var C=d==null?0:d.length;return C?(y&&typeof y!="number"&&sr(d,h,y)?(h=0,y=C):(h=h==null?0:ut(h),y=y===n?C:ut(y)),uo(d,h,y)):[]}function q7(d,h){return qf(d,h)}function G7(d,h,y){return ov(d,h,Ye(y,2))}function Y7(d,h){var y=d==null?0:d.length;if(y){var C=qf(d,h);if(C<y&&Po(d[C],h))return C}return-1}function K7(d,h){return qf(d,h,!0)}function X7(d,h,y){return ov(d,h,Ye(y,2),!0)}function Q7(d,h){var y=d==null?0:d.length;if(y){var C=qf(d,h,!0)-1;if(Po(d[C],h))return C}return-1}function J7(d){return d&&d.length?rS(d):[]}function Z7(d,h){return d&&d.length?rS(d,Ye(h,2)):[]}function eL(d){var h=d==null?0:d.length;return h?uo(d,1,h):[]}function tL(d,h,y){return d&&d.length?(h=y||h===n?1:ut(h),uo(d,0,h<0?0:h)):[]}function nL(d,h,y){var C=d==null?0:d.length;return C?(h=y||h===n?1:ut(h),h=C-h,uo(d,h<0?0:h,C)):[]}function rL(d,h){return d&&d.length?Gf(d,Ye(h,3),!1,!0):[]}function oL(d,h){return d&&d.length?Gf(d,Ye(h,3)):[]}var iL=vt(function(d){return es(Hn(d,1,xn,!0))}),sL=vt(function(d){var h=fo(d);return xn(h)&&(h=n),es(Hn(d,1,xn,!0),Ye(h,2))}),aL=vt(function(d){var h=fo(d);return h=typeof h=="function"?h:n,es(Hn(d,1,xn,!0),n,h)});function lL(d){return d&&d.length?es(d):[]}function cL(d,h){return d&&d.length?es(d,Ye(h,2)):[]}function uL(d,h){return h=typeof h=="function"?h:n,d&&d.length?es(d,n,h):[]}function _v(d){if(!(d&&d.length))return[];var h=0;return d=Ki(d,function(y){if(xn(y))return h=Dn(y.length,h),!0}),zm(h,function(y){return fn(d,Nm(y))})}function HS(d,h){if(!(d&&d.length))return[];var y=_v(d);return h==null?y:fn(y,function(C){return kr(h,n,C)})}var dL=vt(function(d,h){return xn(d)?Qc(d,h):[]}),fL=vt(function(d){return sv(Ki(d,xn))}),hL=vt(function(d){var h=fo(d);return xn(h)&&(h=n),sv(Ki(d,xn),Ye(h,2))}),pL=vt(function(d){var h=fo(d);return h=typeof h=="function"?h:n,sv(Ki(d,xn),n,h)}),gL=vt(_v);function mL(d,h){return aS(d||[],h||[],Xc)}function vL(d,h){return aS(d||[],h||[],eu)}var bL=vt(function(d){var h=d.length,y=h>1?d[h-1]:n;return y=typeof y=="function"?(d.pop(),y):n,HS(d,y)});function WS(d){var h=L(d);return h.__chain__=!0,h}function yL(d,h){return h(d),d}function nh(d,h){return h(d)}var xL=bi(function(d){var h=d.length,y=h?d[0]:0,C=this.__wrapped__,A=function(F){return Gm(F,d)};return h>1||this.__actions__.length||!(C instanceof Ct)||!yi(y)?this.thru(A):(C=C.slice(y,+y+(h?1:0)),C.__actions__.push({func:nh,args:[A],thisArg:n}),new lo(C,this.__chain__).thru(function(F){return h&&!F.length&&F.push(n),F}))});function wL(){return WS(this)}function _L(){return new lo(this.value(),this.__chain__)}function SL(){this.__values__===n&&(this.__values__=oC(this.value()));var d=this.__index__>=this.__values__.length,h=d?n:this.__values__[this.__index__++];return{done:d,value:h}}function CL(){return this}function EL(d){for(var h,y=this;y instanceof Bf;){var C=LS(y);C.__index__=0,C.__values__=n,h?A.__wrapped__=C:h=C;var A=C;y=y.__wrapped__}return A.__wrapped__=d,h}function RL(){var d=this.__wrapped__;if(d instanceof Ct){var h=d;return this.__actions__.length&&(h=new Ct(this)),h=h.reverse(),h.__actions__.push({func:nh,args:[wv],thisArg:n}),new lo(h,this.__chain__)}return this.thru(wv)}function PL(){return sS(this.__wrapped__,this.__actions__)}var OL=Yf(function(d,h,y){Bt.call(d,y)?++d[y]:mi(d,y,1)});function $L(d,h,y){var C=st(d)?y_:y3;return y&&sr(d,h,y)&&(h=n),C(d,Ye(h,3))}function DL(d,h){var y=st(d)?Ki:H_;return y(d,Ye(h,3))}var TL=vS(FS),kL=vS(zS);function ML(d,h){return Hn(rh(d,h),1)}function AL(d,h){return Hn(rh(d,h),H)}function IL(d,h,y){return y=y===n?1:ut(y),Hn(rh(d,h),y)}function US(d,h){var y=st(d)?so:Zi;return y(d,Ye(h,3))}function qS(d,h){var y=st(d)?eN:V_;return y(d,Ye(h,3))}var NL=Yf(function(d,h,y){Bt.call(d,y)?d[y].push(h):mi(d,y,[h])});function LL(d,h,y,C){d=pr(d)?d:_l(d),y=y&&!C?ut(y):0;var A=d.length;return y<0&&(y=Dn(A+y,0)),lh(d)?y<=A&&d.indexOf(h,y)>-1:!!A&&ul(d,h,y)>-1}var FL=vt(function(d,h,y){var C=-1,A=typeof h=="function",F=pr(d)?he(d.length):[];return Zi(d,function(W){F[++C]=A?kr(h,W,y):Jc(W,h,y)}),F}),zL=Yf(function(d,h,y){mi(d,y,h)});function rh(d,h){var y=st(d)?fn:K_;return y(d,Ye(h,3))}function jL(d,h,y,C){return d==null?[]:(st(h)||(h=h==null?[]:[h]),y=C?n:y,st(y)||(y=y==null?[]:[y]),Z_(d,h,y))}var BL=Yf(function(d,h,y){d[y?0:1].push(h)},function(){return[[],[]]});function VL(d,h,y){var C=st(d)?Am:S_,A=arguments.length<3;return C(d,Ye(h,4),y,A,Zi)}function HL(d,h,y){var C=st(d)?tN:S_,A=arguments.length<3;return C(d,Ye(h,4),y,A,V_)}function WL(d,h){var y=st(d)?Ki:H_;return y(d,sh(Ye(h,3)))}function UL(d){var h=st(d)?F_:L3;return h(d)}function qL(d,h,y){(y?sr(d,h,y):h===n)?h=1:h=ut(h);var C=st(d)?p3:F3;return C(d,h)}function GL(d){var h=st(d)?g3:j3;return h(d)}function YL(d){if(d==null)return 0;if(pr(d))return lh(d)?fl(d):d.length;var h=Xn(d);return h==_e||h==ct?d.size:Zm(d).length}function KL(d,h,y){var C=st(d)?Im:B3;return y&&sr(d,h,y)&&(h=n),C(d,Ye(h,3))}var XL=vt(function(d,h){if(d==null)return[];var y=h.length;return y>1&&sr(d,h[0],h[1])?h=[]:y>2&&sr(h[0],h[1],h[2])&&(h=[h[0]]),Z_(d,Hn(h,1),[])}),oh=DN||function(){return Vn.Date.now()};function QL(d,h){if(typeof h!="function")throw new ao(s);return d=ut(d),function(){if(--d<1)return h.apply(this,arguments)}}function GS(d,h,y){return h=y?n:h,h=d&&h==null?d.length:h,vi(d,k,n,n,n,n,h)}function YS(d,h){var y;if(typeof h!="function")throw new ao(s);return d=ut(d),function(){return--d>0&&(y=h.apply(this,arguments)),d<=1&&(h=n),y}}var Sv=vt(function(d,h,y){var C=x;if(y.length){var A=Qi(y,xl(Sv));C|=E}return vi(d,C,h,y,A)}),KS=vt(function(d,h,y){var C=x|w;if(y.length){var A=Qi(y,xl(KS));C|=E}return vi(h,C,d,y,A)});function XS(d,h,y){h=y?n:h;var C=vi(d,S,n,n,n,n,n,h);return C.placeholder=XS.placeholder,C}function QS(d,h,y){h=y?n:h;var C=vi(d,R,n,n,n,n,n,h);return C.placeholder=QS.placeholder,C}function JS(d,h,y){var C,A,F,W,Y,re,ve=0,ye=!1,we=!1,Ae=!0;if(typeof d!="function")throw new ao(s);h=ho(h)||0,pn(y)&&(ye=!!y.leading,we="maxWait"in y,F=we?Dn(ho(y.maxWait)||0,h):F,Ae="trailing"in y?!!y.trailing:Ae);function Be(wn){var Oo=C,_i=A;return C=A=n,ve=wn,W=d.apply(_i,Oo),W}function Ke(wn){return ve=wn,Y=ru(_t,h),ye?Be(wn):W}function pt(wn){var Oo=wn-re,_i=wn-ve,vC=h-Oo;return we?Kn(vC,F-_i):vC}function Xe(wn){var Oo=wn-re,_i=wn-ve;return re===n||Oo>=h||Oo<0||we&&_i>=F}function _t(){var wn=oh();if(Xe(wn))return Rt(wn);Y=ru(_t,pt(wn))}function Rt(wn){return Y=n,Ae&&C?Be(wn):(C=A=n,W)}function Nr(){Y!==n&&lS(Y),ve=0,C=re=A=Y=n}function ar(){return Y===n?W:Rt(oh())}function Lr(){var wn=oh(),Oo=Xe(wn);if(C=arguments,A=this,re=wn,Oo){if(Y===n)return Ke(re);if(we)return lS(Y),Y=ru(_t,h),Be(re)}return Y===n&&(Y=ru(_t,h)),W}return Lr.cancel=Nr,Lr.flush=ar,Lr}var JL=vt(function(d,h){return B_(d,1,h)}),ZL=vt(function(d,h,y){return B_(d,ho(h)||0,y)});function eF(d){return vi(d,D)}function ih(d,h){if(typeof d!="function"||h!=null&&typeof h!="function")throw new ao(s);var y=function(){var C=arguments,A=h?h.apply(this,C):C[0],F=y.cache;if(F.has(A))return F.get(A);var W=d.apply(this,C);return y.cache=F.set(A,W)||F,W};return y.cache=new(ih.Cache||gi),y}ih.Cache=gi;function sh(d){if(typeof d!="function")throw new ao(s);return function(){var h=arguments;switch(h.length){case 0:return!d.call(this);case 1:return!d.call(this,h[0]);case 2:return!d.call(this,h[0],h[1]);case 3:return!d.call(this,h[0],h[1],h[2])}return!d.apply(this,h)}}function tF(d){return YS(2,d)}var nF=V3(function(d,h){h=h.length==1&&st(h[0])?fn(h[0],Mr(Ye())):fn(Hn(h,1),Mr(Ye()));var y=h.length;return vt(function(C){for(var A=-1,F=Kn(C.length,y);++A<F;)C[A]=h[A].call(this,C[A]);return kr(d,this,C)})}),Cv=vt(function(d,h){var y=Qi(h,xl(Cv));return vi(d,E,n,h,y)}),ZS=vt(function(d,h){var y=Qi(h,xl(ZS));return vi(d,O,n,h,y)}),rF=bi(function(d,h){return vi(d,M,n,n,n,h)});function oF(d,h){if(typeof d!="function")throw new ao(s);return h=h===n?h:ut(h),vt(d,h)}function iF(d,h){if(typeof d!="function")throw new ao(s);return h=h==null?0:Dn(ut(h),0),vt(function(y){var C=y[h],A=ns(y,0,h);return C&&Xi(A,C),kr(d,this,A)})}function sF(d,h,y){var C=!0,A=!0;if(typeof d!="function")throw new ao(s);return pn(y)&&(C="leading"in y?!!y.leading:C,A="trailing"in y?!!y.trailing:A),JS(d,h,{leading:C,maxWait:h,trailing:A})}function aF(d){return GS(d,1)}function lF(d,h){return Cv(lv(h),d)}function cF(){if(!arguments.length)return[];var d=arguments[0];return st(d)?d:[d]}function uF(d){return co(d,g)}function dF(d,h){return h=typeof h=="function"?h:n,co(d,g,h)}function fF(d){return co(d,f|g)}function hF(d,h){return h=typeof h=="function"?h:n,co(d,f|g,h)}function pF(d,h){return h==null||j_(d,h,Nn(h))}function Po(d,h){return d===h||d!==d&&h!==h}var gF=Jf(Xm),mF=Jf(function(d,h){return d>=h}),ia=q_(function(){return arguments}())?q_:function(d){return mn(d)&&Bt.call(d,"callee")&&!k_.call(d,"callee")},st=he.isArray,vF=h_?Mr(h_):E3;function pr(d){return d!=null&&ah(d.length)&&!xi(d)}function xn(d){return mn(d)&&pr(d)}function bF(d){return d===!0||d===!1||mn(d)&&ir(d)==oe}var rs=kN||Iv,yF=p_?Mr(p_):R3;function xF(d){return mn(d)&&d.nodeType===1&&!ou(d)}function wF(d){if(d==null)return!0;if(pr(d)&&(st(d)||typeof d=="string"||typeof d.splice=="function"||rs(d)||wl(d)||ia(d)))return!d.length;var h=Xn(d);if(h==_e||h==ct)return!d.size;if(nu(d))return!Zm(d).length;for(var y in d)if(Bt.call(d,y))return!1;return!0}function _F(d,h){return Zc(d,h)}function SF(d,h,y){y=typeof y=="function"?y:n;var C=y?y(d,h):n;return C===n?Zc(d,h,n,y):!!C}function Ev(d){if(!mn(d))return!1;var h=ir(d);return h==be||h==ie||typeof d.message=="string"&&typeof d.name=="string"&&!ou(d)}function CF(d){return typeof d=="number"&&A_(d)}function xi(d){if(!pn(d))return!1;var h=ir(d);return h==G||h==me||h==fe||h==ke}function eC(d){return typeof d=="number"&&d==ut(d)}function ah(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=q}function pn(d){var h=typeof d;return d!=null&&(h=="object"||h=="function")}function mn(d){return d!=null&&typeof d=="object"}var tC=g_?Mr(g_):O3;function EF(d,h){return d===h||Jm(d,h,gv(h))}function RF(d,h,y){return y=typeof y=="function"?y:n,Jm(d,h,gv(h),y)}function PF(d){return nC(d)&&d!=+d}function OF(d){if(d7(d))throw new ot(i);return G_(d)}function $F(d){return d===null}function DF(d){return d==null}function nC(d){return typeof d=="number"||mn(d)&&ir(d)==Pe}function ou(d){if(!mn(d)||ir(d)!=Ve)return!1;var h=Af(d);if(h===null)return!0;var y=Bt.call(h,"constructor")&&h.constructor;return typeof y=="function"&&y instanceof y&&Df.call(y)==RN}var Rv=m_?Mr(m_):$3;function TF(d){return eC(d)&&d>=-q&&d<=q}var rC=v_?Mr(v_):D3;function lh(d){return typeof d=="string"||!st(d)&&mn(d)&&ir(d)==kt}function Ir(d){return typeof d=="symbol"||mn(d)&&ir(d)==Dt}var wl=b_?Mr(b_):T3;function kF(d){return d===n}function MF(d){return mn(d)&&Xn(d)==de}function AF(d){return mn(d)&&ir(d)==Se}var IF=Jf(ev),NF=Jf(function(d,h){return d<=h});function oC(d){if(!d)return[];if(pr(d))return lh(d)?Eo(d):hr(d);if(Uc&&d[Uc])return pN(d[Uc]());var h=Xn(d),y=h==_e?Bm:h==ct?Pf:_l;return y(d)}function wi(d){if(!d)return d===0?d:0;if(d=ho(d),d===H||d===-H){var h=d<0?-1:1;return h*Z}return d===d?d:0}function ut(d){var h=wi(d),y=h%1;return h===h?y?h-y:h:0}function iC(d){return d?ta(ut(d),0,V):0}function ho(d){if(typeof d=="number")return d;if(Ir(d))return T;if(pn(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=pn(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=C_(d);var y=Me.test(d);return y||nt.test(d)?Q5(d.slice(2),y?2:8):Ne.test(d)?T:+d}function sC(d){return Bo(d,gr(d))}function LF(d){return d?ta(ut(d),-q,q):d===0?d:0}function Nt(d){return d==null?"":Ar(d)}var FF=bl(function(d,h){if(nu(h)||pr(h)){Bo(h,Nn(h),d);return}for(var y in h)Bt.call(h,y)&&Xc(d,y,h[y])}),aC=bl(function(d,h){Bo(h,gr(h),d)}),ch=bl(function(d,h,y,C){Bo(h,gr(h),d,C)}),zF=bl(function(d,h,y,C){Bo(h,Nn(h),d,C)}),jF=bi(Gm);function BF(d,h){var y=vl(d);return h==null?y:z_(y,h)}var VF=vt(function(d,h){d=qt(d);var y=-1,C=h.length,A=C>2?h[2]:n;for(A&&sr(h[0],h[1],A)&&(C=1);++y<C;)for(var F=h[y],W=gr(F),Y=-1,re=W.length;++Y<re;){var ve=W[Y],ye=d[ve];(ye===n||Po(ye,pl[ve])&&!Bt.call(d,ve))&&(d[ve]=F[ve])}return d}),HF=vt(function(d){return d.push(n,CS),kr(lC,n,d)});function WF(d,h){return x_(d,Ye(h,3),jo)}function UF(d,h){return x_(d,Ye(h,3),Km)}function qF(d,h){return d==null?d:Ym(d,Ye(h,3),gr)}function GF(d,h){return d==null?d:W_(d,Ye(h,3),gr)}function YF(d,h){return d&&jo(d,Ye(h,3))}function KF(d,h){return d&&Km(d,Ye(h,3))}function XF(d){return d==null?[]:Wf(d,Nn(d))}function QF(d){return d==null?[]:Wf(d,gr(d))}function Pv(d,h,y){var C=d==null?n:na(d,h);return C===n?y:C}function JF(d,h){return d!=null&&PS(d,h,w3)}function Ov(d,h){return d!=null&&PS(d,h,_3)}var ZF=yS(function(d,h,y){h!=null&&typeof h.toString!="function"&&(h=Tf.call(h)),d[h]=y},Dv(mr)),e4=yS(function(d,h,y){h!=null&&typeof h.toString!="function"&&(h=Tf.call(h)),Bt.call(d,h)?d[h].push(y):d[h]=[y]},Ye),t4=vt(Jc);function Nn(d){return pr(d)?L_(d):Zm(d)}function gr(d){return pr(d)?L_(d,!0):k3(d)}function n4(d,h){var y={};return h=Ye(h,3),jo(d,function(C,A,F){mi(y,h(C,A,F),C)}),y}function r4(d,h){var y={};return h=Ye(h,3),jo(d,function(C,A,F){mi(y,A,h(C,A,F))}),y}var o4=bl(function(d,h,y){Uf(d,h,y)}),lC=bl(function(d,h,y,C){Uf(d,h,y,C)}),i4=bi(function(d,h){var y={};if(d==null)return y;var C=!1;h=fn(h,function(F){return F=ts(F,d),C||(C=F.length>1),F}),Bo(d,hv(d),y),C&&(y=co(y,f|p|g,Z3));for(var A=h.length;A--;)iv(y,h[A]);return y});function s4(d,h){return cC(d,sh(Ye(h)))}var a4=bi(function(d,h){return d==null?{}:A3(d,h)});function cC(d,h){if(d==null)return{};var y=fn(hv(d),function(C){return[C]});return h=Ye(h),eS(d,y,function(C,A){return h(C,A[0])})}function l4(d,h,y){h=ts(h,d);var C=-1,A=h.length;for(A||(A=1,d=n);++C<A;){var F=d==null?n:d[Vo(h[C])];F===n&&(C=A,F=y),d=xi(F)?F.call(d):F}return d}function c4(d,h,y){return d==null?d:eu(d,h,y)}function u4(d,h,y,C){return C=typeof C=="function"?C:n,d==null?d:eu(d,h,y,C)}var uC=_S(Nn),dC=_S(gr);function d4(d,h,y){var C=st(d),A=C||rs(d)||wl(d);if(h=Ye(h,4),y==null){var F=d&&d.constructor;A?y=C?new F:[]:pn(d)?y=xi(F)?vl(Af(d)):{}:y={}}return(A?so:jo)(d,function(W,Y,re){return h(y,W,Y,re)}),y}function f4(d,h){return d==null?!0:iv(d,h)}function h4(d,h,y){return d==null?d:iS(d,h,lv(y))}function p4(d,h,y,C){return C=typeof C=="function"?C:n,d==null?d:iS(d,h,lv(y),C)}function _l(d){return d==null?[]:jm(d,Nn(d))}function g4(d){return d==null?[]:jm(d,gr(d))}function m4(d,h,y){return y===n&&(y=h,h=n),y!==n&&(y=ho(y),y=y===y?y:0),h!==n&&(h=ho(h),h=h===h?h:0),ta(ho(d),h,y)}function v4(d,h,y){return h=wi(h),y===n?(y=h,h=0):y=wi(y),d=ho(d),S3(d,h,y)}function b4(d,h,y){if(y&&typeof y!="boolean"&&sr(d,h,y)&&(h=y=n),y===n&&(typeof h=="boolean"?(y=h,h=n):typeof d=="boolean"&&(y=d,d=n)),d===n&&h===n?(d=0,h=1):(d=wi(d),h===n?(h=d,d=0):h=wi(h)),d>h){var C=d;d=h,h=C}if(y||d%1||h%1){var A=I_();return Kn(d+A*(h-d+X5("1e-"+((A+"").length-1))),h)}return nv(d,h)}var y4=yl(function(d,h,y){return h=h.toLowerCase(),d+(y?fC(h):h)});function fC(d){return $v(Nt(d).toLowerCase())}function hC(d){return d=Nt(d),d&&d.replace(Ut,cN).replace(j5,"")}function x4(d,h,y){d=Nt(d),h=Ar(h);var C=d.length;y=y===n?C:ta(ut(y),0,C);var A=y;return y-=h.length,y>=0&&d.slice(y,A)==h}function w4(d){return d=Nt(d),d&&hi.test(d)?d.replace(yn,uN):d}function _4(d){return d=Nt(d),d&&Ys.test(d)?d.replace(Gs,"\\$&"):d}var S4=yl(function(d,h,y){return d+(y?"-":"")+h.toLowerCase()}),C4=yl(function(d,h,y){return d+(y?" ":"")+h.toLowerCase()}),E4=mS("toLowerCase");function R4(d,h,y){d=Nt(d),h=ut(h);var C=h?fl(d):0;if(!h||C>=h)return d;var A=(h-C)/2;return Qf(Ff(A),y)+d+Qf(Lf(A),y)}function P4(d,h,y){d=Nt(d),h=ut(h);var C=h?fl(d):0;return h&&C<h?d+Qf(h-C,y):d}function O4(d,h,y){d=Nt(d),h=ut(h);var C=h?fl(d):0;return h&&C<h?Qf(h-C,y)+d:d}function $4(d,h,y){return y||h==null?h=0:h&&(h=+h),NN(Nt(d).replace(Ks,""),h||0)}function D4(d,h,y){return(y?sr(d,h,y):h===n)?h=1:h=ut(h),rv(Nt(d),h)}function T4(){var d=arguments,h=Nt(d[0]);return d.length<3?h:h.replace(d[1],d[2])}var k4=yl(function(d,h,y){return d+(y?"_":"")+h.toLowerCase()});function M4(d,h,y){return y&&typeof y!="number"&&sr(d,h,y)&&(h=y=n),y=y===n?V:y>>>0,y?(d=Nt(d),d&&(typeof h=="string"||h!=null&&!Rv(h))&&(h=Ar(h),!h&&dl(d))?ns(Eo(d),0,y):d.split(h,y)):[]}var A4=yl(function(d,h,y){return d+(y?" ":"")+$v(h)});function I4(d,h,y){return d=Nt(d),y=y==null?0:ta(ut(y),0,d.length),h=Ar(h),d.slice(y,y+h.length)==h}function N4(d,h,y){var C=L.templateSettings;y&&sr(d,h,y)&&(h=n),d=Nt(d),h=ch({},h,C,SS);var A=ch({},h.imports,C.imports,SS),F=Nn(A),W=jm(A,F),Y,re,ve=0,ye=h.interpolate||In,we="__p += '",Ae=Vm((h.escape||In).source+"|"+ye.source+"|"+(ye===ll?je:In).source+"|"+(h.evaluate||In).source+"|$","g"),Be="//# sourceURL="+(Bt.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++U5+"]")+`
|
|
72
|
+
`;d.replace(Ae,function(Xe,_t,Rt,Nr,ar,Lr){return Rt||(Rt=Nr),we+=d.slice(ve,Lr).replace(Xs,dN),_t&&(Y=!0,we+=`' +
|
|
73
|
+
__e(`+_t+`) +
|
|
74
|
+
'`),ar&&(re=!0,we+=`';
|
|
75
|
+
`+ar+`;
|
|
76
|
+
__p += '`),Rt&&(we+=`' +
|
|
77
|
+
((__t = (`+Rt+`)) == null ? '' : __t) +
|
|
78
|
+
'`),ve=Lr+Xe.length,Xe}),we+=`';
|
|
79
|
+
`;var Ke=Bt.call(h,"variable")&&h.variable;if(!Ke)we=`with (obj) {
|
|
80
|
+
`+we+`
|
|
81
|
+
}
|
|
82
|
+
`;else if(ce.test(Ke))throw new ot(a);we=(re?we.replace(Ze,""):we).replace(Et,"$1").replace(Pt,"$1;"),we="function("+(Ke||"obj")+`) {
|
|
83
|
+
`+(Ke?"":`obj || (obj = {});
|
|
84
|
+
`)+"var __t, __p = ''"+(Y?", __e = _.escape":"")+(re?`, __j = Array.prototype.join;
|
|
85
|
+
function print() { __p += __j.call(arguments, '') }
|
|
86
|
+
`:`;
|
|
87
|
+
`)+we+`return __p
|
|
88
|
+
}`;var pt=gC(function(){return Mt(F,Be+"return "+we).apply(n,W)});if(pt.source=we,Ev(pt))throw pt;return pt}function L4(d){return Nt(d).toLowerCase()}function F4(d){return Nt(d).toUpperCase()}function z4(d,h,y){if(d=Nt(d),d&&(y||h===n))return C_(d);if(!d||!(h=Ar(h)))return d;var C=Eo(d),A=Eo(h),F=E_(C,A),W=R_(C,A)+1;return ns(C,F,W).join("")}function j4(d,h,y){if(d=Nt(d),d&&(y||h===n))return d.slice(0,O_(d)+1);if(!d||!(h=Ar(h)))return d;var C=Eo(d),A=R_(C,Eo(h))+1;return ns(C,0,A).join("")}function B4(d,h,y){if(d=Nt(d),d&&(y||h===n))return d.replace(Ks,"");if(!d||!(h=Ar(h)))return d;var C=Eo(d),A=E_(C,Eo(h));return ns(C,A).join("")}function V4(d,h){var y=I,C=z;if(pn(h)){var A="separator"in h?h.separator:A;y="length"in h?ut(h.length):y,C="omission"in h?Ar(h.omission):C}d=Nt(d);var F=d.length;if(dl(d)){var W=Eo(d);F=W.length}if(y>=F)return d;var Y=y-fl(C);if(Y<1)return C;var re=W?ns(W,0,Y).join(""):d.slice(0,Y);if(A===n)return re+C;if(W&&(Y+=re.length-Y),Rv(A)){if(d.slice(Y).search(A)){var ve,ye=re;for(A.global||(A=Vm(A.source,Nt(He.exec(A))+"g")),A.lastIndex=0;ve=A.exec(ye);)var we=ve.index;re=re.slice(0,we===n?Y:we)}}else if(d.indexOf(Ar(A),Y)!=Y){var Ae=re.lastIndexOf(A);Ae>-1&&(re=re.slice(0,Ae))}return re+C}function H4(d){return d=Nt(d),d&&fr.test(d)?d.replace(Wt,bN):d}var W4=yl(function(d,h,y){return d+(y?" ":"")+h.toUpperCase()}),$v=mS("toUpperCase");function pC(d,h,y){return d=Nt(d),h=y?n:h,h===n?hN(d)?wN(d):oN(d):d.match(h)||[]}var gC=vt(function(d,h){try{return kr(d,n,h)}catch(y){return Ev(y)?y:new ot(y)}}),U4=bi(function(d,h){return so(h,function(y){y=Vo(y),mi(d,y,Sv(d[y],d))}),d});function q4(d){var h=d==null?0:d.length,y=Ye();return d=h?fn(d,function(C){if(typeof C[1]!="function")throw new ao(s);return[y(C[0]),C[1]]}):[],vt(function(C){for(var A=-1;++A<h;){var F=d[A];if(kr(F[0],this,C))return kr(F[1],this,C)}})}function G4(d){return b3(co(d,f))}function Dv(d){return function(){return d}}function Y4(d,h){return d==null||d!==d?h:d}var K4=bS(),X4=bS(!0);function mr(d){return d}function Tv(d){return Y_(typeof d=="function"?d:co(d,f))}function Q4(d){return X_(co(d,f))}function J4(d,h){return Q_(d,co(h,f))}var Z4=vt(function(d,h){return function(y){return Jc(y,d,h)}}),e6=vt(function(d,h){return function(y){return Jc(d,y,h)}});function kv(d,h,y){var C=Nn(h),A=Wf(h,C);y==null&&!(pn(h)&&(A.length||!C.length))&&(y=h,h=d,d=this,A=Wf(h,Nn(h)));var F=!(pn(y)&&"chain"in y)||!!y.chain,W=xi(d);return so(A,function(Y){var re=h[Y];d[Y]=re,W&&(d.prototype[Y]=function(){var ve=this.__chain__;if(F||ve){var ye=d(this.__wrapped__),we=ye.__actions__=hr(this.__actions__);return we.push({func:re,args:arguments,thisArg:d}),ye.__chain__=ve,ye}return re.apply(d,Xi([this.value()],arguments))})}),d}function t6(){return Vn._===this&&(Vn._=PN),this}function Mv(){}function n6(d){return d=ut(d),vt(function(h){return J_(h,d)})}var r6=uv(fn),o6=uv(y_),i6=uv(Im);function mC(d){return vv(d)?Nm(Vo(d)):I3(d)}function s6(d){return function(h){return d==null?n:na(d,h)}}var a6=xS(),l6=xS(!0);function Av(){return[]}function Iv(){return!1}function c6(){return{}}function u6(){return""}function d6(){return!0}function f6(d,h){if(d=ut(d),d<1||d>q)return[];var y=V,C=Kn(d,V);h=Ye(h),d-=V;for(var A=zm(C,h);++y<d;)h(y);return A}function h6(d){return st(d)?fn(d,Vo):Ir(d)?[d]:hr(NS(Nt(d)))}function p6(d){var h=++EN;return Nt(d)+h}var g6=Xf(function(d,h){return d+h},0),m6=dv("ceil"),v6=Xf(function(d,h){return d/h},1),b6=dv("floor");function y6(d){return d&&d.length?Hf(d,mr,Xm):n}function x6(d,h){return d&&d.length?Hf(d,Ye(h,2),Xm):n}function w6(d){return __(d,mr)}function _6(d,h){return __(d,Ye(h,2))}function S6(d){return d&&d.length?Hf(d,mr,ev):n}function C6(d,h){return d&&d.length?Hf(d,Ye(h,2),ev):n}var E6=Xf(function(d,h){return d*h},1),R6=dv("round"),P6=Xf(function(d,h){return d-h},0);function O6(d){return d&&d.length?Fm(d,mr):0}function $6(d,h){return d&&d.length?Fm(d,Ye(h,2)):0}return L.after=QL,L.ary=GS,L.assign=FF,L.assignIn=aC,L.assignInWith=ch,L.assignWith=zF,L.at=jF,L.before=YS,L.bind=Sv,L.bindAll=U4,L.bindKey=KS,L.castArray=cF,L.chain=WS,L.chunk=b7,L.compact=y7,L.concat=x7,L.cond=q4,L.conforms=G4,L.constant=Dv,L.countBy=OL,L.create=BF,L.curry=XS,L.curryRight=QS,L.debounce=JS,L.defaults=VF,L.defaultsDeep=HF,L.defer=JL,L.delay=ZL,L.difference=w7,L.differenceBy=_7,L.differenceWith=S7,L.drop=C7,L.dropRight=E7,L.dropRightWhile=R7,L.dropWhile=P7,L.fill=O7,L.filter=DL,L.flatMap=ML,L.flatMapDeep=AL,L.flatMapDepth=IL,L.flatten=jS,L.flattenDeep=$7,L.flattenDepth=D7,L.flip=eF,L.flow=K4,L.flowRight=X4,L.fromPairs=T7,L.functions=XF,L.functionsIn=QF,L.groupBy=NL,L.initial=M7,L.intersection=A7,L.intersectionBy=I7,L.intersectionWith=N7,L.invert=ZF,L.invertBy=e4,L.invokeMap=FL,L.iteratee=Tv,L.keyBy=zL,L.keys=Nn,L.keysIn=gr,L.map=rh,L.mapKeys=n4,L.mapValues=r4,L.matches=Q4,L.matchesProperty=J4,L.memoize=ih,L.merge=o4,L.mergeWith=lC,L.method=Z4,L.methodOf=e6,L.mixin=kv,L.negate=sh,L.nthArg=n6,L.omit=i4,L.omitBy=s4,L.once=tF,L.orderBy=jL,L.over=r6,L.overArgs=nF,L.overEvery=o6,L.overSome=i6,L.partial=Cv,L.partialRight=ZS,L.partition=BL,L.pick=a4,L.pickBy=cC,L.property=mC,L.propertyOf=s6,L.pull=j7,L.pullAll=VS,L.pullAllBy=B7,L.pullAllWith=V7,L.pullAt=H7,L.range=a6,L.rangeRight=l6,L.rearg=rF,L.reject=WL,L.remove=W7,L.rest=oF,L.reverse=wv,L.sampleSize=qL,L.set=c4,L.setWith=u4,L.shuffle=GL,L.slice=U7,L.sortBy=XL,L.sortedUniq=J7,L.sortedUniqBy=Z7,L.split=M4,L.spread=iF,L.tail=eL,L.take=tL,L.takeRight=nL,L.takeRightWhile=rL,L.takeWhile=oL,L.tap=yL,L.throttle=sF,L.thru=nh,L.toArray=oC,L.toPairs=uC,L.toPairsIn=dC,L.toPath=h6,L.toPlainObject=sC,L.transform=d4,L.unary=aF,L.union=iL,L.unionBy=sL,L.unionWith=aL,L.uniq=lL,L.uniqBy=cL,L.uniqWith=uL,L.unset=f4,L.unzip=_v,L.unzipWith=HS,L.update=h4,L.updateWith=p4,L.values=_l,L.valuesIn=g4,L.without=dL,L.words=pC,L.wrap=lF,L.xor=fL,L.xorBy=hL,L.xorWith=pL,L.zip=gL,L.zipObject=mL,L.zipObjectDeep=vL,L.zipWith=bL,L.entries=uC,L.entriesIn=dC,L.extend=aC,L.extendWith=ch,kv(L,L),L.add=g6,L.attempt=gC,L.camelCase=y4,L.capitalize=fC,L.ceil=m6,L.clamp=m4,L.clone=uF,L.cloneDeep=fF,L.cloneDeepWith=hF,L.cloneWith=dF,L.conformsTo=pF,L.deburr=hC,L.defaultTo=Y4,L.divide=v6,L.endsWith=x4,L.eq=Po,L.escape=w4,L.escapeRegExp=_4,L.every=$L,L.find=TL,L.findIndex=FS,L.findKey=WF,L.findLast=kL,L.findLastIndex=zS,L.findLastKey=UF,L.floor=b6,L.forEach=US,L.forEachRight=qS,L.forIn=qF,L.forInRight=GF,L.forOwn=YF,L.forOwnRight=KF,L.get=Pv,L.gt=gF,L.gte=mF,L.has=JF,L.hasIn=Ov,L.head=BS,L.identity=mr,L.includes=LL,L.indexOf=k7,L.inRange=v4,L.invoke=t4,L.isArguments=ia,L.isArray=st,L.isArrayBuffer=vF,L.isArrayLike=pr,L.isArrayLikeObject=xn,L.isBoolean=bF,L.isBuffer=rs,L.isDate=yF,L.isElement=xF,L.isEmpty=wF,L.isEqual=_F,L.isEqualWith=SF,L.isError=Ev,L.isFinite=CF,L.isFunction=xi,L.isInteger=eC,L.isLength=ah,L.isMap=tC,L.isMatch=EF,L.isMatchWith=RF,L.isNaN=PF,L.isNative=OF,L.isNil=DF,L.isNull=$F,L.isNumber=nC,L.isObject=pn,L.isObjectLike=mn,L.isPlainObject=ou,L.isRegExp=Rv,L.isSafeInteger=TF,L.isSet=rC,L.isString=lh,L.isSymbol=Ir,L.isTypedArray=wl,L.isUndefined=kF,L.isWeakMap=MF,L.isWeakSet=AF,L.join=L7,L.kebabCase=S4,L.last=fo,L.lastIndexOf=F7,L.lowerCase=C4,L.lowerFirst=E4,L.lt=IF,L.lte=NF,L.max=y6,L.maxBy=x6,L.mean=w6,L.meanBy=_6,L.min=S6,L.minBy=C6,L.stubArray=Av,L.stubFalse=Iv,L.stubObject=c6,L.stubString=u6,L.stubTrue=d6,L.multiply=E6,L.nth=z7,L.noConflict=t6,L.noop=Mv,L.now=oh,L.pad=R4,L.padEnd=P4,L.padStart=O4,L.parseInt=$4,L.random=b4,L.reduce=VL,L.reduceRight=HL,L.repeat=D4,L.replace=T4,L.result=l4,L.round=R6,L.runInContext=te,L.sample=UL,L.size=YL,L.snakeCase=k4,L.some=KL,L.sortedIndex=q7,L.sortedIndexBy=G7,L.sortedIndexOf=Y7,L.sortedLastIndex=K7,L.sortedLastIndexBy=X7,L.sortedLastIndexOf=Q7,L.startCase=A4,L.startsWith=I4,L.subtract=P6,L.sum=O6,L.sumBy=$6,L.template=N4,L.times=f6,L.toFinite=wi,L.toInteger=ut,L.toLength=iC,L.toLower=L4,L.toNumber=ho,L.toSafeInteger=LF,L.toString=Nt,L.toUpper=F4,L.trim=z4,L.trimEnd=j4,L.trimStart=B4,L.truncate=V4,L.unescape=H4,L.uniqueId=p6,L.upperCase=W4,L.upperFirst=$v,L.each=US,L.eachRight=qS,L.first=BS,kv(L,function(){var d={};return jo(L,function(h,y){Bt.call(L.prototype,y)||(d[y]=h)}),d}(),{chain:!1}),L.VERSION=r,so(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){L[d].placeholder=L}),so(["drop","take"],function(d,h){Ct.prototype[d]=function(y){y=y===n?1:Dn(ut(y),0);var C=this.__filtered__&&!h?new Ct(this):this.clone();return C.__filtered__?C.__takeCount__=Kn(y,C.__takeCount__):C.__views__.push({size:Kn(y,V),type:d+(C.__dir__<0?"Right":"")}),C},Ct.prototype[d+"Right"]=function(y){return this.reverse()[d](y).reverse()}}),so(["filter","map","takeWhile"],function(d,h){var y=h+1,C=y==U||y==K;Ct.prototype[d]=function(A){var F=this.clone();return F.__iteratees__.push({iteratee:Ye(A,3),type:y}),F.__filtered__=F.__filtered__||C,F}}),so(["head","last"],function(d,h){var y="take"+(h?"Right":"");Ct.prototype[d]=function(){return this[y](1).value()[0]}}),so(["initial","tail"],function(d,h){var y="drop"+(h?"":"Right");Ct.prototype[d]=function(){return this.__filtered__?new Ct(this):this[y](1)}}),Ct.prototype.compact=function(){return this.filter(mr)},Ct.prototype.find=function(d){return this.filter(d).head()},Ct.prototype.findLast=function(d){return this.reverse().find(d)},Ct.prototype.invokeMap=vt(function(d,h){return typeof d=="function"?new Ct(this):this.map(function(y){return Jc(y,d,h)})}),Ct.prototype.reject=function(d){return this.filter(sh(Ye(d)))},Ct.prototype.slice=function(d,h){d=ut(d);var y=this;return y.__filtered__&&(d>0||h<0)?new Ct(y):(d<0?y=y.takeRight(-d):d&&(y=y.drop(d)),h!==n&&(h=ut(h),y=h<0?y.dropRight(-h):y.take(h-d)),y)},Ct.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},Ct.prototype.toArray=function(){return this.take(V)},jo(Ct.prototype,function(d,h){var y=/^(?:filter|find|map|reject)|While$/.test(h),C=/^(?:head|last)$/.test(h),A=L[C?"take"+(h=="last"?"Right":""):h],F=C||/^find/.test(h);A&&(L.prototype[h]=function(){var W=this.__wrapped__,Y=C?[1]:arguments,re=W instanceof Ct,ve=Y[0],ye=re||st(W),we=function(_t){var Rt=A.apply(L,Xi([_t],Y));return C&&Ae?Rt[0]:Rt};ye&&y&&typeof ve=="function"&&ve.length!=1&&(re=ye=!1);var Ae=this.__chain__,Be=!!this.__actions__.length,Ke=F&&!Ae,pt=re&&!Be;if(!F&&ye){W=pt?W:new Ct(this);var Xe=d.apply(W,Y);return Xe.__actions__.push({func:nh,args:[we],thisArg:n}),new lo(Xe,Ae)}return Ke&&pt?d.apply(this,Y):(Xe=this.thru(we),Ke?C?Xe.value()[0]:Xe.value():Xe)})}),so(["pop","push","shift","sort","splice","unshift"],function(d){var h=Of[d],y=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",C=/^(?:pop|shift)$/.test(d);L.prototype[d]=function(){var A=arguments;if(C&&!this.__chain__){var F=this.value();return h.apply(st(F)?F:[],A)}return this[y](function(W){return h.apply(st(W)?W:[],A)})}}),jo(Ct.prototype,function(d,h){var y=L[h];if(y){var C=y.name+"";Bt.call(ml,C)||(ml[C]=[]),ml[C].push({name:h,func:y})}}),ml[Kf(n,w).name]=[{name:"wrapper",func:n}],Ct.prototype.clone=HN,Ct.prototype.reverse=WN,Ct.prototype.value=UN,L.prototype.at=xL,L.prototype.chain=wL,L.prototype.commit=_L,L.prototype.next=SL,L.prototype.plant=EL,L.prototype.reverse=RL,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=PL,L.prototype.first=L.prototype.head,Uc&&(L.prototype[Uc]=CL),L},hl=_N();Qs?((Qs.exports=hl)._=hl,Tm._=hl):Vn._=hl}).call(ms)})(Tp,Tp.exports);var Ll=Tp.exports;const Fi=Oc(Ll);function LC({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};t||(t={}),RO.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]}),t[l].push(a)})}function FC(e,t){t&&RO.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const Te=pO()(wO((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:E0},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&Ll.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.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}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Ll.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.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&&Ll.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.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&&Ll.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.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(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(p=>p.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&Ll.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(p=>p.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n];const o=(s=r.dashboard.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId);LC({id:n.id,layouts:o==null?void 0:o.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);const l=(s=r.dashboard.sheets)==null?void 0:s.find(c=>c.id===r.selectedSheetId);FC(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,p;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(g=>g.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(g=>g.id===r);if(a){const g=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===o.id);g>-1&&((p=a.cards)==null||p.splice(g,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0,p=0;o==="start"&&(f=0),LC({id:r.id,layouts:s.layouts,minH:10,x:p,y:f}),(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(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),FC(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(g=>g.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.splice(s,1),(p=o.onRemoveCard)==null||p.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(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}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const 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},handleDataPointClickAction:(n,r)=>{Q9({card:n,dataPoint:r,set:e,get:t})}}}))),Wi=()=>Te(e=>e.actions);var Qd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},pc=typeof window>"u"||"Deno"in window;function bo(){}function J9(e,t){return typeof e=="function"?e(t):e}function R0(e){return typeof e=="number"&&e>=0&&e!==1/0}function OO(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zC(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==px(s,t.options))return!1}else if(!ed(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function jC(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Zu(t.options.mutationKey)!==Zu(i))return!1}else if(!ed(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function px(e,t){return((t==null?void 0:t.queryKeyHashFn)||Zu)(e)}function Zu(e){return JSON.stringify(e,(t,n)=>O0(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ed(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ed(e[n],t[n])):!1}function $O(e,t){if(e===t)return e;const n=BC(e)&&BC(t);if(n||O0(e)&&O0(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&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=$O(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function P0(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function BC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O0(e){if(!VC(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!VC(n)||!n.hasOwnProperty("isPrototypeOf"))}function VC(e){return Object.prototype.toString.call(e)==="[object Object]"}function Z9(e){return new Promise(t=>{setTimeout(t,e)})}function $0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$O(e,t):t}function e8(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function t8(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ra,vs,Xl,XP,n8=(XP=class extends Qd{constructor(){super();We(this,Ra,void 0);We(this,vs,void 0);We(this,Xl,void 0);Le(this,Xl,t=>{if(!pc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ne(this,vs)||this.setEventListener(ne(this,Xl))}onUnsubscribe(){var t;this.hasListeners()||((t=ne(this,vs))==null||t.call(this),Le(this,vs,void 0))}setEventListener(t){var n;Le(this,Xl,t),(n=ne(this,vs))==null||n.call(this),Le(this,vs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ne(this,Ra)!==t&&(Le(this,Ra,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof ne(this,Ra)=="boolean"?ne(this,Ra):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ra=new WeakMap,vs=new WeakMap,Xl=new WeakMap,XP),kp=new n8,Ql,bs,Jl,QP,r8=(QP=class extends Qd{constructor(){super();We(this,Ql,!0);We(this,bs,void 0);We(this,Jl,void 0);Le(this,Jl,t=>{if(!pc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ne(this,bs)||this.setEventListener(ne(this,Jl))}onUnsubscribe(){var t;this.hasListeners()||((t=ne(this,bs))==null||t.call(this),Le(this,bs,void 0))}setEventListener(t){var n;Le(this,Jl,t),(n=ne(this,bs))==null||n.call(this),Le(this,bs,t(this.setOnline.bind(this)))}setOnline(t){ne(this,Ql)!==t&&(Le(this,Ql,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ne(this,Ql)}},Ql=new WeakMap,bs=new WeakMap,Jl=new WeakMap,QP),Mp=new r8;function o8(e){return Math.min(1e3*2**e,3e4)}function xg(e){return(e??"online")==="online"?Mp.isOnline():!0}var DO=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Wv(e){return e instanceof DO}function TO(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((x,w)=>{i=x,s=w}),l=x=>{var w;r||(g(new DO(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!kp.isFocused()||e.networkMode!=="always"&&!Mp.isOnline(),p=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),o==null||o(),i(x))},g=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),o==null||o(),s(x))},v=()=>new Promise(x=>{var w;o=_=>{const S=r||!f();return S&&x(_),S},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;o=void 0,r||(x=e.onContinue)==null||x.call(e)}),b=()=>{if(r)return;let x;try{x=e.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(p).catch(w=>{var O;if(r)return;const _=e.retry??(pc?0:3),S=e.retryDelay??o8,R=typeof S=="function"?S(n,w):S,E=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,w);if(t||!E){g(w);return}n++,(O=e.onFail)==null||O.call(e,n,w),Z9(R).then(()=>{if(f())return v()}).then(()=>{t?g(w):b()})})};return xg(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function i8(){let e=[],t=0,n=p=>{p()},r=p=>{p()},o=p=>setTimeout(p,0);const i=p=>{o=p},s=p=>{let g;t++;try{g=p()}finally{t--,t||c()}return g},a=p=>{t?e.push(p):o(()=>{n(p)})},l=p=>(...g)=>{a(()=>{p(...g)})},c=()=>{const p=e;e=[],p.length&&o(()=>{r(()=>{p.forEach(g=>{n(g)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:i}}var qn=i8(),Pa,JP,kO=(JP=class{constructor(){We(this,Pa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),R0(this.gcTime)&&Le(this,Pa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pc?1/0:5*60*1e3))}clearGcTimeout(){ne(this,Pa)&&(clearTimeout(ne(this,Pa)),Le(this,Pa,void 0))}},Pa=new WeakMap,JP),Zl,ec,go,ys,mo,Ln,Ld,Oa,tc,hp,To,Ri,ZP,s8=(ZP=class extends kO{constructor(t){super();We(this,tc);We(this,To);We(this,Zl,void 0);We(this,ec,void 0);We(this,go,void 0);We(this,ys,void 0);We(this,mo,void 0);We(this,Ln,void 0);We(this,Ld,void 0);We(this,Oa,void 0);Le(this,Oa,!1),Le(this,Ld,t.defaultOptions),bt(this,tc,hp).call(this,t.options),Le(this,Ln,[]),Le(this,go,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Le(this,Zl,t.state||a8(this.options)),this.state=ne(this,Zl),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ne(this,Ln).length&&this.state.fetchStatus==="idle"&&ne(this,go).remove(this)}setData(t,n){const r=$0(this.state.data,t,this.options);return bt(this,To,Ri).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){bt(this,To,Ri).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=ne(this,ys);return(r=ne(this,mo))==null||r.cancel(t),n?n.then(bo).catch(bo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ne(this,Zl))}isActive(){return ne(this,Ln).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ne(this,Ln).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!OO(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=ne(this,Ln).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ne(this,mo))==null||n.continue()}onOnline(){var n;const t=ne(this,Ln).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ne(this,mo))==null||n.continue()}addObserver(t){ne(this,Ln).includes(t)||(ne(this,Ln).push(t),this.clearGcTimeout(),ne(this,go).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){ne(this,Ln).includes(t)&&(Le(this,Ln,ne(this,Ln).filter(n=>n!==t)),ne(this,Ln).length||(ne(this,mo)&&(ne(this,Oa)?ne(this,mo).cancel({revert:!0}):ne(this,mo).cancelRetry()),this.scheduleGc()),ne(this,go).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return ne(this,Ln).length}invalidate(){this.state.isInvalidated||bt(this,To,Ri).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ne(this,ys))return(c=ne(this,mo))==null||c.continueRetry(),ne(this,ys)}if(t&&bt(this,tc,hp).call(this,t),!this.options.queryFn){const g=ne(this,Ln).find(v=>v.options.queryFn);g&&bt(this,tc,hp).call(this,g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(Le(this,Oa,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Le(this,Oa,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Le(this,ec,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&bt(this,To,Ri).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=g=>{var v,b,x,w;Wv(g)&&g.silent||bt(this,To,Ri).call(this,{type:"error",error:g}),Wv(g)||((b=(v=ne(this,go).config).onError)==null||b.call(v,g,this),(w=(x=ne(this,go).config).onSettled)==null||w.call(x,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Le(this,mo,TO({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var v,b,x,w;if(typeof g>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(b=(v=ne(this,go).config).onSuccess)==null||b.call(v,g,this),(w=(x=ne(this,go).config).onSettled)==null||w.call(x,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,v)=>{bt(this,To,Ri).call(this,{type:"failed",failureCount:g,error:v})},onPause:()=>{bt(this,To,Ri).call(this,{type:"pause"})},onContinue:()=>{bt(this,To,Ri).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Le(this,ys,ne(this,mo).promise),ne(this,ys)}},Zl=new WeakMap,ec=new WeakMap,go=new WeakMap,ys=new WeakMap,mo=new WeakMap,Ln=new WeakMap,Ld=new WeakMap,Oa=new WeakMap,tc=new WeakSet,hp=function(t){this.options={...ne(this,Ld),...t},this.updateGcTime(this.options.gcTime)},To=new WeakSet,Ri=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:xg(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Wv(o)&&o.revert&&ne(this,ec)?{...ne(this,ec),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),qn.batch(()=>{ne(this,Ln).forEach(r=>{r.onQueryUpdate()}),ne(this,go).notify({query:this,type:"updated",action:t})})},ZP);function a8(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Go,eO,MO=(eO=class extends Qd{constructor(t={}){super();We(this,Go,void 0);this.config=t,Le(this,Go,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??px(o,n);let s=this.get(i);return s||(s=new s8({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ne(this,Go).has(t.queryHash)||(ne(this,Go).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ne(this,Go).get(t.queryHash);n&&(t.destroy(),n===t&&ne(this,Go).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ne(this,Go).get(t)}getAll(){return[...ne(this,Go).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>zC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>zC(t,r)):n}notify(t){qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Go=new WeakMap,eO),Yo,Fd,Vr,nc,Ko,fs,tO,l8=(tO=class extends kO{constructor(t){super();We(this,Ko);We(this,Yo,void 0);We(this,Fd,void 0);We(this,Vr,void 0);We(this,nc,void 0);this.mutationId=t.mutationId,Le(this,Fd,t.defaultOptions),Le(this,Vr,t.mutationCache),Le(this,Yo,[]),this.state=t.state||c8(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...ne(this,Fd),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ne(this,Yo).includes(t)||(ne(this,Yo).push(t),this.clearGcTimeout(),ne(this,Vr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Le(this,Yo,ne(this,Yo).filter(n=>n!==t)),this.scheduleGc(),ne(this,Vr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ne(this,Yo).length||(this.state.status==="pending"?this.scheduleGc():ne(this,Vr).remove(this))}continue(){var t;return((t=ne(this,nc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,p,g,v,b,x,w,_,S,R,E,O,k;const n=()=>(Le(this,nc,TO({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,D)=>{bt(this,Ko,fs).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{bt(this,Ko,fs).call(this,{type:"pause"})},onContinue:()=>{bt(this,Ko,fs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ne(this,nc).promise),r=this.state.status==="pending";try{if(!r){bt(this,Ko,fs).call(this,{type:"pending",variables:t}),await((i=(o=ne(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&&bt(this,Ko,fs).call(this,{type:"pending",context:D,variables:t})}const M=await n();return await((c=(l=ne(this,Vr).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,M,t,this.state.context)),await((g=(p=ne(this,Vr).config).onSettled)==null?void 0:g.call(p,M,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,M,null,t,this.state.context)),bt(this,Ko,fs).call(this,{type:"success",data:M}),M}catch(M){try{throw await((w=(x=ne(this,Vr).config).onError)==null?void 0:w.call(x,M,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,M,t,this.state.context)),await((E=(R=ne(this,Vr).config).onSettled)==null?void 0:E.call(R,void 0,M,this.state.variables,this.state.context,this)),await((k=(O=this.options).onSettled)==null?void 0:k.call(O,void 0,M,t,this.state.context)),M}finally{bt(this,Ko,fs).call(this,{type:"error",error:M})}}}},Yo=new WeakMap,Fd=new WeakMap,Vr=new WeakMap,nc=new WeakMap,Ko=new WeakSet,fs=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:!xg(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),qn.batch(()=>{ne(this,Yo).forEach(r=>{r.onMutationUpdate(t)}),ne(this,Vr).notify({mutation:this,type:"updated",action:t})})},tO);function c8(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vo,zd,$a,nO,u8=(nO=class extends Qd{constructor(t={}){super();We(this,vo,void 0);We(this,zd,void 0);We(this,$a,void 0);this.config=t,Le(this,vo,[]),Le(this,zd,0)}build(t,n,r){const o=new l8({mutationCache:this,mutationId:++uh(this,zd)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ne(this,vo).push(t),this.notify({type:"added",mutation:t})}remove(t){Le(this,vo,ne(this,vo).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){qn.batch(()=>{ne(this,vo).forEach(t=>{this.remove(t)})})}getAll(){return ne(this,vo)}find(t){const n={exact:!0,...t};return ne(this,vo).find(r=>jC(n,r))}findAll(t={}){return ne(this,vo).filter(n=>jC(t,n))}notify(t){qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Le(this,$a,(ne(this,$a)??Promise.resolve()).then(()=>{const t=ne(this,vo).filter(n=>n.state.isPaused);return qn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(bo)),Promise.resolve()))}).then(()=>{Le(this,$a,void 0)})),ne(this,$a)}},vo=new WeakMap,zd=new WeakMap,$a=new WeakMap,nO);function d8(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,x,w,_;const o=t.options,i=(x=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:x.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(S,R,E)=>{if(c)return Promise.reject();if(R==null&&S.pages.length)return Promise.resolve(S);const O={queryKey:t.queryKey,pageParam:R,direction:E?"backward":"forward",meta:t.options.meta};u(O);const k=await f(O),{maxPages:M}=t.options,D=E?t8:e8;return{pages:D(S.pages,k,M),pageParams:D(S.pageParams,R,M)}};let g;if(i&&s.length){const S=i==="backward",R=S?f8:HC,E={pages:s,pageParams:a},O=R(o,E);g=await p(E,O,S)}else{g=await p(l,a[0]??o.initialPageParam);const S=e??s.length;for(let R=1;R<S;R++){const E=HC(o,g);g=await p(g,E)}}return g};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function HC(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function f8(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var Tn,xs,ws,rc,oc,_s,ic,sc,rO,h8=(rO=class{constructor(e={}){We(this,Tn,void 0);We(this,xs,void 0);We(this,ws,void 0);We(this,rc,void 0);We(this,oc,void 0);We(this,_s,void 0);We(this,ic,void 0);We(this,sc,void 0);Le(this,Tn,e.queryCache||new MO),Le(this,xs,e.mutationCache||new u8),Le(this,ws,e.defaultOptions||{}),Le(this,rc,new Map),Le(this,oc,new Map),Le(this,_s,0)}mount(){uh(this,_s)._++,ne(this,_s)===1&&(Le(this,ic,kp.subscribe(()=>{kp.isFocused()&&(this.resumePausedMutations(),ne(this,Tn).onFocus())})),Le(this,sc,Mp.subscribe(()=>{Mp.isOnline()&&(this.resumePausedMutations(),ne(this,Tn).onOnline())})))}unmount(){var e,t;uh(this,_s)._--,ne(this,_s)===0&&((e=ne(this,ic))==null||e.call(this),Le(this,ic,void 0),(t=ne(this,sc))==null||t.call(this),Le(this,sc,void 0))}isFetching(e){return ne(this,Tn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ne(this,xs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=ne(this,Tn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=ne(this,Tn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=J9(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return ne(this,Tn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return qn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=ne(this,Tn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=ne(this,Tn);qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ne(this,Tn),r={type:"active",...e};return qn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=qn.batch(()=>ne(this,Tn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(bo).catch(bo)}invalidateQueries(e={},t={}){return qn.batch(()=>{if(ne(this,Tn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=qn.batch(()=>ne(this,Tn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(bo)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(bo)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=ne(this,Tn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(bo).catch(bo)}fetchInfiniteQuery(e){return e.behavior=d8(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(bo).catch(bo)}resumePausedMutations(){return ne(this,xs).resumePausedMutations()}getQueryCache(){return ne(this,Tn)}getMutationCache(){return ne(this,xs)}getDefaultOptions(){return ne(this,ws)}setDefaultOptions(e){Le(this,ws,e)}setQueryDefaults(e,t){ne(this,rc).set(Zu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ne(this,rc).values()];let n={};return t.forEach(r=>{ed(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){ne(this,oc).set(Zu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ne(this,oc).values()];let n={};return t.forEach(r=>{ed(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...ne(this,ws).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=px(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ne(this,ws).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ne(this,Tn).clear(),ne(this,xs).clear()}},Tn=new WeakMap,xs=new WeakMap,ws=new WeakMap,rc=new WeakMap,oc=new WeakMap,_s=new WeakMap,ic=new WeakMap,sc=new WeakMap,rO),_r,rn,jd,cr,Da,ac,Xo,Bd,lc,cc,Ta,ka,Ss,uc,Ma,Cu,Vd,D0,Hd,T0,Wd,k0,Ud,M0,qd,A0,Gd,I0,Yd,N0,pg,AO,oO,p8=(oO=class extends Qd{constructor(t,n){super();We(this,Ma);We(this,Vd);We(this,Hd);We(this,Wd);We(this,Ud);We(this,qd);We(this,Gd);We(this,Yd);We(this,pg);We(this,_r,void 0);We(this,rn,void 0);We(this,jd,void 0);We(this,cr,void 0);We(this,Da,void 0);We(this,ac,void 0);We(this,Xo,void 0);We(this,Bd,void 0);We(this,lc,void 0);We(this,cc,void 0);We(this,Ta,void 0);We(this,ka,void 0);We(this,Ss,void 0);We(this,uc,new Set);this.options=n,Le(this,_r,t),Le(this,Xo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ne(this,rn).addObserver(this),WC(ne(this,rn),this.options)?bt(this,Ma,Cu).call(this):this.updateResult(),bt(this,Ud,M0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L0(ne(this,rn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L0(ne(this,rn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,bt(this,qd,A0).call(this),bt(this,Gd,I0).call(this),ne(this,rn).removeObserver(this)}setOptions(t,n){const r=this.options,o=ne(this,rn);if(this.options=ne(this,_r).defaultQueryOptions(t),P0(r,this.options)||ne(this,_r).getQueryCache().notify({type:"observerOptionsUpdated",query:ne(this,rn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),bt(this,Yd,N0).call(this);const i=this.hasListeners();i&&UC(ne(this,rn),o,this.options,r)&&bt(this,Ma,Cu).call(this),this.updateResult(n),i&&(ne(this,rn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&bt(this,Vd,D0).call(this);const s=bt(this,Hd,T0).call(this);i&&(ne(this,rn)!==o||this.options.enabled!==r.enabled||s!==ne(this,Ss))&&bt(this,Wd,k0).call(this,s)}getOptimisticResult(t){const n=ne(this,_r).getQueryCache().build(ne(this,_r),t),r=this.createResult(n,t);return m8(this,r)&&(Le(this,cr,r),Le(this,ac,this.options),Le(this,Da,ne(this,rn).state)),r}getCurrentResult(){return ne(this,cr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(ne(this,uc).add(r),t[r])})}),n}getCurrentQuery(){return ne(this,rn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ne(this,_r).defaultQueryOptions(t),r=ne(this,_r).getQueryCache().build(ne(this,_r),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return bt(this,Ma,Cu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ne(this,cr)))}createResult(t,n){var O;const r=ne(this,rn),o=this.options,i=ne(this,cr),s=ne(this,Da),a=ne(this,ac),c=t!==r?t.state:ne(this,jd),{state:u}=t;let{error:f,errorUpdatedAt:p,fetchStatus:g,status:v}=u,b=!1,x;if(n._optimisticResults){const k=this.hasListeners(),M=!k&&WC(t,n),D=k&&UC(t,r,n,o);(M||D)&&(g=xg(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===ne(this,Bd))x=ne(this,lc);else try{Le(this,Bd,n.select),x=n.select(u.data),x=$0(i==null?void 0:i.data,x,n),Le(this,lc,x),Le(this,Xo,null)}catch(k){Le(this,Xo,k)}else x=u.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let k;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))k=i.data;else if(k=typeof n.placeholderData=="function"?n.placeholderData((O=ne(this,cc))==null?void 0:O.state.data,ne(this,cc)):n.placeholderData,n.select&&typeof k<"u")try{k=n.select(k),Le(this,Xo,null)}catch(M){Le(this,Xo,M)}typeof k<"u"&&(v="success",x=$0(i==null?void 0:i.data,k,n),b=!0)}ne(this,Xo)&&(f=ne(this,Xo),x=ne(this,lc),p=Date.now(),v="error");const w=g==="fetching",_=v==="pending",S=v==="error",R=_&&w;return{status:v,fetchStatus:g,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:b,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:gx(t,n),refetch:this.refetch}}updateResult(t){const n=ne(this,cr),r=this.createResult(ne(this,rn),this.options);if(Le(this,Da,ne(this,rn).state),Le(this,ac,this.options),ne(this,Da).data!==void 0&&Le(this,cc,ne(this,rn)),P0(r,n))return;Le(this,cr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ne(this,uc).size)return!0;const l=new Set(a??ne(this,uc));return this.options.throwOnError&&l.add("error"),Object.keys(ne(this,cr)).some(c=>{const u=c;return ne(this,cr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),bt(this,pg,AO).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&bt(this,Ud,M0).call(this)}},_r=new WeakMap,rn=new WeakMap,jd=new WeakMap,cr=new WeakMap,Da=new WeakMap,ac=new WeakMap,Xo=new WeakMap,Bd=new WeakMap,lc=new WeakMap,cc=new WeakMap,Ta=new WeakMap,ka=new WeakMap,Ss=new WeakMap,uc=new WeakMap,Ma=new WeakSet,Cu=function(t){bt(this,Yd,N0).call(this);let n=ne(this,rn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(bo)),n},Vd=new WeakSet,D0=function(){if(bt(this,qd,A0).call(this),pc||ne(this,cr).isStale||!R0(this.options.staleTime))return;const n=OO(ne(this,cr).dataUpdatedAt,this.options.staleTime)+1;Le(this,Ta,setTimeout(()=>{ne(this,cr).isStale||this.updateResult()},n))},Hd=new WeakSet,T0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ne(this,rn)):this.options.refetchInterval)??!1},Wd=new WeakSet,k0=function(t){bt(this,Gd,I0).call(this),Le(this,Ss,t),!(pc||this.options.enabled===!1||!R0(ne(this,Ss))||ne(this,Ss)===0)&&Le(this,ka,setInterval(()=>{(this.options.refetchIntervalInBackground||kp.isFocused())&&bt(this,Ma,Cu).call(this)},ne(this,Ss)))},Ud=new WeakSet,M0=function(){bt(this,Vd,D0).call(this),bt(this,Wd,k0).call(this,bt(this,Hd,T0).call(this))},qd=new WeakSet,A0=function(){ne(this,Ta)&&(clearTimeout(ne(this,Ta)),Le(this,Ta,void 0))},Gd=new WeakSet,I0=function(){ne(this,ka)&&(clearInterval(ne(this,ka)),Le(this,ka,void 0))},Yd=new WeakSet,N0=function(){const t=ne(this,_r).getQueryCache().build(ne(this,_r),this.options);if(t===ne(this,rn))return;const n=ne(this,rn);Le(this,rn,t),Le(this,jd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},pg=new WeakSet,AO=function(t){qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ne(this,cr))}),ne(this,_r).getQueryCache().notify({query:ne(this,rn),type:"observerResultsUpdated"})})},oO);function g8(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function WC(e,t){return g8(e,t)||e.state.dataUpdatedAt>0&&L0(e,t,t.refetchOnMount)}function L0(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&gx(e,t)}return!1}function UC(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&gx(e,n)}function gx(e,t){return e.isStaleByTime(t.staleTime)}function m8(e,t){return!P0(e.getCurrentResult(),t)}var IO=pe.createContext(void 0),NO=e=>{const t=pe.useContext(IO);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},v8=({client:e,children:t})=>(pe.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),pe.createElement(IO.Provider,{value:e},t)),LO=pe.createContext(!1),b8=()=>pe.useContext(LO);LO.Provider;function y8(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var x8=pe.createContext(y8()),w8=()=>pe.useContext(x8);function _8(e,t){return typeof e=="function"?e(...t):!!e}var S8=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},C8=e=>{pe.useEffect(()=>{e.clearReset()},[e])},E8=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&_8(n,[e.error,r]),R8=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},P8=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,O8=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function $8(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=NO(n),o=b8(),i=w8(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",R8(s),S8(s,i),C8(i);const[a]=pe.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(pe.useSyncExternalStore(pe.useCallback(c=>{const u=o?()=>{}:a.subscribe(qn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),pe.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),P8(s,l))throw O8(s,a,i);if(E8({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Jd(e,t){return $8(e,p8,t)}const D8={theme:"system",setTheme:()=>null},FO=m.createContext(D8);function T8({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return P.jsx(FO.Provider,{...r,value:s,children:e})}const zO=()=>{const e=m.useContext(FO);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function k8(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function jO(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function qC(e,t){const n=jO(e);return n==="dark"?Fi.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function M8({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=Jd({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>k8(e==null?void 0:e.accessToken),enabled:!1}),{theme:c,setTheme:u}=zO(),f=Te(k=>k.dashboard.globalStyle),{setDashboard:p,setSelectedSheetId:g,setStyle:v,setOnSaveFunction:b}=Te(k=>k.actions);Te(k=>k.actions.setCustomCards);const x=Te(k=>k.actions.setFilterValues),w=Te(k=>k.actions.setBookmarkKey),_=Te(k=>k.actions.setAuthToken),S=Te(k=>k.actions.setThemeStyle),R=Te(k=>k.actions.setDashboardTheme),E=Te(k=>k.actions.setOnEvent);m.useEffect(()=>{if(c){const k=jO(c);R(k)}},[c,R]),m.useEffect(()=>{n&&u(n)},[n,u]);function O(){const k=Fi.cloneDeep(E0),M=Fi.merge(k,f);if(t){const D=Fi.merge(M,t),I=qC(c,D);S(I),v(D)}else{const D=qC(c,M);S(D),v(E0)}}return m.useEffect(()=>{i&&i.dashboard&&O()},[c,t,f]),m.useEffect(()=>{var z;if(!i||!i.dashboard)return;const k=i.dashboard,M=_I(k.id),D=JSON.parse(localStorage.getItem(M)||"[]"),I=D.find(j=>j.default===!0);if(I)p(I.template),w(I.name),I.filterValues&&x(I.filterValues);else{p(k),O();const j=D.find(Q=>(Q==null?void 0:Q.name)==="Original");j?j.template=k:D.push({name:"Original",template:k,default:!1}),localStorage.setItem(M,JSON.stringify(D))}g((z=k.sheets)==null?void 0:z[0].id)},[i,p,g,x,w]),m.useEffect(()=>{r&&b(r),o&&E(o)},[r,b,o,E]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function mx({className:e,...t}){return P.jsx("div",{className:Ee("animate-pulse rounded-md bg-muted",e),...t})}const vx=pe.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:Ee("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));vx.displayName="Card";const wg=pe.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:Ee("flex flex-col space-y-1.5 p-6",e),...t}));wg.displayName="CardHeader";const Zd=pe.forwardRef(({className:e,...t},n)=>P.jsx("h3",{ref:n,className:Ee("text-2xl font-semibold leading-none tracking-tight",e),...t}));Zd.displayName="CardTitle";const bx=pe.forwardRef(({className:e,...t},n)=>P.jsx("p",{ref:n,className:Ee("text-sm text-muted-foreground",e),...t}));bx.displayName="CardDescription";const _g=pe.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:Ee("px-6 pt-0",e),...t}));_g.displayName="CardContent";const yx=pe.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:Ee("flex items-center p-6 pt-0",e),...t}));yx.displayName="CardFooter";function BO({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,...p}){Te(w=>w.selectedSheetId);const g=Te(w=>w.themeStyle),v=Te(w=>w.isSessionExpired),{isLoading:b,isError:x}=M8({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return b||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?P.jsx(o,{message:"loading"}):P.jsx("div",{className:"flex items-center gap-3",children:P.jsx(mx,{className:"h-1 w-full dark:h-[2px]"})})):x?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),P.jsx(i,{})):P.jsx("div",{children:"Error"})):v?(r==null||r({type:"error",message:"Session Expired"}),P.jsx("div",{className:"flex h-full items-center justify-center",children:P.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[P.jsx(Zd,{children:"Session Expired"}),P.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):P.jsx("div",{className:Ee("flex h-full grow flex-col justify-between",g==null?void 0:g.dashboardPanel,e),role:"dashboard-panel",...p})}function le(){return le=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},le.apply(this,arguments)}function Re(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 Bn(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:p,children:g,...v}=f,b=(p==null?void 0:p[e][l])||a,x=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:x},g)}function u(f,p){const g=(p==null?void 0:p[e][l])||a,v=m.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,A8(o,...t)]}function A8(...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 f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function I8(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Sg(...e){return t=>e.forEach(n=>I8(n,t))}function lt(...e){return m.useCallback(Sg(...e),e)}const ji=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(N8);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(F0,le({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(F0,le({},r,{ref:t}),n)});ji.displayName="Slot";const F0=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...L8(r,n.props),ref:t?Sg(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});F0.displayName="SlotClone";const VO=({children:e})=>m.createElement(m.Fragment,null,e);function N8(e){return m.isValidElement(e)&&e.type===VO}function L8(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 Cg(e){const t=e+"CollectionProvider",[n,r]=Bn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:v,children:b}=g,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:w,collectionRef:x},b)},a=e+"CollectionSlot",l=m.forwardRef((g,v)=>{const{scope:b,children:x}=g,w=i(a,b),_=lt(v,w.collectionRef);return m.createElement(ji,{ref:_},x)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((g,v)=>{const{scope:b,children:x,...w}=g,_=m.useRef(null),S=lt(v,_),R=i(c,b);return m.useEffect(()=>(R.itemMap.set(_,{ref:_,...w}),()=>void R.itemMap.delete(_))),m.createElement(ji,{[u]:"",ref:S},x)});function p(g){const v=i(e+"CollectionConsumer",g);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((R,E)=>w.indexOf(R.ref.current)-w.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},p,r]}const tr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},F8=pe.useId||(()=>{});let z8=0;function Or(e){const[t,n]=pe.useState(F8());return tr(()=>{e||n(r=>r??String(z8++))},[e]),e||(t?`radix-${t}`:"")}const j8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ue=j8.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ji:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,le({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function HO(e,t){e&&Fo.flushSync(()=>e.dispatchEvent(t))}function Mn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function nr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=B8({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Mn(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function B8({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=Mn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const V8=m.createContext(void 0);function Xa(e){const t=m.useContext(V8);return e||t||"ltr"}const Uv="rovingFocusGroup.onEntryFocus",H8={bubbles:!1,cancelable:!0},xx="RovingFocusGroup",[z0,WO,W8]=Cg(xx),[U8,Dc]=Bn(xx,[W8]),[q8,G8]=U8(xx),Y8=m.forwardRef((e,t)=>m.createElement(z0.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(z0.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(K8,le({},e,{ref:t}))))),K8=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),p=lt(t,f),g=Xa(i),[v=null,b]=nr({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),_=Mn(c),S=WO(n),R=m.useRef(!1),[E,O]=m.useState(0);return m.useEffect(()=>{const k=f.current;if(k)return k.addEventListener(Uv,_),()=>k.removeEventListener(Uv,_)},[_]),m.createElement(q8,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(k=>b(k),[b]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(k=>k+1),[]),onFocusableItemRemove:m.useCallback(()=>O(k=>k-1),[])},m.createElement(Ue.div,le({tabIndex:x||E===0?-1:0,"data-orientation":r},u,{ref:p,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{R.current=!0}),onFocus:Re(e.onFocus,k=>{const M=!R.current;if(k.target===k.currentTarget&&M&&!x){const D=new CustomEvent(Uv,H8);if(k.currentTarget.dispatchEvent(D),!D.defaultPrevented){const I=S().filter(B=>B.focusable),z=I.find(B=>B.active),j=I.find(B=>B.id===v),U=[z,j,...I].filter(Boolean).map(B=>B.ref.current);UO(U)}}R.current=!1}),onBlur:Re(e.onBlur,()=>w(!1))})))}),X8="RovingFocusGroupItem",Q8=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Or(),l=i||a,c=G8(X8,n),u=c.currentTabStopId===l,f=WO(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=c;return m.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),m.createElement(z0.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Ue.span,le({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Re(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Re(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Re(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=ez(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let w=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const _=w.indexOf(v.currentTarget);w=c.loop?tz(w,_+1):w.slice(_+1)}setTimeout(()=>UO(w))}})})))}),J8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Z8(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ez(e,t,n){const r=Z8(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return J8[r]}function UO(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function tz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const wx=Y8,_x=Q8;function nz(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Rn=e=>{const{present:t,children:n}=e,r=rz(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=lt(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};Rn.displayName="Presence";function rz(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=nz(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=ph(r.current);i.current=a==="mounted"?c:"none"},[a]),tr(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,g=ph(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),tr(()=>{if(t){const c=f=>{const g=ph(r.current).includes(f.animationName);f.target===t&&g&&Fo.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=ph(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function ph(e){return(e==null?void 0:e.animationName)||"none"}const qO="Tabs",[oz,Lpe]=Bn(qO,[Dc]),GO=Dc(),[iz,Sx]=oz(qO),sz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Xa(a),[f,p]=nr({prop:r,onChange:o,defaultProp:i});return m.createElement(iz,{scope:n,baseId:Or(),value:f,onValueChange:p,orientation:s,dir:u,activationMode:l},m.createElement(Ue.div,le({dir:u,"data-orientation":s},c,{ref:t})))}),az="TabsList",lz=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Sx(az,n),s=GO(n);return m.createElement(wx,le({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Ue.div,le({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),cz="TabsTrigger",uz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Sx(cz,n),a=GO(n),l=YO(s.baseId,r),c=KO(s.baseId,r),u=r===s.value;return m.createElement(_x,le({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Ue.button,le({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:Re(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Re(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),dz="TabsContent",fz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Sx(dz,n),l=YO(a.baseId,r),c=KO(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),m.createElement(Rn,{present:o||u},({present:p})=>m.createElement(Ue.div,le({"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:f.current?"0s":void 0}}),p&&i))});function YO(e,t){return`${e}-trigger-${t}`}function KO(e,t){return`${e}-content-${t}`}const hz=sz,XO=lz,QO=uz,JO=fz,ZO=hz,e$=pe.forwardRef(({className:e,...t},n)=>P.jsx(XO,{ref:n,className:Ee("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));e$.displayName=XO.displayName;const t$=pe.forwardRef(({className:e,...t},n)=>P.jsx(QO,{ref:n,className:Ee("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}));t$.displayName=QO.displayName;const Cx=pe.forwardRef(({className:e,...t},n)=>P.jsx(JO,{ref:n,className:Ee("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Cx.displayName=JO.displayName;var n$={exports:{}},ef={},j0={exports:{}};(function(e,t){(function(n,r){r(t)})(ms,function(n){function r(oe){return function(ie,be,G,me,_e,Pe,$e){return oe(ie,be,$e)}}function o(oe){return function(ie,be,G,me){if(!ie||!be||typeof ie!="object"||typeof be!="object")return oe(ie,be,G,me);var _e=me.get(ie),Pe=me.get(be);if(_e&&Pe)return _e===be&&Pe===ie;me.set(ie,be),me.set(be,ie);var $e=oe(ie,be,G,me);return me.delete(ie),me.delete(be),$e}}function i(oe,ee){var ie={};for(var be in oe)ie[be]=oe[be];for(var be in ee)ie[be]=ee[be];return ie}function s(oe){return oe.constructor===Object||oe.constructor==null}function a(oe){return typeof oe.then=="function"}function l(oe,ee){return oe===ee||oe!==oe&&ee!==ee}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",p="[object RegExp]",g="[object Map]",v="[object Number]",b="[object Object]",x="[object Set]",w="[object String]",_=Object.prototype.toString;function S(oe){var ee=oe.areArraysEqual,ie=oe.areDatesEqual,be=oe.areMapsEqual,G=oe.areObjectsEqual,me=oe.areRegExpsEqual,_e=oe.areSetsEqual,Pe=oe.createIsNestedEqual,$e=Pe(Ve);function Ve(Fe,ke,Ge){if(Fe===ke)return!0;if(!Fe||!ke||typeof Fe!="object"||typeof ke!="object")return Fe!==Fe&&ke!==ke;if(s(Fe)&&s(ke))return G(Fe,ke,$e,Ge);var ct=Array.isArray(Fe),kt=Array.isArray(ke);if(ct||kt)return ct===kt&&ee(Fe,ke,$e,Ge);var Dt=_.call(Fe);return Dt!==_.call(ke)?!1:Dt===f?ie(Fe,ke,$e,Ge):Dt===p?me(Fe,ke,$e,Ge):Dt===g?be(Fe,ke,$e,Ge):Dt===x?_e(Fe,ke,$e,Ge):Dt===b||Dt===c?a(Fe)||a(ke)?!1:G(Fe,ke,$e,Ge):Dt===u||Dt===v||Dt===w?l(Fe.valueOf(),ke.valueOf()):!1}return Ve}function R(oe,ee,ie,be){var G=oe.length;if(ee.length!==G)return!1;for(;G-- >0;)if(!ie(oe[G],ee[G],G,G,oe,ee,be))return!1;return!0}var E=o(R);function O(oe,ee){return l(oe.valueOf(),ee.valueOf())}function k(oe,ee,ie,be){var G=oe.size===ee.size;if(!G)return!1;if(!oe.size)return!0;var me={},_e=0;return oe.forEach(function(Pe,$e){if(G){var Ve=!1,Fe=0;ee.forEach(function(ke,Ge){!Ve&&!me[Fe]&&(Ve=ie($e,Ge,_e,Fe,oe,ee,be)&&ie(Pe,ke,$e,Ge,oe,ee,be))&&(me[Fe]=!0),Fe++}),_e++,G=Ve}}),G}var M=o(k),D="_owner",I=Object.prototype.hasOwnProperty;function z(oe,ee,ie,be){var G=Object.keys(oe),me=G.length;if(Object.keys(ee).length!==me)return!1;for(var _e;me-- >0;){if(_e=G[me],_e===D){var Pe=!!oe.$$typeof,$e=!!ee.$$typeof;if((Pe||$e)&&Pe!==$e)return!1}if(!I.call(ee,_e)||!ie(oe[_e],ee[_e],_e,_e,oe,ee,be))return!1}return!0}var j=o(z);function Q(oe,ee){return oe.source===ee.source&&oe.flags===ee.flags}function U(oe,ee,ie,be){var G=oe.size===ee.size;if(!G)return!1;if(!oe.size)return!0;var me={};return oe.forEach(function(_e,Pe){if(G){var $e=!1,Ve=0;ee.forEach(function(Fe,ke){!$e&&!me[Ve]&&($e=ie(_e,Fe,Pe,ke,oe,ee,be))&&(me[Ve]=!0),Ve++}),G=$e}}),G}var B=o(U),K=Object.freeze({areArraysEqual:R,areDatesEqual:O,areMapsEqual:k,areObjectsEqual:z,areRegExpsEqual:Q,areSetsEqual:U,createIsNestedEqual:r}),H=Object.freeze({areArraysEqual:E,areDatesEqual:O,areMapsEqual:M,areObjectsEqual:j,areRegExpsEqual:Q,areSetsEqual:B,createIsNestedEqual:r}),q=S(K);function Z(oe,ee){return q(oe,ee,void 0)}var T=S(i(K,{createIsNestedEqual:function(){return l}}));function V(oe,ee){return T(oe,ee,void 0)}var X=S(H);function N(oe,ee){return X(oe,ee,new WeakMap)}var se=S(i(H,{createIsNestedEqual:function(){return l}}));function ae(oe,ee){return se(oe,ee,new WeakMap)}function ue(oe){return S(i(K,oe(K)))}function fe(oe){var ee=S(i(H,oe(H)));return function(ie,be,G){return G===void 0&&(G=new WeakMap),ee(ie,be,G)}}n.circularDeepEqual=N,n.circularShallowEqual=ae,n.createCustomCircularEqual=fe,n.createCustomEqual=ue,n.deepEqual=Z,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(j0,j0.exports);var Ex=j0.exports;const Rx=sx(I6);var wt={},pz=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(wt,"__esModule",{value:!0});wt.bottom=Px;wt.childrenEqual=bz;wt.cloneLayout=r$;wt.cloneLayoutItem=Aa;wt.collides=Eg;wt.compact=i$;wt.compactItem=s$;wt.compactType=kz;wt.correctBounds=a$;wt.fastPositionEqual=xz;wt.fastRGLPropsEqual=void 0;wt.getAllCollisions=l$;wt.getFirstCollision=_a;wt.getLayoutItem=Ox;wt.getStatics=$x;wt.modifyLayout=o$;wt.moveElement=Ru;wt.moveElementAwayFromCollision=V0;wt.noop=void 0;wt.perc=_z;wt.resizeItemInDirection=Oz;wt.setTopLeft=Dz;wt.setTransform=$z;wt.sortLayoutItems=Ix;wt.sortLayoutItemsByColRow=h$;wt.sortLayoutItemsByRowCol=f$;wt.synchronizeLayoutWithChildren=Tz;wt.validateLayout=p$;wt.withLayoutItem=vz;var GC=Ex,Eu=gz(m);function gz(e){return e&&e.__esModule?e:{default:e}}const mz=process.env.NODE_ENV==="production";function Px(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 r$(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Aa(e[n]);return t}function o$(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 vz(e,t,n){let r=Ox(e,t);return r?(r=n(Aa(r)),e=o$(e,r),[e,r]):[e,null]}function Aa(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 bz(e,t){return(0,GC.deepEqual)(Eu.default.Children.map(e,n=>n==null?void 0:n.key),Eu.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,GC.deepEqual)(Eu.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Eu.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const yz=pz;wt.fastRGLPropsEqual=yz;function xz(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Eg(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 i$(e,t,n,r){const o=$x(e),i=Ix(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=Aa(i[a]);c.static||(c=s$(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const wz={x:"w",y:"h"};function B0(e,t,n,r){const o=wz[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;Eg(t,a)&&B0(e,a,n+t[o],r)}}t[r]=n}function s$(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Px(e),t.y);t.y>0&&!_a(e,t);)t.y--;else if(a)for(;t.x>0&&!_a(e,t);)t.x--;let l;for(;(l=_a(e,t))&&!(n===null&&i);)if(a?B0(o,t,l.x+l.w,"x"):B0(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!_a(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function a$(e,t){const n=$x(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(;_a(n,i);)i.y++}return e}function Ox(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function _a(e,t){for(let n=0,r=e.length;n<r;n++)if(Eg(e[n],t))return e[n]}function l$(e,t){return e.filter(n=>Eg(n,t))}function $x(e){return e.filter(t=>t.static)}function Ru(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=Ix(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const g=l$(f,t),v=g.length>0;if(v&&l)return r$(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let b=0,x=g.length;b<x;b++){const w=g[b];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=V0(e,w,t,o,s):e=V0(e,t,w,o,s))}return e}function V0(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},p=_a(e,f),g=p&&p.y+p.h>t.y,v=p&&t.x+t.w>p.x;if(p){if(g&&a)return Ru(e,n,void 0,t.y+1,r,l,o);if(g&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return Ru(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),Ru(e,n,s?f.x:void 0,a?f.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:Ru(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function _z(e){return e*100+"%"}const c$=(e,t,n,r)=>e+n>r?t:n,u$=(e,t,n)=>e<0?t:n,d$=e=>Math.max(0,e),Dx=e=>Math.max(0,e),Tx=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:u$(s,e.height,o),top:Dx(s)}},kx=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:c$(e.left,e.width,s,n),left:d$(o)}},Mx=(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:c$(e.left,e.width,i,n),top:Dx(r),left:d$(s)}},Ax=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:u$(r,e.height,i),top:Dx(r)}},Sz=function(){return Tx(arguments.length<=0?void 0:arguments[0],kx(...arguments))},Cz=function(){return Tx(arguments.length<=0?void 0:arguments[0],Mx(...arguments))},Ez=function(){return Ax(arguments.length<=0?void 0:arguments[0],kx(...arguments))},Rz=function(){return Ax(arguments.length<=0?void 0:arguments[0],Mx(...arguments))},Pz={n:Tx,ne:Sz,e:kx,se:Ez,s:Ax,sw:Rz,w:Mx,nw:Cz};function Oz(e,t,n,r){const o=Pz[e];return o?o(t,{...t,...n},r):n}function $z(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function Dz(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function Ix(e,t){return t==="horizontal"?h$(e):t==="vertical"?f$(e):e}function f$(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 h$(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 Tz(e,t,n,r,o){e=e||[];const i=[];Eu.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Ox(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(Aa(l)):c?(mz||p$([c],"ReactGridLayout.children"),i.push(Aa({...c,i:a.key}))):i.push(Aa({w:1,h:1,x:0,y:Px(i),i:String(a.key)}))});const s=a$(i,{cols:n});return o?s:i$(s,r,n)}function p$(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function kz(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const Mz=()=>{};wt.noop=Mz;var li={};Object.defineProperty(li,"__esModule",{value:!0});li.calcGridColWidth=Rg;li.calcGridItemPosition=Az;li.calcGridItemWHPx=H0;li.calcWH=Nz;li.calcXY=Iz;li.clamp=Sa;function Rg(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function H0(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Az(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Rg(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=H0(r,c,s[0]),u.height=H0(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 Iz(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=Rg(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Sa(u,0,s-r),f=Sa(f,0,l-o),{x:u,y:f}}function Nz(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=Rg(e);let f=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),g=Sa(f,0,l-r),v=Sa(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=Sa(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=Sa(p,0,a)),{w:g,h:v}}function Sa(e,t,n){return Math.max(Math.min(e,n),t)}var Pg={},W0={exports:{}},qv,YC;function Nx(){if(YC)return qv;YC=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return qv=e,qv}var Gv,KC;function Lz(){if(KC)return Gv;KC=1;var e=Nx();function t(){}function n(){}return n.resetWarningCache=t,Gv=function(){function r(s,a,l,c,u,f){if(f!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Gv}var gh={exports:{}},Lt={};/** @license React v16.13.1
|
|
89
|
+
* react-is.development.js
|
|
90
|
+
*
|
|
91
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the MIT license found in the
|
|
94
|
+
* LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/var XC;function Fz(){return XC||(XC=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,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(G){return typeof G=="string"||typeof G=="function"||G===r||G===c||G===i||G===o||G===f||G===p||typeof G=="object"&&G!==null&&(G.$$typeof===v||G.$$typeof===g||G.$$typeof===s||G.$$typeof===a||G.$$typeof===u||G.$$typeof===x||G.$$typeof===w||G.$$typeof===_||G.$$typeof===b)}function R(G){if(typeof G=="object"&&G!==null){var me=G.$$typeof;switch(me){case t:var _e=G.type;switch(_e){case l:case c:case r:case i:case o:case f:return _e;default:var Pe=_e&&_e.$$typeof;switch(Pe){case a:case u:case v:case g:case s:return Pe;default:return me}}case n:return me}}}var E=l,O=c,k=a,M=s,D=t,I=u,z=r,j=v,Q=g,U=n,B=i,K=o,H=f,q=!1;function Z(G){return q||(q=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),T(G)||R(G)===l}function T(G){return R(G)===c}function V(G){return R(G)===a}function X(G){return R(G)===s}function N(G){return typeof G=="object"&&G!==null&&G.$$typeof===t}function se(G){return R(G)===u}function ae(G){return R(G)===r}function ue(G){return R(G)===v}function fe(G){return R(G)===g}function oe(G){return R(G)===n}function ee(G){return R(G)===i}function ie(G){return R(G)===o}function be(G){return R(G)===f}Lt.AsyncMode=E,Lt.ConcurrentMode=O,Lt.ContextConsumer=k,Lt.ContextProvider=M,Lt.Element=D,Lt.ForwardRef=I,Lt.Fragment=z,Lt.Lazy=j,Lt.Memo=Q,Lt.Portal=U,Lt.Profiler=B,Lt.StrictMode=K,Lt.Suspense=H,Lt.isAsyncMode=Z,Lt.isConcurrentMode=T,Lt.isContextConsumer=V,Lt.isContextProvider=X,Lt.isElement=N,Lt.isForwardRef=se,Lt.isFragment=ae,Lt.isLazy=ue,Lt.isMemo=fe,Lt.isPortal=oe,Lt.isProfiler=ee,Lt.isStrictMode=ie,Lt.isSuspense=be,Lt.isValidElementType=S,Lt.typeOf=R}()),Lt}var Ft={};/** @license React v16.13.1
|
|
96
|
+
* react-is.production.min.js
|
|
97
|
+
*
|
|
98
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the MIT license found in the
|
|
101
|
+
* LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/var QC;function zz(){if(QC)return Ft;QC=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,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(E){if(typeof E=="object"&&E!==null){var O=E.$$typeof;switch(O){case t:switch(E=E.type,E){case l:case c:case r:case i:case o:case f:return E;default:switch(E=E&&E.$$typeof,E){case a:case u:case v:case g:case s:return E;default:return O}}case n:return O}}}function R(E){return S(E)===c}return Ft.AsyncMode=l,Ft.ConcurrentMode=c,Ft.ContextConsumer=a,Ft.ContextProvider=s,Ft.Element=t,Ft.ForwardRef=u,Ft.Fragment=r,Ft.Lazy=v,Ft.Memo=g,Ft.Portal=n,Ft.Profiler=i,Ft.StrictMode=o,Ft.Suspense=f,Ft.isAsyncMode=function(E){return R(E)||S(E)===l},Ft.isConcurrentMode=R,Ft.isContextConsumer=function(E){return S(E)===a},Ft.isContextProvider=function(E){return S(E)===s},Ft.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},Ft.isForwardRef=function(E){return S(E)===u},Ft.isFragment=function(E){return S(E)===r},Ft.isLazy=function(E){return S(E)===v},Ft.isMemo=function(E){return S(E)===g},Ft.isPortal=function(E){return S(E)===n},Ft.isProfiler=function(E){return S(E)===i},Ft.isStrictMode=function(E){return S(E)===o},Ft.isSuspense=function(E){return S(E)===f},Ft.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===c||E===i||E===o||E===f||E===p||typeof E=="object"&&E!==null&&(E.$$typeof===v||E.$$typeof===g||E.$$typeof===s||E.$$typeof===a||E.$$typeof===u||E.$$typeof===x||E.$$typeof===w||E.$$typeof===_||E.$$typeof===b)},Ft.typeOf=S,Ft}var JC;function g$(){return JC||(JC=1,process.env.NODE_ENV==="production"?gh.exports=zz():gh.exports=Fz()),gh.exports}/*
|
|
103
|
+
object-assign
|
|
104
|
+
(c) Sindre Sorhus
|
|
105
|
+
@license MIT
|
|
106
|
+
*/var Yv,ZC;function jz(){if(ZC)return Yv;ZC=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 Yv=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 f in a)t.call(a,f)&&(l[f]=a[f]);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},Yv}var Kv,eE;function m$(){return eE||(eE=1,Kv=Function.call.bind(Object.prototype.hasOwnProperty)),Kv}var Xv,tE;function Bz(){if(tE)return Xv;tE=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Nx(),n={},r=m$();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 f;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}f=i[u](s,u,l,a,null,t)}catch(v){f=v}if(f&&!(f 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 f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var g=c?c():"";e("Failed "+a+" type: "+f.message+(g??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Xv=o,Xv}var Qv,nE;function Vz(){if(nE)return Qv;nE=1;var e=g$(),t=jz(),n=Nx(),r=m$(),o=Bz(),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 Qv=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var V=T&&(c&&T[c]||T[u]);if(typeof V=="function")return V}var p="<<anonymous>>",g={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:_(),arrayOf:S,element:R(),elementType:E(),instanceOf:O,node:I(),objectOf:M,oneOf:k,oneOfType:D,shape:j,exact:Q};function v(T,V){return T===V?T!==0||1/T===1/V:T!==T&&V!==V}function b(T,V){this.message=T,this.data=V&&typeof V=="object"?V:{},this.stack=""}b.prototype=Error.prototype;function x(T){if(process.env.NODE_ENV!=="production")var V={},X=0;function N(ae,ue,fe,oe,ee,ie,be){if(oe=oe||p,ie=ie||fe,be!==n){if(l){var G=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 G.name="Invariant Violation",G}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var me=oe+":"+fe;!V[me]&&X<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ie+"` prop on `"+oe+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[me]=!0,X++)}}return ue[fe]==null?ae?ue[fe]===null?new b("The "+ee+" `"+ie+"` is marked as required "+("in `"+oe+"`, but its value is `null`.")):new b("The "+ee+" `"+ie+"` is marked as required in "+("`"+oe+"`, but its value is `undefined`.")):null:T(ue,fe,oe,ee,ie)}var se=N.bind(null,!1);return se.isRequired=N.bind(null,!0),se}function w(T){function V(X,N,se,ae,ue,fe){var oe=X[N],ee=K(oe);if(ee!==T){var ie=H(oe);return new b("Invalid "+ae+" `"+ue+"` of type "+("`"+ie+"` supplied to `"+se+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return x(V)}function _(){return x(s)}function S(T){function V(X,N,se,ae,ue){if(typeof T!="function")return new b("Property `"+ue+"` of component `"+se+"` has invalid PropType notation inside arrayOf.");var fe=X[N];if(!Array.isArray(fe)){var oe=K(fe);return new b("Invalid "+ae+" `"+ue+"` of type "+("`"+oe+"` supplied to `"+se+"`, expected an array."))}for(var ee=0;ee<fe.length;ee++){var ie=T(fe,ee,se,ae,ue+"["+ee+"]",n);if(ie instanceof Error)return ie}return null}return x(V)}function R(){function T(V,X,N,se,ae){var ue=V[X];if(!a(ue)){var fe=K(ue);return new b("Invalid "+se+" `"+ae+"` of type "+("`"+fe+"` supplied to `"+N+"`, expected a single ReactElement."))}return null}return x(T)}function E(){function T(V,X,N,se,ae){var ue=V[X];if(!e.isValidElementType(ue)){var fe=K(ue);return new b("Invalid "+se+" `"+ae+"` of type "+("`"+fe+"` supplied to `"+N+"`, expected a single ReactElement type."))}return null}return x(T)}function O(T){function V(X,N,se,ae,ue){if(!(X[N]instanceof T)){var fe=T.name||p,oe=Z(X[N]);return new b("Invalid "+ae+" `"+ue+"` of type "+("`"+oe+"` supplied to `"+se+"`, expected ")+("instance of `"+fe+"`."))}return null}return x(V)}function k(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function V(X,N,se,ae,ue){for(var fe=X[N],oe=0;oe<T.length;oe++)if(v(fe,T[oe]))return null;var ee=JSON.stringify(T,function(be,G){var me=H(G);return me==="symbol"?String(G):G});return new b("Invalid "+ae+" `"+ue+"` of value `"+String(fe)+"` "+("supplied to `"+se+"`, expected one of "+ee+"."))}return x(V)}function M(T){function V(X,N,se,ae,ue){if(typeof T!="function")return new b("Property `"+ue+"` of component `"+se+"` has invalid PropType notation inside objectOf.");var fe=X[N],oe=K(fe);if(oe!=="object")return new b("Invalid "+ae+" `"+ue+"` of type "+("`"+oe+"` supplied to `"+se+"`, expected an object."));for(var ee in fe)if(r(fe,ee)){var ie=T(fe,ee,se,ae,ue+"."+ee,n);if(ie instanceof Error)return ie}return null}return x(V)}function D(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var V=0;V<T.length;V++){var X=T[V];if(typeof X!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+q(X)+" at index "+V+"."),s}function N(se,ae,ue,fe,oe){for(var ee=[],ie=0;ie<T.length;ie++){var be=T[ie],G=be(se,ae,ue,fe,oe,n);if(G==null)return null;G.data&&r(G.data,"expectedType")&&ee.push(G.data.expectedType)}var me=ee.length>0?", expected one of type ["+ee.join(", ")+"]":"";return new b("Invalid "+fe+" `"+oe+"` supplied to "+("`"+ue+"`"+me+"."))}return x(N)}function I(){function T(V,X,N,se,ae){return U(V[X])?null:new b("Invalid "+se+" `"+ae+"` supplied to "+("`"+N+"`, expected a ReactNode."))}return x(T)}function z(T,V,X,N,se){return new b((T||"React class")+": "+V+" type `"+X+"."+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+se+"`.")}function j(T){function V(X,N,se,ae,ue){var fe=X[N],oe=K(fe);if(oe!=="object")return new b("Invalid "+ae+" `"+ue+"` of type `"+oe+"` "+("supplied to `"+se+"`, expected `object`."));for(var ee in T){var ie=T[ee];if(typeof ie!="function")return z(se,ae,ue,ee,H(ie));var be=ie(fe,ee,se,ae,ue+"."+ee,n);if(be)return be}return null}return x(V)}function Q(T){function V(X,N,se,ae,ue){var fe=X[N],oe=K(fe);if(oe!=="object")return new b("Invalid "+ae+" `"+ue+"` of type `"+oe+"` "+("supplied to `"+se+"`, expected `object`."));var ee=t({},X[N],T);for(var ie in ee){var be=T[ie];if(r(T,ie)&&typeof be!="function")return z(se,ae,ue,ie,H(be));if(!be)return new b("Invalid "+ae+" `"+ue+"` key `"+ie+"` supplied to `"+se+"`.\nBad object: "+JSON.stringify(X[N],null," ")+`
|
|
107
|
+
Valid keys: `+JSON.stringify(Object.keys(T),null," "));var G=be(fe,ie,se,ae,ue+"."+ie,n);if(G)return G}return null}return x(V)}function U(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(U);if(T===null||a(T))return!0;var V=f(T);if(V){var X=V.call(T),N;if(V!==T.entries){for(;!(N=X.next()).done;)if(!U(N.value))return!1}else for(;!(N=X.next()).done;){var se=N.value;if(se&&!U(se[1]))return!1}}else return!1;return!0;default:return!1}}function B(T,V){return T==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function K(T){var V=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":B(V,T)?"symbol":V}function H(T){if(typeof T>"u"||T===null)return""+T;var V=K(T);if(V==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return V}function q(T){var V=H(T);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function Z(T){return!T.constructor||!T.constructor.name?p:T.constructor.name}return g.checkPropTypes=o,g.resetWarningCache=o.resetWarningCache,g.PropTypes=g,g},Qv}if(process.env.NODE_ENV!=="production"){var Hz=g$(),Wz=!0;W0.exports=Vz()(Hz.isElement,Wz)}else W0.exports=Lz()();var js=W0.exports,Og={exports:{}},v$={};function b$(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=b$(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function rE(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=b$(e))&&(r&&(r+=" "),r+=t);return r}const Uz=Object.freeze(Object.defineProperty({__proto__:null,clsx:rE,default:rE},Symbol.toStringTag,{value:"Module"})),qz=sx(Uz);var bn={},ci={};Object.defineProperty(ci,"__esModule",{value:!0});ci.dontSetMe=Qz;ci.findInArray=Gz;ci.int=Xz;ci.isFunction=Yz;ci.isNum=Kz;function Gz(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Yz(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Kz(e){return typeof e=="number"&&!isNaN(e)}function Xz(e){return parseInt(e,10)}function Qz(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 Qa={};Object.defineProperty(Qa,"__esModule",{value:!0});Qa.browserPrefixToKey=x$;Qa.browserPrefixToStyle=Jz;Qa.default=void 0;Qa.getPrefix=y$;const Jv=["Moz","Webkit","O","ms"];function y$(){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<Jv.length;r++)if(x$(t,Jv[r])in n)return Jv[r];return""}function x$(e,t){return t?"".concat(t).concat(Zz(e)):e}function Jz(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Zz(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}Qa.default=y$();Object.defineProperty(bn,"__esModule",{value:!0});bn.addClassName=S$;bn.addEvent=nj;bn.addUserSelectStyles=hj;bn.createCSSTransform=cj;bn.createSVGTransform=uj;bn.getTouch=dj;bn.getTouchIdentifier=fj;bn.getTranslation=Lx;bn.innerHeight=sj;bn.innerWidth=aj;bn.matchesSelector=_$;bn.matchesSelectorAndParentsTo=tj;bn.offsetXYFromParent=lj;bn.outerHeight=oj;bn.outerWidth=ij;bn.removeClassName=C$;bn.removeEvent=rj;bn.removeUserSelectStyles=pj;var Jr=ci,oE=ej(Qa);function w$(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(w$=function(r){return r?n:t})(e)}function ej(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=w$(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 mh="";function _$(e,t){return mh||(mh=(0,Jr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Jr.isFunction)(e[n])})),(0,Jr.isFunction)(e[mh])?e[mh](t):!1}function tj(e,t,n){let r=e;do{if(_$(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function nj(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 rj(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 oj(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Jr.int)(n.borderTopWidth),t+=(0,Jr.int)(n.borderBottomWidth),t}function ij(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Jr.int)(n.borderLeftWidth),t+=(0,Jr.int)(n.borderRightWidth),t}function sj(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Jr.int)(n.paddingTop),t-=(0,Jr.int)(n.paddingBottom),t}function aj(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Jr.int)(n.paddingLeft),t-=(0,Jr.int)(n.paddingRight),t}function lj(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 cj(e,t){const n=Lx(e,t,"px");return{[(0,oE.browserPrefixToKey)("transform",oE.default)]:n}}function uj(e,t){return Lx(e,t,"")}function Lx(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 dj(e,t){return e.targetTouches&&(0,Jr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Jr.findInArray)(e.changedTouches,n=>t===n.identifier)}function fj(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function hj(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
108
|
+
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
109
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&S$(e.body,"react-draggable-transparent-selection")}function pj(e){if(e)try{if(e.body&&C$(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 S$(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function C$(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var ui={};Object.defineProperty(ui,"__esModule",{value:!0});ui.canDragX=vj;ui.canDragY=bj;ui.createCoreData=xj;ui.createDraggableData=wj;ui.getBoundPosition=gj;ui.getControlPosition=yj;ui.snapToGrid=mj;var Fr=ci,jl=bn;function gj(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:_j(r);const o=Fx(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,Fr.int)(u.paddingLeft)+(0,Fr.int)(c.marginLeft),top:-o.offsetTop+(0,Fr.int)(u.paddingTop)+(0,Fr.int)(c.marginTop),right:(0,jl.innerWidth)(l)-(0,jl.outerWidth)(o)-o.offsetLeft+(0,Fr.int)(u.paddingRight)-(0,Fr.int)(c.marginRight),bottom:(0,jl.innerHeight)(l)-(0,jl.outerHeight)(o)-o.offsetTop+(0,Fr.int)(u.paddingBottom)-(0,Fr.int)(c.marginBottom)}}return(0,Fr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Fr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Fr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Fr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function mj(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function vj(e){return e.props.axis==="both"||e.props.axis==="x"}function bj(e){return e.props.axis==="both"||e.props.axis==="y"}function yj(e,t,n){const r=typeof t=="number"?(0,jl.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=Fx(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,jl.offsetXYFromParent)(r||e,i,n.props.scale)}function xj(e,t,n){const r=!(0,Fr.isNum)(e.lastX),o=Fx(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 wj(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 _j(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Fx(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var $g={},Dg={};Object.defineProperty(Dg,"__esModule",{value:!0});Dg.default=Sj;function Sj(){}Object.defineProperty($g,"__esModule",{value:!0});$g.default=void 0;var Zv=Ej(m),vr=zx(js),Cj=zx(Fo),Qn=bn,ss=ui,eb=ci,cu=zx(Dg);function zx(e){return e&&e.__esModule?e:{default:e}}function E$(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(E$=function(r){return r?n:t})(e)}function Ej(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=E$(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 lr(e,t,n){return t=Rj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rj(e){var t=Pj(e,"string");return typeof t=="symbol"?t:String(t)}function Pj(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Do={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let as=Do.mouse,Tg=class extends Zv.Component{constructor(){super(...arguments),lr(this,"dragging",!1),lr(this,"lastX",NaN),lr(this,"lastY",NaN),lr(this,"touchIdentifier",null),lr(this,"mounted",!1),lr(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,Qn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Qn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Qn.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,ss.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,ss.createCoreData)(this,s,a);(0,cu.default)("DraggableCore: handleDragStart: %j",l),(0,cu.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Qn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Qn.addEvent)(r,as.move,this.handleDrag),(0,Qn.addEvent)(r,as.stop,this.handleDragStop))}),lr(this,"handleDrag",t=>{const n=(0,ss.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,ss.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,ss.createCoreData)(this,r,o);if((0,cu.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}),lr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,ss.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,ss.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,ss.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,Qn.removeUserSelectStyles)(a.ownerDocument),(0,cu.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,cu.default)("DraggableCore: Removing handlers"),(0,Qn.removeEvent)(a.ownerDocument,as.move,this.handleDrag),(0,Qn.removeEvent)(a.ownerDocument,as.stop,this.handleDragStop))}),lr(this,"onMouseDown",t=>(as=Do.mouse,this.handleDragStart(t))),lr(this,"onMouseUp",t=>(as=Do.mouse,this.handleDragStop(t))),lr(this,"onTouchStart",t=>(as=Do.touch,this.handleDragStart(t))),lr(this,"onTouchEnd",t=>(as=Do.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Qn.addEvent)(t,Do.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Qn.removeEvent)(n,Do.mouse.move,this.handleDrag),(0,Qn.removeEvent)(n,Do.touch.move,this.handleDrag),(0,Qn.removeEvent)(n,Do.mouse.stop,this.handleDragStop),(0,Qn.removeEvent)(n,Do.touch.stop,this.handleDragStop),(0,Qn.removeEvent)(t,Do.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Qn.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:Cj.default.findDOMNode(this)}render(){return Zv.cloneElement(Zv.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};$g.default=Tg;lr(Tg,"displayName","DraggableCore");lr(Tg,"propTypes",{allowAnyClick:vr.default.bool,children:vr.default.node.isRequired,disabled:vr.default.bool,enableUserSelectHack:vr.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:vr.default.arrayOf(vr.default.number),handle:vr.default.string,cancel:vr.default.string,nodeRef:vr.default.object,onStart:vr.default.func,onDrag:vr.default.func,onStop:vr.default.func,onMouseDown:vr.default.func,scale:vr.default.number,className:eb.dontSetMe,style:eb.dontSetMe,transform:eb.dontSetMe});lr(Tg,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=p(m),n=u(js),r=u(Fo),o=u(qz),i=bn,s=ui,a=ci,l=u($g),c=u(Dg);function u(_){return _&&_.__esModule?_:{default:_}}function f(_){if(typeof WeakMap!="function")return null;var S=new WeakMap,R=new WeakMap;return(f=function(E){return E?R:S})(_)}function p(_,S){if(!S&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var R=f(S);if(R&&R.has(_))return R.get(_);var E={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in _)if(k!=="default"&&Object.prototype.hasOwnProperty.call(_,k)){var M=O?Object.getOwnPropertyDescriptor(_,k):null;M&&(M.get||M.set)?Object.defineProperty(E,k,M):E[k]=_[k]}return E.default=_,R&&R.set(_,E),E}function g(){return g=Object.assign?Object.assign.bind():function(_){for(var S=1;S<arguments.length;S++){var R=arguments[S];for(var E in R)Object.prototype.hasOwnProperty.call(R,E)&&(_[E]=R[E])}return _},g.apply(this,arguments)}function v(_,S,R){return S=b(S),S in _?Object.defineProperty(_,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):_[S]=R,_}function b(_){var S=x(_,"string");return typeof S=="symbol"?S:String(S)}function x(_,S){if(typeof _!="object"||_===null)return _;var R=_[Symbol.toPrimitive];if(R!==void 0){var E=R.call(_,S||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(_)}class w extends t.Component{static getDerivedStateFromProps(S,R){let{position:E}=S,{prevPropsPosition:O}=R;return E&&(!O||E.x!==O.x||E.y!==O.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:O}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(S){super(S),v(this,"onDragStart",(R,E)=>{if((0,c.default)("Draggable: onDragStart: %j",E),this.props.onStart(R,(0,s.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(R,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const O=(0,s.createDraggableData)(this,E),k={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:D,y:I}=k;k.x+=this.state.slackX,k.y+=this.state.slackY;const[z,j]=(0,s.getBoundPosition)(this,k.x,k.y);k.x=z,k.y=j,k.slackX=this.state.slackX+(D-k.x),k.slackY=this.state.slackY+(I-k.y),O.x=k.x,O.y=k.y,O.deltaX=k.x-this.state.x,O.deltaY=k.y-this.state.y}if(this.props.onDrag(R,O)===!1)return!1;this.setState(k)}),v(this,"onDragStop",(R,E)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,E))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",E);const k={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:D,y:I}=this.props.position;k.x=D,k.y=I}this.setState(k)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.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 S,R;return(S=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:R,children:E,defaultPosition:O,defaultClassName:k,defaultClassNameDragging:M,defaultClassNameDragged:D,position:I,positionOffset:z,scale:j,...Q}=this.props;let U={},B=null;const H=!!!I||this.state.dragging,q=I||O,Z={x:(0,s.canDragX)(this)&&H?this.state.x:q.x,y:(0,s.canDragY)(this)&&H?this.state.y:q.y};this.state.isElementSVG?B=(0,i.createSVGTransform)(Z,z):U=(0,i.createCSSTransform)(Z,z);const T=(0,o.default)(E.props.className||"",k,{[M]:this.state.dragging,[D]:this.state.dragged});return t.createElement(l.default,g({},Q,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:T,style:{...E.props.style,...U},transform:B}))}}e.default=w,v(w,"displayName","Draggable"),v(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),v(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(v$);const{default:R$,DraggableCore:Oj}=v$;Og.exports=R$;Og.exports.default=R$;Og.exports.DraggableCore=Oj;var P$=Og.exports,kg={exports:{}},tf={},jx={};jx.__esModule=!0;jx.cloneElement=Aj;var $j=Dj(m);function Dj(e){return e&&e.__esModule?e:{default:e}}function iE(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 sE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iE(Object(n),!0).forEach(function(r){Tj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tj(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=Mj(e,"string");return typeof t=="symbol"?t:String(t)}function Mj(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Aj(e,t){return t.style&&e.props.style&&(t.style=sE(sE({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),$j.default.cloneElement(e,t)}var nf={};nf.__esModule=!0;nf.resizableProps=void 0;var dt=Ij(js);function Ij(e){return e&&e.__esModule?e:{default:e}}var Nj={axis:dt.default.oneOf(["both","x","y","none"]),className:dt.default.string,children:dt.default.element.isRequired,draggableOpts:dt.default.shape({allowAnyClick:dt.default.bool,cancel:dt.default.string,children:dt.default.node,disabled:dt.default.bool,enableUserSelectHack:dt.default.bool,offsetParent:dt.default.node,grid:dt.default.arrayOf(dt.default.number),handle:dt.default.string,nodeRef:dt.default.object,onStart:dt.default.func,onDrag:dt.default.func,onStop:dt.default.func,onMouseDown:dt.default.func,scale:dt.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=dt.default.number).isRequired.apply(i,n)}return dt.default.number.apply(dt.default,n)},handle:dt.default.oneOfType([dt.default.node,dt.default.func]),handleSize:dt.default.arrayOf(dt.default.number),lockAspectRatio:dt.default.bool,maxConstraints:dt.default.arrayOf(dt.default.number),minConstraints:dt.default.arrayOf(dt.default.number),onResizeStop:dt.default.func,onResizeStart:dt.default.func,onResize:dt.default.func,resizeHandles:dt.default.arrayOf(dt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:dt.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=dt.default.number).isRequired.apply(i,n)}return dt.default.number.apply(dt.default,n)}};nf.resizableProps=Nj;tf.__esModule=!0;tf.default=void 0;var uu=Bj(m),Lj=P$,Fj=jx,zj=nf,jj=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function O$(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(O$=function(o){return o?n:t})(e)}function Bj(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=O$(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function U0(){return U0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U0.apply(this,arguments)}function Vj(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 aE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function tb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aE(Object(n),!0).forEach(function(r){Hj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hj(e,t,n){return t=Wj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wj(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,q0(e,t)}function q0(e,t){return q0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},q0(e,t)}var Bx=function(e){qj(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,f=o-this.props.width,p=i-this.props.height;Math.abs(f)>Math.abs(p*u)?i=o/u:o=i*u}var g=o,v=i,b=this.slack||[0,0],x=b[0],w=b[1];return o+=x,i+=w,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[x+(g-o),w+(v-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;o==="onResizeStart"&&s.resetData();var p=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",g=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!p&&!g)){var v=i[0],b=i[i.length-1],x=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var w=x.left-s.lastHandleRect.left;u+=w}if(v==="n"){var _=x.top-s.lastHandleRect.top;f+=_}}s.lastHandleRect=x,b==="w"&&(u=-u),v==="n"&&(f=-f);var S=s.props.width+(p?u/s.props.transformScale:0),R=s.props.height+(g?f/s.props.transformScale:0),E=s.runConstraints(S,R);S=E[0],R=E[1];var O=S!==s.props.width||R!==s.props.height,k=typeof s.props[o]=="function"?s.props[o]:null,M=o==="onResize"&&!O;k&&!M&&(a.persist==null||a.persist(),k(a,{node:c,size:{width:S,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return uu.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=tb({ref:i},a?{}:{handleAxis:o});return uu.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=Vj(i,jj);return(0,Fj.cloneElement)(s,tb(tb({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var p,g=(p=o.handleRefs[f])!=null?p:o.handleRefs[f]=uu.createRef();return uu.createElement(Lj.DraggableCore,U0({},l,{nodeRef:g,key:"resizableHandle-"+f,onStop:o.resizeHandler("onResizeStop",f),onStart:o.resizeHandler("onResizeStart",f),onDrag:o.resizeHandler("onResize",f)}),o.renderResizeHandle(f,g))}))}))},t}(uu.Component);tf.default=Bx;Bx.propTypes=zj.resizableProps;Bx.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Mg={};Mg.__esModule=!0;Mg.default=void 0;var nb=Qj(m),Gj=$$(js),Yj=$$(tf),Kj=nf,Xj=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function $$(e){return e&&e.__esModule?e:{default:e}}function D$(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(D$=function(o){return o?n:t})(e)}function Qj(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=D$(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function G0(){return G0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G0.apply(this,arguments)}function lE(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 Ap(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lE(Object(n),!0).forEach(function(r){Jj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jj(e,t,n){return t=Zj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zj(e){var t=eB(e,"string");return typeof t=="symbol"?t:String(t)}function eB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tB(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 nB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Y0(e,t)}function Y0(e,t){return Y0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Y0(e,t)}var T$=function(e){nB(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,f=o.maxConstraints,p=o.lockAspectRatio,g=o.axis;o.width,o.height;var v=o.resizeHandles,b=o.style,x=o.transformScale,w=tB(o,Xj);return nb.createElement(Yj.default,{axis:g,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},nb.createElement("div",G0({},w,{style:Ap(Ap({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(nb.Component);Mg.default=T$;T$.propTypes=Ap(Ap({},Kj.resizableProps),{},{children:Gj.default.element});kg.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};kg.exports.Resizable=tf.default;kg.exports.ResizableBox=Mg.default;var rB=kg.exports,zi={};Object.defineProperty(zi,"__esModule",{value:!0});zi.resizeHandleType=zi.resizeHandleAxesType=zi.default=void 0;var mt=k$(js),oB=k$(m);function k$(e){return e&&e.__esModule?e:{default:e}}const M$=mt.default.arrayOf(mt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));zi.resizeHandleAxesType=M$;const A$=mt.default.oneOfType([mt.default.node,mt.default.func]);zi.resizeHandleType=A$;var iB={className:mt.default.string,style:mt.default.object,width:mt.default.number,autoSize:mt.default.bool,cols:mt.default.number,draggableCancel:mt.default.string,draggableHandle:mt.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:mt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&wt.validateLayout(t,"layout")},margin:mt.default.arrayOf(mt.default.number),containerPadding:mt.default.arrayOf(mt.default.number),rowHeight:mt.default.number,maxRows:mt.default.number,isBounded:mt.default.bool,isDraggable:mt.default.bool,isResizable:mt.default.bool,allowOverlap:mt.default.bool,preventCollision:mt.default.bool,useCSSTransforms:mt.default.bool,transformScale:mt.default.number,isDroppable:mt.default.bool,resizeHandles:M$,resizeHandle:A$,onLayoutChange:mt.default.func,onDragStart:mt.default.func,onDrag:mt.default.func,onDragStop:mt.default.func,onResizeStart:mt.default.func,onResize:mt.default.func,onResizeStop:mt.default.func,onDrop:mt.default.func,droppingItem:mt.default.shape({i:mt.default.string.isRequired,w:mt.default.number.isRequired,h:mt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};oB.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:mt.default.any};zi.default=iB;Object.defineProperty(Pg,"__esModule",{value:!0});Pg.default=void 0;var Sl=Vx(m),At=Vx(js),sB=P$,aB=rB,Cl=wt,Wn=li,cE=zi,lB=Vx(Rx);function Vx(e){return e&&e.__esModule?e:{default:e}}function Wo(e,t,n){return t=cB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cB(e){var t=uB(e,"string");return typeof t=="symbol"?t:String(t)}function uB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Hx extends Sl.default.Component{constructor(){super(...arguments),Wo(this,"state",{resizing:null,dragging:null,className:""}),Wo(this,"elementRef",Sl.default.createRef()),Wo(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,f=l.left/i,p=c.top/i,g=l.top/i;s.left=u-f+a.scrollLeft,s.top=p-g+a.scrollTop,this.setState({dragging:s});const{x:v,y:b}=(0,Wn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,b,{e:t,node:r,newPosition:s})}),Wo(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:f,h:p,containerWidth:g}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:S,rowHeight:R}=this.props,E=_.clientHeight-(0,Wn.calcGridItemWHPx)(p,R,S[1]);a=(0,Wn.clamp)(a,0,E);const O=(0,Wn.calcGridColWidth)(v),k=g-(0,Wn.calcGridItemWHPx)(f,O,S[0]);l=(0,Wn.clamp)(l,0,k)}}const b={top:a,left:l};this.setState({dragging:b});const{x,y:w}=(0,Wn.calcXY)(v,a,l,f,p);return s.call(this,u,x,w,{e:t,node:r,newPosition:b})}),Wo(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:f,y:p}=(0,Wn.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,f,p,{e:t,node:r,newPosition:u})}),Wo(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Wo(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Wo(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,Wn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,Wn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Cl.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,Cl.setTransform)(t):(i=(0,Cl.setTopLeft)(t),n&&(i.left=(0,Cl.perc)(t.left/r),i.width=(0,Cl.perc)(t.width/r))),i}mixinDraggable(t,n){return Sl.default.createElement(sB.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:f}=this.props,p=this.getPositionParams(),g=(0,Wn.calcGridItemPosition)(p,0,0,o,0).width,v=(0,Wn.calcGridItemPosition)(p,0,0,i,s),b=(0,Wn.calcGridItemPosition)(p,0,0,a,l),x=[v.width,v.height],w=[Math.min(b.width,g),Math.min(b.height,1/0)];return Sl.default.createElement(aB.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:f},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:f,maxH:p,minH:g,containerWidth:v}=this.props,{minW:b,maxW:x}=this.props;let w=s;i&&(w=(0,Cl.resizeItemInDirection)(a,r,s,v),this.setState({resizing:o==="onResizeStop"?null:w}));let{w:_,h:S}=(0,Wn.calcWH)(this.getPositionParams(),w.width,w.height,c,u,a);_=(0,Wn.clamp)(_,Math.max(b,1),x),S=(0,Wn.clamp)(S,g,p),l.call(this,f,_,S,{e:t,node:i,size:w,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Wn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Sl.default.Children.only(this.props.children);let f=Sl.default.cloneElement(u,{ref:this.elementRef,className:(0,lB.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 f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,i),f}}Pg.default=Hx;Wo(Hx,"propTypes",{children:At.default.element,cols:At.default.number.isRequired,containerWidth:At.default.number.isRequired,rowHeight:At.default.number.isRequired,margin:At.default.array.isRequired,maxRows:At.default.number.isRequired,containerPadding:At.default.array.isRequired,x:At.default.number.isRequired,y:At.default.number.isRequired,w:At.default.number.isRequired,h:At.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:At.default.string.isRequired,resizeHandles:cE.resizeHandleAxesType,resizeHandle:cE.resizeHandleType,onDragStop:At.default.func,onDragStart:At.default.func,onDrag:At.default.func,onResizeStop:At.default.func,onResizeStart:At.default.func,onResize:At.default.func,isDraggable:At.default.bool.isRequired,isResizable:At.default.bool.isRequired,isBounded:At.default.bool.isRequired,static:At.default.bool,useCSSTransforms:At.default.bool.isRequired,transformScale:At.default.number,className:At.default.string,handle:At.default.string,cancel:At.default.string,droppingPosition:At.default.shape({e:At.default.object.isRequired,left:At.default.number.isRequired,top:At.default.number.isRequired})});Wo(Hx,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(ef,"__esModule",{value:!0});ef.default=void 0;var sa=pB(m),rb=Ex,dB=Wx(Rx),tt=wt,fB=li,uE=Wx(Pg),hB=Wx(zi);function Wx(e){return e&&e.__esModule?e:{default:e}}function I$(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(I$=function(r){return r?n:t})(e)}function pB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=I$(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Jn(e,t,n){return t=gB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gB(e){var t=mB(e,"string");return typeof t=="symbol"?t:String(t)}function mB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const dE="react-grid-layout";let N$=!1;try{N$=/firefox/i.test(navigator.userAgent)}catch{}class Ag extends sa.Component{constructor(){super(...arguments),Jn(this,"state",{activeDrag:null,layout:(0,tt.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,tt.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Jn(this,"dragEnterCounter",0),Jn(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,tt.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,tt.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),Jn(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:f}=this.props,p=(0,tt.getLayoutItem)(l,t);if(!p)return;const g={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t},v=!0;l=(0,tt.moveElement)(l,p,n,r,v,f,(0,tt.compactType)(this.props),c,u),this.props.onDrag(l,a,p,g,i,s),this.setState({layout:u?l:(0,tt.compact)(l,(0,tt.compactType)(this.props),c),activeDrag:g})}),Jn(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:f}=this.props,p=(0,tt.getLayoutItem)(l,t);if(!p)return;const g=!0;l=(0,tt.moveElement)(l,p,n,r,g,u,(0,tt.compactType)(this.props),c,f);const v=f?l:(0,tt.compact)(l,(0,tt.compactType)(this.props),c);this.props.onDragStop(v,a,p,null,i,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),Jn(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,tt.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,tt.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),Jn(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:f,preventCollision:p,allowOverlap:g}=this.props;let v=!1,b,x,w;const[_,S]=(0,tt.withLayoutItem)(u,t,E=>{let O;return x=E.x,w=E.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=E.x+(E.w-n),n=E.x!==x&&x<0?E.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=E.y+(E.h-r),r=E.y!==w&&w<0?E.h:r,w=w<0?0:w),v=!0),p&&!g&&(O=(0,tt.getAllCollisions)(u,{...E,w:n,h:r,x,y:w}).filter(M=>M.i!==E.i).length>0,O&&(w=E.y,r=E.h,x=E.x,n=E.w,v=!1)),E.w=n,E.h=r,E});if(!S)return;b=_,v&&(b=(0,tt.moveElement)(_,S,x,w,!0,this.props.preventCollision,(0,tt.compactType)(this.props),f,g));const R={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(b,c,S,R,i,s),this.setState({layout:g?b:(0,tt.compact)(b,(0,tt.compactType)(this.props),f),activeDrag:R})}),Jn(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,f=(0,tt.getLayoutItem)(a,t),p=u?a:(0,tt.compact)(a,(0,tt.compactType)(this.props),c);this.props.onResizeStop(p,l,f,null,i,s);const{oldLayout:g}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,g)}),Jn(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),N$&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(dE)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:f}=this.props,p=o==null?void 0:o(t);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const g={...r,...p},{layout:v}=this.state,{layerX:b,layerY:x}=t.nativeEvent,w={left:b/f,top:x/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=b||S!=x)&&this.setState({droppingPosition:w})}}else{const _={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},S=(0,fB.calcXY)(_,x,b,g.w,g.h);this.setState({droppingDOMNode:sa.createElement("div",{key:g.i}),droppingPosition:w,layout:[...v,{...g,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),Jn(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,tt.compact)(r.filter(i=>i.i!==t.i),(0,tt.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Jn(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Jn(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Jn(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,rb.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,tt.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,tt.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,tt.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,tt.fastRGLPropsEqual)(this.props,t,rb.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,tt.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,rb.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 sa.createElement(uE.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},sa.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,tt.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:f,isBounded:p,useCSSTransforms:g,transformScale:v,draggableCancel:b,draggableHandle:x,resizeHandles:w,resizeHandle:_}=this.props,{mounted:S,droppingPosition:R}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,O=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,k=r.resizeHandles||w,M=E&&p&&r.isBounded!==!1;return sa.createElement(uE.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:O,isBounded:M,useCSSTransforms:g&&S,usePercentages:!S,transformScale:v,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:k,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,dB.default)(dE,t),s={height:this.containerHeight(),...n};return sa.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:tt.noop,onDragLeave:r?this.onDragLeave:tt.noop,onDragEnter:r?this.onDragEnter:tt.noop,onDragOver:r?this.onDragOver:tt.noop},sa.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}ef.default=Ag;Jn(Ag,"displayName","ReactGridLayout");Jn(Ag,"propTypes",hB.default);Jn(Ag,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:tt.noop,onDragStart:tt.noop,onDrag:tt.noop,onDragStop:tt.noop,onResizeStart:tt.noop,onResize:tt.noop,onResizeStop:tt.noop,onDrop:tt.noop,onDropDragOver:tt.noop});var Ig={},Ja={};Object.defineProperty(Ja,"__esModule",{value:!0});Ja.findOrGenerateResponsiveLayout=yB;Ja.getBreakpointFromWidth=vB;Ja.getColsFromBreakpoint=bB;Ja.sortBreakpoints=Ux;var vh=wt;function vB(e,t){const n=Ux(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 bB(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function yB(e,t,n,r,o,i){if(e[n])return(0,vh.cloneLayout)(e[n]);let s=e[r];const a=Ux(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,vh.cloneLayout)(s||[]),(0,vh.compact)((0,vh.correctBounds)(s,{cols:o}),i,o)}function Ux(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Ig,"__esModule",{value:!0});Ig.default=void 0;var fE=wB(m),br=L$(js),ob=Ex,Wl=wt,aa=Ja,xB=L$(ef);function L$(e){return e&&e.__esModule?e:{default:e}}function F$(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(F$=function(r){return r?n:t})(e)}function wB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=F$(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 K0(){return K0=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},K0.apply(this,arguments)}function Ip(e,t,n){return t=_B(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _B(e){var t=SB(e,"string");return typeof t=="symbol"?t:String(t)}function SB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const hE=e=>Object.prototype.toString.call(e);function bh(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class qx extends fE.Component{constructor(){super(...arguments),Ip(this,"state",this.generateInitialState()),Ip(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,aa.getBreakpointFromWidth)(n,t),s=(0,aa.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,aa.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,ob.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,aa.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,ob.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,ob.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,aa.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,aa.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Wl.cloneLayout)(this.state.layout));let p=(0,aa.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);p=(0,Wl.synchronizeLayoutWithChildren)(p,this.props.children,l,i,this.props.allowOverlap),c[s]=p,this.props.onLayoutChange(p,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:p,cols:l})}const u=bh(this.props.margin,s),f=bh(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return fE.createElement(xB.default,K0({},u,{margin:bh(i,this.state.breakpoint),containerPadding:bh(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Ig.default=qx;Ip(qx,"propTypes",{breakpoint:br.default.string,breakpoints:br.default.object,allowOverlap:br.default.bool,cols:br.default.object,margin:br.default.oneOfType([br.default.array,br.default.object]),containerPadding:br.default.oneOfType([br.default.array,br.default.object]),layouts(e,t){if(hE(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+hE(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,Wl.validateLayout)(e.layouts[n],"layouts."+n)})},width:br.default.number.isRequired,onBreakpointChange:br.default.func,onLayoutChange:br.default.func,onWidthChange:br.default.func});Ip(qx,"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:Wl.noop,onLayoutChange:Wl.noop,onWidthChange:Wl.noop});var Gx={},z$=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}()}(),X0=typeof window<"u"&&typeof document<"u"&&window.document===document,Np=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")()}(),CB=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Np):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),EB=2;function RB(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){CB(i)}function a(){var l=Date.now();if(n){if(l-o<EB)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var PB=20,OB=["top","right","bottom","left","width","height","size","weight"],$B=typeof MutationObserver<"u",DB=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=RB(this.refresh.bind(this),PB)}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(){!X0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),$B?(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(){!X0||!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=OB.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}(),j$=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},gc=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Np},B$=Ng(0,0,0,0);function Lp(e){return parseFloat(e)||0}function pE(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+Lp(i)},0)}function TB(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]=Lp(s)}return n}function kB(e){var t=e.getBBox();return Ng(0,0,t.width,t.height)}function MB(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return B$;var r=gc(e).getComputedStyle(e),o=TB(r),i=o.left+o.right,s=o.top+o.bottom,a=Lp(r.width),l=Lp(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=pE(r,"left","right")+i),Math.round(l+s)!==n&&(l-=pE(r,"top","bottom")+s)),!IB(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 Ng(o.left,o.top,a,l)}var AB=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof gc(e).SVGGraphicsElement}:function(e){return e instanceof gc(e).SVGElement&&typeof e.getBBox=="function"}}();function IB(e){return e===gc(e).document.documentElement}function NB(e){return X0?AB(e)?kB(e):MB(e):B$}function LB(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 j$(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function Ng(e,t,n,r){return{x:e,y:t,width:n,height:r}}var FB=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ng(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=NB(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}(),zB=function(){function e(t,n){var r=LB(n);j$(this,{target:t,contentRect:r})}return e}(),jB=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new z$,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 gc(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new FB(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 gc(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 zB(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}(),V$=typeof WeakMap<"u"?new WeakMap:new z$,H$=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=DB.getInstance(),r=new jB(t,n,this);V$.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){H$.prototype[e]=function(){var t;return(t=V$.get(this))[e].apply(t,arguments)}});var BB=function(){return typeof Np.ResizeObserver<"u"?Np.ResizeObserver:H$}();const VB=Object.freeze(Object.defineProperty({__proto__:null,default:BB},Symbol.toStringTag,{value:"Module"})),HB=sx(VB);Object.defineProperty(Gx,"__esModule",{value:!0});Gx.default=QB;var yh=GB(m),WB=Yx(js),UB=Yx(HB),qB=Yx(Rx);function Yx(e){return e&&e.__esModule?e:{default:e}}function W$(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(W$=function(r){return r?n:t})(e)}function GB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=W$(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 Q0(){return Q0=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},Q0.apply(this,arguments)}function El(e,t,n){return t=YB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YB(e){var t=KB(e,"string");return typeof t=="symbol"?t:String(t)}function KB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const XB="react-grid-layout";function QB(e){var t;return t=class extends yh.Component{constructor(){super(...arguments),El(this,"state",{width:1280}),El(this,"elementRef",yh.createRef()),El(this,"mounted",!1),El(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new UB.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?yh.createElement("div",{className:(0,qB.default)(this.props.className,XB),style:this.props.style,ref:this.elementRef}):yh.createElement(e,Q0({innerRef:this.elementRef},o,this.state))}},El(t,"defaultProps",{measureBeforeMount:!1}),El(t,"propTypes",{measureBeforeMount:WB.default.bool}),t}(function(e){e.exports=ef.default,e.exports.utils=wt,e.exports.calculateUtils=li,e.exports.Responsive=Ig.default,e.exports.Responsive.utils=Ja,e.exports.WidthProvider=Gx.default})(n$);var gE=n$.exports;function Va({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),c=Te(p=>p.isDashboardEditing),u=p=>{p.stopPropagation(),c&&s(!0)};function f(){return o==="textarea"?P.jsx("textarea",{className:Ee(" grow px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:p=>l(p.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{p.key==="Enter"&&p.shiftKey||(p.key==="Enter"||p.key==="Tab")&&(s(!1),r(a))}}):P.jsx("input",{onMouseDown:p=>p.stopPropagation(),type:"text",className:Ee("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:p=>l(p.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{(p.key==="Enter"||p.key==="Tab")&&(s(!1),r(a))}})}return P.jsx("div",{className:"flex",role:"editable",onDoubleClick:u,children:i?f():e})}/*!
|
|
110
|
+
* @kurkle/color v0.3.2
|
|
111
|
+
* https://github.com/kurkle/color#readme
|
|
112
|
+
* (c) 2023 Jukka Kurkela
|
|
113
|
+
* Released under the MIT License
|
|
114
|
+
*/function rf(e){return e+.5|0}const Cs=(e,t,n)=>Math.max(Math.min(e,n),t);function Pu(e){return Cs(rf(e*2.55),0,255)}function Ts(e){return Cs(rf(e*255),0,255)}function Di(e){return Cs(rf(e/2.55)/100,0,1)}function mE(e){return Cs(rf(e*100),0,100)}const po={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},J0=[..."0123456789ABCDEF"],JB=e=>J0[e&15],ZB=e=>J0[(e&240)>>4]+J0[e&15],xh=e=>(e&240)>>4===(e&15),eV=e=>xh(e.r)&&xh(e.g)&&xh(e.b)&&xh(e.a);function tV(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&po[e[1]]*17,g:255&po[e[2]]*17,b:255&po[e[3]]*17,a:t===5?po[e[4]]*17:255}:(t===7||t===9)&&(n={r:po[e[1]]<<4|po[e[2]],g:po[e[3]]<<4|po[e[4]],b:po[e[5]]<<4|po[e[6]],a:t===9?po[e[7]]<<4|po[e[8]]:255})),n}const nV=(e,t)=>e<255?t(e):"";function rV(e){var t=eV(e)?JB:ZB;return e?"#"+t(e.r)+t(e.g)+t(e.b)+nV(e.a,t):void 0}const oV=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function U$(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 iV(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 sV(e,t,n){const r=U$(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 aV(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 Kx(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=aV(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function Xx(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Ts)}function Qx(e,t,n){return Xx(U$,e,t,n)}function lV(e,t,n){return Xx(sV,e,t,n)}function cV(e,t,n){return Xx(iV,e,t,n)}function q$(e){return(e%360+360)%360}function uV(e){const t=oV.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Pu(+t[5]):Ts(+t[5]));const o=q$(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=lV(o,i,s):t[1]==="hsv"?r=cV(o,i,s):r=Qx(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function dV(e,t){var n=Kx(e);n[0]=q$(n[0]+t),n=Qx(n),e.r=n[0],e.g=n[1],e.b=n[2]}function fV(e){if(!e)return;const t=Kx(e),n=t[0],r=mE(t[1]),o=mE(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Di(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const vE={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"},bE={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function hV(){const e={},t=Object.keys(bE),n=Object.keys(vE);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,vE[i]);i=parseInt(bE[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let wh;function pV(e){wh||(wh=hV(),wh.transparent=[0,0,0,0]);const t=wh[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const gV=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function mV(e){const t=gV.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Pu(s):Cs(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?Pu(r):Cs(r,0,255)),o=255&(t[4]?Pu(o):Cs(o,0,255)),i=255&(t[6]?Pu(i):Cs(i,0,255)),{r,g:o,b:i,a:n}}}function vV(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Di(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const ib=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Rl=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function bV(e,t,n){const r=Rl(Di(e.r)),o=Rl(Di(e.g)),i=Rl(Di(e.b));return{r:Ts(ib(r+n*(Rl(Di(t.r))-r))),g:Ts(ib(o+n*(Rl(Di(t.g))-o))),b:Ts(ib(i+n*(Rl(Di(t.b))-i))),a:e.a+n*(t.a-e.a)}}function _h(e,t,n){if(e){let r=Kx(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Qx(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function G$(e,t){return e&&Object.assign(t||{},e)}function yE(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=Ts(e[3]))):(t=G$(e,{r:0,g:0,b:0,a:1}),t.a=Ts(t.a)),t}function yV(e){return e.charAt(0)==="r"?mV(e):uV(e)}class td{constructor(t){if(t instanceof td)return t;const n=typeof t;let r;n==="object"?r=yE(t):n==="string"&&(r=tV(t)||pV(t)||yV(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=G$(this._rgb);return t&&(t.a=Di(t.a)),t}set rgb(t){this._rgb=yE(t)}rgbString(){return this._valid?vV(this._rgb):void 0}hexString(){return this._valid?rV(this._rgb):void 0}hslString(){return this._valid?fV(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=bV(this._rgb,t._rgb,n)),this}clone(){return new td(this.rgb)}alpha(t){return this._rgb.a=Ts(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=rf(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 _h(this._rgb,2,t),this}darken(t){return _h(this._rgb,2,-t),this}saturate(t){return _h(this._rgb,1,t),this}desaturate(t){return _h(this._rgb,1,-t),this}rotate(t){return dV(this._rgb,t),this}}/*!
|
|
115
|
+
* Chart.js v4.4.1
|
|
116
|
+
* https://www.chartjs.org
|
|
117
|
+
* (c) 2023 Chart.js Contributors
|
|
118
|
+
* Released under the MIT License
|
|
119
|
+
*/function Si(){}const xV=(()=>{let e=0;return()=>e++})();function xt(e){return e===null||typeof e>"u"}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 St(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function vn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Br(e,t){return vn(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const wV=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Y$=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ht(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function jt(e,t,n,r){let o,i,s;if(sn(e))if(i=e.length,r)for(o=i-1;o>=0;o--)t.call(n,e[o],o);else for(o=0;o<i;o++)t.call(n,e[o],o);else if(St(e))for(s=Object.keys(e),i=s.length,o=0;o<i;o++)t.call(n,e[s[o]],s[o])}function Fp(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 zp(e){if(sn(e))return e.map(zp);if(St(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=zp(e[n[o]]);return t}return e}function K$(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function _V(e,t,n,r){if(!K$(e))return;const o=t[e],i=n[e];St(o)&&St(i)?oi(o,i,r):t[e]=zp(i)}function oi(e,t,n){const r=sn(t)?t:[t],o=r.length;if(!St(e))return e;n=n||{};const i=n.merger||_V;let s;for(let a=0;a<o;++a){if(s=r[a],!St(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 Au(e,t){return oi(e,t,{merger:SV})}function SV(e,t,n){if(!K$(e))return;const r=t[e],o=n[e];St(r)&&St(o)?Au(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=zp(o))}const xE={"":e=>e,x:e=>e.x,y:e=>e.y};function CV(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 EV(e){const t=CV(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Ms(e,t){return(xE[t]||(xE[t]=EV(t)))(e)}function Jx(e){return e.charAt(0).toUpperCase()+e.slice(1)}const nd=e=>typeof e<"u",As=e=>typeof e=="function",wE=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function RV(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ln=Math.PI,an=2*ln,PV=an+ln,jp=Number.POSITIVE_INFINITY,OV=ln/180,_n=ln/2,la=ln/4,_E=ln*2/3,Es=Math.log10,ti=Math.sign;function Iu(e,t,n){return Math.abs(e-t)<n}function SE(e){const t=Math.round(e);e=Iu(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Es(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function $V(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 mc(e){return!isNaN(parseFloat(e))&&isFinite(e)}function DV(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function X$(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 ko(e){return e*(ln/180)}function Zx(e){return e*(180/ln)}function CE(e){if(!vn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Q$(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*ln&&(i+=an),{angle:i,distance:o}}function Z0(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function TV(e,t){return(e-t+PV)%an-ln}function qr(e){return(e%an+an)%an}function rd(e,t,n,r){const o=qr(e),i=qr(t),s=qr(n),a=qr(i-o),l=qr(s-o),c=qr(o-i),u=qr(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function jn(e,t,n){return Math.max(t,Math.min(n,e))}function kV(e){return jn(e,-32768,32767)}function Ai(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ew(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 Ii=(e,t,n,r)=>ew(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),MV=(e,t,n)=>ew(e,n,r=>e[r][t]>=n);function AV(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 J$=["push","pop","shift","splice","unshift"];function IV(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),J$.forEach(n=>{const r="_onData"+Jx(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 EE(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)&&(J$.forEach(i=>{delete e[i]}),delete e._chartjs)}function Z$(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const eD=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function tD(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,eD.call(window,()=>{r=!1,e.apply(t,n)}))}}function NV(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const tw=e=>e==="start"?"left":e==="end"?"right":"center",Zn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,LV=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function nD(e,t,n){const r=t.length;let o=0,i=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:u,minDefined:f,maxDefined:p}=s.getUserBounds();f&&(o=jn(Math.min(Ii(a,l,c).lo,n?r:Ii(t,l,s.getPixelForValue(c)).lo),0,r-1)),p?i=jn(Math.max(Ii(a,s.axis,u,!0).hi+1,n?0:Ii(t,l,s.getPixelForValue(u),!0).hi+1),o,r)-o:i=r-o}return{start:o,count:i}}function rD(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 Sh=e=>e===0||e===1,RE=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*an/n)),PE=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*an/n)+1,Nu={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*_n)+1,easeOutSine:e=>Math.sin(e*_n),easeInOutSine:e=>-.5*(Math.cos(ln*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=>Sh(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=>Sh(e)?e:RE(e,.075,.3),easeOutElastic:e=>Sh(e)?e:PE(e,.075,.3),easeInOutElastic(e){return Sh(e)?e:e<.5?.5*RE(e*2,.1125,.45):.5+.5*PE(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-Nu.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?Nu.easeInBounce(e*2)*.5:Nu.easeOutBounce(e*2-1)*.5+.5};function nw(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function OE(e){return nw(e)?e:new td(e)}function sb(e){return nw(e)?e:new td(e).saturate(.5).darken(.1).hexString()}const FV=["x","y","borderWidth","radius","tension"],zV=["color","borderColor","backgroundColor"];function jV(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:zV},numbers:{type:"number",properties:FV}}),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 BV(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const $E=new Map;function VV(e,t){t=t||{};const n=e+JSON.stringify(t);let r=$E.get(n);return r||(r=new Intl.NumberFormat(e,t),$E.set(n,r)),r}function of(e,t,n){return VV(t,n).format(e)}const oD={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=HV(e,n)}const s=Es(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),of(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Es(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?oD.numeric.call(this,e,t,n):""}};function HV(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Lg={formatters:oD};function WV(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Lg.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ha=Object.create(null),ey=Object.create(null);function Lu(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 ab(e,t,n){return typeof t=="string"?oi(Lu(e,t),n):oi(Lu(e,""),t)}class UV{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)=>sb(o.backgroundColor),this.hoverBorderColor=(r,o)=>sb(o.borderColor),this.hoverColor=(r,o)=>sb(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 ab(this,t,n)}get(t){return Lu(this,t)}describe(t,n){return ab(ey,t,n)}override(t,n){return ab(Ha,t,n)}route(t,n,r,o){const i=Lu(this,t),s=Lu(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 St(l)?Object.assign({},c,l):at(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var gn=new UV({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[jV,BV,WV]);function qV(e){return!e||xt(e.size)||xt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Bp(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 GV(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,f,p;for(l=0;l<a;l++)if(f=n[l],f!=null&&!sn(f))s=Bp(e,o,i,s,f);else if(sn(f))for(c=0,u=f.length;c<u;c++)p=f[c],p!=null&&!sn(p)&&(s=Bp(e,o,i,s,p));e.restore();const g=i.length/2;if(g>n.length){for(l=0;l<g;l++)delete o[i[l]];i.splice(0,g)}return s}function ca(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 DE(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function ty(e,t,n,r){iD(e,t,n,r,null)}function iD(e,t,n,r,o){let i,s,a,l,c,u,f,p;const g=t.pointStyle,v=t.rotation,b=t.radius;let x=(v||0)*OV;if(g&&typeof g=="object"&&(i=g.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(x),e.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),e.restore();return}if(!(isNaN(b)||b<=0)){switch(e.beginPath(),g){default:o?e.ellipse(n,r,o/2,b,0,0,an):e.arc(n,r,b,0,an),e.closePath();break;case"triangle":u=o?o/2:b,e.moveTo(n+Math.sin(x)*u,r-Math.cos(x)*b),x+=_E,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*b),x+=_E,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*b),e.closePath();break;case"rectRounded":c=b*.516,l=b-c,s=Math.cos(x+la)*l,f=Math.cos(x+la)*(o?o/2-c:l),a=Math.sin(x+la)*l,p=Math.sin(x+la)*(o?o/2-c:l),e.arc(n-f,r-a,c,x-ln,x-_n),e.arc(n+p,r-s,c,x-_n,x),e.arc(n+f,r+a,c,x,x+_n),e.arc(n-p,r+s,c,x+_n,x+ln),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*b,u=o?o/2:l,e.rect(n-u,r-l,2*u,2*l);break}x+=la;case"rectRot":f=Math.cos(x)*(o?o/2:b),s=Math.cos(x)*b,a=Math.sin(x)*b,p=Math.sin(x)*(o?o/2:b),e.moveTo(n-f,r-a),e.lineTo(n+p,r-s),e.lineTo(n+f,r+a),e.lineTo(n-p,r+s),e.closePath();break;case"crossRot":x+=la;case"cross":f=Math.cos(x)*(o?o/2:b),s=Math.cos(x)*b,a=Math.sin(x)*b,p=Math.sin(x)*(o?o/2:b),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"star":f=Math.cos(x)*(o?o/2:b),s=Math.cos(x)*b,a=Math.sin(x)*b,p=Math.sin(x)*(o?o/2:b),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s),x+=la,f=Math.cos(x)*(o?o/2:b),s=Math.cos(x)*b,a=Math.sin(x)*b,p=Math.sin(x)*(o?o/2:b),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"line":s=o?o/2:Math.cos(x)*b,a=Math.sin(x)*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(x)*(o?o/2:b),r+Math.sin(x)*b);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Ni(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 Fg(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function zg(e){e.restore()}function YV(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 KV(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 XV(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),xt(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 QV(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 JV(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Wa(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,XV(e,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&JV(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),xt(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),QV(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function od(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*ln,ln,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,ln,_n,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,_n,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-_n,!0),e.lineTo(n+s.topLeft,r)}const ZV=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,eH=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function tH(e,t){const n=(""+e).match(ZV);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 nH=e=>+e||0;function rw(e,t){const n={},r=St(t),o=r?Object.keys(t):t,i=St(e)?r?s=>at(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=nH(i(s));return n}function sD(e){return rw(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ia(e){return rw(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Yn(e){const t=sD(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function En(e,t){e=e||{},t=t||gn.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=at(e.style,t.style);r&&!(""+r).match(eH)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:at(e.family,t.family),lineHeight:tH(at(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:at(e.weight,t.weight),string:""};return o.string=qV(o),o}function on(e,t,n,r){let o=!0,i,s,a;for(i=0,s=e.length;i<s;++i)if(a=e[i],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),o=!1),n!==void 0&&sn(a)&&(a=a[n%a.length],o=!1),a!==void 0))return r&&!o&&(r.cacheable=!1),a}function rH(e,t,n){const{min:r,max:o}=e,i=Y$(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 Bs(e,t){return Object.assign(Object.create(e),t)}function ow(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=uD("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>ow([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 lD(a,l,()=>dH(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return kE(a).includes(l)},ownKeys(a){return kE(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function vc(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:aD(e,r),setContext:i=>vc(e,i,n,r),override:i=>vc(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 lD(i,s,()=>iH(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 aD(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:o=t.allKeys}=e;return{allKeys:o,scriptable:n,indexable:r,isScriptable:As(n)?n:()=>n,isIndexable:As(r)?r:()=>r}}const oH=(e,t)=>e?e+Jx(t):t,iw=(e,t)=>St(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function lD(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function iH(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return As(a)&&s.isScriptable(t)&&(a=sH(t,a,e,n)),sn(a)&&a.length&&(a=aH(t,a,e,s.isIndexable)),iw(t,a)&&(a=vc(a,o,i&&i[t],s)),a}function sH(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),iw(e,l)&&(l=sw(o._scopes,o,e,l)),l}function aH(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(St(t[0])){const l=t,c=o._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=sw(c,o,e,u);t.push(vc(f,i,s&&s[e],a))}}return t}function cD(e,t,n){return As(e)?e(t,n):e}const lH=(e,t)=>e===!0?t:typeof e=="string"?Ms(t,e):void 0;function cH(e,t,n,r,o){for(const i of t){const s=lH(n,i);if(s){e.add(s);const a=cD(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 sw(e,t,n,r){const o=t._rootScopes,i=cD(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=TE(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=TE(a,s,i,l,r),l===null)?!1:ow(Array.from(a),[""],o,i,()=>uH(t,n,r))}function TE(e,t,n,r,o){for(;n;)n=cH(e,t,n,r,o);return n}function uH(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return sn(o)&&St(n)?n:o||{}}function dH(e,t,n,r){let o;for(const i of t)if(o=uD(oH(i,e),n),typeof o<"u")return iw(e,o)?sw(n,r,e,o):o}function uD(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function kE(e){let t=e._keys;return t||(t=e._keys=fH(e._scopes)),t}function fH(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 dD(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(Ms(u,i),c)};return s}const hH=Number.EPSILON||1e-14,bc=(e,t)=>t<e.length&&!e[t].skip&&e[t],fD=e=>e==="x"?"y":"x";function pH(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=Z0(i,o),l=Z0(s,i);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=r*c,p=r*u;return{previous:{x:i.x-f*(s.x-o.x),y:i.y-f*(s.y-o.y)},next:{x:i.x+p*(s.x-o.x),y:i.y+p*(s.y-o.y)}}}function gH(e,t,n){const r=e.length;let o,i,s,a,l,c=bc(e,0);for(let u=0;u<r-1;++u)if(l=c,c=bc(e,u+1),!(!l||!c)){if(Iu(t[u],0,hH)){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 mH(e,t,n="x"){const r=fD(n),o=e.length;let i,s,a,l=bc(e,0);for(let c=0;c<o;++c){if(s=a,a=l,l=bc(e,c+1),!a)continue;const u=a[n],f=a[r];s&&(i=(u-s[n])/3,a[`cp1${n}`]=u-i,a[`cp1${r}`]=f-i*t[c]),l&&(i=(l[n]-u)/3,a[`cp2${n}`]=u+i,a[`cp2${r}`]=f+i*t[c])}}function vH(e,t="x"){const n=fD(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,c=bc(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=bc(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?ti(o[s-1])!==ti(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}gH(e,o,i),mH(e,i,t)}function Ch(e,t,n){return Math.max(Math.min(e,n),t)}function bH(e,t){let n,r,o,i,s,a=Ni(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&Ni(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=Ch(o.cp1x,t.left,t.right),o.cp1y=Ch(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=Ch(o.cp2x,t.left,t.right),o.cp2y=Ch(o.cp2y,t.top,t.bottom)))}function yH(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")vH(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=pH(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&&bH(e,n)}function aw(){return typeof window<"u"&&typeof document<"u"}function lw(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Vp(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const jg=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function xH(e,t){return jg(e).getPropertyValue(t)}const wH=["top","right","bottom","left"];function Na(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=wH[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const _H=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function SH(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(_H(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 ga(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=jg(n),i=o.boxSizing==="border-box",s=Na(o,"padding"),a=Na(o,"border","width"),{x:l,y:c,box:u}=SH(e,n),f=s.left+(u&&a.left),p=s.top+(u&&a.top);let{width:g,height:v}=t;return i&&(g-=s.width+a.width,v-=s.height+a.height),{x:Math.round((l-f)/g*n.width/r),y:Math.round((c-p)/v*n.height/r)}}function CH(e,t,n){let r,o;if(t===void 0||n===void 0){const i=lw(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=jg(i),l=Na(a,"border","width"),c=Na(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Vp(a.maxWidth,i,"clientWidth"),o=Vp(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||jp,maxHeight:o||jp}}const Eh=e=>Math.round(e*10)/10;function EH(e,t,n,r){const o=jg(e),i=Na(o,"margin"),s=Vp(o.maxWidth,e,"clientWidth")||jp,a=Vp(o.maxHeight,e,"clientHeight")||jp,l=CH(e,t,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const p=Na(o,"border","width"),g=Na(o,"padding");c-=g.width+p.width,u-=g.height+p.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=Eh(Math.min(c,s,l.maxWidth)),u=Eh(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Eh(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Eh(Math.floor(u*r))),{width:c,height:u}}function ME(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 RH=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};aw()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function AE(e,t){const n=xH(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function ma(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function PH(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function OH(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=ma(e,o,n),a=ma(o,i,n),l=ma(i,t,n),c=ma(s,a,n),u=ma(a,l,n);return ma(c,u,n)}const $H=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}}},DH=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Ul(e,t,n){return e?$H(t,n):DH()}function hD(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 pD(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function gD(e){return e==="angle"?{between:rd,compare:TV,normalize:qr}:{between:Ai,compare:(t,n)=>t-n,normalize:t=>t}}function IE({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 TH(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=gD(r),l=t.length;let{start:c,end:u,loop:f}=e,p,g;if(f){for(c+=l,u+=l,p=0,g=l;p<g&&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:f,style:e.style}}function mD(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:c}=gD(r),{start:u,end:f,loop:p,style:g}=TH(e,t,n),v=[];let b=!1,x=null,w,_,S;const R=()=>l(o,S,w)&&a(o,S)!==0,E=()=>a(i,w)===0||l(i,S,w),O=()=>b||R(),k=()=>!b||E();for(let M=u,D=u;M<=f;++M)_=t[M%s],!_.skip&&(w=c(_[r]),w!==S&&(b=l(w,o,i),x===null&&O()&&(x=a(w,o)===0?M:D),x!==null&&k()&&(v.push(IE({start:x,end:M,loop:p,count:s,style:g})),x=null),D=M,S=w));return x!==null&&v.push(IE({start:x,end:f,loop:p,count:s,style:g})),v}function vD(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=mD(r[o],e.points,t);i.length&&n.push(...i)}return n}function kH(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 MH(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 AH(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=kH(n,o,i,r);if(r===!0)return NE(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 NE(e,MH(n,s,l,c),n,t)}function NE(e,t,n,r){return!r||!r.setContext||!n?t:IH(e,t,n,r)}function IH(e,t,n,r){const o=e._chart.getContext(),i=LE(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=i,f=t[0].start,p=f;function g(v,b,x,w){const _=a?-1:1;if(v!==b){for(v+=l;n[v%l].skip;)v-=_;for(;n[b%l].skip;)b+=_;v%l!==b%l&&(c.push({start:v%l,end:b%l,loop:x,style:w}),u=w,f=b%l)}}for(const v of t){f=a?f:v.start;let b=n[f%l],x;for(p=f+1;p<=v.end;p++){const w=n[p%l];x=LE(r.setContext(Bs(o,{type:"segment",p0:b,p1:w,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),NH(x,u)&&g(f,p-1,v.loop,u),b=w,u=x}f<p-1&&g(f,p-1,v.loop,u)}return c}function LE(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function NH(e,t){if(!t)return!1;const n=[],r=function(o,i){return nw(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
|
120
|
+
* Chart.js v4.4.1
|
|
121
|
+
* https://www.chartjs.org
|
|
122
|
+
* (c) 2023 Chart.js Contributors
|
|
123
|
+
* Released under the MIT License
|
|
124
|
+
*/class LH{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=eD.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 Pi=new LH;const FE="transparent",FH={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=OE(e||FE),o=r.valid&&OE(t||FE);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class zH{constructor(t,n,r,o){const i=n[r];o=on([t.to,o,i,t.from]);const s=on([t.from,i,o]);this._active=!0,this._fn=t.fn||FH[t.type||typeof s],this._easing=Nu[t.easing]||Nu.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=on([t.to,n,o,t.from]),this._from=on([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 bD{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!St(t))return;const n=Object.keys(gn.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!St(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=BH(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&jH(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 f=i[c];const p=r.get(c);if(f)if(p&&f.active()){f.update(p,u,a);continue}else f.cancel();if(!p||!p.duration){t[c]=u;continue}i[c]=f=new zH(p,t,c,u),o.push(f)}return o}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Pi.add(this._chart,r),!0}}function jH(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 BH(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 zE(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 VH(e,t,n){if(n===!1)return!1;const r=zE(e,n),o=zE(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function HH(e){let t,n,r,o;return St(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 yD(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 jE(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let s,a,l,c;if(t!==null){for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(r.all)continue;break}c=e.values[l],vn(c)&&(i||t===0||ti(t)===ti(c))&&(t+=c)}return t}}function WH(e){const t=Object.keys(e),n=new Array(t.length);let r,o,i;for(r=0,o=t.length;r<o;++r)i=t[r],n[r]={x:i,y:e[i]};return n}function BE(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function UH(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function qH(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 GH(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function VE(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 HE(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=UH(i,s,r),f=t.length;let p;for(let g=0;g<f;++g){const v=t[g],{[l]:b,[c]:x}=v,w=v._stacks||(v._stacks={});p=w[c]=GH(o,u,b),p[a]=x,p._top=VE(p,s,!0,r.type),p._bottom=VE(p,s,!1,r.type);const _=p._visualValues||(p._visualValues={});_[a]=x}}function lb(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function YH(e,t){return Bs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function KH(e,t,n){return Bs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function du(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 cb=e=>e==="reset"||e==="none",WE=(e,t)=>t?e:Object.assign({},e),XH=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:yD(n,!0),values:null};class Mo{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=BE(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&&du(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(f,p,g,v)=>f==="x"?p:f==="r"?v:g,i=n.xAxisID=at(r.xAxisID,lb(t,"x")),s=n.yAxisID=at(r.yAxisID,lb(t,"y")),a=n.rAxisID=at(r.rAxisID,lb(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&&EE(this._data,this),t._stacked&&du(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(St(n))this._data=WH(n);else if(r!==n){if(r){EE(r,this);const o=this._cachedMeta;du(o),o._parsed=[]}n&&Object.isExtensible(n)&&IV(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=BE(n.vScale,n),n.stack!==r.stack&&(o=!0,du(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&HE(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:o}=this,{iScale:i,_stacked:s}=r,a=i.axis;let l=t===0&&n===o.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,f,p;if(this._parsing===!1)r._parsed=o,r._sorted=!0,p=o;else{sn(o[t])?p=this.parseArrayData(r,o,t,n):St(o[t])?p=this.parseObjectData(r,o,t,n):p=this.parsePrimitiveData(r,o,t,n);const g=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=f=p[u],l&&(g()&&(l=!1),c=f);r._sorted=l}s&&HE(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,f=new Array(o);let p,g,v;for(p=0,g=o;p<g;++p)v=p+r,f[p]={[a]:u||i.parse(c[v],v),[l]:s.parse(n[v],v)};return f}parseArrayData(t,n,r,o){const{xScale:i,yScale:s}=t,a=new Array(o);let l,c,u,f;for(l=0,c=o;l<c;++l)u=l+r,f=n[u],a[l]={x:i.parse(f[0],u),y:s.parse(f[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,f,p,g;for(u=0,f=o;u<f;++u)p=u+r,g=n[p],c[u]={x:i.parse(Ms(g,a),p),y:s.parse(Ms(g,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:yD(o,!0),values:n._stacks[t.axis]._visualValues};return jE(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=jE(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=XH(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=qH(a);let p,g;function v(){g=o[p];const b=g[a.axis];return!vn(g[t.axis])||u>b||f<b}for(p=0;p<s&&!(!v()&&(this.updateRangeFromParsed(c,t,g,l),i));++p);if(i){for(p=s-1;p>=0;--p)if(!v()){this.updateRangeFromParsed(c,t,g,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],vn(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=HH(at(this.options.clip,VH(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 f=o[u];f.hidden||(f.active&&c?s.push(f):f.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=KH(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=YH(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&&nd(r);if(a)return WE(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=o?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),u),g=Object.keys(gn.elements[t]),v=()=>this.getContext(r,o,n),b=c.resolveNamedOptions(p,g,v,f);return b.$shared&&(b.$shared=l,i[s]=Object.freeze(WE(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,f=u.datasetAnimationScopeKeys(this._type,n),p=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(p,this.getContext(t,r,n))}const c=new bD(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||cb(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){cb(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!cb(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&&du(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])}}De(Mo,"defaults",{}),De(Mo,"datasetElementType",null),De(Mo,"dataElementType",null);function QH(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=Z$(r.sort((o,i)=>o-i))}return e._cache.$bar}function JH(e){const t=e.iScale,n=QH(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(nd(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 ZH(e,t,n,r){const o=n.barThickness;let i,s;return xt(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 eW(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 tW(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 xD(e,t,n,r){return sn(e)?tW(e,t,n,r):t[n.axis]=n.parse(e,r),t}function UE(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,f,p;for(c=n,u=n+r;c<u;++c)p=t[c],f={},f[o.axis]=a||o.parse(s[c],c),l.push(xD(p,f,i,c));return l}function ub(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function nW(e,t,n){return e!==0?ti(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function rW(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 oW(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}=rW(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[qE(u,s,a,l)]=!0,o=c)),i[qE(o,s,a,l)]=!0,e.borderSkipped=i}function qE(e,t,n,r){return r?(e=iW(e,t,n),e=GE(e,n,t)):e=GE(e,t,n),e}function iW(e,t,n){return e===t?n:e===n?t:e}function GE(e,t,n){return e==="start"?t:e==="end"?n:e}function sW(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class pp extends Mo{parsePrimitiveData(t,n,r,o){return UE(t,n,r,o)}parseArrayData(t,n,r,o){return UE(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,f=[];let p,g,v,b;for(p=r,g=r+o;p<g;++p)b=n[p],v={},v[i.axis]=i.parse(Ms(b,c),p),f.push(xD(Ms(b,u),v,s,p));return f}updateRangeFromParsed(t,n,r,o){super.updateRangeFromParsed(t,n,r,o);const i=r._custom;i&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:o}=n,i=this.getParsed(t),s=i._custom,a=ub(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:f,includeOptions:p}=this._getSharedOptions(n,o);for(let g=n;g<n+r;g++){const v=this.getParsed(g),b=i||xt(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,u),w=(v._stacks||{})[a.axis],_={horizontal:c,base:b.base,enableBorderRadius:!w||ub(v._custom)||s===w._top||s===w._bottom,x:c?b.head:x.center,y:c?x.center:b.head,height:c?x.size:Math.abs(b.size),width:c?Math.abs(b.size):x.size};p&&(_.options=f||this.resolveDataElementOptions(g,t[g].active?"active":o));const S=_.options||t[g].options;oW(_,S,w,s),sW(_,S,u.ratio),this.updateElement(t[g],g,_,o)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),i=r.options.stacked,s=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(xt(u)||isNaN(u))return!0};for(const l of o)if(!(n!==void 0&&a(l))&&((i===!1||s.indexOf(l.stack)===-1||i===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const o=this._getStacks(t,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,s;for(i=0,s=n.data.length;i<s;++i)o.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=t.barThickness;return{min:a||JH(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=ub(c);let f=l[n.axis],p=0,g=r?this.applyStack(n,l,r):f,v,b;g!==f&&(p=g-f,g=f),u&&(f=c.barStart,g=c.barEnd-c.barStart,f!==0&&ti(f)!==ti(c.barEnd)&&(p=0),p+=f);const x=!xt(i)&&!u?i:p;let w=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(p+g):v=w,b=v-w,Math.abs(b)<s){b=nW(b,n,a)*s,f===a&&(w-=b/2);const _=n.getPixelForDecimal(0),S=n.getPixelForDecimal(1),R=Math.min(_,S),E=Math.max(_,S);w=Math.max(Math.min(w,E),R),v=w+b,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(v)-n.getValueForPixel(w))}if(w===n.getPixelForValue(a)){const _=ti(b)*n.getLineWidthForValue(a)/2;w+=_,b-=_}return{size:b,base:w,head:v,center:v+b/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,s=at(o.maxBarThickness,1/0);let a,l;if(n.grouped){const c=i?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?eW(t,n,o,c):ZH(t,n,o,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=u.start+u.chunk*f+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,o=r.length;let i=0;for(;i<o;++i)this.getParsed(i)[n.axis]!==null&&r[i].draw(this._ctx)}}De(pp,"id","bar"),De(pp,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),De(pp,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class gp extends Mo{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=at(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=at(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,f=a.axis;for(let p=n;p<n+r;p++){const g=t[p],v=!i&&this.getParsed(p),b={},x=b[u]=i?s.getPixelForDecimal(.5):s.getPixelForValue(v[u]),w=b[f]=i?a.getBasePixel():a.getPixelForValue(v[f]);b.skip=isNaN(x)||isNaN(w),c&&(b.options=l||this.resolveDataElementOptions(p,g.active?"active":o),i&&(b.options.radius=0)),this.updateElement(g,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+=at(r&&r._custom,i),o}}De(gp,"id","bubble"),De(gp,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),De(gp,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function aW(e,t,n){let r=1,o=1,i=0,s=0;if(t<an){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),f=Math.cos(l),p=Math.sin(l),g=(S,R,E)=>rd(S,a,l,!0)?1:Math.max(R,R*n,E,E*n),v=(S,R,E)=>rd(S,a,l,!0)?-1:Math.min(R,R*n,E,E*n),b=g(0,c,f),x=g(_n,u,p),w=v(ln,c,f),_=v(ln+_n,u,p);r=(b-w)/2,o=(x-_)/2,i=-(b+w)/2,s=-(x+_)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class Ca extends Mo{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(St(r[t])){const{key:l="value"}=this._parsing;i=c=>+Ms(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return ko(this.options.rotation-90)}_getCircumference(){return ko(this.options.circumference)}_getRotationExtents(){let t=an,n=-an;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(wV(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:p,ratioY:g,offsetX:v,offsetY:b}=aW(f,u,l),x=(r.width-s)/p,w=(r.height-s)/g,_=Math.max(Math.min(x,w)/2,0),S=Y$(this.options.radius,_),R=Math.max(S*l,0),E=(S-R)/this._getVisibleDatasetWeightTotal();this.offsetX=v*S,this.offsetY=b*S,o.total=this.calculateTotal(),this.outerRadius=S-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*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/an)}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,f=(a.top+a.bottom)/2,p=i&&c.animateScale,g=p?0:this.innerRadius,v=p?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(n,o);let w=this._getRotation(),_;for(_=0;_<n;++_)w+=this._circumference(_,i);for(_=n;_<n+r;++_){const S=this._circumference(_,i),R=t[_],E={x:u+this.offsetX,y:f+this.offsetY,startAngle:w,endAngle:w+S,circumference:S,outerRadius:v,innerRadius:g};x&&(E.options=b||this.resolveDataElementOptions(_,R.active?"active":o)),w+=S,this.updateElement(R,_,E,o)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,o;for(o=0;o<n.length;o++){const i=t._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?an*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=of(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(at(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}De(Ca,"id","doughnut"),De(Ca,"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"}),De(Ca,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),De(Ca,"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 mp extends Mo{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}=nD(n,o,s);this._drawStart=a,this._drawCount=l,rD(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:f}=this._getSharedOptions(n,o),p=s.axis,g=a.axis,{spanGaps:v,segment:b}=this.options,x=mc(v)?v:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||i||o==="none",_=n+r,S=t.length;let R=n>0&&this.getParsed(n-1);for(let E=0;E<S;++E){const O=t[E],k=w?O:{};if(E<n||E>=_){k.skip=!0;continue}const M=this.getParsed(E),D=xt(M[g]),I=k[p]=s.getPixelForValue(M[p],E),z=k[g]=i||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[g],E);k.skip=isNaN(I)||isNaN(z)||D,k.stop=E>0&&Math.abs(M[p]-R[p])>x,b&&(k.parsed=M,k.raw=c.data[E]),f&&(k.options=u||this.resolveDataElementOptions(E,O.active?"active":o)),w||this.updateElement(O,E,k,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()}}De(mp,"id","line"),De(mp,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),De(mp,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Fu extends Mo{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=of(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return dD.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,f=c.yCenter,p=c.getIndexAngle(0)-.5*ln;let g=p,v;const b=360/this.countVisibleElements();for(v=0;v<n;++v)g+=this._computeAngle(v,o,b);for(v=n;v<n+r;v++){const x=t[v];let w=g,_=g+this._computeAngle(v,o,b),S=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;g=_,i&&(l.animateScale&&(S=0),l.animateRotate&&(w=_=p));const R={x:u,y:f,innerRadius:0,outerRadius:S,startAngle:w,endAngle:_,options:this.resolveDataElementOptions(v,x.active?"active":o)};this.updateElement(x,v,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)?ko(this.resolveDataElementOptions(t,n).angle||r):0}}De(Fu,"id","polarArea"),De(Fu,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),De(Fu,"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 ny extends Ca{}De(ny,"id","pie"),De(ny,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class vp extends Mo{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 dD.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),f=s?i.xCenter:u.x,p=s?i.yCenter:u.y,g={x:f,y:p,angle:u.angle,skip:isNaN(f)||isNaN(p),options:c};this.updateElement(l,a,g,o)}}}De(vp,"id","radar"),De(vp,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),De(vp,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class bp extends Mo{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}=nD(n,r,o);if(this._drawStart=i,this._drawCount=s,rD(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),f=this.getSharedOptions(u),p=this.includeOptions(o,f),g=s.axis,v=a.axis,{spanGaps:b,segment:x}=this.options,w=mc(b)?b:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||i||o==="none";let S=n>0&&this.getParsed(n-1);for(let R=n;R<n+r;++R){const E=t[R],O=this.getParsed(R),k=_?E:{},M=xt(O[v]),D=k[g]=s.getPixelForValue(O[g],R),I=k[v]=i||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,O,l):O[v],R);k.skip=isNaN(D)||isNaN(I)||M,k.stop=R>0&&Math.abs(O[g]-S[g])>w,x&&(k.parsed=O,k.raw=c.data[R]),p&&(k.options=f||this.resolveDataElementOptions(R,E.active?"active":o)),_||this.updateElement(E,R,k,o),S=O}this.updateSharedOptions(f,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}}De(bp,"id","scatter"),De(bp,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),De(bp,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var lW=Object.freeze({__proto__:null,BarController:pp,BubbleController:gp,DoughnutController:Ca,LineController:mp,PieController:ny,PolarAreaController:Fu,RadarController:vp,ScatterController:bp});function ua(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class cw{constructor(t){De(this,"options");this.options=t||{}}static override(t){Object.assign(cw.prototype,t)}init(){}formats(){return ua()}parse(){return ua()}format(){return ua()}add(){return ua()}diff(){return ua()}startOf(){return ua()}endOf(){return ua()}}var cW={_date:cw};function uW(e,t,n,r){const{controller:o,data:i,_sorted:s}=e,a=o._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&i.length){const l=a._reversePixels?MV:Ii;if(r){if(o._sharedOptions){const c=i[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const f=l(i,t,n-u),p=l(i,t,n+u);return{lo:f.lo,hi:p.hi}}}}else return l(i,t,n)}return{lo:0,hi:i.length-1}}function sf(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:f,hi:p}=uW(i[a],t,s,o);for(let g=f;g<=p;++g){const v=u[g];v.skip||r(v,c,g)}}}function dW(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 db(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||sf(e,n,t,function(a,l,c){!o&&!Ni(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function fW(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:f}=Q$(s,{x:t.x,y:t.y});rd(f,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return sf(e,n,t,i),o}function hW(e,t,n,r,o,i){let s=[];const a=dW(n);let l=Number.POSITIVE_INFINITY;function c(u,f,p){const g=u.inRange(t.x,t.y,o);if(r&&!g)return;const v=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(v))&&!g)return;const x=a(t,v);x<l?(s=[{element:u,datasetIndex:f,index:p}],l=x):x===l&&s.push({element:u,datasetIndex:f,index:p})}return sf(e,n,t,c),s}function fb(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?fW(e,t,n,o):hW(e,t,n,r,o,i)}function YE(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return sf(e,n,t,(l,c,u)=>{l[s](t[n],o)&&(i.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,o))}),r&&!a?[]:i}var pW={evaluateInteractionItems:sf,modes:{index(e,t,n,r){const o=ga(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?db(e,o,i,r,s):fb(e,o,i,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const o=ga(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?db(e,o,i,r,s):fb(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=ga(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return db(e,o,i,r,s)},nearest(e,t,n,r){const o=ga(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return fb(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=ga(t,e);return YE(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=ga(t,e);return YE(e,o,"y",n.intersect,r)}}};const wD=["left","top","right","bottom"];function fu(e,t){return e.filter(n=>n.pos===t)}function KE(e,t){return e.filter(n=>wD.indexOf(n.pos)===-1&&n.box.axis===t)}function hu(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 gW(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 mW(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!wD.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 vW(e,t){const n=mW(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 bW(e){const t=gW(e),n=hu(t.filter(c=>c.box.fullSize),!0),r=hu(fu(t,"left"),!0),o=hu(fu(t,"right")),i=hu(fu(t,"top"),!0),s=hu(fu(t,"bottom")),a=KE(t,"x"),l=KE(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:fu(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function XE(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function _D(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 yW(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!St(o)){n.size&&(e[o]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?i.height:i.width),n.size=f.size/f.count,e[o]+=n.size}i.getPadding&&_D(s,i.getPadding());const a=Math.max(0,t.outerWidth-XE(s,e,"left","right")),l=Math.max(0,t.outerHeight-XE(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 xW(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 wW(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 Ou(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,wW(a.horizontal,t));const{same:f,other:p}=yW(t,n,a,r);c|=f&&o.length,u=u||p,l.fullSize||o.push(a)}return c&&Ou(o,t,n,r)||u}function Rh(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 QE(e,t,n,r){const o=n.padding;let{x:i,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*u,p=c.size||l.height;nd(c.start)&&(s=c.start),l.fullSize?Rh(l,o.left,s,n.outerWidth-o.right-o.left,p):Rh(l,t.left+c.placed,s,f,p),c.start=s,c.placed+=f,s=l.bottom}else{const f=t.h*u,p=c.size||l.width;nd(c.start)&&(i=c.start),l.fullSize?Rh(l,i,o.top,p,n.outerHeight-o.bottom-o.top):Rh(l,i,t.top+c.placed,p,f),c.start=i,c.placed+=f,i=l.right}}t.x=i,t.y=s}var er={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=Yn(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=bW(e.boxes),l=a.vertical,c=a.horizontal;jt(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,x)=>x.box.options&&x.box.options.display===!1?b:b+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),p=Object.assign({},o);_D(p,Yn(r));const g=Object.assign({maxPadding:p,w:i,h:s,x:o.left,y:o.top},o),v=vW(l.concat(c),f);Ou(a.fullSize,g,f,v),Ou(l,g,f,v),Ou(c,g,f,v)&&Ou(l,g,f,v),xW(g),QE(a.leftAndTop,g,f,v),g.x+=g.w,g.y+=g.h,QE(a.rightAndBottom,g,f,v),e.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},jt(a.chartArea,b=>{const x=b.box;Object.assign(x,e.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class SD{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 _W extends SD{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const yp="$chartjs",SW={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},JE=e=>e===null||e==="";function CW(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[yp]={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",JE(o)){const i=AE(e,"width");i!==void 0&&(e.width=i)}if(JE(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=AE(e,"height");i!==void 0&&(e.height=i)}return e}const CD=RH?{passive:!0}:!1;function EW(e,t,n){e.addEventListener(t,n,CD)}function RW(e,t,n){e.canvas.removeEventListener(t,n,CD)}function PW(e,t){const n=SW[e.type]||e.type,{x:r,y:o}=ga(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function Hp(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function OW(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Hp(a.addedNodes,r),s=s&&!Hp(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function $W(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Hp(a.removedNodes,r),s=s&&!Hp(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const id=new Map;let ZE=0;function ED(){const e=window.devicePixelRatio;e!==ZE&&(ZE=e,id.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function DW(e,t){id.size||window.addEventListener("resize",ED),id.set(e,t)}function TW(e){id.delete(e),id.size||window.removeEventListener("resize",ED)}function kW(e,t,n){const r=e.canvas,o=r&&lw(r);if(!o)return;const i=tD((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),DW(e,i),s}function hb(e,t,n){n&&n.disconnect(),t==="resize"&&TW(e)}function MW(e,t,n){const r=e.canvas,o=tD(i=>{e.ctx!==null&&n(PW(i,e))},e);return EW(r,t,o),o}class AW extends SD{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(CW(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[yp])return!1;const r=n[yp].initial;["height","width"].forEach(i=>{const s=r[i];xt(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[yp],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:OW,detach:$W,resize:kW}[n]||MW;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:hb,detach:hb,resize:hb}[n]||RW)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return EH(t,n,r,o)}isAttached(t){const n=lw(t);return!!(n&&n.isConnected)}}function IW(e){return!aw()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?_W:AW}var dp;let Ui=(dp=class{constructor(){De(this,"x");De(this,"y");De(this,"active",!1);De(this,"options");De(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return mc(this.x)&&mc(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}},De(dp,"defaults",{}),De(dp,"defaultRoutes"),dp);function NW(e,t){const n=e.options.ticks,r=LW(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?zW(t):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return jW(t,c,i,s/o),c;const u=FW(i,t,o);if(s>0){let f,p;const g=s>1?Math.round((l-a)/(s-1)):null;for(Ph(t,c,u,xt(g)?0:a-g,a),f=0,p=s-1;f<p;f++)Ph(t,c,u,i[f],i[f+1]);return Ph(t,c,u,l,xt(g)?t.length:l+g),c}return Ph(t,c,u),c}function LW(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 FW(e,t,n){const r=BW(e),o=t.length/n;if(!r)return Math.max(o,1);const i=$V(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 zW(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function jW(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 Ph(e,t,n,r,o){const i=at(r,0),s=Math.min(at(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 BW(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 VW=e=>e==="left"?"right":e==="right"?"left":e,eR=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,tR=(e,t)=>Math.min(t||e,e);function nR(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 HW(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 WW(e,t){jt(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 pu(e){return e.drawTicks?e.tickLength:0}function rR(e,t){if(!e.display)return 0;const n=En(e.font,t),r=Yn(e.padding);return(sn(e.text)?e.text.length:1)*n.lineHeight+r.height}function UW(e,t){return Bs(e,{scale:t,type:"scale"})}function qW(e,t,n){return Bs(e,{tick:n,index:t,type:"tick"})}function GW(e,t,n){let r=tw(e);return(n&&t!=="right"||!n&&t==="right")&&(r=VW(r)),r}function YW(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let f=0,p,g,v;const b=s-o,x=a-i;if(e.isHorizontal()){if(g=Zn(r,i,a),St(n)){const w=Object.keys(n)[0],_=n[w];v=u[w].getPixelForValue(_)+b-t}else n==="center"?v=(c.bottom+c.top)/2+b-t:v=eR(e,n,t);p=a-i}else{if(St(n)){const w=Object.keys(n)[0],_=n[w];g=u[w].getPixelForValue(_)-x+t}else n==="center"?g=(c.left+c.right)/2-x+t:g=eR(e,n,t);v=Zn(r,s,o),f=n==="left"?-_n:_n}return{titleX:g,titleY:v,maxWidth:p,rotation:f}}class Za extends Ui{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=Br(t,Number.POSITIVE_INFINITY),n=Br(n,Number.NEGATIVE_INFINITY),r=Br(r,Number.POSITIVE_INFINITY),o=Br(o,Number.NEGATIVE_INFINITY),{min:Br(t,r),max:Br(n,o),minDefined:vn(t),maxDefined:vn(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:Br(n,Br(r,n)),max:Br(r,Br(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(){Ht(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=rH(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?nR(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=NW(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(){Ht(this.options.afterUpdate,[this])}beforeSetDimensions(){Ht(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(){Ht(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ht(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ht(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=Ht(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){Ht(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ht(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=tR(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(),f=u.widest.width,p=u.highest.height,g=jn(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:g/(r-1),f+6>a&&(a=g/(r-(t.offset?.5:1)),l=this.maxHeight-pu(t.grid)-n.padding-rR(t.title,this.chart.options.font),c=Math.sqrt(f*f+p*p),s=Zx(Math.min(Math.asin(jn((u.highest.height+6)/a,-1,1)),Math.asin(jn(l/c,-1,1))-Math.asin(jn(p/c,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){Ht(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ht(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=rR(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=pu(i)+l):(t.height=this.maxHeight,t.width=pu(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:p}=this._getLabelSizes(),g=r.padding*2,v=ko(this.labelRotation),b=Math.cos(v),x=Math.sin(v);if(a){const w=r.mirror?0:x*f.width+b*p.height;t.height=Math.min(this.maxHeight,t.height+w+g)}else{const w=r.mirror?0:b*f.width+x*p.height;t.width=Math.min(this.maxWidth,t.width+w+g)}this._calculatePadding(c,u,x,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,f=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,g=0;l?c?(p=o*t.width,g=r*n.height):(p=r*t.height,g=o*n.width):i==="start"?g=n.width:i==="end"?p=t.width:i!=="inner"&&(p=t.width/2,g=n.width/2),this.paddingLeft=Math.max((p-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-f+s)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;i==="start"?(u=0,f=t.height):i==="end"&&(u=n.height,f=0),this.paddingTop=u+s,this.paddingBottom=f+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Ht(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++)xt(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=nR(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/tR(n,r));let c=0,u=0,f,p,g,v,b,x,w,_,S,R,E;for(f=0;f<n;f+=l){if(v=t[f].label,b=this._resolveTickFontOptions(f),o.font=x=b.string,w=i[x]=i[x]||{data:{},gc:[]},_=b.lineHeight,S=R=0,!xt(v)&&!sn(v))S=Bp(o,w.data,w.gc,S,v),R=_;else if(sn(v))for(p=0,g=v.length;p<g;++p)E=v[p],!xt(E)&&!sn(E)&&(S=Bp(o,w.data,w.gc,S,E),R+=_);s.push(S),a.push(R),c=Math.max(S,c),u=Math.max(R,u)}WW(i,n);const O=s.indexOf(c),k=a.indexOf(u),M=D=>({width:s[D]||0,height:a[D]||0});return{first:M(0),last:M(n-1),widest:M(O),highest:M(k),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 kV(this._alignToPixels?ca(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=qW(this.getContext(),t,r))}return this.$context||(this.$context=UW(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=ko(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(),f=this.ticks.length+(l?1:0),p=pu(i),g=[],v=a.setContext(this.getContext()),b=v.display?v.width:0,x=b/2,w=function(K){return ca(r,K,b)};let _,S,R,E,O,k,M,D,I,z,j,Q;if(s==="top")_=w(this.bottom),k=this.bottom-p,D=_-x,z=w(t.top)+x,Q=t.bottom;else if(s==="bottom")_=w(this.top),z=t.top,Q=w(t.bottom)-x,k=_+x,D=this.top+p;else if(s==="left")_=w(this.right),O=this.right-p,M=_-x,I=w(t.left)+x,j=t.right;else if(s==="right")_=w(this.left),I=t.left,j=w(t.right)-x,O=_+x,M=this.left+p;else if(n==="x"){if(s==="center")_=w((t.top+t.bottom)/2+.5);else if(St(s)){const K=Object.keys(s)[0],H=s[K];_=w(this.chart.scales[K].getPixelForValue(H))}z=t.top,Q=t.bottom,k=_+x,D=k+p}else if(n==="y"){if(s==="center")_=w((t.left+t.right)/2);else if(St(s)){const K=Object.keys(s)[0],H=s[K];_=w(this.chart.scales[K].getPixelForValue(H))}O=_-x,M=O-p,I=t.left,j=t.right}const U=at(o.ticks.maxTicksLimit,f),B=Math.max(1,Math.ceil(f/U));for(S=0;S<f;S+=B){const K=this.getContext(S),H=i.setContext(K),q=a.setContext(K),Z=H.lineWidth,T=H.color,V=q.dash||[],X=q.dashOffset,N=H.tickWidth,se=H.tickColor,ae=H.tickBorderDash||[],ue=H.tickBorderDashOffset;R=HW(this,S,l),R!==void 0&&(E=ca(r,R,Z),c?O=M=I=j=E:k=D=z=Q=E,g.push({tx1:O,ty1:k,tx2:M,ty2:D,x1:I,y1:z,x2:j,y2:Q,width:Z,color:T,borderDash:V,borderDashOffset:X,tickWidth:N,tickColor:se,tickBorderDash:ae,tickBorderDashOffset:ue}))}return this._ticksLength=f,this._borderValue=_,g}_computeLabelItems(t){const n=this.axis,r=this.options,{position:o,ticks:i}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=i,p=pu(r.grid),g=p+u,v=f?-u:g,b=-ko(this.labelRotation),x=[];let w,_,S,R,E,O,k,M,D,I,z,j,Q="middle";if(o==="top")O=this.bottom-v,k=this._getXAxisLabelAlignment();else if(o==="bottom")O=this.top+v,k=this._getXAxisLabelAlignment();else if(o==="left"){const B=this._getYAxisLabelAlignment(p);k=B.textAlign,E=B.x}else if(o==="right"){const B=this._getYAxisLabelAlignment(p);k=B.textAlign,E=B.x}else if(n==="x"){if(o==="center")O=(t.top+t.bottom)/2+g;else if(St(o)){const B=Object.keys(o)[0],K=o[B];O=this.chart.scales[B].getPixelForValue(K)+g}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(t.left+t.right)/2-g;else if(St(o)){const B=Object.keys(o)[0],K=o[B];E=this.chart.scales[B].getPixelForValue(K)}k=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const U=this._getLabelSizes();for(w=0,_=a.length;w<_;++w){S=a[w],R=S.label;const B=i.setContext(this.getContext(w));M=this.getPixelForTick(w)+i.labelOffset,D=this._resolveTickFontOptions(w),I=D.lineHeight,z=sn(R)?R.length:1;const K=z/2,H=B.color,q=B.textStrokeColor,Z=B.textStrokeWidth;let T=k;s?(E=M,k==="inner"&&(w===_-1?T=this.options.reverse?"left":"right":w===0?T=this.options.reverse?"right":"left":T="center"),o==="top"?c==="near"||b!==0?j=-z*I+I/2:c==="center"?j=-U.highest.height/2-K*I+I:j=-U.highest.height+I/2:c==="near"||b!==0?j=I/2:c==="center"?j=U.highest.height/2-K*I:j=U.highest.height-z*I,f&&(j*=-1),b!==0&&!B.showLabelBackdrop&&(E+=I/2*Math.sin(b))):(O=M,j=(1-z)*I/2);let V;if(B.showLabelBackdrop){const X=Yn(B.backdropPadding),N=U.heights[w],se=U.widths[w];let ae=j-X.top,ue=0-X.left;switch(Q){case"middle":ae-=N/2;break;case"bottom":ae-=N;break}switch(k){case"center":ue-=se/2;break;case"right":ue-=se;break;case"inner":w===_-1?ue-=se:w>0&&(ue-=se/2);break}V={left:ue,top:ae,width:se+X.width,height:N+X.height,color:B.backdropColor}}x.push({label:R,font:D,textOffset:j,options:{rotation:b,color:H,strokeColor:q,strokeWidth:Z,textAlign:T,textBaseline:Q,translation:[E,O],backdrop:V}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-ko(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,f,p;this.isHorizontal()?(c=ca(t,this.left,s)-s/2,u=ca(t,this.right,a)+a/2,f=p=l):(f=ca(t,this.top,s)-s/2,p=ca(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&Fg(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;Wa(r,c,0,u,l,a)}o&&zg(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=En(r.font),s=Yn(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||St(n)?(l+=s.bottom,sn(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:f,rotation:p}=YW(this,l,n,a);Wa(t,r.text,0,0,i,{color:r.color,maxWidth:f,rotation:p,textAlign:GW(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=at(t.grid&&t.grid.z,-1),o=at(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Za.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 En(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Oh{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;QW(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,KW(t,s,r),this.override&&gn.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 gn[o]&&(delete gn[o][r],this.override&&delete Ha[r])}}function KW(e,t,n){const r=oi(Object.create(null),[n?gn.get(n):{},gn.get(t),e.defaults]);gn.set(t,r),e.defaultRoutes&&XW(t,e.defaultRoutes),e.descriptors&&gn.describe(t,e.descriptors)}function XW(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(".");gn.route(i,o,l,a)})}function QW(e){return"id"in e&&"defaults"in e}class JW{constructor(){this.controllers=new Oh(Mo,"datasets",!0),this.elements=new Oh(Ui,"elements"),this.plugins=new Oh(Object,"plugins"),this.scales=new Oh(Za,"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):jt(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=Jx(t);Ht(r["before"+o],[],r),n[t](r),Ht(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 Uo=new JW;class ZW{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(Ht(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){xt(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=at(r.options&&r.options.plugins,{}),i=eU(r);return o===!1&&!n?[]:nU(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 eU(e){const t={},n=[],r=Object.keys(Uo.plugins.items);for(let i=0;i<r.length;i++)n.push(Uo.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 tU(e,t){return!t&&e===!1?null:e===!0?{}:e}function nU(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,c=tU(r[l],o);c!==null&&i.push({plugin:a,options:rU(e.config,{plugin:a,local:n[l]},c,s)})}return i}function rU(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 ry(e,t){const n=gn.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function oU(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function iU(e,t){return e===t?"_index_":"_value_"}function oR(e){if(e==="x"||e==="y"||e==="r")return e}function sU(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function oy(e,...t){if(oR(e))return e;for(const n of t){const r=n.axis||sU(n.position)||e.length>1&&oR(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function iR(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function aU(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 iR(e,"x",n[0])||iR(e,"y",n[0])}return{}}function lU(e,t){const n=Ha[e.type]||{scales:{}},r=t.scales||{},o=ry(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!St(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=oy(s,a,aU(s,e),gn.scales[a.type]),c=iU(l,o),u=n.scales||{};i[s]=Au(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||ry(a,t),u=(Ha[a]||{}).scales||{};Object.keys(u).forEach(f=>{const p=oU(f,l),g=s[p+"AxisID"]||p;i[g]=i[g]||Object.create(null),Au(i[g],[{axis:p},r[g],u[f]])})}),Object.keys(i).forEach(s=>{const a=i[s];Au(a,[gn.scales[a.type],gn.scale])}),i}function RD(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=lU(e,t)}function PD(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function cU(e){return e=e||{},e.data=PD(e.data),RD(e),e}const sR=new Map,OD=new Set;function $h(e,t){let n=sR.get(e);return n||(n=t(),sR.set(e,n),OD.add(n)),n}const gu=(e,t,n)=>{const r=Ms(t,n);r!==void 0&&e.add(r)};class uU{constructor(t){this._config=cU(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=PD(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(),RD(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return $h(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return $h(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return $h(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return $h(`${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(f=>gu(l,t,f))),u.forEach(f=>gu(l,o,f)),u.forEach(f=>gu(l,Ha[i]||{},f)),u.forEach(f=>gu(l,gn,f)),u.forEach(f=>gu(l,ey,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),OD.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ha[n]||{},gn.datasets[n]||{},{type:n},gn,ey]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=aR(this._resolverCache,t,o);let l=s;if(fU(s,n)){i.$shared=!1,r=As(r)?r():r;const c=this.createResolver(t,r,a);l=vc(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=aR(this._resolverCache,t,r);return St(n)?vc(i,n,void 0,o):i}}function aR(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:ow(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const dU=e=>St(e)&&Object.getOwnPropertyNames(e).some(t=>As(e[t]));function fU(e,t){const{isScriptable:n,isIndexable:r}=aD(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(As(a)||dU(a))||s&&sn(a))return!0}return!1}var hU="4.4.1";const pU=["top","bottom","left","right","chartArea"];function lR(e,t){return e==="top"||e==="bottom"||pU.indexOf(e)===-1&&t==="x"}function cR(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function uR(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ht(n&&n.onComplete,[e],t)}function gU(e){const t=e.chart,n=t.options.animation;Ht(n&&n.onProgress,[e],t)}function $D(e){return aw()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const xp={},dR=e=>{const t=$D(e);return Object.values(xp).filter(n=>n.canvas===t).pop()};function mU(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 vU(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Dh(e,t,n){return e.options.clip?e[n]:t[n]}function bU(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Dh(n,t,"left"),right:Dh(n,t,"right"),top:Dh(r,t,"top"),bottom:Dh(r,t,"bottom")}:t}class yo{static register(...t){Uo.add(...t),fR()}static unregister(...t){Uo.remove(...t),fR()}constructor(t,n){const r=this.config=new uU(n),o=$D(t),i=dR(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||IW(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=xV(),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 ZW,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=NV(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],xp[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Pi.listen(this,"complete",uR),Pi.listen(this,"progress",gU),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return xt(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 Uo}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ME(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return DE(this.canvas,this.ctx),this}stop(){return Pi.stop(this),this}resize(t,n){Pi.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,ME(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Ht(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};jt(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=oy(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),jt(i,s=>{const a=s.options,l=a.id,c=oy(l,a),u=at(a.type,s.dtype);(a.position===void 0||lR(a.position,c)!==lR(s.dposition))&&(a.position=s.dposition),o[l]=!0;let f=null;if(l in r&&r[l].type===u)f=r[l];else{const p=Uo.getScale(u);f=new p({id:l,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),jt(o,(s,a)=>{s||delete r[a]}),jt(r,s=>{er.configure(this,s,s.options),er.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(cR("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||ry(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=Uo.getController(a),{datasetElementType:c,dataElementType:u}=gn.datasets[a];Object.assign(l,{dataElementType:Uo.getElement(u),datasetElementType:c&&Uo.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){jt(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:f}=this.getDatasetMeta(c),p=!o&&i.indexOf(f)===-1;f.buildOrUpdateElements(p),s=Math.max(+f.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||jt(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(cR("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){jt(this.scales,t=>{er.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!wE(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;mU(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(!wE(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;er.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],jt(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,As(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),o={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(r.controller._update(n),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Pi.has(this)?this.attached&&!Pi.running(this)&&Pi.start(this):(this.draw(),uR({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:o}=this._resizeBeforeDraw;this._resize(r,o),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let o,i;for(o=0,i=n.length;o<i;++o){const s=n[o];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,o=!r.disabled,i=bU(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&Fg(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&&zg(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Ni(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=pW.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=Bs(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);nd(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(),Pi.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(),DE(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete xp[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)};jt(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(){jt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},jt(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}});!Fp(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(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),s=i(n,t),a=r?t:i(t,n);s.length&&this.updateHoverStyle(s,o.mode,!1),a.length&&o.mode&&this.updateHoverStyle(a,o.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},o=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;const i=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(i||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:o=[],options:i}=this,s=n,a=this._getActiveElements(t,o,r,s),l=RV(t),c=vU(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ht(i.onHover,[t,a,this],this),l&&Ht(i.onClick,[t,a,this],this));const u=!Fp(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)}}De(yo,"defaults",gn),De(yo,"instances",xp),De(yo,"overrides",Ha),De(yo,"registry",Uo),De(yo,"version",hU),De(yo,"getChart",dR);function fR(){return jt(yo.instances,e=>e._plugins.invalidate())}function yU(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+_n,r-_n),e.closePath(),e.clip()}function xU(e){return rw(e,["outerStart","outerEnd","innerStart","innerEnd"])}function wU(e,t,n,r){const o=xU(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 jn(l,0,Math.min(i,c))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:jn(o.innerStart,0,s),innerEnd:jn(o.innerEnd,0,s)}}function Pl(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Wp(e,t,n,r,o,i){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,f=Math.max(t.outerRadius+r+n-c,0),p=u>0?u+r+n+c:0;let g=0;const v=o-l;if(r){const B=u>0?u-r:0,K=f>0?f-r:0,H=(B+K)/2,q=H!==0?v*H/(H+r):v;g=(v-q)/2}const b=Math.max(.001,v*f-n/ln)/f,x=(v-b)/2,w=l+x+g,_=o-x-g,{outerStart:S,outerEnd:R,innerStart:E,innerEnd:O}=wU(t,p,f,_-w),k=f-S,M=f-R,D=w+S/k,I=_-R/M,z=p+E,j=p+O,Q=w+E/z,U=_-O/j;if(e.beginPath(),i){const B=(D+I)/2;if(e.arc(s,a,f,D,B),e.arc(s,a,f,B,I),R>0){const Z=Pl(M,I,s,a);e.arc(Z.x,Z.y,R,I,_+_n)}const K=Pl(j,_,s,a);if(e.lineTo(K.x,K.y),O>0){const Z=Pl(j,U,s,a);e.arc(Z.x,Z.y,O,_+_n,U+Math.PI)}const H=(_-O/p+(w+E/p))/2;if(e.arc(s,a,p,_-O/p,H,!0),e.arc(s,a,p,H,w+E/p,!0),E>0){const Z=Pl(z,Q,s,a);e.arc(Z.x,Z.y,E,Q+Math.PI,w-_n)}const q=Pl(k,w,s,a);if(e.lineTo(q.x,q.y),S>0){const Z=Pl(k,D,s,a);e.arc(Z.x,Z.y,S,w-_n,D)}}else{e.moveTo(s,a);const B=Math.cos(D)*f+s,K=Math.sin(D)*f+a;e.lineTo(B,K);const H=Math.cos(I)*f+s,q=Math.sin(I)*f+a;e.lineTo(H,q)}e.closePath()}function _U(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){Wp(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=s+(a%an||an))}return Wp(e,t,n,r,l,o),e.fill(),l}function SU(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:p}=l,g=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=p,g?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let v=t.endAngle;if(i){Wp(e,t,n,r,v,o);for(let b=0;b<i;++b)e.stroke();isNaN(a)||(v=s+(a%an||an))}g&&yU(e,t,v),i||(Wp(e,t,n,r,v,o),e.stroke())}class Bl extends Ui{constructor(n){super();De(this,"circumference");De(this,"endAngle");De(this,"fullCircles");De(this,"innerRadius");De(this,"outerRadius");De(this,"pixelMargin");De(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}=Q$(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:f,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),g=(this.options.spacing+this.options.borderWidth)/2,b=at(p,c-l)>=an||rd(s,l,c),x=Ai(a,u+g,f+g);return b&&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,f=(i+s)/2,p=(a+l+u+c)/2;return{x:r+Math.cos(f)*p,y:o+Math.sin(f)*p}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:o}=this,i=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=o>an?Math.floor(o/an):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(ln,o||0)),u=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,_U(n,this,u,s,a),SU(n,this,u,s,a),n.restore()}}De(Bl,"id","arc"),De(Bl,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),De(Bl,"defaultRoutes",{backgroundColor:"backgroundColor"}),De(Bl,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function DD(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function CU(e,t,n){e.lineTo(n.x,n.y)}function EU(e){return e.stepped?YV:e.tension||e.cubicInterpolationMode==="monotone"?KV:CU}function TD(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 RU(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:c}=TD(o,n,r),u=EU(i);let{move:f=!0,reverse:p}=r||{},g,v,b;for(g=0;g<=c;++g)v=o[(a+(p?c-g:g))%s],!v.skip&&(f?(e.moveTo(v.x,v.y),f=!1):u(e,b,v,p,i.stepped),b=v);return l&&(v=o[(a+(p?c:0))%s],u(e,b,v,p,i.stepped)),!!l}function PU(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=TD(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,f=0,p,g,v,b,x,w;const _=R=>(s+(c?a-R:R))%i,S=()=>{b!==x&&(e.lineTo(u,x),e.lineTo(u,b),e.lineTo(u,w))};for(l&&(g=o[_(0)],e.moveTo(g.x,g.y)),p=0;p<=a;++p){if(g=o[_(p)],g.skip)continue;const R=g.x,E=g.y,O=R|0;O===v?(E<b?b=E:E>x&&(x=E),u=(f*u+R)/++f):(S(),e.lineTo(R,E),v=O,f=0,b=x=E),w=E}S()}function iy(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?PU:RU}function OU(e){return e.stepped?PH:e.tension||e.cubicInterpolationMode==="monotone"?OH:ma}function $U(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),DD(e,t.options),e.stroke(o)}function DU(e,t,n,r){const{segments:o,options:i}=t,s=iy(t);for(const a of o)DD(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const TU=typeof Path2D=="function";function kU(e,t,n,r){TU&&!t.options.segment?$U(e,t,n,r):DU(e,t,n,r)}class Rs extends Ui{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;yH(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=AH(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=vD(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=OU(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:f,end:p}=s[c],g=i[f],v=i[p];if(g===v){a.push(g);continue}const b=Math.abs((o-g[n])/(v[n]-g[n])),x=l(g,v,b,r.stepped);x[n]=t[n],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,n,r){return iy(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=iy(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(),kU(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}De(Rs,"id","line"),De(Rs,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),De(Rs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),De(Rs,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function hR(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class zu extends Ui{constructor(n){super();De(this,"parsed");De(this,"skip");De(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 hR(this,n,"x",r)}inYRange(n,r){return hR(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||!Ni(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,ty(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}De(zu,"id","point"),De(zu,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),De(zu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function kD(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,f;return e.horizontal?(f=s/2,a=Math.min(n,o),l=Math.max(n,o),c=r-f,u=r+f):(f=i/2,a=n-f,l=n+f,c=Math.min(r,o),u=Math.max(r,o)),{left:a,top:c,right:l,bottom:u}}function Ps(e,t,n,r){return e?0:jn(t,n,r)}function MU(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=sD(r);return{t:Ps(o.top,i.top,0,n),r:Ps(o.right,i.right,0,t),b:Ps(o.bottom,i.bottom,0,n),l:Ps(o.left,i.left,0,t)}}function AU(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=Ia(o),s=Math.min(t,n),a=e.borderSkipped,l=r||St(o);return{topLeft:Ps(!l||a.top||a.left,i.topLeft,0,s),topRight:Ps(!l||a.top||a.right,i.topRight,0,s),bottomLeft:Ps(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:Ps(!l||a.bottom||a.right,i.bottomRight,0,s)}}function IU(e){const t=kD(e),n=t.right-t.left,r=t.bottom-t.top,o=MU(e,n/2,r/2),i=AU(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 pb(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&kD(e,r);return a&&(o||Ai(t,a.left,a.right))&&(i||Ai(n,a.top,a.bottom))}function NU(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function LU(e,t){e.rect(t.x,t.y,t.w,t.h)}function gb(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 ju extends Ui{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}=IU(this),a=NU(s.radius)?od:LU;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,gb(s,n,i)),t.clip(),a(t,gb(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,gb(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return pb(this,t,n,r)}inXRange(t,n){return pb(this,t,null,n)}inYRange(t,n){return pb(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}}De(ju,"id","bar"),De(ju,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),De(ju,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var FU=Object.freeze({__proto__:null,ArcElement:Bl,BarElement:ju,LineElement:Rs,PointElement:zu});const sy=["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)"],pR=sy.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function MD(e){return sy[e%sy.length]}function AD(e){return pR[e%pR.length]}function zU(e,t){return e.borderColor=MD(t),e.backgroundColor=AD(t),++t}function jU(e,t){return e.backgroundColor=e.data.map(()=>MD(t++)),t}function BU(e,t){return e.backgroundColor=e.data.map(()=>AD(t++)),t}function VU(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof Ca?t=jU(n,t):o instanceof Fu?t=BU(n,t):o&&(t=zU(n,t))}}function gR(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function HU(e){return e&&(e.borderColor||e.backgroundColor)}var WU={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=e.config,{elements:i}=o;if(!n.forceOverride&&(gR(r)||HU(o)||i&&gR(i)))return;const s=VU(e);r.forEach(s)}};function UU(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,f,p,g,v,b;for(s[l++]=e[u],f=0;f<i-2;f++){let x=0,w=0,_;const S=Math.floor((f+1)*a)+1+t,R=Math.min(Math.floor((f+2)*a)+1,n)+t,E=R-S;for(_=S;_<R;_++)x+=e[_].x,w+=e[_].y;x/=E,w/=E;const O=Math.floor(f*a)+1+t,k=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:M,y:D}=e[u];for(g=v=-1,_=O;_<k;_++)v=.5*Math.abs((M-x)*(e[_].y-D)-(M-e[_].x)*(w-D)),v>g&&(g=v,p=e[_],b=_);s[l++]=p,u=b}return s[l++]=e[c],s}function qU(e,t,n,r){let o=0,i=0,s,a,l,c,u,f,p,g,v,b;const x=[],w=t+n-1,_=e[t].x,R=e[w].x-_;for(s=t;s<t+n;++s){a=e[s],l=(a.x-_)/R*r,c=a.y;const E=l|0;if(E===u)c<v?(v=c,f=s):c>b&&(b=c,p=s),o=(i*o+a.x)/++i;else{const O=s-1;if(!xt(f)&&!xt(p)){const k=Math.min(f,p),M=Math.max(f,p);k!==g&&k!==O&&x.push({...e[k],x:o}),M!==g&&M!==O&&x.push({...e[M],x:o})}s>0&&O!==g&&x.push(e[O]),x.push(a),u=E,i=0,v=b=c,f=p=g=s}}return x}function ID(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 mR(e){e.data.datasets.forEach(t=>{ID(t)})}function GU(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=jn(Ii(t,i.axis,s).lo,0,n-1)),c?o=jn(Ii(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var YU={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){mR(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(on([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:f,count:p}=GU(l,c);const g=n.threshold||4*r;if(p<=g){ID(o);return}xt(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 v;switch(n.algorithm){case"lttb":v=UU(c,f,p,r,n);break;case"min-max":v=qU(c,f,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=v})},destroy(e){mR(e)}};function KU(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=uw(l,c,o);const u=ay(n,o[l],o[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:o[l],end:o[c]});continue}const f=vD(t,u);for(const p of f){const g=ay(n,i[p.start],i[p.end],p.loop),v=mD(a,o,g);for(const b of v)s.push({source:b,target:p,start:{[n]:vR(u,g,"start",Math.max)},end:{[n]:vR(u,g,"end",Math.min)}})}}return s}function ay(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=qr(o),i=qr(i)),{property:e,start:o,end:i}}function XU(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=uw(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 uw(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function vR(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function ND(e,t){let n=[],r=!1;return sn(e)?(r=!0,n=e):n=XU(e,t),n.length?new Rs({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function bR(e){return e&&e.fill!==!1}function QU(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(!vn(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function JU(e,t,n){const r=nq(e);if(St(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return vn(o)&&Math.floor(o)===o?ZU(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function ZU(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function eq(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:St(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function tq(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:St(e)?r=e.value:r=t.getBaseValue(),r}function nq(e){const t=e.options,n=t.fill;let r=at(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function rq(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=oq(t,n);a.push(ND({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++)iq(o,s[u],a)}return new Rs({points:o,options:{}})}function oq(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 iq(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=sq(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function sq(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],f=s[u.start][n],p=s[u.end][n];if(Ai(o,f,p)){a=o===f,l=o===p;break}}return{first:a,last:l,point:r}}class LD{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:an},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 aq(e){const{chart:t,fill:n,line:r}=e;if(vn(n))return lq(t,n);if(n==="stack")return rq(e);if(n==="shape")return!0;const o=cq(e);return o instanceof LD?o:ND(o,r)}function lq(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function cq(e){return(e.scale||{}).getPointPositionForValue?dq(e):uq(e)}function uq(e){const{scale:t={},fill:n}=e,r=eq(n,t);if(vn(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function dq(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=tq(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new LD({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 mb(e,t,n){const r=aq(t),{line:o,scale:i,axis:s}=t,a=o.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:f=c}=l||{};r&&o.points.length&&(Fg(e,n),fq(e,{line:o,target:r,above:u,below:f,area:n,scale:i,axis:s}),zg(e))}function fq(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&&(yR(e,r,s.top),xR(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),yR(e,r,s.bottom)),xR(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function yR(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],f=o[uw(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(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function xR(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=KU(n,r,o);for(const{source:l,target:c,start:u,end:f}of a){const{style:{backgroundColor:p=i}={}}=l,g=r!==!0;e.save(),e.fillStyle=p,hq(e,s,g&&ay(o,u,f)),e.beginPath();const v=!!n.pathSegment(e,l);let b;if(g){v?e.closePath():wR(e,r,f,o);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});b=v&&x,b||wR(e,r,u,o)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function hq(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 wR(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var pq={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 Rs&&(l={visible:e.isDatasetVisible(s),index:s,fill:JU(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=QU(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&&mb(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;bR(i)&&mb(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!bR(r)||n.drawTime!=="beforeDatasetDraw"||mb(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const _R=(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)}},gq=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class SR extends Ui{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=Ht(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=En(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=_R(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 f=t;i.textAlign="left",i.textBaseline="middle";let p=-1,g=-u;return this.legendItems.forEach((v,b)=>{const x=r+n/2+i.measureText(v.text).width;(b===0||c[c.length-1]+x+2*a>s)&&(f+=u,c[c.length-(b>0?0:1)]=0,g+=u,p++),l[b]={left:0,top:g,row:p,width:x,height:o},c[c.length-1]+=x+a}),f}_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 f=a,p=0,g=0,v=0,b=0;return this.legendItems.forEach((x,w)=>{const{itemWidth:_,itemHeight:S}=mq(r,n,i,x,o);w>0&&g+S+2*a>u&&(f+=p+a,c.push({width:p,height:g}),v+=p+a,b++,p=g=0),l[w]={left:v,top:g,col:b,width:_,height:S},p=Math.max(p,_),g+=S+a}),f+=p,c.push({width:p,height:g}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=Ul(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=Zn(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Zn(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=Zn(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Zn(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;Fg(t,this),this._draw(),zg(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=gn.color,l=Ul(t.rtl,this.left,this.width),c=En(s.font),{padding:u}=s,f=c.size,p=f/2;let g;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:v,boxHeight:b,itemHeight:x}=_R(s,f),w=function(O,k,M){if(isNaN(v)||v<=0||isNaN(b)||b<0)return;o.save();const D=at(M.lineWidth,1);if(o.fillStyle=at(M.fillStyle,a),o.lineCap=at(M.lineCap,"butt"),o.lineDashOffset=at(M.lineDashOffset,0),o.lineJoin=at(M.lineJoin,"miter"),o.lineWidth=D,o.strokeStyle=at(M.strokeStyle,a),o.setLineDash(at(M.lineDash,[])),s.usePointStyle){const I={radius:b*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:D},z=l.xPlus(O,v/2),j=k+p;iD(o,I,z,j,s.pointStyleWidth&&v)}else{const I=k+Math.max((f-b)/2,0),z=l.leftForLtr(O,v),j=Ia(M.borderRadius);o.beginPath(),Object.values(j).some(Q=>Q!==0)?od(o,{x:z,y:I,w:v,h:b,radius:j}):o.rect(z,I,v,b),o.fill(),D!==0&&o.stroke()}o.restore()},_=function(O,k,M){Wa(o,M.text,O,k+x/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},S=this.isHorizontal(),R=this._computeTitleHeight();S?g={x:Zn(i,this.left+u,this.right-r[0]),y:this.top+u+R,line:0}:g={x:this.left+u,y:Zn(i,this.top+R+u,this.bottom-n[0].height),line:0},hD(this.ctx,t.textDirection);const E=x+u;this.legendItems.forEach((O,k)=>{o.strokeStyle=O.fontColor,o.fillStyle=O.fontColor;const M=o.measureText(O.text).width,D=l.textAlign(O.textAlign||(O.textAlign=s.textAlign)),I=v+p+M;let z=g.x,j=g.y;l.setWidth(this.width),S?k>0&&z+I+u>this.right&&(j=g.y+=E,g.line++,z=g.x=Zn(i,this.left+u,this.right-r[g.line])):k>0&&j+E>this.bottom&&(z=g.x=z+n[g.line].width+u,g.line++,j=g.y=Zn(i,this.top+R+u,this.bottom-n[g.line].height));const Q=l.x(z);if(w(Q,j,O),z=LV(D,z+v+p,S?z+I:this.right,t.rtl),_(l.x(z),j,O),S)g.x+=I+u;else if(typeof O.text!="string"){const U=c.lineHeight;g.y+=FD(O,U)+u}else g.y+=E}),pD(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=En(n.font),o=Yn(n.padding);if(!n.display)return;const i=Ul(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=o.top+l;let u,f=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+c,f=Zn(t.align,f,this.right-p);else{const v=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);u=c+Zn(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const g=Zn(a,f,f+p);s.textAlign=i.textAlign(tw(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Wa(s,n.text,g,u,r)}_computeTitleHeight(){const t=this.options.title,n=En(t.font),r=Yn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(Ai(t,this.left,this.right)&&Ai(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Ai(t,o.left,o.left+o.width)&&Ai(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!yq(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=gq(o,r);o&&!i&&Ht(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&Ht(n.onHover,[t,r,this],this)}else r&&Ht(n.onClick,[t,r,this],this)}}function mq(e,t,n,r,o){const i=vq(r,e,t,n),s=bq(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function vq(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 bq(e,t,n){let r=e;return typeof t.text!="string"&&(r=FD(t,n)),r}function FD(e,t){const n=e.text?e.text.length:0;return t*n}function yq(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var xq={id:"legend",_element:SR,start(e,t,n){const r=e.legend=new SR({ctx:e.ctx,options:n,chart:e});er.configure(e,r,n),er.addBox(e,r)},stop(e){er.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;er.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=Yn(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)}}};class dw extends Ui{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=Yn(r.padding);const i=o*En(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,f;return this.isHorizontal()?(u=Zn(a,r,i),f=n+t,c=i-r):(s.position==="left"?(u=r+t,f=Zn(a,o,n),l=ln*-.5):(u=i-t,f=Zn(a,n,o),l=ln*.5),c=o-n),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=En(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);Wa(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:tw(n.align),textBaseline:"middle",translation:[s,a]})}}function wq(e,t){const n=new dw({ctx:e.ctx,options:t,chart:e});er.configure(e,n,t),er.addBox(e,n),e.titleBlock=n}var _q={id:"title",_element:dw,start(e,t,n){wq(e,n)},stop(e){const t=e.titleBlock;er.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;er.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 Th=new WeakMap;var Sq={id:"subtitle",start(e,t,n){const r=new dw({ctx:e.ctx,options:n,chart:e});er.configure(e,r,n),er.addBox(e,r),Th.set(e,r)},stop(e){er.removeBox(e,Th.get(e)),Th.delete(e)},beforeUpdate(e,t,n){const r=Th.get(e);er.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 $u={average(e){if(!e.length)return!1;let t,n,r=0,o=0,i=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const a=s.tooltipPosition();r+=a.x,o+=a.y,++i}}return{x:r/i,y:o/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,o=Number.POSITIVE_INFINITY,i,s,a;for(i=0,s=e.length;i<s;++i){const l=e[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Z0(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 Ho(e,t){return t&&(sn(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Oi(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
125
|
+
`)>-1?e.split(`
|
|
126
|
+
`):e}function Cq(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 CR(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=En(t.bodyFont),c=En(t.titleFont),u=En(t.footerFont),f=i.length,p=o.length,g=r.length,v=Yn(t.padding);let b=v.height,x=0,w=r.reduce((R,E)=>R+E.before.length+E.lines.length+E.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,f&&(b+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),w){const R=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=g*R+(w-g)*l.lineHeight+(w-1)*t.bodySpacing}p&&(b+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let _=0;const S=function(R){x=Math.max(x,n.measureText(R).width+_)};return n.save(),n.font=c.string,jt(e.title,S),n.font=l.string,jt(e.beforeBody.concat(e.afterBody),S),_=t.displayColors?s+2+t.boxPadding:0,jt(r,R=>{jt(R.before,S),jt(R.lines,S),jt(R.after,S)}),_=0,n.font=u.string,jt(e.footer,S),n.restore(),x+=v.width,{width:x,height:b}}function Eq(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Rq(e,t,n,r){const{x:o,width:i}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&o+i+s>t.width||e==="right"&&o-i-s<0)return!0}function Pq(e,t,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=o<=(a+l)/2?"left":"right":o<=i/2?c="left":o>=s-i/2&&(c="right"),Rq(c,e,t,n)&&(c="center"),c}function ER(e,t,n){const r=n.yAlign||t.yAlign||Eq(e,n);return{xAlign:n.xAlign||t.xAlign||Pq(e,t,n,r),yAlign:r}}function Oq(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function $q(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function RR(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=o+i,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:g}=Ia(s);let v=Oq(t,a);const b=$q(t,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(u,p)+o:a==="right"&&(v+=Math.max(f,g)+o),{x:jn(v,0,r.width-t.width),y:jn(b,0,r.height-t.height)}}function kh(e,t,n){const r=Yn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function PR(e){return Ho([],Oi(e))}function Dq(e,t,n){return Bs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function OR(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const zD={beforeTitle:Si,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:Si,beforeBody:Si,beforeLabel:Si,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 xt(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:Si,afterBody:Si,beforeFooter:Si,footer:Si,afterFooter:Si};function yr(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?zD[t].call(n,r):o}var h0;let $R=(h0=class extends Ui{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 bD(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=Dq(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=yr(r,"beforeTitle",this,t),i=yr(r,"title",this,t),s=yr(r,"afterTitle",this,t);let a=[];return a=Ho(a,Oi(o)),a=Ho(a,Oi(i)),a=Ho(a,Oi(s)),a}getBeforeBody(t,n){return PR(yr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return jt(t,i=>{const s={before:[],lines:[],after:[]},a=OR(r,i);Ho(s.before,Oi(yr(a,"beforeLabel",this,i))),Ho(s.lines,yr(a,"label",this,i)),Ho(s.after,Oi(yr(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return PR(yr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=yr(r,"beforeFooter",this,t),i=yr(r,"footer",this,t),s=yr(r,"afterFooter",this,t);let a=[];return a=Ho(a,Oi(o)),a=Ho(a,Oi(i)),a=Ho(a,Oi(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(Cq(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,p)=>t.filter(u,f,p,r))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,r))),jt(a,u=>{const f=OR(t.callbacks,u);o.push(yr(f,"labelColor",this,u)),i.push(yr(f,"labelPointStyle",this,u)),s.push(yr(f,"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=$u[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=CR(this,r),c=Object.assign({},a,l),u=ER(this.chart,r,c),f=RR(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,o){const i=this.getCaretPosition(t,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=Ia(a),{x:p,y:g}=t,{width:v,height:b}=n;let x,w,_,S,R,E;return i==="center"?(R=g+b/2,o==="left"?(x=p,w=x-s,S=R+s,E=R-s):(x=p+v,w=x+s,S=R-s,E=R+s),_=x):(o==="left"?w=p+Math.max(l,u)+s:o==="right"?w=p+v-Math.max(c,f)-s:w=this.caretX,i==="top"?(S=g,R=S-s,x=w-s,_=w+s):(S=g+b,R=S+s,x=w+s,_=w-s),E=S),{x1:x,x2:w,x3:_,y1:S,y2:R,y3:E}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const c=Ul(r.rtl,this.x,this.width);for(t.x=kh(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=En(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=En(i.bodyFont),f=kh(this,"left",i),p=o.x(f),g=l<u.lineHeight?(u.lineHeight-l)/2:0,v=n.y+g;if(i.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=o.leftForLtr(p,c)+c/2,w=v+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,ty(t,b,x,w),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,ty(t,b,x,w)}else{t.lineWidth=St(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),x=o.leftForLtr(o.xPlus(p,1),c-2),w=Ia(s.borderRadius);Object.values(w).some(_=>_!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,od(t,{x:b,y:v,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),od(t,{x,y:v+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(b,v,c,l),t.strokeRect(b,v,c,l),t.fillStyle=s.backgroundColor,t.fillRect(x,v+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,f=En(r.bodyFont);let p=f.lineHeight,g=0;const v=Ul(r.rtl,this.x,this.width),b=function(M){n.fillText(M,v.x(t.x+g),t.y+p/2),t.y+=p+i},x=v.textAlign(s);let w,_,S,R,E,O,k;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=kh(this,x,r),n.fillStyle=r.bodyColor,jt(this.beforeBody,b),g=a&&x!=="right"?s==="center"?c/2+u:c+2+u:0,R=0,O=o.length;R<O;++R){for(w=o[R],_=this.labelTextColors[R],n.fillStyle=_,jt(w.before,b),S=w.lines,a&&S.length&&(this._drawColorBox(n,t,R,v,r),p=Math.max(f.lineHeight,l)),E=0,k=S.length;E<k;++E)b(S[E]),p=f.lineHeight;jt(w.after,b)}g=0,p=f.lineHeight,jt(this.afterBody,b),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=Ul(r.rtl,this.x,this.width);for(t.x=kh(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=En(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:f,topRight:p,bottomLeft:g,bottomRight:v}=Ia(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+f,l),s==="top"&&this.drawCaret(t,n,r,o),n.lineTo(a+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-v),n.quadraticCurveTo(a+c,l+u,a+c-v,l+u),s==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(a+g,l+u),n.quadraticCurveTo(a,l+u,a,l+u-g),s==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const s=$u[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=CR(this,t),l=Object.assign({},s,this._size),c=ER(n,t,l),u=RR(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=Yn(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),hD(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),pD(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=!Fp(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||!Fp(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=$u[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},De(h0,"positioners",$u),h0);var Tq={id:"tooltip",_element:$R,positioners:$u,afterInit(e,t,n){n&&(e.tooltip=new $R({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:zD},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"]},kq=Object.freeze({__proto__:null,Colors:WU,Decimation:YU,Filler:pq,Legend:xq,SubTitle:Sq,Title:_q,Tooltip:Tq});const Mq=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Aq(e,t,n,r){const o=e.indexOf(t);if(o===-1)return Mq(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const Iq=(e,t)=>e===null?null:jn(Math.round(e),0,t);function DR(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class ly extends Za{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(xt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Aq(r,t,at(n,t),this._addedLabels),Iq(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 DR.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}}De(ly,"id","category"),De(ly,"defaults",{ticks:{callback:DR}});function Nq(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:p}=e,g=i||1,v=u-1,{min:b,max:x}=t,w=!xt(s),_=!xt(a),S=!xt(c),R=(x-b)/(f+1);let E=SE((x-b)/v/g)*g,O,k,M,D;if(E<1e-14&&!w&&!_)return[{value:b},{value:x}];D=Math.ceil(x/E)-Math.floor(b/E),D>v&&(E=SE(D*E/v/g)*g),xt(l)||(O=Math.pow(10,l),E=Math.ceil(E*O)/O),o==="ticks"?(k=Math.floor(b/E)*E,M=Math.ceil(x/E)*E):(k=b,M=x),w&&_&&i&&DV((a-s)/i,E/1e3)?(D=Math.round(Math.min((a-s)/E,u)),E=(a-s)/D,k=s,M=a):S?(k=w?s:k,M=_?a:M,D=c-1,E=(M-k)/D):(D=(M-k)/E,Iu(D,Math.round(D),E/1e3)?D=Math.round(D):D=Math.ceil(D));const I=Math.max(CE(E),CE(k));O=Math.pow(10,xt(l)?I:l),k=Math.round(k*O)/O,M=Math.round(M*O)/O;let z=0;for(w&&(p&&k!==s?(n.push({value:s}),k<s&&z++,Iu(Math.round((k+z*E)*O)/O,s,TR(s,R,e))&&z++):k<s&&z++);z<D;++z){const j=Math.round((k+z*E)*O)/O;if(_&&j>a)break;n.push({value:j})}return _&&p&&M!==a?n.length&&Iu(n[n.length-1].value,a,TR(a,R,e))?n[n.length-1].value=a:n.push({value:a}):(!_||M===a)&&n.push({value:M}),n}function TR(e,t,{horizontal:n,minRotation:r}){const o=ko(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class Up extends Za{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 xt(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=ti(o),c=ti(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=Nq(o,i);return t.bounds==="ticks"&&X$(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 of(t,this.chart.options.locale,this.options.ticks.format)}}class cy extends Up{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=vn(t)?t:0,this.max=vn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=ko(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}}De(cy,"id","linear"),De(cy,"defaults",{ticks:{callback:Lg.formatters.numeric}});const sd=e=>Math.floor(Es(e)),da=(e,t)=>Math.pow(10,sd(e)+t);function kR(e){return e/Math.pow(10,sd(e))===1}function MR(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function Lq(e,t){const n=t-e;let r=sd(n);for(;MR(e,t,r)>10;)r++;for(;MR(e,t,r)<10;)r--;return Math.min(r,sd(e))}function Fq(e,{min:t,max:n}){t=Br(e.min,t);const r=[],o=sd(t);let i=Lq(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 f=Math.floor((c-u)/Math.pow(10,i)),p=Br(e.min,Math.round((l+u+f*Math.pow(10,i))*s)/s);for(;p<n;)r.push({value:p,major:kR(p),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(i++,f=2,s=i>=0?1:s),p=Math.round((l+u+f*Math.pow(10,i))*s)/s;const g=Br(e.max,p);return r.push({value:g,major:kR(g),significand:f}),r}class uy extends Za{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Up.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return vn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=vn(t)?Math.max(0,t):null,this.max=vn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!vn(this._userMin)&&(this.min=t===da(this.min,0)?da(this.min,-1):da(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(da(r,-1)),s(da(o,1)))),r<=0&&i(da(o,-1)),o<=0&&s(da(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=Fq(n,this);return t.bounds==="ticks"&&X$(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":of(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Es(t),this._valueRange=Es(this.max)-Es(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Es(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}De(uy,"id","logarithmic"),De(uy,"defaults",{ticks:{callback:Lg.formatters.logarithmic,major:{enabled:!0}}});function dy(e){const t=e.ticks;if(t.display&&e.display){const n=Yn(t.backdropPadding);return at(t.font&&t.font.size,gn.font.size)+n.height}return 0}function zq(e,t,n){return n=sn(n)?n:[n],{w:GV(e,t.string,n),h:n.length*t.lineHeight}}function AR(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 jq(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?ln/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),f=En(c.font),p=zq(e.ctx,f,e._pointLabels[l]);r[l]=p;const g=qr(e.getIndexAngle(l)+a),v=Math.round(Zx(g)),b=AR(v,u.x,p.w,0,180),x=AR(v,u.y,p.h,90,270);Bq(n,t,g,b,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Wq(e,r,o)}function Bq(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 Vq(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(Zx(qr(l.angle+_n))),u=Gq(l.y,a.h,c),f=Uq(c),p=qq(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:p,top:u,right:p+a.w,bottom:u+a.h}}function Hq(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(Ni({x:n,y:r},t)||Ni({x:n,y:i},t)||Ni({x:o,y:r},t)||Ni({x:o,y:i},t))}function Wq(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:dy(i)/2,additionalAngle:s?ln/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const f=Vq(e,u,l);r.push(f),a==="auto"&&(f.visible=Hq(f,c),f.visible&&(c=f))}return r}function Uq(e){return e===0||e===180?"center":e<180?"left":"right"}function qq(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Gq(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Yq(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!xt(a)){const l=Ia(t.borderRadius),c=Yn(t.backdropPadding);e.fillStyle=a;const u=r-c.left,f=o-c.top,p=i-r+c.width,g=s-o+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),od(e,{x:u,y:f,w:p,h:g,radius:l}),e.fill()):e.fillRect(u,f,p,g)}}function Kq(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));Yq(n,s,i);const a=En(s.font),{x:l,y:c,textAlign:u}=i;Wa(n,e._pointLabels[o],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function jD(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,an);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 Xq(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(),jD(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function Qq(e,t,n){return Bs(e,{label:n,index:t,type:"pointLabel"})}class Du extends Up{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=Yn(dy(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=vn(t)&&!isNaN(t)?t:0,this.max=vn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/dy(this.options))}generateTickLabels(t){Up.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=Ht(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?jq(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=an/(this._pointLabels.length||1),r=this.options.startAngle||0;return qr(t*n+ko(r))}getDistanceFromCenterForValue(t){if(xt(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(xt(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 Qq(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-_n+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(),jD(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&&Kq(this,s),o.display&&this.ticks.forEach((u,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(u.value);const p=this.getContext(f),g=o.setContext(p),v=i.setContext(p);Xq(this,g,l,s,v)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:p}=u;!p||!f||(t.lineWidth=p,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const o=this.getIndexAngle(0);let i,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=En(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 f=Yn(c.backdropPadding);t.fillRect(-s/2-f.left,-i-u.size/2-f.top,s+f.width,u.size+f.height)}Wa(t,a.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}De(Du,"id","radialLinear"),De(Du,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Lg.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),De(Du,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),De(Du,"descriptors",{angleLines:{_fallback:"grid"}});const Bg={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}},Rr=Object.keys(Bg);function IR(e,t){return e-t}function NR(e,t){if(xt(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)),vn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(mc(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function LR(e,t,n,r){const o=Rr.length;for(let i=Rr.indexOf(e);i<o-1;++i){const s=Bg[Rr[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return Rr[i]}return Rr[o-1]}function Jq(e,t,n,r,o){for(let i=Rr.length-1;i>=Rr.indexOf(n);i--){const s=Rr[i];if(Bg[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return Rr[n?Rr.indexOf(n):0]}function Zq(e){for(let t=Rr.indexOf(e)+1,n=Rr.length;t<n;++t)if(Bg[Rr[t]].common)return Rr[t]}function FR(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=ew(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function eG(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 zR(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:eG(e,r,o,n)}class ad extends Za{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 cW._date(t.adapters.date);o.init(n),Au(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:NR(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=vn(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=vn(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=AV(o,i,s);return this._unit=n.unit||(r.autoSkip?LR(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):Jq(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Zq(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),zR(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=jn(n,0,s),r=jn(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||LR(i.minUnit,n,r,this._getLabelCapacity(n)),a=at(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=mc(l)||l===!0,u={};let f=n,p,g;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,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 v=o.ticks.source==="data"&&this.getDataTimestamps();for(p=f,g=0;p<r;p=+t.add(p,a,s),g++)FR(u,p,v);return(p===r||o.bounds==="ticks"||g===1)&&FR(u,p,v),Object.keys(u).sort(IR).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 Ht(s,[t,n,r],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],p=r[n],g=c&&f&&p&&p.major;return this._adapter.format(t,o||(g?f: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=ko(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,zR(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(NR(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Z$(t.sort(IR))}}De(ad,"id","time"),De(ad,"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 Mh(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}=Ii(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}=Ii(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 fy extends ad{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=Mh(n,this.min),this._tableRange=Mh(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(Mh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Mh(this._table,r*this._tableRange+this._minPos,!0)}}De(fy,"id","timeseries"),De(fy,"defaults",ad.defaults);var tG=Object.freeze({__proto__:null,CategoryScale:ly,LinearScale:cy,LogarithmicScale:uy,RadialLinearScale:Du,TimeScale:ad,TimeSeriesScale:fy});const nG=[lW,FU,kq,tG];/*!
|
|
127
|
+
* chartjs-plugin-datalabels v2.2.0
|
|
128
|
+
* https://chartjs-plugin-datalabels.netlify.app
|
|
129
|
+
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
130
|
+
* Released under the MIT license
|
|
131
|
+
*/var jR=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}(),Bu={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
|
|
132
|
+
`)):Array.isArray(n)?e.push.apply(e,n):xt(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*jR)/jR}};function vb(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 rG(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 oG=0,BD=1,VD=2,HD=4,WD=8;function Ah(e,t,n){var r=oG;return e<n.left?r|=BD:e>n.right&&(r|=VD),t<n.top?r|=WD:t>n.bottom&&(r|=HD),r}function iG(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=Ah(n,r,t),a=Ah(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&WD?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&HD?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&VD?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&BD&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=Ah(n,r,t)):(o=c,i=u,a=Ah(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function Ih(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=iG(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),rG(o,i,e.vx,e.vy,t.align)}var Nh={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 Ih({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=vb(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return Ih({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=vb(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)),Ih({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=vb(e,t.origin);return Ih({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)}},Li=Bu.rasterize;function sG(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 aG(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 lG(e){return e instanceof Bl?Nh.arc:e instanceof zu?Nh.point:e instanceof ju?Nh.bar:Nh.fallback}function cG(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,f=n+o-a;e.moveTo(t,c),l<u&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,f,a,0,s),e.arc(l,f,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<f?(e.arc(l,c,a,-Math.PI,0),e.arc(l,f,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 uG(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),cG(e,Li(t.x)+i/2,Li(t.y)+i/2,Li(t.w)-i,Li(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 dG(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 fG(e,t,n){var r=e.shadowBlur,o=n.stroked,i=Li(n.x),s=Li(n.y),a=Li(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 hG(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,f=c&&u,p;if(!(!l||!s&&!f))for(n=dG(n,o,a),e.font=a.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=i),f&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),p=0,l=t.length;p<l;++p)fG(e,t[p],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var UD=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};oi(UD.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=En(on([n.font,{}],r,i)),a=on([n.color,gn.color],r,i);return{align:on([n.align,"center"],r,i),anchor:on([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:on([n.backgroundColor,null],r,i),borderColor:on([n.borderColor,null],r,i),borderRadius:on([n.borderRadius,0],r,i),borderWidth:on([n.borderWidth,0],r,i),clamp:on([n.clamp,!1],r,i),clip:on([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:on([n.offset,4],r,i),opacity:on([n.opacity,1],r,i),origin:aG(o._el,r),padding:Yn(on([n.padding,4],r,i)),positioner:lG(o._el),rotation:on([n.rotation,0],r,i)*(Math.PI/180),size:Bu.textSize(o._ctx,t,s),textAlign:on([n.textAlign,"start"],r,i),textShadowBlur:on([n.textShadowBlur,0],r,i),textShadowColor:on([n.textShadowColor,a],r,i),textStrokeColor:on([n.textStrokeColor,a],r,i),textStrokeWidth:on([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=on([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=at(Ht(i.formatter,[s,e]),s),l=xt(a)?[]:Bu.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=sG(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=Bu.bound(0,o.opacity,1),r.translate(Li(t.x),Li(t.y)),r.rotate(o.rotation),uG(r,i.frame,o),hG(r,o.lines,i.text,o),r.restore())}});var pG=Number.MIN_SAFE_INTEGER||-9007199254740991,gG=Number.MAX_SAFE_INTEGER||9007199254740991;function mu(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 BR(e,t){var n=gG,r=pG,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 Lh(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 qD=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};oi(qD.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=mu(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=[Lh(t[0],t[1]),Lh(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(Lh(n[0],n[1]),Lh(n[0],n[3])),o=0;o<r.length;++o)if(i=BR(t,r[o]),s=BR(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[mu({x:t.x,y:t.y},r,n),mu({x:t.x+t.w,y:t.y},r,n),mu({x:t.x+t.w,y:t.y+t.h},r,n),mu({x:t.x,y:t.y+t.h},r,n)]}});function GD(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)),f=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*f,u*=i*f,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function mG(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 vG(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=GD(a,r.model(),i),o._box.update(s,i,r.rotation()));return mG(e,function(l,c){var u=l._hidable,f=c._hidable;u&&f||f?c._visible=!1:u&&(l._visible=!1)})}var Vu={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 qD,_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&&vG(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=GD(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},bG=function(e){if(xt(e))return null;var t=e,n,r,o;if(St(e))if(!xt(e.label))t=e.label;else if(!xt(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},yG={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:bG,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},wr="$datalabels",YD="$default";function xG(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=oi({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(oi({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return jt(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||YD]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function hy(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&Ht(s,[o,r])===!0&&(e[wr]._dirty=!0,n.update(o)))}}function wG(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&hy(e,t.leave,n,o),i&&hy(e,t.enter,r,o))}function _G(e,t){var n=e[wr],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=Vu.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,wG(e,r,o,i,t)}}function SG(e,t){var n=e[wr],r=n._listeners.click,o=r&&Vu.lookup(n._labels,t);o&&hy(e,r,o,t)}var CG={id:"datalabels",defaults:yG,beforeInit:function(e){e[wr]={_actives:[]}},beforeUpdate:function(e){var t=e[wr];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[wr],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=xG(a,n),c=t.meta.data||[],u=e.ctx,f,p,g,v,b,x,w,_;for(u.save(),f=0,g=c.length;f<g;++f)if(w=c[f],w[wr]=[],s&&w&&e.getDataVisibility(f)&&!w.skip)for(p=0,v=l.labels.length;p<v;++p)b=l.labels[p],x=b._key,_=new UD(b,u,w,f),_.$groups={_set:r,_key:x||YD},_.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},_.update(_.$context),w[wr].push(_),i.push(_);u.restore(),oi(o._listeners,l.listeners,{merger:function(S,R,E){R[S]=R[S]||{},R[S][t.index]=E[S],o._listened=!0}})},afterUpdate:function(e){e[wr]._labels=Vu.prepare(e[wr]._datasets)},afterDatasetsDraw:function(e){Vu.draw(e,e[wr]._labels)},beforeEvent:function(e,t){if(e[wr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":_G(e,n);break;case"click":SG(e,n);break}}},afterEvent:function(e){var t=e[wr],n=t._actives,r=t._actives=e.getActiveElements(),o=Bu.arrayDiff(n,r),i,s,a,l,c,u,f;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(f=c[0].element[wr]||[],a=0,l=f.length;a<l;++a)u=f[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(Vu.update(t._labels),e.render()),delete t._dirty}};yo.register(...nG);yo.register(CG);function fw({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,o]=m.useState(),i=Te(l=>l.themeStyle);m.useEffect(()=>{var u,f,p,g;(f=(u=i==null?void 0:i.chart)==null?void 0:u.font)!=null&&f.family&&(yo.defaults.font={...yo.defaults.font,...(p=i==null?void 0:i.chart)==null?void 0:p.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(g=n==null?void 0:n.current)==null?void 0:g.getContext("2d");if(!l)return;let c;try{c=new yo(l,e),o(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=i==null?void 0:i.chart)==null?void 0:a.font]);function s(l){var u,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const p=c[0].datasetIndex,g=c[0].index,v=(f=(u=c[0].element)==null?void 0:u.$context)==null?void 0:f.raw;t==null||t(r,p,g,v)}}return P.jsx("div",{onClick:s,className:"relative h-[99%]",children:P.jsx("canvas",{ref:n})})}function Tr(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 EG=["color"],KD=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,EG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),RG=["color"],PG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,RG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),OG=["color"],$G=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,OG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),DG=["color"],XD=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,DG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"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"}))}),TG=["color"],kG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,TG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),MG=["color"],AG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,MG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"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"}))}),IG=["color"],NG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,IG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),LG=["color"],FG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,LG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),zG=["color"],QD=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,zG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),jG=["color"],BG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,jG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),VG=["color"],HG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,VG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),WG=["color"],UG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,WG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),qG=["color"],hw=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,qG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),GG=["color"],pw=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Tr(e,GG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Fh;const YG=new Uint8Array(16);function KG(){if(!Fh&&(Fh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Fh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Fh(YG)}const Un=[];for(let e=0;e<256;++e)Un.push((e+256).toString(16).slice(1));function XG(e,t=0){return Un[e[t+0]]+Un[e[t+1]]+Un[e[t+2]]+Un[e[t+3]]+"-"+Un[e[t+4]]+Un[e[t+5]]+"-"+Un[e[t+6]]+Un[e[t+7]]+"-"+Un[e[t+8]]+Un[e[t+9]]+"-"+Un[e[t+10]]+Un[e[t+11]]+Un[e[t+12]]+Un[e[t+13]]+Un[e[t+14]]+Un[e[t+15]]}const QG=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),VR={randomUUID:QG};function Ua(e,t,n){if(VR.randomUUID&&!t&&!e)return VR.randomUUID();e=e||{};const r=e.random||(e.rng||KG)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return XG(r)}const Sr=pO()(wO((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:{setNumberFormat:(n,r,o,i)=>{e(s=>{var a,l,c;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{...(c=(l=s.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{r.card.type=n})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),gw=()=>Sr(e=>e.actions);function JG(e,t,n){var l,c,u,f;const r=n==null?void 0:n.datasetOptions,o=Te.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,s=(f=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:f.borderColor;return e.map((p,g)=>{var _;const v=r==null?void 0:r.find(S=>S.idx===g),b=i==null?void 0:i[g%i.length],x=s==null?void 0:s[g%s.length];return{label:p.charAt(0).toUpperCase()+p.slice(1),data:t.map(S=>S[p]),...v,datalabels:{...v==null?void 0:v.datalabels,color:ZG((_=v==null?void 0:v.datalabels)==null?void 0:_.align,b)},backgroundColor:b,borderColor:x}})}function ZG(e,t){return Qu(e==="end"||e==="start"?Xu():t)}function eY(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=Xr(e);let r=[];const o=Te.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 f=e.map(p=>({x:p[t[0]],y:p[t[1]],r:p[t[2]],label:p[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:f}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(p=>p[n==null?void 0:n[1]]))].map((p,g)=>{const v=e.filter(b=>b[n==null?void 0:n[1]]===p);return{label:p,data:v.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[g%i.length],borderColor:s==null?void 0:s[g%s.length]}})),r}function tY(e,t){var s,a,l,c;const n=Te.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(f=>f[u]),backgroundColor:t.map((f,p)=>r==null?void 0:r[p%r.length]),borderColor:t.map((f,p)=>o==null?void 0:o[p%o.length])}))}function nY(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 Xr(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=nY(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,f,p,g;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((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((f=e==null?void 0:e[1])==null?void 0:f[i])=="string"||typeof((p=e==null?void 0:e[2])==null?void 0:p[i])&&typeof((g=e==null?void 0:e[2])==null?void 0:g[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function py(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,s)=>({...i,...n[s],data:i.data,label:i.label})):e}function qp({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const o=e.reduce((i,s)=>{const a=s[t],l=s[n],c=s[r];return i[a]||(i[a]={[t]:a}),i[a][l]=c,i},{});return Object.values(o)}function gy(e,t){var s;const n=Te.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=Fi.cloneDeep(r);return Fi.merge(o,e,t)}function JD(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
|
|
133
|
+
* @license lucide-react v0.379.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const rY=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ZD=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
|
|
138
|
+
* @license lucide-react v0.379.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/var oY={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
143
|
+
* @license lucide-react v0.379.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const iY=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>m.createElement("svg",{ref:l,...oY,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ZD("lucide",o),...a},[...s.map(([c,u])=>m.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
|
|
148
|
+
* @license lucide-react v0.379.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const Sn=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(iY,{ref:i,iconNode:t,className:ZD(`lucide-${rY(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
|
|
153
|
+
* @license lucide-react v0.379.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const my=Sn("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
158
|
+
* @license lucide-react v0.379.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const eT=Sn("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"}]]);/**
|
|
163
|
+
* @license lucide-react v0.379.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const af=Sn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
168
|
+
* @license lucide-react v0.379.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const Vg=Sn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
173
|
+
* @license lucide-react v0.379.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const tT=Sn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
178
|
+
* @license lucide-react v0.379.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const mw=Sn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
183
|
+
* @license lucide-react v0.379.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const sY=Sn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
188
|
+
* @license lucide-react v0.379.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const nT=Sn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
193
|
+
* @license lucide-react v0.379.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const aY=Sn("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"}]]);/**
|
|
198
|
+
* @license lucide-react v0.379.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const lY=Sn("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.379.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const cY=Sn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
208
|
+
* @license lucide-react v0.379.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const vw=Sn("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
213
|
+
* @license lucide-react v0.379.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 uY=Sn("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"}]]);/**
|
|
218
|
+
* @license lucide-react v0.379.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 rT=Sn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
223
|
+
* @license lucide-react v0.379.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 dY=Sn("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
|
|
228
|
+
* @license lucide-react v0.379.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 bw=Sn("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"}]]);/**
|
|
233
|
+
* @license lucide-react v0.379.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 oT=Sn("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
|
|
238
|
+
* @license lucide-react v0.379.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 fY=Sn("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
|
|
243
|
+
* @license lucide-react v0.379.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 hY=Sn("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
248
|
+
* @license lucide-react v0.379.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 yw=Sn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pY=({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(f=>`"${(""+c[f]).replace(/"/g,'""')}"`);r.push(u.join(","))}const i=r.join(`
|
|
253
|
+
`),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 P.jsx(aY,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function gY({frame:e}){var _;const t=Te(S=>S.isDashboardEditing),n=Te(S=>S.filterValues),r=Te(S=>S.isVisualEditing),o=Te(S=>S.selectedSheetId);Te(S=>S.currentBreakpoint);const{removeFrame:i}=Te(S=>S.actions),s=Te(S=>S.actions.setIsVisualEditing),a=Sr(S=>S.actions.setFilterValues),l=Sr(S=>S.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:f}=Sr(S=>S.actions),p=Sr(S=>S.actions.setSelectedConnectionId),g=Sr(S=>S.actions.setSelectedDatabaseName),v=Sr(S=>S.actions.setSelectedSchemaName),b=Sr(S=>S.actions.setSelectedTableName),x=e.cards.find(S=>S.id===e.activeCardId);function w(){s(!r),c(x);const{dimensionKeys:S}=Xr((x==null?void 0:x.data)||[]);f(S),u(e),x!=null&&x.connectionId&&p(x==null?void 0:x.connectionId),x!=null&&x.lastSelectedDatabase&&g(x==null?void 0:x.lastSelectedDatabase),x!=null&&x.lastSelectedSchema&&v(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&b(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return P.jsx("section",{className:"absolute right-2 top-2 z-10",children:P.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?P.jsx(AG,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):P.jsx(NG,{role:"edit-visual",onClick:w,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&P.jsx(XD,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((_=x.preferences)==null?void 0:_.allowDownload)===!0&&P.jsx(pY,{data:(x==null?void 0:x.data)||[],filename:x.title})]})})}function mY(e,t=globalThis==null?void 0:globalThis.document){const n=Mn(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const vy="dismissableLayer.update",vY="dismissableLayer.pointerDownOutside",bY="dismissableLayer.focusOutside";let HR;const yY=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Tc=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=m.useContext(yY),[f,p]=m.useState(null),g=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),b=lt(t,M=>p(M)),x=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=x.indexOf(w),S=f?x.indexOf(f):-1,R=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,O=xY(M=>{const D=M.target,I=[...u.branches].some(z=>z.contains(D));!E||I||(i==null||i(M),a==null||a(M),M.defaultPrevented||l==null||l())},g),k=wY(M=>{const D=M.target;[...u.branches].some(z=>z.contains(D))||(s==null||s(M),a==null||a(M),M.defaultPrevented||l==null||l())},g);return mY(M=>{S===u.layers.size-1&&(o==null||o(M),!M.defaultPrevented&&l&&(M.preventDefault(),l()))},g),m.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(HR=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),WR(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=HR)}},[f,g,r,u]),m.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),WR())},[f,u]),m.useEffect(()=>{const M=()=>v({});return document.addEventListener(vy,M),()=>document.removeEventListener(vy,M)},[]),m.createElement(Ue.div,le({},c,{ref:b,style:{pointerEvents:R?E?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,O.onPointerDownCapture)}))});function xY(e,t=globalThis==null?void 0:globalThis.document){const n=Mn(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){iT(vY,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function wY(e,t=globalThis==null?void 0:globalThis.document){const n=Mn(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&iT(bY,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 WR(){const e=new CustomEvent(vy);document.dispatchEvent(e)}function iT(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?HO(o,i):o.dispatchEvent(i)}const _Y=["top","right","bottom","left"],Is=Math.min,Yr=Math.max,Gp=Math.round,zh=Math.floor,Ns=e=>({x:e,y:e}),SY={left:"right",right:"left",bottom:"top",top:"bottom"},CY={start:"end",end:"start"};function by(e,t,n){return Yr(e,Is(t,n))}function Bi(e,t){return typeof e=="function"?e(t):e}function Vi(e){return e.split("-")[0]}function kc(e){return e.split("-")[1]}function xw(e){return e==="x"?"y":"x"}function ww(e){return e==="y"?"height":"width"}function Mc(e){return["top","bottom"].includes(Vi(e))?"y":"x"}function _w(e){return xw(Mc(e))}function EY(e,t,n){n===void 0&&(n=!1);const r=kc(e),o=_w(e),i=ww(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Yp(s)),[s,Yp(s)]}function RY(e){const t=Yp(e);return[yy(e),t,yy(t)]}function yy(e){return e.replace(/start|end/g,t=>CY[t])}function PY(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 OY(e,t,n,r){const o=kc(e);let i=PY(Vi(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(yy)))),i}function Yp(e){return e.replace(/left|right|bottom|top/g,t=>SY[t])}function $Y(e){return{top:0,right:0,bottom:0,left:0,...e}}function sT(e){return typeof e!="number"?$Y(e):{top:e,right:e,bottom:e,left:e}}function Kp(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function UR(e,t,n){let{reference:r,floating:o}=e;const i=Mc(t),s=_w(t),a=ww(s),l=Vi(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-o.width,y:f};break;default:g={x:r.x,y:r.y}}switch(kc(t)){case"start":g[s]-=p*(n&&c?-1:1);break;case"end":g[s]+=p*(n&&c?-1:1);break}return g}const DY=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:f}=UR(c,r,l),p=r,g={},v=0;for(let b=0;b<a.length;b++){const{name:x,fn:w}=a[b],{x:_,y:S,data:R,reset:E}=await w({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=_??u,f=S??f,g={...g,[x]:{...g[x],...R}},E&&v<=50){v++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:f}=UR(c,p,l)),b=-1;continue}}return{x:u,y:f,placement:p,strategy:o,middlewareData:g}};async function ld(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:f="floating",altBoundary:p=!1,padding:g=0}=Bi(t,e),v=sT(g),x=a[p?f==="floating"?"reference":"floating":f],w=Kp(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=f==="floating"?{...s.floating,x:r,y:o}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),R=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=Kp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(w.top-E.top+v.top)/R.y,bottom:(E.bottom-w.bottom+v.bottom)/R.y,left:(w.left-E.left+v.left)/R.x,right:(E.right-w.right+v.right)/R.x}}const qR=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}=Bi(e,t)||{};if(c==null)return{};const f=sT(u),p={x:n,y:r},g=_w(o),v=ww(g),b=await s.getDimensions(c),x=g==="y",w=x?"top":"left",_=x?"bottom":"right",S=x?"clientHeight":"clientWidth",R=i.reference[v]+i.reference[g]-p[g]-i.floating[v],E=p[g]-i.reference[g],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=O?O[S]:0;(!k||!await(s.isElement==null?void 0:s.isElement(O)))&&(k=a.floating[S]||i.floating[v]);const M=R/2-E/2,D=k/2-b[v]/2-1,I=Is(f[w],D),z=Is(f[_],D),j=I,Q=k-b[v]-z,U=k/2-b[v]/2+M,B=by(j,U,Q),K=!l.arrow&&kc(o)!=null&&U!=B&&i.reference[v]/2-(U<j?I:z)-b[v]/2<0,H=K?U<j?U-j:U-Q:0;return{[g]:p[g]+H,data:{[g]:B,centerOffset:U-B-H,...K&&{alignmentOffset:H}},reset:K}}}),TY=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:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...x}=Bi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Vi(o),_=Vi(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),R=p||(_||!b?[Yp(a)]:RY(a));!p&&v!=="none"&&R.push(...OY(a,b,v,S));const E=[a,...R],O=await ld(t,x),k=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(O[w]),f){const j=EY(o,s,S);k.push(O[j[0]],O[j[1]])}if(M=[...M,{placement:o,overflows:k}],!k.every(j=>j<=0)){var D,I;const j=(((D=i.flip)==null?void 0:D.index)||0)+1,Q=E[j];if(Q)return{data:{index:j,overflows:M},reset:{placement:Q}};let U=(I=M.filter(B=>B.overflows[0]<=0).sort((B,K)=>B.overflows[1]-K.overflows[1])[0])==null?void 0:I.placement;if(!U)switch(g){case"bestFit":{var z;const B=(z=M.map(K=>[K.placement,K.overflows.filter(H=>H>0).reduce((H,q)=>H+q,0)]).sort((K,H)=>K[1]-H[1])[0])==null?void 0:z[0];B&&(U=B);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function GR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function YR(e){return _Y.some(t=>e[t]>=0)}const kY=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Bi(e,t);switch(r){case"referenceHidden":{const i=await ld(t,{...o,elementContext:"reference"}),s=GR(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:YR(s)}}}case"escaped":{const i=await ld(t,{...o,altBoundary:!0}),s=GR(i,n.floating);return{data:{escapedOffsets:s,escaped:YR(s)}}}default:return{}}}}};async function MY(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Vi(n),a=kc(n),l=Mc(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,f=Bi(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*u,y:p*c}:{x:p*c,y:g*u}}const AY=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 MY(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}}}}},IY=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:w,y:_}=x;return{x:w,y:_}}},...l}=Bi(e,t),c={x:n,y:r},u=await ld(t,l),f=Mc(Vi(o)),p=xw(f);let g=c[p],v=c[f];if(i){const x=p==="y"?"top":"left",w=p==="y"?"bottom":"right",_=g+u[x],S=g-u[w];g=by(_,g,S)}if(s){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",_=v+u[x],S=v-u[w];v=by(_,v,S)}const b=a.fn({...t,[p]:g,[f]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},NY=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}=Bi(e,t),u={x:n,y:r},f=Mc(o),p=xw(f);let g=u[p],v=u[f];const b=Bi(a,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const S=p==="y"?"height":"width",R=i.reference[p]-i.floating[S]+x.mainAxis,E=i.reference[p]+i.reference[S]-x.mainAxis;g<R?g=R:g>E&&(g=E)}if(c){var w,_;const S=p==="y"?"width":"height",R=["top","left"].includes(Vi(o)),E=i.reference[f]-i.floating[S]+(R&&((w=s.offset)==null?void 0:w[f])||0)+(R?0:x.crossAxis),O=i.reference[f]+i.reference[S]+(R?0:((_=s.offset)==null?void 0:_[f])||0)-(R?x.crossAxis:0);v<E?v=E:v>O&&(v=O)}return{[p]:g,[f]:v}}}},LY=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=Bi(e,t),l=await ld(t,a),c=Vi(n),u=kc(n),f=Mc(n)==="y",{width:p,height:g}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(b=c,v=u==="end"?"top":"bottom");const x=g-l[v],w=p-l[b],_=!t.middlewareData.shift;let S=x,R=w;if(f){const O=p-l.left-l.right;R=u||_?Is(w,O):O}else{const O=g-l.top-l.bottom;S=u||_?Is(x,O):O}if(_&&!u){const O=Yr(l.left,0),k=Yr(l.right,0),M=Yr(l.top,0),D=Yr(l.bottom,0);f?R=p-2*(O!==0||k!==0?O+k:Yr(l.left,l.right)):S=g-2*(M!==0||D!==0?M+D:Yr(l.top,l.bottom))}await s({...t,availableWidth:R,availableHeight:S});const E=await o.getDimensions(i.floating);return p!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function Ls(e){return aT(e)?(e.nodeName||"").toLowerCase():"#document"}function Zr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qi(e){var t;return(t=(aT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function aT(e){return e instanceof Node||e instanceof Zr(e).Node}function Hi(e){return e instanceof Element||e instanceof Zr(e).Element}function ii(e){return e instanceof HTMLElement||e instanceof Zr(e).HTMLElement}function KR(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zr(e).ShadowRoot}function lf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_o(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function FY(e){return["table","td","th"].includes(Ls(e))}function Sw(e){const t=Cw(),n=_o(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function zY(e){let t=yc(e);for(;ii(t)&&!Hg(t);){if(Sw(t))return t;t=yc(t)}return null}function Cw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Hg(e){return["html","body","#document"].includes(Ls(e))}function _o(e){return Zr(e).getComputedStyle(e)}function Wg(e){return Hi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function yc(e){if(Ls(e)==="html")return e;const t=e.assignedSlot||e.parentNode||KR(e)&&e.host||qi(e);return KR(t)?t.host:t}function lT(e){const t=yc(e);return Hg(t)?e.ownerDocument?e.ownerDocument.body:e.body:ii(t)&&lf(t)?t:lT(t)}function cd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=lT(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Zr(o);return i?t.concat(s,s.visualViewport||[],lf(o)?o:[],s.frameElement&&n?cd(s.frameElement):[]):t.concat(o,cd(o,[],n))}function cT(e){const t=_o(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ii(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Gp(n)!==i||Gp(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ew(e){return Hi(e)?e:e.contextElement}function ql(e){const t=Ew(e);if(!ii(t))return Ns(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=cT(t);let s=(i?Gp(n.width):n.width)/r,a=(i?Gp(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const jY=Ns(0);function uT(e){const t=Zr(e);return!Cw()||!t.visualViewport?jY:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function BY(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zr(e)?!1:t}function qa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ew(e);let s=Ns(1);t&&(r?Hi(r)&&(s=ql(r)):s=ql(e));const a=BY(i,n,r)?uT(i):Ns(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const p=Zr(i),g=r&&Hi(r)?Zr(r):r;let v=p.frameElement;for(;v&&r&&g!==p;){const b=ql(v),x=v.getBoundingClientRect(),w=_o(v),_=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*b.x,S=x.top+(v.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,f*=b.y,l+=_,c+=S,v=Zr(v).frameElement}}return Kp({width:u,height:f,x:l,y:c})}function VY(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=ii(n),i=qi(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=Ns(1);const l=Ns(0);if((o||!o&&r!=="fixed")&&((Ls(n)!=="body"||lf(i))&&(s=Wg(n)),ii(n))){const c=qa(n);a=ql(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function HY(e){return Array.from(e.getClientRects())}function dT(e){return qa(qi(e)).left+Wg(e).scrollLeft}function WY(e){const t=qi(e),n=Wg(e),r=e.ownerDocument.body,o=Yr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Yr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+dT(e);const a=-n.scrollTop;return _o(r).direction==="rtl"&&(s+=Yr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function UY(e,t){const n=Zr(e),r=qi(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=Cw();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function qY(e,t){const n=qa(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ii(e)?ql(e):Ns(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 XR(e,t,n){let r;if(t==="viewport")r=UY(e,n);else if(t==="document")r=WY(qi(e));else if(Hi(t))r=qY(t,n);else{const o=uT(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Kp(r)}function fT(e,t){const n=yc(e);return n===t||!Hi(n)||Hg(n)?!1:_o(n).position==="fixed"||fT(n,t)}function GY(e,t){const n=t.get(e);if(n)return n;let r=cd(e,[],!1).filter(a=>Hi(a)&&Ls(a)!=="body"),o=null;const i=_o(e).position==="fixed";let s=i?yc(e):e;for(;Hi(s)&&!Hg(s);){const a=_o(s),l=Sw(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||lf(s)&&!l&&fT(e,s))?r=r.filter(u=>u!==s):o=a,s=yc(s)}return t.set(e,r),r}function YY(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?GY(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=XR(t,u,o);return c.top=Yr(f.top,c.top),c.right=Is(f.right,c.right),c.bottom=Is(f.bottom,c.bottom),c.left=Yr(f.left,c.left),c},XR(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function KY(e){return cT(e)}function XY(e,t,n){const r=ii(t),o=qi(t),i=n==="fixed",s=qa(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Ns(0);if(r||!r&&!i)if((Ls(t)!=="body"||lf(o))&&(a=Wg(t)),r){const c=qa(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=dT(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function QR(e,t){return!ii(e)||_o(e).position==="fixed"?null:t?t(e):e.offsetParent}function hT(e,t){const n=Zr(e);if(!ii(e))return n;let r=QR(e,t);for(;r&&FY(r)&&_o(r).position==="static";)r=QR(r,t);return r&&(Ls(r)==="html"||Ls(r)==="body"&&_o(r).position==="static"&&!Sw(r))?n:r||zY(e)||n}const QY=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||hT,i=this.getDimensions;return{reference:XY(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function JY(e){return _o(e).direction==="rtl"}const ZY={convertOffsetParentRelativeRectToViewportRelativeRect:VY,getDocumentElement:qi,getClippingRect:YY,getOffsetParent:hT,getElementRects:QY,getClientRects:HY,getDimensions:KY,getScale:ql,isElement:Hi,isRTL:JY};function eK(e,t){let n=null,r;const o=qi(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:f,height:p}=e.getBoundingClientRect();if(a||t(),!f||!p)return;const g=zh(u),v=zh(o.clientWidth-(c+f)),b=zh(o.clientHeight-(u+p)),x=zh(c),_={rootMargin:-g+"px "+-v+"px "+-b+"px "+-x+"px",threshold:Yr(0,Is(1,l))||1};let S=!0;function R(E){const O=E[0].intersectionRatio;if(O!==l){if(!S)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(R,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,_)}n.observe(e)}return s(!0),i}function tK(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=Ew(e),u=o||i?[...c?cd(c):[],...cd(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const f=c&&a?eK(c,n):null;let p=-1,g=null;s&&(g=new ResizeObserver(w=>{let[_]=w;_&&_.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{g&&g.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let v,b=l?qa(e):null;l&&x();function x(){const w=qa(e);b&&(w.x!==b.x||w.y!==b.y||w.width!==b.width||w.height!==b.height)&&n(),b=w,v=requestAnimationFrame(x)}return n(),()=>{u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f&&f(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(v)}}const nK=(e,t,n)=>{const r=new Map,o={platform:ZY,...n},i={...o.platform,_c:r};return DY(e,t,{...o,platform:i})},rK=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?qR({element:r.current,padding:o}).fn(n):{}:r?qR({element:r,padding:o}).fn(n):{}}}};var wp=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Xp(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(!Xp(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)&&!Xp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function pT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function JR(e,t){const n=pT(e);return Math.round(t*n)/n}function ZR(e){const t=pe.useRef(e);return wp(()=>{t.current=e}),t}function oK(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,f]=pe.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=pe.useState(r);Xp(p,r)||g(r);const[v,b]=pe.useState(null),[x,w]=pe.useState(null),_=pe.useCallback(K=>{K!=O.current&&(O.current=K,b(K))},[b]),S=pe.useCallback(K=>{K!==k.current&&(k.current=K,w(K))},[w]),R=i||v,E=s||x,O=pe.useRef(null),k=pe.useRef(null),M=pe.useRef(u),D=ZR(l),I=ZR(o),z=pe.useCallback(()=>{if(!O.current||!k.current)return;const K={placement:t,strategy:n,middleware:p};I.current&&(K.platform=I.current),nK(O.current,k.current,K).then(H=>{const q={...H,isPositioned:!0};j.current&&!Xp(M.current,q)&&(M.current=q,k6.flushSync(()=>{f(q)}))})},[p,t,n,I]);wp(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,f(K=>({...K,isPositioned:!1})))},[c]);const j=pe.useRef(!1);wp(()=>(j.current=!0,()=>{j.current=!1}),[]),wp(()=>{if(R&&(O.current=R),E&&(k.current=E),R&&E){if(D.current)return D.current(R,E,z);z()}},[R,E,z,D]);const Q=pe.useMemo(()=>({reference:O,floating:k,setReference:_,setFloating:S}),[_,S]),U=pe.useMemo(()=>({reference:R,floating:E}),[R,E]),B=pe.useMemo(()=>{const K={position:n,left:0,top:0};if(!U.floating)return K;const H=JR(U.floating,u.x),q=JR(U.floating,u.y);return a?{...K,transform:"translate("+H+"px, "+q+"px)",...pT(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:q}},[n,a,U.floating,u.x,u.y]);return pe.useMemo(()=>({...u,update:z,refs:Q,elements:U,floatingStyles:B}),[u,z,Q,U,B])}function Ug(e){const[t,n]=m.useState(void 0);return tr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const gT="Popper",[mT,di]=Bn(gT),[iK,vT]=mT(gT),sK=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(iK,{scope:t,anchor:r,onAnchorChange:o},n)},aK="PopperAnchor",lK=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=vT(aK,n),s=m.useRef(null),a=lt(t,s);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(Ue.div,le({},o,{ref:a}))}),bT="PopperContent",[cK,Vpe]=mT(bT),uK=m.forwardRef((e,t)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:p=0,align:g="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:x=!0,collisionBoundary:w=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:R=!1,updatePositionStrategy:E="optimized",onPlaced:O,...k}=e,M=vT(bT,u),[D,I]=m.useState(null),z=lt(t,Pe=>I(Pe)),[j,Q]=m.useState(null),U=Ug(j),B=(n=U==null?void 0:U.width)!==null&&n!==void 0?n:0,K=(r=U==null?void 0:U.height)!==null&&r!==void 0?r:0,H=f+(g!=="center"?"-"+g:""),q=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},Z=Array.isArray(w)?w:[w],T=Z.length>0,V={padding:q,boundary:Z.filter(dK),altBoundary:T},{refs:X,floatingStyles:N,placement:se,isPositioned:ae,middlewareData:ue}=oK({strategy:"fixed",placement:H,whileElementsMounted:(...Pe)=>tK(...Pe,{animationFrame:E==="always"}),elements:{reference:M.anchor},middleware:[AY({mainAxis:p+K,alignmentAxis:v}),x&&IY({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?NY():void 0,...V}),x&&TY({...V}),LY({...V,apply:({elements:Pe,rects:$e,availableWidth:Ve,availableHeight:Fe})=>{const{width:ke,height:Ge}=$e.reference,ct=Pe.floating.style;ct.setProperty("--radix-popper-available-width",`${Ve}px`),ct.setProperty("--radix-popper-available-height",`${Fe}px`),ct.setProperty("--radix-popper-anchor-width",`${ke}px`),ct.setProperty("--radix-popper-anchor-height",`${Ge}px`)}}),j&&rK({element:j,padding:b}),fK({arrowWidth:B,arrowHeight:K}),R&&kY({strategy:"referenceHidden",...V})]}),[fe,oe]=yT(se),ee=Mn(O);tr(()=>{ae&&(ee==null||ee())},[ae,ee]);const ie=(o=ue.arrow)===null||o===void 0?void 0:o.x,be=(i=ue.arrow)===null||i===void 0?void 0:i.y,G=((s=ue.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[me,_e]=m.useState();return tr(()=>{D&&_e(window.getComputedStyle(D).zIndex)},[D]),m.createElement("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:ae?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(a=ue.transformOrigin)===null||a===void 0?void 0:a.x,(l=ue.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(cK,{scope:u,placedSide:fe,onArrowChange:Q,arrowX:ie,arrowY:be,shouldHideArrow:G},m.createElement(Ue.div,le({"data-side":fe,"data-align":oe},k,{ref:z,style:{...k.style,animation:ae?void 0:"none",opacity:(c=ue.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function dK(e){return e!==null}const fK=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=f?0:e.arrowWidth,g=f?0:e.arrowHeight,[v,b]=yT(a),x={start:"0%",center:"50%",end:"100%"}[b],w=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+p/2,_=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+g/2;let S="",R="";return v==="bottom"?(S=f?x:`${w}px`,R=`${-g}px`):v==="top"?(S=f?x:`${w}px`,R=`${l.floating.height+g}px`):v==="right"?(S=`${-g}px`,R=f?x:`${_}px`):v==="left"&&(S=`${l.floating.width+g}px`,R=f?x:`${_}px`),{data:{x:S,y:R}}}});function yT(e){const[t,n="center"]=e.split("-");return[t,n]}const cf=sK,uf=lK,df=uK,qg=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?Fo.createPortal(m.createElement(Ue.div,le({},o,{ref:t})),r):null}),xT=m.forwardRef((e,t)=>m.createElement(Ue.span,le({},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}}))),hK=xT,[Gg,Hpe]=Bn("Tooltip",[di]),Rw=di(),pK="TooltipProvider",gK=700,xy="tooltip.open",[mK,Pw]=Gg(pK),vK=e=>{const{__scopeTooltip:t,delayDuration:n=gK,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(mK,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:o},i)},Ow="Tooltip",[bK,Yg]=Gg(Ow),yK=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Pw(Ow,e.__scopeTooltip),c=Rw(t),[u,f]=m.useState(null),p=Or(),g=m.useRef(0),v=s??l.disableHoverableContent,b=a??l.delayDuration,x=m.useRef(!1),[w=!1,_]=nr({prop:r,defaultProp:o,onChange:k=>{k?(l.onOpen(),document.dispatchEvent(new CustomEvent(xy))):l.onClose(),i==null||i(k)}}),S=m.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),R=m.useCallback(()=>{window.clearTimeout(g.current),x.current=!1,_(!0)},[_]),E=m.useCallback(()=>{window.clearTimeout(g.current),_(!1)},[_]),O=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,_(!0)},b)},[b,_]);return m.useEffect(()=>()=>window.clearTimeout(g.current),[]),m.createElement(cf,c,m.createElement(bK,{scope:t,contentId:p,open:w,stateAttribute:S,trigger:u,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?O():R()},[l.isOpenDelayed,O,R]),onTriggerLeave:m.useCallback(()=>{v?E():window.clearTimeout(g.current)},[E,v]),onOpen:R,onClose:E,disableHoverableContent:v},n))},e2="TooltipTrigger",wT=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Yg(e2,n),i=Pw(e2,n),s=Rw(n),a=m.useRef(null),l=lt(t,a,o.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(uf,le({asChild:!0},s),m.createElement(Ue.button,le({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:Re(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Re(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Re(e.onBlur,o.onClose),onClick:Re(e.onClick,o.onClose)})))}),xK="TooltipPortal",[Wpe,wK]=Gg(xK,{forceMount:void 0}),ud="TooltipContent",_K=m.forwardRef((e,t)=>{const n=wK(ud,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Yg(ud,e.__scopeTooltip);return m.createElement(Rn,{present:r||s.open},s.disableHoverableContent?m.createElement(_T,le({side:o},i,{ref:t})):m.createElement(SK,le({side:o},i,{ref:t})))}),SK=m.forwardRef((e,t)=>{const n=Yg(ud,e.__scopeTooltip),r=Pw(ud,e.__scopeTooltip),o=m.useRef(null),i=lt(t,o),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,p=m.useCallback(()=>{a(null),f(!1)},[f]),g=m.useCallback((v,b)=>{const x=v.currentTarget,w={x:v.clientX,y:v.clientY},_=EK(w,x.getBoundingClientRect()),S=RK(w,_),R=PK(b.getBoundingClientRect()),E=$K([...S,...R]);a(E),f(!0)},[f]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(l&&u){const v=x=>g(x,u),b=x=>g(x,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",b)}}},[l,u,g,p]),m.useEffect(()=>{if(s){const v=b=>{const x=b.target,w={x:b.clientX,y:b.clientY},_=(l==null?void 0:l.contains(x))||(u==null?void 0:u.contains(x)),S=!OK(w,s);_?p():S&&(p(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,s,c,p]),m.createElement(_T,le({},e,{ref:i}))}),[CK,Upe]=Gg(Ow,{isInside:!1}),_T=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Yg(ud,n),c=Rw(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(xy,u),()=>document.removeEventListener(xy,u)),[u]),m.useEffect(()=>{if(l.trigger){const f=p=>{const g=p.target;g!=null&&g.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),m.createElement(Tc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u},m.createElement(df,le({"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)"}}),m.createElement(VO,null,r),m.createElement(CK,{scope:n,isInside:!0},m.createElement(hK,{id:l.contentId,role:"tooltip"},o||r))))});function EK(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 RK(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 PK(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 OK(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 $K(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),DK(t)}function DK(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const TK=vK,kK=yK,MK=wT,ST=_K,AK=TK,CT=kK,ET=MK,$w=pe.forwardRef(({className:e,sideOffset:t=4,...n},r)=>P.jsx(ST,{ref:r,sideOffset:t,className:Ee("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}));$w.displayName=ST.displayName;function xc({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,f={maximumFractionDigits:c,minimumFractionDigits:c};if(o){f.style="currency",f.currency=o;try{new Intl.NumberFormat(i,f).format(0)}catch{f.currency="USD"}}try{new Intl.NumberFormat(i,f).format(0)}catch{l="en-US"}let g=new Intl.NumberFormat(l,f).format(u);return n&&(g+=a),g}function RT(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function PT({card:e,isLoading:t}){var w,_,S,R,E,O,k,M,D,I,z,j,Q,U,B,K,H,q,Z,T,V,X,N,se;const n=Te(ae=>ae.actions.setCardTitle),r=Te(ae=>ae.actions.setCardDescription),o=Te(ae=>ae.isVisualEditing),i=Sr(ae=>ae.card),s=Sr(ae=>ae.actions.setCard);Sr(ae=>ae.actions.setNumberFormat);const a=Te(ae=>ae.selectedSheetId),l=e.data,c=(_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.colorRanges,{metricKeys:u}=Xr(l||[]),f=(S=l==null?void 0:l[0])==null?void 0:S[u==null?void 0:u[0]],p=(R=l==null?void 0:l[0])==null?void 0:R[u==null?void 0:u[1]],g=!!e.data&&e.data.length>0;function v(ae){o?s({...i,title:ae}):n(a,e.id,ae)}function b(ae){o?s({...i,description:ae}):r(a,e.id,ae)}const x=p&&p-f!==0?(f-p)/p:null;return P.jsxs("div",{className:"kpi-card flex grow flex-col overflow-scroll",children:[P.jsxs(wg,{className:"grow pb-3",children:[P.jsx(Va,{text:o?i.title:e.title,onSave:v,children:P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(Zd,{className:"text-base font-medium text-muted-foreground",children:e.title}),!e.refreshInterval&&t&&P.jsx(vw,{className:"h-4 w-4 animate-spin text-muted-foreground"})]})}),g&&P.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[P.jsx("p",{style:{color:RT(f,c)},className:"text-3xl font-semibold",children:xc({number:f,decimalPlaces:((O=(E=e.preferences)==null?void 0:E.formatNumber)==null?void 0:O.decimalPlaces)||0,useSuffix:!!((M=(k=e.preferences)==null?void 0:k.formatNumber)!=null&&M.suffix),customSuffix:((I=(D=e.preferences)==null?void 0:D.formatNumber)==null?void 0:I.suffix)||"",locale:((j=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:j.locale)||"",currency:((U=(Q=e.preferences)==null?void 0:Q.formatNumber)==null?void 0:U.currency)||""})}),p&&P.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",xc({number:p,decimalPlaces:((K=(B=e.preferences)==null?void 0:B.formatNumber)==null?void 0:K.decimalPlaces)||0,useSuffix:!!((q=(H=e.preferences)==null?void 0:H.formatNumber)!=null&&q.suffix),customSuffix:((T=(Z=e.preferences)==null?void 0:Z.formatNumber)==null?void 0:T.suffix)||"",locale:((X=(V=e.preferences)==null?void 0:V.formatNumber)==null?void 0:X.locale)||"",currency:((se=(N=e.preferences)==null?void 0:N.formatNumber)==null?void 0:se.currency)||""})]})]})]}),x&&P.jsxs(_g,{className:"grow items-start gap-1 pb-4 text-sm",children:[P.jsx(IK,{children:x}),P.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[x>0?"up ":"down ",P.jsx(Va,{text:e.description||"",onSave:b,children:e.description})]})]})]})}function IK({children:e}){const t=e>0?P.jsx(pw,{className:"h-4 w-4"}):P.jsx(hw,{className:"h-4 w-4"}),n=`${Math.abs(e*100).toFixed(0)}%`;return P.jsxs("div",{className:Ee("flex items-center",{"text-green-600":e>0,"text-destructive":e<0}),children:[t,P.jsx("span",{className:"ml-[1px]",children:n})]})}var wc=1e3,_c=wc*60,Sc=_c*60,Ga=Sc*24,NK=Ga*7,LK=Ga*365.25,FK=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return zK(e);if(n==="number"&&isFinite(e))return t.long?BK(e):jK(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function zK(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*LK;case"weeks":case"week":case"w":return n*NK;case"days":case"day":case"d":return n*Ga;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Sc;case"minutes":case"minute":case"mins":case"min":case"m":return n*_c;case"seconds":case"second":case"secs":case"sec":case"s":return n*wc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function jK(e){var t=Math.abs(e);return t>=Ga?Math.round(e/Ga)+"d":t>=Sc?Math.round(e/Sc)+"h":t>=_c?Math.round(e/_c)+"m":t>=wc?Math.round(e/wc)+"s":e+"ms"}function BK(e){var t=Math.abs(e);return t>=Ga?jh(e,t,Ga,"day"):t>=Sc?jh(e,t,Sc,"hour"):t>=_c?jh(e,t,_c,"minute"):t>=wc?jh(e,t,wc,"second"):e+" ms"}function jh(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const VK=Oc(FK);function OT({children:e}){const{setIsSessionExpired:t}=Wi(),n=new h8({queryCache:new MO({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return P.jsx(v8,{client:n,children:e})}const HK={id:"",authToken:void 0},$T=m.createContext(HK),DT=({children:e,dashboardProps:t})=>P.jsx(OT,{children:P.jsx($T.Provider,{value:t,children:e})});function el(){const e=m.useContext($T);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function WK(e){Te(c=>c.bookmarkKey);const t=Te(c=>c.dashboard.baseQueries),{authToken:n}=el(),r=Te(c=>c.authToken),o=Te(c=>c.filterValues),i=Te(c=>c.isDashboardEditing),s=VK((e==null?void 0:e.refreshInterval)||"0"),a=fO(e.sql,t);return Jd({queryKey:[e.id,a],queryFn:()=>Kd("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:a,python:e.python===EO?"":e.python,active_filters:o}),refetchInterval:s,enabled:!!e.connectionId&&!i})}function fa({data:e,cfg:t,customCfg:n,preferences:r}){var w,_,S,R,E,O,k,M,D,I,z,j;const{dimensionKeys:o,metricKeys:i}=Xr(e),s=JG(i,e,r),a=py(s,n),l=o[0],c=JD(e,l),u=TT(r,t),f=UK(r),p={...t==null?void 0:t.options,scales:{...(w=t==null?void 0:t.options)==null?void 0:w.scales,[u]:{...(S=(_=t==null?void 0:t.options)==null?void 0:_.scales)==null?void 0:S[u],ticks:{...(O=(E=(R=t==null?void 0:t.options)==null?void 0:R.scales)==null?void 0:E[u])==null?void 0:O.ticks,callback:Q=>{var U,B,K,H;return xc({number:Number(Q),decimalPlaces:((U=r==null?void 0:r.numberAxisFormat)==null?void 0:U.decimalPlaces)||0,useSuffix:!!((B=r==null?void 0:r.numberAxisFormat)!=null&&B.suffix),customSuffix:"",locale:((K=r==null?void 0:r.numberAxisFormat)==null?void 0:K.locale)||"",currency:((H=r==null?void 0:r.numberAxisFormat)==null?void 0:H.currency)||""})}}},[f]:{...(D=(M=(k=t==null?void 0:t.options)==null?void 0:k.scales)==null?void 0:M[f])==null?void 0:D.ticks,callback:null}},plugins:{...(I=t==null?void 0:t.options)==null?void 0:I.plugins,datalabels:{...(j=(z=t==null?void 0:t.options)==null?void 0:z.plugins)==null?void 0:j.datalabels,formatter:function(Q){var U,B,K,H;return xc({number:Number(Q),decimalPlaces:((U=r==null?void 0:r.numberAxisFormat)==null?void 0:U.decimalPlaces)||0,useSuffix:!!((B=r==null?void 0:r.numberAxisFormat)!=null&&B.suffix),customSuffix:"",locale:((K=r==null?void 0:r.numberAxisFormat)==null?void 0:K.locale)||"",currency:((H=r==null?void 0:r.numberAxisFormat)==null?void 0:H.currency)||""})}}}},g=Fi.merge((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions),v=Fi.merge(p,g),b=gy(v,(n==null?void 0:n.options)||{});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:a},options:b}}function TT(e,t){var r,o,i;const n=((r=t==null?void 0:t.options)==null?void 0:r.indexAxis)==="y"?"x":"y";return(o=e==null?void 0:e.chartOptions)!=null&&o.indexAxis&&((i=e==null?void 0:e.chartOptions)==null||i.indexAxis),n}function UK(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 qK(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function GK(e){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}}}}}function YK(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function KK(e){var n,r,o,i;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{...(r=(n=e==null?void 0:e.options)==null?void 0:n.scales)==null?void 0:r.x,display:!0,stacked:!0},y:{...(i=(o=e==null?void 0:e.options)==null?void 0:o.scales)==null?void 0:i.y,display:!0,stacked:!0}}}}}function XK(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function QK(e,t){return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}},plugins:{legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function JK(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function Dw({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s}){var a,l;if(t==="bar"){const c=YK(n);return fa({data:e,cfg:c,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const c=qK(n);return fa({data:e,cfg:c,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pyramid"){const c=GK(n),{dimensionKeys:u,metricKeys:f}=Xr(e),p=qp({dataArray:e,groupKey:u[0],pivotKey:u[1],valueKey:f[0]}),g=fa({data:p,cfg:c,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s}),v="x2";return{...g,data:{...g.data,datasets:g.data.datasets.map((x,w)=>w===1?{...x,xAxisID:v}:x)},options:{...g.options,scales:{...(a=g==null?void 0:g.options)==null?void 0:a.scales,[v]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"){const c=KK(n),{dimensionKeys:u,metricKeys:f}=Xr(e),p=qp({dataArray:e,groupKey:u[0],pivotKey:u[1],valueKey:f[0]});return fa({data:p,cfg:c,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const c=XK(n);return fa({data:e,cfg:c,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pie"||t==="doughnut"||t==="polarArea"){const c=QK(t,n),{dimensionKeys:u,metricKeys:f}=Xr(e),p=tY(f,e),g=py(p,r),v=u[0],b=JD(e,v),x=gy((c==null?void 0:c.options)||{},(r==null?void 0:r.options)||{}),w={...x,plugins:{...x.plugins,datalabels:{...(l=x.plugins)==null?void 0:l.datalabels,formatter:(R,E)=>{var O,k,M,D;return xc({number:Number(R),decimalPlaces:((O=s==null?void 0:s.numberAxisFormat)==null?void 0:O.decimalPlaces)||0,useSuffix:!!((k=s==null?void 0:s.numberAxisFormat)!=null&&k.suffix),customSuffix:"",locale:((M=s==null?void 0:s.numberAxisFormat)==null?void 0:M.locale)||"",currency:((D=s==null?void 0:s.numberAxisFormat)==null?void 0:D.currency)||""})}}}};return{type:t,data:{labels:b,datasets:g},options:w,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(R,E,O){var U,B,K,H;const{ctx:k,data:M}=R;k.save();const D=R.getDatasetMeta(0).data[0].x,I=R.getDatasetMeta(0).data[0].y,z=Qu(Xu());k.font="1.2rem Arial",k.fontWeight="bolder",k.fillStyle=z,k.textAlign="center",k.textBaseline="middle";const j=M.datasets[0].data.reduce((q,Z)=>q+Z,0),Q=xc({number:Number(j),decimalPlaces:((U=s==null?void 0:s.numberAxisFormat)==null?void 0:U.decimalPlaces)||0,useSuffix:!!((B=s==null?void 0:s.numberAxisFormat)!=null&&B.suffix),customSuffix:"",locale:((K=s==null?void 0:s.numberAxisFormat)==null?void 0:K.locale)||"",currency:((H=s==null?void 0:s.numberAxisFormat)==null?void 0:H.currency)||""});k.fillText(Q,D,I)}}:""]}}if(t==="radar"){const c=JK(n);return fa({data:e,cfg:c,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:c}=Xr(e);if(c.length<3){console.log("Bubble charts require 3 numeric columns");return}const u=eY(e),f=py(u,r),p={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:c[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:c[1]},beginAtZero:!0,ticks:{precision:0}}}},g=gy(p,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:f},options:g}}return fa({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function ZK({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=Te.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)&&tX(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&nX(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&eX({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function eX(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((f,p)=>{var g,v;typeof f.backgroundColor=="string"&&(f.backgroundColor=new Array(f.data.length).fill(f.backgroundColor),f.borderColor=new Array(f.data.length).fill(f.borderColor)),f.backgroundColor=(g=f==null?void 0:f.backgroundColor)==null?void 0:g.map((b,x)=>x===n&&p===r?b:s),f.borderColor=(v=f==null?void 0:f.borderColor)==null?void 0:v.map((b,x)=>x===n&&p===r?b:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((f,p)=>{var g,v,b,x,w,_;f.backgroundColor=new Array(f.data.length).fill((b=(v=(g=o==null?void 0:o.data)==null?void 0:g.datasets)==null?void 0:v[p])==null?void 0:b.backgroundColor),f.borderColor=new Array(f.data.length).fill((_=(w=(x=o==null?void 0:o.data)==null?void 0:x.datasets)==null?void 0:w[p])==null?void 0:_.borderColor)}),t==null||t.update()}function tX(e,t,n,r,o){var i,s,a,l;console.log("clicked index",t),r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,f;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,g)=>g===t?p:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((p,g)=>g===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,p,g,v,b,x;c.backgroundColor=new Array(c.data.length).fill((g=(p=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:p[u])==null?void 0:g.backgroundColor),c.borderColor=new Array(c.data.length).fill((x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor)}),e==null||e.update()}function nX(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,f;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,g)=>g===t?p:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((p,g)=>g===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,p,g,v,b,x,w,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(g=(p=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:p[u])==null?void 0:g.backgroundColor,c.borderColor=(x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor),c.backgroundColor=(w=c==null?void 0:c.backgroundColor)==null?void 0:w.map((S,R)=>{var E;return(E=n.data.datasets[u].backgroundColor)==null?void 0:E[R]}),c.borderColor=(_=c==null?void 0:c.borderColor)==null?void 0:_.map((S,R)=>{var E;return(E=n.data.datasets[u].borderColor)==null?void 0:E[R]})}),e==null||e.update()}function rX(e,t,n,r){var o,i;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=Xr(e.data);if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const l=s[0],c=(o=e.data[n])==null?void 0:o[l];return[{columnName:l,columnValue:c,metric:a[t],value:r}]}if(["stackedBar","pyramid"].includes(e.type)){const l=qp({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),c=s[0],u=(i=l[n])==null?void 0:i[c],f=s[1],{metricKeys:p}=Xr(l),g=p[t];return[{columnName:c,columnValue:u,metric:a[0],value:r},{columnName:f,columnValue:g,metric:a[0],value:r}]}if(e.type==="bubble"||e.type==="scatter"){const l=s[0],c=r.label;return[{columnName:l,columnValue:c,metric1:a[0],value1:r.x,metric2:a[1],value2:r.y,metric3:a==null?void 0:a[2],value3:r==null?void 0:r.r}]}}catch(s){console.error("Error in getAdhocFilter",s)}}function oX(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=Wi(),r=n(e),o=Tw(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 Tw(e){var z,j,Q;const{onChartElementClicked:t}=el(),[n,r]=m.useState(0),o=((z=e==null?void 0:e.preferences)==null?void 0:z.filterOnClickColumnIndex)===void 0?0:(j=e.preferences)==null?void 0:j.filterOnClickColumnIndex,i=Te(U=>U.bookmarkKey);Te(U=>U.isVisualEditing);const s=Te(U=>U.filteringCards),a=Te(U=>U.selectedSheetId);Te(U=>U.selectedCardId),Te(U=>U.isDashboardEditing);const l=Te(U=>U.themeStyle),c=Te(U=>U.filterValues),u=(Q=e==null?void 0:e.preferences)==null?void 0:Q.onClickFilter,{addFrame:f,addFilteringCard:p,setFrameCardData:g,getSelectedFrame:v,addOrUpdateFilterValue:b,addOrUpdateFilterValues:x,removeFilterValue:w,removeFilteringCard:_}=Wi(),{data:S,isLoading:R,isFetching:E,isError:O,refetch:k}=WK(e),M=s==null?void 0:s.find(U=>U.id===e.id);let D;e.data&&e.data.length>0&&(D=Dw({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences})),m.useEffect(()=>{!S||!S.records||g(a,e.id,(S==null?void 0:S.records)||[])},[S,a,e.id,g,c]),m.useEffect(()=>{e.data&&r(n+1)},[e.data,e.type,e.cfg,e.customCfg,e.preferences,l]),m.useEffect(()=>{e.connectionId&&!M&&k()},[c,i]);function I(U,B,K,H){var T,V;let q=!1;if(!e.data)return;const Z=rX(e,B,K,H);if(console.log("fieldValues",Z),t==null||t(e,Z),!!(((T=e==null?void 0:e.preferences)==null?void 0:T.onClickFilter)??[]).length){if(M){const X=e.id;w(X),_(e)}else{if(q=!0,!Z)return;const X=[];Z.forEach((N,se)=>{const ae=u==null?void 0:u.find(fe=>fe.columnIndex===se);if(!ae)return;const ue={filterId:e.id+"-"+N.columnName,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:N.columnName,expression:ae.expression,valueType:Ju(Z[ae.columnIndex].columnValue),operation:"=",values:[Z[ae.columnIndex].columnValue]};X.push(ue)}),e.id,e==null||e.connectionId,e.lastSelectedTable,Z[o].columnName,(V=e.preferences)==null||V.filterOnClickField,Ju(Z[o].columnValue),Z[o].columnValue,x(X),p(e)}ZK({chart:U,elementIndex:K,datasetIndex:B,cardType:e.type,cfg:D,apply:q})}}return{isError:O,isLoading:R,isFetching:E,data:S,visualKey:n,handleDatapointClick:I,cfg:D}}function iX(e,t){const n=Te(u=>u.selectedSheetId),r=Te(u=>u.selectedFrameId),o=Te(u=>u.isDashboardEditing),i=Te(u=>u.isVisualEditing),{addFrame:s,getSelectedFrame:a,setSelectedFrameId:l}=Te(u=>u.actions);m.useEffect(()=>{const u=p=>{if(o&&((p.metaKey||p.ctrlKey)&&p.key==="c"&&navigator.clipboard.writeText(JSON.stringify(a())),(p.ctrlKey||p.metaKey)&&p.key==="v"))try{navigator.clipboard.readText().then(g=>{try{const v=JSON.parse(g);if(v&&v.id){v.id=Ua();const b=v.activeCardId;v.cards.forEach(x=>{const w=x.id;x.id=Ua(),w===b&&(v.activeCardId=x.id,x.title=`${x.title} (Copy)`)}),s(n,v),l(v.id)}}catch(v){console.error("Failed to parse clipboard contents: ",v)}})}catch(g){console.error("Failed to read clipboard contents: ",g)}},f=t==null?void 0:t.current;return f==null||f.addEventListener("keydown",u),()=>{f==null||f.removeEventListener("keydown",u)}},[o,n,a,s,t,l]),m.useEffect(()=>{r===e.id&&o&&!i&&c()},[r,e.id,o,i]);function c(){const u=t==null?void 0:t.current;u==null||u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}let bb;const kT="HoverCard",[MT,qpe]=Bn(kT,[di]),kw=di(),[sX,Mw]=MT(kT),aX=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=kw(t),c=m.useRef(0),u=m.useRef(0),f=m.useRef(!1),p=m.useRef(!1),[g=!1,v]=nr({prop:r,defaultProp:o,onChange:i}),b=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),x=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!p.current&&(u.current=window.setTimeout(()=>v(!1),a))},[a,v]),w=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(sX,{scope:t,open:g,onOpenChange:v,onOpen:b,onClose:x,onDismiss:w,hasSelectionRef:f,isPointerDownOnContentRef:p},m.createElement(cf,l,n))},lX="HoverCardTrigger",cX=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Mw(lX,n),i=kw(n);return m.createElement(uf,le({asChild:!0},i),m.createElement(Ue.a,le({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:Re(e.onPointerEnter,Qp(o.onOpen)),onPointerLeave:Re(e.onPointerLeave,Qp(o.onClose)),onFocus:Re(e.onFocus,o.onOpen),onBlur:Re(e.onBlur,o.onClose),onTouchStart:Re(e.onTouchStart,s=>s.preventDefault())})))}),uX="HoverCardPortal",[Gpe,dX]=MT(uX,{forceMount:void 0}),wy="HoverCardContent",fX=m.forwardRef((e,t)=>{const n=dX(wy,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=Mw(wy,e.__scopeHoverCard);return m.createElement(Rn,{present:r||i.open},m.createElement(hX,le({"data-state":i.open?"open":"closed"},o,{onPointerEnter:Re(e.onPointerEnter,Qp(i.onOpen)),onPointerLeave:Re(e.onPointerLeave,Qp(i.onClose)),ref:t})))}),hX=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=Mw(wy,n),c=kw(n),u=m.useRef(null),f=lt(t,u),[p,g]=m.useState(!1);return m.useEffect(()=>{if(p){const v=document.body;return bb=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=bb,v.style.webkitUserSelect=bb}}},[p]),m.useEffect(()=>{if(u.current){const v=()=>{g(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var b;((b=document.getSelection())===null||b===void 0?void 0:b.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{u.current&&pX(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),m.createElement(Tc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Re(i,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(df,le({},c,a,{onPointerDown:Re(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&g(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function Qp(e){return t=>t.pointerType==="touch"?void 0:e()}function pX(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const gX=aX,mX=cX,AT=fX,Aw=gX,Iw=mX,Kg=pe.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>P.jsx(AT,{ref:o,align:t,sideOffset:n,className:Ee("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}));Kg.displayName=AT.displayName;function vX({card:e}){const{setCardInfo:t}=Wi();return P.jsxs(Aw,{openDelay:0,children:[P.jsx(Iw,{children:P.jsx(cY,{className:"size-4 text-muted-foreground/40"})}),P.jsx(Kg,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:P.jsx(Va,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:P.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}const Nw=pe.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>P.jsx("div",{style:n,className:Ee("relative w-full overflow-auto",t),children:P.jsx("table",{ref:o,className:Ee("w-full caption-bottom text-sm",e),...r})}));Nw.displayName="Table";const Lw=pe.forwardRef(({className:e,...t},n)=>P.jsx("thead",{ref:n,className:Ee("[&_tr]:border-b",e),...t}));Lw.displayName="TableHeader";const Fw=pe.forwardRef(({className:e,...t},n)=>P.jsx("tbody",{ref:n,className:Ee("[&_tr:last-child]:border-0",e),...t}));Fw.displayName="TableBody";const bX=pe.forwardRef(({className:e,...t},n)=>P.jsx("tfoot",{ref:n,className:Ee("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));bX.displayName="TableFooter";const Hu=pe.forwardRef(({className:e,...t},n)=>P.jsx("tr",{ref:n,className:Ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Hu.displayName="TableRow";const zw=pe.forwardRef(({className:e,...t},n)=>P.jsx("th",{ref:n,className:Ee("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));zw.displayName="TableHead";const Jp=pe.forwardRef(({className:e,...t},n)=>P.jsx("td",{ref:n,className:Ee("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Jp.displayName="TableCell";const yX=pe.forwardRef(({className:e,...t},n)=>P.jsx("caption",{ref:n,className:Ee("mt-4 text-sm text-muted-foreground",e),...t}));yX.displayName="TableCaption";/**
|
|
254
|
+
* table-core
|
|
255
|
+
*
|
|
256
|
+
* Copyright (c) TanStack
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the MIT license found in the
|
|
259
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
260
|
+
*
|
|
261
|
+
* @license MIT
|
|
262
|
+
*/function Os(e,t){return typeof e=="function"?e(t):e}function no(e,t){return n=>{t.setState(r=>({...r,[e]:Os(n,r[e])}))}}function Zp(e){return e instanceof Function}function xX(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function wX(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 rt(e,t,n){let r=[],o;return()=>{let i;n.key&&n.debug&&(i=Date.now());const s=e();if(!(s.length!==r.length||s.some((c,u)=>r[u]!==c)))return o;r=s;let l;if(n.key&&n.debug&&(l=Date.now()),o=t(...s),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-i)*100)/100,u=Math.round((Date.now()-l)*100)/100,f=u/16,p=(g,v)=>{for(g=String(g);g.length<v;)g=" "+g;return g};console.info(`%c⏱ ${p(u,5)} /${p(c,5)} ms`,`
|
|
263
|
+
font-size: .6rem;
|
|
264
|
+
font-weight: bold;
|
|
265
|
+
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function _X(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?l.replace(".","_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=p=>{let g=p;for(const b of l.split(".")){var v;g=(v=g)==null?void 0:v[b],process.env.NODE_ENV!=="production"&&g===void 0&&console.warn(`"${b}" in deeply nested key "${l}" returned undefined.`)}return g}: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 f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:rt(()=>[!0],()=>{var p;return[f,...(p=f.columns)==null?void 0:p.flatMap(g=>g.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var p;return(p=e.options.debugAll)!=null?p:e.options.debugColumns}}),getLeafColumns:rt(()=>[e._getOrderColumnsFn()],p=>{var g;if((g=f.columns)!=null&&g.length){let v=f.columns.flatMap(b=>b.getLeafColumns());return p(v)}return[f]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var p;return(p=e.options.debugAll)!=null?p:e.options.debugColumns}})};for(const p of e._features)p.createColumn==null||p.createColumn(f,e);return f}function t2(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 SX={createTable:e=>{e.getHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(f=>n.find(p=>p.id===f)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(f=>n.find(p=>p.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return Bh(t,[...a,...c,...l],e)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=rt(()=>[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))),Bh(t,n,e,"center")),{key:process.env.NODE_ENV==="development"&&"getCenterHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftHeaderGroups=rt(()=>[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 Bh(t,i,e,"left")},{key:process.env.NODE_ENV==="development"&&"getLeftHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightHeaderGroups=rt(()=>[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 Bh(t,i,e,"right")},{key:process.env.NODE_ENV==="development"&&"getRightHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFooterGroups=rt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFooterGroups=rt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getLeftFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFooterGroups=rt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getCenterFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFooterGroups=rt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getRightFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFlatHeaders=rt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFlatHeaders=rt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getLeftFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFlatHeaders=rt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getCenterFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFlatHeaders=rt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getRightFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterLeafHeaders=rt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getCenterLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftLeafHeaders=rt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getLeftLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightLeafHeaders=rt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getRightLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeafHeaders=rt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})}};function Bh(e,t,n,r){var o,i;let s=0;const a=function(p,g){g===void 0&&(g=1),s=Math.max(s,g),p.filter(v=>v.getIsVisible()).forEach(v=>{var b;(b=v.columns)!=null&&b.length&&a(v.columns,g+1)},0)};a(e);let l=[];const c=(p,g)=>{const v={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},b=[];p.forEach(x=>{const w=[...b].reverse()[0],_=x.column.depth===v.depth;let S,R=!1;if(_&&x.column.parent?S=x.column.parent:(S=x.column,R=!0),w&&(w==null?void 0:w.column)===S)w.subHeaders.push(x);else{const E=t2(n,S,{id:[r,g,S.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${b.filter(O=>O.column===S).length}`:void 0,depth:g,index:b.length});E.subHeaders.push(x),b.push(E)}v.headers.push(x),x.headerGroup=v}),l.push(v),g>0&&c(b,g-1)},u=t.map((p,g)=>t2(n,p,{depth:s,index:g}));c(u,s-1),l.reverse();const f=p=>p.filter(v=>v.column.getIsVisible()).map(v=>{let b=0,x=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],f(v.subHeaders).forEach(S=>{let{colSpan:R,rowSpan:E}=S;b+=R,w.push(E)})):b=1;const _=Math.min(...w);return x=x+_,v.colSpan=b,v.rowSpan=x,{colSpan:b,rowSpan:x}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Vh={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},yb=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),CX={getDefaultColumnDef:()=>Vh,getInitialState:e=>({columnSizing:{},columnSizingInfo:yb(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:no("columnSizing",e),onColumnSizingInfoChange:no("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Vh.minSize,(r=i??e.columnDef.size)!=null?r:Vh.size),(o=e.columnDef.maxSize)!=null?o:Vh.maxSize)},e.getStart=n=>{const r=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),o=r.findIndex(i=>i.id===e.id);if(o>0){const i=r[o-1];return i.getStart(n)+i.getSize()}return 0},e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),xb(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=xb(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(w,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(S=>{var R,E;const O=t.options.columnResizeDirection==="rtl"?-1:1,k=(_-((R=S==null?void 0:S.startOffset)!=null?R:0))*O,M=Math.max(k/((E=S==null?void 0:S.startSize)!=null?E:0),-.999999);return S.columnSizingStart.forEach(D=>{let[I,z]=D;c[I]=Math.round(Math.max(z+z*M,0)*100)/100}),{...S,deltaOffset:k,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...c})))},f=w=>u("move",w),p=w=>{u("end",w),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,v={moveHandler:w=>f(w.clientX),upHandler:w=>{g==null||g.removeEventListener("mousemove",v.moveHandler),g==null||g.removeEventListener("mouseup",v.upHandler),p(w.clientX)}},b={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),f(w.touches[0].clientX),!1),upHandler:w=>{var _;g==null||g.removeEventListener("touchmove",b.moveHandler),g==null||g.removeEventListener("touchend",b.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),p((_=w.touches[0])==null?void 0:_.clientX)}},x=EX()?{passive:!1}:!1;xb(i)?(g==null||g.addEventListener("touchmove",b.moveHandler,x),g==null||g.addEventListener("touchend",b.upHandler,x)):(g==null||g.addEventListener("mousemove",v.moveHandler,x),g==null||g.addEventListener("mouseup",v.upHandler,x)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?yb():(n=e.initialState.columnSizingInfo)!=null?n:yb())},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 Hh=null;function EX(){if(typeof Hh=="boolean")return Hh;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 Hh=e,Hh}function xb(e){return e.type==="touchstart"}const RX={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:no("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()}}}},IT=(e,t,n)=>{var r;const o=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(o))};IT.autoRemove=e=>Ao(e);const NT=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};NT.autoRemove=e=>Ao(e);const LT=(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())};LT.autoRemove=e=>Ao(e);const FT=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};FT.autoRemove=e=>Ao(e)||!(e!=null&&e.length);const zT=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});zT.autoRemove=e=>Ao(e)||!(e!=null&&e.length);const jT=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});jT.autoRemove=e=>Ao(e)||!(e!=null&&e.length);const BT=(e,t,n)=>e.getValue(t)===n;BT.autoRemove=e=>Ao(e);const VT=(e,t,n)=>e.getValue(t)==n;VT.autoRemove=e=>Ao(e);const jw=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};jw.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]};jw.autoRemove=e=>Ao(e)||Ao(e[0])&&Ao(e[1]);const Ci={includesString:IT,includesStringSensitive:NT,equalsString:LT,arrIncludes:FT,arrIncludesAll:zT,arrIncludesSome:jT,equals:BT,weakEquals:VT,inNumberRange:jw};function Ao(e){return e==null||e===""}const PX={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:no("columnFilters",e),onGlobalFilterChange:no("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Ci.includesString:typeof r=="number"?Ci.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Ci.equals:Array.isArray(r)?Ci.arrIncludes:Ci.weakEquals},e.getFilterFn=()=>{var n,r;return Zp(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:Ci[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===e.id),s=Os(n,i?i.value:void 0);if(n2(o,s,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Ci.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Zp(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Ci[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Os(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(n2(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function n2(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const OX=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),$X=(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},DX=(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},TX=(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]},kX=(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},MX=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!xX(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},AX=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),IX=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,NX=(e,t)=>t.length,wb={sum:OX,min:$X,max:DX,extent:TX,mean:kX,median:MX,unique:AX,uniqueCount:IX,count:NX},LX={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:no("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r,o,i;return(n=(r=(o=(i=e.columnDef.enableGrouping)!=null?i:!0)!=null?o:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return wb.sum;if(Object.prototype.toString.call(r)==="[object Date]")return wb.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Zp(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:wb[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 FX(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 zX={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:no("columnOrder",e)}),createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=rt(()=>[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 FX(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},_y=0,Sy=10,_b=()=>({pageIndex:_y,pageSize:Sy}),jX={getInitialState:e=>({...e,pagination:{..._b(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:no("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=>Os(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?_b():(o=e.initialState.pagination)!=null?o:_b())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Os(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?_y:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:_y)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Sy:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Sy)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Os(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=Os(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=rt(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},{key:process.env.NODE_ENV==="development"&&"getPageOptions",debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugTable}}),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},Sb=()=>({left:[],right:[]}),Cb=()=>({top:[],bottom:[]}),BX={getInitialState:e=>({columnPinning:Sb(),rowPinning:Cb(),...e}),getDefaultOptions:e=>({onColumnPinningChange:no("columnPinning",e),onRowPinningChange:no("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id: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 f,p;return{top:((f=l==null?void 0:l.top)!=null?f:[]).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 g,v;return{top:[...((g=l==null?void 0:l.top)!=null?g:[]).filter(b=>!(a!=null&&a.has(b))),...Array.from(a)],bottom:((v=l==null?void 0:l.bottom)!=null?v:[]).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=t._getPinnedRows(o))==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getLeftVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),{key:process.env.NODE_ENV==="development"&&"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getRightVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),{key:process.env.NODE_ENV==="development"&&"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Sb():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Sb())},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=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getLeftLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getRightLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getRightLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getCenterLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},{key:process.env.NODE_ENV==="development"&&"getCenterLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Cb():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Cb())},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=>rt(()=>[e.getRowModel().rows,e.getState().rowPinning[t]],(n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(r??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(r??[]).map(s=>n.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:t}))},{key:process.env.NODE_ENV==="development"&&`row.get${t==="top"?"Top":"Bottom"}Rows`,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})(),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterRows",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugRows}})}},VX={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:no("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=>{Cy(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Eb(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="development"&&"getSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getFilteredSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Eb(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getGroupedSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Eb(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return Cy(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Bw(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Ey(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Ey(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)}}}},Cy=(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=>Cy(e,a.id,n,r,o))};function Eb(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=Bw(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 Bw(e,t){var n;return(n=t[e.id])!=null?n:!1}function Ey(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()&&(Bw(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Ey(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Ry=/([0-9]+)/gm,HX=(e,t,n)=>HT(Fs(e.getValue(n)).toLowerCase(),Fs(t.getValue(n)).toLowerCase()),WX=(e,t,n)=>HT(Fs(e.getValue(n)),Fs(t.getValue(n))),UX=(e,t,n)=>Vw(Fs(e.getValue(n)).toLowerCase(),Fs(t.getValue(n)).toLowerCase()),qX=(e,t,n)=>Vw(Fs(e.getValue(n)),Fs(t.getValue(n))),GX=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},YX=(e,t,n)=>Vw(e.getValue(n),t.getValue(n));function Vw(e,t){return e===t?0:e>t?1:-1}function Fs(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function HT(e,t){const n=e.split(Ry).filter(Boolean),r=t.split(Ry).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 vu={alphanumeric:HX,alphanumericCaseSensitive:WX,text:UX,textCaseSensitive:qX,datetime:GX,basic:YX},KX={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:no("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 vu.datetime;if(typeof i=="string"&&(r=!0,i.split(Ry).length>1))return vu.alphanumeric}return r?vu.text:vu.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 Zp(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:vu[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(g=>g.id===e.id),l=s==null?void 0:s.findIndex(g=>g.id===e.id);let c=[],u,f=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:f}],c.splice(0,c.length-((p=t.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(g=>g.id===e.id?{...g,desc:f}:g):u==="remove"?c=s.filter(g=>g.id!==e.id):c=[{id:e.id,desc:f}];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())}},XX={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:no("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;return(n=(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=rt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),{key:process.env.NODE_ENV==="production"&&"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getVisibleCells=rt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],{key:process.env.NODE_ENV==="development"&&"row.getVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{const t=(n,r)=>rt(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),{key:n,debug:()=>{var o;return(o=e.options.debugAll)!=null?o:e.options.debugColumns}});e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}},r2=[SX,XX,zX,BX,PX,KX,LX,RX,jX,VX,CX];function QX(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:r2};const r=n._features.reduce((u,f)=>Object.assign(u,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),o=u=>n.options.mergeOptions?n.options.mergeOptions(r,u):{...r,...u};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(u=>{var f;s=(f=u.getInitialState==null?void 0:u.getInitialState(s))!=null?f:s});const a=[];let l=!1;const c={_features:r2,options:{...r,...e},initialState:s,_queue:u=>{a.push(u),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const f=Os(u,n.options);n.options=o(f)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,f,p)=>{var g;return(g=n.options.getRowId==null?void 0:n.options.getRowId(u,f,p))!=null?g:`${p?[p.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(u,f)=>{let p=(f?n.getPrePaginationRowModel():n.getRowModel()).rowsById[u];if(!p&&(p=n.getCoreRowModel().rowsById[u],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${u}`):new Error;return p},_getDefaultColumnDef:rt(()=>[n.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,v;return(g=(v=p.renderValue())==null||v.toString==null?void 0:v.toString())!=null?g:null},...n._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...u}},{debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:rt(()=>[n._getColumnDefs()],u=>{const f=function(p,g,v){return v===void 0&&(v=0),p.map(b=>{const x=_X(n,b,v,g),w=b;return x.columns=w.columns?f(w.columns,x,v+1):[],x})};return f(u)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:rt(()=>[n.getAllColumns()],u=>u.flatMap(f=>f.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:rt(()=>[n.getAllFlatColumns()],u=>u.reduce((f,p)=>(f[p.id]=p,f),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:rt(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,f)=>{let p=u.flatMap(g=>g.getLeafColumns());return f(p)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>{const f=n._getAllFlatColumnsById()[u];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${u}' does not exist.`),f}};Object.assign(n,c);for(let u=0;u<n._features.length;u++){const f=n._features[u];f==null||f.createTable==null||f.createTable(n)}return n}function JX(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:rt(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),{key:process.env.NODE_ENV==="development"&&"cell.getContext",debug:()=>e.options.debugAll})};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}const ZX=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>wX(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:rt(()=>[e.getAllLeafColumns()],l=>l.map(c=>JX(e,a,c,c.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:rt(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),{key:process.env.NODE_ENV==="production"&&"row.getAllCellsByColumnId",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}})};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a};function WT(){return e=>rt(()=>[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=ZX(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},{key:process.env.NODE_ENV==="development"&&"getRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function UT(){return e=>rt(()=>[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,f)=>{for(let g=0;g<i.length;g+=1){var p;const v=i[g],b=s[v.id],x=(p=v==null?void 0:v.desc)!=null?p:!1;let w=0;if(b.sortUndefined){const _=u.getValue(v.id),S=f.getValue(v.id),R=_===void 0,E=S===void 0;(R||E)&&(w=R&&E?0:R?b.sortUndefined:-b.sortUndefined)}if(w===0&&(w=b.sortingFn(u,f,v.id)),w!==0)return x&&(w*=-1),b.invertSorting&&(w*=-1),w}return u.index-f.index}),c.forEach(u=>{var f;o.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},{key:process.env.NODE_ENV==="development"&&"getSortedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function eQ(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 qT(e){return t=>rt(()=>[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 f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=eQ({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const p=g=>{f.flatRows.push(g),g.subRows.length&&g.subRows.forEach(p)};return f.rows.forEach(p),f},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
|
|
266
|
+
* react-table
|
|
267
|
+
*
|
|
268
|
+
* Copyright (c) TanStack
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the MIT license found in the
|
|
271
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
272
|
+
*
|
|
273
|
+
* @license MIT
|
|
274
|
+
*/function Py(e,t){return e?tQ(e)?pe.createElement(e,t):e:null}function tQ(e){return nQ(e)||typeof e=="function"||rQ(e)}function nQ(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function rQ(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function GT(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=pe.useState(()=>({current:QX(t)})),[r,o]=pe.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 Oy(e,[t,n]){return Math.min(n,Math.max(t,e))}let Rb=0;function Xg(){m.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:o2()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:o2()),Rb++,()=>{Rb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Rb--}},[])}function o2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const Pb="focusScope.autoFocusOnMount",Ob="focusScope.autoFocusOnUnmount",i2={bubbles:!1,cancelable:!0},Qg=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=m.useState(null),c=Mn(o),u=Mn(i),f=m.useRef(null),p=lt(t,b=>l(b)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let b=function(S){if(g.paused||!a)return;const R=S.target;a.contains(R)?f.current=R:hs(f.current,{select:!0})},x=function(S){if(g.paused||!a)return;const R=S.relatedTarget;R!==null&&(a.contains(R)||hs(f.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&hs(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const _=new MutationObserver(w);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),_.disconnect()}}},[r,a,g.paused]),m.useEffect(()=>{if(a){a2.add(g);const b=document.activeElement;if(!a.contains(b)){const w=new CustomEvent(Pb,i2);a.addEventListener(Pb,c),a.dispatchEvent(w),w.defaultPrevented||(oQ(cQ(YT(a)),{select:!0}),document.activeElement===b&&hs(a))}return()=>{a.removeEventListener(Pb,c),setTimeout(()=>{const w=new CustomEvent(Ob,i2);a.addEventListener(Ob,u),a.dispatchEvent(w),w.defaultPrevented||hs(b??document.body,{select:!0}),a.removeEventListener(Ob,u),a2.remove(g)},0)}}},[a,c,u,g]);const v=m.useCallback(b=>{if(!n&&!r||g.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,w=document.activeElement;if(x&&w){const _=b.currentTarget,[S,R]=iQ(_);S&&R?!b.shiftKey&&w===R?(b.preventDefault(),n&&hs(S,{select:!0})):b.shiftKey&&w===S&&(b.preventDefault(),n&&hs(R,{select:!0})):w===_&&b.preventDefault()}},[n,r,g.paused]);return m.createElement(Ue.div,le({tabIndex:-1},s,{ref:p,onKeyDown:v}))});function oQ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(hs(r,{select:t}),document.activeElement!==n)return}function iQ(e){const t=YT(e),n=s2(t,e),r=s2(t.reverse(),e);return[n,r]}function YT(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 s2(e,t){for(const n of e)if(!sQ(n,{upTo:t}))return n}function sQ(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 aQ(e){return e instanceof HTMLInputElement&&"select"in e}function hs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&aQ(e)&&t&&e.select()}}const a2=lQ();function lQ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=l2(e,t),e.unshift(t)},remove(t){var n;e=l2(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function l2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function cQ(e){return e.filter(t=>t.tagName!=="A")}function Jg(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var uQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ol=new WeakMap,Wh=new WeakMap,Uh={},$b=0,KT=function(e){return e&&(e.host||KT(e.parentNode))},dQ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=KT(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})},fQ=function(e,t,n,r){var o=dQ(t,Array.isArray(e)?e:[e]);Uh[n]||(Uh[n]=new WeakMap);var i=Uh[n],s=[],a=new Set,l=new Set(o),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};o.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))u(p);else{var g=p.getAttribute(r),v=g!==null&&g!=="false",b=(Ol.get(p)||0)+1,x=(i.get(p)||0)+1;Ol.set(p,b),i.set(p,x),s.push(p),b===1&&v&&Wh.set(p,!0),x===1&&p.setAttribute(n,"true"),v||p.setAttribute(r,"true")}})};return u(t),a.clear(),$b++,function(){s.forEach(function(f){var p=Ol.get(f)-1,g=i.get(f)-1;Ol.set(f,p),i.set(f,g),p||(Wh.has(f)||f.removeAttribute(r),Wh.delete(f)),g||f.removeAttribute(n)}),$b--,$b||(Ol=new WeakMap,Ol=new WeakMap,Wh=new WeakMap,Uh={})}},Zg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||uQ(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),fQ(r,o,n,"aria-hidden")):function(){return null}},Qo=function(){return Qo=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},Qo.apply(this,arguments)};function XT(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 hQ(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 _p="right-scroll-bar-position",Sp="width-before-scroll-bar",pQ="with-scroll-bars-hidden",gQ="--removed-body-scroll-bar-size";function mQ(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function vQ(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function bQ(e,t){return vQ(t||null,function(n){return e.forEach(function(r){return mQ(r,n)})})}function yQ(e){return e}function xQ(e,t){t===void 0&&(t=yQ);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 wQ(e){e===void 0&&(e={});var t=xQ(null);return t.options=Qo({async:!0,ssr:!1},e),t}var QT=function(e){var t=e.sideCar,n=XT(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 pe.createElement(r,Qo({},n))};QT.isSideCarExport=!0;function _Q(e,t){return e.useMedium(t),QT}var JT=wQ(),Db=function(){},em=pe.forwardRef(function(e,t){var n=pe.useRef(null),r=pe.useState({onScrollCapture:Db,onWheelCapture:Db,onTouchMoveCapture:Db}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,g=e.noIsolation,v=e.inert,b=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,_=XT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=p,R=bQ([n,t]),E=Qo(Qo({},_),o);return pe.createElement(pe.Fragment,null,u&&pe.createElement(S,{sideCar:JT,removeScrollBar:c,shards:f,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!b,lockRef:n}),s?pe.cloneElement(pe.Children.only(a),Qo(Qo({},E),{ref:R})):pe.createElement(w,Qo({},E,{className:l,ref:R}),a))});em.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};em.classNames={fullWidth:Sp,zeroRight:_p};var c2,SQ=function(){if(c2)return c2;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function CQ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=SQ();return t&&e.setAttribute("nonce",t),e}function EQ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function RQ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var PQ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=CQ())&&(EQ(t,n),RQ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},OQ=function(){var e=PQ();return function(t,n){pe.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ZT=function(){var e=OQ(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},$Q={left:0,top:0,right:0,gap:0},Tb=function(e){return parseInt(e||"",10)||0},DQ=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[Tb(n),Tb(r),Tb(o)]},TQ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $Q;var t=DQ(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])}},kQ=ZT(),MQ=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
275
|
+
.`.concat(pQ,` {
|
|
276
|
+
overflow: hidden `).concat(r,`;
|
|
277
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
278
|
+
}
|
|
279
|
+
body {
|
|
280
|
+
overflow: hidden `).concat(r,`;
|
|
281
|
+
overscroll-behavior: contain;
|
|
282
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
283
|
+
padding-left: `.concat(o,`px;
|
|
284
|
+
padding-top: `).concat(i,`px;
|
|
285
|
+
padding-right: `).concat(s,`px;
|
|
286
|
+
margin-left:0;
|
|
287
|
+
margin-top:0;
|
|
288
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
289
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.`).concat(_p,` {
|
|
293
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.`).concat(Sp,` {
|
|
297
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.`).concat(_p," .").concat(_p,` {
|
|
301
|
+
right: 0 `).concat(r,`;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.`).concat(Sp," .").concat(Sp,` {
|
|
305
|
+
margin-right: 0 `).concat(r,`;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
body {
|
|
309
|
+
`).concat(gQ,": ").concat(a,`px;
|
|
310
|
+
}
|
|
311
|
+
`)},AQ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=pe.useMemo(function(){return TQ(o)},[o]);return pe.createElement(kQ,{styles:MQ(i,!t,o,n?"":"!important")})},$y=!1;if(typeof window<"u")try{var qh=Object.defineProperty({},"passive",{get:function(){return $y=!0,!0}});window.addEventListener("test",qh,qh),window.removeEventListener("test",qh,qh)}catch{$y=!1}var $l=$y?{passive:!1}:!1,IQ=function(e){return e.tagName==="TEXTAREA"},ek=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!IQ(e)&&n[t]==="visible")},NQ=function(e){return ek(e,"overflowY")},LQ=function(e){return ek(e,"overflowX")},u2=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=tk(e,n);if(r){var o=nk(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},FQ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},zQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},tk=function(e,t){return e==="v"?NQ(t):LQ(t)},nk=function(e,t){return e==="v"?FQ(t):zQ(t)},jQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},BQ=function(e,t,n,r,o){var i=jQ(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,p=0;do{var g=nk(e,a),v=g[0],b=g[1],x=g[2],w=b-x-i*v;(v||w)&&tk(e,a)&&(f+=w,p+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&f===0||!o&&s>f)||!u&&(o&&p===0||!o&&-s>p))&&(c=!0),c},Gh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},d2=function(e){return[e.deltaX,e.deltaY]},f2=function(e){return e&&"current"in e?e.current:e},VQ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HQ=function(e){return`
|
|
312
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
313
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
314
|
+
`)},WQ=0,Dl=[];function UQ(e){var t=pe.useRef([]),n=pe.useRef([0,0]),r=pe.useRef(),o=pe.useState(WQ++)[0],i=pe.useState(function(){return ZT()})[0],s=pe.useRef(e);pe.useEffect(function(){s.current=e},[e]),pe.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=hQ([e.lockRef.current],(e.shards||[]).map(f2),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=pe.useCallback(function(b,x){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var w=Gh(b),_=n.current,S="deltaX"in b?b.deltaX:_[0]-w[0],R="deltaY"in b?b.deltaY:_[1]-w[1],E,O=b.target,k=Math.abs(S)>Math.abs(R)?"h":"v";if("touches"in b&&k==="h"&&O.type==="range")return!1;var M=u2(k,O);if(!M)return!0;if(M?E=k:(E=k==="v"?"h":"v",M=u2(k,O)),!M)return!1;if(!r.current&&"changedTouches"in b&&(S||R)&&(r.current=E),!E)return!0;var D=r.current||E;return BQ(D,x,b,D==="h"?S:R,!0)},[]),l=pe.useCallback(function(b){var x=b;if(!(!Dl.length||Dl[Dl.length-1]!==i)){var w="deltaY"in x?d2(x):Gh(x),_=t.current.filter(function(E){return E.name===x.type&&E.target===x.target&&VQ(E.delta,w)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(f2).filter(Boolean).filter(function(E){return E.contains(x.target)}),R=S.length>0?a(x,S[0]):!s.current.noIsolation;R&&x.cancelable&&x.preventDefault()}}},[]),c=pe.useCallback(function(b,x,w,_){var S={name:b,delta:x,target:w,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(R){return R!==S})},1)},[]),u=pe.useCallback(function(b){n.current=Gh(b),r.current=void 0},[]),f=pe.useCallback(function(b){c(b.type,d2(b),b.target,a(b,e.lockRef.current))},[]),p=pe.useCallback(function(b){c(b.type,Gh(b),b.target,a(b,e.lockRef.current))},[]);pe.useEffect(function(){return Dl.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,$l),document.addEventListener("touchmove",l,$l),document.addEventListener("touchstart",u,$l),function(){Dl=Dl.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,$l),document.removeEventListener("touchmove",l,$l),document.removeEventListener("touchstart",u,$l)}},[]);var g=e.removeScrollBar,v=e.inert;return pe.createElement(pe.Fragment,null,v?pe.createElement(i,{styles:HQ(o)}):null,g?pe.createElement(AQ,{gapMode:"margin"}):null)}const qQ=_Q(JT,UQ);var rk=pe.forwardRef(function(e,t){return pe.createElement(em,Qo({},e,{ref:t,sideCar:qQ}))});rk.classNames=em.classNames;const tm=rk,GQ=[" ","Enter","ArrowUp","ArrowDown"],YQ=[" ","Enter"],nm="Select",[rm,om,KQ]=Cg(nm),[Ac,Ype]=Bn(nm,[KQ,di]),Hw=di(),[XQ,tl]=Ac(nm),[QQ,JQ]=Ac(nm),ZQ=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:p,required:g}=e,v=Hw(t),[b,x]=m.useState(null),[w,_]=m.useState(null),[S,R]=m.useState(!1),E=Xa(c),[O=!1,k]=nr({prop:r,defaultProp:o,onChange:i}),[M,D]=nr({prop:s,defaultProp:a,onChange:l}),I=m.useRef(null),z=b?!!b.closest("form"):!0,[j,Q]=m.useState(new Set),U=Array.from(j).map(B=>B.props.value).join(";");return m.createElement(cf,v,m.createElement(XQ,{required:g,scope:t,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:R,contentId:Or(),value:M,onValueChange:D,open:O,onOpenChange:k,dir:E,triggerPointerDownPosRef:I,disabled:p},m.createElement(rm.Provider,{scope:t},m.createElement(QQ,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(B=>{Q(K=>new Set(K).add(B))},[]),onNativeOptionRemove:m.useCallback(B=>{Q(K=>{const H=new Set(K);return H.delete(B),H})},[])},n)),z?m.createElement(lk,{key:U,"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:f,value:M,onChange:B=>D(B.target.value),disabled:p},M===void 0?m.createElement("option",{value:""}):null,Array.from(j)):null))},eJ="SelectTrigger",tJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Hw(n),s=tl(eJ,n),a=s.disabled||r,l=lt(t,s.onTriggerChange),c=om(n),[u,f,p]=ck(v=>{const b=c().filter(_=>!_.disabled),x=b.find(_=>_.value===s.value),w=uk(b,v,x);w!==void 0&&s.onValueChange(w.value)}),g=()=>{a||(s.onOpenChange(!0),p())};return m.createElement(uf,le({asChild:!0},i),m.createElement(Ue.button,le({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":ak(s.value)?"":void 0},o,{ref:l,onClick:Re(o.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Re(o.onPointerDown,v=>{const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(g(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Re(o.onKeyDown,v=>{const b=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(b&&v.key===" ")&&GQ.includes(v.key)&&(g(),v.preventDefault())})})))}),nJ="SelectValue",rJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=tl(nJ,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=lt(t,l.onValueNodeChange);return tr(()=>{c(u)},[c,u]),m.createElement(Ue.span,le({},a,{ref:f,style:{pointerEvents:"none"}}),ak(l.value)?m.createElement(m.Fragment,null,s):i)}),oJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Ue.span,le({"aria-hidden":!0},o,{ref:t}),r||"▼")}),iJ=e=>m.createElement(qg,le({asChild:!0},e)),Cc="SelectContent",sJ=m.forwardRef((e,t)=>{const n=tl(Cc,e.__scopeSelect),[r,o]=m.useState();if(tr(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Fo.createPortal(m.createElement(ok,{scope:e.__scopeSelect},m.createElement(rm.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(aJ,le({},e,{ref:t}))}),$i=10,[ok,nl]=Ac(Cc),aJ=m.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:f,collisionBoundary:p,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:x,...w}=e,_=tl(Cc,n),[S,R]=m.useState(null),[E,O]=m.useState(null),k=lt(t,fe=>R(fe)),[M,D]=m.useState(null),[I,z]=m.useState(null),j=om(n),[Q,U]=m.useState(!1),B=m.useRef(!1);m.useEffect(()=>{if(S)return Zg(S)},[S]),Xg();const K=m.useCallback(fe=>{const[oe,...ee]=j().map(G=>G.ref.current),[ie]=ee.slice(-1),be=document.activeElement;for(const G of fe)if(G===be||(G==null||G.scrollIntoView({block:"nearest"}),G===oe&&E&&(E.scrollTop=0),G===ie&&E&&(E.scrollTop=E.scrollHeight),G==null||G.focus(),document.activeElement!==be))return},[j,E]),H=m.useCallback(()=>K([M,S]),[K,M,S]);m.useEffect(()=>{Q&&H()},[Q,H]);const{onOpenChange:q,triggerPointerDownPosRef:Z}=_;m.useEffect(()=>{if(S){let fe={x:0,y:0};const oe=ie=>{var be,G,me,_e;fe={x:Math.abs(Math.round(ie.pageX)-((be=(G=Z.current)===null||G===void 0?void 0:G.x)!==null&&be!==void 0?be:0)),y:Math.abs(Math.round(ie.pageY)-((me=(_e=Z.current)===null||_e===void 0?void 0:_e.y)!==null&&me!==void 0?me:0))}},ee=ie=>{fe.x<=10&&fe.y<=10?ie.preventDefault():S.contains(ie.target)||q(!1),document.removeEventListener("pointermove",oe),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ee,{capture:!0})}}},[S,q,Z]),m.useEffect(()=>{const fe=()=>q(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[q]);const[T,V]=ck(fe=>{const oe=j().filter(be=>!be.disabled),ee=oe.find(be=>be.ref.current===document.activeElement),ie=uk(oe,fe,ee);ie&&setTimeout(()=>ie.ref.current.focus())}),X=m.useCallback((fe,oe,ee)=>{const ie=!B.current&&!ee;(_.value!==void 0&&_.value===oe||ie)&&(D(fe),ie&&(B.current=!0))},[_.value]),N=m.useCallback(()=>S==null?void 0:S.focus(),[S]),se=m.useCallback((fe,oe,ee)=>{const ie=!B.current&&!ee;(_.value!==void 0&&_.value===oe||ie)&&z(fe)},[_.value]),ae=r==="popper"?h2:lJ,ue=ae===h2?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:x}:{};return m.createElement(ok,{scope:n,content:S,viewport:E,onViewportChange:O,itemRefCallback:X,selectedItem:M,onItemLeave:N,itemTextRefCallback:se,focusSelectedItem:H,selectedItemText:I,position:r,isPositioned:Q,searchRef:T},m.createElement(tm,{as:ji,allowPinchZoom:!0},m.createElement(Qg,{asChild:!0,trapped:_.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:Re(o,fe=>{var oe;(oe=_.trigger)===null||oe===void 0||oe.focus({preventScroll:!0}),fe.preventDefault()})},m.createElement(Tc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(ae,le({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:fe=>fe.preventDefault()},w,ue,{onPlaced:()=>U(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Re(w.onKeyDown,fe=>{const oe=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!oe&&fe.key.length===1&&V(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let ie=j().filter(be=>!be.disabled).map(be=>be.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const be=fe.target,G=ie.indexOf(be);ie=ie.slice(G+1)}setTimeout(()=>K(ie)),fe.preventDefault()}})}))))))}),lJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=tl(Cc,n),s=nl(Cc,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=lt(t,k=>u(k)),p=om(n),g=m.useRef(!1),v=m.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:w,focusSelectedItem:_}=s,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&b&&x&&w){const k=i.trigger.getBoundingClientRect(),M=c.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),I=w.getBoundingClientRect();if(i.dir!=="rtl"){const be=I.left-M.left,G=D.left-be,me=k.left-G,_e=k.width+me,Pe=Math.max(_e,M.width),$e=window.innerWidth-$i,Ve=Oy(G,[$i,$e-Pe]);a.style.minWidth=_e+"px",a.style.left=Ve+"px"}else{const be=M.right-I.right,G=window.innerWidth-D.right-be,me=window.innerWidth-k.right-G,_e=k.width+me,Pe=Math.max(_e,M.width),$e=window.innerWidth-$i,Ve=Oy(G,[$i,$e-Pe]);a.style.minWidth=_e+"px",a.style.right=Ve+"px"}const z=p(),j=window.innerHeight-$i*2,Q=b.scrollHeight,U=window.getComputedStyle(c),B=parseInt(U.borderTopWidth,10),K=parseInt(U.paddingTop,10),H=parseInt(U.borderBottomWidth,10),q=parseInt(U.paddingBottom,10),Z=B+K+Q+q+H,T=Math.min(x.offsetHeight*5,Z),V=window.getComputedStyle(b),X=parseInt(V.paddingTop,10),N=parseInt(V.paddingBottom,10),se=k.top+k.height/2-$i,ae=j-se,ue=x.offsetHeight/2,fe=x.offsetTop+ue,oe=B+K+fe,ee=Z-oe;if(oe<=se){const be=x===z[z.length-1].ref.current;a.style.bottom="0px";const G=c.clientHeight-b.offsetTop-b.offsetHeight,me=Math.max(ae,ue+(be?N:0)+G+H),_e=oe+me;a.style.height=_e+"px"}else{const be=x===z[0].ref.current;a.style.top="0px";const me=Math.max(se,B+b.offsetTop+(be?X:0)+ue)+ee;a.style.height=me+"px",b.scrollTop=oe-se+b.offsetTop}a.style.margin=`${$i}px 0`,a.style.minHeight=T+"px",a.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[p,i.trigger,i.valueNode,a,c,b,x,w,i.dir,r]);tr(()=>S(),[S]);const[R,E]=m.useState();tr(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const O=m.useCallback(k=>{k&&v.current===!0&&(S(),_==null||_(),v.current=!1)},[S,_]);return m.createElement(cJ,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:O},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R}},m.createElement(Ue.div,le({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),h2=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=$i,...i}=e,s=Hw(n);return m.createElement(df,le({},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)"}}))}),[cJ,Ww]=Ac(Cc,{}),p2="SelectViewport",uJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=nl(p2,n),i=Ww(p2,n),s=lt(t,o.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(rm.Slot,{scope:n},m.createElement(Ue.div,le({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Re(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&u){const p=Math.abs(a.current-c.scrollTop);if(p>0){const g=window.innerHeight-$i*2,v=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),x=Math.max(v,b);if(x<g){const w=x+p,_=Math.min(g,w),S=w-_;u.style.height=_+"px",u.style.bottom==="0px"&&(c.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),dJ="SelectGroup",[fJ,hJ]=Ac(dJ),pJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Or();return m.createElement(fJ,{scope:n,id:o},m.createElement(Ue.div,le({role:"group","aria-labelledby":o},r,{ref:t})))}),gJ="SelectLabel",mJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=hJ(gJ,n);return m.createElement(Ue.div,le({id:o.id},r,{ref:t}))}),Dy="SelectItem",[vJ,ik]=Ac(Dy),bJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=tl(Dy,n),l=nl(Dy,n),c=a.value===r,[u,f]=m.useState(i??""),[p,g]=m.useState(!1),v=lt(t,w=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,w,r,o)}),b=Or(),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.createElement(vJ,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:m.useCallback(w=>{f(_=>{var S;return _||((S=w==null?void 0:w.textContent)!==null&&S!==void 0?S:"").trim()})},[])},m.createElement(rm.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(Ue.div,le({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:v,onFocus:Re(s.onFocus,()=>g(!0)),onBlur:Re(s.onBlur,()=>g(!1)),onPointerUp:Re(s.onPointerUp,x),onPointerMove:Re(s.onPointerMove,w=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(s.onPointerLeave,w=>{if(w.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:Re(s.onKeyDown,w=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&w.key===" "||(YQ.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})}))))}),Yh="SelectItemText",yJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=tl(Yh,n),a=nl(Yh,n),l=ik(Yh,n),c=JQ(Yh,n),[u,f]=m.useState(null),p=lt(t,w=>f(w),l.onItemTextChange,w=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.call(a,w,l.value,l.disabled)}),g=u==null?void 0:u.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},g),[l.disabled,l.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=c;return tr(()=>(b(v),()=>x(v)),[b,x,v]),m.createElement(m.Fragment,null,m.createElement(Ue.span,le({id:l.textId},i,{ref:p})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Fo.createPortal(i.children,s.valueNode):null)}),xJ="SelectItemIndicator",wJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ik(xJ,n).isSelected?m.createElement(Ue.span,le({"aria-hidden":!0},r,{ref:t})):null}),g2="SelectScrollUpButton",_J=m.forwardRef((e,t)=>{const n=nl(g2,e.__scopeSelect),r=Ww(g2,e.__scopeSelect),[o,i]=m.useState(!1),s=lt(t,r.onScrollButtonChange);return tr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;i(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(sk,le({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),m2="SelectScrollDownButton",SJ=m.forwardRef((e,t)=>{const n=nl(m2,e.__scopeSelect),r=Ww(m2,e.__scopeSelect),[o,i]=m.useState(!1),s=lt(t,r.onScrollButtonChange);return tr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)<c;i(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(sk,le({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),sk=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=nl("SelectScrollButton",n),s=m.useRef(null),a=om(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),tr(()=>{var c;const u=a().find(f=>f.ref.current===document.activeElement);u==null||(c=u.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(Ue.div,le({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:Re(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Re(o.onPointerMove,()=>{var c;(c=i.onItemLeave)===null||c===void 0||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Re(o.onPointerLeave,()=>{l()})}))}),CJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Ue.div,le({"aria-hidden":!0},r,{ref:t}))});function ak(e){return e===""||e===void 0}const lk=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=lt(t,o),s=Jg(n);return m.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(xT,{asChild:!0},m.createElement("select",le({},r,{ref:i,defaultValue:n})))});lk.displayName="BubbleSelect";function ck(e){const t=Mn(e),n=m.useRef(""),r=m.useRef(0),o=m.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=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function uk(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=EJ(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 EJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const RJ=ZQ,dk=tJ,PJ=rJ,OJ=oJ,$J=iJ,fk=sJ,DJ=uJ,TJ=pJ,hk=mJ,pk=bJ,kJ=yJ,MJ=wJ,gk=_J,mk=SJ,vk=CJ,ps=RJ,Fl=TJ,gs=PJ,Ti=pe.forwardRef(({className:e,children:t,...n},r)=>P.jsxs(dk,{ref:r,className:Ee("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,P.jsx(OJ,{asChild:!0,children:P.jsx(Vg,{className:"h-4 w-4 opacity-50"})})]}));Ti.displayName=dk.displayName;const bk=pe.forwardRef(({className:e,...t},n)=>P.jsx(gk,{ref:n,className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:P.jsx(sY,{className:"h-4 w-4"})}));bk.displayName=gk.displayName;const yk=pe.forwardRef(({className:e,...t},n)=>P.jsx(mk,{ref:n,className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:P.jsx(Vg,{className:"h-4 w-4"})}));yk.displayName=mk.displayName;const ki=pe.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>P.jsx($J,{children:P.jsxs(fk,{ref:o,className:Ee("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:[P.jsx(bk,{}),P.jsx(DJ,{className:Ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),P.jsx(yk,{})]})}));ki.displayName=fk.displayName;const ba=pe.forwardRef(({className:e,...t},n)=>P.jsx(hk,{ref:n,className:Ee("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));ba.displayName=hk.displayName;const Fn=pe.forwardRef(({className:e,children:t,...n},r)=>P.jsxs(pk,{ref:r,className:Ee("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(MJ,{children:P.jsx(af,{className:"h-4 w-4"})})}),P.jsx(kJ,{children:t})]}));Fn.displayName=pk.displayName;const eg=pe.forwardRef(({className:e,...t},n)=>P.jsx(vk,{ref:n,className:Ee("-mx-1 my-1 h-px bg-muted",e),...t}));eg.displayName=vk.displayName;const v2=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,b2=Pp,Uw=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return b2(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],f=i==null?void 0:i[c];if(u===null)return null;const p=v2(u)||v2(f);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,p]=u;return p===void 0||(c[f]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:p,...g}=u;return Object.entries(g).every(v=>{let[b,x]=v;return Array.isArray(x)?x.includes({...i,...a}[b]):{...i,...a}[b]===x})?[...c,f,p]:c},[]);return b2(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Ty=Uw("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"}}),dr=pe.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?ji:"button";return P.jsx(s,{className:Ee(Ty({variant:t,size:n,className:e})),ref:i,...o})});dr.displayName="Button";const AJ=m.forwardRef((e,t)=>m.createElement(Ue.label,le({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),xk=AJ,IJ=Uw("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),zn=pe.forwardRef(({className:e,...t},n)=>P.jsx(xk,{ref:n,className:Ee(IJ(),e),...t}));zn.displayName=xk.displayName;const wk="Popover",[_k,Kpe]=Bn(wk,[di]),qw=di(),[NJ,Ic]=_k(wk),LJ=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=qw(t),l=m.useRef(null),[c,u]=m.useState(!1),[f=!1,p]=nr({prop:r,defaultProp:o,onChange:i});return m.createElement(cf,a,m.createElement(NJ,{scope:t,contentId:Or(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(g=>!g),[p]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},FJ="PopoverTrigger",zJ=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ic(FJ,n),i=qw(n),s=lt(t,o.triggerRef),a=m.createElement(Ue.button,le({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ek(o.open)},r,{ref:s,onClick:Re(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(uf,le({asChild:!0},i),a)}),Sk="PopoverPortal",[jJ,BJ]=_k(Sk,{forceMount:void 0}),VJ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Ic(Sk,t);return m.createElement(jJ,{scope:t,forceMount:n},m.createElement(Rn,{present:n||i.open},m.createElement(qg,{asChild:!0,container:o},r)))},dd="PopoverContent",HJ=m.forwardRef((e,t)=>{const n=BJ(dd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Ic(dd,e.__scopePopover);return m.createElement(Rn,{present:r||i.open},i.modal?m.createElement(WJ,le({},o,{ref:t})):m.createElement(UJ,le({},o,{ref:t})))}),WJ=m.forwardRef((e,t)=>{const n=Ic(dd,e.__scopePopover),r=m.useRef(null),o=lt(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return Zg(s)},[]),m.createElement(tm,{as:ji,allowPinchZoom:!0},m.createElement(Ck,le({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Re(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:Re(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),UJ=m.forwardRef((e,t)=>{const n=Ic(dd,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(Ck,le({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),Ck=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,p=Ic(dd,n),g=qw(n);return Xg(),m.createElement(Qg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Tc,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1)},m.createElement(df,le({"data-state":Ek(p.open),role:"dialog",id:p.contentId},g,f,{ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function Ek(e){return e?"open":"closed"}const qJ=LJ,GJ=zJ,YJ=VJ,Rk=HJ,im=qJ,sm=GJ,ff=pe.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>P.jsx(YJ,{children:P.jsx(Rk,{ref:o,align:t,sideOffset:n,className:Ee("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));ff.displayName=Rk.displayName;function KJ(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:{}}}}const Gl=pe.forwardRef(({className:e,type:t,...n},r)=>P.jsx("input",{type:t,className:Ee("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}));Gl.displayName="Input";function Pk({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 P.jsxs("div",{className:"space-y-3",children:[P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(zn,{children:"Color Range"}),P.jsx(dr,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:P.jsx(rT,{className:"size-3"})})]}),e.map((s,a)=>P.jsxs("div",{className:"flex items-center gap-2 px-2",children:[P.jsx(Gl,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:Ee(`h-7 ${fp}`)}),P.jsx("span",{children:"-"}),P.jsx(Gl,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:Ee(`h-7 ${fp}`)}),P.jsx(Gl,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:Ee(`h-7 min-w-14 p-0 ${fp}`),type:"color",list:"presetColors"}),P.jsxs("datalist",{id:"presetColors",children:[P.jsx("option",{children:zt.green[600]}),P.jsx("option",{children:zt.red[500]}),P.jsx("option",{children:zt.yellow[400]}),P.jsx("option",{children:zt.orange[500]})]}),P.jsx(dr,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:P.jsx(yw,{className:"size-3"})})]},a))]})}const XJ=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=nr({prop:n,onChange:o,defaultProp:r});return m.createElement(Ue.button,le({type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:Re(e.onClick,()=>{e.disabled||a(!s)})}))}),Ok=XJ,QJ=Uw("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"}}),Gw=pe.forwardRef(({className:e,variant:t,size:n,...r},o)=>P.jsx(Ok,{ref:o,className:Ee(QJ({variant:t,size:n,className:e})),...r}));Gw.displayName=Ok.displayName;function JJ(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 ZJ(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 eZ(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 tZ(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 nZ(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 rZ(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 oZ(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 iZ({columnIndex:e,columnName:t}){const[n,r]=m.useState(!1),o=Sr(D=>{var I;return(I=D.card)==null?void 0:I.preferences}),[i,s]=m.useState(JJ(o,e)),[a,l]=m.useState(rZ(o,e)),[c,u]=m.useState(ZJ(o,e)),[f,p]=m.useState(eZ(o,e)),[g,v]=m.useState(tZ(o,e)),[b,x]=m.useState(nZ(o,e).toString()),[w,_]=m.useState(oZ(o,e));m.useState("");const S=Sr(D=>D.actions.setCardPreferences);function R(){const D=[...new Set(C0.map(I=>I.currency))];return P.jsx(P.Fragment,{children:P.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[P.jsx(zn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),P.jsxs(ps,{value:c,onValueChange:I=>u(I),children:[P.jsx(Ti,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:P.jsx(gs,{})}),P.jsx(ki,{children:P.jsxs(Fl,{children:[P.jsx(ba,{children:"Locale"}),C0.map(I=>P.jsx(Fn,{value:I.locale,children:I.locale},I.locale))]})})]}),P.jsx(zn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),P.jsxs(ps,{value:g||"none",onValueChange:I=>v(I==="none"?void 0:I),children:[P.jsx(Ti,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:P.jsx(gs,{})}),P.jsx(ki,{children:P.jsxs(Fl,{children:[P.jsx(ba,{children:"Currency"}),P.jsx(Fn,{value:"none",children:"None"}),D.map(I=>P.jsx(Fn,{value:I,children:I},I))]})})]}),P.jsx(zn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),P.jsxs(ps,{value:b,onValueChange:I=>x(I),children:[P.jsx(Ti,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:P.jsx(gs,{})}),P.jsx(ki,{children:["0","1","2","3","4"].map(I=>P.jsx(Fn,{value:I,children:I},I))})]}),!g&&P.jsx(Gw,{onPressedChange:I=>_(I),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:P.jsx(uY,{className:"size-3"})})]})})}function E(){return P.jsx(P.Fragment,{children:P.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[P.jsx(zn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),P.jsxs(ps,{defaultValue:"en-US",value:c,onValueChange:D=>u(D),children:[P.jsx(Ti,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:P.jsx(gs,{})}),P.jsx(ki,{children:W9.map(D=>P.jsxs(Fl,{children:[P.jsx(ba,{children:D.label}),D.locales.map(I=>P.jsx(Fn,{value:I.code,children:I.name},I.code))]},D.label))})]}),P.jsx(zn,{className:"col-span-3",htmlFor:"format",children:"Format"}),P.jsxs(ps,{defaultValue:"short-date-time",value:f,onValueChange:D=>{console.log("format",D),p(D)},children:[P.jsx(Ti,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:P.jsx(gs,{})}),P.jsx(ki,{className:"",id:"type",children:P.jsxs(Fl,{children:[P.jsx(ba,{children:"Option"}),P.jsx(Fn,{value:"full-date-time",children:"Full Date-Time"}),P.jsx(Fn,{value:"short-date-time",children:"Short Date-Time"}),P.jsx(Fn,{value:"hours-date-time",children:"24-Hour Date-Time"}),P.jsx(Fn,{value:"short-date",children:"Short Date"}),P.jsx(Fn,{value:"long-date",children:"Long Date"})]})})]})]})})}function O(){S({...o,columnSettings:[]})}function k(){var D;S({...o,columnSettings:[...((D=o==null?void 0:o.columnSettings)==null?void 0:D.filter(I=>I.columnIdx!==e))||[]]})}function M(){var D,I,z;if(i==="date"){const j=KJ(c,f),Q={columnIdx:e,type:i,options:j};S({...o,columnSettings:[...((D=o==null?void 0:o.columnSettings)==null?void 0:D.filter(U=>U.columnIdx!==e))||[],Q]})}else if(i==="number"){let j;g?j={locale:c,currency:g,options:{style:"currency",currency:g,minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0}:j={locale:c,currency:void 0,options:{style:w?"percent":"decimal",minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0};const Q={columnIdx:e,type:i,options:j};S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(U=>U.columnIdx!==e))||[],Q]})}else S({...o,columnSettings:[...((z=o==null?void 0:o.columnSettings)==null?void 0:z.filter(j=>j.columnIdx!==e))||[]]})}return P.jsxs(im,{onOpenChange:D=>r(D),children:[P.jsx(sm,{asChild:!0,children:P.jsx(bw,{className:"size-3.5 cursor-pointer text-muted"})}),P.jsx(ff,{align:"center",className:"max-w-70",children:P.jsxs("div",{className:"grid gap-4",children:[P.jsxs("div",{className:"space-y-2",children:[P.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),P.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),P.jsxs("div",{className:"grid gap-2",children:[P.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[P.jsx(zn,{htmlFor:"scale",children:"Type"}),P.jsxs(ps,{value:i||"none",onValueChange:D=>s(D),children:[P.jsx(Ti,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:P.jsx(gs,{})}),P.jsx(ki,{id:"type",children:P.jsxs(Fl,{children:[P.jsx(ba,{children:"Option"}),P.jsx(Fn,{value:"number",children:"Number"}),P.jsx(Fn,{value:"date",children:"Date"}),P.jsx(Fn,{value:"none",children:"None"})]})})]})]}),i==="number"&&R(),i==="date"&&E(),i==="number"&&P.jsxs(P.Fragment,{children:[P.jsx(eg,{}),P.jsx(Pk,{colorRanges:a,setColorRanges:l})]}),P.jsx(eg,{}),P.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[P.jsx(dr,{onClick:O,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),P.jsx(dr,{onClick:k,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),P.jsx(dr,{onClick:M,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function sZ(e){const t=new Date(e);return!isNaN(t.getTime())}function $k({data:e,card:t}){var R,E,O,k;const[n,r]=m.useState([]),{keys:o}=Xr(e),i=Te(M=>M.filteringCards),s=Te(M=>M.themeStyle),a=Te(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:f,removeFilterValue:p,removeFilteringCard:g}=Wi(),v=t==null?void 0:t.preferences;function b(M,D){if((D==null?void 0:D.type)==="date"&&sZ(M)){const{locale:I,options:z}=D.options,j=new Date(M);return new Date(j.getTime()).toLocaleDateString(I,z)}if((D==null?void 0:D.type)==="number"){const{locale:I,currency:z,options:j}=D.options;return z?new Intl.NumberFormat(I,{style:"currency",currency:z,...j}).format(M):new Intl.NumberFormat(I,j).format(M)}return M}const x=o.map((M,D)=>({accessorKey:M,header:({column:I})=>{const z=I.getIsSorted();return P.jsxs("div",{className:"flex items-center justify-between gap-2",children:[P.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:[M,z==="asc"?P.jsx(pw,{className:"ml-2 h-5 w-5"}):z==="desc"?P.jsx(hw,{className:"ml-2 h-5 w-5"}):null]}),a&&P.jsx(iZ,{columnName:I.id,columnIndex:D})]})},cell:({cell:I})=>{var B,K;const z=I.getValue(),j=(B=v==null?void 0:v.columnSettings)==null?void 0:B.find(H=>H.columnIdx===D),Q=b(z,j),U=RT(z,(K=j==null?void 0:j.options)==null?void 0:K.colorRanges);return P.jsx("div",{className:"px-2 py-1",style:{backgroundColor:U},children:Q})}})),w=GT({data:e,columns:x,getCoreRowModel:WT(),getPaginationRowModel:qT(),onSortingChange:r,getSortedRowModel:UT(),manualPagination:!0,state:{sorting:n}}),_=w.getSelectedRowModel().rows;m.useEffect(()=>{if(_.length===0){if(l){const M=t.id;p(M),g(t)}return}if(c){const{dimensionKeys:M}=Xr(e),D=c.map(I=>{const z=M==null?void 0:M[I.columnIndex],j=_.map(U=>U.getValue(z));return{filterId:t.id+"-"+z,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:z,expression:I.expression,valueType:Ju(j[0]===void 0?"":j[0]),operation:"in",values:j}});u(D),f(t)}},[f,u,t,e,l,c,p,g,_]);function S(M){M.toggleSelected()}return P.jsxs(Nw,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(E=s==null?void 0:s.chart)==null?void 0:E.options.borderRadius,borderTopLeftRadius:(O=s==null?void 0:s.chart)==null?void 0:O.options.borderRadius},onMouseDown:M=>M.stopPropagation(),children:[P.jsx(Lw,{children:w.getHeaderGroups().map(M=>P.jsx(Hu,{children:M.headers.map((D,I)=>{var z;return P.jsx(zw,{className:Ee("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":I>0&&I<M.headers.length-1,"border-l":I===1&&M.headers.length==2},(z=s==null?void 0:s.table)==null?void 0:z.tableHeaderColor),children:D.isPlaceholder?null:Py(D.column.columnDef.header,D.getContext())},D.id)})},M.id))}),P.jsx(Fw,{children:(k=w.getRowModel().rows)!=null&&k.length?w.getRowModel().rows.map((M,D)=>P.jsx(Hu,{onClick:()=>S(M),className:Ee("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((I,z)=>{var j;return P.jsx(Jp,{onClick:Q=>{var B;const U=((B=window==null?void 0:window.getSelection())==null?void 0:B.toString())||"";(U==null?void 0:U.length)>0&&Q.stopPropagation()},className:Ee("p-0",{"border-x":z>0&&z<x.length-1||z===1&&x.length==2,"border-l":z==0,"border-r":z===x.length-1,"border-b":D===((j=w.getRowModel().rows)==null?void 0:j.length)-1}),children:Py(I.column.columnDef.cell,I.getContext())},I.id)})},M.id)):P.jsx(Hu,{children:P.jsx(Jp,{colSpan:x.length,className:"p-1 text-center",children:"No results."})})})]})}function aZ({frame:e,footer:t,className:n,...r}){var Q,U,B,K;const{customCards:o}=el(),i=m.useRef(null),s=Te(H=>H.themeStyle),a=Te(H=>H.selectedSheetId),l=Te(H=>H.selectedFrameId),c=Te(H=>H.isDashboardEditing),u=e.cards.find(H=>H.id===e.activeCardId);iX(e,i);const{isError:f,isLoading:p,isFetching:g,cfg:v,visualKey:b,handleDatapointClick:x}=Tw(u),{setCardTitle:w,setCardDescription:_,setSelectedFrameId:S}=Wi(),{setSelectedConnectionId:R,setSelectedDatabaseName:E,setSelectedSchemaName:O,setSelectedTableName:k}=gw();function M(H){H.stopPropagation(),S(e.id),u!=null&&u.connectionId&&R(u==null?void 0:u.connectionId),u!=null&&u.lastSelectedDatabase&&E(u==null?void 0:u.lastSelectedDatabase),u!=null&&u.lastSelectedSchema&&O(u==null?void 0:u.lastSelectedSchema),u!=null&&u.lastSelectedTable&&k(u==null?void 0:u.lastSelectedTable)}function D(){if(o&&o.length>0){const H=o.find(q=>q.cardId===u.id);if(H&&H.replaceDefault){const q=H.content;if(q)return P.jsx(q,{card:u})}}return u.type==="kpi"?P.jsx(PT,{isLoading:p||g,card:u}):j}function I(){if(f)return P.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(u.type==="table"&&u.data&&u.data.length>0)return P.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:P.jsx($k,{card:u,data:u.data})});if(o&&o.length>0){const H=o.find(q=>q.cardId===u.id);if(H&&H.content){const q=H.content;return P.jsx(q,{card:u})}}if(v)return P.jsx(fw,{cfg:v,onDatapointClick:x},b)}function z(){if(o&&o.length>0){const H=o.find(q=>q.cardId===u.id);if(H&&H.footer){const q=H.footer;if(q)return P.jsx(q,{card:u})}}return t||null}if(!u.id)return null;const j=P.jsxs(P.Fragment,{children:[P.jsxs(wg,{className:"pb-4",children:[P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(Va,{text:u.title,onSave:H=>w(a,u.id,H),children:P.jsx(Zd,{className:"text-base",children:u.title})}),(c||u.info)&&P.jsx(vX,{card:u}),u.refreshInterval&&P.jsxs(CT,{children:[P.jsx(ET,{className:"pr-1",children:P.jsx("div",{className:Ee("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":p||g})})}),P.jsx($w,{side:"right",align:"center",children:P.jsx("p",{className:"text-xs",children:`Realtime (${u==null?void 0:u.refreshInterval})`})})]}),!u.refreshInterval&&(p||g)&&P.jsx(vw,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),P.jsx(Va,{text:(u==null?void 0:u.description)||"",onSave:H=>_(a,u.id,H),children:P.jsxs(bx,{children:[" ",u.description]})})]}),P.jsx(_g,{className:"relative flex grow flex-col",children:I()}),P.jsx(yx,{children:z()})]});return P.jsxs(vx,{tabIndex:-1,ref:i,role:"card-frame",onClick:M,style:{borderRadius:(U=(Q=s==null?void 0:s.chart)==null?void 0:Q.options)==null?void 0:U.borderRadius,fontFamily:(K=(B=s==null?void 0:s.chart)==null?void 0:B.font)==null?void 0:K.family},className:Ee("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":l===e.id&&c},s==null?void 0:s.dashboardCard,n,"semaphor-card-frame"),...r,children:[P.jsx(gY,{frame:e}),D()]})}const Yw=pe.forwardRef(({className:e,...t},n)=>P.jsx("textarea",{className:Ee("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}));Yw.displayName="Textarea";const ky="horizontal",lZ=["horizontal","vertical"],Dk=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=ky,...o}=e,i=Tk(r)?r:ky,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.createElement(Ue.div,le({"data-orientation":i},a,o,{ref:t}))});Dk.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!Tk(r)?new Error(cZ(o,n)):null}};function cZ(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
|
|
315
|
+
- horizontal
|
|
316
|
+
- vertical
|
|
317
|
+
|
|
318
|
+
Defaulting to \`${ky}\`.`}function Tk(e){return lZ.includes(e)}const kk=Dk,am=pe.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>P.jsx(kk,{ref:o,decorative:n,orientation:t,className:Ee("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));am.displayName=kk.displayName;function uZ({filter:e}){const[t,n]=m.useState(e.sql),[r,o]=m.useState(!1),{updateFilter:i}=Wi();function s(){const l={...e,sql:t};i(l),o(!1)}function a(l){console.log("operation",l);const c={...e,operation:l};i(c)}return P.jsxs(im,{open:r,onOpenChange:o,children:[P.jsx(sm,{children:P.jsx(bw,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),P.jsxs(ff,{onDoubleClick:l=>l.stopPropagation(),className:"m-2 w-full min-w-[350px] space-y-4",children:[P.jsxs("div",{className:"space-y-2",children:[P.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),P.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),P.jsx(am,{}),P.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[P.jsxs("div",{className:"col-span-2 space-y-1",children:[P.jsx(zn,{children:"Table Column"}),P.jsx(zn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),P.jsxs("div",{className:"col-span-2 space-y-1",children:[P.jsx(zn,{children:"Data Type"}),P.jsx(zn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),P.jsxs("div",{className:"col-span-2 space-y-1",children:[P.jsx(zn,{className:"text-sm",children:"Filter Operation"}),P.jsx(dZ,{updateFilterOperation:a,value:e.operation})]})]}),P.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[P.jsx(zn,{className:"text-sm",children:"Values SQL"}),P.jsx(Yw,{value:t,onChange:l=>n(l.target.value),className:`min-w-full grow resize font-mono text-xs ${fp}`})]}),P.jsx("div",{className:"flex justify-end gap-2",children:P.jsxs(dr,{onClick:s,size:"sm",variant:"outline",children:[P.jsx(af,{className:"mr-2 size-4"}),"Apply"]})})]})]})}function dZ({value:e,updateFilterOperation:t}){return P.jsxs(ps,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[P.jsx(Ti,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:P.jsx(gs,{placeholder:"Operation"})}),P.jsxs(ki,{children:[P.jsx(Fn,{value:"=",children:"Equals"}),P.jsx(Fn,{value:"in",children:"Contains"}),P.jsx(Fn,{value:"like",children:"Like"})]})]})}function $t(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 ro(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function ur(e,t){const n=$t(e);return isNaN(t)?ro(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function No(e,t){const n=$t(e);if(isNaN(t))return ro(e,NaN);if(!t)return n;const r=n.getDate(),o=ro(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}const Kw=6048e5,fZ=864e5;let hZ={};function hf(){return hZ}function si(e,t){var a,l,c,u;const n=hf(),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=$t(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 Ya(e){return si(e,{weekStartsOn:1})}function Mk(e){const t=$t(e),n=t.getFullYear(),r=ro(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Ya(r),i=ro(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=Ya(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Ec(e){const t=$t(e);return t.setHours(0,0,0,0),t}function tg(e){const t=$t(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 ei(e,t){const n=Ec(e),r=Ec(t),o=+n-tg(n),i=+r-tg(r);return Math.round((o-i)/fZ)}function pZ(e){const t=Mk(e),n=ro(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Ya(n)}function My(e,t){const n=t*7;return ur(e,n)}function gZ(e,t){return No(e,t*12)}function mZ(e){let t;return e.forEach(function(n){const r=$t(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function vZ(e){let t;return e.forEach(n=>{const r=$t(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function Pr(e,t){const n=Ec(e),r=Ec(t);return+n==+r}function Xw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function bZ(e){if(!Xw(e)&&typeof e!="number")return!1;const t=$t(e);return!isNaN(Number(t))}function fd(e,t){const n=$t(e),r=$t(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function yZ(e,t,n){const r=si(e,n),o=si(t,n),i=+r-tg(r),s=+o-tg(o);return Math.round((i-s)/Kw)}function Qw(e){const t=$t(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function $r(e){const t=$t(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Ak(e){const t=$t(e),n=ro(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Jw(e,t){var a,l,c,u;const n=hf(),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=$t(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 Ik(e){return Jw(e,{weekStartsOn:1})}const xZ={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"}},wZ=(e,t,n)=>{let r;const o=xZ[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 kb(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const _Z={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},SZ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},CZ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},EZ={date:kb({formats:_Z,defaultWidth:"full"}),time:kb({formats:SZ,defaultWidth:"full"}),dateTime:kb({formats:CZ,defaultWidth:"full"})},RZ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},PZ=(e,t,n,r)=>RZ[e];function bu(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 OZ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$Z={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DZ={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"]},TZ={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"]},kZ={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"}},MZ={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"}},AZ=(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"},IZ={ordinalNumber:AZ,era:bu({values:OZ,defaultWidth:"wide"}),quarter:bu({values:$Z,defaultWidth:"wide",argumentCallback:e=>e-1}),month:bu({values:DZ,defaultWidth:"wide"}),day:bu({values:TZ,defaultWidth:"wide"}),dayPeriod:bu({values:kZ,defaultWidth:"wide",formattingValues:MZ,defaultFormattingWidth:"wide"})};function yu(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)?LZ(a,f=>f.test(s)):NZ(a,f=>f.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 NZ(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function LZ(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function FZ(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 zZ=/^(\d+)(th|st|nd|rd)?/i,jZ=/\d+/i,BZ={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},VZ={any:[/^b/i,/^(a|c)/i]},HZ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},WZ={any:[/1/i,/2/i,/3/i,/4/i]},UZ={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},qZ={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]},GZ={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},YZ={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]},KZ={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},XZ={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},QZ={ordinalNumber:FZ({matchPattern:zZ,parsePattern:jZ,valueCallback:e=>parseInt(e,10)}),era:yu({matchPatterns:BZ,defaultMatchWidth:"wide",parsePatterns:VZ,defaultParseWidth:"any"}),quarter:yu({matchPatterns:HZ,defaultMatchWidth:"wide",parsePatterns:WZ,defaultParseWidth:"any",valueCallback:e=>e+1}),month:yu({matchPatterns:UZ,defaultMatchWidth:"wide",parsePatterns:qZ,defaultParseWidth:"any"}),day:yu({matchPatterns:GZ,defaultMatchWidth:"wide",parsePatterns:YZ,defaultParseWidth:"any"}),dayPeriod:yu({matchPatterns:KZ,defaultMatchWidth:"any",parsePatterns:XZ,defaultParseWidth:"any"})},Nk={code:"en-US",formatDistance:wZ,formatLong:EZ,formatRelative:PZ,localize:IZ,match:QZ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function JZ(e){const t=$t(e);return ei(t,Ak(t))+1}function Lk(e){const t=$t(e),n=+Ya(t)-+pZ(t);return Math.round(n/Kw)+1}function Fk(e,t){var u,f,p,g;const n=$t(e),r=n.getFullYear(),o=hf(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((g=(p=o.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??1,s=ro(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=si(s,t),l=ro(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=si(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function ZZ(e,t){var a,l,c,u;const n=hf(),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=Fk(e,t),i=ro(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),si(i,t)}function zk(e,t){const n=$t(e),r=+si(n,t)-+ZZ(n,t);return Math.round(r/Kw)+1}function Vt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ls={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Vt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Vt(n+1,2)},d(e,t){return Vt(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 Vt(e.getHours()%12||12,t.length)},H(e,t){return Vt(e.getHours(),t.length)},m(e,t){return Vt(e.getMinutes(),t.length)},s(e,t){return Vt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Vt(o,t.length)}},Tl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},y2={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 ls.y(e,t)},Y:function(e,t,n,r){const o=Fk(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return Vt(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Vt(i,t.length)},R:function(e,t){const n=Mk(e);return Vt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Vt(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 Vt(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 Vt(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 ls.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 Vt(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=zk(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Vt(o,t.length)},I:function(e,t,n){const r=Lk(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Vt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ls.d(e,t)},D:function(e,t,n){const r=JZ(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Vt(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 Vt(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 Vt(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 Vt(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=Tl.noon:r===0?o=Tl.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=Tl.evening:r>=12?o=Tl.afternoon:r>=4?o=Tl.morning:o=Tl.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 ls.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ls.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Vt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Vt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ls.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ls.s(e,t)},S:function(e,t){return ls.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return w2(r);case"XXXX":case"XX":return va(r);case"XXXXX":case"XXX":default:return va(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return w2(r);case"xxxx":case"xx":return va(r);case"xxxxx":case"xxx":default:return va(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+x2(r,":");case"OOOO":default:return"GMT"+va(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+x2(r,":");case"zzzz":default:return"GMT"+va(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Vt(r,t.length)},T:function(e,t,n){const r=e.getTime();return Vt(r,t.length)}};function x2(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+Vt(i,2)}function w2(e,t){return e%60===0?(e>0?"-":"+")+Vt(Math.abs(e)/60,2):va(e,t)}function va(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Vt(Math.trunc(r/60),2),i=Vt(r%60,2);return n+o+t+i}const _2=(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"})}},jk=(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"})}},eee=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return _2(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}}",_2(r,t)).replace("{{time}}",jk(o,t))},tee={p:jk,P:eee},nee=/^D+$/,ree=/^Y+$/,oee=["D","DD","YY","YYYY"];function iee(e){return nee.test(e)}function see(e){return ree.test(e)}function aee(e,t,n){const r=lee(e,t,n);if(console.warn(r),oee.includes(e))throw new RangeError(r)}function lee(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 cee=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uee=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dee=/^'([^]*?)'?$/,fee=/''/g,hee=/[a-zA-Z]/;function ni(e,t,n){var u,f,p,g,v,b,x,w;const r=hf(),o=(n==null?void 0:n.locale)??r.locale??Nk,i=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((g=(p=r.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((b=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:b.weekStartsOn)??r.weekStartsOn??((w=(x=r.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,a=$t(e);if(!bZ(a))throw new RangeError("Invalid time value");let l=t.match(uee).map(_=>{const S=_[0];if(S==="p"||S==="P"){const R=tee[S];return R(_,o.formatLong)}return _}).join("").match(cee).map(_=>{if(_==="''")return{isToken:!1,value:"'"};const S=_[0];if(S==="'")return{isToken:!1,value:pee(_)};if(y2[S])return{isToken:!0,value:_};if(S.match(hee))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:_}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(_=>{if(!_.isToken)return _.value;const S=_.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&see(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&iee(S))&&aee(S,t,String(e));const R=y2[S[0]];return R(a,S,o.localize,c)}).join("")}function pee(e){const t=e.match(dee);return t?t[1].replace(fee,"'"):e}function gee(e){const t=$t(e),n=t.getFullYear(),r=t.getMonth(),o=ro(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function mee(e){return Math.trunc(+$t(e)/1e3)}function vee(e){const t=$t(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function bee(e,t){return yZ(vee(e),$r(e),t)+1}function Ay(e,t){const n=$t(e),r=$t(t);return n.getTime()>r.getTime()}function Bk(e,t){const n=$t(e),r=$t(t);return+n<+r}function Zw(e,t){const n=$t(e),r=$t(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function yee(e,t){const n=$t(e),r=$t(t);return n.getFullYear()===r.getFullYear()}function Mb(e,t){return ur(e,-t)}function Ab(e,t){const n=$t(e),r=n.getFullYear(),o=n.getDate(),i=ro(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=gee(i);return n.setMonth(t,Math.min(o,s)),n}function S2(e,t){const n=$t(e);return isNaN(+n)?ro(e,NaN):(n.setFullYear(t),n)}var Qe=function(){return Qe=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},Qe.apply(this,arguments)};function xee(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 Vk(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 Iy={exports:{}},xu={};/**
|
|
319
|
+
* @license React
|
|
320
|
+
* react-jsx-runtime.development.js
|
|
321
|
+
*
|
|
322
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the MIT license found in the
|
|
325
|
+
* LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/var C2;function wee(){return C2||(C2=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function x($){if($===null||typeof $!="object")return null;var J=v&&$[v]||$[b];return typeof J=="function"?J:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _($){{for(var J=arguments.length,ce=new Array(J>1?J-1:0),Ce=1;Ce<J;Ce++)ce[Ce-1]=arguments[Ce];S("error",$,ce)}}function S($,J,ce){{var Ce=w.ReactDebugCurrentFrame,je=Ce.getStackAddendum();je!==""&&(J+="%s",ce=ce.concat([je]));var He=ce.map(function(Ne){return String(Ne)});He.unshift("Warning: "+J),Function.prototype.apply.call(console[$],console,He)}}var R=!1,E=!1,O=!1,k=!1,M=!1,D;D=Symbol.for("react.module.reference");function I($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===i||M||$===o||$===c||$===u||k||$===g||R||E||O||typeof $=="object"&&$!==null&&($.$$typeof===p||$.$$typeof===f||$.$$typeof===s||$.$$typeof===a||$.$$typeof===l||$.$$typeof===D||$.getModuleId!==void 0))}function z($,J,ce){var Ce=$.displayName;if(Ce)return Ce;var je=J.displayName||J.name||"";return je!==""?ce+"("+je+")":ce}function j($){return $.displayName||"Context"}function Q($){if($==null)return null;if(typeof $.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof $=="function")return $.displayName||$.name||null;if(typeof $=="string")return $;switch($){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof $=="object")switch($.$$typeof){case a:var J=$;return j(J)+".Consumer";case s:var ce=$;return j(ce._context)+".Provider";case l:return z($,$.render,"ForwardRef");case f:var Ce=$.displayName||null;return Ce!==null?Ce:Q($.type)||"Memo";case p:{var je=$,He=je._payload,Ne=je._init;try{return Q(Ne(He))}catch{return null}}}return null}var U=Object.assign,B=0,K,H,q,Z,T,V,X;function N(){}N.__reactDisabledLog=!0;function se(){{if(B===0){K=console.log,H=console.info,q=console.warn,Z=console.error,T=console.group,V=console.groupCollapsed,X=console.groupEnd;var $={configurable:!0,enumerable:!0,value:N,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}B++}}function ae(){{if(B--,B===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},$,{value:K}),info:U({},$,{value:H}),warn:U({},$,{value:q}),error:U({},$,{value:Z}),group:U({},$,{value:T}),groupCollapsed:U({},$,{value:V}),groupEnd:U({},$,{value:X})})}B<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=w.ReactCurrentDispatcher,fe;function oe($,J,ce){{if(fe===void 0)try{throw Error()}catch(je){var Ce=je.stack.trim().match(/\n( *(at )?)/);fe=Ce&&Ce[1]||""}return`
|
|
327
|
+
`+fe+$}}var ee=!1,ie;{var be=typeof WeakMap=="function"?WeakMap:Map;ie=new be}function G($,J){if(!$||ee)return"";{var ce=ie.get($);if(ce!==void 0)return ce}var Ce;ee=!0;var je=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var He;He=ue.current,ue.current=null,se();try{if(J){var Ne=function(){throw Error()};if(Object.defineProperty(Ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ne,[])}catch(dn){Ce=dn}Reflect.construct($,[],Ne)}else{try{Ne.call()}catch(dn){Ce=dn}$.call(Ne.prototype)}}else{try{throw Error()}catch(dn){Ce=dn}$()}}catch(dn){if(dn&&Ce&&typeof dn.stack=="string"){for(var Me=dn.stack.split(`
|
|
328
|
+
`),Ot=Ce.stack.split(`
|
|
329
|
+
`),nt=Me.length-1,it=Ot.length-1;nt>=1&&it>=0&&Me[nt]!==Ot[it];)it--;for(;nt>=1&&it>=0;nt--,it--)if(Me[nt]!==Ot[it]){if(nt!==1||it!==1)do if(nt--,it--,it<0||Me[nt]!==Ot[it]){var Ut=`
|
|
330
|
+
`+Me[nt].replace(" at new "," at ");return $.displayName&&Ut.includes("<anonymous>")&&(Ut=Ut.replace("<anonymous>",$.displayName)),typeof $=="function"&&ie.set($,Ut),Ut}while(nt>=1&&it>=0);break}}}finally{ee=!1,ue.current=He,ae(),Error.prepareStackTrace=je}var In=$?$.displayName||$.name:"",Xs=In?oe(In):"";return typeof $=="function"&&ie.set($,Xs),Xs}function me($,J,ce){return G($,!1)}function _e($){var J=$.prototype;return!!(J&&J.isReactComponent)}function Pe($,J,ce){if($==null)return"";if(typeof $=="function")return G($,_e($));if(typeof $=="string")return oe($);switch($){case c:return oe("Suspense");case u:return oe("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case l:return me($.render);case f:return Pe($.type,J,ce);case p:{var Ce=$,je=Ce._payload,He=Ce._init;try{return Pe(He(je),J,ce)}catch{}}}return""}var $e=Object.prototype.hasOwnProperty,Ve={},Fe=w.ReactDebugCurrentFrame;function ke($){if($){var J=$._owner,ce=Pe($.type,$._source,J?J.type:null);Fe.setExtraStackFrame(ce)}else Fe.setExtraStackFrame(null)}function Ge($,J,ce,Ce,je){{var He=Function.call.bind($e);for(var Ne in $)if(He($,Ne)){var Me=void 0;try{if(typeof $[Ne]!="function"){var Ot=Error((Ce||"React class")+": "+ce+" type `"+Ne+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[Ne]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ot.name="Invariant Violation",Ot}Me=$[Ne](J,Ne,Ce,ce,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(nt){Me=nt}Me&&!(Me instanceof Error)&&(ke(je),_("%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).",Ce||"React class",ce,Ne,typeof Me),ke(null)),Me instanceof Error&&!(Me.message in Ve)&&(Ve[Me.message]=!0,ke(je),_("Failed %s type: %s",ce,Me.message),ke(null))}}}var ct=Array.isArray;function kt($){return ct($)}function Dt($){{var J=typeof Symbol=="function"&&Symbol.toStringTag,ce=J&&$[Symbol.toStringTag]||$.constructor.name||"Object";return ce}}function cn($){try{return de($),!1}catch{return!0}}function de($){return""+$}function Se($){if(cn($))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dt($)),de($)}var Ie=w.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},Je,Gt,Jt;Jt={};function un($){if($e.call($,"ref")){var J=Object.getOwnPropertyDescriptor($,"ref").get;if(J&&J.isReactWarning)return!1}return $.ref!==void 0}function Pn($){if($e.call($,"key")){var J=Object.getOwnPropertyDescriptor($,"key").get;if(J&&J.isReactWarning)return!1}return $.key!==void 0}function or($,J){if(typeof $.ref=="string"&&Ie.current&&J&&Ie.current.stateNode!==J){var ce=Q(Ie.current.type);Jt[ce]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Q(Ie.current.type),$.ref),Jt[ce]=!0)}}function Zt($,J){{var ce=function(){Je||(Je=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",J))};ce.isReactWarning=!0,Object.defineProperty($,"key",{get:ce,configurable:!0})}}function hn($,J){{var ce=function(){Gt||(Gt=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",J))};ce.isReactWarning=!0,Object.defineProperty($,"ref",{get:ce,configurable:!0})}}var On=function($,J,ce,Ce,je,He,Ne){var Me={$$typeof:t,type:$,key:J,ref:ce,props:Ne,_owner:He};return Me._store={},Object.defineProperty(Me._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Me,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ce}),Object.defineProperty(Me,"_source",{configurable:!1,enumerable:!1,writable:!1,value:je}),Object.freeze&&(Object.freeze(Me.props),Object.freeze(Me)),Me};function Ze($,J,ce,Ce,je){{var He,Ne={},Me=null,Ot=null;ce!==void 0&&(Se(ce),Me=""+ce),Pn(J)&&(Se(J.key),Me=""+J.key),un(J)&&(Ot=J.ref,or(J,je));for(He in J)$e.call(J,He)&&!qe.hasOwnProperty(He)&&(Ne[He]=J[He]);if($&&$.defaultProps){var nt=$.defaultProps;for(He in nt)Ne[He]===void 0&&(Ne[He]=nt[He])}if(Me||Ot){var it=typeof $=="function"?$.displayName||$.name||"Unknown":$;Me&&Zt(Ne,it),Ot&&hn(Ne,it)}return On($,Me,Ot,je,Ce,Ie.current,Ne)}}var Et=w.ReactCurrentOwner,Pt=w.ReactDebugCurrentFrame;function Wt($){if($){var J=$._owner,ce=Pe($.type,$._source,J?J.type:null);Pt.setExtraStackFrame(ce)}else Pt.setExtraStackFrame(null)}var yn;yn=!1;function fr($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function hi(){{if(Et.current){var $=Q(Et.current.type);if($)return`
|
|
331
|
+
|
|
332
|
+
Check the render method of \``+$+"`."}return""}}function zc($){{if($!==void 0){var J=$.fileName.replace(/^.*[\\\/]/,""),ce=$.lineNumber;return`
|
|
333
|
+
|
|
334
|
+
Check your code at `+J+":"+ce+"."}return""}}var Ws={};function ll($){{var J=hi();if(!J){var ce=typeof $=="string"?$:$.displayName||$.name;ce&&(J=`
|
|
335
|
+
|
|
336
|
+
Check the top-level render call using <`+ce+">.")}return J}}function Us($,J){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var ce=ll(J);if(Ws[ce])return;Ws[ce]=!0;var Ce="";$&&$._owner&&$._owner!==Et.current&&(Ce=" It was passed a child from "+Q($._owner.type)+"."),Wt($),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ce,Ce),Wt(null)}}function qs($,J){{if(typeof $!="object")return;if(kt($))for(var ce=0;ce<$.length;ce++){var Ce=$[ce];fr(Ce)&&Us(Ce,J)}else if(fr($))$._store&&($._store.validated=!0);else if($){var je=x($);if(typeof je=="function"&&je!==$.entries)for(var He=je.call($),Ne;!(Ne=He.next()).done;)fr(Ne.value)&&Us(Ne.value,J)}}}function jc($){{var J=$.type;if(J==null||typeof J=="string")return;var ce;if(typeof J=="function")ce=J.propTypes;else if(typeof J=="object"&&(J.$$typeof===l||J.$$typeof===f))ce=J.propTypes;else return;if(ce){var Ce=Q(J);Ge(ce,$.props,"prop",Ce,$)}else if(J.PropTypes!==void 0&&!yn){yn=!0;var je=Q(J);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",je||"Unknown")}typeof J.getDefaultProps=="function"&&!J.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Gs($){{for(var J=Object.keys($.props),ce=0;ce<J.length;ce++){var Ce=J[ce];if(Ce!=="children"&&Ce!=="key"){Wt($),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ce),Wt(null);break}}$.ref!==null&&(Wt($),_("Invalid attribute `ref` supplied to `React.Fragment`."),Wt(null))}}function Ys($,J,ce,Ce,je,He){{var Ne=I($);if(!Ne){var Me="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(Me+=" 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 Ot=zc(je);Ot?Me+=Ot:Me+=hi();var nt;$===null?nt="null":kt($)?nt="array":$!==void 0&&$.$$typeof===t?(nt="<"+(Q($.type)||"Unknown")+" />",Me=" Did you accidentally export a JSX literal instead of a component?"):nt=typeof $,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",nt,Me)}var it=Ze($,J,ce,je,He);if(it==null)return it;if(Ne){var Ut=J.children;if(Ut!==void 0)if(Ce)if(kt(Ut)){for(var In=0;In<Ut.length;In++)qs(Ut[In],$);Object.freeze&&Object.freeze(Ut)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else qs(Ut,$)}return $===r?Gs(it):jc(it),it}}function Ks($,J,ce){return Ys($,J,ce,!0)}function Bc($,J,ce){return Ys($,J,ce,!1)}var Vc=Bc,Hc=Ks;xu.Fragment=r,xu.jsx=Vc,xu.jsxs=Hc}()),xu}var wu={};/**
|
|
337
|
+
* @license React
|
|
338
|
+
* react-jsx-runtime.production.min.js
|
|
339
|
+
*
|
|
340
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
341
|
+
*
|
|
342
|
+
* This source code is licensed under the MIT license found in the
|
|
343
|
+
* LICENSE file in the root directory of this source tree.
|
|
344
|
+
*/var E2;function _ee(){if(E2)return wu;E2=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},p=null,g=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(g=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:p,ref:g,props:f,_owner:o.current}}return wu.Fragment=n,wu.jsx=s,wu.jsxs=s,wu}process.env.NODE_ENV==="production"?Iy.exports=_ee():Iy.exports=wee();var xe=Iy.exports;function pf(e){return e.mode==="multiple"}function gf(e){return e.mode==="range"}function lm(e){return e.mode==="single"}var See={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 Cee(e,t){return ni(e,"LLLL y",t)}function Eee(e,t){return ni(e,"d",t)}function Ree(e,t){return ni(e,"LLLL",t)}function Pee(e){return"".concat(e)}function Oee(e,t){return ni(e,"cccccc",t)}function $ee(e,t){return ni(e,"yyyy",t)}var Dee=Object.freeze({__proto__:null,formatCaption:Cee,formatDay:Eee,formatMonthCaption:Ree,formatWeekNumber:Pee,formatWeekdayName:Oee,formatYearCaption:$ee}),Tee=function(e,t,n){return ni(e,"do MMMM (EEEE)",n)},kee=function(){return"Month: "},Mee=function(){return"Go to next month"},Aee=function(){return"Go to previous month"},Iee=function(e,t){return ni(e,"cccc",t)},Nee=function(e){return"Week n. ".concat(e)},Lee=function(){return"Year: "},Fee=Object.freeze({__proto__:null,labelDay:Tee,labelMonthDropdown:kee,labelNext:Mee,labelPrevious:Aee,labelWeekNumber:Nee,labelWeekday:Iee,labelYearDropdown:Lee});function zee(){var e="buttons",t=See,n=Nk,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:Dee,labels:Fee,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function jee(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=$r(r):t&&(i=new Date(t,0,1)),o?s=Qw(o):n&&(s=new Date(n,11,31)),{fromDate:i?Ec(i):void 0,toDate:s?Ec(s):void 0}}var Hk=m.createContext(void 0);function Bee(e){var t,n=e.initialProps,r=zee(),o=jee(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;(lm(n)||pf(n)||gf(n))&&(l=n.onSelect);var c=Qe(Qe(Qe({},r),n),{captionLayout:a,classNames:Qe(Qe({},r.classNames),n.classNames),components:Qe({},n.components),formatters:Qe(Qe({},r.formatters),n.formatters),fromDate:i,labels:Qe(Qe({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Qe(Qe({},r.modifiers),n.modifiers),modifiersClassNames:Qe(Qe({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Qe(Qe({},r.styles),n.styles),toDate:s});return xe.jsx(Hk.Provider,{value:c,children:e.children})}function Qt(){var e=m.useContext(Hk);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function Wk(e){var t=Qt(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return xe.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 Vee(e){return xe.jsx("svg",Qe({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:xe.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 Uk(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,c=Qt(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Vee;return xe.jsxs("div",{className:a,style:l,children:[xe.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),xe.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),xe.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,xe.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function Hee(e){var t,n=Qt(),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 xe.jsx(xe.Fragment,{});if(!o)return xe.jsx(xe.Fragment,{});var f=[];if(yee(r,o))for(var p=$r(r),g=r.getMonth();g<=o.getMonth();g++)f.push(Ab(p,g));else for(var p=$r(new Date),g=0;g<=11;g++)f.push(Ab(p,g));var v=function(x){var w=Number(x.target.value),_=Ab($r(e.displayMonth),w);e.onChange(_)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Uk;return xe.jsx(b,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(x){return xe.jsx("option",{value:x.getMonth(),children:a(x,{locale:s})},x.getMonth())})})}function Wee(e){var t,n=e.displayMonth,r=Qt(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,p=[];if(!o)return xe.jsx(xe.Fragment,{});if(!i)return xe.jsx(xe.Fragment,{});for(var g=o.getFullYear(),v=i.getFullYear(),b=g;b<=v;b++)p.push(S2(Ak(new Date),b));var x=function(_){var S=S2($r(n),Number(_.target.value));e.onChange(S)},w=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Uk;return xe.jsx(w,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:x,value:n.getFullYear(),caption:u(n,{locale:s}),children:p.map(function(_){return xe.jsx("option",{value:_.getFullYear(),children:u(_,{locale:s})},_.getFullYear())})})}function Uee(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function qee(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&&fd(i,o)<0){var c=-1*(l-1);o=No(i,c)}return s&&fd(o,s)<0&&(o=s),$r(o)}function Gee(){var e=Qt(),t=qee(e),n=Uee(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=$r(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function Yee(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=$r(e),i=$r(No(o,r)),s=fd(i,o),a=[],l=0;l<s;l++){var c=No(o,l);a.push(c)}return n&&(a=a.reverse()),a}function Kee(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=$r(e);if(!n)return No(a,s);var l=fd(n,e);if(!(l<i))return No(a,s)}}function Xee(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=$r(e);if(!n)return No(a,-s);var l=fd(a,n);if(!(l<=0))return No(a,-s)}}var qk=m.createContext(void 0);function Qee(e){var t=Qt(),n=Gee(),r=n[0],o=n[1],i=Yee(r,t),s=Kee(r,t),a=Xee(r,t),l=function(f){return i.some(function(p){return Zw(f,p)})},c=function(f,p){l(f)||(p&&Bk(f,p)?o(No(f,1+t.numberOfMonths*-1)):o(f))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return xe.jsx(qk.Provider,{value:u,children:e.children})}function mf(){var e=m.useContext(qk);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function R2(e){var t,n=Qt(),r=n.classNames,o=n.styles,i=n.components,s=mf().goToMonth,a=function(u){s(No(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:Wk,c=xe.jsx(l,{id:e.id,displayMonth:e.displayMonth});return xe.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[xe.jsx("div",{className:r.vhidden,children:c}),xe.jsx(Hee,{onChange:a,displayMonth:e.displayMonth}),xe.jsx(Wee,{onChange:a,displayMonth:e.displayMonth})]})}function Jee(e){return xe.jsx("svg",Qe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:xe.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 Zee(e){return xe.jsx("svg",Qe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:xe.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 ng=m.forwardRef(function(e,t){var n=Qt(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=Qe(Qe({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),xe.jsx("button",Qe({},e,{ref:t,type:"button",className:s,style:a}))});function ete(e){var t,n,r=Qt(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return xe.jsx(xe.Fragment,{});var p=c(e.previousMonth,{locale:i}),g=[s.nav_button,s.nav_button_previous].join(" "),v=u(e.nextMonth,{locale:i}),b=[s.nav_button,s.nav_button_next].join(" "),x=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:Zee,w=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:Jee;return xe.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&xe.jsx(ng,{name:"previous-month","aria-label":p,className:g,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?xe.jsx(x,{className:s.nav_icon,style:a.nav_icon}):xe.jsx(w,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&xe.jsx(ng,{name:"next-month","aria-label":v,className:b,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?xe.jsx(w,{className:s.nav_icon,style:a.nav_icon}):xe.jsx(x,{className:s.nav_icon,style:a.nav_icon})})]})}function P2(e){var t=Qt().numberOfMonths,n=mf(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(v){return Zw(e.displayMonth,v)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),f=t>1&&(c||!l),p=function(){r&&i(r)},g=function(){o&&i(o)};return xe.jsx(ete,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:f,nextMonth:o,previousMonth:r,onPreviousClick:p,onNextClick:g})}function tte(e){var t,n=Qt(),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:Wk,c;return o?c=xe.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=xe.jsx(R2,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=xe.jsxs(xe.Fragment,{children:[xe.jsx(R2,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),xe.jsx(P2,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=xe.jsxs(xe.Fragment,{children:[xe.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),xe.jsx(P2,{displayMonth:e.displayMonth,id:e.id})]}),xe.jsx("div",{className:r.caption,style:i.caption,children:c})}function nte(e){var t=Qt(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?xe.jsx("tfoot",{className:o,style:r.tfoot,children:xe.jsx("tr",{children:xe.jsx("td",{colSpan:8,children:n})})}):xe.jsx(xe.Fragment,{})}function rte(e,t,n){for(var r=n?Ya(new Date):si(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=ur(r,i);o.push(s)}return o}function ote(){var e=Qt(),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=rte(o,i,s);return xe.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&xe.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,f){return xe.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:a(u,{locale:o})},f)})]})}function ite(){var e,t=Qt(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:ote;return xe.jsx("thead",{style:r.head,className:n.head,children:xe.jsx(i,{})})}function ste(e){var t=Qt(),n=t.locale,r=t.formatters.formatDay;return xe.jsx(xe.Fragment,{children:r(e.date,{locale:n})})}var e1=m.createContext(void 0);function ate(e){if(!pf(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return xe.jsx(e1.Provider,{value:t,children:e.children})}return xe.jsx(lte,{initialProps:e.initialProps,children:e.children})}function lte(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,u,f){var p,g;(p=t.onDayClick)===null||p===void 0||p.call(t,c,u,f);var v=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!v){var b=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!b){var x=r?Vk([],r,!0):[];if(u.selected){var w=x.findIndex(function(_){return Pr(c,_)});x.splice(w,1)}else x.push(c);(g=t.onSelect)===null||g===void 0||g.call(t,x,c,u,f)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=i&&r.length>i-1,f=r.some(function(p){return Pr(p,c)});return!!(u&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return xe.jsx(e1.Provider,{value:l,children:n})}function t1(){var e=m.useContext(e1);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function cte(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?Pr(o,e)&&Pr(r,e)?void 0:Pr(o,e)?{from:o,to:void 0}:Pr(r,e)?void 0:Ay(r,e)?{from:e,to:o}:{from:r,to:e}:o?Ay(e,o)?{from:o,to:e}:{from:e,to:o}:r?Bk(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var n1=m.createContext(void 0);function ute(e){if(!gf(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return xe.jsx(n1.Provider,{value:t,children:e.children})}return xe.jsx(dte,{initialProps:e.initialProps,children:e.children})}function dte(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(g,v,b){var x,w;(x=t.onDayClick)===null||x===void 0||x.call(t,g,v,b);var _=cte(g,r);(w=t.onSelect)===null||w===void 0||w.call(t,_,g,v,b)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],Pr(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:Mb(i,a-1),before:ur(i,a-1)}),i&&s&&u.disabled.push({after:i,before:ur(i,a-1)}),!i&&s&&u.disabled.push({after:Mb(s,a-1),before:ur(s,a-1)})),l){if(i&&!s&&(u.disabled.push({before:ur(i,-l+1)}),u.disabled.push({after:ur(i,l-1)})),i&&s){var f=ei(s,i)+1,p=l-f;u.disabled.push({before:Mb(i,p)}),u.disabled.push({after:ur(s,p)})}!i&&s&&(u.disabled.push({before:ur(s,-l+1)}),u.disabled.push({after:ur(s,l-1)}))}return xe.jsx(n1.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function r1(){var e=m.useContext(n1);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Cp(e){return Array.isArray(e)?Vk([],e,!0):e!==void 0?[e]:[]}function fte(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=Cp(o)}),t}var Lo;(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"})(Lo||(Lo={}));var hte=Lo.Selected,Ei=Lo.Disabled,pte=Lo.Hidden,gte=Lo.Today,Ib=Lo.RangeEnd,Nb=Lo.RangeMiddle,Lb=Lo.RangeStart,mte=Lo.Outside;function vte(e,t,n){var r,o=(r={},r[hte]=Cp(e.selected),r[Ei]=Cp(e.disabled),r[pte]=Cp(e.hidden),r[gte]=[e.today],r[Ib]=[],r[Nb]=[],r[Lb]=[],r[mte]=[],r);return e.fromDate&&o[Ei].push({before:e.fromDate}),e.toDate&&o[Ei].push({after:e.toDate}),pf(e)?o[Ei]=o[Ei].concat(t.modifiers[Ei]):gf(e)&&(o[Ei]=o[Ei].concat(n.modifiers[Ei]),o[Lb]=n.modifiers[Lb],o[Nb]=n.modifiers[Nb],o[Ib]=n.modifiers[Ib]),o}var Gk=m.createContext(void 0);function bte(e){var t=Qt(),n=t1(),r=r1(),o=vte(t,n,r),i=fte(t.modifiers),s=Qe(Qe({},o),i);return xe.jsx(Gk.Provider,{value:s,children:e.children})}function Yk(){var e=m.useContext(Gk);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function yte(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function xte(e){return!!(e&&typeof e=="object"&&"from"in e)}function wte(e){return!!(e&&typeof e=="object"&&"after"in e)}function _te(e){return!!(e&&typeof e=="object"&&"before"in e)}function Ste(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Cte(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=ei(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=ei(e,r)>=0&&ei(o,e)>=0;return s}return o?Pr(o,e):r?Pr(r,e):!1}function Ete(e){return Xw(e)}function Rte(e){return Array.isArray(e)&&e.every(Xw)}function Pte(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Ete(n))return Pr(e,n);if(Rte(n))return n.includes(e);if(xte(n))return Cte(e,n);if(Ste(n))return n.dayOfWeek.includes(e.getDay());if(yte(n)){var r=ei(n.before,e),o=ei(n.after,e),i=r>0,s=o<0,a=Ay(n.before,n.after);return a?s&&i:i||s}return wte(n)?ei(e,n.after)>0:_te(n)?ei(n.before,e)>0:typeof n=="function"?n(e):!1})}function o1(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return Pte(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!Zw(e,n)&&(o.outside=!0),o}function Ote(e,t){for(var n=$r(e[0]),r=Qw(e[e.length-1]),o,i,s=n;s<=r;){var a=o1(s,t),l=!a.disabled&&!a.hidden;if(!l){s=ur(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=ur(s,1)}return i||o}var $te=365;function Kk(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,f=o.locale,p={day:ur,week:My,month:No,year:gZ,startOfWeek:function(x){return o.ISOWeek?Ya(x):si(x,{locale:f,weekStartsOn:l})},endOfWeek:function(x){return o.ISOWeek?Ik(x):Jw(x,{locale:f,weekStartsOn:l})}},g=p[n](e,r==="after"?1:-1);r==="before"&&c?g=mZ([c,g]):r==="after"&&u&&(g=vZ([u,g]));var v=!0;if(i){var b=o1(g,i);v=!b.disabled&&!b.hidden}return v?g:a.count>$te?a.lastFocused:Kk(g,{moveBy:n,direction:r,context:o,modifiers:i,retry:Qe(Qe({},a),{count:a.count+1})})}var Xk=m.createContext(void 0);function Dte(e){var t=mf(),n=Yk(),r=m.useState(),o=r[0],i=r[1],s=m.useState(),a=s[0],l=s[1],c=Ote(t.displayMonths,n),u=o??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(o),i(void 0)},p=function(x){i(x)},g=Qt(),v=function(x,w){if(o){var _=Kk(o,{moveBy:x,direction:w,context:g,modifiers:n});Pr(o,_)||(t.goToDate(_,o),p(_))}},b={focusedDay:o,focusTarget:u,blur:f,focus:p,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return xe.jsx(Xk.Provider,{value:b,children:e.children})}function i1(){var e=m.useContext(Xk);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Tte(e,t){var n=Yk(),r=o1(e,n,t);return r}var s1=m.createContext(void 0);function kte(e){if(!lm(e.initialProps)){var t={selected:void 0};return xe.jsx(s1.Provider,{value:t,children:e.children})}return xe.jsx(Mte,{initialProps:e.initialProps,children:e.children})}function Mte(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 xe.jsx(s1.Provider,{value:o,children:n})}function Qk(){var e=m.useContext(s1);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Ate(e,t){var n=Qt(),r=Qk(),o=t1(),i=r1(),s=i1(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,f=s.blur,p=s.focus,g=s.focusMonthBefore,v=s.focusMonthAfter,b=s.focusYearBefore,x=s.focusYearAfter,w=s.focusStartOfWeek,_=s.focusEndOfWeek,S=function(H){var q,Z,T,V;lm(n)?(q=r.onDayClick)===null||q===void 0||q.call(r,e,t,H):pf(n)?(Z=o.onDayClick)===null||Z===void 0||Z.call(o,e,t,H):gf(n)?(T=i.onDayClick)===null||T===void 0||T.call(i,e,t,H):(V=n.onDayClick)===null||V===void 0||V.call(n,e,t,H)},R=function(H){var q;p(e),(q=n.onDayFocus)===null||q===void 0||q.call(n,e,t,H)},E=function(H){var q;f(),(q=n.onDayBlur)===null||q===void 0||q.call(n,e,t,H)},O=function(H){var q;(q=n.onDayMouseEnter)===null||q===void 0||q.call(n,e,t,H)},k=function(H){var q;(q=n.onDayMouseLeave)===null||q===void 0||q.call(n,e,t,H)},M=function(H){var q;(q=n.onDayPointerEnter)===null||q===void 0||q.call(n,e,t,H)},D=function(H){var q;(q=n.onDayPointerLeave)===null||q===void 0||q.call(n,e,t,H)},I=function(H){var q;(q=n.onDayTouchCancel)===null||q===void 0||q.call(n,e,t,H)},z=function(H){var q;(q=n.onDayTouchEnd)===null||q===void 0||q.call(n,e,t,H)},j=function(H){var q;(q=n.onDayTouchMove)===null||q===void 0||q.call(n,e,t,H)},Q=function(H){var q;(q=n.onDayTouchStart)===null||q===void 0||q.call(n,e,t,H)},U=function(H){var q;(q=n.onDayKeyUp)===null||q===void 0||q.call(n,e,t,H)},B=function(H){var q;switch(H.key){case"ArrowLeft":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":H.preventDefault(),H.stopPropagation(),c();break;case"ArrowUp":H.preventDefault(),H.stopPropagation(),u();break;case"PageUp":H.preventDefault(),H.stopPropagation(),H.shiftKey?b():g();break;case"PageDown":H.preventDefault(),H.stopPropagation(),H.shiftKey?x():v();break;case"Home":H.preventDefault(),H.stopPropagation(),w();break;case"End":H.preventDefault(),H.stopPropagation(),_();break}(q=n.onDayKeyDown)===null||q===void 0||q.call(n,e,t,H)},K={onClick:S,onFocus:R,onBlur:E,onKeyDown:B,onKeyUp:U,onMouseEnter:O,onMouseLeave:k,onPointerEnter:M,onPointerLeave:D,onTouchCancel:I,onTouchEnd:z,onTouchMove:j,onTouchStart:Q};return K}function Ite(){var e=Qt(),t=Qk(),n=t1(),r=r1(),o=lm(e)?t.selected:pf(e)?n.selected:gf(e)?r.selected:void 0;return o}function Nte(e){return Object.values(Lo).includes(e)}function Lte(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(Nte(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Fte(e,t){var n=Qe({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=Qe(Qe({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function zte(e,t,n){var r,o,i,s=Qt(),a=i1(),l=Tte(e,t),c=Ate(e,l),u=Ite(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var O;l.outside||a.focusedDay&&f&&Pr(a.focusedDay,e)&&((O=n.current)===null||O===void 0||O.focus())},[a.focusedDay,e,n,f,l.outside]);var p=Lte(s,l).join(" "),g=Fte(s,l),v=!!(l.outside&&!s.showOutsideDays||l.hidden),b=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:ste,x=xe.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),w={style:g,className:p,children:x,role:"gridcell"},_=a.focusTarget&&Pr(a.focusTarget,e)&&!l.outside,S=a.focusedDay&&Pr(a.focusedDay,e),R=Qe(Qe(Qe({},w),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=S||_?0:-1,r)),c),E={isButton:f,isHidden:v,activeModifiers:l,selectedDays:u,buttonProps:R,divProps:w};return E}function jte(e){var t=m.useRef(null),n=zte(e.date,e.displayMonth,t);return n.isHidden?xe.jsx("div",{role:"gridcell"}):n.isButton?xe.jsx(ng,Qe({name:"day",ref:t},n.buttonProps)):xe.jsx("div",Qe({},n.divProps))}function Bte(e){var t=e.number,n=e.dates,r=Qt(),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 xe.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var f=l(Number(t),{locale:a}),p=function(g){o(t,n,g)};return xe.jsx(ng,{name:"week-number","aria-label":f,className:s.weeknumber,style:i.weeknumber,onClick:p,children:u})}function Vte(e){var t,n,r=Qt(),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:jte,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:Bte,u;return s&&(u=xe.jsx("td",{className:i.cell,style:o.cell,children:xe.jsx(c,{number:e.weekNumber,dates:e.dates})})),xe.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(f){return xe.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:xe.jsx(l,{displayMonth:e.displayMonth,date:f})},mee(f))})]})}function O2(e,t,n){for(var r=n!=null&&n.ISOWeek?Ik(t):Jw(t,n),o=n!=null&&n.ISOWeek?Ya(e):si(e,n),i=ei(r,o),s=[],a=0;a<=i;a++)s.push(ur(o,a));var l=s.reduce(function(c,u){var f=n!=null&&n.ISOWeek?Lk(u):zk(u,n),p=c.find(function(g){return g.weekNumber===f});return p?(p.dates.push(u),c):(c.push({weekNumber:f,dates:[u]}),c)},[]);return l}function Hte(e,t){var n=O2($r(e),Qw(e),t);if(t!=null&&t.useFixedWeeks){var r=bee(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=My(i,6-r),a=O2(My(i,1),s,t);n.push.apply(n,a)}}return n}function Wte(e){var t,n,r,o=Qt(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,f=o.weekStartsOn,p=o.firstWeekContainsDate,g=o.ISOWeek,v=Hte(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:g,locale:i,weekStartsOn:f,firstWeekContainsDate:p}),b=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:ite,x=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:Vte,w=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:nte;return xe.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&xe.jsx(b,{}),xe.jsx("tbody",{className:s.tbody,style:a.tbody,children:v.map(function(_){return xe.jsx(x,{displayMonth:e.displayMonth,dates:_.dates,weekNumber:_.weekNumber},_.weekNumber)})}),xe.jsx(w,{displayMonth:e.displayMonth})]})}function Ute(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var qte=Ute()?m.useLayoutEffect:m.useEffect,Fb=!1,Gte=0;function $2(){return"react-day-picker-".concat(++Gte)}function Yte(e){var t,n=e??(Fb?$2():null),r=m.useState(n),o=r[0],i=r[1];return qte(function(){o===null&&i($2())},[]),m.useEffect(function(){Fb===!1&&(Fb=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function Kte(e){var t,n,r=Qt(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=mf().displayMonths,c=Yte(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[i.month],p=s.month,g=e.displayIndex===0,v=e.displayIndex===l.length-1,b=!g&&!v;o==="rtl"&&(t=[g,v],v=t[0],g=t[1]),g&&(f.push(i.caption_start),p=Qe(Qe({},p),s.caption_start)),v&&(f.push(i.caption_end),p=Qe(Qe({},p),s.caption_end)),b&&(f.push(i.caption_between),p=Qe(Qe({},p),s.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:tte;return xe.jsxs("div",{className:f.join(" "),style:p,children:[xe.jsx(x,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),xe.jsx(Wte,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function Xte(e){var t=Qt(),n=t.classNames,r=t.styles;return xe.jsx("div",{className:n.months,style:r.months,children:e.children})}function Qte(e){var t,n,r=e.initialProps,o=Qt(),i=i1(),s=mf(),a=m.useState(!1),l=a[0],c=a[1];m.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 f=Qe(Qe({},o.styles.root),o.style),p=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,b){var x;return Qe(Qe({},v),(x={},x[b]=r[b],x))},{}),g=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:Xte;return xe.jsx("div",Qe({className:u.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:xe.jsx(g,{children:s.displayMonths.map(function(v,b){return xe.jsx(Kte,{displayIndex:b,displayMonth:v},b)})})}))}function Jte(e){var t=e.children,n=xee(e,["children"]);return xe.jsx(Bee,{initialProps:n,children:xe.jsx(Qee,{children:xe.jsx(kte,{initialProps:n,children:xe.jsx(ate,{initialProps:n,children:xe.jsx(ute,{initialProps:n,children:xe.jsx(bte,{children:xe.jsx(Dte,{children:t})})})})})})})}function Zte(e){return xe.jsx(Jte,Qe({},e,{children:xe.jsx(Qte,{initialProps:e})}))}function Jk({className:e,classNames:t,showOutsideDays:n=!0,...r}){return P.jsx(Zte,{showOutsideDays:n,className:Ee("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:Ee(Ty({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:Ee(Ty({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})=>P.jsx(tT,{...o,className:"h-4 w-4"}),IconRight:({...o})=>P.jsx(mw,{...o,className:"h-4 w-4"})},...r})}Jk.displayName="Calendar";function ene({filter:e,className:t}){const[n,r]=m.useState(!1),[o,i]=m.useState(),[s,a]=m.useState(),l=Te(S=>S.filterValues),{authToken:c}=el(),u=Te(S=>S.actions.addOrUpdateFilterValue),f=Te(S=>S.actions.removeFilterValue),{data:p,isLoading:g,isFetching:v,isError:b,refetch:x}=Jd({queryKey:[e.sql],queryFn:()=>Kd("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId});m.useEffect(()=>{var S;if(((S=p==null?void 0:p.records)==null?void 0:S.length)>0){const R=p.records[0];if(!R.min||!R.max)return;i({from:new Date(R.min),to:new Date(R.max)}),a({from:new Date(R.min),to:new Date(R.max)})}},[p]),m.useEffect(()=>{if(l&&!l.find(R=>R.filterId===e.id)){i(s);return}},[l,e.id,s]);function w(){f(e.id),i(s),r(!1)}function _(){if(!o)return;console.log(o);const S=[o==null?void 0:o.from,o==null?void 0:o.to];console.log(S);const R={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Dp(e),name:e.column,operation:"between",values:S};u(R),r(!1)}return g?P.jsx("div",{children:P.jsx(mx,{className:"h-8 w-full bg-foreground/10"})}):b?P.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):p?P.jsx("div",{className:Ee("grid gap-2",t),children:P.jsxs(im,{open:n,onOpenChange:r,children:[P.jsx(sm,{asChild:!0,children:P.jsxs(dr,{size:"sm",id:"date",variant:"outline",className:Ee("h-[34px] w-full justify-start rounded-sm text-left font-normal",!o&&"text-muted-foreground"),children:[P.jsx(eT,{className:"mr-2 h-4 w-4"}),o!=null&&o.from?o.to?P.jsxs(P.Fragment,{children:[ni(o.from,"LLL dd, y")," -"," ",ni(o.to,"LLL dd, y")]}):ni(o.from,"LLL dd, y"):P.jsx("span",{children:"Pick a date"})]})}),P.jsxs(ff,{className:"w-auto p-0",align:"start",children:[P.jsx(Jk,{initialFocus:!0,mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:i,numberOfMonths:2}),P.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[P.jsx(dr,{size:"sm",variant:"outline",onClick:_,children:"Apply"}),P.jsx(dr,{size:"sm",variant:"outline",onClick:w,children:"Clear"})]})]})]})}):P.jsxs(zn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}/**
|
|
345
|
+
* react-virtual
|
|
346
|
+
*
|
|
347
|
+
* Copyright (c) TanStack
|
|
348
|
+
*
|
|
349
|
+
* This source code is licensed under the MIT license found in the
|
|
350
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
351
|
+
*
|
|
352
|
+
* @license MIT
|
|
353
|
+
*/function rg(){return rg=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},rg.apply(this,arguments)}/**
|
|
354
|
+
* virtual-core
|
|
355
|
+
*
|
|
356
|
+
* Copyright (c) TanStack
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the MIT license found in the
|
|
359
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
360
|
+
*
|
|
361
|
+
* @license MIT
|
|
362
|
+
*/function og(){return og=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},og.apply(this,arguments)}/**
|
|
363
|
+
* virtual-core
|
|
364
|
+
*
|
|
365
|
+
* Copyright (c) TanStack
|
|
366
|
+
*
|
|
367
|
+
* This source code is licensed under the MIT license found in the
|
|
368
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
369
|
+
*
|
|
370
|
+
* @license MIT
|
|
371
|
+
*/function kl(e,t,n){var r,o=(r=n.initialDeps)!=null?r:[],i;return function(){var s;n.key&&n.debug!=null&&n.debug()&&(s=Date.now());var a=e(),l=a.length!==o.length||a.some(function(v,b){return o[b]!==v});if(!l)return i;o=a;var c;if(n.key&&n.debug!=null&&n.debug()&&(c=Date.now()),i=t.apply(void 0,a),n.key&&n.debug!=null&&n.debug()){var u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,p=f/16,g=function(b,x){for(b=String(b);b.length<x;)b=" "+b;return b};console.info("%c⏱ "+g(f,5)+" /"+g(u,5)+" ms",`
|
|
372
|
+
font-size: .6rem;
|
|
373
|
+
font-weight: bold;
|
|
374
|
+
color: hsl(`+Math.max(0,Math.min(120-120*p,120))+"deg 100% 31%);",n==null?void 0:n.key)}return n==null||n.onChange==null||n.onChange(i),i}}function zb(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var tne=function(t,n){return Math.abs(t-n)<1};/**
|
|
375
|
+
* virtual-core
|
|
376
|
+
*
|
|
377
|
+
* Copyright (c) TanStack
|
|
378
|
+
*
|
|
379
|
+
* This source code is licensed under the MIT license found in the
|
|
380
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
381
|
+
*
|
|
382
|
+
* @license MIT
|
|
383
|
+
*/var nne=function(t){return t},rne=function(t){for(var n=Math.max(t.startIndex-t.overscan,0),r=Math.min(t.endIndex+t.overscan,t.count-1),o=[],i=n;i<=r;i++)o.push(i);return o},one=function(t,n){var r=t.scrollElement;if(r){var o=function(a){var l=a.width,c=a.height;n({width:Math.round(l),height:Math.round(c)})};o(r.getBoundingClientRect());var i=new ResizeObserver(function(s){var a=s[0];if(a!=null&&a.borderBoxSize){var l=a.borderBoxSize[0];if(l){o({width:l.inlineSize,height:l.blockSize});return}}o(r.getBoundingClientRect())});return i.observe(r,{box:"border-box"}),function(){i.unobserve(r)}}},ine=function(t,n){var r=t.scrollElement;if(r){var o=function(){n(r[t.options.horizontal?"scrollLeft":"scrollTop"])};return o(),r.addEventListener("scroll",o,{passive:!0}),function(){r.removeEventListener("scroll",o)}}},sne=function(t,n,r){if(n!=null&&n.borderBoxSize){var o=n.borderBoxSize[0];if(o){var i=Math.round(o[r.options.horizontal?"inlineSize":"blockSize"]);return i}}return Math.round(t.getBoundingClientRect()[r.options.horizontal?"width":"height"])},ane=function(t,n,r){var o,i,s=n.adjustments,a=s===void 0?0:s,l=n.behavior,c=t+a;(o=r.scrollElement)==null||o.scrollTo==null||o.scrollTo((i={},i[r.options.horizontal?"left":"top"]=c,i.behavior=l,i))},lne=function(t){var n=this;this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeoutId=null,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=function(){var r=null,o=function(){return r||(typeof ResizeObserver<"u"?r=new ResizeObserver(function(s){s.forEach(function(a){n._measureElement(a.target,a)})}):null)};return{disconnect:function(){var s;return(s=o())==null?void 0:s.disconnect()},observe:function(s){var a;return(a=o())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:function(s){var a;return(a=o())==null?void 0:a.unobserve(s)}}}(),this.range=null,this.setOptions=function(r){Object.entries(r).forEach(function(o){var i=o[0],s=o[1];typeof s>"u"&&delete r[i]}),n.options=og({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:nne,rangeExtractor:rne,onChange:function(){},measureElement:sne,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},r)},this.notify=function(r){n.options.onChange==null||n.options.onChange(n,r)},this.maybeNotify=kl(function(){return n.calculateRange(),[n.isScrolling,n.range?n.range.startIndex:null,n.range?n.range.endIndex:null]},function(r){n.notify(r)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:function(){return n.options.debug},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){n.unsubs.filter(Boolean).forEach(function(r){return r()}),n.unsubs=[],n.scrollElement=null},this._didMount=function(){return n.measureElementCache.forEach(n.observer.observe),function(){n.observer.disconnect(),n.cleanup()}},this._willUpdate=function(){var r=n.options.getScrollElement();n.scrollElement!==r&&(n.cleanup(),n.scrollElement=r,n._scrollToOffset(n.scrollOffset,{adjustments:void 0,behavior:void 0}),n.unsubs.push(n.options.observeElementRect(n,function(o){n.scrollRect=o,n.maybeNotify()})),n.unsubs.push(n.options.observeElementOffset(n,function(o){n.scrollAdjustments=0,n.scrollOffset!==o&&(n.isScrollingTimeoutId!==null&&(clearTimeout(n.isScrollingTimeoutId),n.isScrollingTimeoutId=null),n.isScrolling=!0,n.scrollDirection=n.scrollOffset<o?"forward":"backward",n.scrollOffset=o,n.maybeNotify(),n.isScrollingTimeoutId=setTimeout(function(){n.isScrollingTimeoutId=null,n.isScrolling=!1,n.scrollDirection=null,n.maybeNotify()},n.options.scrollingDelay))})))},this.getSize=function(){return n.scrollRect[n.options.horizontal?"width":"height"]},this.memoOptions=kl(function(){return[n.options.count,n.options.paddingStart,n.options.scrollMargin,n.options.getItemKey]},function(r,o,i,s){return n.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:o,scrollMargin:i,getItemKey:s}},{key:!1}),this.getFurthestMeasurement=function(r,o){for(var i=new Map,s=new Map,a=o-1;a>=0;a--){var l=r[a];if(!i.has(l.lane)){var c=s.get(l.lane);if(c==null||l.end>c.end?s.set(l.lane,l):l.end<c.end&&i.set(l.lane,!0),i.size===n.options.lanes)break}}return s.size===n.options.lanes?Array.from(s.values()).sort(function(u,f){return u.end-f.end})[0]:void 0},this.getMeasurements=kl(function(){return[n.memoOptions(),n.itemSizeCache]},function(r,o){var i=r.count,s=r.paddingStart,a=r.scrollMargin,l=r.getItemKey,c=n.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,n.pendingMeasuredCacheIndexes):0;n.pendingMeasuredCacheIndexes=[];for(var u=n.measurementsCache.slice(0,c),f=c;f<i;f++){var p=l(f),g=n.options.lanes===1?u[f-1]:n.getFurthestMeasurement(u,f),v=g?g.end:s+a,b=o.get(p),x=typeof b=="number"?b:n.options.estimateSize(f),w=v+x,_=g?g.lane:f%n.options.lanes;u[f]={index:f,start:v,size:x,end:w,key:p,lane:_}}return n.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return n.options.debug}}),this.calculateRange=kl(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,o,i){return n.range=r.length>0&&o>0?cne({measurements:r,outerSize:o,scrollOffset:i}):null},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return n.options.debug}}),this.getIndexes=kl(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,o,i,s){return o===null?[]:r(og({},o,{overscan:i,count:s}))},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.indexFromElement=function(r){var o=n.options.indexAttribute,i=r.getAttribute(o);return i?parseInt(i,10):(console.warn("Missing attribute name '"+o+"={index}' on measured element."),-1)},this._measureElement=function(r,o){var i=n.measurementsCache[n.indexFromElement(r)];if(!i||!r.isConnected){n.measureElementCache.forEach(function(l,c){l===r&&(n.observer.unobserve(r),n.measureElementCache.delete(c))});return}var s=n.measureElementCache.get(i.key);s!==r&&(s&&n.observer.unobserve(s),n.observer.observe(r),n.measureElementCache.set(i.key,r));var a=n.options.measureElement(r,o,n);n.resizeItem(i,a)},this.resizeItem=function(r,o){var i,s=(i=n.itemSizeCache.get(r.key))!=null?i:r.size,a=o-s;a!==0&&(r.start<n.scrollOffset&&(process.env.NODE_ENV!=="production"&&n.options.debug&&console.info("correction",a),n._scrollToOffset(n.scrollOffset,{adjustments:n.scrollAdjustments+=a,behavior:void 0})),n.pendingMeasuredCacheIndexes.push(r.index),n.itemSizeCache=new Map(n.itemSizeCache.set(r.key,o)),n.notify(!1))},this.measureElement=function(r){r&&n._measureElement(r,void 0)},this.getVirtualItems=kl(function(){return[n.getIndexes(),n.getMeasurements()]},function(r,o){for(var i=[],s=0,a=r.length;s<a;s++){var l=r[s],c=o[l];i.push(c)}return i},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.getVirtualItemForOffset=function(r){var o=n.getMeasurements();return zb(o[Zk(0,o.length-1,function(i){return zb(o[i]).start},r)])},this.getOffsetForAlignment=function(r,o){var i=n.getSize();o==="auto"&&(r<=n.scrollOffset?o="start":r>=n.scrollOffset+i?o="end":o="start"),o==="start"?r=r:o==="end"?r=r-i:o==="center"&&(r=r-i/2);var s=n.options.horizontal?"scrollWidth":"scrollHeight",a=n.scrollElement?"document"in n.scrollElement?n.scrollElement.document.documentElement[s]:n.scrollElement[s]:0,l=a-n.getSize();return Math.max(Math.min(l,r),0)},this.getOffsetForIndex=function(r,o){o===void 0&&(o="auto"),r=Math.max(0,Math.min(r,n.options.count-1));var i=zb(n.getMeasurements()[r]);if(o==="auto")if(i.end>=n.scrollOffset+n.getSize()-n.options.scrollPaddingEnd)o="end";else if(i.start<=n.scrollOffset+n.options.scrollPaddingStart)o="start";else return[n.scrollOffset,o];var s=o==="end"?i.end+n.options.scrollPaddingEnd:i.start-n.options.scrollPaddingStart;return[n.getOffsetForAlignment(s,o),o]},this.isDynamicMode=function(){return n.measureElementCache.size>0},this.cancelScrollToIndex=function(){n.scrollToIndexTimeoutId!==null&&(clearTimeout(n.scrollToIndexTimeoutId),n.scrollToIndexTimeoutId=null)},this.scrollToOffset=function(r,o){var i=o===void 0?{}:o,s=i.align,a=s===void 0?"start":s,l=i.behavior;n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.getOffsetForAlignment(r,a),{adjustments:void 0,behavior:l})},this.scrollToIndex=function(r,o){var i=o===void 0?{}:o,s=i.align,a=s===void 0?"auto":s,l=i.behavior;r=Math.max(0,Math.min(r,n.options.count-1)),n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");var c=n.getOffsetForIndex(r,a),u=c[0],f=c[1];n._scrollToOffset(u,{adjustments:void 0,behavior:l}),l!=="smooth"&&n.isDynamicMode()&&(n.scrollToIndexTimeoutId=setTimeout(function(){n.scrollToIndexTimeoutId=null;var p=n.measureElementCache.has(n.options.getItemKey(r));if(p){var g=n.getOffsetForIndex(r,f),v=g[0];tne(v,n.scrollOffset)||n.scrollToIndex(r,{align:f,behavior:l})}else n.scrollToIndex(r,{align:f,behavior:l})}))},this.scrollBy=function(r,o){var i=o===void 0?{}:o,s=i.behavior;n.cancelScrollToIndex(),s==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.scrollOffset+r,{adjustments:void 0,behavior:s})},this.getTotalSize=function(){var r;return(((r=n.getMeasurements()[n.options.count-1])==null?void 0:r.end)||n.options.paddingStart)-n.options.scrollMargin+n.options.paddingEnd},this._scrollToOffset=function(r,o){var i=o.adjustments,s=o.behavior;n.options.scrollToFn(r,{behavior:s,adjustments:i},n)},this.measure=function(){n.itemSizeCache=new Map,n.notify(!1)},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(function(r){n.itemSizeCache.set(r.key,r.size)}),this.maybeNotify()},Zk=function(t,n,r,o){for(;t<=n;){var i=(t+n)/2|0,s=r(i);if(s<o)t=i+1;else if(s>o)n=i-1;else return i}return t>0?t-1:0};function cne(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,o=t.length-1,i=function(c){return t[c].start},s=Zk(0,o,i,r),a=s;a<o&&t[a].end<r+n;)a++;return{startIndex:s,endIndex:a}}/**
|
|
384
|
+
* react-virtual
|
|
385
|
+
*
|
|
386
|
+
* Copyright (c) TanStack
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the MIT license found in the
|
|
389
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
390
|
+
*
|
|
391
|
+
* @license MIT
|
|
392
|
+
*/var une=typeof document<"u"?pe.useLayoutEffect:pe.useEffect;function dne(e){var t=pe.useReducer(function(){return{}},{})[1],n=rg({},e,{onChange:function(s,a){a?Fo.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=pe.useState(function(){return new lne(n)}),o=r[0];return o.setOptions(n),pe.useEffect(function(){return o._didMount()},[]),une(function(){return o._willUpdate()}),o}function fne(e){return dne(rg({observeElementRect:one,observeElementOffset:ine,scrollToFn:ane},e))}var hne=Object.defineProperty,pne=(e,t,n)=>t in e?hne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jb=(e,t,n)=>(pne(e,typeof t!="symbol"?t+"":t,n),n);let gne=class{constructor(){jb(this,"current",this.detect()),jb(this,"handoffState","pending"),jb(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"}},La=new gne,An=(e,t)=>{La.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function ri(e){let t=m.useRef(e);return An(()=>{t.current=e},[e]),t}function a1(e,t){let[n,r]=m.useState(e),o=ri(e);return An(()=>r(o.current),[o,r,...t]),n}let yt=function(e){let t=ri(e);return m.useCallback((...n)=>t.current(...n),[t])};function mne(e,t,n){let[r,o]=m.useState(n),i=e!==void 0,s=m.useRef(i),a=m.useRef(!1),l=m.useRef(!1);return i&&!s.current&&!a.current?(a.current=!0,s.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&s.current&&!l.current&&(l.current=!0,s.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,yt(c=>(i||o(c),t==null?void 0:t(c)))]}function vne(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Ka(){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 vne(()=>{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=Ka();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function vf(){let[e]=m.useState(Ka);return m.useEffect(()=>()=>e.dispose(),[e]),e}function bne(){let e=typeof document>"u";return"useSyncExternalStore"in pe?(t=>t.useSyncExternalStore)(pe)(()=>()=>{},()=>!1,()=>!e):!1}function l1(){let e=bne(),[t,n]=pe.useState(La.isHandoffComplete);return t&&La.isHandoffComplete===!1&&n(!1),pe.useEffect(()=>{t!==!0&&n(!0)},[t]),pe.useEffect(()=>La.handoff(),[]),e?!1:t}var D2;let bf=(D2=m.useId)!=null?D2:function(){let e=l1(),[t,n]=m.useState(e?()=>La.nextId():null);return An(()=>{t===null&&n(La.nextId())},[t]),t!=null?""+t:void 0};function Gn(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,Gn),r}function c1(e){return La.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let T2=["[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 yne=(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))(yne||{}),xne=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(xne||{}),wne=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(wne||{}),eM=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(eM||{});function _ne(e,t=0){var n;return e===((n=c1(e))==null?void 0:n.body)?!1:Gn(t,{0(){return e.matches(T2)},1(){let r=e;for(;r!==null;){if(r.matches(T2))return!0;r=r.parentElement}return!1}})}var Sne=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Sne||{});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 Cne(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 Ene(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Rne(){return/Android/gi.test(window.navigator.userAgent)}function tM(){return Ene()||Rne()}function Kh(e,t,n){let r=ri(t);m.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,n),()=>document.removeEventListener(e,o,n)},[e,n])}function Pne(e,t,n){let r=ri(t);m.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,n),()=>window.removeEventListener(e,o,n)},[e,n])}function One(e,t,n=!0){let r=m.useRef(!1);m.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function o(s,a){if(!r.current||s.defaultPrevented)return;let l=a(s);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let c=function u(f){return typeof f=="function"?u(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let u of c){if(u===null)continue;let f=u instanceof HTMLElement?u:u.current;if(f!=null&&f.contains(l)||s.composed&&s.composedPath().includes(f))return}return!_ne(l,eM.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let i=m.useRef(null);Kh("pointerdown",s=>{var a,l;r.current&&(i.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Kh("mousedown",s=>{var a,l;r.current&&(i.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Kh("click",s=>{tM()||i.current&&(o(s,()=>i.current),i.current=null)},!0),Kh("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),Pne("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function $ne(...e){return m.useMemo(()=>c1(...e),[...e])}function k2(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Dne(e,t){let[n,r]=m.useState(()=>k2(e));return An(()=>{r(k2(e))},[e.type,e.as]),An(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let Tne=Symbol();function rl(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=yt(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[Tne]))?void 0:n}function M2(e){return[e.screenX,e.screenY]}function kne(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=M2(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=M2(t)}}}function Mne({container:e,accept:t,walk:n,enabled:r=!0}){let o=m.useRef(t),i=m.useRef(n);m.useEffect(()=>{o.current=t,i.current=n},[t,n]),An(()=>{if(!e||!r)return;let s=c1(e);if(!s)return;let a=o.current,l=i.current,c=Object.assign(f=>a(f),{acceptNode:a}),u=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[e,r,o,i])}function A2(e,t){let n=m.useRef([]),r=yt(e);m.useEffect(()=>{let o=[...n.current];for(let[i,s]of t.entries())if(n.current[i]!==s){let a=r(t,o);return n.current=t,a}},[r,...t])}function ig(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var sg=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(sg||{}),$s=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))($s||{});function Gi({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??Ane;let l=nM(t,e);if(i)return Xh(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...f}=l;if(u)return Xh(f,n,r,s,a)}if(c&1){let{unmount:u=!0,...f}=l;return Gn(u?0:1,{0(){return null},1(){return Xh({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Xh(l,n,r,s,a)}function Xh(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=Bb(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));let f={};if(t){let p=!1,g=[];for(let[v,b]of Object.entries(t))typeof b=="boolean"&&(p=!0),b===!0&&g.push(v);p&&(f["data-headlessui-state"]=g.join(" "))}if(i===m.Fragment&&Object.keys(Ny(l)).length>0){if(!m.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(b=>` - ${b}`).join(`
|
|
393
|
+
`),"","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(b=>` - ${b}`).join(`
|
|
394
|
+
`)].join(`
|
|
395
|
+
`));let p=u.props,g=typeof(p==null?void 0:p.className)=="function"?(...b)=>ig(p==null?void 0:p.className(...b),l.className):ig(p==null?void 0:p.className,l.className),v=g?{className:g}:{};return m.cloneElement(u,Object.assign({},nM(u.props,Ny(Bb(l,["ref"]))),f,c,{ref:o(u.ref,c.ref)},v))}return m.createElement(i,Object.assign({},Bb(l,["ref"]),i!==m.Fragment&&c,i!==m.Fragment&&f),u)}function Ane(...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 nM(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function fi(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ny(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Bb(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Ine="div";var rM=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(rM||{});function Nne(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Gi({ourProps:i,theirProps:o,slot:{},defaultTag:Ine,name:"Hidden"})}let Lne=fi(Nne),u1=m.createContext(null);u1.displayName="OpenClosedContext";var Kr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Kr||{});function d1(){return m.useContext(u1)}function oM({value:e,children:t}){return m.createElement(u1.Provider,{value:e},t)}function Fne(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let ya=[];Fne(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&ya[0]!==t.target&&(ya.unshift(t.target),ya=ya.filter(n=>n!=null&&n.isConnected),ya.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 zne(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&&jne(n)?!1:r}function jne(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function Bne(e){throw new Error("Unexpected object: "+e)}var kn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(kn||{});function I2(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:Bne(e)}}function iM(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))aM(n,sM(t,r),o);return n}function sM(e,t){return e?e+"["+t+"]":t}function aM(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())aM(e,sM(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,""]):iM(n,t,e)}var Hr=(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))(Hr||{}),Vne=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Vne||{}),Hne=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Hne||{}),Wne=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Wne||{}),Une=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(Une||{});function Vb(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):Cne(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let qne={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,r,o,i,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((o=e.dataRef.current)!=null&&o.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let u=t.focus===kn.Specific?t.idx:I2(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var p,g;return(g=(p=e.activeOptionIndex)!=null?p:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?g:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===u&&e.activationTrigger===f?e:{...e,activeOptionIndex:u,activationTrigger:f}}let a=Vb(e);if(a.activeOptionIndex===null){let u=a.options.findIndex(f=>!f.dataRef.current.disabled);u!==-1&&(a.activeOptionIndex=u)}let l=t.focus===kn.Specific?t.idx:I2(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),c=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===c?e:{...e,...a,activeOptionIndex:l,activationTrigger:c}},3:(e,t)=>{var n,r,o;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,s=Vb(e,l=>(l.push(i),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let a={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(o=>o.id!==t.id)};let r=Vb(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?r=o:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},f1=m.createContext(null);f1.displayName="ComboboxActionsContext";function yf(e){let t=m.useContext(f1);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,yf),n}return t}let lM=m.createContext(null);function Gne(e){var t;let n=ol("VirtualProvider"),[r,o]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[n.optionsRef.current]),i=fne({scrollPaddingStart:r,scrollPaddingEnd:o,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=m.useState(0);return An(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(lM.Provider,{value:i},m.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&i.scrollToIndex(n.activeOptionIndex)}}},i.getVirtualItems().map(l=>{var c;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((c=e.children)==null?void 0:c.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":n.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let h1=m.createContext(null);h1.displayName="ComboboxDataContext";function ol(e){let t=m.useContext(h1);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ol),n}return t}function Yne(e,t){return Gn(t.type,qne,e,t)}let Kne=m.Fragment;function Xne(e,t){let{value:n,defaultValue:r,onChange:o,form:i,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:f=!1,immediate:p=!1,virtual:g=null,...v}=e,b=!1,x=null,[w=f?[]:void 0,_]=mne(n,o,r),[S,R]=m.useReducer(Yne,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),E=m.useRef(!1),O=m.useRef({static:!1,hold:!1}),k=m.useRef(null),M=m.useRef(null),D=m.useRef(null),I=m.useRef(null),z=yt(typeof a=="string"?(ee,ie)=>{let be=a;return(ee==null?void 0:ee[be])===(ie==null?void 0:ie[be])}:a??((ee,ie)=>ee===ie)),j=yt(ee=>S.options.findIndex(ie=>z(ie.dataRef.current.value,ee))),Q=m.useCallback(ee=>Gn(B.mode,{1:()=>w.some(ie=>z(ie,ee)),0:()=>z(w,ee)}),[w]),U=yt(ee=>S.activeOptionIndex===j(ee)),B=m.useMemo(()=>({...S,immediate:b,optionsPropsRef:O,labelRef:k,inputRef:M,buttonRef:D,optionsRef:I,value:w,defaultValue:r,disabled:l,mode:f?1:0,virtual:S.virtual,get activeOptionIndex(){if(E.current&&S.activeOptionIndex===null&&S.options.length>0){let ee=S.options.findIndex(ie=>!ie.dataRef.current.disabled);if(ee!==-1)return ee}return S.activeOptionIndex},calculateIndex:j,compare:z,isSelected:Q,isActive:U,nullable:u,__demoMode:c}),[w,r,l,f,u,c,S,x]);An(()=>{},[x,void 0]),An(()=>{S.dataRef.current=B},[B]),One([B.buttonRef,B.inputRef,B.optionsRef],()=>ae.closeCombobox(),B.comboboxState===0);let K=m.useMemo(()=>{var ee,ie,be;return{open:B.comboboxState===0,disabled:l,activeIndex:B.activeOptionIndex,activeOption:B.activeOptionIndex===null?null:B.virtual?B.virtual.options[(ee=B.activeOptionIndex)!=null?ee:0]:(be=(ie=B.options[B.activeOptionIndex])==null?void 0:ie.dataRef.current.value)!=null?be:null,value:w}},[B,l,w]),H=yt(()=>{if(B.activeOptionIndex!==null){if(B.virtual)N(B.virtual.options[B.activeOptionIndex]);else{let{dataRef:ee}=B.options[B.activeOptionIndex];N(ee.current.value)}ae.goToOption(kn.Specific,B.activeOptionIndex)}}),q=yt(()=>{R({type:0}),E.current=!0}),Z=yt(()=>{R({type:1}),E.current=!1}),T=yt((ee,ie,be)=>(E.current=!1,ee===kn.Specific?R({type:2,focus:kn.Specific,idx:ie,trigger:be}):R({type:2,focus:ee,trigger:be}))),V=yt((ee,ie)=>(R({type:3,payload:{id:ee,dataRef:ie}}),()=>{B.isActive(ie.current.value)&&(E.current=!0),R({type:4,id:ee})})),X=yt(ee=>(R({type:5,id:ee}),()=>R({type:5,id:null}))),N=yt(ee=>Gn(B.mode,{0(){return _==null?void 0:_(ee)},1(){let ie=B.value.slice(),be=ie.findIndex(G=>z(G,ee));return be===-1?ie.push(ee):ie.splice(be,1),_==null?void 0:_(ie)}})),se=yt(ee=>{R({type:6,trigger:ee})}),ae=m.useMemo(()=>({onChange:N,registerOption:V,registerLabel:X,goToOption:T,closeCombobox:Z,openCombobox:q,setActivationTrigger:se,selectActiveOption:H}),[]),ue=t===null?{}:{ref:t},fe=m.useRef(null),oe=vf();return m.useEffect(()=>{fe.current&&r!==void 0&&oe.addEventListener(fe.current,"reset",()=>{_==null||_(r)})},[fe,_]),m.createElement(f1.Provider,{value:ae},m.createElement(h1.Provider,{value:B},m.createElement(oM,{value:Gn(B.comboboxState,{0:Kr.Open,1:Kr.Closed})},s!=null&&w!=null&&iM({[s]:w}).map(([ee,ie],be)=>m.createElement(Lne,{features:rM.Hidden,ref:be===0?G=>{var me;fe.current=(me=G==null?void 0:G.closest("form"))!=null?me:null}:void 0,...Ny({key:ee,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:ee,value:ie})})),Gi({ourProps:ue,theirProps:v,slot:K,defaultTag:Kne,name:"Combobox"}))))}let Qne="input";function Jne(e,t){var n,r,o,i,s;let a=bf(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:u,type:f="text",...p}=e,g=ol("Combobox.Input"),v=yf("Combobox.Input"),b=rl(g.inputRef,t),x=$ne(g.inputRef),w=m.useRef(!1),_=vf(),S=yt(()=>{v.onChange(null),g.optionsRef.current&&(g.optionsRef.current.scrollTop=0),v.goToOption(kn.Nothing)}),R=function(){var B;return typeof u=="function"&&g.value!==void 0?(B=u(g.value))!=null?B:"":typeof g.value=="string"?g.value:""}();A2(([B,K],[H,q])=>{if(w.current)return;let Z=g.inputRef.current;Z&&((q===0&&K===1||B!==H)&&(Z.value=B),requestAnimationFrame(()=>{if(w.current||!Z||(x==null?void 0:x.activeElement)!==Z)return;let{selectionStart:T,selectionEnd:V}=Z;Math.abs((V??0)-(T??0))===0&&T===0&&Z.setSelectionRange(Z.value.length,Z.value.length)}))},[R,g.comboboxState,x]),A2(([B],[K])=>{if(B===0&&K===1){if(w.current)return;let H=g.inputRef.current;if(!H)return;let q=H.value,{selectionStart:Z,selectionEnd:T,selectionDirection:V}=H;H.value="",H.value=q,V!==null?H.setSelectionRange(Z,T,V):H.setSelectionRange(Z,T)}},[g.comboboxState]);let E=m.useRef(!1),O=yt(()=>{E.current=!0}),k=yt(()=>{_.nextFrame(()=>{E.current=!1})}),M=yt(B=>{switch(w.current=!0,B.key){case Hr.Enter:if(w.current=!1,g.comboboxState!==0||E.current)return;if(B.preventDefault(),B.stopPropagation(),g.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),g.mode===0&&v.closeCombobox();break;case Hr.ArrowDown:return w.current=!1,B.preventDefault(),B.stopPropagation(),Gn(g.comboboxState,{0:()=>v.goToOption(kn.Next),1:()=>v.openCombobox()});case Hr.ArrowUp:return w.current=!1,B.preventDefault(),B.stopPropagation(),Gn(g.comboboxState,{0:()=>v.goToOption(kn.Previous),1:()=>{v.openCombobox(),_.nextFrame(()=>{g.value||v.goToOption(kn.Last)})}});case Hr.Home:if(B.shiftKey)break;return w.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(kn.First);case Hr.PageUp:return w.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(kn.First);case Hr.End:if(B.shiftKey)break;return w.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(kn.Last);case Hr.PageDown:return w.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(kn.Last);case Hr.Escape:return w.current=!1,g.comboboxState!==0?void 0:(B.preventDefault(),g.optionsRef.current&&!g.optionsPropsRef.current.static&&B.stopPropagation(),g.nullable&&g.mode===0&&g.value===null&&S(),v.closeCombobox());case Hr.Tab:if(w.current=!1,g.comboboxState!==0)return;g.mode===0&&g.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),D=yt(B=>{c==null||c(B),g.nullable&&g.mode===0&&B.target.value===""&&S(),v.openCombobox()}),I=yt(B=>{var K,H,q;let Z=(K=B.relatedTarget)!=null?K:ya.find(T=>T!==B.currentTarget);if(w.current=!1,!((H=g.optionsRef.current)!=null&&H.contains(Z))&&!((q=g.buttonRef.current)!=null&&q.contains(Z))&&g.comboboxState===0)return B.preventDefault(),g.mode===0&&(g.nullable&&g.value===null?S():g.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),z=yt(B=>{var K,H,q;let Z=(K=B.relatedTarget)!=null?K:ya.find(T=>T!==B.currentTarget);(H=g.buttonRef.current)!=null&&H.contains(Z)||(q=g.optionsRef.current)!=null&&q.contains(Z)||g.disabled||g.immediate&&g.comboboxState!==0&&(v.openCombobox(),_.nextFrame(()=>{v.setActivationTrigger(1)}))}),j=a1(()=>{if(g.labelId)return[g.labelId].join(" ")},[g.labelId]),Q=m.useMemo(()=>({open:g.comboboxState===0,disabled:g.disabled}),[g]),U={ref:b,id:l,role:"combobox",type:f,"aria-controls":(n=g.optionsRef.current)==null?void 0:n.id,"aria-expanded":g.comboboxState===0,"aria-activedescendant":g.activeOptionIndex===null?void 0:g.virtual?(r=g.options.find(B=>{var K;return!((K=g.virtual)!=null&&K.disabled(B.dataRef.current.value))&&g.compare(B.dataRef.current.value,g.virtual.options[g.activeOptionIndex])}))==null?void 0:r.id:(o=g.options[g.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":j,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:g.defaultValue!==void 0?u==null?void 0:u(g.defaultValue):null)!=null?s:g.defaultValue,disabled:g.disabled,onCompositionStart:O,onCompositionEnd:k,onKeyDown:M,onChange:D,onFocus:z,onBlur:I};return Gi({ourProps:U,theirProps:p,slot:Q,defaultTag:Qne,name:"Combobox.Input"})}let Zne="button";function ere(e,t){var n;let r=ol("Combobox.Button"),o=yf("Combobox.Button"),i=rl(r.buttonRef,t),s=bf(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=vf(),u=yt(b=>{switch(b.key){case Hr.ArrowDown:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&o.openCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Hr.ArrowUp:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),c.nextFrame(()=>{r.value||o.goToOption(kn.Last)})),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Hr.Escape:return r.comboboxState!==0?void 0:(b.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&b.stopPropagation(),o.closeCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})}));default:return}}),f=yt(b=>{if(zne(b.currentTarget))return b.preventDefault();r.comboboxState===0?o.closeCombobox():(b.preventDefault(),o.openCombobox()),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),p=a1(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),g=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:i,id:a,type:Dne(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsRef.current)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":p,disabled:r.disabled,onClick:f,onKeyDown:u};return Gi({ourProps:v,theirProps:l,slot:g,defaultTag:Zne,name:"Combobox.Button"})}let tre="label";function nre(e,t){let n=bf(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=ol("Combobox.Label"),s=yf("Combobox.Label"),a=rl(i.labelRef,t);An(()=>s.registerLabel(r),[r]);let l=yt(()=>{var u;return(u=i.inputRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return Gi({ourProps:{ref:a,id:r,onClick:l},theirProps:o,slot:c,defaultTag:tre,name:"Combobox.Label"})}let rre="ul",ore=sg.RenderStrategy|sg.Static;function ire(e,t){let n=bf(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=ol("Combobox.Options"),a=rl(s.optionsRef,t),l=d1(),c=l!==null?(l&Kr.Open)===Kr.Open:s.comboboxState===0;An(()=>{var g;s.optionsPropsRef.current.static=(g=e.static)!=null?g:!1},[s.optionsPropsRef,e.static]),An(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),Mne({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(g){return g.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:g.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(g){g.setAttribute("role","none")}});let u=a1(()=>{var g,v;return(v=s.labelId)!=null?v:(g=s.buttonRef.current)==null?void 0:g.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),p={"aria-labelledby":u,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(i,{children:m.createElement(Gne,null,i.children)}),Gi({ourProps:p,theirProps:i,slot:f,defaultTag:rre,features:ore,visible:c,name:"Combobox.Options"})}let sre="li";function are(e,t){var n;let r=bf(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,c=ol("Combobox.Option"),u=yf("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===o,p=c.isSelected(s),g=m.useRef(null),v=ri({disabled:i,value:s,domRef:g,order:a}),b=m.useContext(lM),x=rl(t,g,b?b.measureElement:null),w=yt(()=>u.onChange(s));An(()=>u.registerOption(o,v),[v,o]);let _=m.useRef(!(c.virtual||c.__demoMode));An(()=>{if(!c.virtual||!c.__demoMode)return;let I=Ka();return I.requestAnimationFrame(()=>{_.current=!0}),I.dispose},[c.virtual,c.__demoMode]),An(()=>{if(!_.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let I=Ka();return I.requestAnimationFrame(()=>{var z,j;(j=(z=g.current)==null?void 0:z.scrollIntoView)==null||j.call(z,{block:"nearest"})}),I.dispose},[g,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let S=yt(I=>{var z;if(i||(z=c.virtual)!=null&&z.disabled(s))return I.preventDefault();w(),tM()||requestAnimationFrame(()=>{var j;return(j=c.inputRef.current)==null?void 0:j.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),R=yt(()=>{var I;if(i||(I=c.virtual)!=null&&I.disabled(s))return u.goToOption(kn.Nothing);let z=c.calculateIndex(s);u.goToOption(kn.Specific,z)}),E=kne(),O=yt(I=>E.update(I)),k=yt(I=>{var z;if(!E.wasMoved(I)||i||(z=c.virtual)!=null&&z.disabled(s)||f)return;let j=c.calculateIndex(s);u.goToOption(kn.Specific,j,0)}),M=yt(I=>{var z;E.wasMoved(I)&&(i||(z=c.virtual)!=null&&z.disabled(s)||f&&(c.optionsPropsRef.current.hold||u.goToOption(kn.Nothing)))}),D=m.useMemo(()=>({active:f,selected:p,disabled:i}),[f,p,i]);return Gi({ourProps:{id:o,ref:x,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":p,disabled:void 0,onClick:S,onFocus:R,onPointerEnter:O,onMouseEnter:O,onPointerMove:k,onMouseMove:k,onPointerLeave:M,onMouseLeave:M},theirProps:l,slot:D,defaultTag:sre,name:"Combobox.Option"})}let lre=fi(Xne),cre=fi(ere),ure=fi(Jne),dre=fi(nre),fre=fi(ire),hre=fi(are),Ml=Object.assign(lre,{Input:ure,Button:cre,Label:dre,Options:fre,Option:hre});function p1(){let e=m.useRef(!1);return An(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function pre(e=0){let[t,n]=m.useState(e),r=p1(),o=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),i=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}function gre(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Hb(e,...t){e&&t.length>0&&e.classList.add(...t)}function Wb(e,...t){e&&t.length>0&&e.classList.remove(...t)}function mre(e,t){let n=Ka();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,s]=[r,o].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,f)=>f-u);return c}),a=i+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function vre(e,t,n,r){let o=n?"enter":"leave",i=Ka(),s=r!==void 0?gre(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Gn(o,{enter:()=>t.enter,leave:()=>t.leave}),l=Gn(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Gn(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Wb(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Hb(e,...t.base,...a,...c),i.nextFrame(()=>{Wb(e,...t.base,...a,...c),Hb(e,...t.base,...a,...l),mre(e,()=>(Wb(e,...t.base,...a),Hb(e,...t.base,...t.entered),s()))}),i.dispose}function bre({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=p1(),a=vf(),l=ri(n);An(()=>{e&&(l.current="enter")},[e]),An(()=>{let c=Ka();a.add(c.dispose);let u=t.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),o.current(l.current),c.add(vre(u,r.current,l.current==="enter",()=>{c.dispose(),i.current(l.current)})),c.dispose},[n])}function cs(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let cm=m.createContext(null);cm.displayName="TransitionContext";var yre=(e=>(e.Visible="visible",e.Hidden="hidden",e))(yre||{});function xre(){let e=m.useContext(cm);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function wre(){let e=m.useContext(um);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let um=m.createContext(null);um.displayName="NestingContext";function dm(e){return"children"in e?dm(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function cM(e,t){let n=ri(e),r=m.useRef([]),o=p1(),i=vf(),s=yt((g,v=$s.Hidden)=>{let b=r.current.findIndex(({el:x})=>x===g);b!==-1&&(Gn(v,{[$s.Unmount](){r.current.splice(b,1)},[$s.Hidden](){r.current[b].state="hidden"}}),i.microTask(()=>{var x;!dm(r)&&o.current&&((x=n.current)==null||x.call(n))}))}),a=yt(g=>{let v=r.current.find(({el:b})=>b===g);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:g,state:"visible"}),()=>s(g,$s.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),u=m.useRef({enter:[],leave:[],idle:[]}),f=yt((g,v,b)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([x])=>x!==g)),t==null||t.chains.current[v].push([g,new Promise(x=>{l.current.push(x)})]),t==null||t.chains.current[v].push([g,new Promise(x=>{Promise.all(u.current[v].map(([w,_])=>_)).then(()=>x())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(v)):b(v)}),p=yt((g,v,b)=>{Promise.all(u.current[v].splice(0).map(([x,w])=>w)).then(()=>{var x;(x=l.current.shift())==null||x()}).then(()=>b(v))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:p,wait:c,chains:u}),[a,s,r,f,p,u,c])}function _re(){}let Sre=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function N2(e){var t;let n={};for(let r of Sre)n[r]=(t=e[r])!=null?t:_re;return n}function Cre(e){let t=m.useRef(N2(e));return m.useEffect(()=>{t.current=N2(e)},[e]),t}let Ere="div",uM=sg.RenderStrategy;function Rre(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:f,leave:p,leaveFrom:g,leaveTo:v,...b}=e,x=m.useRef(null),w=rl(x,t),_=(n=b.unmount)==null||n?$s.Unmount:$s.Hidden,{show:S,appear:R,initial:E}=xre(),[O,k]=m.useState(S?"visible":"hidden"),M=wre(),{register:D,unregister:I}=M;m.useEffect(()=>D(x),[D,x]),m.useEffect(()=>{if(_===$s.Hidden&&x.current){if(S&&O!=="visible"){k("visible");return}return Gn(O,{hidden:()=>I(x),visible:()=>D(x)})}},[O,x,D,I,S,_]);let z=ri({base:cs(b.className),enter:cs(l),enterFrom:cs(c),enterTo:cs(u),entered:cs(f),leave:cs(p),leaveFrom:cs(g),leaveTo:cs(v)}),j=Cre({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),Q=l1();m.useEffect(()=>{if(Q&&O==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,O,Q]);let U=E&&!R,B=R&&S&&E,K=!Q||U?"idle":S?"enter":"leave",H=pre(0),q=yt(se=>Gn(se,{enter:()=>{H.addFlag(Kr.Opening),j.current.beforeEnter()},leave:()=>{H.addFlag(Kr.Closing),j.current.beforeLeave()},idle:()=>{}})),Z=yt(se=>Gn(se,{enter:()=>{H.removeFlag(Kr.Opening),j.current.afterEnter()},leave:()=>{H.removeFlag(Kr.Closing),j.current.afterLeave()},idle:()=>{}})),T=cM(()=>{k("hidden"),I(x)},M),V=m.useRef(!1);bre({immediate:B,container:x,classes:z,direction:K,onStart:ri(se=>{V.current=!0,T.onStart(x,se,q)}),onStop:ri(se=>{V.current=!1,T.onStop(x,se,Z),se==="leave"&&!dm(T)&&(k("hidden"),I(x))})});let X=b,N={ref:w};return B?X={...X,className:ig(b.className,...z.current.enter,...z.current.enterFrom)}:V.current&&(X.className=ig(b.className,(r=x.current)==null?void 0:r.className),X.className===""&&delete X.className),m.createElement(um.Provider,{value:T},m.createElement(oM,{value:Gn(O,{visible:Kr.Open,hidden:Kr.Closed})|H.flags},Gi({ourProps:N,theirProps:X,defaultTag:Ere,features:uM,visible:O==="visible",name:"Transition.Child"})))}function Pre(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=rl(s,t);l1();let l=d1();if(n===void 0&&l!==null&&(n=(l&Kr.Open)===Kr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=m.useState(n?"visible":"hidden"),f=cM(()=>{u("hidden")}),[p,g]=m.useState(!0),v=m.useRef([n]);An(()=>{p!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),g(!1))},[v,n]);let b=m.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);m.useEffect(()=>{if(n)u("visible");else if(!dm(f))u("hidden");else{let S=s.current;if(!S)return;let R=S.getBoundingClientRect();R.x===0&&R.y===0&&R.width===0&&R.height===0&&u("hidden")}},[n,f]);let x={unmount:o},w=yt(()=>{var S;p&&g(!1),(S=e.beforeEnter)==null||S.call(e)}),_=yt(()=>{var S;p&&g(!1),(S=e.beforeLeave)==null||S.call(e)});return m.createElement(um.Provider,{value:f},m.createElement(cm.Provider,{value:b},Gi({ourProps:{...x,as:m.Fragment,children:m.createElement(dM,{ref:a,...x,...i,beforeEnter:w,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:uM,visible:c==="visible",name:"Transition"})))}function Ore(e,t){let n=m.useContext(cm)!==null,r=d1()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(Ly,{ref:t,...e}):m.createElement(dM,{ref:t,...e}))}let Ly=fi(Pre),dM=fi(Rre),$re=fi(Ore),Dre=Object.assign(Ly,{Child:$re,Root:Ly});function Tre(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 kre(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 Xd.includes(e)?o:r}function Mre({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null),{authToken:l}=el(),c=Te(M=>M.filterValues),u=Te(M=>M.actions.addOrUpdateFilterValue),f=Te(M=>M.actions.removeFilterValue),p=S(c),{data:g,isLoading:v,isFetching:b,isError:x,refetch:w}=Jd({queryKey:["filter",e.id,e.sql,JSON.stringify(p)],queryFn:()=>Kd("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:p}),enabled:!!e.sql&&!!e.connectionId}),_=m.useMemo(()=>{var M;return(M=g==null?void 0:g.records)==null?void 0:M.map(D=>{let I=e.column.split(".").slice(-1)[0].replace(/"/g,"");return D[I]===void 0&&(I=I.toLowerCase()),{id:D[I],value:D[I]}})},[g,e.column]);m.useEffect(()=>{if(c){const M=c.find(D=>D.filterId===e.id);if(!M){n([]);return}if(M.operation==="in"){const D=_==null?void 0:_.filter(I=>M.values.includes(I.value));D&&n(D)}else o(`${M.operation} ${M.values[0]}`)}},[g]),m.useEffect(()=>{if(c&&!c.find(D=>D.filterId===e.id)){n([]);return}},[c,e.id]);function S(M){return M?M.filter(D=>{const z=D.name.split(".");if(z.slice(0,z.length-1).join(".")===e.table&&D.name!==e.column)return!0}):[]}function R(M){const D=Tre(M[0].toString());if(!(D!=null&&D.value)||!(D!=null&&D.operation))return;const I={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Dp(e),name:e.column,operation:D.operation,values:[Number(D.value)]};u(I)}function E(M){if(console.log("onComboBoxChange",M),M.length===1&&_.find(I=>I.value===M[0].value)===void 0){R(M);return}if(n(M),M.length===0){f(e.id);return}const D={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Dp(e),operation:e.operation,values:M.map(I=>I.value)};u(D)}function O(){var M;o(""),f(e.id),console.log(e.id),(M=a.current)==null||M.click()}if(v)return P.jsx("div",{children:P.jsx(mx,{className:"h-8 w-full bg-foreground/10"})});if(x)return P.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let k=[];return hc.includes(e.dataType)?k=_:k=i===""?_:_==null?void 0:_.filter(M=>M.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,""))),P.jsx("div",{className:"w-full",children:P.jsx(Ml,{value:t,onChange:E,multiple:!0,children:P.jsxs("div",{className:"relative",children:[P.jsxs("div",{className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[P.jsx(Ml.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:M=>M.map(I=>I.value).join(", ")||r,onChange:M=>{o(M.target.value),s(M.target.value)}}),P.jsx(Ml.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:P.jsx(PG,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),P.jsx(Dre,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:P.jsxs(Ml.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm",children:[hc.includes(e.dataType)&&P.jsxs(Ml.Option,{value:r,className:"flex items-center justify-between gap-2 px-3 py-2",children:[P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx("span",{className:"font-thin",children:"#"}),P.jsx("span",{children:r})]}),r&&P.jsx(dr,{variant:"link",className:"h-4 w-3 cursor-pointer text-foreground/50 hover:text-foreground/100",onClick:M=>{M.stopPropagation(),O()},children:"Clear"})]},"custom"),(k==null?void 0:k.length)===0&&i!==""?P.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):k==null?void 0:k.map(M=>P.jsx(Ml.Option,{className:({active:D})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${D?"bg-muted":"text-foreground-900"}`,value:M,children:({selected:D,active:I})=>P.jsxs("div",{className:"",children:[P.jsx("span",{className:`block ${D?"font-medium":"font-normal"}`,children:typeof M.value=="boolean"?M.value?"True":"False":M.value}),D?P.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:P.jsx(KD,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},M.value))]})})]})})})}const Are=gE.WidthProvider(gE.Responsive);function Ire(){var O,k,M;const e=Te(D=>D.isDashboardEditing);Te(D=>D.currentBreakpoint);const t=Te(D=>D.themeStyle),n=Te(D=>D.selectedSheetId);(O=Te(D=>{var I,z;return(z=(I=D.dashboard)==null?void 0:I.sheets)==null?void 0:z.filter(j=>j.id===n)}))==null||O[0].layout;const r=(k=Te(D=>{var I,z;return(z=(I=D.dashboard)==null?void 0:I.sheets)==null?void 0:z.filter(j=>j.id===n)}))==null?void 0:k[0].layouts,o=Te(D=>D.dashboard.filters),i=Te(D=>{var I,z,j;return(j=(z=(I=D.dashboard)==null?void 0:I.sheets)==null?void 0:z.find(Q=>Q.id===n))==null?void 0:j.frames}),{getSelectedSheet:s,getSelectedSheetLayout:a,getSelectedSheetLayouts:l,setSheetLayout:c,setSheetLayouts:u,setCurrentBreakpoint:f,removeFilter:p,updateFilter:g,removeFilterValue:v}=Te(D=>D.actions),b=s(),x=m.useCallback(D=>{f(D)},[]),w=m.useCallback((D,I)=>{b!=null&&b.id&&u(b.id,I)},[b==null?void 0:b.id,u]);if(!n)return null;const _=(D,I)=>P.jsx(fM,{className:"after:content-none",ref:I,handleAxis:D}),S=D=>Xd.includes(D.dataType)?P.jsx(ene,{filter:D}):P.jsx(Mre,{filter:D});function R(){return o==null?void 0:o.map(D=>P.jsxs("div",{className:Ee("group z-50 flex w-full flex-col rounded-md bg-muted/50 p-2"),children:[P.jsx(Va,{className:"my-1",text:D.title||D.column,onSave:I=>g({...D,title:I}),children:P.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[P.jsxs("div",{className:"flex grow items-center gap-2",children:[P.jsx(zn,{className:"inline-block text-sm",children:D.title}),e&&P.jsx(uZ,{filter:D})]}),P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx("div",{onClick:()=>v(D.id),className:"invisible cursor-pointer text-xs text-muted-foreground hover:text-foreground hover:underline group-hover:visible",children:"Clear"}),e&&P.jsx(fY,{onClick:()=>{v(D.id),p(D.id)},className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})]})]})}),S(D)]},D.id))}function E(){return i==null?void 0:i.map(D=>P.jsx("div",{role:"dashboard-frame-container",className:Ee("group",t==null?void 0:t.dashboardCardContainer),children:P.jsx(aZ,{frame:D})},D.id))}return P.jsx(P.Fragment,{children:P.jsxs(Are,{margin:[10,10],isDraggable:e,resizeHandles:e?["sw","nw","ne","se","e","w"]:[],className:Ee((M=t==null?void 0:t.gridLayout)==null?void 0:M.className),layouts:r,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:x,onLayoutChange:w,resizeHandle:_,children:[R(),E()]})})}const fM=m.forwardRef(({className:e,handleAxis:t,...n},r)=>P.jsx("div",{ref:r,className:Ee(`react-resizable-handle z-10 react-resizable-handle-${t} absolute border-foreground/40`,{"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0":t==="nw","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne","border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw","border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0 group-hover:border-t-0":t==="e","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0 group-hover:border-t-0":t==="w"},e),...n}));fM.displayName="ResizeHandle";let Nre=(e,t=21)=>(n=t)=>{let r="",o=n;for(;o--;)r+=e[Math.random()*e.length|0];return r};var Nc={exports:{}};const Lre=typeof Buffer<"u",L2=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,F2=/"(?: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 hM(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),Lre&&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(L2.test(e)===!1&&F2.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(L2.test(e)===!1)return r}else if(F2.test(e)===!1)return r;return pM(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function pM(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 g1(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return hM(e,t,n)}finally{Error.stackTraceLimit=r}}function Fre(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return hM(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Nc.exports=g1;Nc.exports.default=g1;Nc.exports.parse=g1;Nc.exports.safeParse=Fre;Nc.exports.scan=pM;var zre=Nc.exports;const z2=Oc(zre);var gM=Nre("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);function jre(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 f=e.substring(r,l+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(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 Bre(e){if(e!=null)try{return z2.parse(e)}catch{try{const n=jre(e);return z2.parse(n)}catch{}}}var hd={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},pd={code:"1",name:"function_call",parse:e=>{if(e==null||typeof e!="object"||!("function_call"in e)||typeof e.function_call!="object"||e.function_call==null||!("name"in e.function_call)||!("arguments"in e.function_call)||typeof e.function_call.name!="string"||typeof e.function_call.arguments!="string")throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},gd={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},md={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},vd={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}}},bd={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}}}},yd={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}}},xd={code:"7",name:"tool_calls",parse:e=>{if(e==null||typeof e!="object"||!("tool_calls"in e)||typeof e.tool_calls!="object"||e.tool_calls==null||!Array.isArray(e.tool_calls)||e.tool_calls.some(t=>t==null||typeof t!="object"||!("id"in t)||typeof t.id!="string"||!("type"in t)||typeof t.type!="string"||!("function"in t)||t.function==null||typeof t.function!="object"||!("arguments"in t.function)||typeof t.function.name!="string"||typeof t.function.arguments!="string"))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},wd={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}}},_d={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}}},Sd={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}}},Cd={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}}},Ed={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}}},Rd={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string"||!("usage"in e)||e.usage==null||typeof e.usage!="object"||!("promptTokens"in e.usage)||!("completionTokens"in e.usage))throw new Error('"finish_message" parts expect an object with a "finishReason" and "usage" property.');return typeof e.usage.promptTokens!="number"&&(e.usage.promptTokens=Number.NaN),typeof e.usage.completionTokens!="number"&&(e.usage.completionTokens=Number.NaN),{type:"finish_message",value:e}}},Vre=[hd,pd,gd,md,vd,bd,yd,xd,wd,_d,Sd,Cd,Ed,Rd],Hre={[hd.code]:hd,[pd.code]:pd,[gd.code]:gd,[md.code]:md,[vd.code]:vd,[bd.code]:bd,[yd.code]:yd,[xd.code]:xd,[wd.code]:wd,[_d.code]:_d,[Sd.code]:Sd,[Cd.code]:Cd,[Ed.code]:Ed,[Rd.code]:Rd};hd.name+"",hd.code,pd.name+"",pd.code,gd.name+"",gd.code,md.name+"",md.code,vd.name+"",vd.code,bd.name+"",bd.code,yd.name+"",yd.code,xd.name+"",xd.code,wd.name+"",wd.code,_d.name+"",_d.code,Sd.name+"",Sd.code,Cd.name+"",Cd.code,Ed.name+"",Ed.code,Rd.name+"",Rd.code;var Wre=Vre.map(e=>e.code),mM=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(!Wre.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 Hre[r].parse(i)},Ure=10;function qre(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*Gre(e,{isAborted:t}={}){const n=new TextDecoder,r=[];let o=0;for(;;){const{value:i}=await e.read();if(i&&(r.push(i),o+=i.length,i[i.length-1]!==Ure))continue;if(r.length===0)break;const s=qre(r,o);o=0;const a=n.decode(s,{stream:!0}).split(`
|
|
396
|
+
`).filter(l=>l!=="").map(mM);for(const l of a)yield l;if(t!=null&&t()){e.cancel();break}}}function Qh(e,t){return!e||!t||!t.length?e:{...e,annotations:[...t]}}async function Yre({reader:e,abortControllerRef:t,update:n,onToolCall:r,onFinish:o,generateId:i=gM,getCurrentDate:s=()=>new Date}){var a;const l=s(),c={data:[]};let u;const f={};let p={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},g="unknown";for await(const{type:v,value:b}of Gre(e,{isAborted:()=>(t==null?void 0:t.current)===null})){if(v==="text"&&(c.text?c.text={...c.text,content:(c.text.content||"")+b}:c.text={id:i(),role:"assistant",content:b,createdAt:l}),v==="finish_message"){const{completionTokens:R,promptTokens:E}=b.usage;g=b.finishReason,p={completionTokens:R,promptTokens:E,totalTokens:R+E}}if(v==="tool_call_streaming_start")c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),f[b.toolCallId]={text:"",toolName:b.toolName,prefixMapIndex:c.text.toolInvocations.length},c.text.toolInvocations.push({state:"partial-call",toolCallId:b.toolCallId,toolName:b.toolName,args:void 0});else if(v==="tool_call_delta"){const R=f[b.toolCallId];R.text+=b.argsTextDelta,c.text.toolInvocations[R.prefixMapIndex]={state:"partial-call",toolCallId:b.toolCallId,toolName:R.toolName,args:Bre(R.text)},c.text.internalUpdateId=i()}else if(v==="tool_call"){if(f[b.toolCallId]!=null?c.text.toolInvocations[f[b.toolCallId].prefixMapIndex]={state:"call",...b}:(c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),c.text.toolInvocations.push({state:"call",...b})),c.text.internalUpdateId=i(),r){const R=await r({toolCall:b});R!=null&&(c.text.toolInvocations[c.text.toolInvocations.length-1]={state:"result",...b,result:R})}}else if(v==="tool_result"){const R=(a=c.text)==null?void 0:a.toolInvocations;if(R==null)throw new Error("tool_result must be preceded by a tool_call");const E=R.findIndex(O=>O.toolCallId===b.toolCallId);if(E===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");R[E]={...R[E],state:"result",...b}}let x=null;v==="function_call"&&(c.function_call={id:i(),role:"assistant",content:"",function_call:b.function_call,name:b.function_call.name,createdAt:l},x=c.function_call);let w=null;v==="tool_calls"&&(c.tool_calls={id:i(),role:"assistant",content:"",tool_calls:b.tool_calls,createdAt:l},w=c.tool_calls),v==="data"&&c.data.push(...b);let _=c.text;v==="message_annotations"&&(u?u.push(...b):u=[...b],x=Qh(c.function_call,u),w=Qh(c.tool_calls,u),_=Qh(c.text,u)),u!=null&&u.length&&["text","function_call","tool_calls"].forEach(E=>{c[E]&&(c[E].annotations=[...u])});const S=[x,w,_].filter(Boolean).map(R=>({...Qh(R,u)}));n(S,[...c.data])}return o==null||o({prefixMap:c,finishReason:g,usage:p}),{messages:[c.text,c.function_call,c.tool_calls].filter(Boolean),data:c.data}}var Kre=()=>fetch;async function Xre({api:e,body:t,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:f,fetch:p=Kre()}){var g,v;const b=await p(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(g=i==null?void 0:i())==null?void 0:g.signal,credentials:r}).catch(w=>{throw s(),w});if(a)try{await a(b)}catch(w){throw w}if(!b.ok)throw s(),new Error((v=await b.text())!=null?v:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");const x=b.body.getReader();switch(n){case"text":{const w=Qre(),_={id:f(),createdAt:new Date,role:"assistant",content:""};for(;;){const{done:S,value:R}=await x.read();if(S)break;if(_.content+=w(R),l([{..._}],[]),(i==null?void 0:i())===null){x.cancel();break}}return c==null||c(_,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"}),{messages:[_],data:[]}}case"data":return await Yre({reader:x,abortControllerRef:i!=null?{current:i()}:void 0,update:l,onToolCall:u,onFinish({prefixMap:w,finishReason:_,usage:S}){c&&w.text!=null&&c(w.text,{usage:S,finishReason:_})},generateId:f});default:{const w=n;throw new Error(`Unknown stream protocol: ${w}`)}}}function Qre(e){const t=new TextDecoder;return e?function(n){return t.decode(n,{stream:!0}).split(`
|
|
397
|
+
`).filter(o=>o!=="").map(mM).filter(Boolean)}:function(n){return n?t.decode(n,{stream:!0}):""}}async function Jre({getStreamedResponse:e,experimental_onFunctionCall:t,experimental_onToolCall:n,updateChatRequest:r,getCurrentMessages:o}){for(;;){const i=await e();if("messages"in i){let s=!1;for(const a of i.messages)if(!((a.function_call===void 0||typeof a.function_call=="string")&&(a.tool_calls===void 0||typeof a.tool_calls=="string"))){if(s=!0,t){const l=a.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0){s=!1;break}r(c)}if(n){const l=a.tool_calls;if(!Array.isArray(l)||l.some(u=>typeof u!="object")){console.warn("experimental_onToolCall should not be defined when using tools");continue}const c=await n(o(),l);if(c===void 0){s=!1;break}r(c)}}if(!s)break}else{let s=function(l){for(const c of l.messages){if(c.tool_calls!==void 0)for(const u of c.tool_calls)typeof u=="object"&&u.function.arguments&&typeof u.function.arguments!="string"&&(u.function.arguments=JSON.stringify(u.function.arguments));c.function_call!==void 0&&typeof c.function_call=="object"&&c.function_call.arguments&&typeof c.function_call.arguments!="string"&&(c.function_call.arguments=JSON.stringify(c.function_call.arguments))}};const a=i;if((a.function_call===void 0||typeof a.function_call=="string")&&(a.tool_calls===void 0||typeof a.tool_calls=="string"))break;if(t){const l=a.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0)break;s(c),r(c)}if(n){const l=a.tool_calls;if(typeof l!="object"){console.warn("experimental_onToolCall should not be defined when using functions");continue}const c=await n(o(),l);if(c===void 0)break;s(c),r(c)}}}}var Zre=lx();const Ds=()=>{},Cr=Ds(),Ub=Object,Tt=e=>e===Cr,Jo=e=>typeof e=="function",zs=(e,t)=>({...e,...t}),eoe=e=>Jo(e.then),Jh=new WeakMap;let toe=0;const Pd=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(Ub(e)===e&&!r&&n!=RegExp){if(o=Jh.get(e),o)return o;if(o=++toe+"~",Jh.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=Pd(e[i])+",";Jh.set(e,o)}if(n==Ub){o="#";const s=Ub.keys(e).sort();for(;!Tt(i=s.pop());)Tt(e[i])||(o+=i+":"+Pd(e[i])+",");Jh.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Mi=new WeakMap,qb={},Zh={},m1="undefined",fm=typeof window!=m1,Fy=typeof document!=m1,noe=()=>fm&&typeof window.requestAnimationFrame!=m1,vM=(e,t)=>{const n=Mi.get(e);return[()=>!Tt(t)&&e.get(t)||qb,r=>{if(!Tt(t)){const o=e.get(t);t in Zh||(Zh[t]=o),n[5](t,zs(o,r),o||qb)}},n[6],()=>!Tt(t)&&t in Zh?Zh[t]:!Tt(t)&&e.get(t)||qb]};let zy=!0;const roe=()=>zy,[jy,By]=fm&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Ds,Ds],ooe=()=>{const e=Fy&&document.visibilityState;return Tt(e)||e!=="hidden"},ioe=e=>(Fy&&document.addEventListener("visibilitychange",e),jy("focus",e),()=>{Fy&&document.removeEventListener("visibilitychange",e),By("focus",e)}),soe=e=>{const t=()=>{zy=!0,e()},n=()=>{zy=!1};return jy("online",t),jy("offline",n),()=>{By("online",t),By("offline",n)}},aoe={isOnline:roe,isVisible:ooe},loe={initFocus:ioe,initReconnect:soe},j2=!m.useId,Od=!fm||"Deno"in window,coe=e=>noe()?window.requestAnimationFrame(e):setTimeout(e,1),Gb=Od?m.useEffect:m.useLayoutEffect,Yb=typeof navigator<"u"&&navigator.connection,B2=!Od&&Yb&&(["slow-2g","2g"].includes(Yb.effectiveType)||Yb.saveData),v1=e=>{if(Jo(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Pd(e):"",[e,t]};let uoe=0;const Vy=()=>++uoe,bM=0,yM=1,xM=2,doe=3;var _u={__proto__:null,ERROR_REVALIDATE_EVENT:doe,FOCUS_EVENT:bM,MUTATE_EVENT:xM,RECONNECT_EVENT:yM};async function wM(...e){const[t,n,r,o]=e,i=zs({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(Jo(n)){const p=n,g=[],v=t.keys();for(const b of v)!/^\$(inf|sub)\$/.test(b)&&p(t.get(b)._k)&&g.push(b);return Promise.all(g.map(f))}return f(n);async function f(p){const[g]=v1(p);if(!g)return;const[v,b]=vM(t,g),[x,w,_,S]=Mi.get(t),R=()=>{const Q=x[g];return(Jo(i.revalidate)?i.revalidate(v().data,p):i.revalidate!==!1)&&(delete _[g],delete S[g],Q&&Q[0])?Q[0](xM).then(()=>v().data):v().data};if(e.length<3)return R();let E=r,O;const k=Vy();w[g]=[k,0];const M=!Tt(l),D=v(),I=D.data,z=D._c,j=Tt(z)?I:z;if(M&&(l=Jo(l)?l(j,I):l,b({data:l,_c:j})),Jo(E))try{E=E(j)}catch(Q){O=Q}if(E&&eoe(E))if(E=await E.catch(Q=>{O=Q}),k!==w[g][0]){if(O)throw O;return E}else O&&M&&c(O)&&(s=!0,b({data:j,_c:Cr}));if(s&&!O)if(Jo(s)){const Q=s(E,j);b({data:Q,error:Cr,_c:Cr})}else b({data:E,error:Cr,_c:Cr});if(w[g][1]=Vy(),Promise.resolve(R()).then(()=>{b({_c:Cr})}),O){if(u)throw O;return}return E}}const V2=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},foe=(e,t)=>{if(!Mi.has(e)){const n=zs(loe,t),r={},o=wM.bind(Cr,e);let i=Ds;const s={},a=(u,f)=>{const p=s[u]||[];return s[u]=p,p.push(f),()=>p.splice(p.indexOf(f),1)},l=(u,f,p)=>{e.set(u,f);const g=s[u];if(g)for(const v of g)v(f,p)},c=()=>{if(!Mi.has(e)&&(Mi.set(e,[r,{},{},{},o,l,a]),!Od)){const u=n.initFocus(setTimeout.bind(Cr,V2.bind(Cr,r,bM))),f=n.initReconnect(setTimeout.bind(Cr,V2.bind(Cr,r,yM)));i=()=>{u&&u(),f&&f(),Mi.delete(e)}}};return c(),[e,o,c,i]}return[e,Mi.get(e)[4]]},hoe=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Tt(i)&&s>i||setTimeout(r,a,o)},poe=(e,t)=>Pd(e)==Pd(t),[_M,goe]=foe(new Map),moe=zs({onLoadingSlow:Ds,onSuccess:Ds,onError:Ds,onErrorRetry:hoe,onDiscarded:Ds,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:B2?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:B2?5e3:3e3,compare:poe,isPaused:()=>!1,cache:_M,mutate:goe,fallback:{}},aoe),voe=(e,t)=>{const n=zs(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=zs(o,s))}return n},boe=m.createContext({}),yoe="$inf$",SM=fm&&window.__SWR_DEVTOOLS_USE__,xoe=SM?window.__SWR_DEVTOOLS_USE__:[],woe=()=>{SM&&(window.__SWR_DEVTOOLS_REACT__=m)},_oe=e=>Jo(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Soe=()=>zs(moe,m.useContext(boe)),Coe=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=v1(t),[,,,a]=Mi.get(_M);if(s.startsWith(yoe))return n(...i);const l=a[s];return Tt(l)?n(...i):(delete a[s],l)}),r),Eoe=xoe.concat(Coe),Roe=e=>function(...n){const r=Soe(),[o,i,s]=_oe(n),a=voe(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(Eoe);for(let f=u.length;f--;)l=u[f](l);return l(o,i||a.fetcher||null,a)},Poe=(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())}};woe();const H2=m.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),Kb={dedupe:!0},Ooe=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:f,keepPreviousData:p}=n,[g,v,b,x]=Mi.get(r),[w,_]=v1(e),S=m.useRef(!1),R=m.useRef(!1),E=m.useRef(w),O=m.useRef(t),k=m.useRef(n),M=()=>k.current,D=()=>M().isVisible()&&M().isOnline(),[I,z,j,Q]=vM(r,w),U=m.useRef({}).current,B=Tt(s)?n.fallback[w]:s,K=(G,me)=>{for(const _e in U){const Pe=_e;if(Pe==="data"){if(!o(G[Pe],me[Pe])&&(!Tt(G[Pe])||!o(ae,me[Pe])))return!1}else if(me[Pe]!==G[Pe])return!1}return!0},H=m.useMemo(()=>{const G=!w||!t?!1:Tt(a)?M().isPaused()||i?!1:Tt(l)?!0:l:a,me=ke=>{const Ge=zs(ke);return delete Ge._k,G?{isValidating:!0,isLoading:!0,...Ge}:Ge},_e=I(),Pe=Q(),$e=me(_e),Ve=_e===Pe?$e:me(Pe);let Fe=$e;return[()=>{const ke=me(I());return K(ke,Fe)?(Fe.data=ke.data,Fe.isLoading=ke.isLoading,Fe.isValidating=ke.isValidating,Fe.error=ke.error,Fe):(Fe=ke,ke)},()=>Ve]},[r,w]),q=Zre.useSyncExternalStore(m.useCallback(G=>j(w,(me,_e)=>{K(_e,me)||G()}),[r,w]),H[0],H[1]),Z=!S.current,T=g[w]&&g[w].length>0,V=q.data,X=Tt(V)?B:V,N=q.error,se=m.useRef(X),ae=p?Tt(V)?se.current:V:X,ue=T&&!Tt(N)?!1:Z&&!Tt(a)?a:M().isPaused()?!1:i?Tt(X)?!1:l:Tt(X)||l,fe=!!(w&&t&&Z&&ue),oe=Tt(q.isValidating)?fe:q.isValidating,ee=Tt(q.isLoading)?fe:q.isLoading,ie=m.useCallback(async G=>{const me=O.current;if(!w||!me||R.current||M().isPaused())return!1;let _e,Pe,$e=!0;const Ve=G||{},Fe=!b[w]||!Ve.dedupe,ke=()=>j2?!R.current&&w===E.current&&S.current:w===E.current,Ge={isValidating:!1,isLoading:!1},ct=()=>{z(Ge)},kt=()=>{const cn=b[w];cn&&cn[1]===Pe&&delete b[w]},Dt={isValidating:!0};Tt(I().data)&&(Dt.isLoading=!0);try{if(Fe&&(z(Dt),n.loadingTimeout&&Tt(I().data)&&setTimeout(()=>{$e&&ke()&&M().onLoadingSlow(w,n)},n.loadingTimeout),b[w]=[me(_),Vy()]),[_e,Pe]=b[w],_e=await _e,Fe&&setTimeout(kt,n.dedupingInterval),!b[w]||b[w][1]!==Pe)return Fe&&ke()&&M().onDiscarded(w),!1;Ge.error=Cr;const cn=v[w];if(!Tt(cn)&&(Pe<=cn[0]||Pe<=cn[1]||cn[1]===0))return ct(),Fe&&ke()&&M().onDiscarded(w),!1;const de=I().data;Ge.data=o(de,_e)?de:_e,Fe&&ke()&&M().onSuccess(_e,w,n)}catch(cn){kt();const de=M(),{shouldRetryOnError:Se}=de;de.isPaused()||(Ge.error=cn,Fe&&ke()&&(de.onError(cn,w,de),(Se===!0||Jo(Se)&&Se(cn))&&(!M().revalidateOnFocus||!M().revalidateOnReconnect||D())&&de.onErrorRetry(cn,w,de,Ie=>{const qe=g[w];qe&&qe[0]&&qe[0](_u.ERROR_REVALIDATE_EVENT,Ie)},{retryCount:(Ve.retryCount||0)+1,dedupe:!0})))}return $e=!1,ct(),!0},[w,r]),be=m.useCallback((...G)=>wM(r,E.current,...G),[]);if(Gb(()=>{O.current=t,k.current=n,Tt(V)||(se.current=V)}),Gb(()=>{if(!w)return;const G=ie.bind(Cr,Kb);let me=0;const Pe=Poe(w,g,($e,Ve={})=>{if($e==_u.FOCUS_EVENT){const Fe=Date.now();M().revalidateOnFocus&&Fe>me&&D()&&(me=Fe+M().focusThrottleInterval,G())}else if($e==_u.RECONNECT_EVENT)M().revalidateOnReconnect&&D()&&G();else{if($e==_u.MUTATE_EVENT)return ie();if($e==_u.ERROR_REVALIDATE_EVENT)return ie(Ve)}});return R.current=!1,E.current=w,S.current=!0,z({_k:_}),ue&&(Tt(X)||Od?G():coe(G)),()=>{R.current=!0,Pe()}},[w]),Gb(()=>{let G;function me(){const Pe=Jo(c)?c(I().data):c;Pe&&G!==-1&&(G=setTimeout(_e,Pe))}function _e(){!I().error&&(u||M().isVisible())&&(f||M().isOnline())?ie(Kb).then(me):me()}return me(),()=>{G&&(clearTimeout(G),G=-1)}},[c,u,f,w]),m.useDebugValue(ae),i&&Tt(X)&&w){if(!j2&&Od)throw new Error("Fallback data is required when using suspense in SSR.");O.current=t,k.current=n,R.current=!1;const G=x[w];if(!Tt(G)){const me=be(G);H2(me)}if(Tt(N)){const me=ie(Kb);Tt(ae)||(me.status="fulfilled",me.value=!0),H2(me)}else throw N}return{mutate:be,get data(){return U.data=!0,ae},get error(){return U.error=!0,N},get isValidating(){return U.isValidating=!0,oe},get isLoading(){return U.isLoading=!0,ee}}},ep=Roe(Ooe);var $oe=async(e,t,n,r,o,i,s,a,l,c,u,f,p,g,v,b,x)=>{var w;const _=s.current;n(t.messages,!1);const S=g?t.messages:t.messages.map(({role:R,content:E,experimental_attachments:O,name:k,data:M,annotations:D,toolInvocations:I,function_call:z,tool_calls:j,tool_call_id:Q})=>({role:R,content:E,...O!==void 0&&{experimental_attachments:O},...k!==void 0&&{name:k},...M!==void 0&&{data:M},...D!==void 0&&{annotations:D},...I!==void 0&&{toolInvocations:I},tool_call_id:Q,...z!==void 0&&{function_call:z},...j!==void 0&&{tool_calls:j}}));return await Xre({api:e,body:(w=v==null?void 0:v({messages:t.messages,requestData:t.data,requestBody:t.body}))!=null?w:{messages:S,data:t.data,...i.current.body,...t.body,...t.functions!==void 0&&{functions:t.functions},...t.function_call!==void 0&&{function_call:t.function_call},...t.tools!==void 0&&{tools:t.tools},...t.tool_choice!==void 0&&{tool_choice:t.tool_choice}},streamProtocol:c,credentials:i.current.credentials,headers:{...i.current.headers,...t.headers},abortController:()=>a.current,restoreMessagesOnFailure(){x||n(_,!1)},onResponse:f,onUpdate(R,E){n([...t.messages,...R],!1),r([...o||[],...E||[]],!1)},onToolCall:p,onFinish:u,generateId:l,fetch:b})};function Doe({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,experimental_onFunctionCall:i,experimental_onToolCall:s,onToolCall:a,experimental_prepareRequestBody:l,experimental_maxAutomaticRoundtrips:c=0,maxAutomaticRoundtrips:u=c,maxToolRoundtrips:f=u,streamMode:p,streamProtocol:g,onResponse:v,onFinish:b,onError:x,credentials:w,headers:_,body:S,generateId:R=gM,fetch:E,keepLastMessageOnError:O=!1}={}){p&&(g??(g=p==="text"?"text":void 0));const k=m.useId(),M=t??k,D=typeof e=="string"?[e,M]:M,[I]=m.useState([]),{data:z,mutate:j}=ep([D,"messages"],null,{fallbackData:n??I}),{data:Q=!1,mutate:U}=ep([D,"loading"],null),{data:B,mutate:K}=ep([D,"streamData"],null),{data:H=void 0,mutate:q}=ep([D,"error"],null),Z=m.useRef(z||[]);m.useEffect(()=>{Z.current=z||[]},[z]);const T=m.useRef(null),V=m.useRef({credentials:w,headers:_,body:S});m.useEffect(()=>{V.current={credentials:w,headers:_,body:S}},[w,_,S]);const X=m.useCallback(async G=>{const me=Z.current.length;try{U(!0),q(void 0);const $e=new AbortController;T.current=$e,await Jre({getStreamedResponse:()=>$oe(e,G,j,K,B,V,Z,T,R,g,b,v,a,o,l,E,O),experimental_onFunctionCall:i,experimental_onToolCall:s,updateChatRequest:Ve=>{G=Ve},getCurrentMessages:()=>Z.current}),T.current=null}catch($e){if($e.name==="AbortError")return T.current=null,null;x&&$e instanceof Error&&x($e),q($e)}finally{U(!1)}const _e=Z.current,Pe=_e[_e.length-1];_e.length>me&&Pe!=null&&f>0&&W2(Pe)&&Toe(_e)<=f&&await X({messages:_e})},[j,U,e,V,v,b,x,q,K,B,g,o,i,s,l,a,f,Z,T,R,E,O]),N=m.useCallback(async(G,{options:me,functions:_e,function_call:Pe,tools:$e,tool_choice:Ve,data:Fe,headers:ke,body:Ge}={})=>{G.id||(G.id=R());const ct={headers:ke??(me==null?void 0:me.headers),body:Ge??(me==null?void 0:me.body)},kt={messages:Z.current.concat(G),options:ct,headers:ct.headers,body:ct.body,data:Fe,..._e!==void 0&&{functions:_e},...Pe!==void 0&&{function_call:Pe},...$e!==void 0&&{tools:$e},...Ve!==void 0&&{tool_choice:Ve}};return X(kt)},[X,R]),se=m.useCallback(async({options:G,functions:me,function_call:_e,tools:Pe,tool_choice:$e,data:Ve,headers:Fe,body:ke}={})=>{if(Z.current.length===0)return null;const Ge={headers:Fe??(G==null?void 0:G.headers),body:ke??(G==null?void 0:G.body)};if(Z.current[Z.current.length-1].role==="assistant"){const Dt={messages:Z.current.slice(0,-1),options:Ge,headers:Ge.headers,body:Ge.body,data:Ve,...me!==void 0&&{functions:me},..._e!==void 0&&{function_call:_e},...Pe!==void 0&&{tools:Pe},...$e!==void 0&&{tool_choice:$e}};return X(Dt)}const kt={messages:Z.current,options:Ge,headers:Ge.headers,body:Ge.body,data:Ve,...me!==void 0&&{functions:me},..._e!==void 0&&{function_call:_e},...Pe!==void 0&&{tools:Pe},...$e!==void 0&&{tool_choice:$e}};return X(kt)},[X]),ae=m.useCallback(()=>{T.current&&(T.current.abort(),T.current=null)},[]),ue=m.useCallback(G=>{typeof G=="function"&&(G=G(Z.current)),j(G,!1),Z.current=G},[j]),[fe,oe]=m.useState(r),ee=m.useCallback(async(G,me={},_e)=>{var Pe,$e,Ve,Fe,ke;if((Pe=G==null?void 0:G.preventDefault)==null||Pe.call(G),!fe&&!me.allowEmptySubmit)return;_e&&(V.current={...V.current,..._e});const Ge=[],ct=me.experimental_attachments;if(ct)if(ct instanceof FileList)for(const de of Array.from(ct)){const{name:Se,type:Ie}=de,qe=await new Promise((Je,Gt)=>{const Jt=new FileReader;Jt.onload=un=>{var Pn;Je((Pn=un.target)==null?void 0:Pn.result)},Jt.onerror=un=>Gt(un),Jt.readAsDataURL(de)});Ge.push({name:Se,contentType:Ie,url:qe})}else if(Array.isArray(ct))for(const de of ct){const{name:Se,url:Ie,contentType:qe}=de;Ge.push({name:Se,contentType:qe,url:Ie})}else throw new Error("Invalid attachments type");const kt={headers:(Ve=me.headers)!=null?Ve:($e=me.options)==null?void 0:$e.headers,body:(ke=me.body)!=null?ke:(Fe=me.options)==null?void 0:Fe.body},cn={messages:!fe&&me.allowEmptySubmit?Z.current:Z.current.concat({id:R(),createdAt:new Date,role:"user",content:fe,experimental_attachments:Ge.length>0?Ge:void 0}),options:kt,headers:kt.headers,body:kt.body,data:me.data};X(cn),oe("")},[fe,R,X]),ie=G=>{oe(G.target.value)},be=({toolCallId:G,result:me})=>{const _e=Z.current.map(($e,Ve,Fe)=>Ve===Fe.length-1&&$e.role==="assistant"&&$e.toolInvocations?{...$e,toolInvocations:$e.toolInvocations.map(ke=>ke.toolCallId===G?{...ke,result:me}:ke)}:$e);j(_e,!1);const Pe=_e[_e.length-1];W2(Pe)&&X({messages:_e})};return{messages:z||[],error:H,append:N,reload:se,stop:ae,setMessages:ue,input:fe,setInput:oe,handleInputChange:ie,handleSubmit:ee,isLoading:Q,data:B,addToolResult:be,experimental_addToolResult:be}}function W2(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function Toe(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}function koe(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const CM="ScrollArea",[EM,Qpe]=Bn(CM),[Moe,So]=EM(CM),RM=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=m.useState(null),[c,u]=m.useState(null),[f,p]=m.useState(null),[g,v]=m.useState(null),[b,x]=m.useState(null),[w,_]=m.useState(0),[S,R]=m.useState(0),[E,O]=m.useState(!1),[k,M]=m.useState(!1),D=lt(t,z=>l(z)),I=Xa(o);return m.createElement(Moe,{scope:n,type:r,dir:I,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:f,onContentChange:p,scrollbarX:g,onScrollbarXChange:v,scrollbarXEnabled:E,onScrollbarXEnabledChange:O,scrollbarY:b,onScrollbarYChange:x,scrollbarYEnabled:k,onScrollbarYEnabledChange:M,onCornerWidthChange:_,onCornerHeightChange:R},m.createElement(Ue.div,le({dir:I},s,{ref:D,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})))}),Aoe="ScrollAreaViewport",Ioe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=So(Aoe,n),s=m.useRef(null),a=lt(t,s,i.onViewportChange);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(Ue.div,le({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),m.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Yi="ScrollAreaScrollbar",PM=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=So(Yi,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return m.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?m.createElement(Noe,le({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(Loe,le({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(OM,le({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(b1,le({},r,{ref:t})):null}),Noe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=So(Yi,e.__scopeScrollArea),[i,s]=m.useState(!1);return m.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]),m.createElement(Rn,{present:n||i},m.createElement(OM,le({"data-state":i?"visible":"hidden"},r,{ref:t})))}),Loe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=So(Yi,e.__scopeScrollArea),i=e.orientation==="horizontal",s=pm(()=>l("SCROLL_END"),100),[a,l]=koe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),m.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let f=c[u];const p=()=>{const g=c[u];f!==g&&(l("SCROLL"),s()),f=g};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),m.createElement(Rn,{present:n||a!=="hidden"},m.createElement(b1,le({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Re(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),OM=m.forwardRef((e,t)=>{const n=So(Yi,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=m.useState(!1),a=e.orientation==="horizontal",l=pm(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Rc(n.viewport,l),Rc(n.content,l),m.createElement(Rn,{present:r||i},m.createElement(b1,le({"data-state":i?"visible":"hidden"},o,{ref:t})))}),b1=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=So(Yi,e.__scopeScrollArea),i=m.useRef(null),s=m.useRef(0),[a,l]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=kM(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 f(p,g){return Uoe(p,s.current,a,g)}return n==="horizontal"?m.createElement(Foe,le({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,g=U2(p,a,o.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}})):n==="vertical"?m.createElement(zoe,le({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,g=U2(p,a);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}})):null}),Foe=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=So(Yi,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=lt(t,l,i.onScrollbarXChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(DM,le({"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":hm(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),AM(p,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:ag(s.paddingLeft),paddingEnd:ag(s.paddingRight)}})}}))}),zoe=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=So(Yi,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=lt(t,l,i.onScrollbarYChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(DM,le({"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":hm(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),AM(p,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:ag(s.paddingTop),paddingEnd:ag(s.paddingBottom)}})}}))}),[joe,$M]=EM(Yi),DM=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:f,...p}=e,g=So(Yi,n),[v,b]=m.useState(null),x=lt(t,D=>b(D)),w=m.useRef(null),_=m.useRef(""),S=g.viewport,R=r.content-r.viewport,E=Mn(u),O=Mn(l),k=pm(f,10);function M(D){if(w.current){const I=D.clientX-w.current.left,z=D.clientY-w.current.top;c({x:I,y:z})}}return m.useEffect(()=>{const D=I=>{const z=I.target;(v==null?void 0:v.contains(z))&&E(I,R)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[S,v,R,E]),m.useEffect(O,[r,O]),Rc(v,k),Rc(g.content,k),m.createElement(joe,{scope:n,scrollbar:v,hasThumb:o,onThumbChange:Mn(i),onThumbPointerUp:Mn(s),onThumbPositionChange:O,onThumbPointerDown:Mn(a)},m.createElement(Ue.div,le({},p,{ref:x,style:{position:"absolute",...p.style},onPointerDown:Re(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),w.current=v.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),M(D))}),onPointerMove:Re(e.onPointerMove,M),onPointerUp:Re(e.onPointerUp,D=>{const I=D.target;I.hasPointerCapture(D.pointerId)&&I.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),w.current=null})})))}),Hy="ScrollAreaThumb",Boe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=$M(Hy,e.__scopeScrollArea);return m.createElement(Rn,{present:n||o.hasThumb},m.createElement(Voe,le({ref:t},r)))}),Voe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=So(Hy,n),s=$M(Hy,n),{onThumbPositionChange:a}=s,l=lt(t,f=>s.onThumbChange(f)),c=m.useRef(),u=pm(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(u(),!c.current){const g=qoe(f,a);c.current=g,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,u,a]),m.createElement(Ue.div,le({"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:Re(e.onPointerDownCapture,f=>{const g=f.target.getBoundingClientRect(),v=f.clientX-g.left,b=f.clientY-g.top;s.onThumbPointerDown({x:v,y:b})}),onPointerUp:Re(e.onPointerUp,s.onThumbPointerUp)}))}),TM="ScrollAreaCorner",Hoe=m.forwardRef((e,t)=>{const n=So(TM,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(Woe,le({},e,{ref:t})):null}),Woe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=So(TM,n),[i,s]=m.useState(0),[a,l]=m.useState(0),c=!!(i&&a);return Rc(o.scrollbarX,()=>{var u;const f=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(f),l(f)}),Rc(o.scrollbarY,()=>{var u;const f=((u=o.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;o.onCornerWidthChange(f),s(f)}),c?m.createElement(Ue.div,le({},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 ag(e){return e?parseInt(e,10):0}function kM(e,t){const n=e/t;return isNaN(n)?0:n}function hm(e){const t=kM(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Uoe(e,t,n,r="ltr"){const o=hm(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,f=r==="ltr"?[0,u]:[u*-1,0];return MM([l,c],f)(e)}function U2(e,t,n="ltr"){const r=hm(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=Oy(e,l);return MM([0,s],[0,a])(c)}function MM(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 AM(e,t){return e>0&&e<t}const qoe=(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 pm(e,t){const n=Mn(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Rc(e,t){const n=Mn(t);tr(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const IM=RM,Goe=Ioe,Yoe=Hoe,y1=pe.forwardRef(({className:e,children:t,...n},r)=>P.jsxs(IM,{ref:r,className:Ee("relative overflow-hidden",e),...n,children:[P.jsx(Goe,{className:"h-full w-full rounded-[inherit]",children:t}),P.jsx(gm,{}),P.jsx(Yoe,{})]}));y1.displayName=IM.displayName;const gm=pe.forwardRef(({className:e,orientation:t="vertical",...n},r)=>P.jsx(PM,{ref:r,orientation:t,className:Ee("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:P.jsx(Boe,{className:"relative flex-1 rounded-full bg-border"})}));gm.displayName=PM.displayName;const NM="Switch",[Koe,Jpe]=Bn(NM),[Xoe,Qoe]=Koe(NM),Joe=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,p]=m.useState(null),g=lt(t,_=>p(_)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[x=!1,w]=nr({prop:o,defaultProp:i,onChange:c});return m.createElement(Xoe,{scope:n,checked:x,disabled:a},m.createElement(Ue.button,le({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":LM(x),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:g,onClick:Re(e.onClick,_=>{w(S=>!S),b&&(v.current=_.isPropagationStopped(),v.current||_.stopPropagation())})})),b&&m.createElement(tie,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Zoe="SwitchThumb",eie=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Qoe(Zoe,n);return m.createElement(Ue.span,le({"data-state":LM(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),tie=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Jg(n),a=Ug(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",le({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 LM(e){return e?"checked":"unchecked"}const mm=Joe,FM=eie,zM=pe.forwardRef(({className:e,...t},n)=>P.jsx(mm,{className:Ee("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:P.jsx(FM,{className:Ee("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")})}));zM.displayName=mm.displayName;const nie=pe.forwardRef(({className:e,...t},n)=>P.jsx(mm,{className:Ee("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:P.jsx(FM,{className:Ee("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")})}));nie.displayName=mm.displayName;function rie(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const oie=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iie=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sie={};function q2(e,t){return((t||sie).jsx?iie:oie).test(e)}const aie=/[ \t\n\f\r]/g;function lie(e){return typeof e=="object"?e.type==="text"?G2(e.value):!1:G2(e)}function G2(e){return e.replace(aie,"")===""}class xf{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}xf.prototype.property={};xf.prototype.normal={};xf.prototype.space=null;function jM(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new xf(n,r,t)}function Wy(e){return e.toLowerCase()}class Co{constructor(t,n){this.property=t,this.attribute=n}}Co.prototype.space=null;Co.prototype.boolean=!1;Co.prototype.booleanish=!1;Co.prototype.overloadedBoolean=!1;Co.prototype.number=!1;Co.prototype.commaSeparated=!1;Co.prototype.spaceSeparated=!1;Co.prototype.commaOrSpaceSeparated=!1;Co.prototype.mustUseProperty=!1;Co.prototype.defined=!1;let cie=0;const ft=il(),Cn=il(),BM=il(),Oe=il(),Kt=il(),Yl=il(),zr=il();function il(){return 2**++cie}const Uy=Object.freeze(Object.defineProperty({__proto__:null,boolean:ft,booleanish:Cn,commaOrSpaceSeparated:zr,commaSeparated:Yl,number:Oe,overloadedBoolean:BM,spaceSeparated:Kt},Symbol.toStringTag,{value:"Module"})),Xb=Object.keys(Uy);class x1 extends Co{constructor(t,n,r,o){let i=-1;if(super(t,n),Y2(this,"space",o),typeof r=="number")for(;++i<Xb.length;){const s=Xb[i];Y2(this,Xb[i],(r&Uy[s])===Uy[s])}}}x1.prototype.defined=!0;function Y2(e,t,n){n&&(e[t]=n)}const uie={}.hasOwnProperty;function Lc(e){const t={},n={};let r;for(r in e.properties)if(uie.call(e.properties,r)){const o=e.properties[r],i=new x1(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Wy(r)]=r,n[Wy(i.attribute)]=r}return new xf(t,n,e.space)}const VM=Lc({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),HM=Lc({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function WM(e,t){return t in e?e[t]:t}function UM(e,t){return WM(e,t.toLowerCase())}const qM=Lc({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:UM,properties:{xmlns:null,xmlnsXLink:null}}),GM=Lc({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Cn,ariaAutoComplete:null,ariaBusy:Cn,ariaChecked:Cn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Kt,ariaCurrent:null,ariaDescribedBy:Kt,ariaDetails:null,ariaDisabled:Cn,ariaDropEffect:Kt,ariaErrorMessage:null,ariaExpanded:Cn,ariaFlowTo:Kt,ariaGrabbed:Cn,ariaHasPopup:null,ariaHidden:Cn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Kt,ariaLevel:Oe,ariaLive:null,ariaModal:Cn,ariaMultiLine:Cn,ariaMultiSelectable:Cn,ariaOrientation:null,ariaOwns:Kt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Cn,ariaReadOnly:Cn,ariaRelevant:null,ariaRequired:Cn,ariaRoleDescription:Kt,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:Cn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null}}),die=Lc({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:UM,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Yl,acceptCharset:Kt,accessKey:Kt,action:null,allow:null,allowFullScreen:ft,allowPaymentRequest:ft,allowUserMedia:ft,alt:null,as:null,async:ft,autoCapitalize:null,autoComplete:Kt,autoFocus:ft,autoPlay:ft,blocking:Kt,capture:null,charSet:null,checked:ft,cite:null,className:Kt,cols:Oe,colSpan:null,content:null,contentEditable:Cn,controls:ft,controlsList:Kt,coords:Oe|Yl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ft,defer:ft,dir:null,dirName:null,disabled:ft,download:BM,draggable:Cn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ft,formTarget:null,headers:Kt,height:Oe,hidden:ft,high:Oe,href:null,hrefLang:null,htmlFor:Kt,httpEquiv:Kt,id:null,imageSizes:null,imageSrcSet:null,inert:ft,inputMode:null,integrity:null,is:null,isMap:ft,itemId:null,itemProp:Kt,itemRef:Kt,itemScope:ft,itemType:Kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ft,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:ft,muted:ft,name:null,nonce:null,noModule:ft,noValidate:ft,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:ft,optimum:Oe,pattern:null,ping:Kt,placeholder:null,playsInline:ft,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ft,referrerPolicy:null,rel:Kt,required:ft,reversed:ft,rows:Oe,rowSpan:Oe,sandbox:Kt,scope:null,scoped:ft,seamless:ft,selected:ft,shadowRootDelegatesFocus:ft,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:Cn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:ft,useMap:null,value:Cn,width:Oe,wrap:null,align:null,aLink:null,archive:Kt,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ft,declare:ft,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:ft,noHref:ft,noShade:ft,noWrap:ft,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:Cn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ft,disableRemotePlayback:ft,prefix:null,property:null,results:Oe,security:null,unselectable:null}}),fie=Lc({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:WM,properties:{about:zr,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:Kt,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:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:ft,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,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:Yl,g2:Yl,glyphName:Yl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:zr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,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:Oe,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:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zr,rev:zr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zr,requiredFeatures:zr,requiredFonts:zr,requiredFormats:zr,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:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:zr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zr,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),hie=/^data[-\w.:]+$/i,K2=/-[a-z]/g,pie=/[A-Z]/g;function gie(e,t){const n=Wy(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"&&hie.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(K2,vie);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!K2.test(i)){let s=i.replace(pie,mie);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=x1}return new o(r,t)}function mie(e){return"-"+e.toLowerCase()}function vie(e){return e.charAt(1).toUpperCase()}const bie={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"},yie=jM([HM,VM,qM,GM,die],"html"),w1=jM([HM,VM,qM,GM,fie],"svg");function xie(e){return e.join(" ").trim()}var YM={},X2=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,wie=/\n/g,_ie=/^\s*/,Sie=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Cie=/^:\s*/,Eie=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Rie=/^[;\s]*/,Pie=/^\s+|\s+$/g,Oie=`
|
|
398
|
+
`,Q2="/",J2="*",xa="",$ie="comment",Die="declaration",Tie=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(v){var b=v.match(wie);b&&(n+=b.length);var x=v.lastIndexOf(Oie);r=~x?v.length-x:r+v.length}function i(){var v={line:n,column:r};return function(b){return b.position=new s(v),c(),b}}function s(v){this.start=v,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(v){var b=new Error(t.source+":"+n+":"+r+": "+v);if(b.reason=v,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(v){var b=v.exec(e);if(b){var x=b[0];return o(x),e=e.slice(x.length),b}}function c(){l(_ie)}function u(v){var b;for(v=v||[];b=f();)b!==!1&&v.push(b);return v}function f(){var v=i();if(!(Q2!=e.charAt(0)||J2!=e.charAt(1))){for(var b=2;xa!=e.charAt(b)&&(J2!=e.charAt(b)||Q2!=e.charAt(b+1));)++b;if(b+=2,xa===e.charAt(b-1))return a("End of comment missing");var x=e.slice(2,b-2);return r+=2,o(x),e=e.slice(b),r+=2,v({type:$ie,comment:x})}}function p(){var v=i(),b=l(Sie);if(b){if(f(),!l(Cie))return a("property missing ':'");var x=l(Eie),w=v({type:Die,property:Z2(b[0].replace(X2,xa)),value:x?Z2(x[0].replace(X2,xa)):xa});return l(Rie),w}}function g(){var v=[];u(v);for(var b;b=p();)b!==!1&&(v.push(b),u(v));return v}return c(),g()};function Z2(e){return e?e.replace(Pie,xa):xa}var kie=ms&&ms.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(YM,"__esModule",{value:!0});var Mie=kie(Tie);function Aie(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Mie.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 eP=YM.default=Aie;const Iie=eP.default||eP,KM=XM("end"),_1=XM("start");function XM(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 Nie(e){const t=_1(e),n=KM(e);if(t&&n)return{start:t,end:n}}function Wu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?tP(e.position):"start"in e||"end"in e?tP(e):"line"in e||"column"in e?qy(e):""}function qy(e){return nP(e&&e.line)+":"+nP(e&&e.column)}function tP(e){return qy(e&&e.start)+"-"+qy(e&&e.end)}function nP(e){return e&&typeof e=="number"?e:1}class rr 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=Wu(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}}rr.prototype.file="";rr.prototype.name="";rr.prototype.reason="";rr.prototype.message="";rr.prototype.stack="";rr.prototype.column=void 0;rr.prototype.line=void 0;rr.prototype.ancestors=void 0;rr.prototype.cause=void 0;rr.prototype.fatal=void 0;rr.prototype.place=void 0;rr.prototype.ruleId=void 0;rr.prototype.source=void 0;const S1={}.hasOwnProperty,Lie=new Map,Fie=/[A-Z]/g,zie=/-([a-z])/g,jie=new Set(["table","tbody","thead","tfoot","tr"]),Bie=new Set(["td","th"]),QM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Vie(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=Xie(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=Kie(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"?w1:yie,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=JM(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function JM(e,t,n){if(t.type==="element")return Hie(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Wie(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return qie(e,t,n);if(t.type==="mdxjsEsm")return Uie(e,t);if(t.type==="root")return Gie(e,t,n);if(t.type==="text")return Yie(e,t)}function Hie(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=w1,e.schema=o),e.ancestors.push(t);const i=eA(e,t.tagName,!1),s=Qie(e,t);let a=E1(e,t);return jie.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!lie(l):!0})),ZM(e,s,i,t),C1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Wie(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)}$d(e,t.position)}function Uie(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$d(e,t.position)}function qie(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=w1,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:eA(e,t.name,!0),s=Jie(e,t),a=E1(e,t);return ZM(e,s,i,t),C1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Gie(e,t,n){const r={};return C1(r,E1(e,t)),e.create(t,e.Fragment,r,n)}function Yie(e,t){return t.value}function ZM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function C1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Kie(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 Xie(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=_1(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 Qie(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&S1.call(t.properties,o)){const i=Zie(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Bie.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 Jie(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 $d(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 $d(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function E1(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Lie;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=JM(e,i,s);a!==void 0&&n.push(a)}return n}function Zie(e,t,n){const r=gie(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?rie(n):xie(n)),r.property==="style"){let o=typeof n=="object"?n:ese(e,String(n));return e.stylePropertyNameCase==="css"&&(o=tse(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?bie[r.property]||r.property:r.attribute,n]}}function ese(e,t){const n={};try{Iie(t,r)}catch(o){if(!e.ignoreInvalidStyle){const i=o,s=new rr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=QM+"#cannot-parse-style-attribute",s}}return n;function r(o,i){let s=o;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(zie,rse)),n[s]=i}}function eA(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=q2(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=q2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return S1.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);$d(e)}function $d(e,t){const n=new rr("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=QM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tse(e){const t={};let n;for(n in e)S1.call(e,n)&&(t[nse(n)]=e[n]);return t}function nse(e){let t=e.replace(Fie,ose);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function rse(e,t){return t.toUpperCase()}function ose(e){return"-"+e.toLowerCase()}const Qb={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"]},ise={};function sse(e,t){const n=t||ise,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return tA(e,r,o)}function tA(e,t,n){if(ase(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 rP(e.children,t,n)}return Array.isArray(e)?rP(e,t,n):""}function rP(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=tA(e[o],t,n);return r.join("")}function ase(e){return!!(e&&typeof e=="object")}const oP=document.createElement("i");function R1(e){const t="&"+e+";";oP.innerHTML=t;const n=oP.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ai(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 xo(e,t){return e.length>0?(ai(e,e.length,0,t),e):t}const iP={}.hasOwnProperty;function lse(e){const t={};let n=-1;for(;++n<e.length;)cse(t,e[n]);return t}function cse(e,t){let n;for(n in t){const o=(iP.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){iP.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]);ai(e,0,0,r)}function nA(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 Kl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const dse=Vs(new RegExp("\\p{P}","u")),Zo=Vs(/[A-Za-z]/),Qr=Vs(/[\dA-Za-z]/),fse=Vs(/[#-'*+\--9=?A-Z^-~]/);function Gy(e){return e!==null&&(e<32||e===127)}const Yy=Vs(/\d/),hse=Vs(/[\dA-Fa-f]/),rA=Vs(/[!-/:-@[-`{-~]/);function et(e){return e!==null&&e<-2}function Dr(e){return e!==null&&(e<0||e===32)}function It(e){return e===-2||e===-1||e===32}function pse(e){return rA(e)||dse(e)}const gse=Vs(/\s/);function Vs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fc(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&Qr(e.charCodeAt(n+1))&&Qr(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 Xt(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return It(l)?(e.enter(n),a(l)):t(l)}function a(l){return It(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const mse={tokenize:vse};function vse(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"),Xt(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 et(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const bse={tokenize:yse},sP={tokenize:xse};function yse(e){const t=this,n=[];let r=0,o,i,s;return a;function a(S){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,l,c)(S)}return c(S)}function l(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&_();const R=t.events.length;let E=R,O;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){O=t.events[E][1].end;break}w(r);let k=R;for(;k<t.events.length;)t.events[k][1].end=Object.assign({},O),k++;return ai(t.events,E+1,0,t.events.slice(R)),t.events.length=k,c(S)}return a(S)}function c(S){if(r===n.length){if(!o)return p(S);if(o.currentConstruct&&o.currentConstruct.concrete)return v(S);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(sP,u,f)(S)}function u(S){return o&&_(),w(r),p(S)}function f(S){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,v(S)}function p(S){return t.containerState={},e.attempt(sP,g,v)(S)}function g(S){return r++,n.push([t.currentConstruct,t.containerState]),p(S)}function v(S){if(S===null){o&&_(),w(0),e.consume(S);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:o}),b(S)}function b(S){if(S===null){x(e.exit("chunkFlow"),!0),w(0),e.consume(S);return}return et(S)?(e.consume(S),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(S),b)}function x(S,R){const E=t.sliceStream(S);if(R&&E.push(null),S.previous=i,i&&(i.next=S),i=S,o.defineSkip(S.start),o.write(E),t.parser.lazy[S.start.line]){let O=o.events.length;for(;O--;)if(o.events[O][1].start.offset<s&&(!o.events[O][1].end||o.events[O][1].end.offset>s))return;const k=t.events.length;let M=k,D,I;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(D){I=t.events[M][1].end;break}D=!0}for(w(r),O=k;O<t.events.length;)t.events[O][1].end=Object.assign({},I),O++;ai(t.events,M+1,0,t.events.slice(k)),t.events.length=O}}function w(S){let R=n.length;for(;R-- >S;){const E=n[R];t.containerState=E[1],E[0].exit.call(t,e)}n.length=S}function _(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function xse(e,t,n){return Xt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function aP(e){if(e===null||Dr(e)||gse(e))return 1;if(pse(e))return 2}function P1(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 Ky={name:"attention",tokenize:_se,resolveAll:wse};function wse(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 f=Object.assign({},e[r][1].end),p=Object.assign({},e[n][1].start);lP(f,-l),lP(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:p},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=xo(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=xo(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=xo(c,P1(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=xo(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=xo(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,ai(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 _se(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=aP(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=aP(l),f=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(o||!p)),c._close=!!(i===42?p:p&&(u||!f)),t(l)}}function lP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Sse={name:"autolink",tokenize:Cse};function Cse(e,t,n){let r=0;return o;function o(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(g){return Zo(g)?(e.consume(g),s):c(g)}function s(g){return g===43||g===45||g===46||Qr(g)?(r=1,a(g)):c(g)}function a(g){return g===58?(e.consume(g),r=0,l):(g===43||g===45||g===46||Qr(g))&&r++<32?(e.consume(g),a):(r=0,c(g))}function l(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Gy(g)?n(g):(e.consume(g),l)}function c(g){return g===64?(e.consume(g),u):fse(g)?(e.consume(g),c):n(g)}function u(g){return Qr(g)?f(g):n(g)}function f(g){return g===46?(e.consume(g),r=0,u):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):p(g)}function p(g){if((g===45||Qr(g))&&r++<63){const v=g===45?p:f;return e.consume(g),v}return n(g)}}const vm={tokenize:Ese,partial:!0};function Ese(e,t,n){return r;function r(i){return It(i)?Xt(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||et(i)?t(i):n(i)}}const oA={name:"blockQuote",tokenize:Rse,continuation:{tokenize:Pse},exit:Ose};function Rse(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 It(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Pse(e,t,n){const r=this;return o;function o(s){return It(s)?Xt(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(oA,t,n)(s)}}function Ose(e){e.exit("blockQuote")}const iA={name:"characterEscape",tokenize:$se};function $se(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 rA(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const sA={name:"characterReference",tokenize:Dse};function Dse(e,t,n){const r=this;let o=0,i,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=Qr,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=hse,u):(e.enter("characterReferenceValue"),i=7,s=Yy,u(f))}function u(f){if(f===59&&o){const p=e.exit("characterReferenceValue");return s===Qr&&!R1(r.sliceSerialize(p))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&o++<i?(e.consume(f),u):n(f)}}const cP={tokenize:kse,partial:!0},uP={name:"codeFenced",tokenize:Tse,concrete:!0};function Tse(e,t,n){const r=this,o={tokenize:E,partial:!0};let i=0,s=0,a;return l;function l(O){return c(O)}function c(O){const k=r.events[r.events.length-1];return i=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,a=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(O)}function u(O){return O===a?(s++,e.consume(O),u):s<3?n(O):(e.exit("codeFencedFenceSequence"),It(O)?Xt(e,f,"whitespace")(O):f(O))}function f(O){return O===null||et(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(cP,b,R)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(O))}function p(O){return O===null||et(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(O)):It(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xt(e,g,"whitespace")(O)):O===96&&O===a?n(O):(e.consume(O),p)}function g(O){return O===null||et(O)?f(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(O))}function v(O){return O===null||et(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(O)):O===96&&O===a?n(O):(e.consume(O),v)}function b(O){return e.attempt(o,R,x)(O)}function x(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),w}function w(O){return i>0&&It(O)?Xt(e,_,"linePrefix",i+1)(O):_(O)}function _(O){return O===null||et(O)?e.check(cP,b,R)(O):(e.enter("codeFlowValue"),S(O))}function S(O){return O===null||et(O)?(e.exit("codeFlowValue"),_(O)):(e.consume(O),S)}function R(O){return e.exit("codeFenced"),t(O)}function E(O,k,M){let D=0;return I;function I(B){return O.enter("lineEnding"),O.consume(B),O.exit("lineEnding"),z}function z(B){return O.enter("codeFencedFence"),It(B)?Xt(O,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):j(B)}function j(B){return B===a?(O.enter("codeFencedFenceSequence"),Q(B)):M(B)}function Q(B){return B===a?(D++,O.consume(B),Q):D>=s?(O.exit("codeFencedFenceSequence"),It(B)?Xt(O,U,"whitespace")(B):U(B)):M(B)}function U(B){return B===null||et(B)?(O.exit("codeFencedFence"),k(B)):M(B)}}}function kse(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 Jb={name:"codeIndented",tokenize:Ase},Mse={tokenize:Ise,partial:!0};function Ase(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),Xt(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):et(c)?e.attempt(Mse,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||et(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function Ise(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):et(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):Xt(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):et(s)?o(s):n(s)}}const Nse={name:"codeText",tokenize:zse,resolve:Lse,previous:Fse};function Lse(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 Fse(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zse(e,t,n){let r=0,o,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),o=0,u(f)):et(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||et(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}function aA(e){const t={};let n=-1,r,o,i,s,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,jse(e,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--&&(s=e[i],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(o&&(e[o][1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);o&&(r[1].end=Object.assign({},e[o][1].start),a=e.slice(o,n),a.unshift(r),ai(e,o,n-o+1,a))}}return!c}function jse(e,t){const n=e[t][1],r=e[t][2];let o=t-1;const i=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let u,f,p=-1,g=n,v=0,b=0;const x=[b];for(;g;){for(;e[++o][1]!==g;);i.push(o),g._tokenizer||(u=r.sliceStream(g),g.next||u.push(null),f&&s.defineSkip(g.start),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=g,g=g.next}for(g=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,x.push(b),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(s.events=[],g?(g._tokenizer=void 0,g.previous=void 0):x.pop(),p=x.length;p--;){const w=a.slice(x[p],x[p+1]),_=i.pop();l.unshift([_,_+w.length-1]),ai(e,_,2,w)}for(p=-1;++p<l.length;)c[v+l[p][0]]=v+l[p][1],v+=l[p][1]-l[p][0]-1;return c}const Bse={tokenize:Wse,resolve:Hse},Vse={tokenize:Use,partial:!0};function Hse(e){return aA(e),e}function Wse(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):et(a)?e.check(Vse,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 Use(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Xt(e,i,"linePrefix")}function i(s){if(s===null||et(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 lA(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(w){return w===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(w),e.exit(i),p):w===null||w===32||w===41||Gy(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(w))}function p(w){return w===62?(e.enter(i),e.consume(w),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===62?(e.exit("chunkString"),e.exit(a),p(w)):w===null||w===60||et(w)?n(w):(e.consume(w),w===92?v:g)}function v(w){return w===60||w===62||w===92?(e.consume(w),g):g(w)}function b(w){return!u&&(w===null||w===41||Dr(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):u<c&&w===40?(e.consume(w),u++,b):w===41?(e.consume(w),u--,b):w===null||w===32||w===40||Gy(w)?n(w):(e.consume(w),w===92?x:b)}function x(w){return w===40||w===41||w===92?(e.consume(w),b):b(w)}}function cA(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(g){return e.enter(r),e.enter(o),e.consume(g),e.exit(o),e.enter(i),u}function u(g){return a>999||g===null||g===91||g===93&&!l||g===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(g):g===93?(e.exit(i),e.enter(o),e.consume(g),e.exit(o),e.exit(r),t):et(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||et(g)||a++>999?(e.exit("chunkString"),u(g)):(e.consume(g),l||(l=!It(g)),g===92?p:f)}function p(g){return g===91||g===92||g===93?(e.consume(g),a++,f):f(g)}}function uA(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):et(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Xt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||et(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?f:u)}function f(p){return p===s||p===92?(e.consume(p),u):u(p)}}function Uu(e,t){let n;return r;function r(o){return et(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):It(o)?Xt(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const qse={name:"definition",tokenize:Yse},Gse={tokenize:Kse,partial:!0};function Yse(e,t,n){const r=this;let o;return i;function i(g){return e.enter("definition"),s(g)}function s(g){return cA.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function a(g){return o=Kl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),l):n(g)}function l(g){return Dr(g)?Uu(e,c)(g):c(g)}function c(g){return lA(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function u(g){return e.attempt(Gse,f,f)(g)}function f(g){return It(g)?Xt(e,p,"whitespace")(g):p(g)}function p(g){return g===null||et(g)?(e.exit("definition"),r.parser.defined.push(o),t(g)):n(g)}}function Kse(e,t,n){return r;function r(a){return Dr(a)?Uu(e,o)(a):n(a)}function o(a){return uA(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return It(a)?Xt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||et(a)?t(a):n(a)}}const Xse={name:"hardBreakEscape",tokenize:Qse};function Qse(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return et(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const Jse={name:"headingAtx",tokenize:eae,resolve:Zse};function Zse(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"},ai(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function eae(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||Dr(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||et(u)?(e.exit("atxHeading"),t(u)):It(u)?Xt(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||Dr(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const tae=["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"],dP=["pre","script","style","textarea"],nae={name:"htmlFlow",tokenize:sae,resolveTo:iae,concrete:!0},rae={tokenize:lae,partial:!0},oae={tokenize:aae,partial:!0};function iae(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 sae(e,t,n){const r=this;let o,i,s,a,l;return c;function c(N){return u(N)}function u(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),i=!0,b):N===63?(e.consume(N),o=3,r.interrupt?t:T):Zo(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function p(N){return N===45?(e.consume(N),o=2,g):N===91?(e.consume(N),o=5,a=0,v):Zo(N)?(e.consume(N),o=4,r.interrupt?t:T):n(N)}function g(N){return N===45?(e.consume(N),r.interrupt?t:T):n(N)}function v(N){const se="CDATA[";return N===se.charCodeAt(a++)?(e.consume(N),a===se.length?r.interrupt?t:j:v):n(N)}function b(N){return Zo(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function x(N){if(N===null||N===47||N===62||Dr(N)){const se=N===47,ae=s.toLowerCase();return!se&&!i&&dP.includes(ae)?(o=1,r.interrupt?t(N):j(N)):tae.includes(s.toLowerCase())?(o=6,se?(e.consume(N),w):r.interrupt?t(N):j(N)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?_(N):S(N))}return N===45||Qr(N)?(e.consume(N),s+=String.fromCharCode(N),x):n(N)}function w(N){return N===62?(e.consume(N),r.interrupt?t:j):n(N)}function _(N){return It(N)?(e.consume(N),_):I(N)}function S(N){return N===47?(e.consume(N),I):N===58||N===95||Zo(N)?(e.consume(N),R):It(N)?(e.consume(N),S):I(N)}function R(N){return N===45||N===46||N===58||N===95||Qr(N)?(e.consume(N),R):E(N)}function E(N){return N===61?(e.consume(N),O):It(N)?(e.consume(N),E):S(N)}function O(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,k):It(N)?(e.consume(N),O):M(N)}function k(N){return N===l?(e.consume(N),l=null,D):N===null||et(N)?n(N):(e.consume(N),k)}function M(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Dr(N)?E(N):(e.consume(N),M)}function D(N){return N===47||N===62||It(N)?S(N):n(N)}function I(N){return N===62?(e.consume(N),z):n(N)}function z(N){return N===null||et(N)?j(N):It(N)?(e.consume(N),z):n(N)}function j(N){return N===45&&o===2?(e.consume(N),K):N===60&&o===1?(e.consume(N),H):N===62&&o===4?(e.consume(N),V):N===63&&o===3?(e.consume(N),T):N===93&&o===5?(e.consume(N),Z):et(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(rae,X,Q)(N)):N===null||et(N)?(e.exit("htmlFlowData"),Q(N)):(e.consume(N),j)}function Q(N){return e.check(oae,U,X)(N)}function U(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),B}function B(N){return N===null||et(N)?Q(N):(e.enter("htmlFlowData"),j(N))}function K(N){return N===45?(e.consume(N),T):j(N)}function H(N){return N===47?(e.consume(N),s="",q):j(N)}function q(N){if(N===62){const se=s.toLowerCase();return dP.includes(se)?(e.consume(N),V):j(N)}return Zo(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),q):j(N)}function Z(N){return N===93?(e.consume(N),T):j(N)}function T(N){return N===62?(e.consume(N),V):N===45&&o===2?(e.consume(N),T):j(N)}function V(N){return N===null||et(N)?(e.exit("htmlFlowData"),X(N)):(e.consume(N),V)}function X(N){return e.exit("htmlFlow"),t(N)}}function aae(e,t,n){const r=this;return o;function o(s){return et(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 lae(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(vm,t,n)}}const cae={name:"htmlText",tokenize:uae};function uae(e,t,n){const r=this;let o,i,s;return a;function a(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),l}function l(T){return T===33?(e.consume(T),c):T===47?(e.consume(T),E):T===63?(e.consume(T),S):Zo(T)?(e.consume(T),M):n(T)}function c(T){return T===45?(e.consume(T),u):T===91?(e.consume(T),i=0,v):Zo(T)?(e.consume(T),_):n(T)}function u(T){return T===45?(e.consume(T),g):n(T)}function f(T){return T===null?n(T):T===45?(e.consume(T),p):et(T)?(s=f,H(T)):(e.consume(T),f)}function p(T){return T===45?(e.consume(T),g):f(T)}function g(T){return T===62?K(T):T===45?p(T):f(T)}function v(T){const V="CDATA[";return T===V.charCodeAt(i++)?(e.consume(T),i===V.length?b:v):n(T)}function b(T){return T===null?n(T):T===93?(e.consume(T),x):et(T)?(s=b,H(T)):(e.consume(T),b)}function x(T){return T===93?(e.consume(T),w):b(T)}function w(T){return T===62?K(T):T===93?(e.consume(T),w):b(T)}function _(T){return T===null||T===62?K(T):et(T)?(s=_,H(T)):(e.consume(T),_)}function S(T){return T===null?n(T):T===63?(e.consume(T),R):et(T)?(s=S,H(T)):(e.consume(T),S)}function R(T){return T===62?K(T):S(T)}function E(T){return Zo(T)?(e.consume(T),O):n(T)}function O(T){return T===45||Qr(T)?(e.consume(T),O):k(T)}function k(T){return et(T)?(s=k,H(T)):It(T)?(e.consume(T),k):K(T)}function M(T){return T===45||Qr(T)?(e.consume(T),M):T===47||T===62||Dr(T)?D(T):n(T)}function D(T){return T===47?(e.consume(T),K):T===58||T===95||Zo(T)?(e.consume(T),I):et(T)?(s=D,H(T)):It(T)?(e.consume(T),D):K(T)}function I(T){return T===45||T===46||T===58||T===95||Qr(T)?(e.consume(T),I):z(T)}function z(T){return T===61?(e.consume(T),j):et(T)?(s=z,H(T)):It(T)?(e.consume(T),z):D(T)}function j(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),o=T,Q):et(T)?(s=j,H(T)):It(T)?(e.consume(T),j):(e.consume(T),U)}function Q(T){return T===o?(e.consume(T),o=void 0,B):T===null?n(T):et(T)?(s=Q,H(T)):(e.consume(T),Q)}function U(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Dr(T)?D(T):(e.consume(T),U)}function B(T){return T===47||T===62||Dr(T)?D(T):n(T)}function K(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function H(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),q}function q(T){return It(T)?Xt(e,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):Z(T)}function Z(T){return e.enter("htmlTextData"),s(T)}}const O1={name:"labelEnd",tokenize:mae,resolveTo:gae,resolveAll:pae},dae={tokenize:vae},fae={tokenize:bae},hae={tokenize:yae};function pae(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function gae(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[s][1].end)},u={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=xo(a,e.slice(i+1,i+r+3)),a=xo(a,[["enter",u,t]]),a=xo(a,P1(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=xo(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=xo(a,e.slice(s+1)),a=xo(a,[["exit",l,t]]),ai(e,i,e.length,a),e}function mae(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?f(p):(s=r.parser.defined.includes(Kl(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(dae,u,s?u:f)(p):p===91?e.attempt(fae,u,s?c:f)(p):s?u(p):f(p)}function c(p){return e.attempt(hae,u,f)(p)}function u(p){return t(p)}function f(p){return i._balanced=!0,n(p)}}function vae(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return Dr(f)?Uu(e,i)(f):i(f)}function i(f){return f===41?u(f):lA(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Dr(f)?Uu(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?uA(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Dr(f)?Uu(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function bae(e,t,n){const r=this;return o;function o(a){return cA.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Kl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function yae(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 xae={name:"labelStartImage",tokenize:wae,resolveAll:O1.resolveAll};function wae(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 _ae={name:"labelStartLink",tokenize:Sae,resolveAll:O1.resolveAll};function Sae(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 Zb={name:"lineEnding",tokenize:Cae};function Cae(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Xt(e,t,"linePrefix")}}const Ep={name:"thematicBreak",tokenize:Eae};function Eae(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||et(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),It(c)?Xt(e,a,"whitespace")(c):a(c))}}const xr={name:"list",tokenize:Oae,continuation:{tokenize:$ae},exit:Tae},Rae={tokenize:kae,partial:!0},Pae={tokenize:Dae,partial:!0};function Oae(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(g){const v=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:Yy(g)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Ep,n,c)(g):c(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(g)}return n(g)}function l(g){return Yy(g)&&++s<10?(e.consume(g),l):(!r.interrupt||s<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):n(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(vm,r.interrupt?n:u,e.attempt(Rae,p,f))}function u(g){return r.containerState.initialBlankLine=!0,i++,p(g)}function f(g){return It(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),p):n(g)}function p(g){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function $ae(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(vm,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xt(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!It(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(Pae,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xt(e,e.attempt(xr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Dae(e,t,n){const r=this;return Xt(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 Tae(e){e.exit(this.containerState.type)}function kae(e,t,n){const r=this;return Xt(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!It(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const fP={name:"setextUnderline",tokenize:Aae,resolveTo:Mae};function Mae(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function Aae(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(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"),It(c)?Xt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||et(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Iae={tokenize:Nae};function Nae(e){const t=this,n=e.attempt(vm,r,e.attempt(this.parser.constructs.flowInitial,o,Xt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Bse,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 Lae={resolveAll:fA()},Fae=dA("string"),zae=dA("text");function dA(e){return{tokenize:t,resolveAll:fA(e==="text"?jae:void 0)};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=o[u];let p=-1;if(f)for(;++p<f.length;){const g=f[p];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function fA(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 jae(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+i,_bufferIndex:i?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function Bae(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},i=[];let s=[],a=[];const l={consume:_,enter:S,exit:R,attempt:k(E),check:k(O),interrupt:k(O,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:g,sliceSerialize:p,now:v,defineSkip:b,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(z){return s=xo(s,z),x(),s[s.length-1]!==null?[]:(M(t,0),c.events=P1(i,c.events,c),c.events)}function p(z,j){return Hae(g(z),j)}function g(z){return Vae(s,z)}function v(){const{line:z,column:j,offset:Q,_index:U,_bufferIndex:B}=r;return{line:z,column:j,offset:Q,_index:U,_bufferIndex:B}}function b(z){o[z.line]=z.column,I()}function x(){let z;for(;r._index<s.length;){const j=s[r._index];if(typeof j=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<j.length;)w(j.charCodeAt(r._bufferIndex));else w(j)}}function w(z){u=u(z)}function _(z){et(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,I()):z!==-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=z}function S(z,j){const Q=j||{};return Q.type=z,Q.start=v(),c.events.push(["enter",Q,c]),a.push(Q),Q}function R(z){const j=a.pop();return j.end=v(),c.events.push(["exit",j,c]),j}function E(z,j){M(z,j.from)}function O(z,j){j.restore()}function k(z,j){return Q;function Q(U,B,K){let H,q,Z,T;return Array.isArray(U)?X(U):"tokenize"in U?X([U]):V(U);function V(ue){return fe;function fe(oe){const ee=oe!==null&&ue[oe],ie=oe!==null&&ue.null,be=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return X(be)(oe)}}function X(ue){return H=ue,q=0,ue.length===0?K:N(ue[q])}function N(ue){return fe;function fe(oe){return T=D(),Z=ue,ue.partial||(c.currentConstruct=ue),ue.name&&c.parser.constructs.disable.null.includes(ue.name)?ae():ue.tokenize.call(j?Object.assign(Object.create(c),j):c,l,se,ae)(oe)}}function se(ue){return z(Z,T),B}function ae(ue){return T.restore(),++q<H.length?N(H[q]):K}}}function M(z,j){z.resolveAll&&!i.includes(z)&&i.push(z),z.resolve&&ai(c.events,j,c.events.length-j,z.resolve(c.events.slice(j),c)),z.resolveTo&&(c.events=z.resolveTo(c.events,c))}function D(){const z=v(),j=c.previous,Q=c.currentConstruct,U=c.events.length,B=Array.from(a);return{restore:K,from:U};function K(){r=z,c.previous=j,c.currentConstruct=Q,c.events.length=U,a=B,I()}}function I(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function Vae(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 Hae(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=`
|
|
399
|
+
`;break}case-3:{s=`\r
|
|
400
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}const Wae={42:xr,43:xr,45:xr,48:xr,49:xr,50:xr,51:xr,52:xr,53:xr,54:xr,55:xr,56:xr,57:xr,62:oA},Uae={91:qse},qae={[-2]:Jb,[-1]:Jb,32:Jb},Gae={35:Jse,42:Ep,45:[fP,Ep],60:nae,61:fP,95:Ep,96:uP,126:uP},Yae={38:sA,92:iA},Kae={[-5]:Zb,[-4]:Zb,[-3]:Zb,33:xae,38:sA,42:Ky,60:[Sse,cae],91:_ae,92:[Xse,iA],93:O1,95:Ky,96:Nse},Xae={null:[Ky,Lae]},Qae={null:[42,95]},Jae={null:[]},Zae=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Qae,contentInitial:Uae,disable:Jae,document:Wae,flow:Gae,flowInitial:qae,insideSpan:Xae,string:Yae,text:Kae},Symbol.toStringTag,{value:"Module"}));function ele(e){const n=lse([Zae,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(mse),document:o(bse),flow:o(Iae),string:o(Fae),text:o(zae)};return r;function o(i){return s;function s(a){return Bae(r,i,a)}}}function tle(e){for(;!aA(e););return e}const hP=/[\0\t\n\r]/g;function nle(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,f,p,g;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(hP.lastIndex=f,c=hP.exec(i),p=c&&c.index!==void 0?c.index:i.length,g=i.charCodeAt(p),!c){t=i.slice(f);break}if(g===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),e+=p-f),g){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}f=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const rle=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ole(e){return e.replace(rle,ile)}function ile(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return nA(n.slice(i?2:1),i?16:10)}return R1(n)||e}const hA={}.hasOwnProperty;function sle(e,t,n){return typeof t!="string"&&(n=t,t=void 0),ale(n)(tle(ele(n).document().write(nle()(e,t,!0))))}function ale(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Fe),autolinkProtocol:D,autolinkEmail:D,atxHeading:i(_e),blockQuote:i(ee),characterEscape:D,characterReference:D,codeFenced:i(ie),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(ie,s),codeText:i(be,s),codeTextData:D,data:D,codeFlowValue:D,definition:i(G),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(me),hardBreakEscape:i(Pe),hardBreakTrailing:i(Pe),htmlFlow:i($e,s),htmlFlowData:D,htmlText:i($e,s),htmlTextData:D,image:i(Ve),label:s,link:i(Fe),listItem:i(Ge),listItemValue:p,listOrdered:i(ke,f),listUnordered:i(ke),paragraph:i(ct),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(_e),strong:i(kt),thematicBreak:i(cn)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:oe,autolinkProtocol:fe,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:ue,codeFenced:l(x),codeFencedFence:b,codeFencedFenceInfo:g,codeFencedFenceMeta:v,codeFlowValue:I,codeIndented:l(w),codeText:l(B),codeTextData:I,data:I,definition:l(),definitionDestinationString:R,definitionLabelString:_,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(Q),htmlFlowData:I,htmlText:l(U),htmlTextData:I,image:l(H),label:Z,labelText:q,lineEnding:z,link:l(K),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:se,resourceDestinationString:T,resourceTitleString:V,resource:X,setextHeading:l(M),setextHeadingLineSequence:k,setextHeadingText:O,strong:l(),thematicBreak:l()}};pA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(de){let Se={type:"root",children:[]};const Ie={stack:[Se],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},qe=[];let Je=-1;for(;++Je<de.length;)if(de[Je][1].type==="listOrdered"||de[Je][1].type==="listUnordered")if(de[Je][0]==="enter")qe.push(Je);else{const Gt=qe.pop();Je=o(de,Gt,Je)}for(Je=-1;++Je<de.length;){const Gt=t[de[Je][0]];hA.call(Gt,de[Je][1].type)&&Gt[de[Je][1].type].call(Object.assign({sliceSerialize:de[Je][2].sliceSerialize},Ie),de[Je][1])}if(Ie.tokenStack.length>0){const Gt=Ie.tokenStack[Ie.tokenStack.length-1];(Gt[1]||pP).call(Ie,void 0,Gt[0])}for(Se.position={start:us(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:us(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},Je=-1;++Je<t.transforms.length;)Se=t.transforms[Je](Se)||Se;return Se}function o(de,Se,Ie){let qe=Se-1,Je=-1,Gt=!1,Jt,un,Pn,or;for(;++qe<=Ie;){const Zt=de[qe];switch(Zt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Zt[0]==="enter"?Je++:Je--,or=void 0;break}case"lineEndingBlank":{Zt[0]==="enter"&&(Jt&&!or&&!Je&&!Pn&&(Pn=qe),or=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:or=void 0}if(!Je&&Zt[0]==="enter"&&Zt[1].type==="listItemPrefix"||Je===-1&&Zt[0]==="exit"&&(Zt[1].type==="listUnordered"||Zt[1].type==="listOrdered")){if(Jt){let hn=qe;for(un=void 0;hn--;){const On=de[hn];if(On[1].type==="lineEnding"||On[1].type==="lineEndingBlank"){if(On[0]==="exit")continue;un&&(de[un][1].type="lineEndingBlank",Gt=!0),On[1].type="lineEnding",un=hn}else if(!(On[1].type==="linePrefix"||On[1].type==="blockQuotePrefix"||On[1].type==="blockQuotePrefixWhitespace"||On[1].type==="blockQuoteMarker"||On[1].type==="listItemIndent"))break}Pn&&(!un||Pn<un)&&(Jt._spread=!0),Jt.end=Object.assign({},un?de[un][1].start:Zt[1].end),de.splice(un||qe,0,["exit",Jt,Zt[2]]),qe++,Ie++}if(Zt[1].type==="listItemPrefix"){const hn={type:"listItem",_spread:!1,start:Object.assign({},Zt[1].start),end:void 0};Jt=hn,de.splice(qe,0,["enter",hn,Zt[2]]),qe++,Ie++,Pn=void 0,or=!0}}}return de[Se][1]._spread=Gt,Ie}function i(de,Se){return Ie;function Ie(qe){a.call(this,de(qe),qe),Se&&Se.call(this,qe)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(de,Se,Ie){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([Se,Ie]),de.position={start:us(Se.start),end:void 0}}function l(de){return Se;function Se(Ie){de&&de.call(this,Ie),c.call(this,Ie)}}function c(de,Se){const Ie=this.stack.pop(),qe=this.tokenStack.pop();if(qe)qe[0].type!==de.type&&(Se?Se.call(this,de,qe[0]):(qe[1]||pP).call(this,de,qe[0]));else throw new Error("Cannot close `"+de.type+"` ("+Wu({start:de.start,end:de.end})+"): it’s not open");Ie.position.end=us(de.end)}function u(){return sse(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(de){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function g(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=de}function v(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=de}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.value=de.replace(/(\r?\n|\r)$/g,"")}function _(de){const Se=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=Se,Ie.identifier=Kl(this.sliceSerialize(de)).toLowerCase()}function S(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.title=de}function R(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.url=de}function E(de){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Ie=this.sliceSerialize(de).length;Se.depth=Ie}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function k(de){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function D(de){const Ie=this.stack[this.stack.length-1].children;let qe=Ie[Ie.length-1];(!qe||qe.type!=="text")&&(qe=Dt(),qe.position={start:us(de.start),end:void 0},Ie.push(qe)),this.stack.push(qe)}function I(de){const Se=this.stack.pop();Se.value+=this.sliceSerialize(de),Se.position.end=us(de.end)}function z(de){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ie=Se.children[Se.children.length-1];Ie.position.end=us(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Se.type)&&(D.call(this,de),I.call(this,de))}function j(){this.data.atHardBreak=!0}function Q(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.value=de}function U(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.value=de}function B(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.value=de}function K(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Se,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function H(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Se,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function q(de){const Se=this.sliceSerialize(de),Ie=this.stack[this.stack.length-2];Ie.label=ole(Se),Ie.identifier=Kl(Se).toLowerCase()}function Z(){const de=this.stack[this.stack.length-1],Se=this.resume(),Ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ie.type==="link"){const qe=de.children;Ie.children=qe}else Ie.alt=Se}function T(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.url=de}function V(){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.title=de}function X(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function se(de){const Se=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=Se,Ie.identifier=Kl(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function ae(de){this.data.characterReferenceType=de.type}function ue(de){const Se=this.sliceSerialize(de),Ie=this.data.characterReferenceType;let qe;Ie?(qe=nA(Se,Ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):qe=R1(Se);const Je=this.stack.pop();Je.value+=qe,Je.position.end=us(de.end)}function fe(de){I.call(this,de);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(de)}function oe(de){I.call(this,de);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(de)}function ee(){return{type:"blockquote",children:[]}}function ie(){return{type:"code",lang:null,meta:null,value:""}}function be(){return{type:"inlineCode",value:""}}function G(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function $e(){return{type:"html",value:""}}function Ve(){return{type:"image",title:null,url:"",alt:null}}function Fe(){return{type:"link",title:null,url:"",children:[]}}function ke(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function Ge(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function ct(){return{type:"paragraph",children:[]}}function kt(){return{type:"strong",children:[]}}function Dt(){return{type:"text",value:""}}function cn(){return{type:"thematicBreak"}}}function us(e){return{line:e.line,column:e.column,offset:e.offset}}function pA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?pA(e,r):lle(e,r)}}function lle(e,t){let n;for(n in t)if(hA.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 pP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wu({start:t.start,end:t.end})+") is still open")}function cle(e){const t=this;t.parser=n;function n(r){return sle(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ule(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 dle(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
401
|
+
`}]}function fle(e,t){const n=t.value?t.value+`
|
|
402
|
+
`:"",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 hle(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ple(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gle(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Fc(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 mle(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 vle(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gA(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 ble(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gA(e,t);const o={src:Fc(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 yle(e,t){const n={src:Fc(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 xle(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 wle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gA(e,t);const o={href:Fc(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 _le(e,t){const n={href:Fc(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 Sle(e,t,n){const r=e.all(t),o=n?Cle(n):mA(t),i={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.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:`
|
|
403
|
+
`}),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:`
|
|
404
|
+
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function Cle(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=mA(n[r])}return t}function mA(e){const t=e.spread;return t??e.children.length>1}function Ele(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 Rle(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ple(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ole(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $le(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=_1(t.children[1]),l=KM(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 Dle(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 f=t.children[l],p={},g=s?s[l]:void 0;g&&(p.align=g);let v={type:"element",tagName:i,properties:p,children:[]};f&&(v.children=e.all(f),e.patch(f,v),v=e.applyData(f,v)),c.push(v)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function Tle(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const gP=9,mP=32;function kle(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(vP(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(vP(t.slice(o),o>0,!1)),i.join("")}function vP(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===gP||i===mP;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===gP||i===mP;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function Mle(e,t){const n={type:"text",value:kle(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ale(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Ile={blockquote:ule,break:dle,code:fle,delete:hle,emphasis:ple,footnoteReference:gle,heading:mle,html:vle,imageReference:ble,image:yle,inlineCode:xle,linkReference:wle,link:_le,listItem:Sle,list:Ele,paragraph:Rle,root:Ple,strong:Ole,table:$le,tableCell:Tle,tableRow:Dle,text:Mle,thematicBreak:Ale,toml:tp,yaml:tp,definition:tp,footnoteDefinition:tp};function tp(){}const vA=-1,bm=0,lg=1,cg=2,$1=3,D1=4,T1=5,k1=6,bA=7,yA=8,bP=typeof self=="object"?self:globalThis,Nle=(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 bm:case vA:return n(s,o);case lg:{const a=n([],o);for(const l of s)a.push(r(l));return a}case cg:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case $1:return n(new Date(s),o);case D1:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case T1:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case k1:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case bA:{const{name:a,message:l}=s;return n(new bP[a](l),o)}case yA:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o)}return n(new bP[i](s),o)};return r},yP=e=>Nle(new Map,e)(0),Al="",{toString:Lle}={},{keys:Fle}=Object,Su=e=>{const t=typeof e;if(t!=="object"||!e)return[bm,t];const n=Lle.call(e).slice(8,-1);switch(n){case"Array":return[lg,Al];case"Object":return[cg,Al];case"Date":return[$1,Al];case"RegExp":return[D1,Al];case"Map":return[T1,Al];case"Set":return[k1,Al]}return n.includes("Array")?[lg,n]:n.includes("Error")?[bA,n]:[cg,n]},np=([e,t])=>e===bm&&(t==="function"||t==="symbol"),zle=(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]=Su(s);switch(a){case bm:{let u=s;switch(l){case"bigint":a=yA,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([vA],s)}return o([a,u],s)}case lg:{if(l)return o([l,[...s]],s);const u=[],f=o([a,u],s);for(const p of s)u.push(i(p));return f}case cg:{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=[],f=o([a,u],s);for(const p of Fle(s))(e||!np(Su(s[p])))&&u.push([i(p),i(s[p])]);return f}case $1:return o([a,s.toISOString()],s);case D1:{const{source:u,flags:f}=s;return o([a,{source:u,flags:f}],s)}case T1:{const u=[],f=o([a,u],s);for(const[p,g]of s)(e||!(np(Su(p))||np(Su(g))))&&u.push([i(p),i(g)]);return f}case k1:{const u=[],f=o([a,u],s);for(const p of s)(e||!np(Su(p)))&&u.push(i(p));return f}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},xP=(e,{json:t,lossy:n}={})=>{const r=[];return zle(!(t||n),!!t,new Map,r)(e),r},ug=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?yP(xP(e,t)):structuredClone(e):(e,t)=>yP(xP(e,t));function jle(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 Ble(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Vle(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||jle,r=e.options.footnoteBackLabel||Ble,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),f=String(c.identifier).toUpperCase(),p=Fc(f.toLowerCase());let g=0;const v=[],b=e.footnoteCounts.get(f);for(;b!==void 0&&++g<=b;){v.length>0&&v.push({type:"text",value:" "});let _=typeof n=="string"?n:n(l,g);typeof _=="string"&&(_={type:"text",value:_}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const x=u[u.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const _=x.children[x.children.length-1];_&&_.type==="text"?_.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...v)}else u.push(...v);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ug(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
405
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
406
|
+
`}]}}const xA=function(e){if(e==null)return qle;if(typeof e=="function")return ym(e);if(typeof e=="object")return Array.isArray(e)?Hle(e):Wle(e);if(typeof e=="string")return Ule(e);throw new Error("Expected function, string, or object as test")};function Hle(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=xA(e[n]);return ym(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function Wle(e){const t=e;return ym(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function Ule(e){return ym(t);function t(n){return n&&n.type===e}}function ym(e){return t;function t(n,r,o){return!!(Gle(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function qle(){return!0}function Gle(e){return e!==null&&typeof e=="object"&&"type"in e}const wA=[],Yle=!0,wP=!1,Kle="skip";function Xle(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=xA(o),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const g=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(g?"<"+g+">":""))+")"})}return p;function p(){let g=wA,v,b,x;if((!t||i(l,c,u[u.length-1]||void 0))&&(g=Qle(n(l,u)),g[0]===wP))return g;if("children"in l&&l.children){const w=l;if(w.children&&g[0]!==Kle)for(b=(r?w.children.length:-1)+s,x=u.concat(w);b>-1&&b<w.children.length;){const _=w.children[b];if(v=a(_,b,x)(),v[0]===wP)return v;b=typeof v[1]=="number"?v[1]:b+s}}return g}}}function Qle(e){return Array.isArray(e)?e:typeof e=="number"?[Yle,e]:e==null?wA:[e]}function _A(e,t,n,r){let o,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),Xle(e,i,a,o);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return s(l,f,u)}}const Xy={}.hasOwnProperty,Jle={};function Zle(e,t){const n=t||Jle,r=new Map,o=new Map,i=new Map,s={...Ile,...n.handlers},a={all:c,applyData:tce,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:ece,wrap:rce};return _A(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:o,p=String(u.identifier).toUpperCase();f.has(p)||f.set(p,u)}}),a;function l(u,f){const p=u.type,g=a.handlers[p];if(Xy.call(a.handlers,p)&&g)return g(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:b,...x}=u,w=ug(x);return w.children=a.all(u),w}return ug(u)}return(a.options.unknownHandler||nce)(a,u,f)}function c(u){const f=[];if("children"in u){const p=u.children;let g=-1;for(;++g<p.length;){const v=a.one(p[g],u);if(v){if(g&&p[g-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=_P(v.value)),!Array.isArray(v)&&v.type==="element")){const b=v.children[0];b&&b.type==="text"&&(b.value=_P(b.value))}Array.isArray(v)?f.push(...v):f.push(v)}}}return f}}function ece(e,t){e.position&&(t.position=Nie(e))}function tce(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,ug(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function nce(e,t){const n=t.data||{},r="value"in t&&!(Xy.call(n,"hProperties")||Xy.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 rce(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
407
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
408
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
409
|
+
`}),n}function _P(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function SP(e,t){const n=Zle(e,t),r=n.one(e,void 0),o=Vle(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
|
|
410
|
+
`},o),i}function oce(e,t){return e&&"run"in e?async function(n,r){const o=SP(n,{file:r,...t});await e.run(o,r)}:function(n,r){return SP(n,{file:r,...t||e})}}function CP(e){if(e)throw e}var Rp=Object.prototype.hasOwnProperty,SA=Object.prototype.toString,EP=Object.defineProperty,RP=Object.getOwnPropertyDescriptor,PP=function(t){return typeof Array.isArray=="function"?Array.isArray(t):SA.call(t)==="[object Array]"},OP=function(t){if(!t||SA.call(t)!=="[object Object]")return!1;var n=Rp.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Rp.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||Rp.call(t,o)},$P=function(t,n){EP&&n.name==="__proto__"?EP(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},DP=function(t,n){if(n==="__proto__")if(Rp.call(t,n)){if(RP)return RP(t,n).value}else return;return t[n]},ice=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=DP(a,n),o=DP(t,n),a!==o&&(u&&o&&(OP(o)||(i=PP(o)))?(i?(i=!1,s=r&&PP(r)?r:[]):s=r&&OP(r)?r:{},$P(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&$P(a,{name:n,newValue:o}));return a};const e0=Oc(ice);function Qy(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 sce(){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 f=-1;if(l){s(l);return}for(;++f<o.length;)(c[f]===null||c[f]===void 0)&&(c[f]=o[f]);o=c,u?ace(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 ace(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l instanceof Promise?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const qo={basename:lce,dirname:cce,extname:uce,join:dce,sep:"/"};function lce(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');wf(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 cce(e){if(wf(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 uce(e){wf(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 dce(...e){let t=-1,n;for(;++t<e.length;)wf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":fce(n)}function fce(e){wf(e);const t=e.codePointAt(0)===47;let n=hce(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function hce(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 wf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const pce={cwd:gce};function gce(){return"/"}function Jy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function mce(e){if(typeof e=="string")e=new URL(e);else if(!Jy(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 vce(e)}function vce(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 t0=["history","path","basename","stem","extname","dirname"];class CA{constructor(t){let n;t?Jy(t)?n={path:t}:typeof t=="string"||bce(t)?n={value:t}:n=t:n={},this.cwd=pce.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<t0.length;){const i=t0[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)t0.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?qo.basename(this.path):void 0}set basename(t){r0(t,"basename"),n0(t,"basename"),this.path=qo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?qo.dirname(this.path):void 0}set dirname(t){TP(this.basename,"dirname"),this.path=qo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?qo.extname(this.path):void 0}set extname(t){if(n0(t,"extname"),TP(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=qo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Jy(t)&&(t=mce(t)),r0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?qo.basename(this.path,this.extname):void 0}set stem(t){r0(t,"stem"),n0(t,"stem"),this.path=qo.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 rr(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 n0(e,t){if(e&&e.includes(qo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+qo.sep+"`")}function r0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function TP(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function bce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yce=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};Object.setPrototypeOf(i,r);const s=Object.getOwnPropertyNames(o);for(const a of s){const l=Object.getOwnPropertyDescriptor(o,a);l&&Object.defineProperty(i,a,l)}return i},xce={}.hasOwnProperty;class M1 extends yce{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=sce()}copy(){const t=new M1;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(e0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(s0("data",this.frozen),this.namespace[t]=n,this):xce.call(this.namespace,t)&&this.namespace[t]||void 0:t?(s0("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=rp(t),r=this.parser||this.Parser;return o0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),o0("process",this.parser||this.Parser),i0("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=rp(t),l=r.parse(a);r.run(l,a,function(u,f,p){if(u||!f||!p)return c(u);const g=f,v=r.stringify(g,p);Sce(v)?p.value=v:p.result=v,c(u,p)});function c(u,f){u||!f?s(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),o0("processSync",this.parser||this.Parser),i0("processSync",this.compiler||this.Compiler),this.process(t,o),MP("processSync","process",n),r;function o(i,s){n=!0,CP(i),r=s}}run(t,n,r){kP(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=rp(n);o.run(t,l,c);function c(u,f,p){const g=f||t;u?a(u):s?s(g):r(void 0,g,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),MP("runSync","run",r),o;function i(s,a){CP(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=rp(n),o=this.compiler||this.Compiler;return i0("stringify",o),kP(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(s0("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,...f]=c;l(u,f)}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=e0(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===c){p=f;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[g,...v]=u;const b=r[p][1];Qy(b)&&Qy(g)&&(g=e0(!0,b,g)),r[p]=[c,g,...v]}}}}const wce=new M1().freeze();function o0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function i0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function s0(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 kP(e){if(!Qy(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function MP(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function rp(e){return _ce(e)?e:new CA(e)}function _ce(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Sce(e){return typeof e=="string"||Cce(e)}function Cce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ece="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",AP=[],IP={allowDangerousHtml:!0},Rce=/^(https?|ircs?|mailto|xmpp)$/i,Pce=[{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 EA(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||AP,l=e.remarkPlugins||AP,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...IP}:IP,u=e.skipHtml,f=e.unwrapDisallowed,p=e.urlTransform||Oce,g=wce().use(cle).use(l).use(oce,c).use(a),v=new CA;typeof r=="string"&&(v.value=r);for(const _ of Pce)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+Ece+_.id,void 0);const b=g.parse(v);let x=g.runSync(b,v);return o&&(x={type:"element",tagName:"div",properties:{className:o},children:x.type==="root"?x.children:[x]}),_A(x,w),Vie(x,{Fragment:P.Fragment,components:i,ignoreInvalidStyle:!0,jsx:P.jsx,jsxs:P.jsxs,passKeys:!0,passNode:!0});function w(_,S,R){if(_.type==="raw"&&R&&typeof S=="number")return u?R.children.splice(S,1):R.children[S]={type:"text",value:_.value},S;if(_.type==="element"){let E;for(E in Qb)if(Object.hasOwn(Qb,E)&&Object.hasOwn(_.properties,E)){const O=_.properties[E],k=Qb[E];(k===null||k.includes(_.tagName))&&(_.properties[E]=p(String(O||""),E,_))}}if(_.type==="element"){let E=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!E&&n&&typeof S=="number"&&(E=!n(_,S,R)),E&&R&&typeof S=="number")return f&&_.children?R.children.splice(S,1,..._.children):R.children.splice(S,1),S}}}function Oce(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t<0||o>-1&&t>o||n>-1&&t>n||r>-1&&t>r||Rce.test(e.slice(0,t))?e:""}function $ce(){const e=m.useRef(null),[t,n]=m.useState(""),[r,o]=m.useState(!1),i=Te(D=>D.dashboard.aiScopeTables);gw();const s=Te(D=>D.selectedSheetId),{addFrame:a,setSelectedFrameId:l,setIsDashboardEditing:c}=Wi(),{authToken:u}=el(),f=NO(),{messages:p,input:g,handleInputChange:v,handleSubmit:b,addToolResult:x,stop:w,isLoading:_}=Doe({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},maxToolRoundtrips:5,async onToolCall({toolCall:D}){if(R(D.toolName),D.toolName==="getLocation"){const I=["New York","Los Angeles","Chicago","San Francisco"];return I[Math.floor(Math.random()*I.length)]}if(D.toolName==="getTables")return JSON.stringify(i||[]);if(D.toolName==="getData"){console.log(D.args);const I=D.args;if(!(I!=null&&I.sql)||!(I!=null&&I.connectionId))return"Please provide sql, connectionId and table";const z=await f.fetchQuery({queryKey:["chat",I.connectionId,I.sql],queryFn:()=>Kd("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:I.connectionId,sql:I.sql})});return n("Summarizing"),JSON.stringify(z)}},onFinish(D,I){console.log("onFinish",D,I),D.content&&n("")}}),S=()=>{var D;(D=e.current)==null||D.scrollIntoView({behavior:"smooth"})};m.useEffect(()=>{S()},[p]);function R(D){D==="getTables"&&n("Initializing"),D==="getSchemas"&&n("Analyzing"),D==="getData"&&n("Fetching")}function E(D){const I=D.toolInvocations||[];return I.length===0||I.find(j=>j.toolName==="getData"&&"result"in j)?!0:r}function O(D){return D==null?void 0:D.map(I=>{var j;const z=I.role==="user";return E(I)?P.jsxs("div",{className:Ee("relative rounded-md bg-background px-4 py-4 text-sm text-foreground/80",{"bg-muted":z}),children:[P.jsx("div",{className:"space-y-2",children:P.jsxs("div",{className:"flex shrink-0 items-start gap-3",children:[P.jsx("div",{className:"text-muted-foreground",children:z?P.jsx(hY,{className:"size-5 shrink-0"}):P.jsx(my,{className:"size-5 shrink-0"})}),P.jsx("div",{children:P.jsx(EA,{components:Dce,children:I.content})})]})}),(j=I.toolInvocations)==null?void 0:j.map(Q=>{const U=Q.toolCallId;return"result"in Q?P.jsx("div",{children:k(Q)},U):P.jsxs("div",{children:["Calling ",Q.toolName,"..."]},U)})]},I.id):null})}function k(D){if("result"in D){let I;try{const z=JSON.parse(D.result);if(I=P.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(z,null,2)}),D.toolName==="getData"){console.log(D);const j=Dw({cardType:D.args.chartType,data:z.records});return P.jsxs("div",{className:"space-y-2",children:[r&&P.jsxs("div",{children:[P.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${D.toolName}: `,I]}),P.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[P.jsx(dr,{onClick:()=>{const Q=D.args.chartTitle,U=D.args.connectionId;M({sql:D.args.sql,data:z.records,cardType:D.args.chartType,cardCfg:j,cardTitle:Q,connectionId:U})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),j&&P.jsx(fw,{cfg:j})]})]})}}catch{I=P.jsx("span",{children:D.result})}return P.jsxs("div",{children:[P.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${D.toolName}: `,I]})}return`Calling ${D.toolName}...`}function M({sql:D,data:I,cardCfg:z,cardTitle:j,connectionId:Q,cardType:U}){if(!s)return;const B={id:Ua(),title:j||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:U==="horizontalBar"?"y":"x"}},type:z.type,cfg:z,sql:D,data:I,connectionId:Q},K={id:Ua(),cards:[B],activeCardId:B.id};c(!0),a(s,K,"start"),l(K.id)}return P.jsxs("div",{className:"flex h-full grow flex-col justify-between break-words rounded-md bg-muted/30 px-6 py-8",children:[P.jsxs("div",{className:"flex items-center gap-3",children:[P.jsx(zn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),P.jsxs(Aw,{openDelay:700,children:[P.jsx(Iw,{children:P.jsx(dY,{className:"size-4 text-muted-foreground"})}),P.jsx(Kg,{className:"w-70",children:P.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[P.jsx(my,{className:"size-5"}),P.jsxs("div",{className:"space-y-1",children:[P.jsx("p",{className:"text-sm",children:i&&(i==null?void 0:i.length)>0?"I can analyze following datasets":"No datasets in scope"}),P.jsx("div",{className:"space-y-2 pt-2",children:i==null?void 0:i.map((D,I)=>P.jsxs("div",{className:"flex gap-2 text-xs",children:[P.jsx(oT,{className:"size-4 opacity-70"}),P.jsx("span",{children:D.tableName})]},I))})]})]})})]}),!1]}),P.jsx(am,{className:"my-4"}),P.jsx("div",{className:"",children:P.jsxs("form",{className:"mb-1 flex w-full grow items-center justify-between gap-2 rounded-md",onSubmit:b,children:[P.jsxs("div",{className:"flex w-full items-center justify-between rounded-md border bg-background",children:[P.jsx(Gl,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:g,disabled:_,placeholder:"What can I help you with?",onChange:v}),P.jsx("button",{className:"mr-3",children:P.jsx(QD,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),_&&P.jsx(dr,{size:"sm",className:"rounded-full",onClick:()=>w(),children:P.jsx(UG,{className:"size-2.5 bg-background"})})]})}),P.jsxs(y1,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end",children:[P.jsxs("div",{className:"flex items-center text-xs text-foreground/90",children:[_&&t!==""&&P.jsx(kG,{className:"size-10 animate-pulse"}),t]}),P.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:O(p)}),P.jsx(gm,{orientation:"vertical"})]})]})}const Dce={li:({node:e,...t})=>P.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t}),pre:({node:e,...t})=>P.jsx("pre",{className:"word my-2 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-xs text-foreground/80",...t})},{createElement:Pc,createContext:Tce,createRef:Zpe,forwardRef:RA,useCallback:jr,useContext:PA,useEffect:Fa,useImperativeHandle:OA,useLayoutEffect:kce,useMemo:Mce,useRef:wo,useState:dg}=pe,NP=pe.useId,xm=Tce(null);xm.displayName="PanelGroupContext";const Dd=kce,Ace=typeof NP=="function"?NP:()=>null;let Ice=0;function A1(e=null){const t=Ace(),n=wo(e||t||null);return n.current===null&&(n.current=""+Ice++),e??n.current}function $A({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:p,style:g,tagName:v="div",...b}){const x=PA(xm);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:_,getPanelSize:S,getPanelStyle:R,groupId:E,isPanelCollapsed:O,registerPanel:k,resizePanel:M,unregisterPanel:D}=x,I=A1(s),z=wo({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:I,idIsFromProps:s!==void 0,order:p});wo({didLogMissingDefaultSizeWarning:!1}),Dd(()=>{const{callbacks:Q,constraints:U}=z.current;z.current.id=I,z.current.idIsFromProps=s!==void 0,z.current.order=p,Q.onCollapse=c,Q.onExpand=u,Q.onResize=f,U.collapsedSize=n,U.collapsible=r,U.defaultSize=o,U.maxSize=a,U.minSize=l}),Dd(()=>{const Q=z.current;return k(Q),()=>{D(Q)}},[p,I,k,D]),OA(i,()=>({collapse:()=>{w(z.current)},expand:()=>{_(z.current)},getId(){return I},getSize(){return S(z.current)},isCollapsed(){return O(z.current)},isExpanded(){return!O(z.current)},resize:Q=>{M(z.current,Q)}}),[w,_,S,O,I,M]);const j=R(z.current,o);return Pc(v,{...b,children:e,className:t,style:{...j,...g},"data-panel":"","data-panel-id":I,"data-panel-group-id":E,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const DA=RA((e,t)=>Pc($A,{...e,forwardedRef:t}));$A.displayName="Panel";DA.displayName="forwardRef(Panel)";function ht(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const TA=10;function Td(e,t,n=TA){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Wr(e,t,n){return Td(e,t,n)===0}function Vl({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];ht(r!=null);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(Td(n,a)<0)if(i){const l=(o+a)/2;Td(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(TA)),n}function Tu({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(Wr(e,0))return t;const i=[...t],[s,a]=r;ht(s!=null),ht(a!=null);let l=0;if(o==="keyboard"){{const u=e<0?a:s,f=n[u];if(ht(f),f.collapsible){const p=t[u];ht(p!=null);const g=n[u];ht(g);const{collapsedSize:v=0,minSize:b=0}=g;if(Wr(p,v)){const x=b-p;Td(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const u=e<0?s:a,f=n[u];ht(f);const{collapsible:p}=f;if(p){const g=t[u];ht(g!=null);const v=n[u];ht(v);const{collapsedSize:b=0,minSize:x=0}=v;if(Wr(g,x)){const w=g-b;Td(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const u=e<0?1:-1;let f=e<0?a:s,p=0;for(;;){const v=t[f];ht(v!=null);const x=Vl({panelConstraints:n,panelIndex:f,size:100})-v;if(p+=x,f+=u,f<0||f>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-g:g}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const p=Math.abs(e)-Math.abs(l),g=t[f];ht(g!=null);const v=g-p,b=Vl({panelConstraints:n,panelIndex:f,size:v});if(!Wr(g,b)&&(l+=g-b,i[f]=b,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Wr(l,0))return t;{const u=e<0?a:s,f=t[u];ht(f!=null);const p=f+l,g=Vl({panelConstraints:n,panelIndex:u,size:p});if(i[u]=g,!Wr(g,p)){let v=p-g,x=e<0?a:s;for(;x>=0&&x<n.length;){const w=i[x];ht(w!=null);const _=w+v,S=Vl({panelConstraints:n,panelIndex:x,size:_});if(Wr(w,S)||(v-=S-w,i[x]=S),Wr(v,0))break;e>0?x--:x++}}}const c=i.reduce((u,f)=>f+u,0);return Wr(c,100)?i:t}function Nce({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];ht(a!=null),t.forEach((f,p)=>{const{constraints:g}=f,{maxSize:v=100,minSize:b=0}=g;p===a?(r=b,o=v):(i+=b,s+=v)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function kd(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function kA(e,t){const r=kd(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function MA(e,t){const n=kA(e,t);return n!=null?[n,n+1]:[-1,-1]}function AA(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function wm(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Lce(e,t,n){var r,o,i,s;const a=wm(t),l=kd(e),c=a?l.indexOf(a):-1,u=(r=(o=n[c])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,f=(i=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null;return[u,f]}function Fce({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){wo({didWarnAboutMissingResizeHandle:!1}),Dd(()=>{const s=kd(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:c,valueNow:u}=Nce({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const p=o[a];ht(p),f.setAttribute("aria-controls",p.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,o]),Fa(()=>{const s=t.current;ht(s);const{panelDataArray:a}=s,l=AA(n);ht(l!=null,`No group found for id "${n}"`);const c=kd(n);ht(c);const u=c.map(f=>{const p=f.getAttribute("data-panel-resize-handle-id");ht(p);const[g,v]=Lce(n,p,a);if(g==null||v==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=a.findIndex(_=>_.id===g);if(w>=0){const _=a[w];ht(_);const S=r[w],{collapsedSize:R=0,collapsible:E,minSize:O=0}=_.constraints;if(S!=null&&E){const k=Tu({delta:Wr(S,R)?O-R:R-S,layout:r,panelConstraints:a.map(M=>M.constraints),pivotIndices:MA(n,p),trigger:"keyboard"});r!==k&&i(k)}}break}}};return f.addEventListener("keydown",b),()=>{f.removeEventListener("keydown",b)}});return()=>{u.forEach(f=>f())}},[e,t,n,r,o,i])}function LP(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 IA(e){return e.type==="keydown"}function NA(e){return e.type.startsWith("mouse")}function LA(e){return e.type.startsWith("touch")}function FA(e,t){const n=e==="horizontal";if(NA(t))return n?t.clientX:t.clientY;if(LA(t)){const r=t.touches[0];return ht(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function zce(e,t,n,r){const o=n==="horizontal",i=wm(t);ht(i);const s=i.getAttribute("data-panel-group-id");ht(s);let{initialCursorPosition:a}=r;const l=FA(n,e),c=AA(s);ht(c);const u=c.getBoundingClientRect(),f=o?u.width:u.height;return(l-a)/f*100}function jce(e,t,n,r,o){if(IA(e)){const i=n==="horizontal";let s=0;e.shiftKey?s=100:o!=null?s=o:s=10;let a=0;switch(e.key){case"ArrowDown":a=i?0:s;break;case"ArrowLeft":a=i?-s:0;break;case"ArrowRight":a=i?s:0;break;case"ArrowUp":a=i?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:zce(e,t,n,r)}function Bce({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];ht(s);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];ht(s);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 Il(e,t,n){t.forEach((r,o)=>{const i=e[o];ht(i);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:p,onExpand:g,onResize:v}=s;v&&v(r,f),u&&(p||g)&&(g&&(f==null||f===c)&&r!==c&&g(),p&&(f==null||f!==c)&&r===c&&p())}})}function op(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 Vce({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let Zy=null,Ea=null;function zA(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function Hce(){Ea!==null&&(document.head.removeChild(Ea),Zy=null,Ea=null)}function a0(e){if(Zy===e)return;Zy=e;const t=zA(e);Ea===null&&(Ea=document.createElement("style"),document.head.appendChild(Ea)),Ea.innerHTML=`*{cursor: ${t}!important;}`}function Wce(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function FP(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 jA(e){return`react-resizable-panels:${e}`}function BA(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 VA(e,t){try{const n=jA(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Uce(e,t,n){var r,o;const i=(r=VA(e,n))!==null&&r!==void 0?r:{},s=BA(t);return(o=i[s])!==null&&o!==void 0?o:null}function qce(e,t,n,r,o){var i;const s=jA(e),a=BA(t),l=(i=VA(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 zP({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(!Wr(r,100))for(let i=0;i<t.length;i++){const s=n[i];ht(s!=null);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];ht(s!=null);const a=Vl({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!Wr(o,0))for(let i=0;i<t.length;i++){const s=n[i];ht(s!=null);const a=s+o,l=Vl({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,Wr(o,0)))break}return n}const Gce=100,ku={getItem:e=>(FP(ku),ku.getItem(e)),setItem:(e,t)=>{FP(ku),ku.setItem(e,t)}},jP={};function HA({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=ku,style:c,tagName:u="div",...f}){const p=A1(i),[g,v]=dg(null),[b,x]=dg([]),w=wo({}),_=wo(new Map),S=wo(0),R=wo({autoSaveId:e,direction:r,dragState:g,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),E=wo({layout:b,panelDataArray:[],panelDataArrayChanged:!1});wo({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),OA(o,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:T}=E.current;return T},setLayout:T=>{const{onLayout:V}=R.current,{layout:X,panelDataArray:N}=E.current,se=zP({layout:T,panelConstraints:N.map(ae=>ae.constraints)});LP(X,se)||(x(se),E.current.layout=se,V&&V(se),Il(N,se,w.current))}}),[]),Dd(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=g,R.current.id=p,R.current.onLayout=s,R.current.storage=l}),Fce({committedValuesRef:R,eagerValuesRef:E,groupId:p,layout:b,panelDataArray:E.current.panelDataArray,setLayout:x}),Fa(()=>{const{panelDataArray:T}=E.current;if(e){if(b.length===0||b.length!==T.length)return;let V=jP[e];V==null&&(V=Wce(qce,Gce),jP[e]=V);const X=[...T],N=new Map(_.current);V(e,X,N,b,l)}},[e,b,l]),Fa(()=>{});const O=jr(T=>{const{onLayout:V}=R.current,{layout:X,panelDataArray:N}=E.current;if(T.constraints.collapsible){const se=N.map(oe=>oe.constraints),{collapsedSize:ae=0,panelSize:ue,pivotIndices:fe}=Nl(N,T,X);if(ht(ue!=null),ue!==ae){_.current.set(T.id,ue);const ee=zl(N,T)===N.length-1?ue-ae:ae-ue,ie=Tu({delta:ee,layout:X,panelConstraints:se,pivotIndices:fe,trigger:"imperative-api"});op(X,ie)||(x(ie),E.current.layout=ie,V&&V(ie),Il(N,ie,w.current))}}},[]),k=jr(T=>{const{onLayout:V}=R.current,{layout:X,panelDataArray:N}=E.current;if(T.constraints.collapsible){const se=N.map(ee=>ee.constraints),{collapsedSize:ae=0,panelSize:ue,minSize:fe=0,pivotIndices:oe}=Nl(N,T,X);if(ue===ae){const ee=_.current.get(T.id),ie=ee!=null&&ee>=fe?ee:fe,G=zl(N,T)===N.length-1?ue-ie:ie-ue,me=Tu({delta:G,layout:X,panelConstraints:se,pivotIndices:oe,trigger:"imperative-api"});op(X,me)||(x(me),E.current.layout=me,V&&V(me),Il(N,me,w.current))}}},[]),M=jr(T=>{const{layout:V,panelDataArray:X}=E.current,{panelSize:N}=Nl(X,T,V);return ht(N!=null),N},[]),D=jr((T,V)=>{const{panelDataArray:X}=E.current,N=zl(X,T);return Vce({defaultSize:V,dragState:g,layout:b,panelData:X,panelIndex:N})},[g,b]),I=jr(T=>{const{layout:V,panelDataArray:X}=E.current,{collapsedSize:N=0,collapsible:se,panelSize:ae}=Nl(X,T,V);return se===!0&&ae===N},[]),z=jr(T=>{const{layout:V,panelDataArray:X}=E.current,{collapsedSize:N=0,collapsible:se,panelSize:ae}=Nl(X,T,V);return ht(ae!=null),!se||ae>N},[]),j=jr(T=>{const{panelDataArray:V}=E.current;V.push(T),V.sort((X,N)=>{const se=X.order,ae=N.order;return se==null&&ae==null?0:se==null?-1:ae==null?1:se-ae}),E.current.panelDataArrayChanged=!0},[]);Dd(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:T,onLayout:V,storage:X}=R.current,{layout:N,panelDataArray:se}=E.current;let ae=null;if(T){const fe=Uce(T,se,X);fe&&(_.current=new Map(Object.entries(fe.expandToSizes)),ae=fe.layout)}ae==null&&(ae=Bce({panelDataArray:se}));const ue=zP({layout:ae,panelConstraints:se.map(fe=>fe.constraints)});LP(N,ue)||(x(ue),E.current.layout=ue,V&&V(ue),Il(se,ue,w.current))}});const Q=jr(T=>function(X){X.preventDefault();const{direction:N,dragState:se,id:ae,keyboardResizeBy:ue,onLayout:fe}=R.current,{layout:oe,panelDataArray:ee}=E.current,{initialLayout:ie}=se??{},be=MA(ae,T);let G=jce(X,T,N,se,ue);if(G===0)return;const me=N==="horizontal";document.dir==="rtl"&&me&&(G=-G);const _e=ee.map(Ve=>Ve.constraints),Pe=Tu({delta:G,layout:ie??oe,panelConstraints:_e,pivotIndices:be,trigger:IA(X)?"keyboard":"mouse-or-touch"}),$e=!op(oe,Pe);(NA(X)||LA(X))&&S.current!=G&&(S.current=G,a0($e?me?"horizontal":"vertical":me?G<0?"horizontal-min":"horizontal-max":G<0?"vertical-min":"vertical-max")),$e&&(x(Pe),E.current.layout=Pe,fe&&fe(Pe),Il(ee,Pe,w.current))},[]),U=jr((T,V)=>{const{onLayout:X}=R.current,{layout:N,panelDataArray:se}=E.current,ae=se.map(be=>be.constraints),{panelSize:ue,pivotIndices:fe}=Nl(se,T,N);ht(ue!=null);const ee=zl(se,T)===se.length-1?ue-V:V-ue,ie=Tu({delta:ee,layout:N,panelConstraints:ae,pivotIndices:fe,trigger:"imperative-api"});op(N,ie)||(x(ie),E.current.layout=ie,X&&X(ie),Il(se,ie,w.current))},[]),B=jr((T,V)=>{const{direction:X}=R.current,{layout:N}=E.current,se=wm(T);ht(se);const ae=FA(X,V);v({dragHandleId:T,dragHandleRect:se.getBoundingClientRect(),initialCursorPosition:ae,initialLayout:N})},[]),K=jr(()=>{Hce(),v(null)},[]),H=jr(T=>{const{panelDataArray:V}=E.current,X=zl(V,T);X>=0&&(V.splice(X,1),delete w.current[T.id],E.current.panelDataArrayChanged=!0)},[]),q=Mce(()=>({collapsePanel:O,direction:r,dragState:g,expandPanel:k,getPanelSize:M,getPanelStyle:D,groupId:p,isPanelCollapsed:I,isPanelExpanded:z,registerPanel:j,registerResizeHandle:Q,resizePanel:U,startDragging:B,stopDragging:K,unregisterPanel:H}),[O,g,r,k,M,D,p,I,z,j,Q,U,B,K,H]),Z={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Pc(xm.Provider,{value:q},Pc(u,{...f,children:t,className:n,style:{...Z,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const WA=RA((e,t)=>Pc(HA,{...e,forwardedRef:t}));HA.displayName="PanelGroup";WA.displayName="forwardRef(PanelGroup)";function zl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Nl(e,t,n){const r=e.map(c=>c.constraints),o=zl(e,t),i=r[o],a=o===e.length-1?[o-1,o]:[o,o+1],l=n[o];return{...i,panelSize:l,pivotIndices:a}}function Yce({disabled:e,handleId:t,resizeHandler:n}){Fa(()=>{if(e||n==null)return;const r=wm(t);if(r==null)return;const o=i=>{if(!i.defaultPrevented)switch(i.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{i.preventDefault(),n(i);break}case"F6":{i.preventDefault();const s=r.getAttribute("data-panel-group-id");ht(s);const a=kd(s),l=kA(s,t);ht(l!==null);const c=i.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function I1({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:s=0,tagName:a="div",...l}){const c=wo(null),u=wo({onDragging:o});Fa(()=>{u.current.onDragging=o});const f=PA(xm);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:p,dragState:g,groupId:v,registerResizeHandle:b,startDragging:x,stopDragging:w}=f,_=A1(r),S=(g==null?void 0:g.dragHandleId)===_,[R,E]=dg(!1),[O,k]=dg(null),M=jr(()=>{const I=c.current;ht(I),I.blur(),w();const{onDragging:z}=u.current;z&&z(!1)},[w]);Fa(()=>{if(n)k(null);else{const I=b(_);k(()=>I)}},[n,_,b]),Fa(()=>{if(n||O==null||!S)return;const I=U=>{O(U)},z=U=>{O(U)},j=c.current;ht(j);const Q=j.ownerDocument;return Q.body.addEventListener("contextmenu",M),Q.body.addEventListener("mousemove",I),Q.body.addEventListener("touchmove",I),Q.body.addEventListener("mouseleave",z),window.addEventListener("mouseup",M),window.addEventListener("touchend",M),()=>{Q.body.removeEventListener("contextmenu",M),Q.body.removeEventListener("mousemove",I),Q.body.removeEventListener("touchmove",I),Q.body.removeEventListener("mouseleave",z),window.removeEventListener("mouseup",M),window.removeEventListener("touchend",M)}},[p,n,S,O,M]),Yce({disabled:n,handleId:_,resizeHandler:O});const D={cursor:zA(p),touchAction:"none",userSelect:"none"};return Pc(a,{...l,children:e,className:t,onBlur:()=>E(!1),onFocus:()=>E(!0),onMouseDown:I=>{x(_,I.nativeEvent);const z=u.current;ht(z);const{onDragging:j}=z;j&&j(!0)},onMouseUp:M,onTouchCancel:M,onTouchEnd:M,onTouchStart:I=>{x(_,I.nativeEvent);const z=u.current;ht(z);const{onDragging:j}=z;j&&j(!0)},ref:c,role:"separator",style:{...D,...i},tabIndex:s,"data-panel-group-direction":p,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":S?"pointer":R?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}I1.displayName="PanelResizeHandle";const UA=({className:e,...t})=>P.jsx(WA,{className:Ee("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),ex=DA,Kce=({withHandle:e,className:t,...n})=>P.jsx(I1,{className:Ee("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&&P.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:P.jsx(lY,{className:"h-2.5 w-2.5"})})}),Xce=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>P.jsx(I1,{className:Ee("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&&P.jsx("div",{className:Ee("z-50 flex items-center justify-start",{"border-l":r}),children:P.jsx(dr,{variant:"secondary",className:Ee("h-7 p-1",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-2 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?P.jsx(mw,{className:"size-4"}):P.jsx(tT,{className:"size-4"})})})});function qA(){const e=Te(l=>{var c;return(c=l.dashboard)==null?void 0:c.sheets}),t=m.useRef(null),[n,r]=m.useState(!1);Te(l=>l.isDashboardEditing);const o=Te(l=>l.themeStyle);Te(l=>l.isVisualEditing);const i=Te(l=>l.selectedSheetId),s=Te(l=>l.actions.setSelectedSheetId);if(!e)return null;function a(l){var c,u;l?((c=t.current)==null||c.resize(35),r(!0)):(r(!1),(u=t.current)==null||u.resize(0))}return P.jsx(ZO,{role:"dashboard-tabs-container",className:Ee("relative flex grow",o==null?void 0:o.dashboardTabsContainer),onValueChange:l=>{s(l)},value:i||e[0].id,children:P.jsxs(UA,{direction:"horizontal",children:[P.jsx(ex,{children:e==null?void 0:e.map(l=>P.jsx(Cx,{className:"mt-0",value:l.id,children:P.jsx(Ire,{})},l.id))}),P.jsx(Xce,{open:n,onTabClick:a,withHandle:!0}),P.jsx(ex,{onResize:l=>{l<1?r(!1):n||r(!0)},defaultSize:0,ref:t,children:P.jsx($ce,{})})]})})}function GA({children:e}){return P.jsx(T8,{defaultTheme:"system",storageKey:"vite-ui-theme",children:P.jsx(AK,{delayDuration:0,children:e})})}function YA(e){return P.jsx(DT,{dashboardProps:e,children:P.jsx(GA,{children:P.jsx(BO,{...e,children:P.jsx(qA,{})})})})}const tx=["Enter"," "],Qce=["ArrowDown","PageUp","Home"],KA=["ArrowUp","PageDown","End"],Jce=[...Qce,...KA],Zce={ltr:[...tx,"ArrowRight"],rtl:[...tx,"ArrowLeft"]},eue={ltr:["ArrowLeft"],rtl:["ArrowRight"]},_m="Menu",[Md,tue,nue]=Cg(_m),[sl,XA]=Bn(_m,[nue,di,Dc]),N1=di(),QA=Dc(),[rue,al]=sl(_m),[oue,_f]=sl(_m),iue=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=N1(t),[l,c]=m.useState(null),u=m.useRef(!1),f=Mn(i),p=Xa(o);return m.useEffect(()=>{const g=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(cf,a,m.createElement(rue,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(oue,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:s},r)))},JA=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=N1(n);return m.createElement(uf,le({},o,r,{ref:t}))}),ZA="MenuPortal",[sue,eI]=sl(ZA,{forceMount:void 0}),aue=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=al(ZA,t);return m.createElement(sue,{scope:t,forceMount:n},m.createElement(Rn,{present:n||i.open},m.createElement(qg,{asChild:!0,container:o},r)))},Io="MenuContent",[lue,L1]=sl(Io),cue=m.forwardRef((e,t)=>{const n=eI(Io,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=al(Io,e.__scopeMenu),s=_f(Io,e.__scopeMenu);return m.createElement(Md.Provider,{scope:e.__scopeMenu},m.createElement(Rn,{present:r||i.open},m.createElement(Md.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(uue,le({},o,{ref:t})):m.createElement(due,le({},o,{ref:t})))))}),uue=m.forwardRef((e,t)=>{const n=al(Io,e.__scopeMenu),r=m.useRef(null),o=lt(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Zg(i)},[]),m.createElement(F1,le({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),due=m.forwardRef((e,t)=>{const n=al(Io,e.__scopeMenu);return m.createElement(F1,le({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),F1=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:g,disableOutsideScroll:v,...b}=e,x=al(Io,n),w=_f(Io,n),_=N1(n),S=QA(n),R=tue(n),[E,O]=m.useState(null),k=m.useRef(null),M=lt(t,k,x.onContentChange),D=m.useRef(0),I=m.useRef(""),z=m.useRef(0),j=m.useRef(null),Q=m.useRef("right"),U=m.useRef(0),B=v?tm:m.Fragment,K=v?{as:ji,allowPinchZoom:!0}:void 0,H=Z=>{var T,V;const X=I.current+Z,N=R().filter(ee=>!ee.disabled),se=document.activeElement,ae=(T=N.find(ee=>ee.ref.current===se))===null||T===void 0?void 0:T.textValue,ue=N.map(ee=>ee.textValue),fe=Due(ue,X,ae),oe=(V=N.find(ee=>ee.textValue===fe))===null||V===void 0?void 0:V.ref.current;(function ee(ie){I.current=ie,window.clearTimeout(D.current),ie!==""&&(D.current=window.setTimeout(()=>ee(""),1e3))})(X),oe&&setTimeout(()=>oe.focus())};m.useEffect(()=>()=>window.clearTimeout(D.current),[]),Xg();const q=m.useCallback(Z=>{var T,V;return Q.current===((T=j.current)===null||T===void 0?void 0:T.side)&&kue(Z,(V=j.current)===null||V===void 0?void 0:V.area)},[]);return m.createElement(lue,{scope:n,searchRef:I,onItemEnter:m.useCallback(Z=>{q(Z)&&Z.preventDefault()},[q]),onItemLeave:m.useCallback(Z=>{var T;q(Z)||((T=k.current)===null||T===void 0||T.focus(),O(null))},[q]),onTriggerLeave:m.useCallback(Z=>{q(Z)&&Z.preventDefault()},[q]),pointerGraceTimerRef:z,onPointerGraceIntentChange:m.useCallback(Z=>{j.current=Z},[])},m.createElement(B,K,m.createElement(Qg,{asChild:!0,trapped:o,onMountAutoFocus:Re(i,Z=>{var T;Z.preventDefault(),(T=k.current)===null||T===void 0||T.focus()}),onUnmountAutoFocus:s},m.createElement(Tc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:g},m.createElement(wx,le({asChild:!0},S,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:O,onEntryFocus:Re(l,Z=>{w.isUsingKeyboardRef.current||Z.preventDefault()})}),m.createElement(df,le({role:"menu","aria-orientation":"vertical","data-state":iI(x.open),"data-radix-menu-content":"",dir:w.dir},_,b,{ref:M,style:{outline:"none",...b.style},onKeyDown:Re(b.onKeyDown,Z=>{const V=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,X=Z.ctrlKey||Z.altKey||Z.metaKey,N=Z.key.length===1;V&&(Z.key==="Tab"&&Z.preventDefault(),!X&&N&&H(Z.key));const se=k.current;if(Z.target!==se||!Jce.includes(Z.key))return;Z.preventDefault();const ue=R().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);KA.includes(Z.key)&&ue.reverse(),Oue(ue)}),onBlur:Re(e.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(D.current),I.current="")}),onPointerMove:Re(e.onPointerMove,Ad(Z=>{const T=Z.target,V=U.current!==Z.clientX;if(Z.currentTarget.contains(T)&&V){const X=Z.clientX>U.current?"right":"left";Q.current=X,U.current=Z.clientX}}))})))))))}),fue=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Ue.div,le({role:"group"},r,{ref:t}))}),hue=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Ue.div,le({},r,{ref:t}))}),nx="MenuItem",BP="menu.itemSelect",z1=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=_f(nx,e.__scopeMenu),a=L1(nx,e.__scopeMenu),l=lt(t,i),c=m.useRef(!1),u=()=>{const f=i.current;if(!n&&f){const p=new CustomEvent(BP,{bubbles:!0,cancelable:!0});f.addEventListener(BP,g=>r==null?void 0:r(g),{once:!0}),HO(f,p),p.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(tI,le({},o,{ref:l,disabled:n,onClick:Re(e.onClick,u),onPointerDown:f=>{var p;(p=e.onPointerDown)===null||p===void 0||p.call(e,f),c.current=!0},onPointerUp:Re(e.onPointerUp,f=>{var p;c.current||(p=f.currentTarget)===null||p===void 0||p.click()}),onKeyDown:Re(e.onKeyDown,f=>{const p=a.searchRef.current!=="";n||p&&f.key===" "||tx.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),tI=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=L1(nx,n),a=QA(n),l=m.useRef(null),c=lt(t,l),[u,f]=m.useState(!1),[p,g]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var b;g(((b=v.textContent)!==null&&b!==void 0?b:"").trim())}},[i.children]),m.createElement(Md.ItemSlot,{scope:n,disabled:r,textValue:o??p},m.createElement(_x,le({asChild:!0},a,{focusable:!r}),m.createElement(Ue.div,le({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:Re(e.onPointerMove,Ad(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Re(e.onPointerLeave,Ad(v=>s.onItemLeave(v))),onFocus:Re(e.onFocus,()=>f(!0)),onBlur:Re(e.onBlur,()=>f(!1))}))))}),pue=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(rI,{scope:e.__scopeMenu,checked:n},m.createElement(z1,le({role:"menuitemcheckbox","aria-checked":fg(n)?"mixed":n},o,{ref:t,"data-state":j1(n),onSelect:Re(o.onSelect,()=>r==null?void 0:r(fg(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),gue="MenuRadioGroup",[mue,vue]=sl(gue,{value:void 0,onValueChange:()=>{}}),bue=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Mn(r);return m.createElement(mue,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(fue,le({},o,{ref:t})))}),yue="MenuRadioItem",xue=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=vue(yue,e.__scopeMenu),i=n===o.value;return m.createElement(rI,{scope:e.__scopeMenu,checked:i},m.createElement(z1,le({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":j1(i),onSelect:Re(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),nI="MenuItemIndicator",[rI,wue]=sl(nI,{checked:!1}),_ue=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=wue(nI,n);return m.createElement(Rn,{present:r||fg(i.checked)||i.checked===!0},m.createElement(Ue.span,le({},o,{ref:t,"data-state":j1(i.checked)})))}),Sue=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Ue.div,le({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),Cue="MenuSub",[ege,oI]=sl(Cue),ip="MenuSubTrigger",Eue=m.forwardRef((e,t)=>{const n=al(ip,e.__scopeMenu),r=_f(ip,e.__scopeMenu),o=oI(ip,e.__scopeMenu),i=L1(ip,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(JA,le({asChild:!0},c),m.createElement(tI,le({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":iI(n.open)},e,{ref:Sg(t,o.onTriggerChange),onClick:f=>{var p;(p=e.onClick)===null||p===void 0||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,Ad(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Re(e.onPointerLeave,Ad(f=>{var p;u();const g=(p=n.content)===null||p===void 0?void 0:p.getBoundingClientRect();if(g){var v;const b=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=b==="right",w=x?-5:5,_=g[x?"left":"right"],S=g[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:_,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:_,y:g.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,f=>{const p=i.searchRef.current!=="";if(!(e.disabled||p&&f.key===" ")&&Zce[r.dir].includes(f.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),f.preventDefault()}})})))}),Rue="MenuSubContent",Pue=m.forwardRef((e,t)=>{const n=eI(Io,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=al(Io,e.__scopeMenu),s=_f(Io,e.__scopeMenu),a=oI(Rue,e.__scopeMenu),l=m.useRef(null),c=lt(t,l);return m.createElement(Md.Provider,{scope:e.__scopeMenu},m.createElement(Rn,{present:r||i.open},m.createElement(Md.Slot,{scope:e.__scopeMenu},m.createElement(F1,le({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 f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Re(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Re(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),p=eue[s.dir].includes(u.key);if(f&&p){var g;i.onOpenChange(!1),(g=a.trigger)===null||g===void 0||g.focus(),u.preventDefault()}})})))))});function iI(e){return e?"open":"closed"}function fg(e){return e==="indeterminate"}function j1(e){return fg(e)?"indeterminate":e?"checked":"unchecked"}function Oue(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $ue(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Due(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=$ue(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 Tue(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 kue(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Tue(n,t)}function Ad(e){return t=>t.pointerType==="mouse"?e(t):void 0}const Mue=iue,Aue=JA,Iue=aue,Nue=cue,Lue=hue,Fue=z1,zue=pue,jue=bue,Bue=xue,Vue=_ue,Hue=Sue,Wue=Eue,Uue=Pue,sI="DropdownMenu",[que,tge]=Bn(sI,[XA]),oo=XA(),[Gue,aI]=que(sI),Yue=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=oo(t),c=m.useRef(null),[u=!1,f]=nr({prop:o,defaultProp:i,onChange:s});return m.createElement(Gue,{scope:t,triggerId:Or(),triggerRef:c,contentId:Or(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),modal:a},m.createElement(Mue,le({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},Kue="DropdownMenuTrigger",Xue=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=aI(Kue,n),s=oo(n);return m.createElement(Aue,le({asChild:!0},s),m.createElement(Ue.button,le({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:Sg(t,i.triggerRef),onPointerDown:Re(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Re(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),Que=e=>{const{__scopeDropdownMenu:t,...n}=e,r=oo(t);return m.createElement(Iue,le({},r,n))},Jue="DropdownMenuContent",Zue=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=aI(Jue,n),i=oo(n),s=m.useRef(!1);return m.createElement(Nue,le({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Re(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)"}}))}),ede=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=oo(n);return m.createElement(Lue,le({},o,r,{ref:t}))}),tde=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=oo(n);return m.createElement(Fue,le({},o,r,{ref:t}))}),nde=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=oo(n);return m.createElement(zue,le({},o,r,{ref:t}))}),rde=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=oo(n);return m.createElement(jue,le({},o,r,{ref:t}))}),ode=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=oo(n);return m.createElement(Bue,le({},o,r,{ref:t}))}),ide=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=oo(n);return m.createElement(Vue,le({},o,r,{ref:t}))}),sde=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=oo(n);return m.createElement(Hue,le({},o,r,{ref:t}))}),ade=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=oo(n);return m.createElement(Wue,le({},o,r,{ref:t}))}),lde=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=oo(n);return m.createElement(Uue,le({},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)"}}))}),cde=Yue,ude=Xue,dde=Que,lI=Zue,cI=ede,uI=tde,dI=nde,fde=rde,fI=ode,hI=ide,pI=sde,gI=ade,mI=lde,hde=cde,pde=ude,gde=fde,mde=pe.forwardRef(({className:e,inset:t,children:n,...r},o)=>P.jsxs(gI,{ref:o,className:Ee("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,P.jsx(mw,{className:"ml-auto h-4 w-4"})]}));mde.displayName=gI.displayName;const vde=pe.forwardRef(({className:e,...t},n)=>P.jsx(mI,{ref:n,className:Ee("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}));vde.displayName=mI.displayName;const vI=pe.forwardRef(({className:e,sideOffset:t=4,...n},r)=>P.jsx(dde,{children:P.jsx(lI,{ref:r,sideOffset:t,className:Ee("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})}));vI.displayName=lI.displayName;const bde=pe.forwardRef(({className:e,inset:t,...n},r)=>P.jsx(uI,{ref:r,className:Ee("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}));bde.displayName=uI.displayName;const yde=pe.forwardRef(({className:e,children:t,checked:n,...r},o)=>P.jsxs(dI,{ref:o,className:Ee("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(hI,{children:P.jsx(af,{className:"h-4 w-4"})})}),t]}));yde.displayName=dI.displayName;const bI=pe.forwardRef(({className:e,children:t,...n},r)=>P.jsxs(fI,{ref:r,className:Ee("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:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(hI,{children:P.jsx(nT,{className:"h-2 w-2 fill-current"})})}),t]}));bI.displayName=fI.displayName;const yI=pe.forwardRef(({className:e,inset:t,...n},r)=>P.jsx(cI,{ref:r,className:Ee("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));yI.displayName=cI.displayName;const xI=pe.forwardRef(({className:e,...t},n)=>P.jsx(pI,{ref:n,className:Ee("-mx-1 my-1 h-px bg-muted",e),...t}));xI.displayName=pI.displayName;function xde(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,frames:(r=n.frames)==null?void 0:r.map(o=>{var i;return{...o,cards:(i=o.cards)==null?void 0:i.map(s=>wI(s))}})}})}}function wI(e){var t,n,r,o;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(o=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:o.map(i=>({...i,data:[]}))}},customCfg:wde(e.customCfg),data:[]}}function wde(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function _I(e){return`semaphor:bookmark:${e}`}const SI="Dialog",[CI,nge]=Bn(SI),[_de,zo]=CI(SI),Sde=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,u]=nr({prop:r,defaultProp:o,onChange:i});return m.createElement(_de,{scope:t,triggerRef:a,contentRef:l,contentId:Or(),titleId:Or(),descriptionId:Or(),open:c,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(f=>!f),[u]),modal:s},n)},Cde="DialogTrigger",Ede=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=zo(Cde,n),i=lt(t,o.triggerRef);return m.createElement(Ue.button,le({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":B1(o.open)},r,{ref:i,onClick:Re(e.onClick,o.onOpenToggle)}))}),EI="DialogPortal",[Rde,RI]=CI(EI,{forceMount:void 0}),Pde=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=zo(EI,t);return m.createElement(Rde,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(Rn,{present:n||i.open},m.createElement(qg,{asChild:!0,container:o},s))))},rx="DialogOverlay",Ode=m.forwardRef((e,t)=>{const n=RI(rx,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=zo(rx,e.__scopeDialog);return i.modal?m.createElement(Rn,{present:r||i.open},m.createElement($de,le({},o,{ref:t}))):null}),$de=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=zo(rx,n);return m.createElement(tm,{as:ji,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(Ue.div,le({"data-state":B1(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Id="DialogContent",Dde=m.forwardRef((e,t)=>{const n=RI(Id,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=zo(Id,e.__scopeDialog);return m.createElement(Rn,{present:r||i.open},i.modal?m.createElement(Tde,le({},o,{ref:t})):m.createElement(kde,le({},o,{ref:t})))}),Tde=m.forwardRef((e,t)=>{const n=zo(Id,e.__scopeDialog),r=m.useRef(null),o=lt(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Zg(i)},[]),m.createElement(PI,le({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,i=>i.preventDefault())}))}),kde=m.forwardRef((e,t)=>{const n=zo(Id,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(PI,le({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),PI=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=zo(Id,n),l=m.useRef(null),c=lt(t,l);return Xg(),m.createElement(m.Fragment,null,m.createElement(Qg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Tc,le({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":B1(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),Mde="DialogTitle",Ade=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=zo(Mde,n);return m.createElement(Ue.h2,le({id:o.titleId},r,{ref:t}))}),Ide="DialogDescription",Nde=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=zo(Ide,n);return m.createElement(Ue.p,le({id:o.descriptionId},r,{ref:t}))}),Lde="DialogClose",Fde=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=zo(Lde,n);return m.createElement(Ue.button,le({type:"button"},r,{ref:t,onClick:Re(e.onClick,()=>o.onOpenChange(!1))}))});function B1(e){return e?"open":"closed"}const zde=Sde,jde=Ede,Bde=Pde,OI=Ode,$I=Dde,DI=Ade,TI=Nde,Vde=Fde,Hde=zde,Wde=jde,Ude=Bde,kI=pe.forwardRef(({className:e,...t},n)=>P.jsx(OI,{ref:n,className:Ee("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}));kI.displayName=OI.displayName;const MI=pe.forwardRef(({className:e,children:t,...n},r)=>P.jsxs(Ude,{children:[P.jsx(kI,{}),P.jsxs($I,{ref:r,className:Ee("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,P.jsxs(Vde,{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:[P.jsx(yw,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));MI.displayName=$I.displayName;const AI=({className:e,...t})=>P.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});AI.displayName="DialogHeader";const II=({className:e,...t})=>P.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});II.displayName="DialogFooter";const NI=pe.forwardRef(({className:e,...t},n)=>P.jsx(DI,{ref:n,className:Ee("text-lg font-semibold leading-none tracking-tight",e),...t}));NI.displayName=DI.displayName;const LI=pe.forwardRef(({className:e,...t},n)=>P.jsx(TI,{ref:n,className:Ee("text-sm text-muted-foreground",e),...t}));LI.displayName=TI.displayName;const FI="Checkbox",[qde,rge]=Bn(FI),[Gde,Yde]=qde(FI),Kde=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,p]=m.useState(null),g=lt(t,S=>p(S)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[x=!1,w]=nr({prop:o,defaultProp:i,onChange:c}),_=m.useRef(x);return m.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const R=()=>w(_.current);return S.addEventListener("reset",R),()=>S.removeEventListener("reset",R)}},[f,w]),m.createElement(Gde,{scope:n,state:x,disabled:a},m.createElement(Ue.button,le({type:"button",role:"checkbox","aria-checked":za(x)?"mixed":x,"aria-required":s,"data-state":zI(x),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:g,onKeyDown:Re(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Re(e.onClick,S=>{w(R=>za(R)?!0:!R),b&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),b&&m.createElement(Jde,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Xde="CheckboxIndicator",Qde=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Yde(Xde,n);return m.createElement(Rn,{present:r||za(i.state)||i.state===!0},m.createElement(Ue.span,le({"data-state":zI(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Jde=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Jg(n),a=Ug(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});l.indeterminate=za(n),f.call(l,za(n)?!1:n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",le({type:"checkbox","aria-hidden":!0,defaultChecked:za(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function za(e){return e==="indeterminate"}function zI(e){return za(e)?"indeterminate":e?"checked":"unchecked"}const jI=Kde,Zde=Qde,BI=pe.forwardRef(({className:e,...t},n)=>P.jsx(jI,{ref:n,className:Ee("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:P.jsx(Zde,{className:Ee("flex items-center justify-center text-current"),children:P.jsx(af,{className:"h-4 w-4"})})}));BI.displayName=jI.displayName;const VI=m.forwardRef(({className:e,...t},n)=>P.jsx("div",{role:"editor-panel",ref:n,className:Ee("flex grow h-full",e),...t}));VI.displayName="EditorPanel";const HI=m.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:Ee(" flex flex-col space-y-2 w-[270px]",e),...t}));HI.displayName="EditorAside";const WI=m.forwardRef(({className:e,...t},n)=>P.jsx("div",{ref:n,className:Ee(" grow",e),...t}));WI.displayName="EditorMain";var efe=e=>{switch(e){case"success":return rfe;case"info":return ife;case"warning":return ofe;case"error":return sfe;default:return null}},tfe=Array(12).fill(0),nfe=({visible:e})=>m.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},m.createElement("div",{className:"sonner-spinner"},tfe.map((t,n)=>m.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),rfe=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.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"})),ofe=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},m.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"})),ife=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.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"})),sfe=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.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"})),afe=()=>{let[e,t]=m.useState(document.hidden);return m.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},ox=1,lfe=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:ox++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0;return r.then(async i=>{if(ufe(i)&&!i.ok){o=!1;let s=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:s,description:a})}else if(t.success!==void 0){o=!1;let s=typeof t.success=="function"?await t.success(i):t.success,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:s,description:a})}}).catch(async i=>{if(t.error!==void 0){o=!1;let s=typeof t.error=="function"?await t.error(i):t.error,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:s,description:a})}}).finally(()=>{var i;o&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||ox++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Ur=new lfe,cfe=(e,t)=>{let n=(t==null?void 0:t.id)||ox++;return Ur.addToast({title:e,...t,id:n}),n},ufe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",dfe=cfe,ffe=()=>Ur.toasts,hfe=Object.assign(dfe,{success:Ur.success,info:Ur.info,warning:Ur.warning,error:Ur.error,custom:Ur.custom,message:Ur.message,promise:Ur.promise,dismiss:Ur.dismiss,loading:Ur.loading},{getHistory:ffe});function pfe(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}pfe(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
411
|
+
`);function sp(e){return e.label!==void 0}var gfe=3,mfe="32px",vfe=4e3,bfe=356,yfe=14,xfe=20,wfe=200;function _fe(...e){return e.filter(Boolean).join(" ")}var Sfe=e=>{var t,n,r,o,i,s,a,l,c,u;let{invert:f,toast:p,unstyled:g,interacting:v,setHeights:b,visibleToasts:x,heights:w,index:_,toasts:S,expanded:R,removeToast:E,defaultRichColors:O,closeButton:k,style:M,cancelButtonStyle:D,actionButtonStyle:I,className:z="",descriptionClassName:j="",duration:Q,position:U,gap:B,loadingIcon:K,expandByDefault:H,classNames:q,icons:Z,closeButtonAriaLabel:T="Close toast",pauseWhenPageIsHidden:V,cn:X}=e,[N,se]=m.useState(!1),[ae,ue]=m.useState(!1),[fe,oe]=m.useState(!1),[ee,ie]=m.useState(!1),[be,G]=m.useState(0),[me,_e]=m.useState(0),Pe=m.useRef(null),$e=m.useRef(null),Ve=_===0,Fe=_+1<=x,ke=p.type,Ge=p.dismissible!==!1,ct=p.className||"",kt=p.descriptionClassName||"",Dt=m.useMemo(()=>w.findIndex(Ze=>Ze.toastId===p.id)||0,[w,p.id]),cn=m.useMemo(()=>{var Ze;return(Ze=p.closeButton)!=null?Ze:k},[p.closeButton,k]),de=m.useMemo(()=>p.duration||Q||vfe,[p.duration,Q]),Se=m.useRef(0),Ie=m.useRef(0),qe=m.useRef(0),Je=m.useRef(null),[Gt,Jt]=U.split("-"),un=m.useMemo(()=>w.reduce((Ze,Et,Pt)=>Pt>=Dt?Ze:Ze+Et.height,0),[w,Dt]),Pn=afe(),or=p.invert||f,Zt=ke==="loading";Ie.current=m.useMemo(()=>Dt*B+un,[Dt,un]),m.useEffect(()=>{se(!0)},[]),m.useLayoutEffect(()=>{if(!N)return;let Ze=$e.current,Et=Ze.style.height;Ze.style.height="auto";let Pt=Ze.getBoundingClientRect().height;Ze.style.height=Et,_e(Pt),b(Wt=>Wt.find(yn=>yn.toastId===p.id)?Wt.map(yn=>yn.toastId===p.id?{...yn,height:Pt}:yn):[{toastId:p.id,height:Pt,position:p.position},...Wt])},[N,p.title,p.description,b,p.id]);let hn=m.useCallback(()=>{ue(!0),G(Ie.current),b(Ze=>Ze.filter(Et=>Et.toastId!==p.id)),setTimeout(()=>{E(p)},wfe)},[p,E,b,Ie]);m.useEffect(()=>{if(p.promise&&ke==="loading"||p.duration===1/0||p.type==="loading")return;let Ze,Et=de;return R||v||V&&Pn?(()=>{if(qe.current<Se.current){let Pt=new Date().getTime()-Se.current;Et=Et-Pt}qe.current=new Date().getTime()})():Et!==1/0&&(Se.current=new Date().getTime(),Ze=setTimeout(()=>{var Pt;(Pt=p.onAutoClose)==null||Pt.call(p,p),hn()},Et)),()=>clearTimeout(Ze)},[R,v,H,p,de,hn,p.promise,ke,V,Pn]),m.useEffect(()=>{let Ze=$e.current;if(Ze){let Et=Ze.getBoundingClientRect().height;return _e(Et),b(Pt=>[{toastId:p.id,height:Et,position:p.position},...Pt]),()=>b(Pt=>Pt.filter(Wt=>Wt.toastId!==p.id))}},[b,p.id]),m.useEffect(()=>{p.delete&&hn()},[hn,p.delete]);function On(){return Z!=null&&Z.loading?m.createElement("div",{className:"sonner-loader","data-visible":ke==="loading"},Z.loading):K?m.createElement("div",{className:"sonner-loader","data-visible":ke==="loading"},K):m.createElement(nfe,{visible:ke==="loading"})}return m.createElement("li",{"aria-live":p.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:$e,className:X(z,ct,q==null?void 0:q.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,q==null?void 0:q.default,q==null?void 0:q[ke],(n=p==null?void 0:p.classNames)==null?void 0:n[ke]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:O,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":N,"data-promise":!!p.promise,"data-removed":ae,"data-visible":Fe,"data-y-position":Gt,"data-x-position":Jt,"data-index":_,"data-front":Ve,"data-swiping":fe,"data-dismissible":Ge,"data-type":ke,"data-invert":or,"data-swipe-out":ee,"data-expanded":!!(R||H&&N),style:{"--index":_,"--toasts-before":_,"--z-index":S.length-_,"--offset":`${ae?be:Ie.current}px`,"--initial-height":H?"auto":`${me}px`,...M,...p.style},onPointerDown:Ze=>{Zt||!Ge||(Pe.current=new Date,G(Ie.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(oe(!0),Je.current={x:Ze.clientX,y:Ze.clientY}))},onPointerUp:()=>{var Ze,Et,Pt,Wt;if(ee||!Ge)return;Je.current=null;let yn=Number(((Ze=$e.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount").replace("px",""))||0),fr=new Date().getTime()-((Et=Pe.current)==null?void 0:Et.getTime()),hi=Math.abs(yn)/fr;if(Math.abs(yn)>=xfe||hi>.11){G(Ie.current),(Pt=p.onDismiss)==null||Pt.call(p,p),hn(),ie(!0);return}(Wt=$e.current)==null||Wt.style.setProperty("--swipe-amount","0px"),oe(!1)},onPointerMove:Ze=>{var Et;if(!Je.current||!Ge)return;let Pt=Ze.clientY-Je.current.y,Wt=Ze.clientX-Je.current.x,yn=(Gt==="top"?Math.min:Math.max)(0,Pt),fr=Ze.pointerType==="touch"?10:2;Math.abs(yn)>fr?(Et=$e.current)==null||Et.style.setProperty("--swipe-amount",`${Pt}px`):Math.abs(Wt)>fr&&(Je.current=null)}},cn&&!p.jsx?m.createElement("button",{"aria-label":T,"data-disabled":Zt,"data-close-button":!0,onClick:Zt||!Ge?()=>{}:()=>{var Ze;hn(),(Ze=p.onDismiss)==null||Ze.call(p,p)},className:X(q==null?void 0:q.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},m.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"},m.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,p.jsx||m.isValidElement(p.title)?p.jsx||p.title:m.createElement(m.Fragment,null,ke||p.icon||p.promise?m.createElement("div",{"data-icon":"",className:X(q==null?void 0:q.icon,(i=p==null?void 0:p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||On():null,p.type!=="loading"?p.icon||(Z==null?void 0:Z[ke])||efe(ke):null):null,m.createElement("div",{"data-content":"",className:X(q==null?void 0:q.content,(s=p==null?void 0:p.classNames)==null?void 0:s.content)},m.createElement("div",{"data-title":"",className:X(q==null?void 0:q.title,(a=p==null?void 0:p.classNames)==null?void 0:a.title)},p.title),p.description?m.createElement("div",{"data-description":"",className:X(j,kt,q==null?void 0:q.description,(l=p==null?void 0:p.classNames)==null?void 0:l.description)},p.description):null),m.isValidElement(p.cancel)?p.cancel:p.cancel&&sp(p.cancel)?m.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||D,onClick:Ze=>{var Et,Pt;sp(p.cancel)&&Ge&&((Pt=(Et=p.cancel).onClick)==null||Pt.call(Et,Ze),hn())},className:X(q==null?void 0:q.cancelButton,(c=p==null?void 0:p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,m.isValidElement(p.action)?p.action:p.action&&sp(p.action)?m.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||I,onClick:Ze=>{var Et,Pt;sp(p.action)&&(Ze.defaultPrevented||((Pt=(Et=p.action).onClick)==null||Pt.call(Et,Ze),hn()))},className:X(q==null?void 0:q.actionButton,(u=p==null?void 0:p.classNames)==null?void 0:u.actionButton)},p.action.label):null))};function VP(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var Cfe=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:s,offset:a,theme:l="light",richColors:c,duration:u,style:f,visibleToasts:p=gfe,toastOptions:g,dir:v=VP(),gap:b=yfe,loadingIcon:x,icons:w,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S,cn:R=_fe}=e,[E,O]=m.useState([]),k=m.useMemo(()=>Array.from(new Set([n].concat(E.filter(V=>V.position).map(V=>V.position)))),[E,n]),[M,D]=m.useState([]),[I,z]=m.useState(!1),[j,Q]=m.useState(!1),[U,B]=m.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=m.useRef(null),H=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=m.useRef(null),Z=m.useRef(!1),T=m.useCallback(V=>{var X;(X=E.find(N=>N.id===V.id))!=null&&X.delete||Ur.dismiss(V.id),O(N=>N.filter(({id:se})=>se!==V.id))},[E]);return m.useEffect(()=>Ur.subscribe(V=>{if(V.dismiss){O(X=>X.map(N=>N.id===V.id?{...N,delete:!0}:N));return}setTimeout(()=>{Fo.flushSync(()=>{O(X=>{let N=X.findIndex(se=>se.id===V.id);return N!==-1?[...X.slice(0,N),{...X[N],...V},...X.slice(N+1)]:[V,...X]})})})}),[]),m.useEffect(()=>{if(l!=="system"){B(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:V})=>{B(V?"dark":"light")})},[l]),m.useEffect(()=>{E.length<=1&&z(!1)},[E]),m.useEffect(()=>{let V=X=>{var N,se;r.every(ae=>X[ae]||X.code===ae)&&(z(!0),(N=K.current)==null||N.focus()),X.code==="Escape"&&(document.activeElement===K.current||(se=K.current)!=null&&se.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[r]),m.useEffect(()=>{if(K.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,Z.current=!1)}},[K.current]),E.length?m.createElement("section",{"aria-label":`${_} ${H}`,tabIndex:-1},k.map((V,X)=>{var N;let[se,ae]=V.split("-");return m.createElement("ol",{key:V,dir:v==="auto"?VP():v,tabIndex:-1,ref:K,className:s,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":se,"data-x-position":ae,style:{"--front-toast-height":`${((N=M[0])==null?void 0:N.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||mfe,"--width":`${bfe}px`,"--gap":`${b}px`,...f},onBlur:ue=>{Z.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(Z.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,q.current=ue.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{j||z(!1)},onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||Q(!0)},onPointerUp:()=>Q(!1)},E.filter(ue=>!ue.position&&X===0||ue.position===V).map((ue,fe)=>{var oe,ee;return m.createElement(Sfe,{key:ue.id,icons:w,index:fe,toast:ue,defaultRichColors:c,duration:(oe=g==null?void 0:g.duration)!=null?oe:u,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:t,visibleToasts:p,closeButton:(ee=g==null?void 0:g.closeButton)!=null?ee:i,interacting:j,position:V,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:T,toasts:E.filter(ie=>ie.position==ue.position),heights:M.filter(ie=>ie.position==ue.position),setHeights:D,expandByDefault:o,gap:b,loadingIcon:x,expanded:I,pauseWhenPageIsHidden:S,cn:R})}))})):null};function Efe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HP(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 WP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HP(Object(n),!0).forEach(function(r){Efe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rfe(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 Pfe(e,t){if(e==null)return{};var n=Rfe(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 Ofe(e,t){return $fe(e)||Dfe(e,t)||Tfe(e,t)||kfe()}function $fe(e){if(Array.isArray(e))return e}function Dfe(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 Tfe(e,t){if(e){if(typeof e=="string")return UP(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 UP(e,t)}}function UP(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 kfe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
412
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mfe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qP(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 GP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qP(Object(n),!0).forEach(function(r){Mfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Afe(){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 Mu(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 hg(e){return{}.toString.call(e).includes("Object")}function Ife(e){return!Object.keys(e).length}function Nd(e){return typeof e=="function"}function Nfe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Lfe(e,t){return hg(t)||ks("changeType"),Object.keys(t).some(function(n){return!Nfe(e,n)})&&ks("changeField"),t}function Ffe(e){Nd(e)||ks("selectorType")}function zfe(e){Nd(e)||hg(e)||ks("handlerType"),hg(e)&&Object.values(e).some(function(t){return!Nd(t)})&&ks("handlersType")}function jfe(e){e||ks("initialIsRequired"),hg(e)||ks("initialType"),Ife(e)&&ks("initialContent")}function Bfe(e,t){throw new Error(e[t]||e.default)}var Vfe={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"},ks=Mu(Bfe)(Vfe),ap={changes:Lfe,selector:Ffe,handler:zfe,initial:jfe};function Hfe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ap.initial(e),ap.handler(t);var n={current:e},r=Mu(qfe)(n,t),o=Mu(Ufe)(n),i=Mu(ap.changes)(e),s=Mu(Wfe)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return ap.selector(c),c(n.current)}function l(c){Afe(r,o,i,s)(c)}return[a,l]}function Wfe(e,t){return Nd(t)?t(e.current):t}function Ufe(e,t){return e.current=GP(GP({},e.current),t),t}function qfe(e,t,n){return Nd(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 Gfe={create:Hfe},Yfe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function Kfe(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 Xfe(e){return{}.toString.call(e).includes("Object")}function Qfe(e){return e||YP("configIsRequired"),Xfe(e)||YP("configType"),e.urls?(Jfe(),{paths:{vs:e.urls.monacoBase}}):e}function Jfe(){console.warn(UI.deprecation)}function Zfe(e,t){throw new Error(e[t]||e.default)}var UI={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!
|
|
413
|
+
You are using deprecated way of configuration.
|
|
414
|
+
|
|
415
|
+
Instead of using
|
|
416
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
417
|
+
use
|
|
418
|
+
monaco.config({ paths: { vs: '...' } })
|
|
419
|
+
|
|
420
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
421
|
+
`},YP=Kfe(Zfe)(UI),ehe={config:Qfe},the=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 qI(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],qI(e[n],t[n]))}),WP(WP({},e),t)}var nhe={type:"cancelation",msg:"operation is manually canceled"};function l0(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(nhe):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var rhe=Gfe.create({config:Yfe,isInitialized:!1,resolve:null,reject:null,monaco:null}),GI=Ofe(rhe,2),Sf=GI[0],Sm=GI[1];function ohe(e){var t=ehe.config(e),n=t.monaco,r=Pfe(t,["monaco"]);Sm(function(o){return{config:qI(o.config,r),monaco:n}})}function ihe(){var e=Sf(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Sm({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),l0(c0);if(window.monaco&&window.monaco.editor)return YI(window.monaco),e.resolve(window.monaco),l0(c0);the(she,lhe)(che)}return l0(c0)}function she(e){return document.body.appendChild(e)}function ahe(e){var t=document.createElement("script");return e&&(t.src=e),t}function lhe(e){var t=Sf(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=ahe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function che(){var e=Sf(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){YI(n),e.resolve(n)},function(n){e.reject(n)})}function YI(e){Sf().monaco||Sm({monaco:e})}function uhe(){return Sf(function(e){var t=e.monaco;return t})}var c0=new Promise(function(e,t){return Sm({resolve:e,reject:t})}),KI={config:ohe,init:ihe,__getMonacoInstance:uhe},dhe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},u0=dhe,fhe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},hhe=fhe;function phe({children:e}){return m.createElement("div",{style:hhe.container},e)}var ghe=phe,mhe=ghe;function vhe({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...u0.wrapper,width:e,height:t},...s},!n&&m.createElement(mhe,null,r),m.createElement("div",{ref:o,style:{...u0.fullWidth,...!n&&u0.hide},className:i}))}var bhe=vhe,XI=m.memo(bhe);function yhe(e){m.useEffect(e,[])}var QI=yhe;function xhe(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Gr=xhe;function qu(){}function Hl(e,t,n,r){return whe(e,r)||_he(e,t,n,r)}function whe(e,t){return e.editor.getModel(JI(e,t))}function _he(e,t,n,r){return e.editor.createModel(t,n,r?JI(e,r):void 0)}function JI(e,t){return e.Uri.parse(t)}function She({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:f={},height:p="100%",width:g="100%",className:v,wrapperProps:b={},beforeMount:x=qu,onMount:w=qu}){let[_,S]=m.useState(!1),[R,E]=m.useState(!0),O=m.useRef(null),k=m.useRef(null),M=m.useRef(null),D=m.useRef(w),I=m.useRef(x),z=m.useRef(!1);QI(()=>{let B=KI.init();return B.then(K=>(k.current=K)&&E(!1)).catch(K=>(K==null?void 0:K.type)!=="cancelation"&&console.error("Monaco initialization: error:",K)),()=>O.current?U():B.cancel()}),Gr(()=>{if(O.current&&k.current){let B=O.current.getOriginalEditor(),K=Hl(k.current,e||"",r||n||"text",i||"");K!==B.getModel()&&B.setModel(K)}},[i],_),Gr(()=>{if(O.current&&k.current){let B=O.current.getModifiedEditor(),K=Hl(k.current,t||"",o||n||"text",s||"");K!==B.getModel()&&B.setModel(K)}},[s],_),Gr(()=>{let B=O.current.getModifiedEditor();B.getOption(k.current.editor.EditorOption.readOnly)?B.setValue(t||""):t!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[t],_),Gr(()=>{var B,K;(K=(B=O.current)==null?void 0:B.getModel())==null||K.original.setValue(e||"")},[e],_),Gr(()=>{let{original:B,modified:K}=O.current.getModel();k.current.editor.setModelLanguage(B,r||n||"text"),k.current.editor.setModelLanguage(K,o||n||"text")},[n,r,o],_),Gr(()=>{var B;(B=k.current)==null||B.editor.setTheme(c)},[c],_),Gr(()=>{var B;(B=O.current)==null||B.updateOptions(f)},[f],_);let j=m.useCallback(()=>{var H;if(!k.current)return;I.current(k.current);let B=Hl(k.current,e||"",r||n||"text",i||""),K=Hl(k.current,t||"",o||n||"text",s||"");(H=O.current)==null||H.setModel({original:B,modified:K})},[n,t,o,e,r,i,s]),Q=m.useCallback(()=>{var B;!z.current&&M.current&&(O.current=k.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...f}),j(),(B=k.current)==null||B.editor.setTheme(c),S(!0),z.current=!0)},[f,c,j]);m.useEffect(()=>{_&&D.current(O.current,k.current)},[_]),m.useEffect(()=>{!R&&!_&&Q()},[R,_,Q]);function U(){var K,H,q,Z;let B=(K=O.current)==null?void 0:K.getModel();a||((H=B==null?void 0:B.original)==null||H.dispose()),l||((q=B==null?void 0:B.modified)==null||q.dispose()),(Z=O.current)==null||Z.dispose()}return m.createElement(XI,{width:g,height:p,isEditorReady:_,loading:u,_ref:M,className:v,wrapperProps:b})}var Che=She;m.memo(Che);function Ehe(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var Rhe=Ehe,lp=new Map;function Phe({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:f=!0,keepCurrentModel:p=!1,width:g="100%",height:v="100%",className:b,wrapperProps:x={},beforeMount:w=qu,onMount:_=qu,onChange:S,onValidate:R=qu}){let[E,O]=m.useState(!1),[k,M]=m.useState(!0),D=m.useRef(null),I=m.useRef(null),z=m.useRef(null),j=m.useRef(_),Q=m.useRef(w),U=m.useRef(),B=m.useRef(r),K=Rhe(i),H=m.useRef(!1),q=m.useRef(!1);QI(()=>{let V=KI.init();return V.then(X=>(D.current=X)&&M(!1)).catch(X=>(X==null?void 0:X.type)!=="cancelation"&&console.error("Monaco initialization: error:",X)),()=>I.current?T():V.cancel()}),Gr(()=>{var X,N,se,ae;let V=Hl(D.current,e||r||"",t||o||"",i||n||"");V!==((X=I.current)==null?void 0:X.getModel())&&(f&&lp.set(K,(N=I.current)==null?void 0:N.saveViewState()),(se=I.current)==null||se.setModel(V),f&&((ae=I.current)==null||ae.restoreViewState(lp.get(i))))},[i],E),Gr(()=>{var V;(V=I.current)==null||V.updateOptions(c)},[c],E),Gr(()=>{!I.current||r===void 0||(I.current.getOption(D.current.editor.EditorOption.readOnly)?I.current.setValue(r):r!==I.current.getValue()&&(q.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),I.current.pushUndoStop(),q.current=!1))},[r],E),Gr(()=>{var X,N;let V=(X=I.current)==null?void 0:X.getModel();V&&o&&((N=D.current)==null||N.editor.setModelLanguage(V,o))},[o],E),Gr(()=>{var V;a!==void 0&&((V=I.current)==null||V.revealLine(a))},[a],E),Gr(()=>{var V;(V=D.current)==null||V.editor.setTheme(s)},[s],E);let Z=m.useCallback(()=>{var V;if(!(!z.current||!D.current)&&!H.current){Q.current(D.current);let X=i||n,N=Hl(D.current,r||e||"",t||o||"",X||"");I.current=(V=D.current)==null?void 0:V.editor.create(z.current,{model:N,automaticLayout:!0,...c},u),f&&I.current.restoreViewState(lp.get(X)),D.current.editor.setTheme(s),a!==void 0&&I.current.revealLine(a),O(!0),H.current=!0}},[e,t,n,r,o,i,c,u,f,s,a]);m.useEffect(()=>{E&&j.current(I.current,D.current)},[E]),m.useEffect(()=>{!k&&!E&&Z()},[k,E,Z]),B.current=r,m.useEffect(()=>{var V,X;E&&S&&((V=U.current)==null||V.dispose(),U.current=(X=I.current)==null?void 0:X.onDidChangeModelContent(N=>{q.current||S(I.current.getValue(),N)}))},[E,S]),m.useEffect(()=>{if(E){let V=D.current.editor.onDidChangeMarkers(X=>{var se;let N=(se=I.current.getModel())==null?void 0:se.uri;if(N&&X.find(ae=>ae.path===N.path)){let ae=D.current.editor.getModelMarkers({resource:N});R==null||R(ae)}});return()=>{V==null||V.dispose()}}return()=>{}},[E,R]);function T(){var V,X;(V=U.current)==null||V.dispose(),p?f&&lp.set(i,I.current.saveViewState()):(X=I.current.getModel())==null||X.dispose(),I.current.dispose()}return m.createElement(XI,{width:g,height:v,isEditorReady:E,loading:l,_ref:z,className:b,wrapperProps:x})}var Ohe=Phe,ZI=m.memo(Ohe),$he=ZI;const e5="Collapsible",[Dhe,t5]=Bn(e5),[The,V1]=Dhe(e5),khe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=nr({prop:r,defaultProp:o,onChange:s});return m.createElement(The,{scope:n,disabled:i,contentId:Or(),open:l,onOpenToggle:m.useCallback(()=>c(u=>!u),[c])},m.createElement(Ue.div,le({"data-state":H1(l),"data-disabled":i?"":void 0},a,{ref:t})))}),Mhe="CollapsibleTrigger",Ahe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=V1(Mhe,n);return m.createElement(Ue.button,le({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":H1(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:Re(e.onClick,o.onOpenToggle)}))}),n5="CollapsibleContent",Ihe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=V1(n5,e.__scopeCollapsible);return m.createElement(Rn,{present:n||o.open},({present:i})=>m.createElement(Nhe,le({},r,{ref:t,present:i})))}),Nhe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=V1(n5,n),[a,l]=m.useState(r),c=m.useRef(null),u=lt(t,c),f=m.useRef(0),p=f.current,g=m.useRef(0),v=g.current,b=s.open||a,x=m.useRef(b),w=m.useRef();return m.useEffect(()=>{const _=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(_)},[]),tr(()=>{const _=c.current;if(_){w.current=w.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const S=_.getBoundingClientRect();f.current=S.height,g.current=S.width,x.current||(_.style.transitionDuration=w.current.transitionDuration,_.style.animationName=w.current.animationName),l(r)}},[s.open,r]),m.createElement(Ue.div,le({"data-state":H1(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":v?`${v}px`:void 0,...e.style}}),b&&o)});function H1(e){return e?"open":"closed"}const Lhe=khe,Fhe=Ahe,zhe=Ihe,Hs="Accordion",jhe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[W1,Bhe,Vhe]=Cg(Hs),[Cm,oge]=Bn(Hs,[Vhe,t5]),U1=t5(),r5=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(W1.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(qhe,le({},i,{ref:t})):m.createElement(Uhe,le({},o,{ref:t})))});r5.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[o5,Hhe]=Cm(Hs),[i5,Whe]=Cm(Hs,{collapsible:!1}),Uhe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=nr({prop:n,defaultProp:r,onChange:o});return m.createElement(o5,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(i5,{scope:e.__scopeAccordion,collapsible:i},m.createElement(s5,le({},s,{ref:t}))))}),qhe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=nr({prop:n,defaultProp:r,onChange:o}),l=m.useCallback(u=>a((f=[])=>[...f,u]),[a]),c=m.useCallback(u=>a((f=[])=>f.filter(p=>p!==u)),[a]);return m.createElement(o5,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(i5,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(s5,le({},i,{ref:t}))))}),[Ghe,Em]=Cm(Hs),s5=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=m.useRef(null),l=lt(a,t),c=Bhe(n),f=Xa(o)==="ltr",p=Re(e.onKeyDown,g=>{var v;if(!jhe.includes(g.key))return;const b=g.target,x=c().filter(D=>{var I;return!((I=D.ref.current)!==null&&I!==void 0&&I.disabled)}),w=x.findIndex(D=>D.ref.current===b),_=x.length;if(w===-1)return;g.preventDefault();let S=w;const R=0,E=_-1,O=()=>{S=w+1,S>E&&(S=R)},k=()=>{S=w-1,S<R&&(S=E)};switch(g.key){case"Home":S=R;break;case"End":S=E;break;case"ArrowRight":i==="horizontal"&&(f?O():k());break;case"ArrowDown":i==="vertical"&&O();break;case"ArrowLeft":i==="horizontal"&&(f?k():O());break;case"ArrowUp":i==="vertical"&&k();break}const M=S%_;(v=x[M].ref.current)===null||v===void 0||v.focus()});return m.createElement(Ghe,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(W1.Slot,{scope:n},m.createElement(Ue.div,le({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:p}))))}),ix="AccordionItem",[Yhe,q1]=Cm(ix),Khe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Em(ix,n),s=Hhe(ix,n),a=U1(n),l=Or(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return m.createElement(Yhe,{scope:n,open:c,disabled:u,triggerId:l},m.createElement(Lhe,le({"data-orientation":i.orientation,"data-state":a5(c)},a,o,{ref:t,disabled:u,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),Xhe="AccordionHeader",Qhe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Em(Hs,n),i=q1(Xhe,n);return m.createElement(Ue.h3,le({"data-orientation":o.orientation,"data-state":a5(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),KP="AccordionTrigger",Jhe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Em(Hs,n),i=q1(KP,n),s=Whe(KP,n),a=U1(n);return m.createElement(W1.ItemSlot,{scope:n},m.createElement(Fhe,le({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),Zhe="AccordionContent",epe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Em(Hs,n),i=q1(Zhe,n),s=U1(n);return m.createElement(zhe,le({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function a5(e){return e?"open":"closed"}const tpe=r5,npe=Khe,rpe=Qhe,l5=Jhe,c5=epe,ope=tpe,u5=pe.forwardRef(({className:e,...t},n)=>P.jsx(npe,{ref:n,className:Ee("border-b",e),...t}));u5.displayName="AccordionItem";const d5=pe.forwardRef(({className:e,children:t,...n},r)=>P.jsx(rpe,{className:"flex",children:P.jsxs(l5,{ref:r,className:Ee("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,P.jsx(Vg,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));d5.displayName=l5.displayName;const f5=pe.forwardRef(({className:e,children:t,...n},r)=>P.jsx(c5,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:P.jsx("div",{className:Ee("pb-4 pt-0",e),children:t})}));f5.displayName=c5.displayName;const h5="Radio",[ipe,p5]=Bn(h5),[spe,ape]=ipe(h5),lpe=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...c}=e,[u,f]=m.useState(null),p=lt(t,b=>f(b)),g=m.useRef(!1),v=u?!!u.closest("form"):!0;return m.createElement(spe,{scope:n,checked:o,disabled:s},m.createElement(Ue.button,le({type:"button",role:"radio","aria-checked":o,"data-state":g5(o),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:p,onClick:Re(e.onClick,b=>{o||l==null||l(),v&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})})),v&&m.createElement(dpe,{control:u,bubbles:!g.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),cpe="RadioIndicator",upe=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=ape(cpe,n);return m.createElement(Rn,{present:r||i.checked},m.createElement(Ue.span,le({"data-state":g5(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),dpe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Jg(n),a=Ug(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",le({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 g5(e){return e?"checked":"unchecked"}const fpe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],m5="RadioGroup",[hpe,ige]=Bn(m5,[Dc,p5]),v5=Dc(),b5=p5(),[ppe,gpe]=hpe(m5),mpe=m.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:f,...p}=e,g=v5(n),v=Xa(c),[b,x]=nr({prop:i,defaultProp:o,onChange:f});return m.createElement(ppe,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:x},m.createElement(wx,le({asChild:!0},g,{orientation:l,dir:v,loop:u}),m.createElement(Ue.div,le({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},p,{ref:t}))))}),vpe="RadioGroupItem",bpe=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=gpe(vpe,n),s=i.disabled||r,a=v5(n),l=b5(n),c=m.useRef(null),u=lt(t,c),f=i.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const g=b=>{fpe.includes(b.key)&&(p.current=!0)},v=()=>p.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",v)}},[]),m.createElement(_x,le({asChild:!0},a,{focusable:!s,active:f}),m.createElement(lpe,le({disabled:s,required:i.required,checked:f},l,o,{name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:Re(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:Re(o.onFocus,()=>{var g;p.current&&((g=c.current)===null||g===void 0||g.click())})})))}),ype=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=b5(n);return m.createElement(upe,le({},o,r,{ref:t}))}),y5=mpe,x5=bpe,xpe=ype,w5=pe.forwardRef(({className:e,...t},n)=>P.jsx(y5,{className:Ee("grid gap-2",e),...t,ref:n}));w5.displayName=y5.displayName;const _5=pe.forwardRef(({className:e,...t},n)=>P.jsx(x5,{ref:n,className:Ee("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:P.jsx(xpe,{className:"flex items-center justify-center",children:P.jsx(nT,{className:"h-2.5 w-2.5 fill-current text-current"})})}));_5.displayName=x5.displayName;var wpe=Object.defineProperty,_pe=(e,t,n)=>t in e?wpe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cp=(e,t,n)=>(_pe(e,typeof t!="symbol"?t+"":t,n),n);const Spe={stringify:e=>e,parse:e=>e},Cpe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},Epe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},Rpe={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},Ppe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},d0={string:Spe,number:Cpe,boolean:Epe,function:Rpe,json:Ppe},f0=Symbol.for("r2wc.render"),up=Symbol.for("r2wc.connected"),ha=Symbol.for("r2wc.context"),ds=Symbol.for("r2wc.props");function Ope(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(f=>f!=="container"),a={},l={},c={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const p=$pe(f);l[f]=p,c[p]=f}class u extends HTMLElement{constructor(){super(),cp(this,r,!0),cp(this,o),cp(this,i,{}),cp(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[ds].container=this.container;for(const p of s){const g=l[p],v=this.getAttribute(g),b=a[p],x=d0[b];v&&x!=null&&x.parse&&(this[ds][p]=x.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[up]=!0,this[f0]()}disconnectedCallback(){this[up]=!1,this[ha]&&n.unmount(this[ha]),delete this[ha]}attributeChangedCallback(p,g,v){const b=c[p],x=a[b],w=d0[x];b in a&&w!=null&&w.parse&&(this[ds][b]=w.parse(v,this),this[f0]())}[(r=up,o=ha,i=ds,f0)](){this[up]&&(this[ha]?n.update(this[ha],this[ds]):this[ha]=n.mount(this.container,e,this[ds]))}}for(const f of s){const p=l[f],g=a[f];Object.defineProperty(u.prototype,f,{enumerable:!0,configurable:!0,get(){return this[ds][f]},set(v){this[ds][f]=v;const b=d0[g];if(b!=null&&b.stringify){const x=b.stringify(v);this.getAttribute(p)!==x&&this.setAttribute(p,x)}}})}return u}function $pe(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Dpe(e,t,n){const r=S0(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function Tpe({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function kpe({root:e}){e.unmount()}function Mpe(e,t={}){return Ope(e,t,{mount:Dpe,update:Tpe,unmount:kpe})}const Ape={id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function"},Ipe=Mpe(YA,{props:Ape});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=RM;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=wT;exports.Accordion=ope;exports.AccordionContent=f5;exports.AccordionItem=u5;exports.AccordionTrigger=d5;exports.BOOLEAN_DATA_TYPES=fx;exports.Bot=my;exports.Button=dr;exports.Calendar=eT;exports.Card=vx;exports.CardContent=_g;exports.CardDescription=bx;exports.CardFooter=yx;exports.CardHeader=wg;exports.CardTitle=Zd;exports.ChartJsVisual=fw;exports.Check=af;exports.CheckIcon=KD;exports.Checkbox=BI;exports.ChevronDown=Vg;exports.ClipboardCopyIcon=$G;exports.ColorFormat=Pk;exports.Cross2Icon=XD;exports.DATE_DATA_TYPES=Xd;exports.Dashboard=YA;exports.DashboardPanel=BO;exports.DashboardTabs=qA;exports.DashboardWC=Ipe;exports.Dialog=Hde;exports.DialogContent=MI;exports.DialogDescription=LI;exports.DialogFooter=II;exports.DialogHeader=AI;exports.DialogTitle=NI;exports.DialogTrigger=Wde;exports.DropdownMenu=hde;exports.DropdownMenuContent=vI;exports.DropdownMenuLabel=yI;exports.DropdownMenuRadioGroup=gde;exports.DropdownMenuRadioItem=bI;exports.DropdownMenuSeparator=xI;exports.DropdownMenuTrigger=pde;exports.Editable=Va;exports.EditorAside=HI;exports.EditorMain=WI;exports.EditorPanel=VI;exports.Ft=$he;exports.HoverCard=Aw;exports.HoverCardContent=Kg;exports.HoverCardTrigger=Iw;exports.InfoCircledIcon=FG;exports.Input=Gl;exports.Jt=hfe;exports.KPICard=PT;exports.LOCALE_CURRENCY_PAIRS=C0;exports.Label=zn;exports.LoaderCircle=vw;exports.Markdown=EA;exports.NUMBER_DATA_TYPES=hc;exports.PYTHON_DEFAULT_CODE=EO;exports.PaperPlaneIcon=QD;exports.PlayIcon=BG;exports.Plus=rT;exports.Popover=im;exports.PopoverContent=ff;exports.PopoverTrigger=sm;exports.RadioGroup=w5;exports.RadioGroupItem=_5;exports.ResizableHandle=Kce;exports.ResizablePanel=ex;exports.ResizablePanelGroup=UA;exports.ScrollArea=y1;exports.ScrollBar=gm;exports.Select=ps;exports.SelectContent=ki;exports.SelectGroup=Fl;exports.SelectItem=Fn;exports.SelectLabel=ba;exports.SelectSeparator=eg;exports.SelectTrigger=Ti;exports.SelectValue=gs;exports.SemaphorContextProvider=DT;exports.SemaphorQueryClient=OT;exports.Separator=am;exports.Settings=bw;exports.SliderIcon=HG;exports.Switch=zM;exports.TEXT_DATA_TYPES=yg;exports.Table=oT;exports.Table$1=Nw;exports.TableBody=Fw;exports.TableCell=Jp;exports.TableHead=zw;exports.TableHeader=Lw;exports.TableRow=Hu;exports.TableVisual=$k;exports.Tabs=ZO;exports.TabsContent=Cx;exports.TabsList=e$;exports.TabsTrigger=t$;exports.Te=Cfe;exports.Textarea=Yw;exports.Toggle=Gw;exports.Tooltip=CT;exports.TooltipContent=$w;exports.TooltipTrigger=ET;exports.TriangleDownIcon=hw;exports.TriangleUpIcon=pw;exports.UXProvider=GA;exports.X=yw;exports._=Fi;exports.cleanCard=wI;exports.cn=Ee;exports.copyToClipboard=g9;exports.createChartConfig=Dw;exports.createLucideIcon=Sn;exports.createSqlGenConfig=q9;exports.de=ZI;exports.flexRender=Py;exports.fmt=hx;exports.getBookmarkKey=_I;exports.getCanvasBackgroundColor=Xu;exports.getColumnDataType=G9;exports.getContrastColor=Qu;exports.getCoreRowModel=WT;exports.getDashbaordStateWithoutData=xde;exports.getDefaultFilterSql=kre;exports.getFilterValueType=Dp;exports.getKeys=Xr;exports.getNumberAxis=TT;exports.getPaginationRowModel=qT;exports.getQualifiedTableName=PO;exports.getRequest=p9;exports.getSortedRowModel=UT;exports.getSql=U9;exports.isColumnInSqlGen=Y9;exports.jsxRuntimeExports=P;exports.pivotData=qp;exports.postRequest=Kd;exports.resolveBaseQuery=fO;exports.resolveDataType=Ju;exports.titleCase=v9;exports.useCard=oX;exports.useDashboardActions=Wi;exports.useDashboardCard=Tw;exports.useDashboardStore=Te;exports.useEditorActions=gw;exports.useEditorStore=Sr;exports.useQuery=Jd;exports.useReactTable=GT;exports.useSemaphorContext=el;exports.useTheme=zO;exports.v4=Ua;
|