react-semaphor 0.0.78 → 0.0.80

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.
@@ -6,11 +6,11 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var uw;function EN(){return uw||(uw=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"),i=Symbol.for("react.strict_mode"),o=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"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function x(D){if(D===null||typeof D!="object")return null;var G=v&&D[v]||D[b];return typeof G=="function"?G:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(D){{for(var G=arguments.length,oe=new Array(G>1?G-1:0),Oe=1;Oe<G;Oe++)oe[Oe-1]=arguments[Oe];C("error",D,oe)}}function C(D,G,oe){{var Oe=w.ReactDebugCurrentFrame,$e=Oe.getStackAddendum();$e!==""&&(G+="%s",oe=oe.concat([$e]));var Be=oe.map(function(Re){return String(Re)});Be.unshift("Warning: "+G),Function.prototype.apply.call(console[D],console,Be)}}var P=!1,O=!1,k=!1,T=!1,I=!1,F;F=Symbol.for("react.module.reference");function j(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===o||I||D===i||D===c||D===d||T||D===p||P||O||k||typeof D=="object"&&D!==null&&(D.$$typeof===g||D.$$typeof===f||D.$$typeof===s||D.$$typeof===a||D.$$typeof===l||D.$$typeof===F||D.getModuleId!==void 0))}function B(D,G,oe){var Oe=D.displayName;if(Oe)return Oe;var $e=G.displayName||G.name||"";return $e!==""?oe+"("+$e+")":oe}function V(D){return D.displayName||"Context"}function q(D){if(D==null)return null;if(typeof D.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if(typeof D=="object")switch(D.$$typeof){case a:var G=D;return V(G)+".Consumer";case s:var oe=D;return V(oe._context)+".Provider";case l:return B(D,D.render,"ForwardRef");case f:var Oe=D.displayName||null;return Oe!==null?Oe:q(D.type)||"Memo";case g:{var $e=D,Be=$e._payload,Re=$e._init;try{return q(Re(Be))}catch{return null}}}return null}var J=Object.assign,$=0,X,W,ne,le,A,H,re;function R(){}R.__reactDisabledLog=!0;function ue(){{if($===0){X=console.log,W=console.info,ne=console.warn,le=console.error,A=console.group,H=console.groupCollapsed,re=console.groupEnd;var D={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}$++}}function xe(){{if($--,$===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:J({},D,{value:X}),info:J({},D,{value:W}),warn:J({},D,{value:ne}),error:J({},D,{value:le}),group:J({},D,{value:A}),groupCollapsed:J({},D,{value:H}),groupEnd:J({},D,{value:re})})}$<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=w.ReactCurrentDispatcher,pe;function ee(D,G,oe){{if(pe===void 0)try{throw Error()}catch($e){var Oe=$e.stack.trim().match(/\n( *(at )?)/);pe=Oe&&Oe[1]||""}return`
10
- `+pe+D}}var Q=!1,ie;{var we=typeof WeakMap=="function"?WeakMap:Map;ie=new we}function te(D,G){if(!D||Q)return"";{var oe=ie.get(D);if(oe!==void 0)return oe}var Oe;Q=!0;var $e=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Be;Be=ge.current,ge.current=null,ue();try{if(G){var Re=function(){throw Error()};if(Object.defineProperty(Re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Re,[])}catch(on){Oe=on}Reflect.construct(D,[],Re)}else{try{Re.call()}catch(on){Oe=on}D.call(Re.prototype)}}else{try{throw Error()}catch(on){Oe=on}D()}}catch(on){if(on&&Oe&&typeof on.stack=="string"){for(var Te=on.stack.split(`
9
+ */var uw;function EN(){return uw||(uw=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"),i=Symbol.for("react.strict_mode"),o=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"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function x(D){if(D===null||typeof D!="object")return null;var G=v&&D[v]||D[b];return typeof G=="function"?G:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(D){{for(var G=arguments.length,oe=new Array(G>1?G-1:0),Oe=1;Oe<G;Oe++)oe[Oe-1]=arguments[Oe];C("error",D,oe)}}function C(D,G,oe){{var Oe=w.ReactDebugCurrentFrame,$e=Oe.getStackAddendum();$e!==""&&(G+="%s",oe=oe.concat([$e]));var Be=oe.map(function(Re){return String(Re)});Be.unshift("Warning: "+G),Function.prototype.apply.call(console[D],console,Be)}}var P=!1,O=!1,k=!1,T=!1,I=!1,F;F=Symbol.for("react.module.reference");function j(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===o||I||D===i||D===c||D===d||T||D===p||P||O||k||typeof D=="object"&&D!==null&&(D.$$typeof===g||D.$$typeof===f||D.$$typeof===s||D.$$typeof===a||D.$$typeof===l||D.$$typeof===F||D.getModuleId!==void 0))}function B(D,G,oe){var Oe=D.displayName;if(Oe)return Oe;var $e=G.displayName||G.name||"";return $e!==""?oe+"("+$e+")":oe}function V(D){return D.displayName||"Context"}function q(D){if(D==null)return null;if(typeof D.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if(typeof D=="object")switch(D.$$typeof){case a:var G=D;return V(G)+".Consumer";case s:var oe=D;return V(oe._context)+".Provider";case l:return B(D,D.render,"ForwardRef");case f:var Oe=D.displayName||null;return Oe!==null?Oe:q(D.type)||"Memo";case g:{var $e=D,Be=$e._payload,Re=$e._init;try{return q(Re(Be))}catch{return null}}}return null}var J=Object.assign,$=0,X,W,te,le,A,H,ne;function R(){}R.__reactDisabledLog=!0;function ue(){{if($===0){X=console.log,W=console.info,te=console.warn,le=console.error,A=console.group,H=console.groupCollapsed,ne=console.groupEnd;var D={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}$++}}function xe(){{if($--,$===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:J({},D,{value:X}),info:J({},D,{value:W}),warn:J({},D,{value:te}),error:J({},D,{value:le}),group:J({},D,{value:A}),groupCollapsed:J({},D,{value:H}),groupEnd:J({},D,{value:ne})})}$<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=w.ReactCurrentDispatcher,pe;function ee(D,G,oe){{if(pe===void 0)try{throw Error()}catch($e){var Oe=$e.stack.trim().match(/\n( *(at )?)/);pe=Oe&&Oe[1]||""}return`
10
+ `+pe+D}}var Q=!1,ie;{var we=typeof WeakMap=="function"?WeakMap:Map;ie=new we}function re(D,G){if(!D||Q)return"";{var oe=ie.get(D);if(oe!==void 0)return oe}var Oe;Q=!0;var $e=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Be;Be=ge.current,ge.current=null,ue();try{if(G){var Re=function(){throw Error()};if(Object.defineProperty(Re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Re,[])}catch(on){Oe=on}Reflect.construct(D,[],Re)}else{try{Re.call()}catch(on){Oe=on}D.call(Re.prototype)}}else{try{throw Error()}catch(on){Oe=on}D()}}catch(on){if(on&&Oe&&typeof on.stack=="string"){for(var Te=on.stack.split(`
11
11
  `),Pt=Oe.stack.split(`
12
12
  `),et=Te.length-1,ot=Pt.length-1;et>=1&&ot>=0&&Te[et]!==Pt[ot];)ot--;for(;et>=1&&ot>=0;et--,ot--)if(Te[et]!==Pt[ot]){if(et!==1||ot!==1)do if(et--,ot--,ot<0||Te[et]!==Pt[ot]){var Vt=`
13
- `+Te[et].replace(" at new "," at ");return D.displayName&&Vt.includes("<anonymous>")&&(Vt=Vt.replace("<anonymous>",D.displayName)),typeof D=="function"&&ie.set(D,Vt),Vt}while(et>=1&&ot>=0);break}}}finally{Q=!1,ge.current=Be,xe(),Error.prepareStackTrace=$e}var Tn=D?D.displayName||D.name:"",Xa=Tn?ee(Tn):"";return typeof D=="function"&&ie.set(D,Xa),Xa}function Ie(D,G,oe){return te(D,!1)}function ae(D){var G=D.prototype;return!!(G&&G.isReactComponent)}function Se(D,G,oe){if(D==null)return"";if(typeof D=="function")return te(D,ae(D));if(typeof D=="string")return ee(D);switch(D){case c:return ee("Suspense");case d:return ee("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case l:return Ie(D.render);case f:return Se(D.type,G,oe);case g:{var Oe=D,$e=Oe._payload,Be=Oe._init;try{return Se(Be($e),G,oe)}catch{}}}return""}var We=Object.prototype.hasOwnProperty,dt={},qe=w.ReactDebugCurrentFrame;function gt(D){if(D){var G=D._owner,oe=Se(D.type,D._source,G?G.type:null);qe.setExtraStackFrame(oe)}else qe.setExtraStackFrame(null)}function Gt(D,G,oe,Oe,$e){{var Be=Function.call.bind(We);for(var Re in D)if(Be(D,Re)){var Te=void 0;try{if(typeof D[Re]!="function"){var Pt=Error((Oe||"React class")+": "+oe+" type `"+Re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[Re]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pt.name="Invariant Violation",Pt}Te=D[Re](G,Re,Oe,oe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(et){Te=et}Te&&!(Te instanceof Error)&&(gt($e),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Oe||"React class",oe,Re,typeof Te),gt(null)),Te instanceof Error&&!(Te.message in dt)&&(dt[Te.message]=!0,gt($e),S("Failed %s type: %s",oe,Te.message),gt(null))}}}var Bt=Array.isArray;function gn(D){return Bt(D)}function Rt(D){{var G=typeof Symbol=="function"&&Symbol.toStringTag,oe=G&&D[Symbol.toStringTag]||D.constructor.name||"Object";return oe}}function mr(D){try{return he(D),!1}catch{return!0}}function he(D){return""+D}function Ee(D){if(mr(D))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Rt(D)),he(D)}var Ne=w.ReactCurrentOwner,Ue={key:!0,ref:!0,__self:!0,__source:!0},at,ln,cn;cn={};function $n(D){if(We.call(D,"ref")){var G=Object.getOwnPropertyDescriptor(D,"ref").get;if(G&&G.isReactWarning)return!1}return D.ref!==void 0}function Br(D){if(We.call(D,"key")){var G=Object.getOwnPropertyDescriptor(D,"key").get;if(G&&G.isReactWarning)return!1}return D.key!==void 0}function Vr(D,G){if(typeof D.ref=="string"&&Ne.current&&G&&Ne.current.stateNode!==G){var oe=q(Ne.current.type);cn[oe]||(S('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(Ne.current.type),D.ref),cn[oe]=!0)}}function mn(D,G){{var oe=function(){at||(at=!0,S("%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)",G))};oe.isReactWarning=!0,Object.defineProperty(D,"key",{get:oe,configurable:!0})}}function vr(D,G){{var oe=function(){ln||(ln=!0,S("%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)",G))};oe.isReactWarning=!0,Object.defineProperty(D,"ref",{get:oe,configurable:!0})}}var jn=function(D,G,oe,Oe,$e,Be,Re){var Te={$$typeof:t,type:D,key:G,ref:oe,props:Re,_owner:Be};return Te._store={},Object.defineProperty(Te._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Te,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.defineProperty(Te,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$e}),Object.freeze&&(Object.freeze(Te.props),Object.freeze(Te)),Te};function Ld(D,G,oe,Oe,$e){{var Be,Re={},Te=null,Pt=null;oe!==void 0&&(Ee(oe),Te=""+oe),Br(G)&&(Ee(G.key),Te=""+G.key),$n(G)&&(Pt=G.ref,Vr(G,$e));for(Be in G)We.call(G,Be)&&!Ue.hasOwnProperty(Be)&&(Re[Be]=G[Be]);if(D&&D.defaultProps){var et=D.defaultProps;for(Be in et)Re[Be]===void 0&&(Re[Be]=et[Be])}if(Te||Pt){var ot=typeof D=="function"?D.displayName||D.name||"Unknown":D;Te&&mn(Re,ot),Pt&&vr(Re,ot)}return jn(D,Te,Pt,$e,Oe,Ne.current,Re)}}var To=w.ReactCurrentOwner,Va=w.ReactDebugCurrentFrame;function Yn(D){if(D){var G=D._owner,oe=Se(D.type,D._source,G?G.type:null);Va.setExtraStackFrame(oe)}else Va.setExtraStackFrame(null)}var to;to=!1;function Ao(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Ha(){{if(To.current){var D=q(To.current.type);if(D)return`
13
+ `+Te[et].replace(" at new "," at ");return D.displayName&&Vt.includes("<anonymous>")&&(Vt=Vt.replace("<anonymous>",D.displayName)),typeof D=="function"&&ie.set(D,Vt),Vt}while(et>=1&&ot>=0);break}}}finally{Q=!1,ge.current=Be,xe(),Error.prepareStackTrace=$e}var Tn=D?D.displayName||D.name:"",Xa=Tn?ee(Tn):"";return typeof D=="function"&&ie.set(D,Xa),Xa}function Ie(D,G,oe){return re(D,!1)}function ae(D){var G=D.prototype;return!!(G&&G.isReactComponent)}function Se(D,G,oe){if(D==null)return"";if(typeof D=="function")return re(D,ae(D));if(typeof D=="string")return ee(D);switch(D){case c:return ee("Suspense");case d:return ee("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case l:return Ie(D.render);case f:return Se(D.type,G,oe);case g:{var Oe=D,$e=Oe._payload,Be=Oe._init;try{return Se(Be($e),G,oe)}catch{}}}return""}var We=Object.prototype.hasOwnProperty,dt={},qe=w.ReactDebugCurrentFrame;function gt(D){if(D){var G=D._owner,oe=Se(D.type,D._source,G?G.type:null);qe.setExtraStackFrame(oe)}else qe.setExtraStackFrame(null)}function Gt(D,G,oe,Oe,$e){{var Be=Function.call.bind(We);for(var Re in D)if(Be(D,Re)){var Te=void 0;try{if(typeof D[Re]!="function"){var Pt=Error((Oe||"React class")+": "+oe+" type `"+Re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[Re]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pt.name="Invariant Violation",Pt}Te=D[Re](G,Re,Oe,oe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(et){Te=et}Te&&!(Te instanceof Error)&&(gt($e),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Oe||"React class",oe,Re,typeof Te),gt(null)),Te instanceof Error&&!(Te.message in dt)&&(dt[Te.message]=!0,gt($e),S("Failed %s type: %s",oe,Te.message),gt(null))}}}var Bt=Array.isArray;function gn(D){return Bt(D)}function Rt(D){{var G=typeof Symbol=="function"&&Symbol.toStringTag,oe=G&&D[Symbol.toStringTag]||D.constructor.name||"Object";return oe}}function mr(D){try{return he(D),!1}catch{return!0}}function he(D){return""+D}function Ee(D){if(mr(D))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Rt(D)),he(D)}var Ne=w.ReactCurrentOwner,Ue={key:!0,ref:!0,__self:!0,__source:!0},at,ln,cn;cn={};function $n(D){if(We.call(D,"ref")){var G=Object.getOwnPropertyDescriptor(D,"ref").get;if(G&&G.isReactWarning)return!1}return D.ref!==void 0}function Br(D){if(We.call(D,"key")){var G=Object.getOwnPropertyDescriptor(D,"key").get;if(G&&G.isReactWarning)return!1}return D.key!==void 0}function Vr(D,G){if(typeof D.ref=="string"&&Ne.current&&G&&Ne.current.stateNode!==G){var oe=q(Ne.current.type);cn[oe]||(S('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(Ne.current.type),D.ref),cn[oe]=!0)}}function mn(D,G){{var oe=function(){at||(at=!0,S("%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)",G))};oe.isReactWarning=!0,Object.defineProperty(D,"key",{get:oe,configurable:!0})}}function vr(D,G){{var oe=function(){ln||(ln=!0,S("%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)",G))};oe.isReactWarning=!0,Object.defineProperty(D,"ref",{get:oe,configurable:!0})}}var jn=function(D,G,oe,Oe,$e,Be,Re){var Te={$$typeof:t,type:D,key:G,ref:oe,props:Re,_owner:Be};return Te._store={},Object.defineProperty(Te._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Te,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.defineProperty(Te,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$e}),Object.freeze&&(Object.freeze(Te.props),Object.freeze(Te)),Te};function Ld(D,G,oe,Oe,$e){{var Be,Re={},Te=null,Pt=null;oe!==void 0&&(Ee(oe),Te=""+oe),Br(G)&&(Ee(G.key),Te=""+G.key),$n(G)&&(Pt=G.ref,Vr(G,$e));for(Be in G)We.call(G,Be)&&!Ue.hasOwnProperty(Be)&&(Re[Be]=G[Be]);if(D&&D.defaultProps){var et=D.defaultProps;for(Be in et)Re[Be]===void 0&&(Re[Be]=et[Be])}if(Te||Pt){var ot=typeof D=="function"?D.displayName||D.name||"Unknown":D;Te&&mn(Re,ot),Pt&&vr(Re,ot)}return jn(D,Te,Pt,$e,Oe,Ne.current,Re)}}var To=w.ReactCurrentOwner,Va=w.ReactDebugCurrentFrame;function Yn(D){if(D){var G=D._owner,oe=Se(D.type,D._source,G?G.type:null);Va.setExtraStackFrame(oe)}else Va.setExtraStackFrame(null)}var to;to=!1;function Ao(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Ha(){{if(To.current){var D=q(To.current.type);if(D)return`
14
14
 
15
15
  Check the render method of \``+D+"`."}return""}}function Fd(D){{if(D!==void 0){var G=D.fileName.replace(/^.*[\\\/]/,""),oe=D.lineNumber;return`
16
16
 
@@ -24,7 +24,7 @@ Check the top-level render call using <`+oe+">.")}return G}}function Ua(D,G){{if
24
24
  *
25
25
  * This source code is licensed under the MIT license found in the
26
26
  * LICENSE file in the root directory of this source tree.
27
- */var dw;function ON(){if(dw)return $c;dw=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var d,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)r.call(l,d)&&!o.hasOwnProperty(d)&&(f[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)f[d]===void 0&&(f[d]=l[d]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return $c.Fragment=n,$c.jsx=s,$c.jsxs=s,$c}process.env.NODE_ENV==="production"?fm.exports=ON():fm.exports=EN();var _=fm.exports;function fw(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=fw(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function of(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=fw(e))&&(r&&(r+=" "),r+=t);return r}const PN=Object.freeze(Object.defineProperty({__proto__:null,clsx:of,default:of},Symbol.toStringTag,{value:"Module"})),hm="-";function kN(e){const t=MN(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function i(s){const a=s.split(hm);return a[0]===""&&a.length!==1&&a.shift(),hw(a,t)||DN(s)}function o(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function hw(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?hw(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(hm);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId}const pw=/^\[(.+)\]$/;function DN(e){if(pw.test(e)){const t=pw.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function MN(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return AN(Object.entries(e.classGroups),n).forEach(([o,s])=>{pm(s,r,o,t)}),r}function pm(e,t,n,r){e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:gw(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(TN(i)){pm(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{pm(s,gw(t,o),n,r)})})}function gw(e,t){let n=e;return t.split(hm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function TN(e){return e.isThemeGetter}function AN(e,t){return t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e}function IN(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function i(o,s){n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}}const mw="!";function NN(e){const t=e.separator,n=t.length===1,r=t[0],i=t.length;return function(s){const a=[];let l=0,c=0,d;for(let b=0;b<s.length;b++){let x=s[b];if(l===0){if(x===r&&(n||s.slice(b,b+i)===t)){a.push(s.slice(c,b)),c=b+i;continue}if(x==="/"){d=b;continue}}x==="["?l++:x==="]"&&l--}const f=a.length===0?s:s.substring(c),g=f.startsWith(mw),p=g?f.substring(1):f,v=d&&d>c?d-c:void 0;return{modifiers:a,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:v}}}function RN(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 LN(e){return{cache:IN(e.cacheSize),splitModifiers:NN(e),...kN(e)}}const FN=/\s+/;function $N(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=new Set;return e.trim().split(FN).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:d}=n(s);let f=r(d?c.substring(0,d):c),g=!!d;if(!f){if(!d)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};g=!1}const p=RN(a).join(":");return{isTailwindClass:!0,modifierId:l?p+mw:p,classGroupId:f,originalClassName:s,hasPostfixModifier:g}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,d=a+l;return o.has(d)?!1:(o.add(d),i(l,c).forEach(f=>o.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function jN(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vw(t))&&(r&&(r+=" "),r+=n);return r}function vw(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vw(e[r]))&&(n&&(n+=" "),n+=t);return n}function zN(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((d,f)=>f(d),e());return n=LN(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=$N(l,n);return i(l,d),d}return function(){return o(jN.apply(null,arguments))}}function Kt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const bw=/^\[(?:([a-z-]+):)?(.+)\]$/i,BN=/^\d+\/\d+$/,VN=new Set(["px","full","screen"]),HN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WN=/\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$/,UN=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function vi(e){return $s(e)||VN.has(e)||BN.test(e)}function Wo(e){return sl(e,"length",e3)}function $s(e){return!!e&&!Number.isNaN(Number(e))}function sf(e){return sl(e,"number",$s)}function jc(e){return!!e&&Number.isInteger(Number(e))}function GN(e){return e.endsWith("%")&&$s(e.slice(0,-1))}function ht(e){return bw.test(e)}function Uo(e){return HN.test(e)}const YN=new Set(["length","size","percentage"]);function KN(e){return sl(e,YN,yw)}function XN(e){return sl(e,"position",yw)}const QN=new Set(["image","url"]);function ZN(e){return sl(e,QN,n3)}function JN(e){return sl(e,"",t3)}function zc(){return!0}function sl(e,t,n){const r=bw.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function e3(e){return WN.test(e)}function yw(){return!1}function t3(e){return UN.test(e)}function n3(e){return qN.test(e)}function r3(){const e=Kt("colors"),t=Kt("spacing"),n=Kt("blur"),r=Kt("brightness"),i=Kt("borderColor"),o=Kt("borderRadius"),s=Kt("borderSpacing"),a=Kt("borderWidth"),l=Kt("contrast"),c=Kt("grayscale"),d=Kt("hueRotate"),f=Kt("invert"),g=Kt("gap"),p=Kt("gradientColorStops"),v=Kt("gradientColorStopPositions"),b=Kt("inset"),x=Kt("margin"),w=Kt("opacity"),S=Kt("padding"),C=Kt("saturate"),P=Kt("scale"),O=Kt("sepia"),k=Kt("skew"),T=Kt("space"),I=Kt("translate"),F=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",ht,t],V=()=>[ht,t],q=()=>["",vi,Wo],J=()=>["auto",$s,ht],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],ne=()=>["start","end","center","between","around","evenly","stretch"],le=()=>["","0",ht],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[$s,sf],re=()=>[$s,ht];return{cacheSize:500,separator:":",theme:{colors:[zc],spacing:[vi,Wo],blur:["none","",Uo,ht],brightness:H(),borderColor:[e],borderRadius:["none","","full",Uo,ht],borderSpacing:V(),borderWidth:q(),contrast:H(),grayscale:le(),hueRotate:re(),invert:le(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[GN,Wo],inset:B(),margin:B(),opacity:H(),padding:V(),saturate:H(),scale:H(),sepia:le(),skew:re(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",ht]}],container:["container"],columns:[{columns:[Uo]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:[...$(),ht]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],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",jc,ht]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ht]}],grow:[{grow:le()}],shrink:[{shrink:le()}],order:[{order:["first","last","none",jc,ht]}],"grid-cols":[{"grid-cols":[zc]}],"col-start-end":[{col:["auto",{span:["full",jc,ht]},ht]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[zc]}],"row-start-end":[{row:["auto",{span:[jc,ht]},ht]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ht]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ht]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],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":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",ht,t]}],"min-w":[{"min-w":["min","max","fit",ht,vi]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Uo]},Uo,ht]}],h:[{h:[ht,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",vi,ht]}],"max-h":[{"max-h":[ht,t,"min","max","fit"]}],"font-size":[{text:["base",Uo,Wo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sf]}],"font-family":[{font:[zc]}],"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",ht]}],"line-clamp":[{"line-clamp":["none",$s,sf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",vi,ht]}],"list-image":[{"list-image":["none",ht]}],"list-style-type":[{list:["none","disc","decimal",ht]}],"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:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",vi,Wo]}],"underline-offset":[{"underline-offset":["auto",vi,ht]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ht]}],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",ht]}],"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:[...$(),XN]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",KN]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ZN]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"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:[...X(),"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:X()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[vi,ht]}],"outline-w":[{outline:[vi,Wo]}],"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":[vi,Wo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Uo,JN]}],"shadow-color":[{shadow:[zc]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":W()}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Uo,ht]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[O]}],"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":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"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",ht]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",ht]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",ht]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[jc,ht]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ht]}],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",ht]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"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",ht]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[vi,Wo,sf]}],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 i3=zN(r3);class o3 extends Error{}o3.prototype.name="InvalidTokenError";function De(...e){return i3(of(e))}async function al(e,t,n={}){try{const r=new URLSearchParams(n).toString(),i=`${e}?${r}`,o=await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const a=await o.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${o.status}`)}return await o.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function ll(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(o=>{throw console.log(o.detail||"Unknown error occurred"),new Error((o==null?void 0:o.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function s3(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")}}var a3={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const xw=e=>{let t;const n=new Set,r=(l,c)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=c??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(g=>g(t,f))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(a3?"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,i,a),a},l3=e=>e?xw(e):xw;var gm={exports:{}},mm={},af={exports:{}},vm={};/**
27
+ */var dw;function ON(){if(dw)return $c;dw=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var d,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)r.call(l,d)&&!o.hasOwnProperty(d)&&(f[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)f[d]===void 0&&(f[d]=l[d]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return $c.Fragment=n,$c.jsx=s,$c.jsxs=s,$c}process.env.NODE_ENV==="production"?fm.exports=ON():fm.exports=EN();var _=fm.exports;function fw(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=fw(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function of(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=fw(e))&&(r&&(r+=" "),r+=t);return r}const PN=Object.freeze(Object.defineProperty({__proto__:null,clsx:of,default:of},Symbol.toStringTag,{value:"Module"})),hm="-";function kN(e){const t=MN(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function i(s){const a=s.split(hm);return a[0]===""&&a.length!==1&&a.shift(),hw(a,t)||DN(s)}function o(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function hw(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?hw(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(hm);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId}const pw=/^\[(.+)\]$/;function DN(e){if(pw.test(e)){const t=pw.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function MN(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return AN(Object.entries(e.classGroups),n).forEach(([o,s])=>{pm(s,r,o,t)}),r}function pm(e,t,n,r){e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:gw(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(TN(i)){pm(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{pm(s,gw(t,o),n,r)})})}function gw(e,t){let n=e;return t.split(hm).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function TN(e){return e.isThemeGetter}function AN(e,t){return t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e}function IN(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function i(o,s){n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}}const mw="!";function NN(e){const t=e.separator,n=t.length===1,r=t[0],i=t.length;return function(s){const a=[];let l=0,c=0,d;for(let b=0;b<s.length;b++){let x=s[b];if(l===0){if(x===r&&(n||s.slice(b,b+i)===t)){a.push(s.slice(c,b)),c=b+i;continue}if(x==="/"){d=b;continue}}x==="["?l++:x==="]"&&l--}const f=a.length===0?s:s.substring(c),g=f.startsWith(mw),p=g?f.substring(1):f,v=d&&d>c?d-c:void 0;return{modifiers:a,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:v}}}function RN(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 LN(e){return{cache:IN(e.cacheSize),splitModifiers:NN(e),...kN(e)}}const FN=/\s+/;function $N(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=new Set;return e.trim().split(FN).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:d}=n(s);let f=r(d?c.substring(0,d):c),g=!!d;if(!f){if(!d)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};g=!1}const p=RN(a).join(":");return{isTailwindClass:!0,modifierId:l?p+mw:p,classGroupId:f,originalClassName:s,hasPostfixModifier:g}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,d=a+l;return o.has(d)?!1:(o.add(d),i(l,c).forEach(f=>o.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function jN(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=vw(t))&&(r&&(r+=" "),r+=n);return r}function vw(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vw(e[r]))&&(n&&(n+=" "),n+=t);return n}function zN(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((d,f)=>f(d),e());return n=LN(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=$N(l,n);return i(l,d),d}return function(){return o(jN.apply(null,arguments))}}function Kt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const bw=/^\[(?:([a-z-]+):)?(.+)\]$/i,BN=/^\d+\/\d+$/,VN=new Set(["px","full","screen"]),HN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WN=/\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$/,UN=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function vi(e){return $s(e)||VN.has(e)||BN.test(e)}function Wo(e){return sl(e,"length",e3)}function $s(e){return!!e&&!Number.isNaN(Number(e))}function sf(e){return sl(e,"number",$s)}function jc(e){return!!e&&Number.isInteger(Number(e))}function GN(e){return e.endsWith("%")&&$s(e.slice(0,-1))}function ht(e){return bw.test(e)}function Uo(e){return HN.test(e)}const YN=new Set(["length","size","percentage"]);function KN(e){return sl(e,YN,yw)}function XN(e){return sl(e,"position",yw)}const QN=new Set(["image","url"]);function ZN(e){return sl(e,QN,n3)}function JN(e){return sl(e,"",t3)}function zc(){return!0}function sl(e,t,n){const r=bw.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function e3(e){return WN.test(e)}function yw(){return!1}function t3(e){return UN.test(e)}function n3(e){return qN.test(e)}function r3(){const e=Kt("colors"),t=Kt("spacing"),n=Kt("blur"),r=Kt("brightness"),i=Kt("borderColor"),o=Kt("borderRadius"),s=Kt("borderSpacing"),a=Kt("borderWidth"),l=Kt("contrast"),c=Kt("grayscale"),d=Kt("hueRotate"),f=Kt("invert"),g=Kt("gap"),p=Kt("gradientColorStops"),v=Kt("gradientColorStopPositions"),b=Kt("inset"),x=Kt("margin"),w=Kt("opacity"),S=Kt("padding"),C=Kt("saturate"),P=Kt("scale"),O=Kt("sepia"),k=Kt("skew"),T=Kt("space"),I=Kt("translate"),F=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",ht,t],V=()=>[ht,t],q=()=>["",vi,Wo],J=()=>["auto",$s,ht],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],te=()=>["start","end","center","between","around","evenly","stretch"],le=()=>["","0",ht],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[$s,sf],ne=()=>[$s,ht];return{cacheSize:500,separator:":",theme:{colors:[zc],spacing:[vi,Wo],blur:["none","",Uo,ht],brightness:H(),borderColor:[e],borderRadius:["none","","full",Uo,ht],borderSpacing:V(),borderWidth:q(),contrast:H(),grayscale:le(),hueRotate:ne(),invert:le(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[GN,Wo],inset:B(),margin:B(),opacity:H(),padding:V(),saturate:H(),scale:H(),sepia:le(),skew:ne(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",ht]}],container:["container"],columns:[{columns:[Uo]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:[...$(),ht]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],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",jc,ht]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ht]}],grow:[{grow:le()}],shrink:[{shrink:le()}],order:[{order:["first","last","none",jc,ht]}],"grid-cols":[{"grid-cols":[zc]}],"col-start-end":[{col:["auto",{span:["full",jc,ht]},ht]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[zc]}],"row-start-end":[{row:["auto",{span:[jc,ht]},ht]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ht]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ht]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...te()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...te(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...te(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],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":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",ht,t]}],"min-w":[{"min-w":["min","max","fit",ht,vi]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Uo]},Uo,ht]}],h:[{h:[ht,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",vi,ht]}],"max-h":[{"max-h":[ht,t,"min","max","fit"]}],"font-size":[{text:["base",Uo,Wo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sf]}],"font-family":[{font:[zc]}],"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",ht]}],"line-clamp":[{"line-clamp":["none",$s,sf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",vi,ht]}],"list-image":[{"list-image":["none",ht]}],"list-style-type":[{list:["none","disc","decimal",ht]}],"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:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",vi,Wo]}],"underline-offset":[{"underline-offset":["auto",vi,ht]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ht]}],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",ht]}],"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:[...$(),XN]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",KN]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ZN]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"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:[...X(),"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:X()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[vi,ht]}],"outline-w":[{outline:[vi,Wo]}],"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":[vi,Wo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Uo,JN]}],"shadow-color":[{shadow:[zc]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":W()}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Uo,ht]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[O]}],"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":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"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",ht]}],duration:[{duration:ne()}],ease:[{ease:["linear","in","out","in-out",ht]}],delay:[{delay:ne()}],animate:[{animate:["none","spin","ping","pulse","bounce",ht]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[jc,ht]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ht]}],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",ht]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"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",ht]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[vi,Wo,sf]}],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 i3=zN(r3);class o3 extends Error{}o3.prototype.name="InvalidTokenError";function De(...e){return i3(of(e))}async function al(e,t,n={}){try{const r=new URLSearchParams(n).toString(),i=`${e}?${r}`,o=await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const a=await o.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${o.status}`)}return await o.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function ll(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(o=>{throw console.log(o.detail||"Unknown error occurred"),new Error((o==null?void 0:o.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function s3(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")}}var a3={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const xw=e=>{let t;const n=new Set,r=(l,c)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=c??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(g=>g(t,f))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(a3?"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,i,a),a},l3=e=>e?xw(e):xw;var gm={exports:{}},mm={},af={exports:{}},vm={};/**
28
28
  * @license React
29
29
  * use-sync-external-store-shim.development.js
30
30
  *
@@ -56,16 +56,16 @@ Check the top-level render call using <`+oe+">.")}return G}}function Ua(D,G){{if
56
56
  *
57
57
  * This source code is licensed under the MIT license found in the
58
58
  * LICENSE file in the root directory of this source tree.
59
- */var Ow;function f3(){if(Ow)return ym;Ow=1;var e=m,t=Cw();function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return ym.useSyncExternalStoreWithSelector=function(c,d,f,g,p){var v=o(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=a(function(){function w(k){if(!S){if(S=!0,C=k,k=g(k),p!==void 0&&b.hasValue){var T=b.value;if(p(T,k))return P=T}return P=k}if(T=P,r(C,k))return T;var I=g(k);return p!==void 0&&p(T,I)?T:(C=k,P=I)}var S=!1,C,P,O=f===void 0?null:f;return[function(){return w(d())},O===null?void 0:function(){return w(O())}]},[d,f,g,p]);var x=i(c,v[0],v[1]);return s(function(){b.hasValue=!0,b.value=x},[x]),l(x),x},ym}process.env.NODE_ENV==="production"?gm.exports=f3():gm.exports=d3();var h3=gm.exports;const p3=Lc(h3);var Pw={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:g3}=m,{useSyncExternalStoreWithSelector:m3}=p3;let kw=!1;function v3(e,t=e.getState,n){(Pw?"production":void 0)!=="production"&&n&&!kw&&(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"),kw=!0);const r=m3(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return g3(r),r}const Dw=e=>{(Pw?"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"?l3(e):e,n=(r,i)=>v3(t,r,i);return Object.assign(n,t),n},Mw=e=>e?Dw(e):Dw;var Tw=Symbol.for("immer-nothing"),Aw=Symbol.for("immer-draftable"),_r=Symbol.for("immer-state"),b3=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 ir(e,...t){if(process.env.NODE_ENV!=="production"){const n=b3[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 cl=Object.getPrototypeOf;function ul(e){return!!e&&!!e[_r]}function js(e){var t;return e?Iw(e)||Array.isArray(e)||!!e[Aw]||!!((t=e.constructor)!=null&&t[Aw])||cf(e)||uf(e):!1}var y3=Object.prototype.constructor.toString();function Iw(e){if(!e||typeof e!="object")return!1;const t=cl(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)===y3}function Bc(e,t){lf(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function lf(e){const t=e[_r];return t?t.type_:Array.isArray(e)?1:cf(e)?2:uf(e)?3:0}function xm(e,t){return lf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nw(e,t,n){const r=lf(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function x3(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function cf(e){return e instanceof Map}function uf(e){return e instanceof Set}function zs(e){return e.copy_||e.base_}function wm(e,t){if(cf(e))return new Map(e);if(uf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Iw(e))return cl(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[_r];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const o=r[i],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(cl(e),n)}function _m(e,t=!1){return df(e)||ul(e)||!js(e)||(lf(e)>1&&(e.set=e.add=e.clear=e.delete=w3),Object.freeze(e),t&&Bc(e,(n,r)=>_m(r,!0))),e}function w3(){ir(2)}function df(e){return Object.isFrozen(e)}var _3={};function Bs(e){const t=_3[e];return t||ir(0,e),t}var Vc;function Rw(){return Vc}function S3(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Lw(e,t){t&&(Bs("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sm(e){Cm(e),e.drafts_.forEach(C3),e.drafts_=null}function Cm(e){e===Vc&&(Vc=e.parent_)}function Fw(e){return Vc=S3(Vc,e)}function C3(e){const t=e[_r];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function $w(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[_r].modified_&&(Sm(t),ir(4)),js(e)&&(e=ff(t,e),t.parent_||hf(t,e)),t.patches_&&Bs("Patches").generateReplacementPatches_(n[_r].base_,e,t.patches_,t.inversePatches_)):e=ff(t,n,[]),Sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Tw?e:void 0}function ff(e,t,n){if(df(t))return t;const r=t[_r];if(!r)return Bc(t,(i,o)=>jw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return hf(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),Bc(o,(a,l)=>jw(e,r,i,a,l,n,s)),hf(e,i,!1),n&&e.patches_&&Bs("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function jw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&ir(5),ul(i)){const a=o&&t&&t.type_!==3&&!xm(t.assigned_,r)?o.concat(r):void 0,l=ff(e,i,a);if(Nw(n,r,l),ul(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(js(i)&&!df(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ff(e,i),(!t||!t.scope_.parent_)&&hf(e,i)}}function hf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_m(t,n)}function E3(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Rw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=Em;n&&(i=[r],o=Hc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var Em={get(e,t){if(t===_r)return e;const n=zs(e);if(!xm(n,t))return O3(e,n,t);const r=n[t];return e.finalized_||!js(r)?r:r===Om(e.base_,t)?(km(e),e.copy_[t]=Dm(r,e)):r},has(e,t){return t in zs(e)},ownKeys(e){return Reflect.ownKeys(zs(e))},set(e,t,n){const r=zw(zs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Om(zs(e),t),o=i==null?void 0:i[_r];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(x3(n,i)&&(n!==void 0||xm(e.base_,t)))return!0;km(e),Pm(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 Om(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,km(e),Pm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=zs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ir(11)},getPrototypeOf(e){return cl(e.base_)},setPrototypeOf(){ir(12)}},Hc={};Bc(Em,(e,t)=>{Hc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Hc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ir(13),Hc.set.call(this,e,t,void 0)},Hc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ir(14),Em.set.call(this,e[0],t,n,e[0])};function Om(e,t){const n=e[_r];return(n?zs(n):e)[t]}function O3(e,t,n){var i;const r=zw(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function zw(e,t){if(!(t in e))return;let n=cl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=cl(n)}}function Pm(e){e.modified_||(e.modified_=!0,e.parent_&&Pm(e.parent_))}function km(e){e.copy_||(e.copy_=wm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var P3=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,d=>n.call(this,d,...c))}}typeof n!="function"&&ir(6),r!==void 0&&typeof r!="function"&&ir(7);let i;if(js(t)){const o=Fw(this),s=Dm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?Sm(o):Cm(o)}return Lw(o,r),$w(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Tw&&(i=void 0),this.autoFreeze_&&_m(i,!0),r){const o=[],s=[];Bs("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else ir(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},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){js(e)||ir(8),ul(e)&&(e=k3(e));const t=Fw(this),n=Dm(e,void 0);return n[_r].isManual_=!0,Cm(t),n}finishDraft(e,t){const n=e&&e[_r];(!n||!n.isManual_)&&ir(9);const{scope_:r}=n;return Lw(r,t),$w(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 i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Bs("Patches").applyPatches_;return ul(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Dm(e,t){const n=cf(e)?Bs("MapSet").proxyMap_(e,t):uf(e)?Bs("MapSet").proxySet_(e,t):E3(e,t);return(t?t.scope_:Rw()).drafts_.push(n),n}function k3(e){return ul(e)||ir(10,e),Bw(e)}function Bw(e){if(!js(e)||df(e))return e;const t=e[_r];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=wm(e,t.scope_.immer_.useStrictShallowCopy_)}else n=wm(e,!0);return Bc(n,(r,i)=>{Nw(n,r,Bw(i))}),t&&(t.finalized_=!1),n}var Sr=new P3,D3=Sr.produce;Sr.produceWithPatches.bind(Sr),Sr.setAutoFreeze.bind(Sr),Sr.setUseStrictShallowCopy.bind(Sr),Sr.applyPatches.bind(Sr),Sr.createDraft.bind(Sr),Sr.finishDraft.bind(Sr);const Vw=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?D3(i):i;return t(a,o,...s)},e(r.setState,n,r));var pf,gf=kt;if(process.env.NODE_ENV==="production")pf=gf.createRoot,gf.hydrateRoot;else{var Hw=gf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;pf=function(e,t){Hw.usingClientEntryPoint=!0;try{return gf.createRoot(e,t)}finally{Hw.usingClientEntryPoint=!1}}}function Ww(e,t,n){const r={count:0},i=a=>{const l=m.useRef(r.count);return m.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(i.displayName=`((${e})) devtool`,typeof document>"u")return;if(!n){let a=document.getElementById(`simple-zustand-devtools-${e}`);a||(a=document.createElement("div"),a.id=`simple-zustand-devtools-${e}`),document.body.appendChild(a),n=a}const o=pf(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var Uw={},qw={},Mm={exports:{}},Xt=String,Gw=function(){return{isColorSupported:!1,reset:Xt,bold:Xt,dim:Xt,italic:Xt,underline:Xt,inverse:Xt,hidden:Xt,strikethrough:Xt,black:Xt,red:Xt,green:Xt,yellow:Xt,blue:Xt,magenta:Xt,cyan:Xt,white:Xt,gray:Xt,bgBlack:Xt,bgRed:Xt,bgGreen:Xt,bgYellow:Xt,bgBlue:Xt,bgMagenta:Xt,bgCyan:Xt,bgWhite:Xt}};Mm.exports=Gw(),Mm.exports.createColors=Gw;var M3=Mm.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var d in c)Object.defineProperty(l,d,{enumerable:!0,get:c[d]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(M3);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,d){typeof process<"u"&&process.env.JEST_WORKER_ID||d&&i.has(d)||(d&&i.add(d),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){o(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){o(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){o(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(qw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(qw);function n(o){return o&&o.__esModule?o:{default:o}}function r({version:o,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${o}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={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}}}(Uw);let Tm=Uw;var T3=(Tm.__esModule?Tm:{default:Tm}).default;const rn=Lc(T3),Am={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[rn.blue[500],rn.teal[500],rn.amber[500],rn.red[500],rn.indigo[500],rn.green[500]],borderColor:[rn.blue[500],rn.teal[500],rn.amber[500],rn.red[500],rn.indigo[500],rn.green[500]]},options:{plugins:{datalabels:{display:!1,color:A3},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[rn.teal[100],rn.purple[100],rn.amber[100],rn.orange[100],rn.rose[100]],borderColor:[rn.teal[400],rn.purple[400],rn.amber[400],rn.orange[300],rn.rose[400]]},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:rn.slate[800]}},y:{grid:{display:!0,color:rn.slate[800]}}}}}}};function A3(e){var r,i,o,s,a,l;const t=(a=(s=(o=(i=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:i._config)==null?void 0:o.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=Yw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Yw()),I3(n)}function Yw(){return fe.getState().theme==="dark"?"#000000":"#FFFFFF"}function I3(e){let t=0,n=0,r=0,i=0;const o=d=>{const f=d.replace("#",""),g=parseInt(f.substring(0,2),16),p=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=g,n+=p,r+=v,i++};Array.isArray(e)?e.forEach(d=>{o(d)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}var Wc=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(){}},dl=typeof window>"u"||"Deno"in window;function Kr(){}function N3(e,t){return typeof e=="function"?e(t):e}function Im(e){return typeof e=="number"&&e>=0&&e!==1/0}function Kw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xw(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Nm(s,t.options))return!1}else if(!qc(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 i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Qw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Uc(t.options.mutationKey)!==Uc(o))return!1}else if(!qc(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Nm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Uc)(e)}function Uc(e){return JSON.stringify(e,(t,n)=>Lm(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function qc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!qc(e[n],t[n])):!1}function Zw(e,t){if(e===t)return e;const n=Jw(e)&&Jw(t);if(n||Lm(e)&&Lm(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const d=n?c:o[c];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(a[d]=void 0,l++):(a[d]=Zw(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function Rm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Jw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lm(e){if(!e_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!e_(n)||!n.hasOwnProperty("isPrototypeOf"))}function e_(e){return Object.prototype.toString.call(e)==="[object Object]"}function R3(e){return new Promise(t=>{setTimeout(t,e)})}function Fm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Zw(e,t):t}function L3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function F3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var $3=(H5=class extends Wc{constructor(){super();Ve(this,Na,void 0);Ve(this,xs,void 0);Ve(this,sc,void 0);Le(this,sc,t=>{if(!dl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){K(this,xs)||this.setEventListener(K(this,sc))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,xs))==null||t.call(this),Le(this,xs,void 0))}setEventListener(t){var n;Le(this,sc,t),(n=K(this,xs))==null||n.call(this),Le(this,xs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){K(this,Na)!==t&&(Le(this,Na,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof K(this,Na)=="boolean"?K(this,Na):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Na=new WeakMap,xs=new WeakMap,sc=new WeakMap,H5),mf=new $3,j3=(W5=class extends Wc{constructor(){super();Ve(this,ac,!0);Ve(this,ws,void 0);Ve(this,lc,void 0);Le(this,lc,t=>{if(!dl&&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(){K(this,ws)||this.setEventListener(K(this,lc))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,ws))==null||t.call(this),Le(this,ws,void 0))}setEventListener(t){var n;Le(this,lc,t),(n=K(this,ws))==null||n.call(this),Le(this,ws,t(this.setOnline.bind(this)))}setOnline(t){K(this,ac)!==t&&(Le(this,ac,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return K(this,ac)}},ac=new WeakMap,ws=new WeakMap,lc=new WeakMap,W5),vf=new j3;function z3(e){return Math.min(1e3*2**e,3e4)}function bf(e){return(e??"online")==="online"?vf.isOnline():!0}var t_=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $m(e){return e instanceof t_}function n_(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((x,w)=>{o=x,s=w}),l=x=>{var w;r||(p(new t_(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},d=()=>{t=!1},f=()=>!mf.isFocused()||e.networkMode!=="always"&&!vf.isOnline(),g=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),i==null||i(),o(x))},p=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),i==null||i(),s(x))},v=()=>new Promise(x=>{var w;i=S=>{const C=r||!f();return C&&x(S),C},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;i=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(g).catch(w=>{var k;if(r)return;const S=e.retry??(dl?0:3),C=e.retryDelay??z3,P=typeof C=="function"?C(n,w):C,O=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,w);if(t||!O){p(w);return}n++,(k=e.onFail)==null||k.call(e,n,w),R3(P).then(()=>{if(f())return v()}).then(()=>{t?p(w):b()})})};return bf(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:d}}function B3(){let e=[],t=0,n=g=>{g()},r=g=>{g()},i=g=>setTimeout(g,0);const o=g=>{i=g},s=g=>{let p;t++;try{p=g()}finally{t--,t||c()}return p},a=g=>{t?e.push(g):i(()=>{n(g)})},l=g=>(...p)=>{a(()=>{g(...p)})},c=()=>{const g=e;e=[],g.length&&i(()=>{r(()=>{g.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var In=B3(),r_=(U5=class{constructor(){Ve(this,Ra,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Im(this.gcTime)&&Le(this,Ra,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(dl?1/0:5*60*1e3))}clearGcTimeout(){K(this,Ra)&&(clearTimeout(K(this,Ra)),Le(this,Ra,void 0))}},Ra=new WeakMap,U5),V3=(q5=class extends r_{constructor(t){super();Ve(this,dc);Ve(this,Pi);Ve(this,cc,void 0);Ve(this,uc,void 0);Ve(this,si,void 0);Ve(this,_s,void 0);Ve(this,ai,void 0);Ve(this,Mn,void 0);Ve(this,Cd,void 0);Ve(this,La,void 0);Le(this,La,!1),Le(this,Cd,t.defaultOptions),wt(this,dc,um).call(this,t.options),Le(this,Mn,[]),Le(this,si,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Le(this,cc,t.state||H3(this.options)),this.state=K(this,cc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!K(this,Mn).length&&this.state.fetchStatus==="idle"&&K(this,si).remove(this)}setData(t,n){const r=Fm(this.state.data,t,this.options);return wt(this,Pi,Vo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){wt(this,Pi,Vo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=K(this,_s);return(r=K(this,ai))==null||r.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(K(this,cc))}isActive(){return K(this,Mn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||K(this,Mn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Kw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=K(this,Mn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,ai))==null||n.continue()}onOnline(){var n;const t=K(this,Mn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,ai))==null||n.continue()}addObserver(t){K(this,Mn).includes(t)||(K(this,Mn).push(t),this.clearGcTimeout(),K(this,si).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){K(this,Mn).includes(t)&&(Le(this,Mn,K(this,Mn).filter(n=>n!==t)),K(this,Mn).length||(K(this,ai)&&(K(this,La)?K(this,ai).cancel({revert:!0}):K(this,ai).cancelRetry()),this.scheduleGc()),K(this,si).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return K(this,Mn).length}invalidate(){this.state.isInvalidated||wt(this,Pi,Vo).call(this,{type:"invalidate"})}fetch(t,n){var c,d,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(K(this,_s))return(c=K(this,ai))==null||c.continueRetry(),K(this,_s)}if(t&&wt(this,dc,um).call(this,t),!this.options.queryFn){const p=K(this,Mn).find(v=>v.options.queryFn);p&&wt(this,dc,um).call(this,p.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,i={queryKey:this.queryKey,meta:this.meta},o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Le(this,La,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Le(this,La,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(a),(d=this.options.behavior)==null||d.onFetch(a,this),Le(this,uc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&wt(this,Pi,Vo).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,b,x,w;$m(p)&&p.silent||wt(this,Pi,Vo).call(this,{type:"error",error:p}),$m(p)||((b=(v=K(this,si).config).onError)==null||b.call(v,p,this),(w=(x=K(this,si).config).onSettled)==null||w.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Le(this,ai,n_({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,b,x,w;if(typeof p>"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(p),(b=(v=K(this,si).config).onSuccess)==null||b.call(v,p,this),(w=(x=K(this,si).config).onSettled)==null||w.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{wt(this,Pi,Vo).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{wt(this,Pi,Vo).call(this,{type:"pause"})},onContinue:()=>{wt(this,Pi,Vo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Le(this,_s,K(this,ai).promise),K(this,_s)}},cc=new WeakMap,uc=new WeakMap,si=new WeakMap,_s=new WeakMap,ai=new WeakMap,Mn=new WeakMap,Cd=new WeakMap,La=new WeakMap,dc=new WeakSet,um=function(t){this.options={...K(this,Cd),...t},this.updateGcTime(this.options.gcTime)},Pi=new WeakSet,Vo=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:bf(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 i=t.error;return $m(i)&&i.revert&&K(this,uc)?{...K(this,uc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),In.batch(()=>{K(this,Mn).forEach(r=>{r.onQueryUpdate()}),K(this,si).notify({query:this,type:"updated",action:t})})},q5);function H3(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 W3=(G5=class extends Wc{constructor(t={}){super();Ve(this,Qi,void 0);this.config=t,Le(this,Qi,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??Nm(i,n);let s=this.get(o);return s||(s=new V3({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){K(this,Qi).has(t.queryHash)||(K(this,Qi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=K(this,Qi).get(t.queryHash);n&&(t.destroy(),n===t&&K(this,Qi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){In.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return K(this,Qi).get(t)}getAll(){return[...K(this,Qi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Xw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Xw(t,r)):n}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){In.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){In.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qi=new WeakMap,G5),U3=(Y5=class extends r_{constructor(t){super();Ve(this,Ji);Ve(this,Zi,void 0);Ve(this,Ed,void 0);Ve(this,zr,void 0);Ve(this,fc,void 0);this.mutationId=t.mutationId,Le(this,Ed,t.defaultOptions),Le(this,zr,t.mutationCache),Le(this,Zi,[]),this.state=t.state||q3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...K(this,Ed),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){K(this,Zi).includes(t)||(K(this,Zi).push(t),this.clearGcTimeout(),K(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Le(this,Zi,K(this,Zi).filter(n=>n!==t)),this.scheduleGc(),K(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){K(this,Zi).length||(this.state.status==="pending"?this.scheduleGc():K(this,zr).remove(this))}continue(){var t;return((t=K(this,fc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,d,f,g,p,v,b,x,w,S,C,P,O,k,T;const n=()=>(Le(this,fc,n_({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,F)=>{wt(this,Ji,Ls).call(this,{type:"failed",failureCount:I,error:F})},onPause:()=>{wt(this,Ji,Ls).call(this,{type:"pause"})},onContinue:()=>{wt(this,Ji,Ls).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),K(this,fc).promise),r=this.state.status==="pending";try{if(!r){wt(this,Ji,Ls).call(this,{type:"pending",variables:t}),await((o=(i=K(this,zr).config).onMutate)==null?void 0:o.call(i,t,this));const F=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));F!==this.state.context&&wt(this,Ji,Ls).call(this,{type:"pending",context:F,variables:t})}const I=await n();return await((c=(l=K(this,zr).config).onSuccess)==null?void 0:c.call(l,I,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,I,t,this.state.context)),await((p=(g=K(this,zr).config).onSettled)==null?void 0:p.call(g,I,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,I,null,t,this.state.context)),wt(this,Ji,Ls).call(this,{type:"success",data:I}),I}catch(I){try{throw await((w=(x=K(this,zr).config).onError)==null?void 0:w.call(x,I,t,this.state.context,this)),await((C=(S=this.options).onError)==null?void 0:C.call(S,I,t,this.state.context)),await((O=(P=K(this,zr).config).onSettled)==null?void 0:O.call(P,void 0,I,this.state.variables,this.state.context,this)),await((T=(k=this.options).onSettled)==null?void 0:T.call(k,void 0,I,t,this.state.context)),I}finally{wt(this,Ji,Ls).call(this,{type:"error",error:I})}}}},Zi=new WeakMap,Ed=new WeakMap,zr=new WeakMap,fc=new WeakMap,Ji=new WeakSet,Ls=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:!bf(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),In.batch(()=>{K(this,Zi).forEach(r=>{r.onMutationUpdate(t)}),K(this,zr).notify({mutation:this,type:"updated",action:t})})},Y5);function q3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var G3=(K5=class extends Wc{constructor(t={}){super();Ve(this,li,void 0);Ve(this,Od,void 0);Ve(this,Fa,void 0);this.config=t,Le(this,li,[]),Le(this,Od,0)}build(t,n,r){const i=new U3({mutationCache:this,mutationId:++cm(this,Od)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){K(this,li).push(t),this.notify({type:"added",mutation:t})}remove(t){Le(this,li,K(this,li).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){In.batch(()=>{K(this,li).forEach(t=>{this.remove(t)})})}getAll(){return K(this,li)}find(t){const n={exact:!0,...t};return K(this,li).find(r=>Qw(n,r))}findAll(t={}){return K(this,li).filter(n=>Qw(t,n))}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Le(this,Fa,(K(this,Fa)??Promise.resolve()).then(()=>{const t=K(this,li).filter(n=>n.state.isPaused);return In.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Kr)),Promise.resolve()))}).then(()=>{Le(this,Fa,void 0)})),K(this,Fa)}},li=new WeakMap,Od=new WeakMap,Fa=new WeakMap,K5);function Y3(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,x,w,S;const i=t.options,o=(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=((S=t.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const d=C=>{Object.defineProperty(C,"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}'`))),g=async(C,P,O)=>{if(c)return Promise.reject();if(P==null&&C.pages.length)return Promise.resolve(C);const k={queryKey:t.queryKey,pageParam:P,direction:O?"backward":"forward",meta:t.options.meta};d(k);const T=await f(k),{maxPages:I}=t.options,F=O?F3:L3;return{pages:F(C.pages,T,I),pageParams:F(C.pageParams,P,I)}};let p;if(o&&s.length){const C=o==="backward",P=C?K3:i_,O={pages:s,pageParams:a},k=P(i,O);p=await g(O,k,C)}else{p=await g(l,a[0]??i.initialPageParam);const C=e??s.length;for(let P=1;P<C;P++){const O=i_(i,p);p=await g(p,O)}}return p};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function i_(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function K3(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var o_=(X5=class{constructor(e={}){Ve(this,En,void 0);Ve(this,Ss,void 0);Ve(this,Cs,void 0);Ve(this,hc,void 0);Ve(this,pc,void 0);Ve(this,Es,void 0);Ve(this,gc,void 0);Ve(this,mc,void 0);Le(this,En,e.queryCache||new W3),Le(this,Ss,e.mutationCache||new G3),Le(this,Cs,e.defaultOptions||{}),Le(this,hc,new Map),Le(this,pc,new Map),Le(this,Es,0)}mount(){cm(this,Es)._++,K(this,Es)===1&&(Le(this,gc,mf.subscribe(()=>{mf.isFocused()&&(this.resumePausedMutations(),K(this,En).onFocus())})),Le(this,mc,vf.subscribe(()=>{vf.isOnline()&&(this.resumePausedMutations(),K(this,En).onOnline())})))}unmount(){var e,t;cm(this,Es)._--,K(this,Es)===0&&((e=K(this,gc))==null||e.call(this),Le(this,gc,void 0),(t=K(this,mc))==null||t.call(this),Le(this,mc,void 0))}isFetching(e){return K(this,En).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return K(this,Ss).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=K(this,En).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=K(this,En).find({queryKey:e}),i=r==null?void 0:r.state.data,o=N3(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return K(this,En).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return In.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=K(this,En).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=K(this,En);In.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=K(this,En),r={type:"active",...e};return In.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=In.batch(()=>K(this,En).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e={},t={}){return In.batch(()=>{if(K(this,En).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=In.batch(()=>K(this,En).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=K(this,En).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e.behavior=Y3(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}resumePausedMutations(){return K(this,Ss).resumePausedMutations()}getQueryCache(){return K(this,En)}getMutationCache(){return K(this,Ss)}getDefaultOptions(){return K(this,Cs)}setDefaultOptions(e){Le(this,Cs,e)}setQueryDefaults(e,t){K(this,hc).set(Uc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...K(this,hc).values()];let n={};return t.forEach(r=>{qc(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){K(this,pc).set(Uc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...K(this,pc).values()];let n={};return t.forEach(r=>{qc(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...K(this,Cs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Nm(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:{...K(this,Cs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){K(this,En).clear(),K(this,Ss).clear()}},En=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,hc=new WeakMap,pc=new WeakMap,Es=new WeakMap,gc=new WeakMap,mc=new WeakMap,X5),X3=(Q5=class extends Wc{constructor(t,n){super();Ve(this,Ba);Ve(this,Dd);Ve(this,Md);Ve(this,Td);Ve(this,Ad);Ve(this,Id);Ve(this,Nd);Ve(this,Rd);Ve(this,wg);Ve(this,gr,void 0);Ve(this,tn,void 0);Ve(this,Pd,void 0);Ve(this,er,void 0);Ve(this,$a,void 0);Ve(this,vc,void 0);Ve(this,eo,void 0);Ve(this,kd,void 0);Ve(this,bc,void 0);Ve(this,yc,void 0);Ve(this,ja,void 0);Ve(this,za,void 0);Ve(this,Os,void 0);Ve(this,xc,new Set);this.options=n,Le(this,gr,t),Le(this,eo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(K(this,tn).addObserver(this),s_(K(this,tn),this.options)?wt(this,Ba,rf).call(this):this.updateResult(),wt(this,Ad,sw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jm(K(this,tn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jm(K(this,tn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,wt(this,Id,aw).call(this),wt(this,Nd,lw).call(this),K(this,tn).removeObserver(this)}setOptions(t,n){const r=this.options,i=K(this,tn);if(this.options=K(this,gr).defaultQueryOptions(t),Rm(r,this.options)||K(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:K(this,tn),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),wt(this,Rd,cw).call(this);const o=this.hasListeners();o&&a_(K(this,tn),i,this.options,r)&&wt(this,Ba,rf).call(this),this.updateResult(n),o&&(K(this,tn)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&wt(this,Dd,rw).call(this);const s=wt(this,Md,iw).call(this);o&&(K(this,tn)!==i||this.options.enabled!==r.enabled||s!==K(this,Os))&&wt(this,Td,ow).call(this,s)}getOptimisticResult(t){const n=K(this,gr).getQueryCache().build(K(this,gr),t),r=this.createResult(n,t);return Z3(this,r)&&(Le(this,er,r),Le(this,vc,this.options),Le(this,$a,K(this,tn).state)),r}getCurrentResult(){return K(this,er)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(K(this,xc).add(r),t[r])})}),n}getCurrentQuery(){return K(this,tn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=K(this,gr).defaultQueryOptions(t),r=K(this,gr).getQueryCache().build(K(this,gr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return wt(this,Ba,rf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),K(this,er)))}createResult(t,n){var k;const r=K(this,tn),i=this.options,o=K(this,er),s=K(this,$a),a=K(this,vc),c=t!==r?t.state:K(this,Pd),{state:d}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=d,b=!1,x;if(n._optimisticResults){const T=this.hasListeners(),I=!T&&s_(t,n),F=T&&a_(t,r,n,i);(I||F)&&(p=bf(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof d.data<"u")if(o&&d.data===(s==null?void 0:s.data)&&n.select===K(this,kd))x=K(this,bc);else try{Le(this,kd,n.select),x=n.select(d.data),x=Fm(o==null?void 0:o.data,x,n),Le(this,bc,x),Le(this,eo,null)}catch(T){Le(this,eo,T)}else x=d.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let T;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=o.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((k=K(this,yc))==null?void 0:k.state.data,K(this,yc)):n.placeholderData,n.select&&typeof T<"u")try{T=n.select(T),Le(this,eo,null)}catch(I){Le(this,eo,I)}typeof T<"u"&&(v="success",x=Fm(o==null?void 0:o.data,T,n),b=!0)}K(this,eo)&&(f=K(this,eo),x=K(this,bc),g=Date.now(),v="error");const w=p==="fetching",S=v==="pending",C=v==="error",P=S&&w;return{status:v,fetchStatus:p,isPending:S,isSuccess:v==="success",isError:C,isInitialLoading:P,isLoading:P,data:x,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:b,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:zm(t,n),refetch:this.refetch}}updateResult(t){const n=K(this,er),r=this.createResult(K(this,tn),this.options);if(Le(this,$a,K(this,tn).state),Le(this,vc,this.options),K(this,$a).data!==void 0&&Le(this,yc,K(this,tn)),Rm(r,n))return;Le(this,er,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!K(this,xc).size)return!0;const l=new Set(a??K(this,xc));return this.options.throwOnError&&l.add("error"),Object.keys(K(this,er)).some(c=>{const d=c;return K(this,er)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),wt(this,wg,SN).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&wt(this,Ad,sw).call(this)}},gr=new WeakMap,tn=new WeakMap,Pd=new WeakMap,er=new WeakMap,$a=new WeakMap,vc=new WeakMap,eo=new WeakMap,kd=new WeakMap,bc=new WeakMap,yc=new WeakMap,ja=new WeakMap,za=new WeakMap,Os=new WeakMap,xc=new WeakMap,Ba=new WeakSet,rf=function(t){wt(this,Rd,cw).call(this);let n=K(this,tn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},Dd=new WeakSet,rw=function(){if(wt(this,Id,aw).call(this),dl||K(this,er).isStale||!Im(this.options.staleTime))return;const n=Kw(K(this,er).dataUpdatedAt,this.options.staleTime)+1;Le(this,ja,setTimeout(()=>{K(this,er).isStale||this.updateResult()},n))},Md=new WeakSet,iw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(K(this,tn)):this.options.refetchInterval)??!1},Td=new WeakSet,ow=function(t){wt(this,Nd,lw).call(this),Le(this,Os,t),!(dl||this.options.enabled===!1||!Im(K(this,Os))||K(this,Os)===0)&&Le(this,za,setInterval(()=>{(this.options.refetchIntervalInBackground||mf.isFocused())&&wt(this,Ba,rf).call(this)},K(this,Os)))},Ad=new WeakSet,sw=function(){wt(this,Dd,rw).call(this),wt(this,Td,ow).call(this,wt(this,Md,iw).call(this))},Id=new WeakSet,aw=function(){K(this,ja)&&(clearTimeout(K(this,ja)),Le(this,ja,void 0))},Nd=new WeakSet,lw=function(){K(this,za)&&(clearInterval(K(this,za)),Le(this,za,void 0))},Rd=new WeakSet,cw=function(){const t=K(this,gr).getQueryCache().build(K(this,gr),this.options);if(t===K(this,tn))return;const n=K(this,tn);Le(this,tn,t),Le(this,Pd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},wg=new WeakSet,SN=function(t){In.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(K(this,er))}),K(this,gr).getQueryCache().notify({query:K(this,tn),type:"observerResultsUpdated"})})},Q5);function Q3(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function s_(e,t){return Q3(e,t)||e.state.dataUpdatedAt>0&&jm(e,t,t.refetchOnMount)}function jm(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zm(e,t)}return!1}function a_(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&zm(e,n)}function zm(e,t){return e.isStaleByTime(t.staleTime)}function Z3(e,t){return!Rm(e.getCurrentResult(),t)}var l_=de.createContext(void 0),J3=e=>{const t=de.useContext(l_);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},eR=({client:e,children:t})=>(de.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),de.createElement(l_.Provider,{value:e},t)),c_=de.createContext(!1),tR=()=>de.useContext(c_);c_.Provider;function nR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var rR=de.createContext(nR()),iR=()=>de.useContext(rR);function oR(e,t){return typeof e=="function"?e(...t):!!e}var sR=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},aR=e=>{de.useEffect(()=>{e.clearReset()},[e])},lR=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&oR(n,[e.error,r]),cR=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},uR=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,dR=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function fR(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=J3(n),i=tR(),o=iR(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",cR(s),sR(s,o),aR(o);const[a]=de.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(de.useSyncExternalStore(de.useCallback(c=>{const d=i?()=>{}:a.subscribe(In.batchCalls(c));return a.updateResult(),d},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),de.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),uR(s,l))throw dR(s,a,o);if(lR({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Xr(e,t){return fR(e,X3,t)}let yf;const hR=new Uint8Array(16);function pR(){if(!yf&&(yf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yf(hR)}const Nn=[];for(let e=0;e<256;++e)Nn.push((e+256).toString(16).slice(1));function gR(e,t=0){return Nn[e[t+0]]+Nn[e[t+1]]+Nn[e[t+2]]+Nn[e[t+3]]+"-"+Nn[e[t+4]]+Nn[e[t+5]]+"-"+Nn[e[t+6]]+Nn[e[t+7]]+"-"+Nn[e[t+8]]+Nn[e[t+9]]+"-"+Nn[e[t+10]]+Nn[e[t+11]]+Nn[e[t+12]]+Nn[e[t+13]]+Nn[e[t+14]]+Nn[e[t+15]]}const u_={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function qo(e,t,n){if(u_.randomUUID&&!t&&!e)return u_.randomUUID();e=e||{};const r=e.random||(e.rng||pR)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return gR(r)}const ve=Mw()(Vw((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:qo(),title:"Editor Card",description:"Desdcription",type:"bar",data:[]},frame:{id:qo(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,i,o)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:i,suffix:o,enabled:!0}}})},setCardPreferences:n=>{e(r=>{r.card.preferences=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})},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(i=>{i.sqlGen.measures=[...i.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,i;e(o=>{o.selectedConnectionId=n,o.card.connectionId=n}),(i=(r=t()).onConnectionChange)==null||i.call(r,n)},setSelectedDatabaseName:n=>{var r,i;e(o=>{o.selectedDatabaseName=n,o.card.lastSelectedDatabase=n}),(i=(r=t()).onDatabaseChange)==null||i.call(r,n)},setSelectedSchemaName:n=>{var r,i;e(o=>{o.selectedSchemaName=n,o.card.lastSelectedSchema=n}),(i=(r=t()).onSchemaChange)==null||i.call(r,n)},setSelectedTableName:n=>{var r,i;e(o=>{o.selectedTableName=n,o.card.lastSelectedTable=n}),(i=(r=t()).onTableChange)==null||i.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})}}}))),mR=()=>ve(e=>e.actions);process.env.NODE_ENV==="development"&&Ww("EditorStore",ve);function d_(e,t){let n=m.useMemo(()=>[],[]);const r=fe(Se=>Se.authToken)||e,i=ve(Se=>Se.selectedConnectionId),o=ve(Se=>Se.selectedDatabaseName),s=ve(Se=>Se.selectedSchemaName),a=ve(Se=>Se.selectedTableName),l=ve(Se=>Se.actions.setCurrentColumns),c=ve(Se=>Se.actions.setSelectedConnectionId),d=ve(Se=>Se.actions.setSelectedDatabaseName),f=ve(Se=>Se.actions.setSelectedSchemaName),g=ve(Se=>Se.actions.setSelectedTableName),p=ve(Se=>Se.actions.setCardSql),{data:v,isLoading:b,isError:x}=Xr({queryKey:[t||"connections"],queryFn:()=>al("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)}),w=v==null?void 0:v.connections.find(Se=>Se.id===i),S=(w==null?void 0:w.type)==="API",{data:C,isLoading:P,isFetching:O,isError:k,refetch:T}=Xr({queryKey:[i],queryFn:()=>al("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:i}),enabled:!!i&&(w==null?void 0:w.type)!=="API"}),{data:I,isLoading:F,isFetching:j,isError:B,refetch:V}=Xr({queryKey:[i,o],queryFn:()=>al("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o}),enabled:!!i&&!!o&&(w==null?void 0:w.type)!=="API"}),{data:q,isLoading:J,isFetching:$,isError:X,refetch:W}=Xr({queryKey:[i,o,s],queryFn:()=>al("https://semaphor.cloud/api/v1/tables",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s}),enabled:!!i&&!!o&&!!s&&(w==null?void 0:w.type)!=="API"}),{data:ne,isLoading:le,isFetching:A,isError:H}=Xr({queryKey:[i,o,a],queryFn:()=>al("https://semaphor.cloud/api/v1/columns",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s,table_name:a}),enabled:!!i&&!!o&&!!s&&!!a&&(w==null?void 0:w.type)!=="API"}),{data:re,isLoading:R,isFetching:ue,isError:xe}=Xr({queryKey:["api",i],queryFn:()=>ll("https://semaphor.cloud/api/v1/query",(r==null?void 0:r.accessToken)||"",{connection_id:i,sql:"select * from api limit 10"}),enabled:!!i&&S});m.useEffect(()=>{l(n)},[n,l]),m.useEffect(()=>{S&&(d("NA"),f(""),g("api"))},[S,p,g,f,d]);const ge=S?"api":a||"",pe=S?"":s||"";function ee(Se){f(Se),g("")}function Q(Se){d(Se),f(""),g("")}function ie(Se){c(Se)}re&&re.records.length>0&&(n=yR(re.records[0])),C&&C.databases.length>0,I&&I.schemas.length>0,ne&&ne.columns.length>0&&(n=ne.columns.map(Se=>({...Se,data_type:Se.data_type.toLowerCase()}))),k&&(n=[]),(H||x)&&(n=[]);const we=v==null?void 0:v.connections.map(Se=>({id:Se.id,name:Se.name})),te=C==null?void 0:C.databases.map(Se=>({id:Se.database_name,name:Se.database_name})),Ie=I==null?void 0:I.schemas.map(Se=>({id:Se.schema_name,name:Se.schema_name})),ae=q==null?void 0:q.tables.map(Se=>({id:Se.table_name,name:Se.table_name}));return{connectionItems:we,isConnectionsLoading:b,isConnectionsError:x,databaseItems:te,isDatabasesLoadingOrFetching:P||O,isDatabaseError:k,schemaItems:Ie,isSchemaLoadingOrFetching:F||j,isSchemaError:B,tableItems:ae,isTableLoadingOrFetching:J||$,isTableError:X,columns:n,isColumnsLoadingOrFetching:le||A,isColumnsError:H,isAPIConnection:S,tableName:ge,schemaName:pe,handleConnectionChange:ie,handleDatabaseChange:Q,handleSchemaChange:ee}}const vR=e=>{const t=new Date(e);return!isNaN(t.getTime())},bR=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),xf=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?vR(e)?t="date":bR(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t},yR=e=>Object.keys(e).map(t=>{const n=e[t],r=xf(n);return{column_name:t,data_type:r,is_nullable:n===null?"YES":"NO"}});function xR({get:e,dataPoint:t,card:n}){var g;const{addOrUpdateFilterValue:r,addFilteringCard:i,removeFilterValue:o,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:d}=t,f={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(g=n.preferences)==null?void 0:g.filterOnClickField,valueType:xf(d),operation:"=",values:[d]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(d==null){a(n),o(p);return}else s(f)}i(n),r(f)}var wf={exports:{}};/**
59
+ */var Ow;function f3(){if(Ow)return ym;Ow=1;var e=m,t=Cw();function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return ym.useSyncExternalStoreWithSelector=function(c,d,f,g,p){var v=o(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=a(function(){function w(k){if(!S){if(S=!0,C=k,k=g(k),p!==void 0&&b.hasValue){var T=b.value;if(p(T,k))return P=T}return P=k}if(T=P,r(C,k))return T;var I=g(k);return p!==void 0&&p(T,I)?T:(C=k,P=I)}var S=!1,C,P,O=f===void 0?null:f;return[function(){return w(d())},O===null?void 0:function(){return w(O())}]},[d,f,g,p]);var x=i(c,v[0],v[1]);return s(function(){b.hasValue=!0,b.value=x},[x]),l(x),x},ym}process.env.NODE_ENV==="production"?gm.exports=f3():gm.exports=d3();var h3=gm.exports;const p3=Lc(h3);var Pw={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:g3}=m,{useSyncExternalStoreWithSelector:m3}=p3;let kw=!1;function v3(e,t=e.getState,n){(Pw?"production":void 0)!=="production"&&n&&!kw&&(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"),kw=!0);const r=m3(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return g3(r),r}const Dw=e=>{(Pw?"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"?l3(e):e,n=(r,i)=>v3(t,r,i);return Object.assign(n,t),n},Mw=e=>e?Dw(e):Dw;var Tw=Symbol.for("immer-nothing"),Aw=Symbol.for("immer-draftable"),_r=Symbol.for("immer-state"),b3=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 ir(e,...t){if(process.env.NODE_ENV!=="production"){const n=b3[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 cl=Object.getPrototypeOf;function ul(e){return!!e&&!!e[_r]}function js(e){var t;return e?Iw(e)||Array.isArray(e)||!!e[Aw]||!!((t=e.constructor)!=null&&t[Aw])||cf(e)||uf(e):!1}var y3=Object.prototype.constructor.toString();function Iw(e){if(!e||typeof e!="object")return!1;const t=cl(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)===y3}function Bc(e,t){lf(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function lf(e){const t=e[_r];return t?t.type_:Array.isArray(e)?1:cf(e)?2:uf(e)?3:0}function xm(e,t){return lf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nw(e,t,n){const r=lf(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function x3(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function cf(e){return e instanceof Map}function uf(e){return e instanceof Set}function zs(e){return e.copy_||e.base_}function wm(e,t){if(cf(e))return new Map(e);if(uf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Iw(e))return cl(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[_r];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const o=r[i],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(cl(e),n)}function _m(e,t=!1){return df(e)||ul(e)||!js(e)||(lf(e)>1&&(e.set=e.add=e.clear=e.delete=w3),Object.freeze(e),t&&Bc(e,(n,r)=>_m(r,!0))),e}function w3(){ir(2)}function df(e){return Object.isFrozen(e)}var _3={};function Bs(e){const t=_3[e];return t||ir(0,e),t}var Vc;function Rw(){return Vc}function S3(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Lw(e,t){t&&(Bs("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sm(e){Cm(e),e.drafts_.forEach(C3),e.drafts_=null}function Cm(e){e===Vc&&(Vc=e.parent_)}function Fw(e){return Vc=S3(Vc,e)}function C3(e){const t=e[_r];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function $w(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[_r].modified_&&(Sm(t),ir(4)),js(e)&&(e=ff(t,e),t.parent_||hf(t,e)),t.patches_&&Bs("Patches").generateReplacementPatches_(n[_r].base_,e,t.patches_,t.inversePatches_)):e=ff(t,n,[]),Sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Tw?e:void 0}function ff(e,t,n){if(df(t))return t;const r=t[_r];if(!r)return Bc(t,(i,o)=>jw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return hf(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),Bc(o,(a,l)=>jw(e,r,i,a,l,n,s)),hf(e,i,!1),n&&e.patches_&&Bs("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function jw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&ir(5),ul(i)){const a=o&&t&&t.type_!==3&&!xm(t.assigned_,r)?o.concat(r):void 0,l=ff(e,i,a);if(Nw(n,r,l),ul(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(js(i)&&!df(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ff(e,i),(!t||!t.scope_.parent_)&&hf(e,i)}}function hf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_m(t,n)}function E3(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Rw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=Em;n&&(i=[r],o=Hc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var Em={get(e,t){if(t===_r)return e;const n=zs(e);if(!xm(n,t))return O3(e,n,t);const r=n[t];return e.finalized_||!js(r)?r:r===Om(e.base_,t)?(km(e),e.copy_[t]=Dm(r,e)):r},has(e,t){return t in zs(e)},ownKeys(e){return Reflect.ownKeys(zs(e))},set(e,t,n){const r=zw(zs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Om(zs(e),t),o=i==null?void 0:i[_r];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(x3(n,i)&&(n!==void 0||xm(e.base_,t)))return!0;km(e),Pm(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 Om(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,km(e),Pm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=zs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ir(11)},getPrototypeOf(e){return cl(e.base_)},setPrototypeOf(){ir(12)}},Hc={};Bc(Em,(e,t)=>{Hc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Hc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ir(13),Hc.set.call(this,e,t,void 0)},Hc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ir(14),Em.set.call(this,e[0],t,n,e[0])};function Om(e,t){const n=e[_r];return(n?zs(n):e)[t]}function O3(e,t,n){var i;const r=zw(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function zw(e,t){if(!(t in e))return;let n=cl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=cl(n)}}function Pm(e){e.modified_||(e.modified_=!0,e.parent_&&Pm(e.parent_))}function km(e){e.copy_||(e.copy_=wm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var P3=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,d=>n.call(this,d,...c))}}typeof n!="function"&&ir(6),r!==void 0&&typeof r!="function"&&ir(7);let i;if(js(t)){const o=Fw(this),s=Dm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?Sm(o):Cm(o)}return Lw(o,r),$w(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Tw&&(i=void 0),this.autoFreeze_&&_m(i,!0),r){const o=[],s=[];Bs("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else ir(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},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){js(e)||ir(8),ul(e)&&(e=k3(e));const t=Fw(this),n=Dm(e,void 0);return n[_r].isManual_=!0,Cm(t),n}finishDraft(e,t){const n=e&&e[_r];(!n||!n.isManual_)&&ir(9);const{scope_:r}=n;return Lw(r,t),$w(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 i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Bs("Patches").applyPatches_;return ul(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Dm(e,t){const n=cf(e)?Bs("MapSet").proxyMap_(e,t):uf(e)?Bs("MapSet").proxySet_(e,t):E3(e,t);return(t?t.scope_:Rw()).drafts_.push(n),n}function k3(e){return ul(e)||ir(10,e),Bw(e)}function Bw(e){if(!js(e)||df(e))return e;const t=e[_r];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=wm(e,t.scope_.immer_.useStrictShallowCopy_)}else n=wm(e,!0);return Bc(n,(r,i)=>{Nw(n,r,Bw(i))}),t&&(t.finalized_=!1),n}var Sr=new P3,D3=Sr.produce;Sr.produceWithPatches.bind(Sr),Sr.setAutoFreeze.bind(Sr),Sr.setUseStrictShallowCopy.bind(Sr),Sr.applyPatches.bind(Sr),Sr.createDraft.bind(Sr),Sr.finishDraft.bind(Sr);const Vw=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?D3(i):i;return t(a,o,...s)},e(r.setState,n,r));var pf,gf=kt;if(process.env.NODE_ENV==="production")pf=gf.createRoot,gf.hydrateRoot;else{var Hw=gf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;pf=function(e,t){Hw.usingClientEntryPoint=!0;try{return gf.createRoot(e,t)}finally{Hw.usingClientEntryPoint=!1}}}function Ww(e,t,n){const r={count:0},i=a=>{const l=m.useRef(r.count);return m.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(i.displayName=`((${e})) devtool`,typeof document>"u")return;if(!n){let a=document.getElementById(`simple-zustand-devtools-${e}`);a||(a=document.createElement("div"),a.id=`simple-zustand-devtools-${e}`),document.body.appendChild(a),n=a}const o=pf(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var Uw={},qw={},Mm={exports:{}},Xt=String,Gw=function(){return{isColorSupported:!1,reset:Xt,bold:Xt,dim:Xt,italic:Xt,underline:Xt,inverse:Xt,hidden:Xt,strikethrough:Xt,black:Xt,red:Xt,green:Xt,yellow:Xt,blue:Xt,magenta:Xt,cyan:Xt,white:Xt,gray:Xt,bgBlack:Xt,bgRed:Xt,bgGreen:Xt,bgYellow:Xt,bgBlue:Xt,bgMagenta:Xt,bgCyan:Xt,bgWhite:Xt}};Mm.exports=Gw(),Mm.exports.createColors=Gw;var M3=Mm.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var d in c)Object.defineProperty(l,d,{enumerable:!0,get:c[d]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(M3);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,d){typeof process<"u"&&process.env.JEST_WORKER_ID||d&&i.has(d)||(d&&i.add(d),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){o(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){o(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){o(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(qw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(qw);function n(o){return o&&o.__esModule?o:{default:o}}function r({version:o,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${o}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={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}}}(Uw);let Tm=Uw;var T3=(Tm.__esModule?Tm:{default:Tm}).default;const rn=Lc(T3),Am={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[rn.blue[500],rn.teal[500],rn.amber[500],rn.red[500],rn.indigo[500],rn.green[500]],borderColor:[rn.blue[500],rn.teal[500],rn.amber[500],rn.red[500],rn.indigo[500],rn.green[500]]},options:{plugins:{datalabels:{display:!1,color:A3},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[rn.teal[100],rn.purple[100],rn.amber[100],rn.orange[100],rn.rose[100]],borderColor:[rn.teal[400],rn.purple[400],rn.amber[400],rn.orange[300],rn.rose[400]]},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:rn.slate[800]}},y:{grid:{display:!0,color:rn.slate[800]}}}}}}};function A3(e){var r,i,o,s,a,l;const t=(a=(s=(o=(i=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:i._config)==null?void 0:o.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=Yw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Yw()),I3(n)}function Yw(){return fe.getState().theme==="dark"?"#000000":"#FFFFFF"}function I3(e){let t=0,n=0,r=0,i=0;const o=d=>{const f=d.replace("#",""),g=parseInt(f.substring(0,2),16),p=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=g,n+=p,r+=v,i++};Array.isArray(e)?e.forEach(d=>{o(d)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}var Wc=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(){}},dl=typeof window>"u"||"Deno"in window;function Kr(){}function N3(e,t){return typeof e=="function"?e(t):e}function Im(e){return typeof e=="number"&&e>=0&&e!==1/0}function Kw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xw(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Nm(s,t.options))return!1}else if(!qc(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 i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Qw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Uc(t.options.mutationKey)!==Uc(o))return!1}else if(!qc(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Nm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Uc)(e)}function Uc(e){return JSON.stringify(e,(t,n)=>Lm(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function qc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!qc(e[n],t[n])):!1}function Zw(e,t){if(e===t)return e;const n=Jw(e)&&Jw(t);if(n||Lm(e)&&Lm(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const d=n?c:o[c];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(a[d]=void 0,l++):(a[d]=Zw(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function Rm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Jw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lm(e){if(!e_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!e_(n)||!n.hasOwnProperty("isPrototypeOf"))}function e_(e){return Object.prototype.toString.call(e)==="[object Object]"}function R3(e){return new Promise(t=>{setTimeout(t,e)})}function Fm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Zw(e,t):t}function L3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function F3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var $3=(H5=class extends Wc{constructor(){super();Ve(this,Na,void 0);Ve(this,xs,void 0);Ve(this,sc,void 0);Le(this,sc,t=>{if(!dl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){K(this,xs)||this.setEventListener(K(this,sc))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,xs))==null||t.call(this),Le(this,xs,void 0))}setEventListener(t){var n;Le(this,sc,t),(n=K(this,xs))==null||n.call(this),Le(this,xs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){K(this,Na)!==t&&(Le(this,Na,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof K(this,Na)=="boolean"?K(this,Na):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Na=new WeakMap,xs=new WeakMap,sc=new WeakMap,H5),mf=new $3,j3=(W5=class extends Wc{constructor(){super();Ve(this,ac,!0);Ve(this,ws,void 0);Ve(this,lc,void 0);Le(this,lc,t=>{if(!dl&&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(){K(this,ws)||this.setEventListener(K(this,lc))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,ws))==null||t.call(this),Le(this,ws,void 0))}setEventListener(t){var n;Le(this,lc,t),(n=K(this,ws))==null||n.call(this),Le(this,ws,t(this.setOnline.bind(this)))}setOnline(t){K(this,ac)!==t&&(Le(this,ac,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return K(this,ac)}},ac=new WeakMap,ws=new WeakMap,lc=new WeakMap,W5),vf=new j3;function z3(e){return Math.min(1e3*2**e,3e4)}function bf(e){return(e??"online")==="online"?vf.isOnline():!0}var t_=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $m(e){return e instanceof t_}function n_(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((x,w)=>{o=x,s=w}),l=x=>{var w;r||(p(new t_(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},d=()=>{t=!1},f=()=>!mf.isFocused()||e.networkMode!=="always"&&!vf.isOnline(),g=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),i==null||i(),o(x))},p=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),i==null||i(),s(x))},v=()=>new Promise(x=>{var w;i=S=>{const C=r||!f();return C&&x(S),C},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;i=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(g).catch(w=>{var k;if(r)return;const S=e.retry??(dl?0:3),C=e.retryDelay??z3,P=typeof C=="function"?C(n,w):C,O=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,w);if(t||!O){p(w);return}n++,(k=e.onFail)==null||k.call(e,n,w),R3(P).then(()=>{if(f())return v()}).then(()=>{t?p(w):b()})})};return bf(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:d}}function B3(){let e=[],t=0,n=g=>{g()},r=g=>{g()},i=g=>setTimeout(g,0);const o=g=>{i=g},s=g=>{let p;t++;try{p=g()}finally{t--,t||c()}return p},a=g=>{t?e.push(g):i(()=>{n(g)})},l=g=>(...p)=>{a(()=>{g(...p)})},c=()=>{const g=e;e=[],g.length&&i(()=>{r(()=>{g.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var In=B3(),r_=(U5=class{constructor(){Ve(this,Ra,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Im(this.gcTime)&&Le(this,Ra,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(dl?1/0:5*60*1e3))}clearGcTimeout(){K(this,Ra)&&(clearTimeout(K(this,Ra)),Le(this,Ra,void 0))}},Ra=new WeakMap,U5),V3=(q5=class extends r_{constructor(t){super();Ve(this,dc);Ve(this,Pi);Ve(this,cc,void 0);Ve(this,uc,void 0);Ve(this,si,void 0);Ve(this,_s,void 0);Ve(this,ai,void 0);Ve(this,Mn,void 0);Ve(this,Cd,void 0);Ve(this,La,void 0);Le(this,La,!1),Le(this,Cd,t.defaultOptions),wt(this,dc,um).call(this,t.options),Le(this,Mn,[]),Le(this,si,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Le(this,cc,t.state||H3(this.options)),this.state=K(this,cc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!K(this,Mn).length&&this.state.fetchStatus==="idle"&&K(this,si).remove(this)}setData(t,n){const r=Fm(this.state.data,t,this.options);return wt(this,Pi,Vo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){wt(this,Pi,Vo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=K(this,_s);return(r=K(this,ai))==null||r.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(K(this,cc))}isActive(){return K(this,Mn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||K(this,Mn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Kw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=K(this,Mn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,ai))==null||n.continue()}onOnline(){var n;const t=K(this,Mn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,ai))==null||n.continue()}addObserver(t){K(this,Mn).includes(t)||(K(this,Mn).push(t),this.clearGcTimeout(),K(this,si).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){K(this,Mn).includes(t)&&(Le(this,Mn,K(this,Mn).filter(n=>n!==t)),K(this,Mn).length||(K(this,ai)&&(K(this,La)?K(this,ai).cancel({revert:!0}):K(this,ai).cancelRetry()),this.scheduleGc()),K(this,si).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return K(this,Mn).length}invalidate(){this.state.isInvalidated||wt(this,Pi,Vo).call(this,{type:"invalidate"})}fetch(t,n){var c,d,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(K(this,_s))return(c=K(this,ai))==null||c.continueRetry(),K(this,_s)}if(t&&wt(this,dc,um).call(this,t),!this.options.queryFn){const p=K(this,Mn).find(v=>v.options.queryFn);p&&wt(this,dc,um).call(this,p.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,i={queryKey:this.queryKey,meta:this.meta},o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Le(this,La,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Le(this,La,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(a),(d=this.options.behavior)==null||d.onFetch(a,this),Le(this,uc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&wt(this,Pi,Vo).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,b,x,w;$m(p)&&p.silent||wt(this,Pi,Vo).call(this,{type:"error",error:p}),$m(p)||((b=(v=K(this,si).config).onError)==null||b.call(v,p,this),(w=(x=K(this,si).config).onSettled)==null||w.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Le(this,ai,n_({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,b,x,w;if(typeof p>"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(p),(b=(v=K(this,si).config).onSuccess)==null||b.call(v,p,this),(w=(x=K(this,si).config).onSettled)==null||w.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{wt(this,Pi,Vo).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{wt(this,Pi,Vo).call(this,{type:"pause"})},onContinue:()=>{wt(this,Pi,Vo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Le(this,_s,K(this,ai).promise),K(this,_s)}},cc=new WeakMap,uc=new WeakMap,si=new WeakMap,_s=new WeakMap,ai=new WeakMap,Mn=new WeakMap,Cd=new WeakMap,La=new WeakMap,dc=new WeakSet,um=function(t){this.options={...K(this,Cd),...t},this.updateGcTime(this.options.gcTime)},Pi=new WeakSet,Vo=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:bf(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 i=t.error;return $m(i)&&i.revert&&K(this,uc)?{...K(this,uc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),In.batch(()=>{K(this,Mn).forEach(r=>{r.onQueryUpdate()}),K(this,si).notify({query:this,type:"updated",action:t})})},q5);function H3(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 W3=(G5=class extends Wc{constructor(t={}){super();Ve(this,Qi,void 0);this.config=t,Le(this,Qi,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??Nm(i,n);let s=this.get(o);return s||(s=new V3({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){K(this,Qi).has(t.queryHash)||(K(this,Qi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=K(this,Qi).get(t.queryHash);n&&(t.destroy(),n===t&&K(this,Qi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){In.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return K(this,Qi).get(t)}getAll(){return[...K(this,Qi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Xw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Xw(t,r)):n}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){In.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){In.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qi=new WeakMap,G5),U3=(Y5=class extends r_{constructor(t){super();Ve(this,Ji);Ve(this,Zi,void 0);Ve(this,Ed,void 0);Ve(this,zr,void 0);Ve(this,fc,void 0);this.mutationId=t.mutationId,Le(this,Ed,t.defaultOptions),Le(this,zr,t.mutationCache),Le(this,Zi,[]),this.state=t.state||q3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...K(this,Ed),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){K(this,Zi).includes(t)||(K(this,Zi).push(t),this.clearGcTimeout(),K(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Le(this,Zi,K(this,Zi).filter(n=>n!==t)),this.scheduleGc(),K(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){K(this,Zi).length||(this.state.status==="pending"?this.scheduleGc():K(this,zr).remove(this))}continue(){var t;return((t=K(this,fc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,d,f,g,p,v,b,x,w,S,C,P,O,k,T;const n=()=>(Le(this,fc,n_({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,F)=>{wt(this,Ji,Ls).call(this,{type:"failed",failureCount:I,error:F})},onPause:()=>{wt(this,Ji,Ls).call(this,{type:"pause"})},onContinue:()=>{wt(this,Ji,Ls).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),K(this,fc).promise),r=this.state.status==="pending";try{if(!r){wt(this,Ji,Ls).call(this,{type:"pending",variables:t}),await((o=(i=K(this,zr).config).onMutate)==null?void 0:o.call(i,t,this));const F=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));F!==this.state.context&&wt(this,Ji,Ls).call(this,{type:"pending",context:F,variables:t})}const I=await n();return await((c=(l=K(this,zr).config).onSuccess)==null?void 0:c.call(l,I,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,I,t,this.state.context)),await((p=(g=K(this,zr).config).onSettled)==null?void 0:p.call(g,I,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,I,null,t,this.state.context)),wt(this,Ji,Ls).call(this,{type:"success",data:I}),I}catch(I){try{throw await((w=(x=K(this,zr).config).onError)==null?void 0:w.call(x,I,t,this.state.context,this)),await((C=(S=this.options).onError)==null?void 0:C.call(S,I,t,this.state.context)),await((O=(P=K(this,zr).config).onSettled)==null?void 0:O.call(P,void 0,I,this.state.variables,this.state.context,this)),await((T=(k=this.options).onSettled)==null?void 0:T.call(k,void 0,I,t,this.state.context)),I}finally{wt(this,Ji,Ls).call(this,{type:"error",error:I})}}}},Zi=new WeakMap,Ed=new WeakMap,zr=new WeakMap,fc=new WeakMap,Ji=new WeakSet,Ls=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:!bf(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),In.batch(()=>{K(this,Zi).forEach(r=>{r.onMutationUpdate(t)}),K(this,zr).notify({mutation:this,type:"updated",action:t})})},Y5);function q3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var G3=(K5=class extends Wc{constructor(t={}){super();Ve(this,li,void 0);Ve(this,Od,void 0);Ve(this,Fa,void 0);this.config=t,Le(this,li,[]),Le(this,Od,0)}build(t,n,r){const i=new U3({mutationCache:this,mutationId:++cm(this,Od)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){K(this,li).push(t),this.notify({type:"added",mutation:t})}remove(t){Le(this,li,K(this,li).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){In.batch(()=>{K(this,li).forEach(t=>{this.remove(t)})})}getAll(){return K(this,li)}find(t){const n={exact:!0,...t};return K(this,li).find(r=>Qw(n,r))}findAll(t={}){return K(this,li).filter(n=>Qw(t,n))}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Le(this,Fa,(K(this,Fa)??Promise.resolve()).then(()=>{const t=K(this,li).filter(n=>n.state.isPaused);return In.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Kr)),Promise.resolve()))}).then(()=>{Le(this,Fa,void 0)})),K(this,Fa)}},li=new WeakMap,Od=new WeakMap,Fa=new WeakMap,K5);function Y3(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,x,w,S;const i=t.options,o=(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=((S=t.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const d=C=>{Object.defineProperty(C,"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}'`))),g=async(C,P,O)=>{if(c)return Promise.reject();if(P==null&&C.pages.length)return Promise.resolve(C);const k={queryKey:t.queryKey,pageParam:P,direction:O?"backward":"forward",meta:t.options.meta};d(k);const T=await f(k),{maxPages:I}=t.options,F=O?F3:L3;return{pages:F(C.pages,T,I),pageParams:F(C.pageParams,P,I)}};let p;if(o&&s.length){const C=o==="backward",P=C?K3:i_,O={pages:s,pageParams:a},k=P(i,O);p=await g(O,k,C)}else{p=await g(l,a[0]??i.initialPageParam);const C=e??s.length;for(let P=1;P<C;P++){const O=i_(i,p);p=await g(p,O)}}return p};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function i_(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function K3(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var o_=(X5=class{constructor(e={}){Ve(this,En,void 0);Ve(this,Ss,void 0);Ve(this,Cs,void 0);Ve(this,hc,void 0);Ve(this,pc,void 0);Ve(this,Es,void 0);Ve(this,gc,void 0);Ve(this,mc,void 0);Le(this,En,e.queryCache||new W3),Le(this,Ss,e.mutationCache||new G3),Le(this,Cs,e.defaultOptions||{}),Le(this,hc,new Map),Le(this,pc,new Map),Le(this,Es,0)}mount(){cm(this,Es)._++,K(this,Es)===1&&(Le(this,gc,mf.subscribe(()=>{mf.isFocused()&&(this.resumePausedMutations(),K(this,En).onFocus())})),Le(this,mc,vf.subscribe(()=>{vf.isOnline()&&(this.resumePausedMutations(),K(this,En).onOnline())})))}unmount(){var e,t;cm(this,Es)._--,K(this,Es)===0&&((e=K(this,gc))==null||e.call(this),Le(this,gc,void 0),(t=K(this,mc))==null||t.call(this),Le(this,mc,void 0))}isFetching(e){return K(this,En).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return K(this,Ss).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=K(this,En).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=K(this,En).find({queryKey:e}),i=r==null?void 0:r.state.data,o=N3(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return K(this,En).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return In.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=K(this,En).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=K(this,En);In.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=K(this,En),r={type:"active",...e};return In.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=In.batch(()=>K(this,En).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e={},t={}){return In.batch(()=>{if(K(this,En).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=In.batch(()=>K(this,En).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=K(this,En).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e.behavior=Y3(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}resumePausedMutations(){return K(this,Ss).resumePausedMutations()}getQueryCache(){return K(this,En)}getMutationCache(){return K(this,Ss)}getDefaultOptions(){return K(this,Cs)}setDefaultOptions(e){Le(this,Cs,e)}setQueryDefaults(e,t){K(this,hc).set(Uc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...K(this,hc).values()];let n={};return t.forEach(r=>{qc(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){K(this,pc).set(Uc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...K(this,pc).values()];let n={};return t.forEach(r=>{qc(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...K(this,Cs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Nm(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:{...K(this,Cs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){K(this,En).clear(),K(this,Ss).clear()}},En=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,hc=new WeakMap,pc=new WeakMap,Es=new WeakMap,gc=new WeakMap,mc=new WeakMap,X5),X3=(Q5=class extends Wc{constructor(t,n){super();Ve(this,Ba);Ve(this,Dd);Ve(this,Md);Ve(this,Td);Ve(this,Ad);Ve(this,Id);Ve(this,Nd);Ve(this,Rd);Ve(this,wg);Ve(this,gr,void 0);Ve(this,tn,void 0);Ve(this,Pd,void 0);Ve(this,er,void 0);Ve(this,$a,void 0);Ve(this,vc,void 0);Ve(this,eo,void 0);Ve(this,kd,void 0);Ve(this,bc,void 0);Ve(this,yc,void 0);Ve(this,ja,void 0);Ve(this,za,void 0);Ve(this,Os,void 0);Ve(this,xc,new Set);this.options=n,Le(this,gr,t),Le(this,eo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(K(this,tn).addObserver(this),s_(K(this,tn),this.options)?wt(this,Ba,rf).call(this):this.updateResult(),wt(this,Ad,sw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jm(K(this,tn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jm(K(this,tn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,wt(this,Id,aw).call(this),wt(this,Nd,lw).call(this),K(this,tn).removeObserver(this)}setOptions(t,n){const r=this.options,i=K(this,tn);if(this.options=K(this,gr).defaultQueryOptions(t),Rm(r,this.options)||K(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:K(this,tn),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),wt(this,Rd,cw).call(this);const o=this.hasListeners();o&&a_(K(this,tn),i,this.options,r)&&wt(this,Ba,rf).call(this),this.updateResult(n),o&&(K(this,tn)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&wt(this,Dd,rw).call(this);const s=wt(this,Md,iw).call(this);o&&(K(this,tn)!==i||this.options.enabled!==r.enabled||s!==K(this,Os))&&wt(this,Td,ow).call(this,s)}getOptimisticResult(t){const n=K(this,gr).getQueryCache().build(K(this,gr),t),r=this.createResult(n,t);return Z3(this,r)&&(Le(this,er,r),Le(this,vc,this.options),Le(this,$a,K(this,tn).state)),r}getCurrentResult(){return K(this,er)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(K(this,xc).add(r),t[r])})}),n}getCurrentQuery(){return K(this,tn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=K(this,gr).defaultQueryOptions(t),r=K(this,gr).getQueryCache().build(K(this,gr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return wt(this,Ba,rf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),K(this,er)))}createResult(t,n){var k;const r=K(this,tn),i=this.options,o=K(this,er),s=K(this,$a),a=K(this,vc),c=t!==r?t.state:K(this,Pd),{state:d}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=d,b=!1,x;if(n._optimisticResults){const T=this.hasListeners(),I=!T&&s_(t,n),F=T&&a_(t,r,n,i);(I||F)&&(p=bf(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof d.data<"u")if(o&&d.data===(s==null?void 0:s.data)&&n.select===K(this,kd))x=K(this,bc);else try{Le(this,kd,n.select),x=n.select(d.data),x=Fm(o==null?void 0:o.data,x,n),Le(this,bc,x),Le(this,eo,null)}catch(T){Le(this,eo,T)}else x=d.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let T;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=o.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((k=K(this,yc))==null?void 0:k.state.data,K(this,yc)):n.placeholderData,n.select&&typeof T<"u")try{T=n.select(T),Le(this,eo,null)}catch(I){Le(this,eo,I)}typeof T<"u"&&(v="success",x=Fm(o==null?void 0:o.data,T,n),b=!0)}K(this,eo)&&(f=K(this,eo),x=K(this,bc),g=Date.now(),v="error");const w=p==="fetching",S=v==="pending",C=v==="error",P=S&&w;return{status:v,fetchStatus:p,isPending:S,isSuccess:v==="success",isError:C,isInitialLoading:P,isLoading:P,data:x,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:b,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:zm(t,n),refetch:this.refetch}}updateResult(t){const n=K(this,er),r=this.createResult(K(this,tn),this.options);if(Le(this,$a,K(this,tn).state),Le(this,vc,this.options),K(this,$a).data!==void 0&&Le(this,yc,K(this,tn)),Rm(r,n))return;Le(this,er,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!K(this,xc).size)return!0;const l=new Set(a??K(this,xc));return this.options.throwOnError&&l.add("error"),Object.keys(K(this,er)).some(c=>{const d=c;return K(this,er)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),wt(this,wg,SN).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&wt(this,Ad,sw).call(this)}},gr=new WeakMap,tn=new WeakMap,Pd=new WeakMap,er=new WeakMap,$a=new WeakMap,vc=new WeakMap,eo=new WeakMap,kd=new WeakMap,bc=new WeakMap,yc=new WeakMap,ja=new WeakMap,za=new WeakMap,Os=new WeakMap,xc=new WeakMap,Ba=new WeakSet,rf=function(t){wt(this,Rd,cw).call(this);let n=K(this,tn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},Dd=new WeakSet,rw=function(){if(wt(this,Id,aw).call(this),dl||K(this,er).isStale||!Im(this.options.staleTime))return;const n=Kw(K(this,er).dataUpdatedAt,this.options.staleTime)+1;Le(this,ja,setTimeout(()=>{K(this,er).isStale||this.updateResult()},n))},Md=new WeakSet,iw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(K(this,tn)):this.options.refetchInterval)??!1},Td=new WeakSet,ow=function(t){wt(this,Nd,lw).call(this),Le(this,Os,t),!(dl||this.options.enabled===!1||!Im(K(this,Os))||K(this,Os)===0)&&Le(this,za,setInterval(()=>{(this.options.refetchIntervalInBackground||mf.isFocused())&&wt(this,Ba,rf).call(this)},K(this,Os)))},Ad=new WeakSet,sw=function(){wt(this,Dd,rw).call(this),wt(this,Td,ow).call(this,wt(this,Md,iw).call(this))},Id=new WeakSet,aw=function(){K(this,ja)&&(clearTimeout(K(this,ja)),Le(this,ja,void 0))},Nd=new WeakSet,lw=function(){K(this,za)&&(clearInterval(K(this,za)),Le(this,za,void 0))},Rd=new WeakSet,cw=function(){const t=K(this,gr).getQueryCache().build(K(this,gr),this.options);if(t===K(this,tn))return;const n=K(this,tn);Le(this,tn,t),Le(this,Pd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},wg=new WeakSet,SN=function(t){In.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(K(this,er))}),K(this,gr).getQueryCache().notify({query:K(this,tn),type:"observerResultsUpdated"})})},Q5);function Q3(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function s_(e,t){return Q3(e,t)||e.state.dataUpdatedAt>0&&jm(e,t,t.refetchOnMount)}function jm(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zm(e,t)}return!1}function a_(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&zm(e,n)}function zm(e,t){return e.isStaleByTime(t.staleTime)}function Z3(e,t){return!Rm(e.getCurrentResult(),t)}var l_=de.createContext(void 0),J3=e=>{const t=de.useContext(l_);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},eR=({client:e,children:t})=>(de.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),de.createElement(l_.Provider,{value:e},t)),c_=de.createContext(!1),tR=()=>de.useContext(c_);c_.Provider;function nR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var rR=de.createContext(nR()),iR=()=>de.useContext(rR);function oR(e,t){return typeof e=="function"?e(...t):!!e}var sR=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},aR=e=>{de.useEffect(()=>{e.clearReset()},[e])},lR=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&oR(n,[e.error,r]),cR=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},uR=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,dR=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function fR(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=J3(n),i=tR(),o=iR(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",cR(s),sR(s,o),aR(o);const[a]=de.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(de.useSyncExternalStore(de.useCallback(c=>{const d=i?()=>{}:a.subscribe(In.batchCalls(c));return a.updateResult(),d},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),de.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),uR(s,l))throw dR(s,a,o);if(lR({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Xr(e,t){return fR(e,X3,t)}let yf;const hR=new Uint8Array(16);function pR(){if(!yf&&(yf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yf(hR)}const Nn=[];for(let e=0;e<256;++e)Nn.push((e+256).toString(16).slice(1));function gR(e,t=0){return Nn[e[t+0]]+Nn[e[t+1]]+Nn[e[t+2]]+Nn[e[t+3]]+"-"+Nn[e[t+4]]+Nn[e[t+5]]+"-"+Nn[e[t+6]]+Nn[e[t+7]]+"-"+Nn[e[t+8]]+Nn[e[t+9]]+"-"+Nn[e[t+10]]+Nn[e[t+11]]+Nn[e[t+12]]+Nn[e[t+13]]+Nn[e[t+14]]+Nn[e[t+15]]}const u_={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function qo(e,t,n){if(u_.randomUUID&&!t&&!e)return u_.randomUUID();e=e||{};const r=e.random||(e.rng||pR)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return gR(r)}const ve=Mw()(Vw((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:qo(),title:"Editor Card",description:"Desdcription",type:"bar",data:[]},frame:{id:qo(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,i,o)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:i,suffix:o,enabled:!0}}})},setCardPreferences:n=>{e(r=>{r.card.preferences=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})},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(i=>{i.sqlGen.measures=[...i.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,i;e(o=>{o.selectedConnectionId=n,o.card.connectionId=n}),(i=(r=t()).onConnectionChange)==null||i.call(r,n)},setSelectedDatabaseName:n=>{var r,i;e(o=>{o.selectedDatabaseName=n,o.card.lastSelectedDatabase=n}),(i=(r=t()).onDatabaseChange)==null||i.call(r,n)},setSelectedSchemaName:n=>{var r,i;e(o=>{o.selectedSchemaName=n,o.card.lastSelectedSchema=n}),(i=(r=t()).onSchemaChange)==null||i.call(r,n)},setSelectedTableName:n=>{var r,i;e(o=>{o.selectedTableName=n,o.card.lastSelectedTable=n}),(i=(r=t()).onTableChange)==null||i.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})}}}))),mR=()=>ve(e=>e.actions);process.env.NODE_ENV==="development"&&Ww("EditorStore",ve);function d_(e,t){let n=m.useMemo(()=>[],[]);const r=fe(Se=>Se.authToken)||e,i=ve(Se=>Se.selectedConnectionId),o=ve(Se=>Se.selectedDatabaseName),s=ve(Se=>Se.selectedSchemaName),a=ve(Se=>Se.selectedTableName),l=ve(Se=>Se.actions.setCurrentColumns),c=ve(Se=>Se.actions.setSelectedConnectionId),d=ve(Se=>Se.actions.setSelectedDatabaseName),f=ve(Se=>Se.actions.setSelectedSchemaName),g=ve(Se=>Se.actions.setSelectedTableName),p=ve(Se=>Se.actions.setCardSql),{data:v,isLoading:b,isError:x}=Xr({queryKey:[t||"connections"],queryFn:()=>al("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)}),w=v==null?void 0:v.connections.find(Se=>Se.id===i),S=(w==null?void 0:w.type)==="API",{data:C,isLoading:P,isFetching:O,isError:k,refetch:T}=Xr({queryKey:[i],queryFn:()=>al("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:i}),enabled:!!i&&(w==null?void 0:w.type)!=="API"}),{data:I,isLoading:F,isFetching:j,isError:B,refetch:V}=Xr({queryKey:[i,o],queryFn:()=>al("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o}),enabled:!!i&&!!o&&(w==null?void 0:w.type)!=="API"}),{data:q,isLoading:J,isFetching:$,isError:X,refetch:W}=Xr({queryKey:[i,o,s],queryFn:()=>al("https://semaphor.cloud/api/v1/tables",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s}),enabled:!!i&&!!o&&!!s&&(w==null?void 0:w.type)!=="API"}),{data:te,isLoading:le,isFetching:A,isError:H}=Xr({queryKey:[i,o,a],queryFn:()=>al("https://semaphor.cloud/api/v1/columns",(r==null?void 0:r.accessToken)||"",{connection_id:i,database_name:o,schema_name:s,table_name:a}),enabled:!!i&&!!o&&!!s&&!!a&&(w==null?void 0:w.type)!=="API"}),{data:ne,isLoading:R,isFetching:ue,isError:xe}=Xr({queryKey:["api",i],queryFn:()=>ll("https://semaphor.cloud/api/v1/query",(r==null?void 0:r.accessToken)||"",{connection_id:i,sql:"select * from api limit 10"}),enabled:!!i&&S});m.useEffect(()=>{l(n)},[te,l,n,ne]),m.useEffect(()=>{S&&(d("NA"),f(""),g("api"))},[S,p,g,f,d]);const ge=S?"api":a||"",pe=S?"":s||"";function ee(Se){f(Se),g("")}function Q(Se){d(Se),f(""),g("")}function ie(Se){c(Se)}ne&&ne.records.length>0&&(n=yR(ne.records[0])),C&&C.databases.length>0,I&&I.schemas.length>0,te&&te.columns.length>0&&(n=te.columns.map(Se=>({...Se,data_type:Se.data_type.toLowerCase()}))),k&&(n=[]),(H||x)&&(n=[]);const we=v==null?void 0:v.connections.map(Se=>({id:Se.id,name:Se.name})),re=C==null?void 0:C.databases.map(Se=>({id:Se.database_name,name:Se.database_name})),Ie=I==null?void 0:I.schemas.map(Se=>({id:Se.schema_name,name:Se.schema_name})),ae=q==null?void 0:q.tables.map(Se=>({id:Se.table_name,name:Se.table_name}));return{connectionItems:we,isConnectionsLoading:b,isConnectionsError:x,databaseItems:re,isDatabasesLoadingOrFetching:P||O,isDatabaseError:k,schemaItems:Ie,isSchemaLoadingOrFetching:F||j,isSchemaError:B,tableItems:ae,isTableLoadingOrFetching:J||$,isTableError:X,columns:n,isColumnsLoadingOrFetching:le||A,isColumnsError:H,isAPIConnection:S,tableName:ge,schemaName:pe,handleConnectionChange:ie,handleDatabaseChange:Q,handleSchemaChange:ee}}const vR=e=>{const t=new Date(e);return!isNaN(t.getTime())},bR=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),xf=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?vR(e)?t="date":bR(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t},yR=e=>Object.keys(e).map(t=>{const n=e[t],r=xf(n);return{column_name:t,data_type:r,is_nullable:n===null?"YES":"NO"}});function xR({get:e,dataPoint:t,card:n}){var g;const{addOrUpdateFilterValue:r,addFilteringCard:i,removeFilterValue:o,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:d}=t,f={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(g=n.preferences)==null?void 0:g.filterOnClickField,valueType:xf(d),operation:"=",values:[d]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(d==null){a(n),o(p);return}else s(f)}i(n),r(f)}var wf={exports:{}};/**
60
60
  * @license
61
61
  * Lodash <https://lodash.com/>
62
62
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
63
63
  * Released under MIT license <https://lodash.com/license>
64
64
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
65
65
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
66
- */wf.exports,function(e,t){(function(){var n,r="4.17.21",i=200,o="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,d="__lodash_placeholder__",f=1,g=2,p=4,v=1,b=2,x=1,w=2,S=4,C=8,P=16,O=32,k=64,T=128,I=256,F=512,j=30,B="...",V=800,q=16,J=1,$=2,X=3,W=1/0,ne=9007199254740991,le=17976931348623157e292,A=NaN,H=4294967295,re=H-1,R=H>>>1,ue=[["ary",T],["bind",x],["bindKey",w],["curry",C],["curryRight",P],["flip",F],["partial",O],["partialRight",k],["rearg",I]],xe="[object Arguments]",ge="[object Array]",pe="[object AsyncFunction]",ee="[object Boolean]",Q="[object Date]",ie="[object DOMException]",we="[object Error]",te="[object Function]",Ie="[object GeneratorFunction]",ae="[object Map]",Se="[object Number]",We="[object Null]",dt="[object Object]",qe="[object Promise]",gt="[object Proxy]",Gt="[object RegExp]",Bt="[object Set]",gn="[object String]",Rt="[object Symbol]",mr="[object Undefined]",he="[object WeakMap]",Ee="[object WeakSet]",Ne="[object ArrayBuffer]",Ue="[object DataView]",at="[object Float32Array]",ln="[object Float64Array]",cn="[object Int8Array]",$n="[object Int16Array]",Br="[object Int32Array]",Vr="[object Uint8Array]",mn="[object Uint8ClampedArray]",vr="[object Uint16Array]",jn="[object Uint32Array]",Ld=/\b__p \+= '';/g,To=/\b(__p \+=) '' \+/g,Va=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Yn=/&(?:amp|lt|gt|quot|#39);/g,to=/[&<>"']/g,Ao=RegExp(Yn.source),Ha=RegExp(to.source),Fd=/<%-([\s\S]+?)%>/g,Wa=/<%([\s\S]+?)%>/g,wc=/<%=([\s\S]+?)%>/g,Ua=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qa=/^\w*$/,$d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ga=/[\\^$.*+?()[\]{}|]/g,Ya=RegExp(Ga.source),Ka=/^\s+/,jd=/\s/,zd=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bd=/\{\n\/\* \[wrapped with (.+)\] \*/,D=/,? & /,G=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,oe=/[()=,{}\[\]\/\s]/,Oe=/\\(\\)?/g,$e=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Be=/\w*$/,Re=/^[-+]0x[0-9a-f]+$/i,Te=/^0b[01]+$/i,Pt=/^\[object .+?Constructor\]$/,et=/^0o[0-7]+$/i,ot=/^(?:0|[1-9]\d*)$/,Vt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tn=/($^)/,Xa=/['\n\r\u2028\u2029\\]/g,on="\\ud800-\\udfff",zie="\\u0300-\\u036f",Bie="\\ufe20-\\ufe2f",Vie="\\u20d0-\\u20ff",Z5=zie+Bie+Vie,J5="\\u2700-\\u27bf",eA="a-z\\xdf-\\xf6\\xf8-\\xff",Hie="\\xac\\xb1\\xd7\\xf7",Wie="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Uie="\\u2000-\\u206f",qie=" \\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",tA="A-Z\\xc0-\\xd6\\xd8-\\xde",nA="\\ufe0e\\ufe0f",rA=Hie+Wie+Uie+qie,qx="['’]",Gie="["+on+"]",iA="["+rA+"]",Sg="["+Z5+"]",oA="\\d+",Yie="["+J5+"]",sA="["+eA+"]",aA="[^"+on+rA+oA+J5+eA+tA+"]",Gx="\\ud83c[\\udffb-\\udfff]",Kie="(?:"+Sg+"|"+Gx+")",lA="[^"+on+"]",Yx="(?:\\ud83c[\\udde6-\\uddff]){2}",Kx="[\\ud800-\\udbff][\\udc00-\\udfff]",_c="["+tA+"]",cA="\\u200d",uA="(?:"+sA+"|"+aA+")",Xie="(?:"+_c+"|"+aA+")",dA="(?:"+qx+"(?:d|ll|m|re|s|t|ve))?",fA="(?:"+qx+"(?:D|LL|M|RE|S|T|VE))?",hA=Kie+"?",pA="["+nA+"]?",Qie="(?:"+cA+"(?:"+[lA,Yx,Kx].join("|")+")"+pA+hA+")*",Zie="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Jie="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gA=pA+hA+Qie,eoe="(?:"+[Yie,Yx,Kx].join("|")+")"+gA,toe="(?:"+[lA+Sg+"?",Sg,Yx,Kx,Gie].join("|")+")",noe=RegExp(qx,"g"),roe=RegExp(Sg,"g"),Xx=RegExp(Gx+"(?="+Gx+")|"+toe+gA,"g"),ioe=RegExp([_c+"?"+sA+"+"+dA+"(?="+[iA,_c,"$"].join("|")+")",Xie+"+"+fA+"(?="+[iA,_c+uA,"$"].join("|")+")",_c+"?"+uA+"+"+dA,_c+"+"+fA,Jie,Zie,oA,eoe].join("|"),"g"),ooe=RegExp("["+cA+on+Z5+nA+"]"),soe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,aoe=["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"],loe=-1,nn={};nn[at]=nn[ln]=nn[cn]=nn[$n]=nn[Br]=nn[Vr]=nn[mn]=nn[vr]=nn[jn]=!0,nn[xe]=nn[ge]=nn[Ne]=nn[ee]=nn[Ue]=nn[Q]=nn[we]=nn[te]=nn[ae]=nn[Se]=nn[dt]=nn[Gt]=nn[Bt]=nn[gn]=nn[he]=!1;var Yt={};Yt[xe]=Yt[ge]=Yt[Ne]=Yt[Ue]=Yt[ee]=Yt[Q]=Yt[at]=Yt[ln]=Yt[cn]=Yt[$n]=Yt[Br]=Yt[ae]=Yt[Se]=Yt[dt]=Yt[Gt]=Yt[Bt]=Yt[gn]=Yt[Rt]=Yt[Vr]=Yt[mn]=Yt[vr]=Yt[jn]=!0,Yt[we]=Yt[te]=Yt[he]=!1;var coe={À:"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"},uoe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},doe={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},foe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hoe=parseFloat,poe=parseInt,mA=typeof Ho=="object"&&Ho&&Ho.Object===Object&&Ho,goe=typeof self=="object"&&self&&self.Object===Object&&self,zn=mA||goe||Function("return this")(),Qx=t&&!t.nodeType&&t,Qa=Qx&&!0&&e&&!e.nodeType&&e,vA=Qa&&Qa.exports===Qx,Zx=vA&&mA.process,ci=function(){try{var Y=Qa&&Qa.require&&Qa.require("util").types;return Y||Zx&&Zx.binding&&Zx.binding("util")}catch{}}(),bA=ci&&ci.isArrayBuffer,yA=ci&&ci.isDate,xA=ci&&ci.isMap,wA=ci&&ci.isRegExp,_A=ci&&ci.isSet,SA=ci&&ci.isTypedArray;function Hr(Y,me,ce){switch(ce.length){case 0:return Y.call(me);case 1:return Y.call(me,ce[0]);case 2:return Y.call(me,ce[0],ce[1]);case 3:return Y.call(me,ce[0],ce[1],ce[2])}return Y.apply(me,ce)}function moe(Y,me,ce,Fe){for(var tt=-1,Tt=Y==null?0:Y.length;++tt<Tt;){var On=Y[tt];me(Fe,On,ce(On),Y)}return Fe}function ui(Y,me){for(var ce=-1,Fe=Y==null?0:Y.length;++ce<Fe&&me(Y[ce],ce,Y)!==!1;);return Y}function voe(Y,me){for(var ce=Y==null?0:Y.length;ce--&&me(Y[ce],ce,Y)!==!1;);return Y}function CA(Y,me){for(var ce=-1,Fe=Y==null?0:Y.length;++ce<Fe;)if(!me(Y[ce],ce,Y))return!1;return!0}function Ps(Y,me){for(var ce=-1,Fe=Y==null?0:Y.length,tt=0,Tt=[];++ce<Fe;){var On=Y[ce];me(On,ce,Y)&&(Tt[tt++]=On)}return Tt}function Cg(Y,me){var ce=Y==null?0:Y.length;return!!ce&&Sc(Y,me,0)>-1}function Jx(Y,me,ce){for(var Fe=-1,tt=Y==null?0:Y.length;++Fe<tt;)if(ce(me,Y[Fe]))return!0;return!1}function sn(Y,me){for(var ce=-1,Fe=Y==null?0:Y.length,tt=Array(Fe);++ce<Fe;)tt[ce]=me(Y[ce],ce,Y);return tt}function ks(Y,me){for(var ce=-1,Fe=me.length,tt=Y.length;++ce<Fe;)Y[tt+ce]=me[ce];return Y}function e1(Y,me,ce,Fe){var tt=-1,Tt=Y==null?0:Y.length;for(Fe&&Tt&&(ce=Y[++tt]);++tt<Tt;)ce=me(ce,Y[tt],tt,Y);return ce}function boe(Y,me,ce,Fe){var tt=Y==null?0:Y.length;for(Fe&&tt&&(ce=Y[--tt]);tt--;)ce=me(ce,Y[tt],tt,Y);return ce}function t1(Y,me){for(var ce=-1,Fe=Y==null?0:Y.length;++ce<Fe;)if(me(Y[ce],ce,Y))return!0;return!1}var yoe=n1("length");function xoe(Y){return Y.split("")}function woe(Y){return Y.match(G)||[]}function EA(Y,me,ce){var Fe;return ce(Y,function(tt,Tt,On){if(me(tt,Tt,On))return Fe=Tt,!1}),Fe}function Eg(Y,me,ce,Fe){for(var tt=Y.length,Tt=ce+(Fe?1:-1);Fe?Tt--:++Tt<tt;)if(me(Y[Tt],Tt,Y))return Tt;return-1}function Sc(Y,me,ce){return me===me?Ioe(Y,me,ce):Eg(Y,OA,ce)}function _oe(Y,me,ce,Fe){for(var tt=ce-1,Tt=Y.length;++tt<Tt;)if(Fe(Y[tt],me))return tt;return-1}function OA(Y){return Y!==Y}function PA(Y,me){var ce=Y==null?0:Y.length;return ce?i1(Y,me)/ce:A}function n1(Y){return function(me){return me==null?n:me[Y]}}function r1(Y){return function(me){return Y==null?n:Y[me]}}function kA(Y,me,ce,Fe,tt){return tt(Y,function(Tt,On,Ht){ce=Fe?(Fe=!1,Tt):me(ce,Tt,On,Ht)}),ce}function Soe(Y,me){var ce=Y.length;for(Y.sort(me);ce--;)Y[ce]=Y[ce].value;return Y}function i1(Y,me){for(var ce,Fe=-1,tt=Y.length;++Fe<tt;){var Tt=me(Y[Fe]);Tt!==n&&(ce=ce===n?Tt:ce+Tt)}return ce}function o1(Y,me){for(var ce=-1,Fe=Array(Y);++ce<Y;)Fe[ce]=me(ce);return Fe}function Coe(Y,me){return sn(me,function(ce){return[ce,Y[ce]]})}function DA(Y){return Y&&Y.slice(0,IA(Y)+1).replace(Ka,"")}function Wr(Y){return function(me){return Y(me)}}function s1(Y,me){return sn(me,function(ce){return Y[ce]})}function Vd(Y,me){return Y.has(me)}function MA(Y,me){for(var ce=-1,Fe=Y.length;++ce<Fe&&Sc(me,Y[ce],0)>-1;);return ce}function TA(Y,me){for(var ce=Y.length;ce--&&Sc(me,Y[ce],0)>-1;);return ce}function Eoe(Y,me){for(var ce=Y.length,Fe=0;ce--;)Y[ce]===me&&++Fe;return Fe}var Ooe=r1(coe),Poe=r1(uoe);function koe(Y){return"\\"+foe[Y]}function Doe(Y,me){return Y==null?n:Y[me]}function Cc(Y){return ooe.test(Y)}function Moe(Y){return soe.test(Y)}function Toe(Y){for(var me,ce=[];!(me=Y.next()).done;)ce.push(me.value);return ce}function a1(Y){var me=-1,ce=Array(Y.size);return Y.forEach(function(Fe,tt){ce[++me]=[tt,Fe]}),ce}function AA(Y,me){return function(ce){return Y(me(ce))}}function Ds(Y,me){for(var ce=-1,Fe=Y.length,tt=0,Tt=[];++ce<Fe;){var On=Y[ce];(On===me||On===d)&&(Y[ce]=d,Tt[tt++]=ce)}return Tt}function Og(Y){var me=-1,ce=Array(Y.size);return Y.forEach(function(Fe){ce[++me]=Fe}),ce}function Aoe(Y){var me=-1,ce=Array(Y.size);return Y.forEach(function(Fe){ce[++me]=[Fe,Fe]}),ce}function Ioe(Y,me,ce){for(var Fe=ce-1,tt=Y.length;++Fe<tt;)if(Y[Fe]===me)return Fe;return-1}function Noe(Y,me,ce){for(var Fe=ce+1;Fe--;)if(Y[Fe]===me)return Fe;return Fe}function Ec(Y){return Cc(Y)?Loe(Y):yoe(Y)}function ki(Y){return Cc(Y)?Foe(Y):xoe(Y)}function IA(Y){for(var me=Y.length;me--&&jd.test(Y.charAt(me)););return me}var Roe=r1(doe);function Loe(Y){for(var me=Xx.lastIndex=0;Xx.test(Y);)++me;return me}function Foe(Y){return Y.match(Xx)||[]}function $oe(Y){return Y.match(ioe)||[]}var joe=function Y(me){me=me==null?zn:Oc.defaults(zn.Object(),me,Oc.pick(zn,aoe));var ce=me.Array,Fe=me.Date,tt=me.Error,Tt=me.Function,On=me.Math,Ht=me.Object,l1=me.RegExp,zoe=me.String,di=me.TypeError,Pg=ce.prototype,Boe=Tt.prototype,Pc=Ht.prototype,kg=me["__core-js_shared__"],Dg=Boe.toString,$t=Pc.hasOwnProperty,Voe=0,NA=function(){var u=/[^.]+$/.exec(kg&&kg.keys&&kg.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),Mg=Pc.toString,Hoe=Dg.call(Ht),Woe=zn._,Uoe=l1("^"+Dg.call($t).replace(Ga,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tg=vA?me.Buffer:n,Ms=me.Symbol,Ag=me.Uint8Array,RA=Tg?Tg.allocUnsafe:n,Ig=AA(Ht.getPrototypeOf,Ht),LA=Ht.create,FA=Pc.propertyIsEnumerable,Ng=Pg.splice,$A=Ms?Ms.isConcatSpreadable:n,Hd=Ms?Ms.iterator:n,Za=Ms?Ms.toStringTag:n,Rg=function(){try{var u=rl(Ht,"defineProperty");return u({},"",{}),u}catch{}}(),qoe=me.clearTimeout!==zn.clearTimeout&&me.clearTimeout,Goe=Fe&&Fe.now!==zn.Date.now&&Fe.now,Yoe=me.setTimeout!==zn.setTimeout&&me.setTimeout,Lg=On.ceil,Fg=On.floor,c1=Ht.getOwnPropertySymbols,Koe=Tg?Tg.isBuffer:n,jA=me.isFinite,Xoe=Pg.join,Qoe=AA(Ht.keys,Ht),Pn=On.max,Kn=On.min,Zoe=Fe.now,Joe=me.parseInt,zA=On.random,ese=Pg.reverse,u1=rl(me,"DataView"),Wd=rl(me,"Map"),d1=rl(me,"Promise"),kc=rl(me,"Set"),Ud=rl(me,"WeakMap"),qd=rl(Ht,"create"),$g=Ud&&new Ud,Dc={},tse=il(u1),nse=il(Wd),rse=il(d1),ise=il(kc),ose=il(Ud),jg=Ms?Ms.prototype:n,Gd=jg?jg.valueOf:n,BA=jg?jg.toString:n;function N(u){if(hn(u)&&!st(u)&&!(u instanceof Ct)){if(u instanceof fi)return u;if($t.call(u,"__wrapped__"))return VI(u)}return new fi(u)}var Mc=function(){function u(){}return function(h){if(!un(h))return{};if(LA)return LA(h);u.prototype=h;var y=new u;return u.prototype=n,y}}();function zg(){}function fi(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}N.templateSettings={escape:Fd,evaluate:Wa,interpolate:wc,variable:"",imports:{_:N}},N.prototype=zg.prototype,N.prototype.constructor=N,fi.prototype=Mc(zg.prototype),fi.prototype.constructor=fi;function Ct(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function sse(){var u=new Ct(this.__wrapped__);return u.__actions__=br(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=br(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=br(this.__views__),u}function ase(){if(this.__filtered__){var u=new Ct(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function lse(){var u=this.__wrapped__.value(),h=this.__dir__,y=st(u),E=h<0,M=y?u.length:0,L=xae(0,M,this.__views__),z=L.start,U=L.end,Z=U-z,be=E?U:z-1,ye=this.__iteratees__,Ce=ye.length,Ae=0,ze=Kn(Z,this.__takeCount__);if(!y||!E&&M==Z&&ze==Z)return dI(u,this.__actions__);var Ye=[];e:for(;Z--&&Ae<ze;){be+=h;for(var mt=-1,Ke=u[be];++mt<Ce;){var St=ye[mt],Et=St.iteratee,Gr=St.type,rr=Et(Ke);if(Gr==$)Ke=rr;else if(!rr){if(Gr==J)continue e;break e}}Ye[Ae++]=Ke}return Ye}Ct.prototype=Mc(zg.prototype),Ct.prototype.constructor=Ct;function Ja(u){var h=-1,y=u==null?0:u.length;for(this.clear();++h<y;){var E=u[h];this.set(E[0],E[1])}}function cse(){this.__data__=qd?qd(null):{},this.size=0}function use(u){var h=this.has(u)&&delete this.__data__[u];return this.size-=h?1:0,h}function dse(u){var h=this.__data__;if(qd){var y=h[u];return y===l?n:y}return $t.call(h,u)?h[u]:n}function fse(u){var h=this.__data__;return qd?h[u]!==n:$t.call(h,u)}function hse(u,h){var y=this.__data__;return this.size+=this.has(u)?0:1,y[u]=qd&&h===n?l:h,this}Ja.prototype.clear=cse,Ja.prototype.delete=use,Ja.prototype.get=dse,Ja.prototype.has=fse,Ja.prototype.set=hse;function Io(u){var h=-1,y=u==null?0:u.length;for(this.clear();++h<y;){var E=u[h];this.set(E[0],E[1])}}function pse(){this.__data__=[],this.size=0}function gse(u){var h=this.__data__,y=Bg(h,u);if(y<0)return!1;var E=h.length-1;return y==E?h.pop():Ng.call(h,y,1),--this.size,!0}function mse(u){var h=this.__data__,y=Bg(h,u);return y<0?n:h[y][1]}function vse(u){return Bg(this.__data__,u)>-1}function bse(u,h){var y=this.__data__,E=Bg(y,u);return E<0?(++this.size,y.push([u,h])):y[E][1]=h,this}Io.prototype.clear=pse,Io.prototype.delete=gse,Io.prototype.get=mse,Io.prototype.has=vse,Io.prototype.set=bse;function No(u){var h=-1,y=u==null?0:u.length;for(this.clear();++h<y;){var E=u[h];this.set(E[0],E[1])}}function yse(){this.size=0,this.__data__={hash:new Ja,map:new(Wd||Io),string:new Ja}}function xse(u){var h=Jg(this,u).delete(u);return this.size-=h?1:0,h}function wse(u){return Jg(this,u).get(u)}function _se(u){return Jg(this,u).has(u)}function Sse(u,h){var y=Jg(this,u),E=y.size;return y.set(u,h),this.size+=y.size==E?0:1,this}No.prototype.clear=yse,No.prototype.delete=xse,No.prototype.get=wse,No.prototype.has=_se,No.prototype.set=Sse;function el(u){var h=-1,y=u==null?0:u.length;for(this.__data__=new No;++h<y;)this.add(u[h])}function Cse(u){return this.__data__.set(u,l),this}function Ese(u){return this.__data__.has(u)}el.prototype.add=el.prototype.push=Cse,el.prototype.has=Ese;function Di(u){var h=this.__data__=new Io(u);this.size=h.size}function Ose(){this.__data__=new Io,this.size=0}function Pse(u){var h=this.__data__,y=h.delete(u);return this.size=h.size,y}function kse(u){return this.__data__.get(u)}function Dse(u){return this.__data__.has(u)}function Mse(u,h){var y=this.__data__;if(y instanceof Io){var E=y.__data__;if(!Wd||E.length<i-1)return E.push([u,h]),this.size=++y.size,this;y=this.__data__=new No(E)}return y.set(u,h),this.size=y.size,this}Di.prototype.clear=Ose,Di.prototype.delete=Pse,Di.prototype.get=kse,Di.prototype.has=Dse,Di.prototype.set=Mse;function VA(u,h){var y=st(u),E=!y&&ol(u),M=!y&&!E&&Rs(u),L=!y&&!E&&!M&&Nc(u),z=y||E||M||L,U=z?o1(u.length,zoe):[],Z=U.length;for(var be in u)(h||$t.call(u,be))&&!(z&&(be=="length"||M&&(be=="offset"||be=="parent")||L&&(be=="buffer"||be=="byteLength"||be=="byteOffset")||$o(be,Z)))&&U.push(be);return U}function HA(u){var h=u.length;return h?u[_1(0,h-1)]:n}function Tse(u,h){return em(br(u),tl(h,0,u.length))}function Ase(u){return em(br(u))}function f1(u,h,y){(y!==n&&!Mi(u[h],y)||y===n&&!(h in u))&&Ro(u,h,y)}function Yd(u,h,y){var E=u[h];(!($t.call(u,h)&&Mi(E,y))||y===n&&!(h in u))&&Ro(u,h,y)}function Bg(u,h){for(var y=u.length;y--;)if(Mi(u[y][0],h))return y;return-1}function Ise(u,h,y,E){return Ts(u,function(M,L,z){h(E,M,y(M),z)}),E}function WA(u,h){return u&&ro(h,An(h),u)}function Nse(u,h){return u&&ro(h,xr(h),u)}function Ro(u,h,y){h=="__proto__"&&Rg?Rg(u,h,{configurable:!0,enumerable:!0,value:y,writable:!0}):u[h]=y}function h1(u,h){for(var y=-1,E=h.length,M=ce(E),L=u==null;++y<E;)M[y]=L?n:G1(u,h[y]);return M}function tl(u,h,y){return u===u&&(y!==n&&(u=u<=y?u:y),h!==n&&(u=u>=h?u:h)),u}function hi(u,h,y,E,M,L){var z,U=h&f,Z=h&g,be=h&p;if(y&&(z=M?y(u,E,M,L):y(u)),z!==n)return z;if(!un(u))return u;var ye=st(u);if(ye){if(z=_ae(u),!U)return br(u,z)}else{var Ce=Xn(u),Ae=Ce==te||Ce==Ie;if(Rs(u))return pI(u,U);if(Ce==dt||Ce==xe||Ae&&!M){if(z=Z||Ae?{}:II(u),!U)return Z?dae(u,Nse(z,u)):uae(u,WA(z,u))}else{if(!Yt[Ce])return M?u:{};z=Sae(u,Ce,U)}}L||(L=new Di);var ze=L.get(u);if(ze)return ze;L.set(u,z),lN(u)?u.forEach(function(Ke){z.add(hi(Ke,h,y,Ke,u,L))}):sN(u)&&u.forEach(function(Ke,St){z.set(St,hi(Ke,h,y,St,u,L))});var Ye=be?Z?I1:A1:Z?xr:An,mt=ye?n:Ye(u);return ui(mt||u,function(Ke,St){mt&&(St=Ke,Ke=u[St]),Yd(z,St,hi(Ke,h,y,St,u,L))}),z}function Rse(u){var h=An(u);return function(y){return UA(y,u,h)}}function UA(u,h,y){var E=y.length;if(u==null)return!E;for(u=Ht(u);E--;){var M=y[E],L=h[M],z=u[M];if(z===n&&!(M in u)||!L(z))return!1}return!0}function qA(u,h,y){if(typeof u!="function")throw new di(s);return tf(function(){u.apply(n,y)},h)}function Kd(u,h,y,E){var M=-1,L=Cg,z=!0,U=u.length,Z=[],be=h.length;if(!U)return Z;y&&(h=sn(h,Wr(y))),E?(L=Jx,z=!1):h.length>=i&&(L=Vd,z=!1,h=new el(h));e:for(;++M<U;){var ye=u[M],Ce=y==null?ye:y(ye);if(ye=E||ye!==0?ye:0,z&&Ce===Ce){for(var Ae=be;Ae--;)if(h[Ae]===Ce)continue e;Z.push(ye)}else L(h,Ce,E)||Z.push(ye)}return Z}var Ts=yI(no),GA=yI(g1,!0);function Lse(u,h){var y=!0;return Ts(u,function(E,M,L){return y=!!h(E,M,L),y}),y}function Vg(u,h,y){for(var E=-1,M=u.length;++E<M;){var L=u[E],z=h(L);if(z!=null&&(U===n?z===z&&!qr(z):y(z,U)))var U=z,Z=L}return Z}function Fse(u,h,y,E){var M=u.length;for(y=ft(y),y<0&&(y=-y>M?0:M+y),E=E===n||E>M?M:ft(E),E<0&&(E+=M),E=y>E?0:uN(E);y<E;)u[y++]=h;return u}function YA(u,h){var y=[];return Ts(u,function(E,M,L){h(E,M,L)&&y.push(E)}),y}function Bn(u,h,y,E,M){var L=-1,z=u.length;for(y||(y=Eae),M||(M=[]);++L<z;){var U=u[L];h>0&&y(U)?h>1?Bn(U,h-1,y,E,M):ks(M,U):E||(M[M.length]=U)}return M}var p1=xI(),KA=xI(!0);function no(u,h){return u&&p1(u,h,An)}function g1(u,h){return u&&KA(u,h,An)}function Hg(u,h){return Ps(h,function(y){return jo(u[y])})}function nl(u,h){h=Is(h,u);for(var y=0,E=h.length;u!=null&&y<E;)u=u[io(h[y++])];return y&&y==E?u:n}function XA(u,h,y){var E=h(u);return st(u)?E:ks(E,y(u))}function tr(u){return u==null?u===n?mr:We:Za&&Za in Ht(u)?yae(u):Aae(u)}function m1(u,h){return u>h}function $se(u,h){return u!=null&&$t.call(u,h)}function jse(u,h){return u!=null&&h in Ht(u)}function zse(u,h,y){return u>=Kn(h,y)&&u<Pn(h,y)}function v1(u,h,y){for(var E=y?Jx:Cg,M=u[0].length,L=u.length,z=L,U=ce(L),Z=1/0,be=[];z--;){var ye=u[z];z&&h&&(ye=sn(ye,Wr(h))),Z=Kn(ye.length,Z),U[z]=!y&&(h||M>=120&&ye.length>=120)?new el(z&&ye):n}ye=u[0];var Ce=-1,Ae=U[0];e:for(;++Ce<M&&be.length<Z;){var ze=ye[Ce],Ye=h?h(ze):ze;if(ze=y||ze!==0?ze:0,!(Ae?Vd(Ae,Ye):E(be,Ye,y))){for(z=L;--z;){var mt=U[z];if(!(mt?Vd(mt,Ye):E(u[z],Ye,y)))continue e}Ae&&Ae.push(Ye),be.push(ze)}}return be}function Bse(u,h,y,E){return no(u,function(M,L,z){h(E,y(M),L,z)}),E}function Xd(u,h,y){h=Is(h,u),u=FI(u,h);var E=u==null?u:u[io(gi(h))];return E==null?n:Hr(E,u,y)}function QA(u){return hn(u)&&tr(u)==xe}function Vse(u){return hn(u)&&tr(u)==Ne}function Hse(u){return hn(u)&&tr(u)==Q}function Qd(u,h,y,E,M){return u===h?!0:u==null||h==null||!hn(u)&&!hn(h)?u!==u&&h!==h:Wse(u,h,y,E,Qd,M)}function Wse(u,h,y,E,M,L){var z=st(u),U=st(h),Z=z?ge:Xn(u),be=U?ge:Xn(h);Z=Z==xe?dt:Z,be=be==xe?dt:be;var ye=Z==dt,Ce=be==dt,Ae=Z==be;if(Ae&&Rs(u)){if(!Rs(h))return!1;z=!0,ye=!1}if(Ae&&!ye)return L||(L=new Di),z||Nc(u)?MI(u,h,y,E,M,L):vae(u,h,Z,y,E,M,L);if(!(y&v)){var ze=ye&&$t.call(u,"__wrapped__"),Ye=Ce&&$t.call(h,"__wrapped__");if(ze||Ye){var mt=ze?u.value():u,Ke=Ye?h.value():h;return L||(L=new Di),M(mt,Ke,y,E,L)}}return Ae?(L||(L=new Di),bae(u,h,y,E,M,L)):!1}function Use(u){return hn(u)&&Xn(u)==ae}function b1(u,h,y,E){var M=y.length,L=M,z=!E;if(u==null)return!L;for(u=Ht(u);M--;){var U=y[M];if(z&&U[2]?U[1]!==u[U[0]]:!(U[0]in u))return!1}for(;++M<L;){U=y[M];var Z=U[0],be=u[Z],ye=U[1];if(z&&U[2]){if(be===n&&!(Z in u))return!1}else{var Ce=new Di;if(E)var Ae=E(be,ye,Z,u,h,Ce);if(!(Ae===n?Qd(ye,be,v|b,E,Ce):Ae))return!1}}return!0}function ZA(u){if(!un(u)||Pae(u))return!1;var h=jo(u)?Uoe:Pt;return h.test(il(u))}function qse(u){return hn(u)&&tr(u)==Gt}function Gse(u){return hn(u)&&Xn(u)==Bt}function Yse(u){return hn(u)&&sm(u.length)&&!!nn[tr(u)]}function JA(u){return typeof u=="function"?u:u==null?wr:typeof u=="object"?st(u)?nI(u[0],u[1]):tI(u):wN(u)}function y1(u){if(!ef(u))return Qoe(u);var h=[];for(var y in Ht(u))$t.call(u,y)&&y!="constructor"&&h.push(y);return h}function Kse(u){if(!un(u))return Tae(u);var h=ef(u),y=[];for(var E in u)E=="constructor"&&(h||!$t.call(u,E))||y.push(E);return y}function x1(u,h){return u<h}function eI(u,h){var y=-1,E=yr(u)?ce(u.length):[];return Ts(u,function(M,L,z){E[++y]=h(M,L,z)}),E}function tI(u){var h=R1(u);return h.length==1&&h[0][2]?RI(h[0][0],h[0][1]):function(y){return y===u||b1(y,u,h)}}function nI(u,h){return F1(u)&&NI(h)?RI(io(u),h):function(y){var E=G1(y,u);return E===n&&E===h?Y1(y,u):Qd(h,E,v|b)}}function Wg(u,h,y,E,M){u!==h&&p1(h,function(L,z){if(M||(M=new Di),un(L))Xse(u,h,z,y,Wg,E,M);else{var U=E?E(j1(u,z),L,z+"",u,h,M):n;U===n&&(U=L),f1(u,z,U)}},xr)}function Xse(u,h,y,E,M,L,z){var U=j1(u,y),Z=j1(h,y),be=z.get(Z);if(be){f1(u,y,be);return}var ye=L?L(U,Z,y+"",u,h,z):n,Ce=ye===n;if(Ce){var Ae=st(Z),ze=!Ae&&Rs(Z),Ye=!Ae&&!ze&&Nc(Z);ye=Z,Ae||ze||Ye?st(U)?ye=U:vn(U)?ye=br(U):ze?(Ce=!1,ye=pI(Z,!0)):Ye?(Ce=!1,ye=gI(Z,!0)):ye=[]:nf(Z)||ol(Z)?(ye=U,ol(U)?ye=dN(U):(!un(U)||jo(U))&&(ye=II(Z))):Ce=!1}Ce&&(z.set(Z,ye),M(ye,Z,E,L,z),z.delete(Z)),f1(u,y,ye)}function rI(u,h){var y=u.length;if(y)return h+=h<0?y:0,$o(h,y)?u[h]:n}function iI(u,h,y){h.length?h=sn(h,function(L){return st(L)?function(z){return nl(z,L.length===1?L[0]:L)}:L}):h=[wr];var E=-1;h=sn(h,Wr(Ge()));var M=eI(u,function(L,z,U){var Z=sn(h,function(be){return be(L)});return{criteria:Z,index:++E,value:L}});return Soe(M,function(L,z){return cae(L,z,y)})}function Qse(u,h){return oI(u,h,function(y,E){return Y1(u,E)})}function oI(u,h,y){for(var E=-1,M=h.length,L={};++E<M;){var z=h[E],U=nl(u,z);y(U,z)&&Zd(L,Is(z,u),U)}return L}function Zse(u){return function(h){return nl(h,u)}}function w1(u,h,y,E){var M=E?_oe:Sc,L=-1,z=h.length,U=u;for(u===h&&(h=br(h)),y&&(U=sn(u,Wr(y)));++L<z;)for(var Z=0,be=h[L],ye=y?y(be):be;(Z=M(U,ye,Z,E))>-1;)U!==u&&Ng.call(U,Z,1),Ng.call(u,Z,1);return u}function sI(u,h){for(var y=u?h.length:0,E=y-1;y--;){var M=h[y];if(y==E||M!==L){var L=M;$o(M)?Ng.call(u,M,1):E1(u,M)}}return u}function _1(u,h){return u+Fg(zA()*(h-u+1))}function Jse(u,h,y,E){for(var M=-1,L=Pn(Lg((h-u)/(y||1)),0),z=ce(L);L--;)z[E?L:++M]=u,u+=y;return z}function S1(u,h){var y="";if(!u||h<1||h>ne)return y;do h%2&&(y+=u),h=Fg(h/2),h&&(u+=u);while(h);return y}function vt(u,h){return z1(LI(u,h,wr),u+"")}function eae(u){return HA(Rc(u))}function tae(u,h){var y=Rc(u);return em(y,tl(h,0,y.length))}function Zd(u,h,y,E){if(!un(u))return u;h=Is(h,u);for(var M=-1,L=h.length,z=L-1,U=u;U!=null&&++M<L;){var Z=io(h[M]),be=y;if(Z==="__proto__"||Z==="constructor"||Z==="prototype")return u;if(M!=z){var ye=U[Z];be=E?E(ye,Z,U):n,be===n&&(be=un(ye)?ye:$o(h[M+1])?[]:{})}Yd(U,Z,be),U=U[Z]}return u}var aI=$g?function(u,h){return $g.set(u,h),u}:wr,nae=Rg?function(u,h){return Rg(u,"toString",{configurable:!0,enumerable:!1,value:X1(h),writable:!0})}:wr;function rae(u){return em(Rc(u))}function pi(u,h,y){var E=-1,M=u.length;h<0&&(h=-h>M?0:M+h),y=y>M?M:y,y<0&&(y+=M),M=h>y?0:y-h>>>0,h>>>=0;for(var L=ce(M);++E<M;)L[E]=u[E+h];return L}function iae(u,h){var y;return Ts(u,function(E,M,L){return y=h(E,M,L),!y}),!!y}function Ug(u,h,y){var E=0,M=u==null?E:u.length;if(typeof h=="number"&&h===h&&M<=R){for(;E<M;){var L=E+M>>>1,z=u[L];z!==null&&!qr(z)&&(y?z<=h:z<h)?E=L+1:M=L}return M}return C1(u,h,wr,y)}function C1(u,h,y,E){var M=0,L=u==null?0:u.length;if(L===0)return 0;h=y(h);for(var z=h!==h,U=h===null,Z=qr(h),be=h===n;M<L;){var ye=Fg((M+L)/2),Ce=y(u[ye]),Ae=Ce!==n,ze=Ce===null,Ye=Ce===Ce,mt=qr(Ce);if(z)var Ke=E||Ye;else be?Ke=Ye&&(E||Ae):U?Ke=Ye&&Ae&&(E||!ze):Z?Ke=Ye&&Ae&&!ze&&(E||!mt):ze||mt?Ke=!1:Ke=E?Ce<=h:Ce<h;Ke?M=ye+1:L=ye}return Kn(L,re)}function lI(u,h){for(var y=-1,E=u.length,M=0,L=[];++y<E;){var z=u[y],U=h?h(z):z;if(!y||!Mi(U,Z)){var Z=U;L[M++]=z===0?0:z}}return L}function cI(u){return typeof u=="number"?u:qr(u)?A:+u}function Ur(u){if(typeof u=="string")return u;if(st(u))return sn(u,Ur)+"";if(qr(u))return BA?BA.call(u):"";var h=u+"";return h=="0"&&1/u==-W?"-0":h}function As(u,h,y){var E=-1,M=Cg,L=u.length,z=!0,U=[],Z=U;if(y)z=!1,M=Jx;else if(L>=i){var be=h?null:gae(u);if(be)return Og(be);z=!1,M=Vd,Z=new el}else Z=h?[]:U;e:for(;++E<L;){var ye=u[E],Ce=h?h(ye):ye;if(ye=y||ye!==0?ye:0,z&&Ce===Ce){for(var Ae=Z.length;Ae--;)if(Z[Ae]===Ce)continue e;h&&Z.push(Ce),U.push(ye)}else M(Z,Ce,y)||(Z!==U&&Z.push(Ce),U.push(ye))}return U}function E1(u,h){return h=Is(h,u),u=FI(u,h),u==null||delete u[io(gi(h))]}function uI(u,h,y,E){return Zd(u,h,y(nl(u,h)),E)}function qg(u,h,y,E){for(var M=u.length,L=E?M:-1;(E?L--:++L<M)&&h(u[L],L,u););return y?pi(u,E?0:L,E?L+1:M):pi(u,E?L+1:0,E?M:L)}function dI(u,h){var y=u;return y instanceof Ct&&(y=y.value()),e1(h,function(E,M){return M.func.apply(M.thisArg,ks([E],M.args))},y)}function O1(u,h,y){var E=u.length;if(E<2)return E?As(u[0]):[];for(var M=-1,L=ce(E);++M<E;)for(var z=u[M],U=-1;++U<E;)U!=M&&(L[M]=Kd(L[M]||z,u[U],h,y));return As(Bn(L,1),h,y)}function fI(u,h,y){for(var E=-1,M=u.length,L=h.length,z={};++E<M;){var U=E<L?h[E]:n;y(z,u[E],U)}return z}function P1(u){return vn(u)?u:[]}function k1(u){return typeof u=="function"?u:wr}function Is(u,h){return st(u)?u:F1(u,h)?[u]:BI(Lt(u))}var oae=vt;function Ns(u,h,y){var E=u.length;return y=y===n?E:y,!h&&y>=E?u:pi(u,h,y)}var hI=qoe||function(u){return zn.clearTimeout(u)};function pI(u,h){if(h)return u.slice();var y=u.length,E=RA?RA(y):new u.constructor(y);return u.copy(E),E}function D1(u){var h=new u.constructor(u.byteLength);return new Ag(h).set(new Ag(u)),h}function sae(u,h){var y=h?D1(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.byteLength)}function aae(u){var h=new u.constructor(u.source,Be.exec(u));return h.lastIndex=u.lastIndex,h}function lae(u){return Gd?Ht(Gd.call(u)):{}}function gI(u,h){var y=h?D1(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.length)}function mI(u,h){if(u!==h){var y=u!==n,E=u===null,M=u===u,L=qr(u),z=h!==n,U=h===null,Z=h===h,be=qr(h);if(!U&&!be&&!L&&u>h||L&&z&&Z&&!U&&!be||E&&z&&Z||!y&&Z||!M)return 1;if(!E&&!L&&!be&&u<h||be&&y&&M&&!E&&!L||U&&y&&M||!z&&M||!Z)return-1}return 0}function cae(u,h,y){for(var E=-1,M=u.criteria,L=h.criteria,z=M.length,U=y.length;++E<z;){var Z=mI(M[E],L[E]);if(Z){if(E>=U)return Z;var be=y[E];return Z*(be=="desc"?-1:1)}}return u.index-h.index}function vI(u,h,y,E){for(var M=-1,L=u.length,z=y.length,U=-1,Z=h.length,be=Pn(L-z,0),ye=ce(Z+be),Ce=!E;++U<Z;)ye[U]=h[U];for(;++M<z;)(Ce||M<L)&&(ye[y[M]]=u[M]);for(;be--;)ye[U++]=u[M++];return ye}function bI(u,h,y,E){for(var M=-1,L=u.length,z=-1,U=y.length,Z=-1,be=h.length,ye=Pn(L-U,0),Ce=ce(ye+be),Ae=!E;++M<ye;)Ce[M]=u[M];for(var ze=M;++Z<be;)Ce[ze+Z]=h[Z];for(;++z<U;)(Ae||M<L)&&(Ce[ze+y[z]]=u[M++]);return Ce}function br(u,h){var y=-1,E=u.length;for(h||(h=ce(E));++y<E;)h[y]=u[y];return h}function ro(u,h,y,E){var M=!y;y||(y={});for(var L=-1,z=h.length;++L<z;){var U=h[L],Z=E?E(y[U],u[U],U,y,u):n;Z===n&&(Z=u[U]),M?Ro(y,U,Z):Yd(y,U,Z)}return y}function uae(u,h){return ro(u,L1(u),h)}function dae(u,h){return ro(u,TI(u),h)}function Gg(u,h){return function(y,E){var M=st(y)?moe:Ise,L=h?h():{};return M(y,u,Ge(E,2),L)}}function Tc(u){return vt(function(h,y){var E=-1,M=y.length,L=M>1?y[M-1]:n,z=M>2?y[2]:n;for(L=u.length>3&&typeof L=="function"?(M--,L):n,z&&nr(y[0],y[1],z)&&(L=M<3?n:L,M=1),h=Ht(h);++E<M;){var U=y[E];U&&u(h,U,E,L)}return h})}function yI(u,h){return function(y,E){if(y==null)return y;if(!yr(y))return u(y,E);for(var M=y.length,L=h?M:-1,z=Ht(y);(h?L--:++L<M)&&E(z[L],L,z)!==!1;);return y}}function xI(u){return function(h,y,E){for(var M=-1,L=Ht(h),z=E(h),U=z.length;U--;){var Z=z[u?U:++M];if(y(L[Z],Z,L)===!1)break}return h}}function fae(u,h,y){var E=h&x,M=Jd(u);function L(){var z=this&&this!==zn&&this instanceof L?M:u;return z.apply(E?y:this,arguments)}return L}function wI(u){return function(h){h=Lt(h);var y=Cc(h)?ki(h):n,E=y?y[0]:h.charAt(0),M=y?Ns(y,1).join(""):h.slice(1);return E[u]()+M}}function Ac(u){return function(h){return e1(yN(bN(h).replace(noe,"")),u,"")}}function Jd(u){return function(){var h=arguments;switch(h.length){case 0:return new u;case 1:return new u(h[0]);case 2:return new u(h[0],h[1]);case 3:return new u(h[0],h[1],h[2]);case 4:return new u(h[0],h[1],h[2],h[3]);case 5:return new u(h[0],h[1],h[2],h[3],h[4]);case 6:return new u(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new u(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var y=Mc(u.prototype),E=u.apply(y,h);return un(E)?E:y}}function hae(u,h,y){var E=Jd(u);function M(){for(var L=arguments.length,z=ce(L),U=L,Z=Ic(M);U--;)z[U]=arguments[U];var be=L<3&&z[0]!==Z&&z[L-1]!==Z?[]:Ds(z,Z);if(L-=be.length,L<y)return OI(u,h,Yg,M.placeholder,n,z,be,n,n,y-L);var ye=this&&this!==zn&&this instanceof M?E:u;return Hr(ye,this,z)}return M}function _I(u){return function(h,y,E){var M=Ht(h);if(!yr(h)){var L=Ge(y,3);h=An(h),y=function(U){return L(M[U],U,M)}}var z=u(h,y,E);return z>-1?M[L?h[z]:z]:n}}function SI(u){return Fo(function(h){var y=h.length,E=y,M=fi.prototype.thru;for(u&&h.reverse();E--;){var L=h[E];if(typeof L!="function")throw new di(s);if(M&&!z&&Zg(L)=="wrapper")var z=new fi([],!0)}for(E=z?E:y;++E<y;){L=h[E];var U=Zg(L),Z=U=="wrapper"?N1(L):n;Z&&$1(Z[0])&&Z[1]==(T|C|O|I)&&!Z[4].length&&Z[9]==1?z=z[Zg(Z[0])].apply(z,Z[3]):z=L.length==1&&$1(L)?z[U]():z.thru(L)}return function(){var be=arguments,ye=be[0];if(z&&be.length==1&&st(ye))return z.plant(ye).value();for(var Ce=0,Ae=y?h[Ce].apply(this,be):ye;++Ce<y;)Ae=h[Ce].call(this,Ae);return Ae}})}function Yg(u,h,y,E,M,L,z,U,Z,be){var ye=h&T,Ce=h&x,Ae=h&w,ze=h&(C|P),Ye=h&F,mt=Ae?n:Jd(u);function Ke(){for(var St=arguments.length,Et=ce(St),Gr=St;Gr--;)Et[Gr]=arguments[Gr];if(ze)var rr=Ic(Ke),Yr=Eoe(Et,rr);if(E&&(Et=vI(Et,E,M,ze)),L&&(Et=bI(Et,L,z,ze)),St-=Yr,ze&&St<be){var bn=Ds(Et,rr);return OI(u,h,Yg,Ke.placeholder,y,Et,bn,U,Z,be-St)}var Ti=Ce?y:this,Bo=Ae?Ti[u]:u;return St=Et.length,U?Et=Iae(Et,U):Ye&&St>1&&Et.reverse(),ye&&Z<St&&(Et.length=Z),this&&this!==zn&&this instanceof Ke&&(Bo=mt||Jd(Bo)),Bo.apply(Ti,Et)}return Ke}function CI(u,h){return function(y,E){return Bse(y,u,h(E),{})}}function Kg(u,h){return function(y,E){var M;if(y===n&&E===n)return h;if(y!==n&&(M=y),E!==n){if(M===n)return E;typeof y=="string"||typeof E=="string"?(y=Ur(y),E=Ur(E)):(y=cI(y),E=cI(E)),M=u(y,E)}return M}}function M1(u){return Fo(function(h){return h=sn(h,Wr(Ge())),vt(function(y){var E=this;return u(h,function(M){return Hr(M,E,y)})})})}function Xg(u,h){h=h===n?" ":Ur(h);var y=h.length;if(y<2)return y?S1(h,u):h;var E=S1(h,Lg(u/Ec(h)));return Cc(h)?Ns(ki(E),0,u).join(""):E.slice(0,u)}function pae(u,h,y,E){var M=h&x,L=Jd(u);function z(){for(var U=-1,Z=arguments.length,be=-1,ye=E.length,Ce=ce(ye+Z),Ae=this&&this!==zn&&this instanceof z?L:u;++be<ye;)Ce[be]=E[be];for(;Z--;)Ce[be++]=arguments[++U];return Hr(Ae,M?y:this,Ce)}return z}function EI(u){return function(h,y,E){return E&&typeof E!="number"&&nr(h,y,E)&&(y=E=n),h=zo(h),y===n?(y=h,h=0):y=zo(y),E=E===n?h<y?1:-1:zo(E),Jse(h,y,E,u)}}function Qg(u){return function(h,y){return typeof h=="string"&&typeof y=="string"||(h=mi(h),y=mi(y)),u(h,y)}}function OI(u,h,y,E,M,L,z,U,Z,be){var ye=h&C,Ce=ye?z:n,Ae=ye?n:z,ze=ye?L:n,Ye=ye?n:L;h|=ye?O:k,h&=~(ye?k:O),h&S||(h&=~(x|w));var mt=[u,h,M,ze,Ce,Ye,Ae,U,Z,be],Ke=y.apply(n,mt);return $1(u)&&$I(Ke,mt),Ke.placeholder=E,jI(Ke,u,h)}function T1(u){var h=On[u];return function(y,E){if(y=mi(y),E=E==null?0:Kn(ft(E),292),E&&jA(y)){var M=(Lt(y)+"e").split("e"),L=h(M[0]+"e"+(+M[1]+E));return M=(Lt(L)+"e").split("e"),+(M[0]+"e"+(+M[1]-E))}return h(y)}}var gae=kc&&1/Og(new kc([,-0]))[1]==W?function(u){return new kc(u)}:J1;function PI(u){return function(h){var y=Xn(h);return y==ae?a1(h):y==Bt?Aoe(h):Coe(h,u(h))}}function Lo(u,h,y,E,M,L,z,U){var Z=h&w;if(!Z&&typeof u!="function")throw new di(s);var be=E?E.length:0;if(be||(h&=~(O|k),E=M=n),z=z===n?z:Pn(ft(z),0),U=U===n?U:ft(U),be-=M?M.length:0,h&k){var ye=E,Ce=M;E=M=n}var Ae=Z?n:N1(u),ze=[u,h,y,E,M,ye,Ce,L,z,U];if(Ae&&Mae(ze,Ae),u=ze[0],h=ze[1],y=ze[2],E=ze[3],M=ze[4],U=ze[9]=ze[9]===n?Z?0:u.length:Pn(ze[9]-be,0),!U&&h&(C|P)&&(h&=~(C|P)),!h||h==x)var Ye=fae(u,h,y);else h==C||h==P?Ye=hae(u,h,U):(h==O||h==(x|O))&&!M.length?Ye=pae(u,h,y,E):Ye=Yg.apply(n,ze);var mt=Ae?aI:$I;return jI(mt(Ye,ze),u,h)}function kI(u,h,y,E){return u===n||Mi(u,Pc[y])&&!$t.call(E,y)?h:u}function DI(u,h,y,E,M,L){return un(u)&&un(h)&&(L.set(h,u),Wg(u,h,n,DI,L),L.delete(h)),u}function mae(u){return nf(u)?n:u}function MI(u,h,y,E,M,L){var z=y&v,U=u.length,Z=h.length;if(U!=Z&&!(z&&Z>U))return!1;var be=L.get(u),ye=L.get(h);if(be&&ye)return be==h&&ye==u;var Ce=-1,Ae=!0,ze=y&b?new el:n;for(L.set(u,h),L.set(h,u);++Ce<U;){var Ye=u[Ce],mt=h[Ce];if(E)var Ke=z?E(mt,Ye,Ce,h,u,L):E(Ye,mt,Ce,u,h,L);if(Ke!==n){if(Ke)continue;Ae=!1;break}if(ze){if(!t1(h,function(St,Et){if(!Vd(ze,Et)&&(Ye===St||M(Ye,St,y,E,L)))return ze.push(Et)})){Ae=!1;break}}else if(!(Ye===mt||M(Ye,mt,y,E,L))){Ae=!1;break}}return L.delete(u),L.delete(h),Ae}function vae(u,h,y,E,M,L,z){switch(y){case Ue:if(u.byteLength!=h.byteLength||u.byteOffset!=h.byteOffset)return!1;u=u.buffer,h=h.buffer;case Ne:return!(u.byteLength!=h.byteLength||!L(new Ag(u),new Ag(h)));case ee:case Q:case Se:return Mi(+u,+h);case we:return u.name==h.name&&u.message==h.message;case Gt:case gn:return u==h+"";case ae:var U=a1;case Bt:var Z=E&v;if(U||(U=Og),u.size!=h.size&&!Z)return!1;var be=z.get(u);if(be)return be==h;E|=b,z.set(u,h);var ye=MI(U(u),U(h),E,M,L,z);return z.delete(u),ye;case Rt:if(Gd)return Gd.call(u)==Gd.call(h)}return!1}function bae(u,h,y,E,M,L){var z=y&v,U=A1(u),Z=U.length,be=A1(h),ye=be.length;if(Z!=ye&&!z)return!1;for(var Ce=Z;Ce--;){var Ae=U[Ce];if(!(z?Ae in h:$t.call(h,Ae)))return!1}var ze=L.get(u),Ye=L.get(h);if(ze&&Ye)return ze==h&&Ye==u;var mt=!0;L.set(u,h),L.set(h,u);for(var Ke=z;++Ce<Z;){Ae=U[Ce];var St=u[Ae],Et=h[Ae];if(E)var Gr=z?E(Et,St,Ae,h,u,L):E(St,Et,Ae,u,h,L);if(!(Gr===n?St===Et||M(St,Et,y,E,L):Gr)){mt=!1;break}Ke||(Ke=Ae=="constructor")}if(mt&&!Ke){var rr=u.constructor,Yr=h.constructor;rr!=Yr&&"constructor"in u&&"constructor"in h&&!(typeof rr=="function"&&rr instanceof rr&&typeof Yr=="function"&&Yr instanceof Yr)&&(mt=!1)}return L.delete(u),L.delete(h),mt}function Fo(u){return z1(LI(u,n,UI),u+"")}function A1(u){return XA(u,An,L1)}function I1(u){return XA(u,xr,TI)}var N1=$g?function(u){return $g.get(u)}:J1;function Zg(u){for(var h=u.name+"",y=Dc[h],E=$t.call(Dc,h)?y.length:0;E--;){var M=y[E],L=M.func;if(L==null||L==u)return M.name}return h}function Ic(u){var h=$t.call(N,"placeholder")?N:u;return h.placeholder}function Ge(){var u=N.iteratee||Q1;return u=u===Q1?JA:u,arguments.length?u(arguments[0],arguments[1]):u}function Jg(u,h){var y=u.__data__;return Oae(h)?y[typeof h=="string"?"string":"hash"]:y.map}function R1(u){for(var h=An(u),y=h.length;y--;){var E=h[y],M=u[E];h[y]=[E,M,NI(M)]}return h}function rl(u,h){var y=Doe(u,h);return ZA(y)?y:n}function yae(u){var h=$t.call(u,Za),y=u[Za];try{u[Za]=n;var E=!0}catch{}var M=Mg.call(u);return E&&(h?u[Za]=y:delete u[Za]),M}var L1=c1?function(u){return u==null?[]:(u=Ht(u),Ps(c1(u),function(h){return FA.call(u,h)}))}:ew,TI=c1?function(u){for(var h=[];u;)ks(h,L1(u)),u=Ig(u);return h}:ew,Xn=tr;(u1&&Xn(new u1(new ArrayBuffer(1)))!=Ue||Wd&&Xn(new Wd)!=ae||d1&&Xn(d1.resolve())!=qe||kc&&Xn(new kc)!=Bt||Ud&&Xn(new Ud)!=he)&&(Xn=function(u){var h=tr(u),y=h==dt?u.constructor:n,E=y?il(y):"";if(E)switch(E){case tse:return Ue;case nse:return ae;case rse:return qe;case ise:return Bt;case ose:return he}return h});function xae(u,h,y){for(var E=-1,M=y.length;++E<M;){var L=y[E],z=L.size;switch(L.type){case"drop":u+=z;break;case"dropRight":h-=z;break;case"take":h=Kn(h,u+z);break;case"takeRight":u=Pn(u,h-z);break}}return{start:u,end:h}}function wae(u){var h=u.match(Bd);return h?h[1].split(D):[]}function AI(u,h,y){h=Is(h,u);for(var E=-1,M=h.length,L=!1;++E<M;){var z=io(h[E]);if(!(L=u!=null&&y(u,z)))break;u=u[z]}return L||++E!=M?L:(M=u==null?0:u.length,!!M&&sm(M)&&$o(z,M)&&(st(u)||ol(u)))}function _ae(u){var h=u.length,y=new u.constructor(h);return h&&typeof u[0]=="string"&&$t.call(u,"index")&&(y.index=u.index,y.input=u.input),y}function II(u){return typeof u.constructor=="function"&&!ef(u)?Mc(Ig(u)):{}}function Sae(u,h,y){var E=u.constructor;switch(h){case Ne:return D1(u);case ee:case Q:return new E(+u);case Ue:return sae(u,y);case at:case ln:case cn:case $n:case Br:case Vr:case mn:case vr:case jn:return gI(u,y);case ae:return new E;case Se:case gn:return new E(u);case Gt:return aae(u);case Bt:return new E;case Rt:return lae(u)}}function Cae(u,h){var y=h.length;if(!y)return u;var E=y-1;return h[E]=(y>1?"& ":"")+h[E],h=h.join(y>2?", ":" "),u.replace(zd,`{
66
+ */wf.exports,function(e,t){(function(){var n,r="4.17.21",i=200,o="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,d="__lodash_placeholder__",f=1,g=2,p=4,v=1,b=2,x=1,w=2,S=4,C=8,P=16,O=32,k=64,T=128,I=256,F=512,j=30,B="...",V=800,q=16,J=1,$=2,X=3,W=1/0,te=9007199254740991,le=17976931348623157e292,A=NaN,H=4294967295,ne=H-1,R=H>>>1,ue=[["ary",T],["bind",x],["bindKey",w],["curry",C],["curryRight",P],["flip",F],["partial",O],["partialRight",k],["rearg",I]],xe="[object Arguments]",ge="[object Array]",pe="[object AsyncFunction]",ee="[object Boolean]",Q="[object Date]",ie="[object DOMException]",we="[object Error]",re="[object Function]",Ie="[object GeneratorFunction]",ae="[object Map]",Se="[object Number]",We="[object Null]",dt="[object Object]",qe="[object Promise]",gt="[object Proxy]",Gt="[object RegExp]",Bt="[object Set]",gn="[object String]",Rt="[object Symbol]",mr="[object Undefined]",he="[object WeakMap]",Ee="[object WeakSet]",Ne="[object ArrayBuffer]",Ue="[object DataView]",at="[object Float32Array]",ln="[object Float64Array]",cn="[object Int8Array]",$n="[object Int16Array]",Br="[object Int32Array]",Vr="[object Uint8Array]",mn="[object Uint8ClampedArray]",vr="[object Uint16Array]",jn="[object Uint32Array]",Ld=/\b__p \+= '';/g,To=/\b(__p \+=) '' \+/g,Va=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Yn=/&(?:amp|lt|gt|quot|#39);/g,to=/[&<>"']/g,Ao=RegExp(Yn.source),Ha=RegExp(to.source),Fd=/<%-([\s\S]+?)%>/g,Wa=/<%([\s\S]+?)%>/g,wc=/<%=([\s\S]+?)%>/g,Ua=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qa=/^\w*$/,$d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ga=/[\\^$.*+?()[\]{}|]/g,Ya=RegExp(Ga.source),Ka=/^\s+/,jd=/\s/,zd=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bd=/\{\n\/\* \[wrapped with (.+)\] \*/,D=/,? & /,G=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,oe=/[()=,{}\[\]\/\s]/,Oe=/\\(\\)?/g,$e=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Be=/\w*$/,Re=/^[-+]0x[0-9a-f]+$/i,Te=/^0b[01]+$/i,Pt=/^\[object .+?Constructor\]$/,et=/^0o[0-7]+$/i,ot=/^(?:0|[1-9]\d*)$/,Vt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tn=/($^)/,Xa=/['\n\r\u2028\u2029\\]/g,on="\\ud800-\\udfff",zie="\\u0300-\\u036f",Bie="\\ufe20-\\ufe2f",Vie="\\u20d0-\\u20ff",Z5=zie+Bie+Vie,J5="\\u2700-\\u27bf",eA="a-z\\xdf-\\xf6\\xf8-\\xff",Hie="\\xac\\xb1\\xd7\\xf7",Wie="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Uie="\\u2000-\\u206f",qie=" \\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",tA="A-Z\\xc0-\\xd6\\xd8-\\xde",nA="\\ufe0e\\ufe0f",rA=Hie+Wie+Uie+qie,qx="['’]",Gie="["+on+"]",iA="["+rA+"]",Sg="["+Z5+"]",oA="\\d+",Yie="["+J5+"]",sA="["+eA+"]",aA="[^"+on+rA+oA+J5+eA+tA+"]",Gx="\\ud83c[\\udffb-\\udfff]",Kie="(?:"+Sg+"|"+Gx+")",lA="[^"+on+"]",Yx="(?:\\ud83c[\\udde6-\\uddff]){2}",Kx="[\\ud800-\\udbff][\\udc00-\\udfff]",_c="["+tA+"]",cA="\\u200d",uA="(?:"+sA+"|"+aA+")",Xie="(?:"+_c+"|"+aA+")",dA="(?:"+qx+"(?:d|ll|m|re|s|t|ve))?",fA="(?:"+qx+"(?:D|LL|M|RE|S|T|VE))?",hA=Kie+"?",pA="["+nA+"]?",Qie="(?:"+cA+"(?:"+[lA,Yx,Kx].join("|")+")"+pA+hA+")*",Zie="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Jie="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gA=pA+hA+Qie,eoe="(?:"+[Yie,Yx,Kx].join("|")+")"+gA,toe="(?:"+[lA+Sg+"?",Sg,Yx,Kx,Gie].join("|")+")",noe=RegExp(qx,"g"),roe=RegExp(Sg,"g"),Xx=RegExp(Gx+"(?="+Gx+")|"+toe+gA,"g"),ioe=RegExp([_c+"?"+sA+"+"+dA+"(?="+[iA,_c,"$"].join("|")+")",Xie+"+"+fA+"(?="+[iA,_c+uA,"$"].join("|")+")",_c+"?"+uA+"+"+dA,_c+"+"+fA,Jie,Zie,oA,eoe].join("|"),"g"),ooe=RegExp("["+cA+on+Z5+nA+"]"),soe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,aoe=["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"],loe=-1,nn={};nn[at]=nn[ln]=nn[cn]=nn[$n]=nn[Br]=nn[Vr]=nn[mn]=nn[vr]=nn[jn]=!0,nn[xe]=nn[ge]=nn[Ne]=nn[ee]=nn[Ue]=nn[Q]=nn[we]=nn[re]=nn[ae]=nn[Se]=nn[dt]=nn[Gt]=nn[Bt]=nn[gn]=nn[he]=!1;var Yt={};Yt[xe]=Yt[ge]=Yt[Ne]=Yt[Ue]=Yt[ee]=Yt[Q]=Yt[at]=Yt[ln]=Yt[cn]=Yt[$n]=Yt[Br]=Yt[ae]=Yt[Se]=Yt[dt]=Yt[Gt]=Yt[Bt]=Yt[gn]=Yt[Rt]=Yt[Vr]=Yt[mn]=Yt[vr]=Yt[jn]=!0,Yt[we]=Yt[re]=Yt[he]=!1;var coe={À:"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"},uoe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},doe={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},foe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hoe=parseFloat,poe=parseInt,mA=typeof Ho=="object"&&Ho&&Ho.Object===Object&&Ho,goe=typeof self=="object"&&self&&self.Object===Object&&self,zn=mA||goe||Function("return this")(),Qx=t&&!t.nodeType&&t,Qa=Qx&&!0&&e&&!e.nodeType&&e,vA=Qa&&Qa.exports===Qx,Zx=vA&&mA.process,ci=function(){try{var Y=Qa&&Qa.require&&Qa.require("util").types;return Y||Zx&&Zx.binding&&Zx.binding("util")}catch{}}(),bA=ci&&ci.isArrayBuffer,yA=ci&&ci.isDate,xA=ci&&ci.isMap,wA=ci&&ci.isRegExp,_A=ci&&ci.isSet,SA=ci&&ci.isTypedArray;function Hr(Y,me,ce){switch(ce.length){case 0:return Y.call(me);case 1:return Y.call(me,ce[0]);case 2:return Y.call(me,ce[0],ce[1]);case 3:return Y.call(me,ce[0],ce[1],ce[2])}return Y.apply(me,ce)}function moe(Y,me,ce,Fe){for(var tt=-1,Tt=Y==null?0:Y.length;++tt<Tt;){var On=Y[tt];me(Fe,On,ce(On),Y)}return Fe}function ui(Y,me){for(var ce=-1,Fe=Y==null?0:Y.length;++ce<Fe&&me(Y[ce],ce,Y)!==!1;);return Y}function voe(Y,me){for(var ce=Y==null?0:Y.length;ce--&&me(Y[ce],ce,Y)!==!1;);return Y}function CA(Y,me){for(var ce=-1,Fe=Y==null?0:Y.length;++ce<Fe;)if(!me(Y[ce],ce,Y))return!1;return!0}function Ps(Y,me){for(var ce=-1,Fe=Y==null?0:Y.length,tt=0,Tt=[];++ce<Fe;){var On=Y[ce];me(On,ce,Y)&&(Tt[tt++]=On)}return Tt}function Cg(Y,me){var ce=Y==null?0:Y.length;return!!ce&&Sc(Y,me,0)>-1}function Jx(Y,me,ce){for(var Fe=-1,tt=Y==null?0:Y.length;++Fe<tt;)if(ce(me,Y[Fe]))return!0;return!1}function sn(Y,me){for(var ce=-1,Fe=Y==null?0:Y.length,tt=Array(Fe);++ce<Fe;)tt[ce]=me(Y[ce],ce,Y);return tt}function ks(Y,me){for(var ce=-1,Fe=me.length,tt=Y.length;++ce<Fe;)Y[tt+ce]=me[ce];return Y}function e1(Y,me,ce,Fe){var tt=-1,Tt=Y==null?0:Y.length;for(Fe&&Tt&&(ce=Y[++tt]);++tt<Tt;)ce=me(ce,Y[tt],tt,Y);return ce}function boe(Y,me,ce,Fe){var tt=Y==null?0:Y.length;for(Fe&&tt&&(ce=Y[--tt]);tt--;)ce=me(ce,Y[tt],tt,Y);return ce}function t1(Y,me){for(var ce=-1,Fe=Y==null?0:Y.length;++ce<Fe;)if(me(Y[ce],ce,Y))return!0;return!1}var yoe=n1("length");function xoe(Y){return Y.split("")}function woe(Y){return Y.match(G)||[]}function EA(Y,me,ce){var Fe;return ce(Y,function(tt,Tt,On){if(me(tt,Tt,On))return Fe=Tt,!1}),Fe}function Eg(Y,me,ce,Fe){for(var tt=Y.length,Tt=ce+(Fe?1:-1);Fe?Tt--:++Tt<tt;)if(me(Y[Tt],Tt,Y))return Tt;return-1}function Sc(Y,me,ce){return me===me?Ioe(Y,me,ce):Eg(Y,OA,ce)}function _oe(Y,me,ce,Fe){for(var tt=ce-1,Tt=Y.length;++tt<Tt;)if(Fe(Y[tt],me))return tt;return-1}function OA(Y){return Y!==Y}function PA(Y,me){var ce=Y==null?0:Y.length;return ce?i1(Y,me)/ce:A}function n1(Y){return function(me){return me==null?n:me[Y]}}function r1(Y){return function(me){return Y==null?n:Y[me]}}function kA(Y,me,ce,Fe,tt){return tt(Y,function(Tt,On,Ht){ce=Fe?(Fe=!1,Tt):me(ce,Tt,On,Ht)}),ce}function Soe(Y,me){var ce=Y.length;for(Y.sort(me);ce--;)Y[ce]=Y[ce].value;return Y}function i1(Y,me){for(var ce,Fe=-1,tt=Y.length;++Fe<tt;){var Tt=me(Y[Fe]);Tt!==n&&(ce=ce===n?Tt:ce+Tt)}return ce}function o1(Y,me){for(var ce=-1,Fe=Array(Y);++ce<Y;)Fe[ce]=me(ce);return Fe}function Coe(Y,me){return sn(me,function(ce){return[ce,Y[ce]]})}function DA(Y){return Y&&Y.slice(0,IA(Y)+1).replace(Ka,"")}function Wr(Y){return function(me){return Y(me)}}function s1(Y,me){return sn(me,function(ce){return Y[ce]})}function Vd(Y,me){return Y.has(me)}function MA(Y,me){for(var ce=-1,Fe=Y.length;++ce<Fe&&Sc(me,Y[ce],0)>-1;);return ce}function TA(Y,me){for(var ce=Y.length;ce--&&Sc(me,Y[ce],0)>-1;);return ce}function Eoe(Y,me){for(var ce=Y.length,Fe=0;ce--;)Y[ce]===me&&++Fe;return Fe}var Ooe=r1(coe),Poe=r1(uoe);function koe(Y){return"\\"+foe[Y]}function Doe(Y,me){return Y==null?n:Y[me]}function Cc(Y){return ooe.test(Y)}function Moe(Y){return soe.test(Y)}function Toe(Y){for(var me,ce=[];!(me=Y.next()).done;)ce.push(me.value);return ce}function a1(Y){var me=-1,ce=Array(Y.size);return Y.forEach(function(Fe,tt){ce[++me]=[tt,Fe]}),ce}function AA(Y,me){return function(ce){return Y(me(ce))}}function Ds(Y,me){for(var ce=-1,Fe=Y.length,tt=0,Tt=[];++ce<Fe;){var On=Y[ce];(On===me||On===d)&&(Y[ce]=d,Tt[tt++]=ce)}return Tt}function Og(Y){var me=-1,ce=Array(Y.size);return Y.forEach(function(Fe){ce[++me]=Fe}),ce}function Aoe(Y){var me=-1,ce=Array(Y.size);return Y.forEach(function(Fe){ce[++me]=[Fe,Fe]}),ce}function Ioe(Y,me,ce){for(var Fe=ce-1,tt=Y.length;++Fe<tt;)if(Y[Fe]===me)return Fe;return-1}function Noe(Y,me,ce){for(var Fe=ce+1;Fe--;)if(Y[Fe]===me)return Fe;return Fe}function Ec(Y){return Cc(Y)?Loe(Y):yoe(Y)}function ki(Y){return Cc(Y)?Foe(Y):xoe(Y)}function IA(Y){for(var me=Y.length;me--&&jd.test(Y.charAt(me)););return me}var Roe=r1(doe);function Loe(Y){for(var me=Xx.lastIndex=0;Xx.test(Y);)++me;return me}function Foe(Y){return Y.match(Xx)||[]}function $oe(Y){return Y.match(ioe)||[]}var joe=function Y(me){me=me==null?zn:Oc.defaults(zn.Object(),me,Oc.pick(zn,aoe));var ce=me.Array,Fe=me.Date,tt=me.Error,Tt=me.Function,On=me.Math,Ht=me.Object,l1=me.RegExp,zoe=me.String,di=me.TypeError,Pg=ce.prototype,Boe=Tt.prototype,Pc=Ht.prototype,kg=me["__core-js_shared__"],Dg=Boe.toString,$t=Pc.hasOwnProperty,Voe=0,NA=function(){var u=/[^.]+$/.exec(kg&&kg.keys&&kg.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),Mg=Pc.toString,Hoe=Dg.call(Ht),Woe=zn._,Uoe=l1("^"+Dg.call($t).replace(Ga,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tg=vA?me.Buffer:n,Ms=me.Symbol,Ag=me.Uint8Array,RA=Tg?Tg.allocUnsafe:n,Ig=AA(Ht.getPrototypeOf,Ht),LA=Ht.create,FA=Pc.propertyIsEnumerable,Ng=Pg.splice,$A=Ms?Ms.isConcatSpreadable:n,Hd=Ms?Ms.iterator:n,Za=Ms?Ms.toStringTag:n,Rg=function(){try{var u=rl(Ht,"defineProperty");return u({},"",{}),u}catch{}}(),qoe=me.clearTimeout!==zn.clearTimeout&&me.clearTimeout,Goe=Fe&&Fe.now!==zn.Date.now&&Fe.now,Yoe=me.setTimeout!==zn.setTimeout&&me.setTimeout,Lg=On.ceil,Fg=On.floor,c1=Ht.getOwnPropertySymbols,Koe=Tg?Tg.isBuffer:n,jA=me.isFinite,Xoe=Pg.join,Qoe=AA(Ht.keys,Ht),Pn=On.max,Kn=On.min,Zoe=Fe.now,Joe=me.parseInt,zA=On.random,ese=Pg.reverse,u1=rl(me,"DataView"),Wd=rl(me,"Map"),d1=rl(me,"Promise"),kc=rl(me,"Set"),Ud=rl(me,"WeakMap"),qd=rl(Ht,"create"),$g=Ud&&new Ud,Dc={},tse=il(u1),nse=il(Wd),rse=il(d1),ise=il(kc),ose=il(Ud),jg=Ms?Ms.prototype:n,Gd=jg?jg.valueOf:n,BA=jg?jg.toString:n;function N(u){if(hn(u)&&!st(u)&&!(u instanceof Ct)){if(u instanceof fi)return u;if($t.call(u,"__wrapped__"))return VI(u)}return new fi(u)}var Mc=function(){function u(){}return function(h){if(!un(h))return{};if(LA)return LA(h);u.prototype=h;var y=new u;return u.prototype=n,y}}();function zg(){}function fi(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}N.templateSettings={escape:Fd,evaluate:Wa,interpolate:wc,variable:"",imports:{_:N}},N.prototype=zg.prototype,N.prototype.constructor=N,fi.prototype=Mc(zg.prototype),fi.prototype.constructor=fi;function Ct(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function sse(){var u=new Ct(this.__wrapped__);return u.__actions__=br(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=br(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=br(this.__views__),u}function ase(){if(this.__filtered__){var u=new Ct(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function lse(){var u=this.__wrapped__.value(),h=this.__dir__,y=st(u),E=h<0,M=y?u.length:0,L=xae(0,M,this.__views__),z=L.start,U=L.end,Z=U-z,be=E?U:z-1,ye=this.__iteratees__,Ce=ye.length,Ae=0,ze=Kn(Z,this.__takeCount__);if(!y||!E&&M==Z&&ze==Z)return dI(u,this.__actions__);var Ye=[];e:for(;Z--&&Ae<ze;){be+=h;for(var mt=-1,Ke=u[be];++mt<Ce;){var St=ye[mt],Et=St.iteratee,Gr=St.type,rr=Et(Ke);if(Gr==$)Ke=rr;else if(!rr){if(Gr==J)continue e;break e}}Ye[Ae++]=Ke}return Ye}Ct.prototype=Mc(zg.prototype),Ct.prototype.constructor=Ct;function Ja(u){var h=-1,y=u==null?0:u.length;for(this.clear();++h<y;){var E=u[h];this.set(E[0],E[1])}}function cse(){this.__data__=qd?qd(null):{},this.size=0}function use(u){var h=this.has(u)&&delete this.__data__[u];return this.size-=h?1:0,h}function dse(u){var h=this.__data__;if(qd){var y=h[u];return y===l?n:y}return $t.call(h,u)?h[u]:n}function fse(u){var h=this.__data__;return qd?h[u]!==n:$t.call(h,u)}function hse(u,h){var y=this.__data__;return this.size+=this.has(u)?0:1,y[u]=qd&&h===n?l:h,this}Ja.prototype.clear=cse,Ja.prototype.delete=use,Ja.prototype.get=dse,Ja.prototype.has=fse,Ja.prototype.set=hse;function Io(u){var h=-1,y=u==null?0:u.length;for(this.clear();++h<y;){var E=u[h];this.set(E[0],E[1])}}function pse(){this.__data__=[],this.size=0}function gse(u){var h=this.__data__,y=Bg(h,u);if(y<0)return!1;var E=h.length-1;return y==E?h.pop():Ng.call(h,y,1),--this.size,!0}function mse(u){var h=this.__data__,y=Bg(h,u);return y<0?n:h[y][1]}function vse(u){return Bg(this.__data__,u)>-1}function bse(u,h){var y=this.__data__,E=Bg(y,u);return E<0?(++this.size,y.push([u,h])):y[E][1]=h,this}Io.prototype.clear=pse,Io.prototype.delete=gse,Io.prototype.get=mse,Io.prototype.has=vse,Io.prototype.set=bse;function No(u){var h=-1,y=u==null?0:u.length;for(this.clear();++h<y;){var E=u[h];this.set(E[0],E[1])}}function yse(){this.size=0,this.__data__={hash:new Ja,map:new(Wd||Io),string:new Ja}}function xse(u){var h=Jg(this,u).delete(u);return this.size-=h?1:0,h}function wse(u){return Jg(this,u).get(u)}function _se(u){return Jg(this,u).has(u)}function Sse(u,h){var y=Jg(this,u),E=y.size;return y.set(u,h),this.size+=y.size==E?0:1,this}No.prototype.clear=yse,No.prototype.delete=xse,No.prototype.get=wse,No.prototype.has=_se,No.prototype.set=Sse;function el(u){var h=-1,y=u==null?0:u.length;for(this.__data__=new No;++h<y;)this.add(u[h])}function Cse(u){return this.__data__.set(u,l),this}function Ese(u){return this.__data__.has(u)}el.prototype.add=el.prototype.push=Cse,el.prototype.has=Ese;function Di(u){var h=this.__data__=new Io(u);this.size=h.size}function Ose(){this.__data__=new Io,this.size=0}function Pse(u){var h=this.__data__,y=h.delete(u);return this.size=h.size,y}function kse(u){return this.__data__.get(u)}function Dse(u){return this.__data__.has(u)}function Mse(u,h){var y=this.__data__;if(y instanceof Io){var E=y.__data__;if(!Wd||E.length<i-1)return E.push([u,h]),this.size=++y.size,this;y=this.__data__=new No(E)}return y.set(u,h),this.size=y.size,this}Di.prototype.clear=Ose,Di.prototype.delete=Pse,Di.prototype.get=kse,Di.prototype.has=Dse,Di.prototype.set=Mse;function VA(u,h){var y=st(u),E=!y&&ol(u),M=!y&&!E&&Rs(u),L=!y&&!E&&!M&&Nc(u),z=y||E||M||L,U=z?o1(u.length,zoe):[],Z=U.length;for(var be in u)(h||$t.call(u,be))&&!(z&&(be=="length"||M&&(be=="offset"||be=="parent")||L&&(be=="buffer"||be=="byteLength"||be=="byteOffset")||$o(be,Z)))&&U.push(be);return U}function HA(u){var h=u.length;return h?u[_1(0,h-1)]:n}function Tse(u,h){return em(br(u),tl(h,0,u.length))}function Ase(u){return em(br(u))}function f1(u,h,y){(y!==n&&!Mi(u[h],y)||y===n&&!(h in u))&&Ro(u,h,y)}function Yd(u,h,y){var E=u[h];(!($t.call(u,h)&&Mi(E,y))||y===n&&!(h in u))&&Ro(u,h,y)}function Bg(u,h){for(var y=u.length;y--;)if(Mi(u[y][0],h))return y;return-1}function Ise(u,h,y,E){return Ts(u,function(M,L,z){h(E,M,y(M),z)}),E}function WA(u,h){return u&&ro(h,An(h),u)}function Nse(u,h){return u&&ro(h,xr(h),u)}function Ro(u,h,y){h=="__proto__"&&Rg?Rg(u,h,{configurable:!0,enumerable:!0,value:y,writable:!0}):u[h]=y}function h1(u,h){for(var y=-1,E=h.length,M=ce(E),L=u==null;++y<E;)M[y]=L?n:G1(u,h[y]);return M}function tl(u,h,y){return u===u&&(y!==n&&(u=u<=y?u:y),h!==n&&(u=u>=h?u:h)),u}function hi(u,h,y,E,M,L){var z,U=h&f,Z=h&g,be=h&p;if(y&&(z=M?y(u,E,M,L):y(u)),z!==n)return z;if(!un(u))return u;var ye=st(u);if(ye){if(z=_ae(u),!U)return br(u,z)}else{var Ce=Xn(u),Ae=Ce==re||Ce==Ie;if(Rs(u))return pI(u,U);if(Ce==dt||Ce==xe||Ae&&!M){if(z=Z||Ae?{}:II(u),!U)return Z?dae(u,Nse(z,u)):uae(u,WA(z,u))}else{if(!Yt[Ce])return M?u:{};z=Sae(u,Ce,U)}}L||(L=new Di);var ze=L.get(u);if(ze)return ze;L.set(u,z),lN(u)?u.forEach(function(Ke){z.add(hi(Ke,h,y,Ke,u,L))}):sN(u)&&u.forEach(function(Ke,St){z.set(St,hi(Ke,h,y,St,u,L))});var Ye=be?Z?I1:A1:Z?xr:An,mt=ye?n:Ye(u);return ui(mt||u,function(Ke,St){mt&&(St=Ke,Ke=u[St]),Yd(z,St,hi(Ke,h,y,St,u,L))}),z}function Rse(u){var h=An(u);return function(y){return UA(y,u,h)}}function UA(u,h,y){var E=y.length;if(u==null)return!E;for(u=Ht(u);E--;){var M=y[E],L=h[M],z=u[M];if(z===n&&!(M in u)||!L(z))return!1}return!0}function qA(u,h,y){if(typeof u!="function")throw new di(s);return tf(function(){u.apply(n,y)},h)}function Kd(u,h,y,E){var M=-1,L=Cg,z=!0,U=u.length,Z=[],be=h.length;if(!U)return Z;y&&(h=sn(h,Wr(y))),E?(L=Jx,z=!1):h.length>=i&&(L=Vd,z=!1,h=new el(h));e:for(;++M<U;){var ye=u[M],Ce=y==null?ye:y(ye);if(ye=E||ye!==0?ye:0,z&&Ce===Ce){for(var Ae=be;Ae--;)if(h[Ae]===Ce)continue e;Z.push(ye)}else L(h,Ce,E)||Z.push(ye)}return Z}var Ts=yI(no),GA=yI(g1,!0);function Lse(u,h){var y=!0;return Ts(u,function(E,M,L){return y=!!h(E,M,L),y}),y}function Vg(u,h,y){for(var E=-1,M=u.length;++E<M;){var L=u[E],z=h(L);if(z!=null&&(U===n?z===z&&!qr(z):y(z,U)))var U=z,Z=L}return Z}function Fse(u,h,y,E){var M=u.length;for(y=ft(y),y<0&&(y=-y>M?0:M+y),E=E===n||E>M?M:ft(E),E<0&&(E+=M),E=y>E?0:uN(E);y<E;)u[y++]=h;return u}function YA(u,h){var y=[];return Ts(u,function(E,M,L){h(E,M,L)&&y.push(E)}),y}function Bn(u,h,y,E,M){var L=-1,z=u.length;for(y||(y=Eae),M||(M=[]);++L<z;){var U=u[L];h>0&&y(U)?h>1?Bn(U,h-1,y,E,M):ks(M,U):E||(M[M.length]=U)}return M}var p1=xI(),KA=xI(!0);function no(u,h){return u&&p1(u,h,An)}function g1(u,h){return u&&KA(u,h,An)}function Hg(u,h){return Ps(h,function(y){return jo(u[y])})}function nl(u,h){h=Is(h,u);for(var y=0,E=h.length;u!=null&&y<E;)u=u[io(h[y++])];return y&&y==E?u:n}function XA(u,h,y){var E=h(u);return st(u)?E:ks(E,y(u))}function tr(u){return u==null?u===n?mr:We:Za&&Za in Ht(u)?yae(u):Aae(u)}function m1(u,h){return u>h}function $se(u,h){return u!=null&&$t.call(u,h)}function jse(u,h){return u!=null&&h in Ht(u)}function zse(u,h,y){return u>=Kn(h,y)&&u<Pn(h,y)}function v1(u,h,y){for(var E=y?Jx:Cg,M=u[0].length,L=u.length,z=L,U=ce(L),Z=1/0,be=[];z--;){var ye=u[z];z&&h&&(ye=sn(ye,Wr(h))),Z=Kn(ye.length,Z),U[z]=!y&&(h||M>=120&&ye.length>=120)?new el(z&&ye):n}ye=u[0];var Ce=-1,Ae=U[0];e:for(;++Ce<M&&be.length<Z;){var ze=ye[Ce],Ye=h?h(ze):ze;if(ze=y||ze!==0?ze:0,!(Ae?Vd(Ae,Ye):E(be,Ye,y))){for(z=L;--z;){var mt=U[z];if(!(mt?Vd(mt,Ye):E(u[z],Ye,y)))continue e}Ae&&Ae.push(Ye),be.push(ze)}}return be}function Bse(u,h,y,E){return no(u,function(M,L,z){h(E,y(M),L,z)}),E}function Xd(u,h,y){h=Is(h,u),u=FI(u,h);var E=u==null?u:u[io(gi(h))];return E==null?n:Hr(E,u,y)}function QA(u){return hn(u)&&tr(u)==xe}function Vse(u){return hn(u)&&tr(u)==Ne}function Hse(u){return hn(u)&&tr(u)==Q}function Qd(u,h,y,E,M){return u===h?!0:u==null||h==null||!hn(u)&&!hn(h)?u!==u&&h!==h:Wse(u,h,y,E,Qd,M)}function Wse(u,h,y,E,M,L){var z=st(u),U=st(h),Z=z?ge:Xn(u),be=U?ge:Xn(h);Z=Z==xe?dt:Z,be=be==xe?dt:be;var ye=Z==dt,Ce=be==dt,Ae=Z==be;if(Ae&&Rs(u)){if(!Rs(h))return!1;z=!0,ye=!1}if(Ae&&!ye)return L||(L=new Di),z||Nc(u)?MI(u,h,y,E,M,L):vae(u,h,Z,y,E,M,L);if(!(y&v)){var ze=ye&&$t.call(u,"__wrapped__"),Ye=Ce&&$t.call(h,"__wrapped__");if(ze||Ye){var mt=ze?u.value():u,Ke=Ye?h.value():h;return L||(L=new Di),M(mt,Ke,y,E,L)}}return Ae?(L||(L=new Di),bae(u,h,y,E,M,L)):!1}function Use(u){return hn(u)&&Xn(u)==ae}function b1(u,h,y,E){var M=y.length,L=M,z=!E;if(u==null)return!L;for(u=Ht(u);M--;){var U=y[M];if(z&&U[2]?U[1]!==u[U[0]]:!(U[0]in u))return!1}for(;++M<L;){U=y[M];var Z=U[0],be=u[Z],ye=U[1];if(z&&U[2]){if(be===n&&!(Z in u))return!1}else{var Ce=new Di;if(E)var Ae=E(be,ye,Z,u,h,Ce);if(!(Ae===n?Qd(ye,be,v|b,E,Ce):Ae))return!1}}return!0}function ZA(u){if(!un(u)||Pae(u))return!1;var h=jo(u)?Uoe:Pt;return h.test(il(u))}function qse(u){return hn(u)&&tr(u)==Gt}function Gse(u){return hn(u)&&Xn(u)==Bt}function Yse(u){return hn(u)&&sm(u.length)&&!!nn[tr(u)]}function JA(u){return typeof u=="function"?u:u==null?wr:typeof u=="object"?st(u)?nI(u[0],u[1]):tI(u):wN(u)}function y1(u){if(!ef(u))return Qoe(u);var h=[];for(var y in Ht(u))$t.call(u,y)&&y!="constructor"&&h.push(y);return h}function Kse(u){if(!un(u))return Tae(u);var h=ef(u),y=[];for(var E in u)E=="constructor"&&(h||!$t.call(u,E))||y.push(E);return y}function x1(u,h){return u<h}function eI(u,h){var y=-1,E=yr(u)?ce(u.length):[];return Ts(u,function(M,L,z){E[++y]=h(M,L,z)}),E}function tI(u){var h=R1(u);return h.length==1&&h[0][2]?RI(h[0][0],h[0][1]):function(y){return y===u||b1(y,u,h)}}function nI(u,h){return F1(u)&&NI(h)?RI(io(u),h):function(y){var E=G1(y,u);return E===n&&E===h?Y1(y,u):Qd(h,E,v|b)}}function Wg(u,h,y,E,M){u!==h&&p1(h,function(L,z){if(M||(M=new Di),un(L))Xse(u,h,z,y,Wg,E,M);else{var U=E?E(j1(u,z),L,z+"",u,h,M):n;U===n&&(U=L),f1(u,z,U)}},xr)}function Xse(u,h,y,E,M,L,z){var U=j1(u,y),Z=j1(h,y),be=z.get(Z);if(be){f1(u,y,be);return}var ye=L?L(U,Z,y+"",u,h,z):n,Ce=ye===n;if(Ce){var Ae=st(Z),ze=!Ae&&Rs(Z),Ye=!Ae&&!ze&&Nc(Z);ye=Z,Ae||ze||Ye?st(U)?ye=U:vn(U)?ye=br(U):ze?(Ce=!1,ye=pI(Z,!0)):Ye?(Ce=!1,ye=gI(Z,!0)):ye=[]:nf(Z)||ol(Z)?(ye=U,ol(U)?ye=dN(U):(!un(U)||jo(U))&&(ye=II(Z))):Ce=!1}Ce&&(z.set(Z,ye),M(ye,Z,E,L,z),z.delete(Z)),f1(u,y,ye)}function rI(u,h){var y=u.length;if(y)return h+=h<0?y:0,$o(h,y)?u[h]:n}function iI(u,h,y){h.length?h=sn(h,function(L){return st(L)?function(z){return nl(z,L.length===1?L[0]:L)}:L}):h=[wr];var E=-1;h=sn(h,Wr(Ge()));var M=eI(u,function(L,z,U){var Z=sn(h,function(be){return be(L)});return{criteria:Z,index:++E,value:L}});return Soe(M,function(L,z){return cae(L,z,y)})}function Qse(u,h){return oI(u,h,function(y,E){return Y1(u,E)})}function oI(u,h,y){for(var E=-1,M=h.length,L={};++E<M;){var z=h[E],U=nl(u,z);y(U,z)&&Zd(L,Is(z,u),U)}return L}function Zse(u){return function(h){return nl(h,u)}}function w1(u,h,y,E){var M=E?_oe:Sc,L=-1,z=h.length,U=u;for(u===h&&(h=br(h)),y&&(U=sn(u,Wr(y)));++L<z;)for(var Z=0,be=h[L],ye=y?y(be):be;(Z=M(U,ye,Z,E))>-1;)U!==u&&Ng.call(U,Z,1),Ng.call(u,Z,1);return u}function sI(u,h){for(var y=u?h.length:0,E=y-1;y--;){var M=h[y];if(y==E||M!==L){var L=M;$o(M)?Ng.call(u,M,1):E1(u,M)}}return u}function _1(u,h){return u+Fg(zA()*(h-u+1))}function Jse(u,h,y,E){for(var M=-1,L=Pn(Lg((h-u)/(y||1)),0),z=ce(L);L--;)z[E?L:++M]=u,u+=y;return z}function S1(u,h){var y="";if(!u||h<1||h>te)return y;do h%2&&(y+=u),h=Fg(h/2),h&&(u+=u);while(h);return y}function vt(u,h){return z1(LI(u,h,wr),u+"")}function eae(u){return HA(Rc(u))}function tae(u,h){var y=Rc(u);return em(y,tl(h,0,y.length))}function Zd(u,h,y,E){if(!un(u))return u;h=Is(h,u);for(var M=-1,L=h.length,z=L-1,U=u;U!=null&&++M<L;){var Z=io(h[M]),be=y;if(Z==="__proto__"||Z==="constructor"||Z==="prototype")return u;if(M!=z){var ye=U[Z];be=E?E(ye,Z,U):n,be===n&&(be=un(ye)?ye:$o(h[M+1])?[]:{})}Yd(U,Z,be),U=U[Z]}return u}var aI=$g?function(u,h){return $g.set(u,h),u}:wr,nae=Rg?function(u,h){return Rg(u,"toString",{configurable:!0,enumerable:!1,value:X1(h),writable:!0})}:wr;function rae(u){return em(Rc(u))}function pi(u,h,y){var E=-1,M=u.length;h<0&&(h=-h>M?0:M+h),y=y>M?M:y,y<0&&(y+=M),M=h>y?0:y-h>>>0,h>>>=0;for(var L=ce(M);++E<M;)L[E]=u[E+h];return L}function iae(u,h){var y;return Ts(u,function(E,M,L){return y=h(E,M,L),!y}),!!y}function Ug(u,h,y){var E=0,M=u==null?E:u.length;if(typeof h=="number"&&h===h&&M<=R){for(;E<M;){var L=E+M>>>1,z=u[L];z!==null&&!qr(z)&&(y?z<=h:z<h)?E=L+1:M=L}return M}return C1(u,h,wr,y)}function C1(u,h,y,E){var M=0,L=u==null?0:u.length;if(L===0)return 0;h=y(h);for(var z=h!==h,U=h===null,Z=qr(h),be=h===n;M<L;){var ye=Fg((M+L)/2),Ce=y(u[ye]),Ae=Ce!==n,ze=Ce===null,Ye=Ce===Ce,mt=qr(Ce);if(z)var Ke=E||Ye;else be?Ke=Ye&&(E||Ae):U?Ke=Ye&&Ae&&(E||!ze):Z?Ke=Ye&&Ae&&!ze&&(E||!mt):ze||mt?Ke=!1:Ke=E?Ce<=h:Ce<h;Ke?M=ye+1:L=ye}return Kn(L,ne)}function lI(u,h){for(var y=-1,E=u.length,M=0,L=[];++y<E;){var z=u[y],U=h?h(z):z;if(!y||!Mi(U,Z)){var Z=U;L[M++]=z===0?0:z}}return L}function cI(u){return typeof u=="number"?u:qr(u)?A:+u}function Ur(u){if(typeof u=="string")return u;if(st(u))return sn(u,Ur)+"";if(qr(u))return BA?BA.call(u):"";var h=u+"";return h=="0"&&1/u==-W?"-0":h}function As(u,h,y){var E=-1,M=Cg,L=u.length,z=!0,U=[],Z=U;if(y)z=!1,M=Jx;else if(L>=i){var be=h?null:gae(u);if(be)return Og(be);z=!1,M=Vd,Z=new el}else Z=h?[]:U;e:for(;++E<L;){var ye=u[E],Ce=h?h(ye):ye;if(ye=y||ye!==0?ye:0,z&&Ce===Ce){for(var Ae=Z.length;Ae--;)if(Z[Ae]===Ce)continue e;h&&Z.push(Ce),U.push(ye)}else M(Z,Ce,y)||(Z!==U&&Z.push(Ce),U.push(ye))}return U}function E1(u,h){return h=Is(h,u),u=FI(u,h),u==null||delete u[io(gi(h))]}function uI(u,h,y,E){return Zd(u,h,y(nl(u,h)),E)}function qg(u,h,y,E){for(var M=u.length,L=E?M:-1;(E?L--:++L<M)&&h(u[L],L,u););return y?pi(u,E?0:L,E?L+1:M):pi(u,E?L+1:0,E?M:L)}function dI(u,h){var y=u;return y instanceof Ct&&(y=y.value()),e1(h,function(E,M){return M.func.apply(M.thisArg,ks([E],M.args))},y)}function O1(u,h,y){var E=u.length;if(E<2)return E?As(u[0]):[];for(var M=-1,L=ce(E);++M<E;)for(var z=u[M],U=-1;++U<E;)U!=M&&(L[M]=Kd(L[M]||z,u[U],h,y));return As(Bn(L,1),h,y)}function fI(u,h,y){for(var E=-1,M=u.length,L=h.length,z={};++E<M;){var U=E<L?h[E]:n;y(z,u[E],U)}return z}function P1(u){return vn(u)?u:[]}function k1(u){return typeof u=="function"?u:wr}function Is(u,h){return st(u)?u:F1(u,h)?[u]:BI(Lt(u))}var oae=vt;function Ns(u,h,y){var E=u.length;return y=y===n?E:y,!h&&y>=E?u:pi(u,h,y)}var hI=qoe||function(u){return zn.clearTimeout(u)};function pI(u,h){if(h)return u.slice();var y=u.length,E=RA?RA(y):new u.constructor(y);return u.copy(E),E}function D1(u){var h=new u.constructor(u.byteLength);return new Ag(h).set(new Ag(u)),h}function sae(u,h){var y=h?D1(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.byteLength)}function aae(u){var h=new u.constructor(u.source,Be.exec(u));return h.lastIndex=u.lastIndex,h}function lae(u){return Gd?Ht(Gd.call(u)):{}}function gI(u,h){var y=h?D1(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.length)}function mI(u,h){if(u!==h){var y=u!==n,E=u===null,M=u===u,L=qr(u),z=h!==n,U=h===null,Z=h===h,be=qr(h);if(!U&&!be&&!L&&u>h||L&&z&&Z&&!U&&!be||E&&z&&Z||!y&&Z||!M)return 1;if(!E&&!L&&!be&&u<h||be&&y&&M&&!E&&!L||U&&y&&M||!z&&M||!Z)return-1}return 0}function cae(u,h,y){for(var E=-1,M=u.criteria,L=h.criteria,z=M.length,U=y.length;++E<z;){var Z=mI(M[E],L[E]);if(Z){if(E>=U)return Z;var be=y[E];return Z*(be=="desc"?-1:1)}}return u.index-h.index}function vI(u,h,y,E){for(var M=-1,L=u.length,z=y.length,U=-1,Z=h.length,be=Pn(L-z,0),ye=ce(Z+be),Ce=!E;++U<Z;)ye[U]=h[U];for(;++M<z;)(Ce||M<L)&&(ye[y[M]]=u[M]);for(;be--;)ye[U++]=u[M++];return ye}function bI(u,h,y,E){for(var M=-1,L=u.length,z=-1,U=y.length,Z=-1,be=h.length,ye=Pn(L-U,0),Ce=ce(ye+be),Ae=!E;++M<ye;)Ce[M]=u[M];for(var ze=M;++Z<be;)Ce[ze+Z]=h[Z];for(;++z<U;)(Ae||M<L)&&(Ce[ze+y[z]]=u[M++]);return Ce}function br(u,h){var y=-1,E=u.length;for(h||(h=ce(E));++y<E;)h[y]=u[y];return h}function ro(u,h,y,E){var M=!y;y||(y={});for(var L=-1,z=h.length;++L<z;){var U=h[L],Z=E?E(y[U],u[U],U,y,u):n;Z===n&&(Z=u[U]),M?Ro(y,U,Z):Yd(y,U,Z)}return y}function uae(u,h){return ro(u,L1(u),h)}function dae(u,h){return ro(u,TI(u),h)}function Gg(u,h){return function(y,E){var M=st(y)?moe:Ise,L=h?h():{};return M(y,u,Ge(E,2),L)}}function Tc(u){return vt(function(h,y){var E=-1,M=y.length,L=M>1?y[M-1]:n,z=M>2?y[2]:n;for(L=u.length>3&&typeof L=="function"?(M--,L):n,z&&nr(y[0],y[1],z)&&(L=M<3?n:L,M=1),h=Ht(h);++E<M;){var U=y[E];U&&u(h,U,E,L)}return h})}function yI(u,h){return function(y,E){if(y==null)return y;if(!yr(y))return u(y,E);for(var M=y.length,L=h?M:-1,z=Ht(y);(h?L--:++L<M)&&E(z[L],L,z)!==!1;);return y}}function xI(u){return function(h,y,E){for(var M=-1,L=Ht(h),z=E(h),U=z.length;U--;){var Z=z[u?U:++M];if(y(L[Z],Z,L)===!1)break}return h}}function fae(u,h,y){var E=h&x,M=Jd(u);function L(){var z=this&&this!==zn&&this instanceof L?M:u;return z.apply(E?y:this,arguments)}return L}function wI(u){return function(h){h=Lt(h);var y=Cc(h)?ki(h):n,E=y?y[0]:h.charAt(0),M=y?Ns(y,1).join(""):h.slice(1);return E[u]()+M}}function Ac(u){return function(h){return e1(yN(bN(h).replace(noe,"")),u,"")}}function Jd(u){return function(){var h=arguments;switch(h.length){case 0:return new u;case 1:return new u(h[0]);case 2:return new u(h[0],h[1]);case 3:return new u(h[0],h[1],h[2]);case 4:return new u(h[0],h[1],h[2],h[3]);case 5:return new u(h[0],h[1],h[2],h[3],h[4]);case 6:return new u(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new u(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var y=Mc(u.prototype),E=u.apply(y,h);return un(E)?E:y}}function hae(u,h,y){var E=Jd(u);function M(){for(var L=arguments.length,z=ce(L),U=L,Z=Ic(M);U--;)z[U]=arguments[U];var be=L<3&&z[0]!==Z&&z[L-1]!==Z?[]:Ds(z,Z);if(L-=be.length,L<y)return OI(u,h,Yg,M.placeholder,n,z,be,n,n,y-L);var ye=this&&this!==zn&&this instanceof M?E:u;return Hr(ye,this,z)}return M}function _I(u){return function(h,y,E){var M=Ht(h);if(!yr(h)){var L=Ge(y,3);h=An(h),y=function(U){return L(M[U],U,M)}}var z=u(h,y,E);return z>-1?M[L?h[z]:z]:n}}function SI(u){return Fo(function(h){var y=h.length,E=y,M=fi.prototype.thru;for(u&&h.reverse();E--;){var L=h[E];if(typeof L!="function")throw new di(s);if(M&&!z&&Zg(L)=="wrapper")var z=new fi([],!0)}for(E=z?E:y;++E<y;){L=h[E];var U=Zg(L),Z=U=="wrapper"?N1(L):n;Z&&$1(Z[0])&&Z[1]==(T|C|O|I)&&!Z[4].length&&Z[9]==1?z=z[Zg(Z[0])].apply(z,Z[3]):z=L.length==1&&$1(L)?z[U]():z.thru(L)}return function(){var be=arguments,ye=be[0];if(z&&be.length==1&&st(ye))return z.plant(ye).value();for(var Ce=0,Ae=y?h[Ce].apply(this,be):ye;++Ce<y;)Ae=h[Ce].call(this,Ae);return Ae}})}function Yg(u,h,y,E,M,L,z,U,Z,be){var ye=h&T,Ce=h&x,Ae=h&w,ze=h&(C|P),Ye=h&F,mt=Ae?n:Jd(u);function Ke(){for(var St=arguments.length,Et=ce(St),Gr=St;Gr--;)Et[Gr]=arguments[Gr];if(ze)var rr=Ic(Ke),Yr=Eoe(Et,rr);if(E&&(Et=vI(Et,E,M,ze)),L&&(Et=bI(Et,L,z,ze)),St-=Yr,ze&&St<be){var bn=Ds(Et,rr);return OI(u,h,Yg,Ke.placeholder,y,Et,bn,U,Z,be-St)}var Ti=Ce?y:this,Bo=Ae?Ti[u]:u;return St=Et.length,U?Et=Iae(Et,U):Ye&&St>1&&Et.reverse(),ye&&Z<St&&(Et.length=Z),this&&this!==zn&&this instanceof Ke&&(Bo=mt||Jd(Bo)),Bo.apply(Ti,Et)}return Ke}function CI(u,h){return function(y,E){return Bse(y,u,h(E),{})}}function Kg(u,h){return function(y,E){var M;if(y===n&&E===n)return h;if(y!==n&&(M=y),E!==n){if(M===n)return E;typeof y=="string"||typeof E=="string"?(y=Ur(y),E=Ur(E)):(y=cI(y),E=cI(E)),M=u(y,E)}return M}}function M1(u){return Fo(function(h){return h=sn(h,Wr(Ge())),vt(function(y){var E=this;return u(h,function(M){return Hr(M,E,y)})})})}function Xg(u,h){h=h===n?" ":Ur(h);var y=h.length;if(y<2)return y?S1(h,u):h;var E=S1(h,Lg(u/Ec(h)));return Cc(h)?Ns(ki(E),0,u).join(""):E.slice(0,u)}function pae(u,h,y,E){var M=h&x,L=Jd(u);function z(){for(var U=-1,Z=arguments.length,be=-1,ye=E.length,Ce=ce(ye+Z),Ae=this&&this!==zn&&this instanceof z?L:u;++be<ye;)Ce[be]=E[be];for(;Z--;)Ce[be++]=arguments[++U];return Hr(Ae,M?y:this,Ce)}return z}function EI(u){return function(h,y,E){return E&&typeof E!="number"&&nr(h,y,E)&&(y=E=n),h=zo(h),y===n?(y=h,h=0):y=zo(y),E=E===n?h<y?1:-1:zo(E),Jse(h,y,E,u)}}function Qg(u){return function(h,y){return typeof h=="string"&&typeof y=="string"||(h=mi(h),y=mi(y)),u(h,y)}}function OI(u,h,y,E,M,L,z,U,Z,be){var ye=h&C,Ce=ye?z:n,Ae=ye?n:z,ze=ye?L:n,Ye=ye?n:L;h|=ye?O:k,h&=~(ye?k:O),h&S||(h&=~(x|w));var mt=[u,h,M,ze,Ce,Ye,Ae,U,Z,be],Ke=y.apply(n,mt);return $1(u)&&$I(Ke,mt),Ke.placeholder=E,jI(Ke,u,h)}function T1(u){var h=On[u];return function(y,E){if(y=mi(y),E=E==null?0:Kn(ft(E),292),E&&jA(y)){var M=(Lt(y)+"e").split("e"),L=h(M[0]+"e"+(+M[1]+E));return M=(Lt(L)+"e").split("e"),+(M[0]+"e"+(+M[1]-E))}return h(y)}}var gae=kc&&1/Og(new kc([,-0]))[1]==W?function(u){return new kc(u)}:J1;function PI(u){return function(h){var y=Xn(h);return y==ae?a1(h):y==Bt?Aoe(h):Coe(h,u(h))}}function Lo(u,h,y,E,M,L,z,U){var Z=h&w;if(!Z&&typeof u!="function")throw new di(s);var be=E?E.length:0;if(be||(h&=~(O|k),E=M=n),z=z===n?z:Pn(ft(z),0),U=U===n?U:ft(U),be-=M?M.length:0,h&k){var ye=E,Ce=M;E=M=n}var Ae=Z?n:N1(u),ze=[u,h,y,E,M,ye,Ce,L,z,U];if(Ae&&Mae(ze,Ae),u=ze[0],h=ze[1],y=ze[2],E=ze[3],M=ze[4],U=ze[9]=ze[9]===n?Z?0:u.length:Pn(ze[9]-be,0),!U&&h&(C|P)&&(h&=~(C|P)),!h||h==x)var Ye=fae(u,h,y);else h==C||h==P?Ye=hae(u,h,U):(h==O||h==(x|O))&&!M.length?Ye=pae(u,h,y,E):Ye=Yg.apply(n,ze);var mt=Ae?aI:$I;return jI(mt(Ye,ze),u,h)}function kI(u,h,y,E){return u===n||Mi(u,Pc[y])&&!$t.call(E,y)?h:u}function DI(u,h,y,E,M,L){return un(u)&&un(h)&&(L.set(h,u),Wg(u,h,n,DI,L),L.delete(h)),u}function mae(u){return nf(u)?n:u}function MI(u,h,y,E,M,L){var z=y&v,U=u.length,Z=h.length;if(U!=Z&&!(z&&Z>U))return!1;var be=L.get(u),ye=L.get(h);if(be&&ye)return be==h&&ye==u;var Ce=-1,Ae=!0,ze=y&b?new el:n;for(L.set(u,h),L.set(h,u);++Ce<U;){var Ye=u[Ce],mt=h[Ce];if(E)var Ke=z?E(mt,Ye,Ce,h,u,L):E(Ye,mt,Ce,u,h,L);if(Ke!==n){if(Ke)continue;Ae=!1;break}if(ze){if(!t1(h,function(St,Et){if(!Vd(ze,Et)&&(Ye===St||M(Ye,St,y,E,L)))return ze.push(Et)})){Ae=!1;break}}else if(!(Ye===mt||M(Ye,mt,y,E,L))){Ae=!1;break}}return L.delete(u),L.delete(h),Ae}function vae(u,h,y,E,M,L,z){switch(y){case Ue:if(u.byteLength!=h.byteLength||u.byteOffset!=h.byteOffset)return!1;u=u.buffer,h=h.buffer;case Ne:return!(u.byteLength!=h.byteLength||!L(new Ag(u),new Ag(h)));case ee:case Q:case Se:return Mi(+u,+h);case we:return u.name==h.name&&u.message==h.message;case Gt:case gn:return u==h+"";case ae:var U=a1;case Bt:var Z=E&v;if(U||(U=Og),u.size!=h.size&&!Z)return!1;var be=z.get(u);if(be)return be==h;E|=b,z.set(u,h);var ye=MI(U(u),U(h),E,M,L,z);return z.delete(u),ye;case Rt:if(Gd)return Gd.call(u)==Gd.call(h)}return!1}function bae(u,h,y,E,M,L){var z=y&v,U=A1(u),Z=U.length,be=A1(h),ye=be.length;if(Z!=ye&&!z)return!1;for(var Ce=Z;Ce--;){var Ae=U[Ce];if(!(z?Ae in h:$t.call(h,Ae)))return!1}var ze=L.get(u),Ye=L.get(h);if(ze&&Ye)return ze==h&&Ye==u;var mt=!0;L.set(u,h),L.set(h,u);for(var Ke=z;++Ce<Z;){Ae=U[Ce];var St=u[Ae],Et=h[Ae];if(E)var Gr=z?E(Et,St,Ae,h,u,L):E(St,Et,Ae,u,h,L);if(!(Gr===n?St===Et||M(St,Et,y,E,L):Gr)){mt=!1;break}Ke||(Ke=Ae=="constructor")}if(mt&&!Ke){var rr=u.constructor,Yr=h.constructor;rr!=Yr&&"constructor"in u&&"constructor"in h&&!(typeof rr=="function"&&rr instanceof rr&&typeof Yr=="function"&&Yr instanceof Yr)&&(mt=!1)}return L.delete(u),L.delete(h),mt}function Fo(u){return z1(LI(u,n,UI),u+"")}function A1(u){return XA(u,An,L1)}function I1(u){return XA(u,xr,TI)}var N1=$g?function(u){return $g.get(u)}:J1;function Zg(u){for(var h=u.name+"",y=Dc[h],E=$t.call(Dc,h)?y.length:0;E--;){var M=y[E],L=M.func;if(L==null||L==u)return M.name}return h}function Ic(u){var h=$t.call(N,"placeholder")?N:u;return h.placeholder}function Ge(){var u=N.iteratee||Q1;return u=u===Q1?JA:u,arguments.length?u(arguments[0],arguments[1]):u}function Jg(u,h){var y=u.__data__;return Oae(h)?y[typeof h=="string"?"string":"hash"]:y.map}function R1(u){for(var h=An(u),y=h.length;y--;){var E=h[y],M=u[E];h[y]=[E,M,NI(M)]}return h}function rl(u,h){var y=Doe(u,h);return ZA(y)?y:n}function yae(u){var h=$t.call(u,Za),y=u[Za];try{u[Za]=n;var E=!0}catch{}var M=Mg.call(u);return E&&(h?u[Za]=y:delete u[Za]),M}var L1=c1?function(u){return u==null?[]:(u=Ht(u),Ps(c1(u),function(h){return FA.call(u,h)}))}:ew,TI=c1?function(u){for(var h=[];u;)ks(h,L1(u)),u=Ig(u);return h}:ew,Xn=tr;(u1&&Xn(new u1(new ArrayBuffer(1)))!=Ue||Wd&&Xn(new Wd)!=ae||d1&&Xn(d1.resolve())!=qe||kc&&Xn(new kc)!=Bt||Ud&&Xn(new Ud)!=he)&&(Xn=function(u){var h=tr(u),y=h==dt?u.constructor:n,E=y?il(y):"";if(E)switch(E){case tse:return Ue;case nse:return ae;case rse:return qe;case ise:return Bt;case ose:return he}return h});function xae(u,h,y){for(var E=-1,M=y.length;++E<M;){var L=y[E],z=L.size;switch(L.type){case"drop":u+=z;break;case"dropRight":h-=z;break;case"take":h=Kn(h,u+z);break;case"takeRight":u=Pn(u,h-z);break}}return{start:u,end:h}}function wae(u){var h=u.match(Bd);return h?h[1].split(D):[]}function AI(u,h,y){h=Is(h,u);for(var E=-1,M=h.length,L=!1;++E<M;){var z=io(h[E]);if(!(L=u!=null&&y(u,z)))break;u=u[z]}return L||++E!=M?L:(M=u==null?0:u.length,!!M&&sm(M)&&$o(z,M)&&(st(u)||ol(u)))}function _ae(u){var h=u.length,y=new u.constructor(h);return h&&typeof u[0]=="string"&&$t.call(u,"index")&&(y.index=u.index,y.input=u.input),y}function II(u){return typeof u.constructor=="function"&&!ef(u)?Mc(Ig(u)):{}}function Sae(u,h,y){var E=u.constructor;switch(h){case Ne:return D1(u);case ee:case Q:return new E(+u);case Ue:return sae(u,y);case at:case ln:case cn:case $n:case Br:case Vr:case mn:case vr:case jn:return gI(u,y);case ae:return new E;case Se:case gn:return new E(u);case Gt:return aae(u);case Bt:return new E;case Rt:return lae(u)}}function Cae(u,h){var y=h.length;if(!y)return u;var E=y-1;return h[E]=(y>1?"& ":"")+h[E],h=h.join(y>2?", ":" "),u.replace(zd,`{
67
67
  /* [wrapped with `+h+`] */
68
- `)}function Eae(u){return st(u)||ol(u)||!!($A&&u&&u[$A])}function $o(u,h){var y=typeof u;return h=h??ne,!!h&&(y=="number"||y!="symbol"&&ot.test(u))&&u>-1&&u%1==0&&u<h}function nr(u,h,y){if(!un(y))return!1;var E=typeof h;return(E=="number"?yr(y)&&$o(h,y.length):E=="string"&&h in y)?Mi(y[h],u):!1}function F1(u,h){if(st(u))return!1;var y=typeof u;return y=="number"||y=="symbol"||y=="boolean"||u==null||qr(u)?!0:qa.test(u)||!Ua.test(u)||h!=null&&u in Ht(h)}function Oae(u){var h=typeof u;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?u!=="__proto__":u===null}function $1(u){var h=Zg(u),y=N[h];if(typeof y!="function"||!(h in Ct.prototype))return!1;if(u===y)return!0;var E=N1(y);return!!E&&u===E[0]}function Pae(u){return!!NA&&NA in u}var kae=kg?jo:tw;function ef(u){var h=u&&u.constructor,y=typeof h=="function"&&h.prototype||Pc;return u===y}function NI(u){return u===u&&!un(u)}function RI(u,h){return function(y){return y==null?!1:y[u]===h&&(h!==n||u in Ht(y))}}function Dae(u){var h=im(u,function(E){return y.size===c&&y.clear(),E}),y=h.cache;return h}function Mae(u,h){var y=u[1],E=h[1],M=y|E,L=M<(x|w|T),z=E==T&&y==C||E==T&&y==I&&u[7].length<=h[8]||E==(T|I)&&h[7].length<=h[8]&&y==C;if(!(L||z))return u;E&x&&(u[2]=h[2],M|=y&x?0:S);var U=h[3];if(U){var Z=u[3];u[3]=Z?vI(Z,U,h[4]):U,u[4]=Z?Ds(u[3],d):h[4]}return U=h[5],U&&(Z=u[5],u[5]=Z?bI(Z,U,h[6]):U,u[6]=Z?Ds(u[5],d):h[6]),U=h[7],U&&(u[7]=U),E&T&&(u[8]=u[8]==null?h[8]:Kn(u[8],h[8])),u[9]==null&&(u[9]=h[9]),u[0]=h[0],u[1]=M,u}function Tae(u){var h=[];if(u!=null)for(var y in Ht(u))h.push(y);return h}function Aae(u){return Mg.call(u)}function LI(u,h,y){return h=Pn(h===n?u.length-1:h,0),function(){for(var E=arguments,M=-1,L=Pn(E.length-h,0),z=ce(L);++M<L;)z[M]=E[h+M];M=-1;for(var U=ce(h+1);++M<h;)U[M]=E[M];return U[h]=y(z),Hr(u,this,U)}}function FI(u,h){return h.length<2?u:nl(u,pi(h,0,-1))}function Iae(u,h){for(var y=u.length,E=Kn(h.length,y),M=br(u);E--;){var L=h[E];u[E]=$o(L,y)?M[L]:n}return u}function j1(u,h){if(!(h==="constructor"&&typeof u[h]=="function")&&h!="__proto__")return u[h]}var $I=zI(aI),tf=Yoe||function(u,h){return zn.setTimeout(u,h)},z1=zI(nae);function jI(u,h,y){var E=h+"";return z1(u,Cae(E,Nae(wae(E),y)))}function zI(u){var h=0,y=0;return function(){var E=Zoe(),M=q-(E-y);if(y=E,M>0){if(++h>=V)return arguments[0]}else h=0;return u.apply(n,arguments)}}function em(u,h){var y=-1,E=u.length,M=E-1;for(h=h===n?E:h;++y<h;){var L=_1(y,M),z=u[L];u[L]=u[y],u[y]=z}return u.length=h,u}var BI=Dae(function(u){var h=[];return u.charCodeAt(0)===46&&h.push(""),u.replace($d,function(y,E,M,L){h.push(M?L.replace(Oe,"$1"):E||y)}),h});function io(u){if(typeof u=="string"||qr(u))return u;var h=u+"";return h=="0"&&1/u==-W?"-0":h}function il(u){if(u!=null){try{return Dg.call(u)}catch{}try{return u+""}catch{}}return""}function Nae(u,h){return ui(ue,function(y){var E="_."+y[0];h&y[1]&&!Cg(u,E)&&u.push(E)}),u.sort()}function VI(u){if(u instanceof Ct)return u.clone();var h=new fi(u.__wrapped__,u.__chain__);return h.__actions__=br(u.__actions__),h.__index__=u.__index__,h.__values__=u.__values__,h}function Rae(u,h,y){(y?nr(u,h,y):h===n)?h=1:h=Pn(ft(h),0);var E=u==null?0:u.length;if(!E||h<1)return[];for(var M=0,L=0,z=ce(Lg(E/h));M<E;)z[L++]=pi(u,M,M+=h);return z}function Lae(u){for(var h=-1,y=u==null?0:u.length,E=0,M=[];++h<y;){var L=u[h];L&&(M[E++]=L)}return M}function Fae(){var u=arguments.length;if(!u)return[];for(var h=ce(u-1),y=arguments[0],E=u;E--;)h[E-1]=arguments[E];return ks(st(y)?br(y):[y],Bn(h,1))}var $ae=vt(function(u,h){return vn(u)?Kd(u,Bn(h,1,vn,!0)):[]}),jae=vt(function(u,h){var y=gi(h);return vn(y)&&(y=n),vn(u)?Kd(u,Bn(h,1,vn,!0),Ge(y,2)):[]}),zae=vt(function(u,h){var y=gi(h);return vn(y)&&(y=n),vn(u)?Kd(u,Bn(h,1,vn,!0),n,y):[]});function Bae(u,h,y){var E=u==null?0:u.length;return E?(h=y||h===n?1:ft(h),pi(u,h<0?0:h,E)):[]}function Vae(u,h,y){var E=u==null?0:u.length;return E?(h=y||h===n?1:ft(h),h=E-h,pi(u,0,h<0?0:h)):[]}function Hae(u,h){return u&&u.length?qg(u,Ge(h,3),!0,!0):[]}function Wae(u,h){return u&&u.length?qg(u,Ge(h,3),!0):[]}function Uae(u,h,y,E){var M=u==null?0:u.length;return M?(y&&typeof y!="number"&&nr(u,h,y)&&(y=0,E=M),Fse(u,h,y,E)):[]}function HI(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var M=y==null?0:ft(y);return M<0&&(M=Pn(E+M,0)),Eg(u,Ge(h,3),M)}function WI(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var M=E-1;return y!==n&&(M=ft(y),M=y<0?Pn(E+M,0):Kn(M,E-1)),Eg(u,Ge(h,3),M,!0)}function UI(u){var h=u==null?0:u.length;return h?Bn(u,1):[]}function qae(u){var h=u==null?0:u.length;return h?Bn(u,W):[]}function Gae(u,h){var y=u==null?0:u.length;return y?(h=h===n?1:ft(h),Bn(u,h)):[]}function Yae(u){for(var h=-1,y=u==null?0:u.length,E={};++h<y;){var M=u[h];E[M[0]]=M[1]}return E}function qI(u){return u&&u.length?u[0]:n}function Kae(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var M=y==null?0:ft(y);return M<0&&(M=Pn(E+M,0)),Sc(u,h,M)}function Xae(u){var h=u==null?0:u.length;return h?pi(u,0,-1):[]}var Qae=vt(function(u){var h=sn(u,P1);return h.length&&h[0]===u[0]?v1(h):[]}),Zae=vt(function(u){var h=gi(u),y=sn(u,P1);return h===gi(y)?h=n:y.pop(),y.length&&y[0]===u[0]?v1(y,Ge(h,2)):[]}),Jae=vt(function(u){var h=gi(u),y=sn(u,P1);return h=typeof h=="function"?h:n,h&&y.pop(),y.length&&y[0]===u[0]?v1(y,n,h):[]});function ele(u,h){return u==null?"":Xoe.call(u,h)}function gi(u){var h=u==null?0:u.length;return h?u[h-1]:n}function tle(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var M=E;return y!==n&&(M=ft(y),M=M<0?Pn(E+M,0):Kn(M,E-1)),h===h?Noe(u,h,M):Eg(u,OA,M,!0)}function nle(u,h){return u&&u.length?rI(u,ft(h)):n}var rle=vt(GI);function GI(u,h){return u&&u.length&&h&&h.length?w1(u,h):u}function ile(u,h,y){return u&&u.length&&h&&h.length?w1(u,h,Ge(y,2)):u}function ole(u,h,y){return u&&u.length&&h&&h.length?w1(u,h,n,y):u}var sle=Fo(function(u,h){var y=u==null?0:u.length,E=h1(u,h);return sI(u,sn(h,function(M){return $o(M,y)?+M:M}).sort(mI)),E});function ale(u,h){var y=[];if(!(u&&u.length))return y;var E=-1,M=[],L=u.length;for(h=Ge(h,3);++E<L;){var z=u[E];h(z,E,u)&&(y.push(z),M.push(E))}return sI(u,M),y}function B1(u){return u==null?u:ese.call(u)}function lle(u,h,y){var E=u==null?0:u.length;return E?(y&&typeof y!="number"&&nr(u,h,y)?(h=0,y=E):(h=h==null?0:ft(h),y=y===n?E:ft(y)),pi(u,h,y)):[]}function cle(u,h){return Ug(u,h)}function ule(u,h,y){return C1(u,h,Ge(y,2))}function dle(u,h){var y=u==null?0:u.length;if(y){var E=Ug(u,h);if(E<y&&Mi(u[E],h))return E}return-1}function fle(u,h){return Ug(u,h,!0)}function hle(u,h,y){return C1(u,h,Ge(y,2),!0)}function ple(u,h){var y=u==null?0:u.length;if(y){var E=Ug(u,h,!0)-1;if(Mi(u[E],h))return E}return-1}function gle(u){return u&&u.length?lI(u):[]}function mle(u,h){return u&&u.length?lI(u,Ge(h,2)):[]}function vle(u){var h=u==null?0:u.length;return h?pi(u,1,h):[]}function ble(u,h,y){return u&&u.length?(h=y||h===n?1:ft(h),pi(u,0,h<0?0:h)):[]}function yle(u,h,y){var E=u==null?0:u.length;return E?(h=y||h===n?1:ft(h),h=E-h,pi(u,h<0?0:h,E)):[]}function xle(u,h){return u&&u.length?qg(u,Ge(h,3),!1,!0):[]}function wle(u,h){return u&&u.length?qg(u,Ge(h,3)):[]}var _le=vt(function(u){return As(Bn(u,1,vn,!0))}),Sle=vt(function(u){var h=gi(u);return vn(h)&&(h=n),As(Bn(u,1,vn,!0),Ge(h,2))}),Cle=vt(function(u){var h=gi(u);return h=typeof h=="function"?h:n,As(Bn(u,1,vn,!0),n,h)});function Ele(u){return u&&u.length?As(u):[]}function Ole(u,h){return u&&u.length?As(u,Ge(h,2)):[]}function Ple(u,h){return h=typeof h=="function"?h:n,u&&u.length?As(u,n,h):[]}function V1(u){if(!(u&&u.length))return[];var h=0;return u=Ps(u,function(y){if(vn(y))return h=Pn(y.length,h),!0}),o1(h,function(y){return sn(u,n1(y))})}function YI(u,h){if(!(u&&u.length))return[];var y=V1(u);return h==null?y:sn(y,function(E){return Hr(h,n,E)})}var kle=vt(function(u,h){return vn(u)?Kd(u,h):[]}),Dle=vt(function(u){return O1(Ps(u,vn))}),Mle=vt(function(u){var h=gi(u);return vn(h)&&(h=n),O1(Ps(u,vn),Ge(h,2))}),Tle=vt(function(u){var h=gi(u);return h=typeof h=="function"?h:n,O1(Ps(u,vn),n,h)}),Ale=vt(V1);function Ile(u,h){return fI(u||[],h||[],Yd)}function Nle(u,h){return fI(u||[],h||[],Zd)}var Rle=vt(function(u){var h=u.length,y=h>1?u[h-1]:n;return y=typeof y=="function"?(u.pop(),y):n,YI(u,y)});function KI(u){var h=N(u);return h.__chain__=!0,h}function Lle(u,h){return h(u),u}function tm(u,h){return h(u)}var Fle=Fo(function(u){var h=u.length,y=h?u[0]:0,E=this.__wrapped__,M=function(L){return h1(L,u)};return h>1||this.__actions__.length||!(E instanceof Ct)||!$o(y)?this.thru(M):(E=E.slice(y,+y+(h?1:0)),E.__actions__.push({func:tm,args:[M],thisArg:n}),new fi(E,this.__chain__).thru(function(L){return h&&!L.length&&L.push(n),L}))});function $le(){return KI(this)}function jle(){return new fi(this.value(),this.__chain__)}function zle(){this.__values__===n&&(this.__values__=cN(this.value()));var u=this.__index__>=this.__values__.length,h=u?n:this.__values__[this.__index__++];return{done:u,value:h}}function Ble(){return this}function Vle(u){for(var h,y=this;y instanceof zg;){var E=VI(y);E.__index__=0,E.__values__=n,h?M.__wrapped__=E:h=E;var M=E;y=y.__wrapped__}return M.__wrapped__=u,h}function Hle(){var u=this.__wrapped__;if(u instanceof Ct){var h=u;return this.__actions__.length&&(h=new Ct(this)),h=h.reverse(),h.__actions__.push({func:tm,args:[B1],thisArg:n}),new fi(h,this.__chain__)}return this.thru(B1)}function Wle(){return dI(this.__wrapped__,this.__actions__)}var Ule=Gg(function(u,h,y){$t.call(u,y)?++u[y]:Ro(u,y,1)});function qle(u,h,y){var E=st(u)?CA:Lse;return y&&nr(u,h,y)&&(h=n),E(u,Ge(h,3))}function Gle(u,h){var y=st(u)?Ps:YA;return y(u,Ge(h,3))}var Yle=_I(HI),Kle=_I(WI);function Xle(u,h){return Bn(nm(u,h),1)}function Qle(u,h){return Bn(nm(u,h),W)}function Zle(u,h,y){return y=y===n?1:ft(y),Bn(nm(u,h),y)}function XI(u,h){var y=st(u)?ui:Ts;return y(u,Ge(h,3))}function QI(u,h){var y=st(u)?voe:GA;return y(u,Ge(h,3))}var Jle=Gg(function(u,h,y){$t.call(u,y)?u[y].push(h):Ro(u,y,[h])});function ece(u,h,y,E){u=yr(u)?u:Rc(u),y=y&&!E?ft(y):0;var M=u.length;return y<0&&(y=Pn(M+y,0)),am(u)?y<=M&&u.indexOf(h,y)>-1:!!M&&Sc(u,h,y)>-1}var tce=vt(function(u,h,y){var E=-1,M=typeof h=="function",L=yr(u)?ce(u.length):[];return Ts(u,function(z){L[++E]=M?Hr(h,z,y):Xd(z,h,y)}),L}),nce=Gg(function(u,h,y){Ro(u,y,h)});function nm(u,h){var y=st(u)?sn:eI;return y(u,Ge(h,3))}function rce(u,h,y,E){return u==null?[]:(st(h)||(h=h==null?[]:[h]),y=E?n:y,st(y)||(y=y==null?[]:[y]),iI(u,h,y))}var ice=Gg(function(u,h,y){u[y?0:1].push(h)},function(){return[[],[]]});function oce(u,h,y){var E=st(u)?e1:kA,M=arguments.length<3;return E(u,Ge(h,4),y,M,Ts)}function sce(u,h,y){var E=st(u)?boe:kA,M=arguments.length<3;return E(u,Ge(h,4),y,M,GA)}function ace(u,h){var y=st(u)?Ps:YA;return y(u,om(Ge(h,3)))}function lce(u){var h=st(u)?HA:eae;return h(u)}function cce(u,h,y){(y?nr(u,h,y):h===n)?h=1:h=ft(h);var E=st(u)?Tse:tae;return E(u,h)}function uce(u){var h=st(u)?Ase:rae;return h(u)}function dce(u){if(u==null)return 0;if(yr(u))return am(u)?Ec(u):u.length;var h=Xn(u);return h==ae||h==Bt?u.size:y1(u).length}function fce(u,h,y){var E=st(u)?t1:iae;return y&&nr(u,h,y)&&(h=n),E(u,Ge(h,3))}var hce=vt(function(u,h){if(u==null)return[];var y=h.length;return y>1&&nr(u,h[0],h[1])?h=[]:y>2&&nr(h[0],h[1],h[2])&&(h=[h[0]]),iI(u,Bn(h,1),[])}),rm=Goe||function(){return zn.Date.now()};function pce(u,h){if(typeof h!="function")throw new di(s);return u=ft(u),function(){if(--u<1)return h.apply(this,arguments)}}function ZI(u,h,y){return h=y?n:h,h=u&&h==null?u.length:h,Lo(u,T,n,n,n,n,h)}function JI(u,h){var y;if(typeof h!="function")throw new di(s);return u=ft(u),function(){return--u>0&&(y=h.apply(this,arguments)),u<=1&&(h=n),y}}var H1=vt(function(u,h,y){var E=x;if(y.length){var M=Ds(y,Ic(H1));E|=O}return Lo(u,E,h,y,M)}),eN=vt(function(u,h,y){var E=x|w;if(y.length){var M=Ds(y,Ic(eN));E|=O}return Lo(h,E,u,y,M)});function tN(u,h,y){h=y?n:h;var E=Lo(u,C,n,n,n,n,n,h);return E.placeholder=tN.placeholder,E}function nN(u,h,y){h=y?n:h;var E=Lo(u,P,n,n,n,n,n,h);return E.placeholder=nN.placeholder,E}function rN(u,h,y){var E,M,L,z,U,Z,be=0,ye=!1,Ce=!1,Ae=!0;if(typeof u!="function")throw new di(s);h=mi(h)||0,un(y)&&(ye=!!y.leading,Ce="maxWait"in y,L=Ce?Pn(mi(y.maxWait)||0,h):L,Ae="trailing"in y?!!y.trailing:Ae);function ze(bn){var Ti=E,Bo=M;return E=M=n,be=bn,z=u.apply(Bo,Ti),z}function Ye(bn){return be=bn,U=tf(St,h),ye?ze(bn):z}function mt(bn){var Ti=bn-Z,Bo=bn-be,_N=h-Ti;return Ce?Kn(_N,L-Bo):_N}function Ke(bn){var Ti=bn-Z,Bo=bn-be;return Z===n||Ti>=h||Ti<0||Ce&&Bo>=L}function St(){var bn=rm();if(Ke(bn))return Et(bn);U=tf(St,mt(bn))}function Et(bn){return U=n,Ae&&E?ze(bn):(E=M=n,z)}function Gr(){U!==n&&hI(U),be=0,E=Z=M=U=n}function rr(){return U===n?z:Et(rm())}function Yr(){var bn=rm(),Ti=Ke(bn);if(E=arguments,M=this,Z=bn,Ti){if(U===n)return Ye(Z);if(Ce)return hI(U),U=tf(St,h),ze(Z)}return U===n&&(U=tf(St,h)),z}return Yr.cancel=Gr,Yr.flush=rr,Yr}var gce=vt(function(u,h){return qA(u,1,h)}),mce=vt(function(u,h,y){return qA(u,mi(h)||0,y)});function vce(u){return Lo(u,F)}function im(u,h){if(typeof u!="function"||h!=null&&typeof h!="function")throw new di(s);var y=function(){var E=arguments,M=h?h.apply(this,E):E[0],L=y.cache;if(L.has(M))return L.get(M);var z=u.apply(this,E);return y.cache=L.set(M,z)||L,z};return y.cache=new(im.Cache||No),y}im.Cache=No;function om(u){if(typeof u!="function")throw new di(s);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}function bce(u){return JI(2,u)}var yce=oae(function(u,h){h=h.length==1&&st(h[0])?sn(h[0],Wr(Ge())):sn(Bn(h,1),Wr(Ge()));var y=h.length;return vt(function(E){for(var M=-1,L=Kn(E.length,y);++M<L;)E[M]=h[M].call(this,E[M]);return Hr(u,this,E)})}),W1=vt(function(u,h){var y=Ds(h,Ic(W1));return Lo(u,O,n,h,y)}),iN=vt(function(u,h){var y=Ds(h,Ic(iN));return Lo(u,k,n,h,y)}),xce=Fo(function(u,h){return Lo(u,I,n,n,n,h)});function wce(u,h){if(typeof u!="function")throw new di(s);return h=h===n?h:ft(h),vt(u,h)}function _ce(u,h){if(typeof u!="function")throw new di(s);return h=h==null?0:Pn(ft(h),0),vt(function(y){var E=y[h],M=Ns(y,0,h);return E&&ks(M,E),Hr(u,this,M)})}function Sce(u,h,y){var E=!0,M=!0;if(typeof u!="function")throw new di(s);return un(y)&&(E="leading"in y?!!y.leading:E,M="trailing"in y?!!y.trailing:M),rN(u,h,{leading:E,maxWait:h,trailing:M})}function Cce(u){return ZI(u,1)}function Ece(u,h){return W1(k1(h),u)}function Oce(){if(!arguments.length)return[];var u=arguments[0];return st(u)?u:[u]}function Pce(u){return hi(u,p)}function kce(u,h){return h=typeof h=="function"?h:n,hi(u,p,h)}function Dce(u){return hi(u,f|p)}function Mce(u,h){return h=typeof h=="function"?h:n,hi(u,f|p,h)}function Tce(u,h){return h==null||UA(u,h,An(h))}function Mi(u,h){return u===h||u!==u&&h!==h}var Ace=Qg(m1),Ice=Qg(function(u,h){return u>=h}),ol=QA(function(){return arguments}())?QA:function(u){return hn(u)&&$t.call(u,"callee")&&!FA.call(u,"callee")},st=ce.isArray,Nce=bA?Wr(bA):Vse;function yr(u){return u!=null&&sm(u.length)&&!jo(u)}function vn(u){return hn(u)&&yr(u)}function Rce(u){return u===!0||u===!1||hn(u)&&tr(u)==ee}var Rs=Koe||tw,Lce=yA?Wr(yA):Hse;function Fce(u){return hn(u)&&u.nodeType===1&&!nf(u)}function $ce(u){if(u==null)return!0;if(yr(u)&&(st(u)||typeof u=="string"||typeof u.splice=="function"||Rs(u)||Nc(u)||ol(u)))return!u.length;var h=Xn(u);if(h==ae||h==Bt)return!u.size;if(ef(u))return!y1(u).length;for(var y in u)if($t.call(u,y))return!1;return!0}function jce(u,h){return Qd(u,h)}function zce(u,h,y){y=typeof y=="function"?y:n;var E=y?y(u,h):n;return E===n?Qd(u,h,n,y):!!E}function U1(u){if(!hn(u))return!1;var h=tr(u);return h==we||h==ie||typeof u.message=="string"&&typeof u.name=="string"&&!nf(u)}function Bce(u){return typeof u=="number"&&jA(u)}function jo(u){if(!un(u))return!1;var h=tr(u);return h==te||h==Ie||h==pe||h==gt}function oN(u){return typeof u=="number"&&u==ft(u)}function sm(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=ne}function un(u){var h=typeof u;return u!=null&&(h=="object"||h=="function")}function hn(u){return u!=null&&typeof u=="object"}var sN=xA?Wr(xA):Use;function Vce(u,h){return u===h||b1(u,h,R1(h))}function Hce(u,h,y){return y=typeof y=="function"?y:n,b1(u,h,R1(h),y)}function Wce(u){return aN(u)&&u!=+u}function Uce(u){if(kae(u))throw new tt(o);return ZA(u)}function qce(u){return u===null}function Gce(u){return u==null}function aN(u){return typeof u=="number"||hn(u)&&tr(u)==Se}function nf(u){if(!hn(u)||tr(u)!=dt)return!1;var h=Ig(u);if(h===null)return!0;var y=$t.call(h,"constructor")&&h.constructor;return typeof y=="function"&&y instanceof y&&Dg.call(y)==Hoe}var q1=wA?Wr(wA):qse;function Yce(u){return oN(u)&&u>=-ne&&u<=ne}var lN=_A?Wr(_A):Gse;function am(u){return typeof u=="string"||!st(u)&&hn(u)&&tr(u)==gn}function qr(u){return typeof u=="symbol"||hn(u)&&tr(u)==Rt}var Nc=SA?Wr(SA):Yse;function Kce(u){return u===n}function Xce(u){return hn(u)&&Xn(u)==he}function Qce(u){return hn(u)&&tr(u)==Ee}var Zce=Qg(x1),Jce=Qg(function(u,h){return u<=h});function cN(u){if(!u)return[];if(yr(u))return am(u)?ki(u):br(u);if(Hd&&u[Hd])return Toe(u[Hd]());var h=Xn(u),y=h==ae?a1:h==Bt?Og:Rc;return y(u)}function zo(u){if(!u)return u===0?u:0;if(u=mi(u),u===W||u===-W){var h=u<0?-1:1;return h*le}return u===u?u:0}function ft(u){var h=zo(u),y=h%1;return h===h?y?h-y:h:0}function uN(u){return u?tl(ft(u),0,H):0}function mi(u){if(typeof u=="number")return u;if(qr(u))return A;if(un(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=un(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=DA(u);var y=Te.test(u);return y||et.test(u)?poe(u.slice(2),y?2:8):Re.test(u)?A:+u}function dN(u){return ro(u,xr(u))}function eue(u){return u?tl(ft(u),-ne,ne):u===0?u:0}function Lt(u){return u==null?"":Ur(u)}var tue=Tc(function(u,h){if(ef(h)||yr(h)){ro(h,An(h),u);return}for(var y in h)$t.call(h,y)&&Yd(u,y,h[y])}),fN=Tc(function(u,h){ro(h,xr(h),u)}),lm=Tc(function(u,h,y,E){ro(h,xr(h),u,E)}),nue=Tc(function(u,h,y,E){ro(h,An(h),u,E)}),rue=Fo(h1);function iue(u,h){var y=Mc(u);return h==null?y:WA(y,h)}var oue=vt(function(u,h){u=Ht(u);var y=-1,E=h.length,M=E>2?h[2]:n;for(M&&nr(h[0],h[1],M)&&(E=1);++y<E;)for(var L=h[y],z=xr(L),U=-1,Z=z.length;++U<Z;){var be=z[U],ye=u[be];(ye===n||Mi(ye,Pc[be])&&!$t.call(u,be))&&(u[be]=L[be])}return u}),sue=vt(function(u){return u.push(n,DI),Hr(hN,n,u)});function aue(u,h){return EA(u,Ge(h,3),no)}function lue(u,h){return EA(u,Ge(h,3),g1)}function cue(u,h){return u==null?u:p1(u,Ge(h,3),xr)}function uue(u,h){return u==null?u:KA(u,Ge(h,3),xr)}function due(u,h){return u&&no(u,Ge(h,3))}function fue(u,h){return u&&g1(u,Ge(h,3))}function hue(u){return u==null?[]:Hg(u,An(u))}function pue(u){return u==null?[]:Hg(u,xr(u))}function G1(u,h,y){var E=u==null?n:nl(u,h);return E===n?y:E}function gue(u,h){return u!=null&&AI(u,h,$se)}function Y1(u,h){return u!=null&&AI(u,h,jse)}var mue=CI(function(u,h,y){h!=null&&typeof h.toString!="function"&&(h=Mg.call(h)),u[h]=y},X1(wr)),vue=CI(function(u,h,y){h!=null&&typeof h.toString!="function"&&(h=Mg.call(h)),$t.call(u,h)?u[h].push(y):u[h]=[y]},Ge),bue=vt(Xd);function An(u){return yr(u)?VA(u):y1(u)}function xr(u){return yr(u)?VA(u,!0):Kse(u)}function yue(u,h){var y={};return h=Ge(h,3),no(u,function(E,M,L){Ro(y,h(E,M,L),E)}),y}function xue(u,h){var y={};return h=Ge(h,3),no(u,function(E,M,L){Ro(y,M,h(E,M,L))}),y}var wue=Tc(function(u,h,y){Wg(u,h,y)}),hN=Tc(function(u,h,y,E){Wg(u,h,y,E)}),_ue=Fo(function(u,h){var y={};if(u==null)return y;var E=!1;h=sn(h,function(L){return L=Is(L,u),E||(E=L.length>1),L}),ro(u,I1(u),y),E&&(y=hi(y,f|g|p,mae));for(var M=h.length;M--;)E1(y,h[M]);return y});function Sue(u,h){return pN(u,om(Ge(h)))}var Cue=Fo(function(u,h){return u==null?{}:Qse(u,h)});function pN(u,h){if(u==null)return{};var y=sn(I1(u),function(E){return[E]});return h=Ge(h),oI(u,y,function(E,M){return h(E,M[0])})}function Eue(u,h,y){h=Is(h,u);var E=-1,M=h.length;for(M||(M=1,u=n);++E<M;){var L=u==null?n:u[io(h[E])];L===n&&(E=M,L=y),u=jo(L)?L.call(u):L}return u}function Oue(u,h,y){return u==null?u:Zd(u,h,y)}function Pue(u,h,y,E){return E=typeof E=="function"?E:n,u==null?u:Zd(u,h,y,E)}var gN=PI(An),mN=PI(xr);function kue(u,h,y){var E=st(u),M=E||Rs(u)||Nc(u);if(h=Ge(h,4),y==null){var L=u&&u.constructor;M?y=E?new L:[]:un(u)?y=jo(L)?Mc(Ig(u)):{}:y={}}return(M?ui:no)(u,function(z,U,Z){return h(y,z,U,Z)}),y}function Due(u,h){return u==null?!0:E1(u,h)}function Mue(u,h,y){return u==null?u:uI(u,h,k1(y))}function Tue(u,h,y,E){return E=typeof E=="function"?E:n,u==null?u:uI(u,h,k1(y),E)}function Rc(u){return u==null?[]:s1(u,An(u))}function Aue(u){return u==null?[]:s1(u,xr(u))}function Iue(u,h,y){return y===n&&(y=h,h=n),y!==n&&(y=mi(y),y=y===y?y:0),h!==n&&(h=mi(h),h=h===h?h:0),tl(mi(u),h,y)}function Nue(u,h,y){return h=zo(h),y===n?(y=h,h=0):y=zo(y),u=mi(u),zse(u,h,y)}function Rue(u,h,y){if(y&&typeof y!="boolean"&&nr(u,h,y)&&(h=y=n),y===n&&(typeof h=="boolean"?(y=h,h=n):typeof u=="boolean"&&(y=u,u=n)),u===n&&h===n?(u=0,h=1):(u=zo(u),h===n?(h=u,u=0):h=zo(h)),u>h){var E=u;u=h,h=E}if(y||u%1||h%1){var M=zA();return Kn(u+M*(h-u+hoe("1e-"+((M+"").length-1))),h)}return _1(u,h)}var Lue=Ac(function(u,h,y){return h=h.toLowerCase(),u+(y?vN(h):h)});function vN(u){return K1(Lt(u).toLowerCase())}function bN(u){return u=Lt(u),u&&u.replace(Vt,Ooe).replace(roe,"")}function Fue(u,h,y){u=Lt(u),h=Ur(h);var E=u.length;y=y===n?E:tl(ft(y),0,E);var M=y;return y-=h.length,y>=0&&u.slice(y,M)==h}function $ue(u){return u=Lt(u),u&&Ha.test(u)?u.replace(to,Poe):u}function jue(u){return u=Lt(u),u&&Ya.test(u)?u.replace(Ga,"\\$&"):u}var zue=Ac(function(u,h,y){return u+(y?"-":"")+h.toLowerCase()}),Bue=Ac(function(u,h,y){return u+(y?" ":"")+h.toLowerCase()}),Vue=wI("toLowerCase");function Hue(u,h,y){u=Lt(u),h=ft(h);var E=h?Ec(u):0;if(!h||E>=h)return u;var M=(h-E)/2;return Xg(Fg(M),y)+u+Xg(Lg(M),y)}function Wue(u,h,y){u=Lt(u),h=ft(h);var E=h?Ec(u):0;return h&&E<h?u+Xg(h-E,y):u}function Uue(u,h,y){u=Lt(u),h=ft(h);var E=h?Ec(u):0;return h&&E<h?Xg(h-E,y)+u:u}function que(u,h,y){return y||h==null?h=0:h&&(h=+h),Joe(Lt(u).replace(Ka,""),h||0)}function Gue(u,h,y){return(y?nr(u,h,y):h===n)?h=1:h=ft(h),S1(Lt(u),h)}function Yue(){var u=arguments,h=Lt(u[0]);return u.length<3?h:h.replace(u[1],u[2])}var Kue=Ac(function(u,h,y){return u+(y?"_":"")+h.toLowerCase()});function Xue(u,h,y){return y&&typeof y!="number"&&nr(u,h,y)&&(h=y=n),y=y===n?H:y>>>0,y?(u=Lt(u),u&&(typeof h=="string"||h!=null&&!q1(h))&&(h=Ur(h),!h&&Cc(u))?Ns(ki(u),0,y):u.split(h,y)):[]}var Que=Ac(function(u,h,y){return u+(y?" ":"")+K1(h)});function Zue(u,h,y){return u=Lt(u),y=y==null?0:tl(ft(y),0,u.length),h=Ur(h),u.slice(y,y+h.length)==h}function Jue(u,h,y){var E=N.templateSettings;y&&nr(u,h,y)&&(h=n),u=Lt(u),h=lm({},h,E,kI);var M=lm({},h.imports,E.imports,kI),L=An(M),z=s1(M,L),U,Z,be=0,ye=h.interpolate||Tn,Ce="__p += '",Ae=l1((h.escape||Tn).source+"|"+ye.source+"|"+(ye===wc?$e:Tn).source+"|"+(h.evaluate||Tn).source+"|$","g"),ze="//# sourceURL="+($t.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++loe+"]")+`
68
+ `)}function Eae(u){return st(u)||ol(u)||!!($A&&u&&u[$A])}function $o(u,h){var y=typeof u;return h=h??te,!!h&&(y=="number"||y!="symbol"&&ot.test(u))&&u>-1&&u%1==0&&u<h}function nr(u,h,y){if(!un(y))return!1;var E=typeof h;return(E=="number"?yr(y)&&$o(h,y.length):E=="string"&&h in y)?Mi(y[h],u):!1}function F1(u,h){if(st(u))return!1;var y=typeof u;return y=="number"||y=="symbol"||y=="boolean"||u==null||qr(u)?!0:qa.test(u)||!Ua.test(u)||h!=null&&u in Ht(h)}function Oae(u){var h=typeof u;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?u!=="__proto__":u===null}function $1(u){var h=Zg(u),y=N[h];if(typeof y!="function"||!(h in Ct.prototype))return!1;if(u===y)return!0;var E=N1(y);return!!E&&u===E[0]}function Pae(u){return!!NA&&NA in u}var kae=kg?jo:tw;function ef(u){var h=u&&u.constructor,y=typeof h=="function"&&h.prototype||Pc;return u===y}function NI(u){return u===u&&!un(u)}function RI(u,h){return function(y){return y==null?!1:y[u]===h&&(h!==n||u in Ht(y))}}function Dae(u){var h=im(u,function(E){return y.size===c&&y.clear(),E}),y=h.cache;return h}function Mae(u,h){var y=u[1],E=h[1],M=y|E,L=M<(x|w|T),z=E==T&&y==C||E==T&&y==I&&u[7].length<=h[8]||E==(T|I)&&h[7].length<=h[8]&&y==C;if(!(L||z))return u;E&x&&(u[2]=h[2],M|=y&x?0:S);var U=h[3];if(U){var Z=u[3];u[3]=Z?vI(Z,U,h[4]):U,u[4]=Z?Ds(u[3],d):h[4]}return U=h[5],U&&(Z=u[5],u[5]=Z?bI(Z,U,h[6]):U,u[6]=Z?Ds(u[5],d):h[6]),U=h[7],U&&(u[7]=U),E&T&&(u[8]=u[8]==null?h[8]:Kn(u[8],h[8])),u[9]==null&&(u[9]=h[9]),u[0]=h[0],u[1]=M,u}function Tae(u){var h=[];if(u!=null)for(var y in Ht(u))h.push(y);return h}function Aae(u){return Mg.call(u)}function LI(u,h,y){return h=Pn(h===n?u.length-1:h,0),function(){for(var E=arguments,M=-1,L=Pn(E.length-h,0),z=ce(L);++M<L;)z[M]=E[h+M];M=-1;for(var U=ce(h+1);++M<h;)U[M]=E[M];return U[h]=y(z),Hr(u,this,U)}}function FI(u,h){return h.length<2?u:nl(u,pi(h,0,-1))}function Iae(u,h){for(var y=u.length,E=Kn(h.length,y),M=br(u);E--;){var L=h[E];u[E]=$o(L,y)?M[L]:n}return u}function j1(u,h){if(!(h==="constructor"&&typeof u[h]=="function")&&h!="__proto__")return u[h]}var $I=zI(aI),tf=Yoe||function(u,h){return zn.setTimeout(u,h)},z1=zI(nae);function jI(u,h,y){var E=h+"";return z1(u,Cae(E,Nae(wae(E),y)))}function zI(u){var h=0,y=0;return function(){var E=Zoe(),M=q-(E-y);if(y=E,M>0){if(++h>=V)return arguments[0]}else h=0;return u.apply(n,arguments)}}function em(u,h){var y=-1,E=u.length,M=E-1;for(h=h===n?E:h;++y<h;){var L=_1(y,M),z=u[L];u[L]=u[y],u[y]=z}return u.length=h,u}var BI=Dae(function(u){var h=[];return u.charCodeAt(0)===46&&h.push(""),u.replace($d,function(y,E,M,L){h.push(M?L.replace(Oe,"$1"):E||y)}),h});function io(u){if(typeof u=="string"||qr(u))return u;var h=u+"";return h=="0"&&1/u==-W?"-0":h}function il(u){if(u!=null){try{return Dg.call(u)}catch{}try{return u+""}catch{}}return""}function Nae(u,h){return ui(ue,function(y){var E="_."+y[0];h&y[1]&&!Cg(u,E)&&u.push(E)}),u.sort()}function VI(u){if(u instanceof Ct)return u.clone();var h=new fi(u.__wrapped__,u.__chain__);return h.__actions__=br(u.__actions__),h.__index__=u.__index__,h.__values__=u.__values__,h}function Rae(u,h,y){(y?nr(u,h,y):h===n)?h=1:h=Pn(ft(h),0);var E=u==null?0:u.length;if(!E||h<1)return[];for(var M=0,L=0,z=ce(Lg(E/h));M<E;)z[L++]=pi(u,M,M+=h);return z}function Lae(u){for(var h=-1,y=u==null?0:u.length,E=0,M=[];++h<y;){var L=u[h];L&&(M[E++]=L)}return M}function Fae(){var u=arguments.length;if(!u)return[];for(var h=ce(u-1),y=arguments[0],E=u;E--;)h[E-1]=arguments[E];return ks(st(y)?br(y):[y],Bn(h,1))}var $ae=vt(function(u,h){return vn(u)?Kd(u,Bn(h,1,vn,!0)):[]}),jae=vt(function(u,h){var y=gi(h);return vn(y)&&(y=n),vn(u)?Kd(u,Bn(h,1,vn,!0),Ge(y,2)):[]}),zae=vt(function(u,h){var y=gi(h);return vn(y)&&(y=n),vn(u)?Kd(u,Bn(h,1,vn,!0),n,y):[]});function Bae(u,h,y){var E=u==null?0:u.length;return E?(h=y||h===n?1:ft(h),pi(u,h<0?0:h,E)):[]}function Vae(u,h,y){var E=u==null?0:u.length;return E?(h=y||h===n?1:ft(h),h=E-h,pi(u,0,h<0?0:h)):[]}function Hae(u,h){return u&&u.length?qg(u,Ge(h,3),!0,!0):[]}function Wae(u,h){return u&&u.length?qg(u,Ge(h,3),!0):[]}function Uae(u,h,y,E){var M=u==null?0:u.length;return M?(y&&typeof y!="number"&&nr(u,h,y)&&(y=0,E=M),Fse(u,h,y,E)):[]}function HI(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var M=y==null?0:ft(y);return M<0&&(M=Pn(E+M,0)),Eg(u,Ge(h,3),M)}function WI(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var M=E-1;return y!==n&&(M=ft(y),M=y<0?Pn(E+M,0):Kn(M,E-1)),Eg(u,Ge(h,3),M,!0)}function UI(u){var h=u==null?0:u.length;return h?Bn(u,1):[]}function qae(u){var h=u==null?0:u.length;return h?Bn(u,W):[]}function Gae(u,h){var y=u==null?0:u.length;return y?(h=h===n?1:ft(h),Bn(u,h)):[]}function Yae(u){for(var h=-1,y=u==null?0:u.length,E={};++h<y;){var M=u[h];E[M[0]]=M[1]}return E}function qI(u){return u&&u.length?u[0]:n}function Kae(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var M=y==null?0:ft(y);return M<0&&(M=Pn(E+M,0)),Sc(u,h,M)}function Xae(u){var h=u==null?0:u.length;return h?pi(u,0,-1):[]}var Qae=vt(function(u){var h=sn(u,P1);return h.length&&h[0]===u[0]?v1(h):[]}),Zae=vt(function(u){var h=gi(u),y=sn(u,P1);return h===gi(y)?h=n:y.pop(),y.length&&y[0]===u[0]?v1(y,Ge(h,2)):[]}),Jae=vt(function(u){var h=gi(u),y=sn(u,P1);return h=typeof h=="function"?h:n,h&&y.pop(),y.length&&y[0]===u[0]?v1(y,n,h):[]});function ele(u,h){return u==null?"":Xoe.call(u,h)}function gi(u){var h=u==null?0:u.length;return h?u[h-1]:n}function tle(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var M=E;return y!==n&&(M=ft(y),M=M<0?Pn(E+M,0):Kn(M,E-1)),h===h?Noe(u,h,M):Eg(u,OA,M,!0)}function nle(u,h){return u&&u.length?rI(u,ft(h)):n}var rle=vt(GI);function GI(u,h){return u&&u.length&&h&&h.length?w1(u,h):u}function ile(u,h,y){return u&&u.length&&h&&h.length?w1(u,h,Ge(y,2)):u}function ole(u,h,y){return u&&u.length&&h&&h.length?w1(u,h,n,y):u}var sle=Fo(function(u,h){var y=u==null?0:u.length,E=h1(u,h);return sI(u,sn(h,function(M){return $o(M,y)?+M:M}).sort(mI)),E});function ale(u,h){var y=[];if(!(u&&u.length))return y;var E=-1,M=[],L=u.length;for(h=Ge(h,3);++E<L;){var z=u[E];h(z,E,u)&&(y.push(z),M.push(E))}return sI(u,M),y}function B1(u){return u==null?u:ese.call(u)}function lle(u,h,y){var E=u==null?0:u.length;return E?(y&&typeof y!="number"&&nr(u,h,y)?(h=0,y=E):(h=h==null?0:ft(h),y=y===n?E:ft(y)),pi(u,h,y)):[]}function cle(u,h){return Ug(u,h)}function ule(u,h,y){return C1(u,h,Ge(y,2))}function dle(u,h){var y=u==null?0:u.length;if(y){var E=Ug(u,h);if(E<y&&Mi(u[E],h))return E}return-1}function fle(u,h){return Ug(u,h,!0)}function hle(u,h,y){return C1(u,h,Ge(y,2),!0)}function ple(u,h){var y=u==null?0:u.length;if(y){var E=Ug(u,h,!0)-1;if(Mi(u[E],h))return E}return-1}function gle(u){return u&&u.length?lI(u):[]}function mle(u,h){return u&&u.length?lI(u,Ge(h,2)):[]}function vle(u){var h=u==null?0:u.length;return h?pi(u,1,h):[]}function ble(u,h,y){return u&&u.length?(h=y||h===n?1:ft(h),pi(u,0,h<0?0:h)):[]}function yle(u,h,y){var E=u==null?0:u.length;return E?(h=y||h===n?1:ft(h),h=E-h,pi(u,h<0?0:h,E)):[]}function xle(u,h){return u&&u.length?qg(u,Ge(h,3),!1,!0):[]}function wle(u,h){return u&&u.length?qg(u,Ge(h,3)):[]}var _le=vt(function(u){return As(Bn(u,1,vn,!0))}),Sle=vt(function(u){var h=gi(u);return vn(h)&&(h=n),As(Bn(u,1,vn,!0),Ge(h,2))}),Cle=vt(function(u){var h=gi(u);return h=typeof h=="function"?h:n,As(Bn(u,1,vn,!0),n,h)});function Ele(u){return u&&u.length?As(u):[]}function Ole(u,h){return u&&u.length?As(u,Ge(h,2)):[]}function Ple(u,h){return h=typeof h=="function"?h:n,u&&u.length?As(u,n,h):[]}function V1(u){if(!(u&&u.length))return[];var h=0;return u=Ps(u,function(y){if(vn(y))return h=Pn(y.length,h),!0}),o1(h,function(y){return sn(u,n1(y))})}function YI(u,h){if(!(u&&u.length))return[];var y=V1(u);return h==null?y:sn(y,function(E){return Hr(h,n,E)})}var kle=vt(function(u,h){return vn(u)?Kd(u,h):[]}),Dle=vt(function(u){return O1(Ps(u,vn))}),Mle=vt(function(u){var h=gi(u);return vn(h)&&(h=n),O1(Ps(u,vn),Ge(h,2))}),Tle=vt(function(u){var h=gi(u);return h=typeof h=="function"?h:n,O1(Ps(u,vn),n,h)}),Ale=vt(V1);function Ile(u,h){return fI(u||[],h||[],Yd)}function Nle(u,h){return fI(u||[],h||[],Zd)}var Rle=vt(function(u){var h=u.length,y=h>1?u[h-1]:n;return y=typeof y=="function"?(u.pop(),y):n,YI(u,y)});function KI(u){var h=N(u);return h.__chain__=!0,h}function Lle(u,h){return h(u),u}function tm(u,h){return h(u)}var Fle=Fo(function(u){var h=u.length,y=h?u[0]:0,E=this.__wrapped__,M=function(L){return h1(L,u)};return h>1||this.__actions__.length||!(E instanceof Ct)||!$o(y)?this.thru(M):(E=E.slice(y,+y+(h?1:0)),E.__actions__.push({func:tm,args:[M],thisArg:n}),new fi(E,this.__chain__).thru(function(L){return h&&!L.length&&L.push(n),L}))});function $le(){return KI(this)}function jle(){return new fi(this.value(),this.__chain__)}function zle(){this.__values__===n&&(this.__values__=cN(this.value()));var u=this.__index__>=this.__values__.length,h=u?n:this.__values__[this.__index__++];return{done:u,value:h}}function Ble(){return this}function Vle(u){for(var h,y=this;y instanceof zg;){var E=VI(y);E.__index__=0,E.__values__=n,h?M.__wrapped__=E:h=E;var M=E;y=y.__wrapped__}return M.__wrapped__=u,h}function Hle(){var u=this.__wrapped__;if(u instanceof Ct){var h=u;return this.__actions__.length&&(h=new Ct(this)),h=h.reverse(),h.__actions__.push({func:tm,args:[B1],thisArg:n}),new fi(h,this.__chain__)}return this.thru(B1)}function Wle(){return dI(this.__wrapped__,this.__actions__)}var Ule=Gg(function(u,h,y){$t.call(u,y)?++u[y]:Ro(u,y,1)});function qle(u,h,y){var E=st(u)?CA:Lse;return y&&nr(u,h,y)&&(h=n),E(u,Ge(h,3))}function Gle(u,h){var y=st(u)?Ps:YA;return y(u,Ge(h,3))}var Yle=_I(HI),Kle=_I(WI);function Xle(u,h){return Bn(nm(u,h),1)}function Qle(u,h){return Bn(nm(u,h),W)}function Zle(u,h,y){return y=y===n?1:ft(y),Bn(nm(u,h),y)}function XI(u,h){var y=st(u)?ui:Ts;return y(u,Ge(h,3))}function QI(u,h){var y=st(u)?voe:GA;return y(u,Ge(h,3))}var Jle=Gg(function(u,h,y){$t.call(u,y)?u[y].push(h):Ro(u,y,[h])});function ece(u,h,y,E){u=yr(u)?u:Rc(u),y=y&&!E?ft(y):0;var M=u.length;return y<0&&(y=Pn(M+y,0)),am(u)?y<=M&&u.indexOf(h,y)>-1:!!M&&Sc(u,h,y)>-1}var tce=vt(function(u,h,y){var E=-1,M=typeof h=="function",L=yr(u)?ce(u.length):[];return Ts(u,function(z){L[++E]=M?Hr(h,z,y):Xd(z,h,y)}),L}),nce=Gg(function(u,h,y){Ro(u,y,h)});function nm(u,h){var y=st(u)?sn:eI;return y(u,Ge(h,3))}function rce(u,h,y,E){return u==null?[]:(st(h)||(h=h==null?[]:[h]),y=E?n:y,st(y)||(y=y==null?[]:[y]),iI(u,h,y))}var ice=Gg(function(u,h,y){u[y?0:1].push(h)},function(){return[[],[]]});function oce(u,h,y){var E=st(u)?e1:kA,M=arguments.length<3;return E(u,Ge(h,4),y,M,Ts)}function sce(u,h,y){var E=st(u)?boe:kA,M=arguments.length<3;return E(u,Ge(h,4),y,M,GA)}function ace(u,h){var y=st(u)?Ps:YA;return y(u,om(Ge(h,3)))}function lce(u){var h=st(u)?HA:eae;return h(u)}function cce(u,h,y){(y?nr(u,h,y):h===n)?h=1:h=ft(h);var E=st(u)?Tse:tae;return E(u,h)}function uce(u){var h=st(u)?Ase:rae;return h(u)}function dce(u){if(u==null)return 0;if(yr(u))return am(u)?Ec(u):u.length;var h=Xn(u);return h==ae||h==Bt?u.size:y1(u).length}function fce(u,h,y){var E=st(u)?t1:iae;return y&&nr(u,h,y)&&(h=n),E(u,Ge(h,3))}var hce=vt(function(u,h){if(u==null)return[];var y=h.length;return y>1&&nr(u,h[0],h[1])?h=[]:y>2&&nr(h[0],h[1],h[2])&&(h=[h[0]]),iI(u,Bn(h,1),[])}),rm=Goe||function(){return zn.Date.now()};function pce(u,h){if(typeof h!="function")throw new di(s);return u=ft(u),function(){if(--u<1)return h.apply(this,arguments)}}function ZI(u,h,y){return h=y?n:h,h=u&&h==null?u.length:h,Lo(u,T,n,n,n,n,h)}function JI(u,h){var y;if(typeof h!="function")throw new di(s);return u=ft(u),function(){return--u>0&&(y=h.apply(this,arguments)),u<=1&&(h=n),y}}var H1=vt(function(u,h,y){var E=x;if(y.length){var M=Ds(y,Ic(H1));E|=O}return Lo(u,E,h,y,M)}),eN=vt(function(u,h,y){var E=x|w;if(y.length){var M=Ds(y,Ic(eN));E|=O}return Lo(h,E,u,y,M)});function tN(u,h,y){h=y?n:h;var E=Lo(u,C,n,n,n,n,n,h);return E.placeholder=tN.placeholder,E}function nN(u,h,y){h=y?n:h;var E=Lo(u,P,n,n,n,n,n,h);return E.placeholder=nN.placeholder,E}function rN(u,h,y){var E,M,L,z,U,Z,be=0,ye=!1,Ce=!1,Ae=!0;if(typeof u!="function")throw new di(s);h=mi(h)||0,un(y)&&(ye=!!y.leading,Ce="maxWait"in y,L=Ce?Pn(mi(y.maxWait)||0,h):L,Ae="trailing"in y?!!y.trailing:Ae);function ze(bn){var Ti=E,Bo=M;return E=M=n,be=bn,z=u.apply(Bo,Ti),z}function Ye(bn){return be=bn,U=tf(St,h),ye?ze(bn):z}function mt(bn){var Ti=bn-Z,Bo=bn-be,_N=h-Ti;return Ce?Kn(_N,L-Bo):_N}function Ke(bn){var Ti=bn-Z,Bo=bn-be;return Z===n||Ti>=h||Ti<0||Ce&&Bo>=L}function St(){var bn=rm();if(Ke(bn))return Et(bn);U=tf(St,mt(bn))}function Et(bn){return U=n,Ae&&E?ze(bn):(E=M=n,z)}function Gr(){U!==n&&hI(U),be=0,E=Z=M=U=n}function rr(){return U===n?z:Et(rm())}function Yr(){var bn=rm(),Ti=Ke(bn);if(E=arguments,M=this,Z=bn,Ti){if(U===n)return Ye(Z);if(Ce)return hI(U),U=tf(St,h),ze(Z)}return U===n&&(U=tf(St,h)),z}return Yr.cancel=Gr,Yr.flush=rr,Yr}var gce=vt(function(u,h){return qA(u,1,h)}),mce=vt(function(u,h,y){return qA(u,mi(h)||0,y)});function vce(u){return Lo(u,F)}function im(u,h){if(typeof u!="function"||h!=null&&typeof h!="function")throw new di(s);var y=function(){var E=arguments,M=h?h.apply(this,E):E[0],L=y.cache;if(L.has(M))return L.get(M);var z=u.apply(this,E);return y.cache=L.set(M,z)||L,z};return y.cache=new(im.Cache||No),y}im.Cache=No;function om(u){if(typeof u!="function")throw new di(s);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}function bce(u){return JI(2,u)}var yce=oae(function(u,h){h=h.length==1&&st(h[0])?sn(h[0],Wr(Ge())):sn(Bn(h,1),Wr(Ge()));var y=h.length;return vt(function(E){for(var M=-1,L=Kn(E.length,y);++M<L;)E[M]=h[M].call(this,E[M]);return Hr(u,this,E)})}),W1=vt(function(u,h){var y=Ds(h,Ic(W1));return Lo(u,O,n,h,y)}),iN=vt(function(u,h){var y=Ds(h,Ic(iN));return Lo(u,k,n,h,y)}),xce=Fo(function(u,h){return Lo(u,I,n,n,n,h)});function wce(u,h){if(typeof u!="function")throw new di(s);return h=h===n?h:ft(h),vt(u,h)}function _ce(u,h){if(typeof u!="function")throw new di(s);return h=h==null?0:Pn(ft(h),0),vt(function(y){var E=y[h],M=Ns(y,0,h);return E&&ks(M,E),Hr(u,this,M)})}function Sce(u,h,y){var E=!0,M=!0;if(typeof u!="function")throw new di(s);return un(y)&&(E="leading"in y?!!y.leading:E,M="trailing"in y?!!y.trailing:M),rN(u,h,{leading:E,maxWait:h,trailing:M})}function Cce(u){return ZI(u,1)}function Ece(u,h){return W1(k1(h),u)}function Oce(){if(!arguments.length)return[];var u=arguments[0];return st(u)?u:[u]}function Pce(u){return hi(u,p)}function kce(u,h){return h=typeof h=="function"?h:n,hi(u,p,h)}function Dce(u){return hi(u,f|p)}function Mce(u,h){return h=typeof h=="function"?h:n,hi(u,f|p,h)}function Tce(u,h){return h==null||UA(u,h,An(h))}function Mi(u,h){return u===h||u!==u&&h!==h}var Ace=Qg(m1),Ice=Qg(function(u,h){return u>=h}),ol=QA(function(){return arguments}())?QA:function(u){return hn(u)&&$t.call(u,"callee")&&!FA.call(u,"callee")},st=ce.isArray,Nce=bA?Wr(bA):Vse;function yr(u){return u!=null&&sm(u.length)&&!jo(u)}function vn(u){return hn(u)&&yr(u)}function Rce(u){return u===!0||u===!1||hn(u)&&tr(u)==ee}var Rs=Koe||tw,Lce=yA?Wr(yA):Hse;function Fce(u){return hn(u)&&u.nodeType===1&&!nf(u)}function $ce(u){if(u==null)return!0;if(yr(u)&&(st(u)||typeof u=="string"||typeof u.splice=="function"||Rs(u)||Nc(u)||ol(u)))return!u.length;var h=Xn(u);if(h==ae||h==Bt)return!u.size;if(ef(u))return!y1(u).length;for(var y in u)if($t.call(u,y))return!1;return!0}function jce(u,h){return Qd(u,h)}function zce(u,h,y){y=typeof y=="function"?y:n;var E=y?y(u,h):n;return E===n?Qd(u,h,n,y):!!E}function U1(u){if(!hn(u))return!1;var h=tr(u);return h==we||h==ie||typeof u.message=="string"&&typeof u.name=="string"&&!nf(u)}function Bce(u){return typeof u=="number"&&jA(u)}function jo(u){if(!un(u))return!1;var h=tr(u);return h==re||h==Ie||h==pe||h==gt}function oN(u){return typeof u=="number"&&u==ft(u)}function sm(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=te}function un(u){var h=typeof u;return u!=null&&(h=="object"||h=="function")}function hn(u){return u!=null&&typeof u=="object"}var sN=xA?Wr(xA):Use;function Vce(u,h){return u===h||b1(u,h,R1(h))}function Hce(u,h,y){return y=typeof y=="function"?y:n,b1(u,h,R1(h),y)}function Wce(u){return aN(u)&&u!=+u}function Uce(u){if(kae(u))throw new tt(o);return ZA(u)}function qce(u){return u===null}function Gce(u){return u==null}function aN(u){return typeof u=="number"||hn(u)&&tr(u)==Se}function nf(u){if(!hn(u)||tr(u)!=dt)return!1;var h=Ig(u);if(h===null)return!0;var y=$t.call(h,"constructor")&&h.constructor;return typeof y=="function"&&y instanceof y&&Dg.call(y)==Hoe}var q1=wA?Wr(wA):qse;function Yce(u){return oN(u)&&u>=-te&&u<=te}var lN=_A?Wr(_A):Gse;function am(u){return typeof u=="string"||!st(u)&&hn(u)&&tr(u)==gn}function qr(u){return typeof u=="symbol"||hn(u)&&tr(u)==Rt}var Nc=SA?Wr(SA):Yse;function Kce(u){return u===n}function Xce(u){return hn(u)&&Xn(u)==he}function Qce(u){return hn(u)&&tr(u)==Ee}var Zce=Qg(x1),Jce=Qg(function(u,h){return u<=h});function cN(u){if(!u)return[];if(yr(u))return am(u)?ki(u):br(u);if(Hd&&u[Hd])return Toe(u[Hd]());var h=Xn(u),y=h==ae?a1:h==Bt?Og:Rc;return y(u)}function zo(u){if(!u)return u===0?u:0;if(u=mi(u),u===W||u===-W){var h=u<0?-1:1;return h*le}return u===u?u:0}function ft(u){var h=zo(u),y=h%1;return h===h?y?h-y:h:0}function uN(u){return u?tl(ft(u),0,H):0}function mi(u){if(typeof u=="number")return u;if(qr(u))return A;if(un(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=un(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=DA(u);var y=Te.test(u);return y||et.test(u)?poe(u.slice(2),y?2:8):Re.test(u)?A:+u}function dN(u){return ro(u,xr(u))}function eue(u){return u?tl(ft(u),-te,te):u===0?u:0}function Lt(u){return u==null?"":Ur(u)}var tue=Tc(function(u,h){if(ef(h)||yr(h)){ro(h,An(h),u);return}for(var y in h)$t.call(h,y)&&Yd(u,y,h[y])}),fN=Tc(function(u,h){ro(h,xr(h),u)}),lm=Tc(function(u,h,y,E){ro(h,xr(h),u,E)}),nue=Tc(function(u,h,y,E){ro(h,An(h),u,E)}),rue=Fo(h1);function iue(u,h){var y=Mc(u);return h==null?y:WA(y,h)}var oue=vt(function(u,h){u=Ht(u);var y=-1,E=h.length,M=E>2?h[2]:n;for(M&&nr(h[0],h[1],M)&&(E=1);++y<E;)for(var L=h[y],z=xr(L),U=-1,Z=z.length;++U<Z;){var be=z[U],ye=u[be];(ye===n||Mi(ye,Pc[be])&&!$t.call(u,be))&&(u[be]=L[be])}return u}),sue=vt(function(u){return u.push(n,DI),Hr(hN,n,u)});function aue(u,h){return EA(u,Ge(h,3),no)}function lue(u,h){return EA(u,Ge(h,3),g1)}function cue(u,h){return u==null?u:p1(u,Ge(h,3),xr)}function uue(u,h){return u==null?u:KA(u,Ge(h,3),xr)}function due(u,h){return u&&no(u,Ge(h,3))}function fue(u,h){return u&&g1(u,Ge(h,3))}function hue(u){return u==null?[]:Hg(u,An(u))}function pue(u){return u==null?[]:Hg(u,xr(u))}function G1(u,h,y){var E=u==null?n:nl(u,h);return E===n?y:E}function gue(u,h){return u!=null&&AI(u,h,$se)}function Y1(u,h){return u!=null&&AI(u,h,jse)}var mue=CI(function(u,h,y){h!=null&&typeof h.toString!="function"&&(h=Mg.call(h)),u[h]=y},X1(wr)),vue=CI(function(u,h,y){h!=null&&typeof h.toString!="function"&&(h=Mg.call(h)),$t.call(u,h)?u[h].push(y):u[h]=[y]},Ge),bue=vt(Xd);function An(u){return yr(u)?VA(u):y1(u)}function xr(u){return yr(u)?VA(u,!0):Kse(u)}function yue(u,h){var y={};return h=Ge(h,3),no(u,function(E,M,L){Ro(y,h(E,M,L),E)}),y}function xue(u,h){var y={};return h=Ge(h,3),no(u,function(E,M,L){Ro(y,M,h(E,M,L))}),y}var wue=Tc(function(u,h,y){Wg(u,h,y)}),hN=Tc(function(u,h,y,E){Wg(u,h,y,E)}),_ue=Fo(function(u,h){var y={};if(u==null)return y;var E=!1;h=sn(h,function(L){return L=Is(L,u),E||(E=L.length>1),L}),ro(u,I1(u),y),E&&(y=hi(y,f|g|p,mae));for(var M=h.length;M--;)E1(y,h[M]);return y});function Sue(u,h){return pN(u,om(Ge(h)))}var Cue=Fo(function(u,h){return u==null?{}:Qse(u,h)});function pN(u,h){if(u==null)return{};var y=sn(I1(u),function(E){return[E]});return h=Ge(h),oI(u,y,function(E,M){return h(E,M[0])})}function Eue(u,h,y){h=Is(h,u);var E=-1,M=h.length;for(M||(M=1,u=n);++E<M;){var L=u==null?n:u[io(h[E])];L===n&&(E=M,L=y),u=jo(L)?L.call(u):L}return u}function Oue(u,h,y){return u==null?u:Zd(u,h,y)}function Pue(u,h,y,E){return E=typeof E=="function"?E:n,u==null?u:Zd(u,h,y,E)}var gN=PI(An),mN=PI(xr);function kue(u,h,y){var E=st(u),M=E||Rs(u)||Nc(u);if(h=Ge(h,4),y==null){var L=u&&u.constructor;M?y=E?new L:[]:un(u)?y=jo(L)?Mc(Ig(u)):{}:y={}}return(M?ui:no)(u,function(z,U,Z){return h(y,z,U,Z)}),y}function Due(u,h){return u==null?!0:E1(u,h)}function Mue(u,h,y){return u==null?u:uI(u,h,k1(y))}function Tue(u,h,y,E){return E=typeof E=="function"?E:n,u==null?u:uI(u,h,k1(y),E)}function Rc(u){return u==null?[]:s1(u,An(u))}function Aue(u){return u==null?[]:s1(u,xr(u))}function Iue(u,h,y){return y===n&&(y=h,h=n),y!==n&&(y=mi(y),y=y===y?y:0),h!==n&&(h=mi(h),h=h===h?h:0),tl(mi(u),h,y)}function Nue(u,h,y){return h=zo(h),y===n?(y=h,h=0):y=zo(y),u=mi(u),zse(u,h,y)}function Rue(u,h,y){if(y&&typeof y!="boolean"&&nr(u,h,y)&&(h=y=n),y===n&&(typeof h=="boolean"?(y=h,h=n):typeof u=="boolean"&&(y=u,u=n)),u===n&&h===n?(u=0,h=1):(u=zo(u),h===n?(h=u,u=0):h=zo(h)),u>h){var E=u;u=h,h=E}if(y||u%1||h%1){var M=zA();return Kn(u+M*(h-u+hoe("1e-"+((M+"").length-1))),h)}return _1(u,h)}var Lue=Ac(function(u,h,y){return h=h.toLowerCase(),u+(y?vN(h):h)});function vN(u){return K1(Lt(u).toLowerCase())}function bN(u){return u=Lt(u),u&&u.replace(Vt,Ooe).replace(roe,"")}function Fue(u,h,y){u=Lt(u),h=Ur(h);var E=u.length;y=y===n?E:tl(ft(y),0,E);var M=y;return y-=h.length,y>=0&&u.slice(y,M)==h}function $ue(u){return u=Lt(u),u&&Ha.test(u)?u.replace(to,Poe):u}function jue(u){return u=Lt(u),u&&Ya.test(u)?u.replace(Ga,"\\$&"):u}var zue=Ac(function(u,h,y){return u+(y?"-":"")+h.toLowerCase()}),Bue=Ac(function(u,h,y){return u+(y?" ":"")+h.toLowerCase()}),Vue=wI("toLowerCase");function Hue(u,h,y){u=Lt(u),h=ft(h);var E=h?Ec(u):0;if(!h||E>=h)return u;var M=(h-E)/2;return Xg(Fg(M),y)+u+Xg(Lg(M),y)}function Wue(u,h,y){u=Lt(u),h=ft(h);var E=h?Ec(u):0;return h&&E<h?u+Xg(h-E,y):u}function Uue(u,h,y){u=Lt(u),h=ft(h);var E=h?Ec(u):0;return h&&E<h?Xg(h-E,y)+u:u}function que(u,h,y){return y||h==null?h=0:h&&(h=+h),Joe(Lt(u).replace(Ka,""),h||0)}function Gue(u,h,y){return(y?nr(u,h,y):h===n)?h=1:h=ft(h),S1(Lt(u),h)}function Yue(){var u=arguments,h=Lt(u[0]);return u.length<3?h:h.replace(u[1],u[2])}var Kue=Ac(function(u,h,y){return u+(y?"_":"")+h.toLowerCase()});function Xue(u,h,y){return y&&typeof y!="number"&&nr(u,h,y)&&(h=y=n),y=y===n?H:y>>>0,y?(u=Lt(u),u&&(typeof h=="string"||h!=null&&!q1(h))&&(h=Ur(h),!h&&Cc(u))?Ns(ki(u),0,y):u.split(h,y)):[]}var Que=Ac(function(u,h,y){return u+(y?" ":"")+K1(h)});function Zue(u,h,y){return u=Lt(u),y=y==null?0:tl(ft(y),0,u.length),h=Ur(h),u.slice(y,y+h.length)==h}function Jue(u,h,y){var E=N.templateSettings;y&&nr(u,h,y)&&(h=n),u=Lt(u),h=lm({},h,E,kI);var M=lm({},h.imports,E.imports,kI),L=An(M),z=s1(M,L),U,Z,be=0,ye=h.interpolate||Tn,Ce="__p += '",Ae=l1((h.escape||Tn).source+"|"+ye.source+"|"+(ye===wc?$e:Tn).source+"|"+(h.evaluate||Tn).source+"|$","g"),ze="//# sourceURL="+($t.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++loe+"]")+`
69
69
  `;u.replace(Ae,function(Ke,St,Et,Gr,rr,Yr){return Et||(Et=Gr),Ce+=u.slice(be,Yr).replace(Xa,koe),St&&(U=!0,Ce+=`' +
70
70
  __e(`+St+`) +
71
71
  '`),rr&&(Z=!0,Ce+=`';
@@ -82,14 +82,14 @@ __p += '`),Et&&(Ce+=`' +
82
82
  function print() { __p += __j.call(arguments, '') }
83
83
  `:`;
84
84
  `)+Ce+`return __p
85
- }`;var mt=xN(function(){return Tt(L,ze+"return "+Ce).apply(n,z)});if(mt.source=Ce,U1(mt))throw mt;return mt}function ede(u){return Lt(u).toLowerCase()}function tde(u){return Lt(u).toUpperCase()}function nde(u,h,y){if(u=Lt(u),u&&(y||h===n))return DA(u);if(!u||!(h=Ur(h)))return u;var E=ki(u),M=ki(h),L=MA(E,M),z=TA(E,M)+1;return Ns(E,L,z).join("")}function rde(u,h,y){if(u=Lt(u),u&&(y||h===n))return u.slice(0,IA(u)+1);if(!u||!(h=Ur(h)))return u;var E=ki(u),M=TA(E,ki(h))+1;return Ns(E,0,M).join("")}function ide(u,h,y){if(u=Lt(u),u&&(y||h===n))return u.replace(Ka,"");if(!u||!(h=Ur(h)))return u;var E=ki(u),M=MA(E,ki(h));return Ns(E,M).join("")}function ode(u,h){var y=j,E=B;if(un(h)){var M="separator"in h?h.separator:M;y="length"in h?ft(h.length):y,E="omission"in h?Ur(h.omission):E}u=Lt(u);var L=u.length;if(Cc(u)){var z=ki(u);L=z.length}if(y>=L)return u;var U=y-Ec(E);if(U<1)return E;var Z=z?Ns(z,0,U).join(""):u.slice(0,U);if(M===n)return Z+E;if(z&&(U+=Z.length-U),q1(M)){if(u.slice(U).search(M)){var be,ye=Z;for(M.global||(M=l1(M.source,Lt(Be.exec(M))+"g")),M.lastIndex=0;be=M.exec(ye);)var Ce=be.index;Z=Z.slice(0,Ce===n?U:Ce)}}else if(u.indexOf(Ur(M),U)!=U){var Ae=Z.lastIndexOf(M);Ae>-1&&(Z=Z.slice(0,Ae))}return Z+E}function sde(u){return u=Lt(u),u&&Ao.test(u)?u.replace(Yn,Roe):u}var ade=Ac(function(u,h,y){return u+(y?" ":"")+h.toUpperCase()}),K1=wI("toUpperCase");function yN(u,h,y){return u=Lt(u),h=y?n:h,h===n?Moe(u)?$oe(u):woe(u):u.match(h)||[]}var xN=vt(function(u,h){try{return Hr(u,n,h)}catch(y){return U1(y)?y:new tt(y)}}),lde=Fo(function(u,h){return ui(h,function(y){y=io(y),Ro(u,y,H1(u[y],u))}),u});function cde(u){var h=u==null?0:u.length,y=Ge();return u=h?sn(u,function(E){if(typeof E[1]!="function")throw new di(s);return[y(E[0]),E[1]]}):[],vt(function(E){for(var M=-1;++M<h;){var L=u[M];if(Hr(L[0],this,E))return Hr(L[1],this,E)}})}function ude(u){return Rse(hi(u,f))}function X1(u){return function(){return u}}function dde(u,h){return u==null||u!==u?h:u}var fde=SI(),hde=SI(!0);function wr(u){return u}function Q1(u){return JA(typeof u=="function"?u:hi(u,f))}function pde(u){return tI(hi(u,f))}function gde(u,h){return nI(u,hi(h,f))}var mde=vt(function(u,h){return function(y){return Xd(y,u,h)}}),vde=vt(function(u,h){return function(y){return Xd(u,y,h)}});function Z1(u,h,y){var E=An(h),M=Hg(h,E);y==null&&!(un(h)&&(M.length||!E.length))&&(y=h,h=u,u=this,M=Hg(h,An(h)));var L=!(un(y)&&"chain"in y)||!!y.chain,z=jo(u);return ui(M,function(U){var Z=h[U];u[U]=Z,z&&(u.prototype[U]=function(){var be=this.__chain__;if(L||be){var ye=u(this.__wrapped__),Ce=ye.__actions__=br(this.__actions__);return Ce.push({func:Z,args:arguments,thisArg:u}),ye.__chain__=be,ye}return Z.apply(u,ks([this.value()],arguments))})}),u}function bde(){return zn._===this&&(zn._=Woe),this}function J1(){}function yde(u){return u=ft(u),vt(function(h){return rI(h,u)})}var xde=M1(sn),wde=M1(CA),_de=M1(t1);function wN(u){return F1(u)?n1(io(u)):Zse(u)}function Sde(u){return function(h){return u==null?n:nl(u,h)}}var Cde=EI(),Ede=EI(!0);function ew(){return[]}function tw(){return!1}function Ode(){return{}}function Pde(){return""}function kde(){return!0}function Dde(u,h){if(u=ft(u),u<1||u>ne)return[];var y=H,E=Kn(u,H);h=Ge(h),u-=H;for(var M=o1(E,h);++y<u;)h(y);return M}function Mde(u){return st(u)?sn(u,io):qr(u)?[u]:br(BI(Lt(u)))}function Tde(u){var h=++Voe;return Lt(u)+h}var Ade=Kg(function(u,h){return u+h},0),Ide=T1("ceil"),Nde=Kg(function(u,h){return u/h},1),Rde=T1("floor");function Lde(u){return u&&u.length?Vg(u,wr,m1):n}function Fde(u,h){return u&&u.length?Vg(u,Ge(h,2),m1):n}function $de(u){return PA(u,wr)}function jde(u,h){return PA(u,Ge(h,2))}function zde(u){return u&&u.length?Vg(u,wr,x1):n}function Bde(u,h){return u&&u.length?Vg(u,Ge(h,2),x1):n}var Vde=Kg(function(u,h){return u*h},1),Hde=T1("round"),Wde=Kg(function(u,h){return u-h},0);function Ude(u){return u&&u.length?i1(u,wr):0}function qde(u,h){return u&&u.length?i1(u,Ge(h,2)):0}return N.after=pce,N.ary=ZI,N.assign=tue,N.assignIn=fN,N.assignInWith=lm,N.assignWith=nue,N.at=rue,N.before=JI,N.bind=H1,N.bindAll=lde,N.bindKey=eN,N.castArray=Oce,N.chain=KI,N.chunk=Rae,N.compact=Lae,N.concat=Fae,N.cond=cde,N.conforms=ude,N.constant=X1,N.countBy=Ule,N.create=iue,N.curry=tN,N.curryRight=nN,N.debounce=rN,N.defaults=oue,N.defaultsDeep=sue,N.defer=gce,N.delay=mce,N.difference=$ae,N.differenceBy=jae,N.differenceWith=zae,N.drop=Bae,N.dropRight=Vae,N.dropRightWhile=Hae,N.dropWhile=Wae,N.fill=Uae,N.filter=Gle,N.flatMap=Xle,N.flatMapDeep=Qle,N.flatMapDepth=Zle,N.flatten=UI,N.flattenDeep=qae,N.flattenDepth=Gae,N.flip=vce,N.flow=fde,N.flowRight=hde,N.fromPairs=Yae,N.functions=hue,N.functionsIn=pue,N.groupBy=Jle,N.initial=Xae,N.intersection=Qae,N.intersectionBy=Zae,N.intersectionWith=Jae,N.invert=mue,N.invertBy=vue,N.invokeMap=tce,N.iteratee=Q1,N.keyBy=nce,N.keys=An,N.keysIn=xr,N.map=nm,N.mapKeys=yue,N.mapValues=xue,N.matches=pde,N.matchesProperty=gde,N.memoize=im,N.merge=wue,N.mergeWith=hN,N.method=mde,N.methodOf=vde,N.mixin=Z1,N.negate=om,N.nthArg=yde,N.omit=_ue,N.omitBy=Sue,N.once=bce,N.orderBy=rce,N.over=xde,N.overArgs=yce,N.overEvery=wde,N.overSome=_de,N.partial=W1,N.partialRight=iN,N.partition=ice,N.pick=Cue,N.pickBy=pN,N.property=wN,N.propertyOf=Sde,N.pull=rle,N.pullAll=GI,N.pullAllBy=ile,N.pullAllWith=ole,N.pullAt=sle,N.range=Cde,N.rangeRight=Ede,N.rearg=xce,N.reject=ace,N.remove=ale,N.rest=wce,N.reverse=B1,N.sampleSize=cce,N.set=Oue,N.setWith=Pue,N.shuffle=uce,N.slice=lle,N.sortBy=hce,N.sortedUniq=gle,N.sortedUniqBy=mle,N.split=Xue,N.spread=_ce,N.tail=vle,N.take=ble,N.takeRight=yle,N.takeRightWhile=xle,N.takeWhile=wle,N.tap=Lle,N.throttle=Sce,N.thru=tm,N.toArray=cN,N.toPairs=gN,N.toPairsIn=mN,N.toPath=Mde,N.toPlainObject=dN,N.transform=kue,N.unary=Cce,N.union=_le,N.unionBy=Sle,N.unionWith=Cle,N.uniq=Ele,N.uniqBy=Ole,N.uniqWith=Ple,N.unset=Due,N.unzip=V1,N.unzipWith=YI,N.update=Mue,N.updateWith=Tue,N.values=Rc,N.valuesIn=Aue,N.without=kle,N.words=yN,N.wrap=Ece,N.xor=Dle,N.xorBy=Mle,N.xorWith=Tle,N.zip=Ale,N.zipObject=Ile,N.zipObjectDeep=Nle,N.zipWith=Rle,N.entries=gN,N.entriesIn=mN,N.extend=fN,N.extendWith=lm,Z1(N,N),N.add=Ade,N.attempt=xN,N.camelCase=Lue,N.capitalize=vN,N.ceil=Ide,N.clamp=Iue,N.clone=Pce,N.cloneDeep=Dce,N.cloneDeepWith=Mce,N.cloneWith=kce,N.conformsTo=Tce,N.deburr=bN,N.defaultTo=dde,N.divide=Nde,N.endsWith=Fue,N.eq=Mi,N.escape=$ue,N.escapeRegExp=jue,N.every=qle,N.find=Yle,N.findIndex=HI,N.findKey=aue,N.findLast=Kle,N.findLastIndex=WI,N.findLastKey=lue,N.floor=Rde,N.forEach=XI,N.forEachRight=QI,N.forIn=cue,N.forInRight=uue,N.forOwn=due,N.forOwnRight=fue,N.get=G1,N.gt=Ace,N.gte=Ice,N.has=gue,N.hasIn=Y1,N.head=qI,N.identity=wr,N.includes=ece,N.indexOf=Kae,N.inRange=Nue,N.invoke=bue,N.isArguments=ol,N.isArray=st,N.isArrayBuffer=Nce,N.isArrayLike=yr,N.isArrayLikeObject=vn,N.isBoolean=Rce,N.isBuffer=Rs,N.isDate=Lce,N.isElement=Fce,N.isEmpty=$ce,N.isEqual=jce,N.isEqualWith=zce,N.isError=U1,N.isFinite=Bce,N.isFunction=jo,N.isInteger=oN,N.isLength=sm,N.isMap=sN,N.isMatch=Vce,N.isMatchWith=Hce,N.isNaN=Wce,N.isNative=Uce,N.isNil=Gce,N.isNull=qce,N.isNumber=aN,N.isObject=un,N.isObjectLike=hn,N.isPlainObject=nf,N.isRegExp=q1,N.isSafeInteger=Yce,N.isSet=lN,N.isString=am,N.isSymbol=qr,N.isTypedArray=Nc,N.isUndefined=Kce,N.isWeakMap=Xce,N.isWeakSet=Qce,N.join=ele,N.kebabCase=zue,N.last=gi,N.lastIndexOf=tle,N.lowerCase=Bue,N.lowerFirst=Vue,N.lt=Zce,N.lte=Jce,N.max=Lde,N.maxBy=Fde,N.mean=$de,N.meanBy=jde,N.min=zde,N.minBy=Bde,N.stubArray=ew,N.stubFalse=tw,N.stubObject=Ode,N.stubString=Pde,N.stubTrue=kde,N.multiply=Vde,N.nth=nle,N.noConflict=bde,N.noop=J1,N.now=rm,N.pad=Hue,N.padEnd=Wue,N.padStart=Uue,N.parseInt=que,N.random=Rue,N.reduce=oce,N.reduceRight=sce,N.repeat=Gue,N.replace=Yue,N.result=Eue,N.round=Hde,N.runInContext=Y,N.sample=lce,N.size=dce,N.snakeCase=Kue,N.some=fce,N.sortedIndex=cle,N.sortedIndexBy=ule,N.sortedIndexOf=dle,N.sortedLastIndex=fle,N.sortedLastIndexBy=hle,N.sortedLastIndexOf=ple,N.startCase=Que,N.startsWith=Zue,N.subtract=Wde,N.sum=Ude,N.sumBy=qde,N.template=Jue,N.times=Dde,N.toFinite=zo,N.toInteger=ft,N.toLength=uN,N.toLower=ede,N.toNumber=mi,N.toSafeInteger=eue,N.toString=Lt,N.toUpper=tde,N.trim=nde,N.trimEnd=rde,N.trimStart=ide,N.truncate=ode,N.unescape=sde,N.uniqueId=Tde,N.upperCase=ade,N.upperFirst=K1,N.each=XI,N.eachRight=QI,N.first=qI,Z1(N,function(){var u={};return no(N,function(h,y){$t.call(N.prototype,y)||(u[y]=h)}),u}(),{chain:!1}),N.VERSION=r,ui(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){N[u].placeholder=N}),ui(["drop","take"],function(u,h){Ct.prototype[u]=function(y){y=y===n?1:Pn(ft(y),0);var E=this.__filtered__&&!h?new Ct(this):this.clone();return E.__filtered__?E.__takeCount__=Kn(y,E.__takeCount__):E.__views__.push({size:Kn(y,H),type:u+(E.__dir__<0?"Right":"")}),E},Ct.prototype[u+"Right"]=function(y){return this.reverse()[u](y).reverse()}}),ui(["filter","map","takeWhile"],function(u,h){var y=h+1,E=y==J||y==X;Ct.prototype[u]=function(M){var L=this.clone();return L.__iteratees__.push({iteratee:Ge(M,3),type:y}),L.__filtered__=L.__filtered__||E,L}}),ui(["head","last"],function(u,h){var y="take"+(h?"Right":"");Ct.prototype[u]=function(){return this[y](1).value()[0]}}),ui(["initial","tail"],function(u,h){var y="drop"+(h?"":"Right");Ct.prototype[u]=function(){return this.__filtered__?new Ct(this):this[y](1)}}),Ct.prototype.compact=function(){return this.filter(wr)},Ct.prototype.find=function(u){return this.filter(u).head()},Ct.prototype.findLast=function(u){return this.reverse().find(u)},Ct.prototype.invokeMap=vt(function(u,h){return typeof u=="function"?new Ct(this):this.map(function(y){return Xd(y,u,h)})}),Ct.prototype.reject=function(u){return this.filter(om(Ge(u)))},Ct.prototype.slice=function(u,h){u=ft(u);var y=this;return y.__filtered__&&(u>0||h<0)?new Ct(y):(u<0?y=y.takeRight(-u):u&&(y=y.drop(u)),h!==n&&(h=ft(h),y=h<0?y.dropRight(-h):y.take(h-u)),y)},Ct.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ct.prototype.toArray=function(){return this.take(H)},no(Ct.prototype,function(u,h){var y=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),M=N[E?"take"+(h=="last"?"Right":""):h],L=E||/^find/.test(h);M&&(N.prototype[h]=function(){var z=this.__wrapped__,U=E?[1]:arguments,Z=z instanceof Ct,be=U[0],ye=Z||st(z),Ce=function(St){var Et=M.apply(N,ks([St],U));return E&&Ae?Et[0]:Et};ye&&y&&typeof be=="function"&&be.length!=1&&(Z=ye=!1);var Ae=this.__chain__,ze=!!this.__actions__.length,Ye=L&&!Ae,mt=Z&&!ze;if(!L&&ye){z=mt?z:new Ct(this);var Ke=u.apply(z,U);return Ke.__actions__.push({func:tm,args:[Ce],thisArg:n}),new fi(Ke,Ae)}return Ye&&mt?u.apply(this,U):(Ke=this.thru(Ce),Ye?E?Ke.value()[0]:Ke.value():Ke)})}),ui(["pop","push","shift","sort","splice","unshift"],function(u){var h=Pg[u],y=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",E=/^(?:pop|shift)$/.test(u);N.prototype[u]=function(){var M=arguments;if(E&&!this.__chain__){var L=this.value();return h.apply(st(L)?L:[],M)}return this[y](function(z){return h.apply(st(z)?z:[],M)})}}),no(Ct.prototype,function(u,h){var y=N[h];if(y){var E=y.name+"";$t.call(Dc,E)||(Dc[E]=[]),Dc[E].push({name:h,func:y})}}),Dc[Yg(n,w).name]=[{name:"wrapper",func:n}],Ct.prototype.clone=sse,Ct.prototype.reverse=ase,Ct.prototype.value=lse,N.prototype.at=Fle,N.prototype.chain=$le,N.prototype.commit=jle,N.prototype.next=zle,N.prototype.plant=Vle,N.prototype.reverse=Hle,N.prototype.toJSON=N.prototype.valueOf=N.prototype.value=Wle,N.prototype.first=N.prototype.head,Hd&&(N.prototype[Hd]=Ble),N},Oc=joe();Qa?((Qa.exports=Oc)._=Oc,Qx._=Oc):zn._=Oc}).call(Ho)}(wf,wf.exports);var _f=wf.exports;const Vs=Lc(_f),fe=Mw()(Vw((e,t)=>({dashboard:{id:"",style:Am},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{addFilteringCard:n=>{e(r=>{var i;(i=r.filteringCards)==null||i.push(n)})},removeFilteringCard:n=>{e(r=>{var o,s;const i=(o=r.filteringCards)==null?void 0:o.findIndex(a=>a.id===n.id);i!==void 0&&i>-1&&((s=r.filteringCards)==null||s.splice(i,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,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&_f.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.title=i)})})},setCardDescription:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&_f.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.description=i)})})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.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(g=>g.id===r);f&&(f.sql=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setFrameCardData:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&_f.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.data=i)})})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n);i>-1&&r.filterValues.splice(i,1)}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1&&r.filterValues.splice(i,1,n)}})},addFilter:n=>{e(r=>{var i;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1))}})},updateFrameCard:(n,r,i)=>{e(o=>{var l,c,d,f,g;const s=(c=(l=o.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(d=s==null?void 0:s.frames)==null?void 0:d.find(p=>p.id===r);if(a){const p=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===i.id);p>-1&&((g=a.cards)==null||g.splice(p,1,i))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){o.frames||(o.frames=[]),(l=o.frames)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:10};(c=o.layout)==null||c.push(f),(d=i.onAddFrame)==null||d.call(i,r,n)}})},removeFrame:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){const f=(l=o.frames)==null?void 0:l.findIndex(g=>g.id===r);f&&f>-1&&((c=o.frames)==null||c.splice(f,1),(d=o.layout)==null||d.splice(f,1))}})},updateFrame:(n,r)=>{e(i=>{var a,l,c,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=o==null?void 0:o.frames)==null?void 0:c.findIndex(f=>f.id===r.id);o&&((d=o.frames)==null||d.splice(s,1,r))})},updateCard:(n,r)=>{e(i=>{var a,l,c,d,f;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(g=>g.id===r.id);o&&((d=o.cards)==null||d.splice(s,1,r),(f=i.onUpdateCard)==null||f.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,d,f,g;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((d=o.cards)==null||d.splice(s,1),(f=o.layout)==null||f.splice(s,1),(g=i.onRemoveCard)==null||g.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(d=>d.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.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(i=>i.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.frames)==null?void 0:o.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.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=(o=a[l].cards)==null?void 0:o.find(d=>d.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{xR({card:n,dataPoint:r,set:e,get:t})}}}))),Gc=()=>fe(e=>e.actions);process.env.NODE_ENV==="development"&&Ww("DashboardStore",fe);const wR={theme:"system",setTheme:()=>null},f_=m.createContext(wR);function _R({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return _.jsx(f_.Provider,{...r,value:s,children:e})}const Bm=()=>{const e=m.useContext(f_);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function SR(e,t,n){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}&version=${t}`,{headers:{Authorization:`Bearer ${n}`}})).json()}function h_(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function p_(e,t){const n=h_(e);return n==="dark"?Vs.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function g_({id:e,version:t,authToken:n,customStyle:r,currentTheme:i,onSave:o,onEvent:s}){const{data:a,refetch:l,isLoading:c,isError:d}=Xr({queryKey:[e],queryFn:()=>SR(e,t||"",n==null?void 0:n.accessToken),enabled:!1}),{theme:f,setTheme:g}=Bm(),{setDashboard:p,setSelectedSheetId:v,setStyle:b,setOnSaveFunction:x}=fe(T=>T.actions);fe(T=>T.actions.setCustomCards);const w=fe(T=>T.actions.setFilterValues),S=fe(T=>T.actions.setBookmarkKey),C=fe(T=>T.actions.setAuthToken),P=fe(T=>T.actions.setThemeStyle),O=fe(T=>T.actions.setDashboardTheme),k=fe(T=>T.actions.setOnEvent);return m.useEffect(()=>{if(f){const T=h_(f);O(T)}},[f,O]),m.useEffect(()=>{i&&g(i)},[i,g]),m.useEffect(()=>{const T=Vs.cloneDeep(Am);if(r){const I=Vs.merge(T,r),F=p_(f,I);P(F),b(I)}else{const I=p_(f,T);P(I),b(Am)}},[f,r,b,P]),m.useEffect(()=>{var B;if(!a||!a.dashboard)return;const T=a.dashboard,I=gs(T.id),F=JSON.parse(localStorage.getItem(I)||"[]"),j=F.find(V=>V.default===!0);if(j)p(j.template),S(j.name),j.filterValues&&w(j.filterValues);else{p(T);const V=F.find(q=>(q==null?void 0:q.name)==="Original");V?V.template=T:F.push({name:"Original",template:T,default:!1}),localStorage.setItem(I,JSON.stringify(F))}v((B=T.sheets)==null?void 0:B[0].id)},[a,p,v,w,S]),m.useEffect(()=>{o&&x(o),s&&k(s)},[o,x,s,k]),m.useEffect(()=>{n&&n.accessToken&&(C(n),l())},[n,l,C]),{isLoading:c,isError:d}}function Sf({className:e,...t}){return _.jsx("div",{className:De("animate-pulse rounded-md bg-muted",e),...t})}function m_({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:d,customCards:f,...g}){fe(w=>w.selectedSheetId);const p=fe(w=>w.themeStyle),v=fe(w=>w.onEvent),{isLoading:b,isError:x}=g_({id:a,version:d,authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return b||!l?(v==null||v({type:"info",message:`isLoading: ${b}, accessToken: ${l==null?void 0:l.accessToken}`}),i?_.jsx(i,{message:"loading"}):_.jsx("div",{className:" flex items-center gap-3",children:_.jsx(Sf,{className:"dark:h-[2px] h-1 w-full"})})):x?(v==null||v({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),_.jsx(o,{})):_.jsx("div",{children:"Error"})):_.jsx("div",{className:De(" h-full flex flex-col justify-between",p==null?void 0:p.dashboardPanel,e),role:"dashboard-panel",...g})}function se(){return se=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},se.apply(this,arguments)}function Pe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function kn(e,t=[]){let n=[];function r(o,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:g,children:p,...v}=f,b=(g==null?void 0:g[e][l])||a,x=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:x},p)}function d(f,g){const p=(g==null?void 0:g[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const i=()=>{const o=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,CR(i,...t)]}function CR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ER(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Cf(...e){return t=>e.forEach(n=>ER(n,t))}function nt(...e){return m.useCallback(Cf(...e),e)}const oo=m.forwardRef((e,t)=>{const{children:n,...r}=e,i=m.Children.toArray(n),o=i.find(OR);if(o){const s=o.props.children,a=i.map(l=>l===o?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Vm,se({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Vm,se({},r,{ref:t}),n)});oo.displayName="Slot";const Vm=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...PR(r,n.props),ref:t?Cf(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Vm.displayName="SlotClone";const v_=({children:e})=>m.createElement(m.Fragment,null,e);function OR(e){return m.isValidElement(e)&&e.type===v_}function PR(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Ef(e){const t=e+"CollectionProvider",[n,r]=kn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:b}=p,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(i,{scope:v,itemMap:w,collectionRef:x},b)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:b,children:x}=p,w=o(a,b),S=nt(v,w.collectionRef);return m.createElement(oo,{ref:S},x)}),c=e+"CollectionItemSlot",d="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:b,children:x,...w}=p,S=m.useRef(null),C=nt(v,S),P=o(c,b);return m.useEffect(()=>(P.itemMap.set(S,{ref:S,...w}),()=>void P.itemMap.delete(S))),m.createElement(oo,{[d]:"",ref:C},x)});function g(p){const v=o(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((P,O)=>w.indexOf(P.ref.current)-w.indexOf(O.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,r]}const Vn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},kR=de.useId||(()=>{});let DR=0;function or(e){const[t,n]=de.useState(kR());return Vn(()=>{e||n(r=>r??String(DR++))},[e]),e||(t?`radix-${t}`:"")}const He=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=m.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?oo:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,se({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function b_(e,t){e&&kt.flushSync(()=>e.dispatchEvent(t))}function _n(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 Qn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=MR({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=_n(n),l=m.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else i(c)},[o,e,i,a]);return[s,l]}function MR({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,i=m.useRef(r),o=_n(t);return m.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const TR=m.createContext(void 0);function Hs(e){const t=m.useContext(TR);return e||t||"ltr"}const Hm="rovingFocusGroup.onEntryFocus",AR={bubbles:!1,cancelable:!0},Wm="RovingFocusGroup",[Um,y_,IR]=Ef(Wm),[NR,fl]=kn(Wm,[IR]),[RR,LR]=NR(Wm),FR=m.forwardRef((e,t)=>m.createElement(Um.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Um.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement($R,se({},e,{ref:t}))))),$R=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=e,f=m.useRef(null),g=nt(t,f),p=Hs(o),[v=null,b]=Qn({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),S=_n(c),C=y_(n),P=m.useRef(!1),[O,k]=m.useState(0);return m.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(Hm,S),()=>T.removeEventListener(Hm,S)},[S]),m.createElement(RR,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(T=>b(T),[b]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>k(T=>T-1),[])},m.createElement(He.div,se({tabIndex:x||O===0?-1:0,"data-orientation":r},d,{ref:g,style:{outline:"none",...e.style},onMouseDown:Pe(e.onMouseDown,()=>{P.current=!0}),onFocus:Pe(e.onFocus,T=>{const I=!P.current;if(T.target===T.currentTarget&&I&&!x){const F=new CustomEvent(Hm,AR);if(T.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=C().filter($=>$.focusable),B=j.find($=>$.active),V=j.find($=>$.id===v),J=[B,V,...j].filter(Boolean).map($=>$.ref.current);x_(J)}}P.current=!1}),onBlur:Pe(e.onBlur,()=>w(!1))})))}),jR="RovingFocusGroupItem",zR=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=or(),l=o||a,c=LR(jR,n),d=c.currentTabStopId===l,f=y_(n),{onFocusableItemAdd:g,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),m.createElement(Um.ItemSlot,{scope:n,id:l,focusable:r,active:i},m.createElement(He.span,se({tabIndex:d?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Pe(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Pe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Pe(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=HR(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let w=f().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=c.loop?WR(w,S+1):w.slice(S+1)}setTimeout(()=>x_(w))}})})))}),BR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function HR(e,t,n){const r=VR(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return BR[r]}function x_(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function WR(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const qm=FR,Gm=zR;function UR(e,t){return m.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const yn=e=>{const{present:t,children:n}=e,r=qR(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=nt(r.ref,i.ref);return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:o}):null};yn.displayName="Presence";function qR(e){const[t,n]=m.useState(),r=m.useRef({}),i=m.useRef(e),o=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=UR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Of(r.current);o.current=a==="mounted"?c:"none"},[a]),Vn(()=>{const c=r.current,d=i.current;if(d!==e){const g=o.current,p=Of(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&g!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Vn(()=>{if(t){const c=f=>{const p=Of(r.current).includes(f.animationName);f.target===t&&p&&kt.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=Of(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),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 Of(e){return(e==null?void 0:e.animationName)||"none"}const w_="Tabs",[GR,Zde]=kn(w_,[fl]),__=fl(),[YR,Ym]=GR(w_),KR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,d=Hs(a),[f,g]=Qn({prop:r,onChange:i,defaultProp:o});return m.createElement(YR,{scope:n,baseId:or(),value:f,onValueChange:g,orientation:s,dir:d,activationMode:l},m.createElement(He.div,se({dir:d,"data-orientation":s},c,{ref:t})))}),XR="TabsList",QR=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Ym(XR,n),s=__(n);return m.createElement(qm,se({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),m.createElement(He.div,se({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),ZR="TabsTrigger",JR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Ym(ZR,n),a=__(n),l=S_(s.baseId,r),c=C_(s.baseId,r),d=r===s.value;return m.createElement(Gm,se({asChild:!0},a,{focusable:!i,active:d}),m.createElement(He.button,se({type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:Pe(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Pe(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Pe(e.onFocus,()=>{const f=s.activationMode!=="manual";!d&&!i&&f&&s.onValueChange(r)})})))}),e4="TabsContent",t4=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=Ym(e4,n),l=S_(a.baseId,r),c=C_(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),m.createElement(yn,{present:i||d},({present:g})=>m.createElement(He.div,se({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),g&&o))});function S_(e,t){return`${e}-trigger-${t}`}function C_(e,t){return`${e}-content-${t}`}const n4=KR,E_=QR,O_=JR,P_=t4,k_=n4,D_=de.forwardRef(({className:e,...t},n)=>_.jsx(E_,{ref:n,className:De("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));D_.displayName=E_.displayName;const Km=de.forwardRef(({className:e,...t},n)=>_.jsx(O_,{ref:n,className:De("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}));Km.displayName=O_.displayName;const Pf=de.forwardRef(({className:e,...t},n)=>_.jsx(P_,{ref:n,className:De("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Pf.displayName=P_.displayName;var M_={exports:{}},Yc={},Xm={exports:{}};(function(e,t){(function(n,r){r(t)})(Ho,function(n){function r(ee){return function(ie,we,te,Ie,ae,Se,We){return ee(ie,we,We)}}function i(ee){return function(ie,we,te,Ie){if(!ie||!we||typeof ie!="object"||typeof we!="object")return ee(ie,we,te,Ie);var ae=Ie.get(ie),Se=Ie.get(we);if(ae&&Se)return ae===we&&Se===ie;Ie.set(ie,we),Ie.set(we,ie);var We=ee(ie,we,te,Ie);return Ie.delete(ie),Ie.delete(we),We}}function o(ee,Q){var ie={};for(var we in ee)ie[we]=ee[we];for(var we in Q)ie[we]=Q[we];return ie}function s(ee){return ee.constructor===Object||ee.constructor==null}function a(ee){return typeof ee.then=="function"}function l(ee,Q){return ee===Q||ee!==ee&&Q!==Q}var c="[object Arguments]",d="[object Boolean]",f="[object Date]",g="[object RegExp]",p="[object Map]",v="[object Number]",b="[object Object]",x="[object Set]",w="[object String]",S=Object.prototype.toString;function C(ee){var Q=ee.areArraysEqual,ie=ee.areDatesEqual,we=ee.areMapsEqual,te=ee.areObjectsEqual,Ie=ee.areRegExpsEqual,ae=ee.areSetsEqual,Se=ee.createIsNestedEqual,We=Se(dt);function dt(qe,gt,Gt){if(qe===gt)return!0;if(!qe||!gt||typeof qe!="object"||typeof gt!="object")return qe!==qe&&gt!==gt;if(s(qe)&&s(gt))return te(qe,gt,We,Gt);var Bt=Array.isArray(qe),gn=Array.isArray(gt);if(Bt||gn)return Bt===gn&&Q(qe,gt,We,Gt);var Rt=S.call(qe);return Rt!==S.call(gt)?!1:Rt===f?ie(qe,gt,We,Gt):Rt===g?Ie(qe,gt,We,Gt):Rt===p?we(qe,gt,We,Gt):Rt===x?ae(qe,gt,We,Gt):Rt===b||Rt===c?a(qe)||a(gt)?!1:te(qe,gt,We,Gt):Rt===d||Rt===v||Rt===w?l(qe.valueOf(),gt.valueOf()):!1}return dt}function P(ee,Q,ie,we){var te=ee.length;if(Q.length!==te)return!1;for(;te-- >0;)if(!ie(ee[te],Q[te],te,te,ee,Q,we))return!1;return!0}var O=i(P);function k(ee,Q){return l(ee.valueOf(),Q.valueOf())}function T(ee,Q,ie,we){var te=ee.size===Q.size;if(!te)return!1;if(!ee.size)return!0;var Ie={},ae=0;return ee.forEach(function(Se,We){if(te){var dt=!1,qe=0;Q.forEach(function(gt,Gt){!dt&&!Ie[qe]&&(dt=ie(We,Gt,ae,qe,ee,Q,we)&&ie(Se,gt,We,Gt,ee,Q,we))&&(Ie[qe]=!0),qe++}),ae++,te=dt}}),te}var I=i(T),F="_owner",j=Object.prototype.hasOwnProperty;function B(ee,Q,ie,we){var te=Object.keys(ee),Ie=te.length;if(Object.keys(Q).length!==Ie)return!1;for(var ae;Ie-- >0;){if(ae=te[Ie],ae===F){var Se=!!ee.$$typeof,We=!!Q.$$typeof;if((Se||We)&&Se!==We)return!1}if(!j.call(Q,ae)||!ie(ee[ae],Q[ae],ae,ae,ee,Q,we))return!1}return!0}var V=i(B);function q(ee,Q){return ee.source===Q.source&&ee.flags===Q.flags}function J(ee,Q,ie,we){var te=ee.size===Q.size;if(!te)return!1;if(!ee.size)return!0;var Ie={};return ee.forEach(function(ae,Se){if(te){var We=!1,dt=0;Q.forEach(function(qe,gt){!We&&!Ie[dt]&&(We=ie(ae,qe,Se,gt,ee,Q,we))&&(Ie[dt]=!0),dt++}),te=We}}),te}var $=i(J),X=Object.freeze({areArraysEqual:P,areDatesEqual:k,areMapsEqual:T,areObjectsEqual:B,areRegExpsEqual:q,areSetsEqual:J,createIsNestedEqual:r}),W=Object.freeze({areArraysEqual:O,areDatesEqual:k,areMapsEqual:I,areObjectsEqual:V,areRegExpsEqual:q,areSetsEqual:$,createIsNestedEqual:r}),ne=C(X);function le(ee,Q){return ne(ee,Q,void 0)}var A=C(o(X,{createIsNestedEqual:function(){return l}}));function H(ee,Q){return A(ee,Q,void 0)}var re=C(W);function R(ee,Q){return re(ee,Q,new WeakMap)}var ue=C(o(W,{createIsNestedEqual:function(){return l}}));function xe(ee,Q){return ue(ee,Q,new WeakMap)}function ge(ee){return C(o(X,ee(X)))}function pe(ee){var Q=C(o(W,ee(W)));return function(ie,we,te){return te===void 0&&(te=new WeakMap),Q(ie,we,te)}}n.circularDeepEqual=R,n.circularShallowEqual=xe,n.createCustomCircularEqual=pe,n.createCustomEqual=ge,n.deepEqual=le,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Xm,Xm.exports);var Qm=Xm.exports;const Zm=dm(PN);var bt={},r4=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(bt,"__esModule",{value:!0}),bt.bottom=Jm,bt.childrenEqual=a4,bt.cloneLayout=A_,bt.cloneLayoutItem=Ws,bt.collides=kf,bt.compact=N_,bt.compactItem=R_,bt.compactType=v4,bt.correctBounds=L_,bt.fastPositionEqual=c4,bt.fastRGLPropsEqual=void 0,bt.getAllCollisions=F_,bt.getFirstCollision=Us,bt.getLayoutItem=tv,bt.getStatics=nv,bt.modifyLayout=I_,bt.moveElement=Xc,bt.moveElementAwayFromCollision=rv,bt.noop=void 0,bt.perc=d4,bt.resizeItemInDirection=h4,bt.setTopLeft=g4,bt.setTransform=p4,bt.sortLayoutItems=cv,bt.sortLayoutItemsByColRow=V_,bt.sortLayoutItemsByRowCol=B_,bt.synchronizeLayoutWithChildren=m4,bt.validateLayout=H_,bt.withLayoutItem=s4;var T_=Qm,Kc=i4(m);function i4(e){return e&&e.__esModule?e:{default:e}}const o4=process.env.NODE_ENV==="production";function Jm(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function A_(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Ws(e[n]);return t}function I_(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function s4(e,t,n){let r=tv(e,t);return r?(r=n(Ws(r)),e=I_(e,r),[e,r]):[e,null]}function Ws(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 a4(e,t){return(0,T_.deepEqual)(Kc.default.Children.map(e,n=>n==null?void 0:n.key),Kc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,T_.deepEqual)(Kc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Kc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const l4=r4;bt.fastRGLPropsEqual=l4;function c4(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function kf(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 N_(e,t,n,r){const i=nv(e),o=cv(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=Ws(o[a]);c.static||(c=R_(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const u4={x:"w",y:"h"};function ev(e,t,n,r){const i=u4[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;kf(t,a)&&ev(e,a,n+t[i],r)}}t[r]=n}function R_(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Jm(e),t.y);t.y>0&&!Us(e,t);)t.y--;else if(a)for(;t.x>0&&!Us(e,t);)t.x--;let l;for(;(l=Us(e,t))&&!(n===null&&o);)if(a?ev(i,t,l.x+l.w,"x"):ev(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Us(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function L_(e,t){const n=nv(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Us(n,o);)o.y++}return e}function tv(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Us(e,t){for(let n=0,r=e.length;n<r;n++)if(kf(e[n],t))return e[n]}function F_(e,t){return e.filter(n=>kf(n,t))}function nv(e){return e.filter(t=>t.static)}function Xc(e,t,n,r,i,o,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,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=cv(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=F_(f,t),v=p.length>0;if(v&&l)return A_(e);if(v&&o)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=d,t.moved=!1,e;for(let b=0,x=p.length;b<x;b++){const w=p[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=rv(e,w,t,i,s):e=rv(e,t,w,i,s))}return e}function rv(e,t,n,r,i,o){const s=i==="horizontal",a=i==="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"},g=Us(e,f),p=g&&g.y+g.h>t.y,v=g&&t.x+t.w>g.x;if(g){if(p&&a)return Xc(e,n,void 0,t.y+1,r,l,i);if(p&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return Xc(e,t,n.x,void 0,r,l,i)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),Xc(e,n,s?f.x:void 0,a?f.y:void 0,r,l,i)}const c=s?n.x+1:void 0,d=a?n.y+1:void 0;return c==null&&d==null?e:Xc(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function d4(e){return e*100+"%"}const $_=(e,t,n,r)=>e+n>r?t:n,j_=(e,t,n)=>e<0?t:n,z_=e=>Math.max(0,e),iv=e=>Math.max(0,e),ov=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:j_(s,e.height,i),top:iv(s)}},sv=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:$_(e.left,e.width,s,n),left:z_(i)}},av=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:$_(e.left,e.width,o,n),top:iv(r),left:z_(s)}},lv=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:j_(r,e.height,o),top:iv(r)}},f4={n:ov,ne:function(){return ov(arguments.length<=0?void 0:arguments[0],sv(...arguments))},e:sv,se:function(){return lv(arguments.length<=0?void 0:arguments[0],sv(...arguments))},s:lv,sw:function(){return lv(arguments.length<=0?void 0:arguments[0],av(...arguments))},w:av,nw:function(){return ov(arguments.length<=0?void 0:arguments[0],av(...arguments))}};function h4(e,t,n,r){const i=f4[e];return i?i(t,{...t,...n},r):n}function p4(e){let{top:t,left:n,width:r,height:i}=e;const o="translate(".concat(n,"px,").concat(t,"px)");return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function g4(e){let{top:t,left:n,width:r,height:i}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function cv(e,t){return t==="horizontal"?V_(e):t==="vertical"?B_(e):e}function B_(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 V_(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 m4(e,t,n,r,i){e=e||[];const o=[];Kc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=tv(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(Ws(l)):c?(o4||H_([c],"ReactGridLayout.children"),o.push(Ws({...c,i:a.key}))):o.push(Ws({w:1,h:1,x:0,y:Jm(o),i:String(a.key)}))});const s=L_(o,{cols:n});return i?s:N_(s,r,n)}function H_(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,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++)if(typeof o[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function v4(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function rfe(){}const b4=()=>{};bt.noop=b4;var Ai={};Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.calcGridColWidth=Df,Ai.calcGridItemPosition=y4,Ai.calcGridItemWHPx=uv,Ai.calcWH=w4,Ai.calcXY=x4,Ai.clamp=qs;function Df(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function uv(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function y4(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Df(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=uv(r,c,s[0]),d.height=uv(i,l,s[1])),o&&o.dragging?(d.top=Math.round(o.dragging.top),d.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(d.top=Math.round(o.resizing.top),d.left=Math.round(o.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((c+s[0])*t+a[0])),d}function x4(e,t,n,r,i){const{margin:o,cols:s,rowHeight:a,maxRows:l}=e,c=Df(e);let d=Math.round((n-o[0])/(c+o[0])),f=Math.round((t-o[1])/(a+o[1]));return d=qs(d,0,s-r),f=qs(f,0,l-i),{x:d,y:f}}function w4(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,d=Df(e);let f=Math.round((t+s[0])/(d+s[0])),g=Math.round((n+s[1])/(c+s[1])),p=qs(f,0,l-r),v=qs(g,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(p=qs(f,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(v=qs(g,0,a)),{w:p,h:v}}function qs(e,t,n){return Math.max(Math.min(e,n),t)}var Mf={},dv={exports:{}},fv,W_;function hv(){if(W_)return fv;W_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return fv=e,fv}var pv,U_;function _4(){if(U_)return pv;U_=1;var e=hv();function t(){}function n(){}return n.resetWarningCache=t,pv=function(){function r(s,a,l,c,d,f){if(f!==e){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}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},pv}var Tf={exports:{}},At={};/** @license React v16.13.1
85
+ }`;var mt=xN(function(){return Tt(L,ze+"return "+Ce).apply(n,z)});if(mt.source=Ce,U1(mt))throw mt;return mt}function ede(u){return Lt(u).toLowerCase()}function tde(u){return Lt(u).toUpperCase()}function nde(u,h,y){if(u=Lt(u),u&&(y||h===n))return DA(u);if(!u||!(h=Ur(h)))return u;var E=ki(u),M=ki(h),L=MA(E,M),z=TA(E,M)+1;return Ns(E,L,z).join("")}function rde(u,h,y){if(u=Lt(u),u&&(y||h===n))return u.slice(0,IA(u)+1);if(!u||!(h=Ur(h)))return u;var E=ki(u),M=TA(E,ki(h))+1;return Ns(E,0,M).join("")}function ide(u,h,y){if(u=Lt(u),u&&(y||h===n))return u.replace(Ka,"");if(!u||!(h=Ur(h)))return u;var E=ki(u),M=MA(E,ki(h));return Ns(E,M).join("")}function ode(u,h){var y=j,E=B;if(un(h)){var M="separator"in h?h.separator:M;y="length"in h?ft(h.length):y,E="omission"in h?Ur(h.omission):E}u=Lt(u);var L=u.length;if(Cc(u)){var z=ki(u);L=z.length}if(y>=L)return u;var U=y-Ec(E);if(U<1)return E;var Z=z?Ns(z,0,U).join(""):u.slice(0,U);if(M===n)return Z+E;if(z&&(U+=Z.length-U),q1(M)){if(u.slice(U).search(M)){var be,ye=Z;for(M.global||(M=l1(M.source,Lt(Be.exec(M))+"g")),M.lastIndex=0;be=M.exec(ye);)var Ce=be.index;Z=Z.slice(0,Ce===n?U:Ce)}}else if(u.indexOf(Ur(M),U)!=U){var Ae=Z.lastIndexOf(M);Ae>-1&&(Z=Z.slice(0,Ae))}return Z+E}function sde(u){return u=Lt(u),u&&Ao.test(u)?u.replace(Yn,Roe):u}var ade=Ac(function(u,h,y){return u+(y?" ":"")+h.toUpperCase()}),K1=wI("toUpperCase");function yN(u,h,y){return u=Lt(u),h=y?n:h,h===n?Moe(u)?$oe(u):woe(u):u.match(h)||[]}var xN=vt(function(u,h){try{return Hr(u,n,h)}catch(y){return U1(y)?y:new tt(y)}}),lde=Fo(function(u,h){return ui(h,function(y){y=io(y),Ro(u,y,H1(u[y],u))}),u});function cde(u){var h=u==null?0:u.length,y=Ge();return u=h?sn(u,function(E){if(typeof E[1]!="function")throw new di(s);return[y(E[0]),E[1]]}):[],vt(function(E){for(var M=-1;++M<h;){var L=u[M];if(Hr(L[0],this,E))return Hr(L[1],this,E)}})}function ude(u){return Rse(hi(u,f))}function X1(u){return function(){return u}}function dde(u,h){return u==null||u!==u?h:u}var fde=SI(),hde=SI(!0);function wr(u){return u}function Q1(u){return JA(typeof u=="function"?u:hi(u,f))}function pde(u){return tI(hi(u,f))}function gde(u,h){return nI(u,hi(h,f))}var mde=vt(function(u,h){return function(y){return Xd(y,u,h)}}),vde=vt(function(u,h){return function(y){return Xd(u,y,h)}});function Z1(u,h,y){var E=An(h),M=Hg(h,E);y==null&&!(un(h)&&(M.length||!E.length))&&(y=h,h=u,u=this,M=Hg(h,An(h)));var L=!(un(y)&&"chain"in y)||!!y.chain,z=jo(u);return ui(M,function(U){var Z=h[U];u[U]=Z,z&&(u.prototype[U]=function(){var be=this.__chain__;if(L||be){var ye=u(this.__wrapped__),Ce=ye.__actions__=br(this.__actions__);return Ce.push({func:Z,args:arguments,thisArg:u}),ye.__chain__=be,ye}return Z.apply(u,ks([this.value()],arguments))})}),u}function bde(){return zn._===this&&(zn._=Woe),this}function J1(){}function yde(u){return u=ft(u),vt(function(h){return rI(h,u)})}var xde=M1(sn),wde=M1(CA),_de=M1(t1);function wN(u){return F1(u)?n1(io(u)):Zse(u)}function Sde(u){return function(h){return u==null?n:nl(u,h)}}var Cde=EI(),Ede=EI(!0);function ew(){return[]}function tw(){return!1}function Ode(){return{}}function Pde(){return""}function kde(){return!0}function Dde(u,h){if(u=ft(u),u<1||u>te)return[];var y=H,E=Kn(u,H);h=Ge(h),u-=H;for(var M=o1(E,h);++y<u;)h(y);return M}function Mde(u){return st(u)?sn(u,io):qr(u)?[u]:br(BI(Lt(u)))}function Tde(u){var h=++Voe;return Lt(u)+h}var Ade=Kg(function(u,h){return u+h},0),Ide=T1("ceil"),Nde=Kg(function(u,h){return u/h},1),Rde=T1("floor");function Lde(u){return u&&u.length?Vg(u,wr,m1):n}function Fde(u,h){return u&&u.length?Vg(u,Ge(h,2),m1):n}function $de(u){return PA(u,wr)}function jde(u,h){return PA(u,Ge(h,2))}function zde(u){return u&&u.length?Vg(u,wr,x1):n}function Bde(u,h){return u&&u.length?Vg(u,Ge(h,2),x1):n}var Vde=Kg(function(u,h){return u*h},1),Hde=T1("round"),Wde=Kg(function(u,h){return u-h},0);function Ude(u){return u&&u.length?i1(u,wr):0}function qde(u,h){return u&&u.length?i1(u,Ge(h,2)):0}return N.after=pce,N.ary=ZI,N.assign=tue,N.assignIn=fN,N.assignInWith=lm,N.assignWith=nue,N.at=rue,N.before=JI,N.bind=H1,N.bindAll=lde,N.bindKey=eN,N.castArray=Oce,N.chain=KI,N.chunk=Rae,N.compact=Lae,N.concat=Fae,N.cond=cde,N.conforms=ude,N.constant=X1,N.countBy=Ule,N.create=iue,N.curry=tN,N.curryRight=nN,N.debounce=rN,N.defaults=oue,N.defaultsDeep=sue,N.defer=gce,N.delay=mce,N.difference=$ae,N.differenceBy=jae,N.differenceWith=zae,N.drop=Bae,N.dropRight=Vae,N.dropRightWhile=Hae,N.dropWhile=Wae,N.fill=Uae,N.filter=Gle,N.flatMap=Xle,N.flatMapDeep=Qle,N.flatMapDepth=Zle,N.flatten=UI,N.flattenDeep=qae,N.flattenDepth=Gae,N.flip=vce,N.flow=fde,N.flowRight=hde,N.fromPairs=Yae,N.functions=hue,N.functionsIn=pue,N.groupBy=Jle,N.initial=Xae,N.intersection=Qae,N.intersectionBy=Zae,N.intersectionWith=Jae,N.invert=mue,N.invertBy=vue,N.invokeMap=tce,N.iteratee=Q1,N.keyBy=nce,N.keys=An,N.keysIn=xr,N.map=nm,N.mapKeys=yue,N.mapValues=xue,N.matches=pde,N.matchesProperty=gde,N.memoize=im,N.merge=wue,N.mergeWith=hN,N.method=mde,N.methodOf=vde,N.mixin=Z1,N.negate=om,N.nthArg=yde,N.omit=_ue,N.omitBy=Sue,N.once=bce,N.orderBy=rce,N.over=xde,N.overArgs=yce,N.overEvery=wde,N.overSome=_de,N.partial=W1,N.partialRight=iN,N.partition=ice,N.pick=Cue,N.pickBy=pN,N.property=wN,N.propertyOf=Sde,N.pull=rle,N.pullAll=GI,N.pullAllBy=ile,N.pullAllWith=ole,N.pullAt=sle,N.range=Cde,N.rangeRight=Ede,N.rearg=xce,N.reject=ace,N.remove=ale,N.rest=wce,N.reverse=B1,N.sampleSize=cce,N.set=Oue,N.setWith=Pue,N.shuffle=uce,N.slice=lle,N.sortBy=hce,N.sortedUniq=gle,N.sortedUniqBy=mle,N.split=Xue,N.spread=_ce,N.tail=vle,N.take=ble,N.takeRight=yle,N.takeRightWhile=xle,N.takeWhile=wle,N.tap=Lle,N.throttle=Sce,N.thru=tm,N.toArray=cN,N.toPairs=gN,N.toPairsIn=mN,N.toPath=Mde,N.toPlainObject=dN,N.transform=kue,N.unary=Cce,N.union=_le,N.unionBy=Sle,N.unionWith=Cle,N.uniq=Ele,N.uniqBy=Ole,N.uniqWith=Ple,N.unset=Due,N.unzip=V1,N.unzipWith=YI,N.update=Mue,N.updateWith=Tue,N.values=Rc,N.valuesIn=Aue,N.without=kle,N.words=yN,N.wrap=Ece,N.xor=Dle,N.xorBy=Mle,N.xorWith=Tle,N.zip=Ale,N.zipObject=Ile,N.zipObjectDeep=Nle,N.zipWith=Rle,N.entries=gN,N.entriesIn=mN,N.extend=fN,N.extendWith=lm,Z1(N,N),N.add=Ade,N.attempt=xN,N.camelCase=Lue,N.capitalize=vN,N.ceil=Ide,N.clamp=Iue,N.clone=Pce,N.cloneDeep=Dce,N.cloneDeepWith=Mce,N.cloneWith=kce,N.conformsTo=Tce,N.deburr=bN,N.defaultTo=dde,N.divide=Nde,N.endsWith=Fue,N.eq=Mi,N.escape=$ue,N.escapeRegExp=jue,N.every=qle,N.find=Yle,N.findIndex=HI,N.findKey=aue,N.findLast=Kle,N.findLastIndex=WI,N.findLastKey=lue,N.floor=Rde,N.forEach=XI,N.forEachRight=QI,N.forIn=cue,N.forInRight=uue,N.forOwn=due,N.forOwnRight=fue,N.get=G1,N.gt=Ace,N.gte=Ice,N.has=gue,N.hasIn=Y1,N.head=qI,N.identity=wr,N.includes=ece,N.indexOf=Kae,N.inRange=Nue,N.invoke=bue,N.isArguments=ol,N.isArray=st,N.isArrayBuffer=Nce,N.isArrayLike=yr,N.isArrayLikeObject=vn,N.isBoolean=Rce,N.isBuffer=Rs,N.isDate=Lce,N.isElement=Fce,N.isEmpty=$ce,N.isEqual=jce,N.isEqualWith=zce,N.isError=U1,N.isFinite=Bce,N.isFunction=jo,N.isInteger=oN,N.isLength=sm,N.isMap=sN,N.isMatch=Vce,N.isMatchWith=Hce,N.isNaN=Wce,N.isNative=Uce,N.isNil=Gce,N.isNull=qce,N.isNumber=aN,N.isObject=un,N.isObjectLike=hn,N.isPlainObject=nf,N.isRegExp=q1,N.isSafeInteger=Yce,N.isSet=lN,N.isString=am,N.isSymbol=qr,N.isTypedArray=Nc,N.isUndefined=Kce,N.isWeakMap=Xce,N.isWeakSet=Qce,N.join=ele,N.kebabCase=zue,N.last=gi,N.lastIndexOf=tle,N.lowerCase=Bue,N.lowerFirst=Vue,N.lt=Zce,N.lte=Jce,N.max=Lde,N.maxBy=Fde,N.mean=$de,N.meanBy=jde,N.min=zde,N.minBy=Bde,N.stubArray=ew,N.stubFalse=tw,N.stubObject=Ode,N.stubString=Pde,N.stubTrue=kde,N.multiply=Vde,N.nth=nle,N.noConflict=bde,N.noop=J1,N.now=rm,N.pad=Hue,N.padEnd=Wue,N.padStart=Uue,N.parseInt=que,N.random=Rue,N.reduce=oce,N.reduceRight=sce,N.repeat=Gue,N.replace=Yue,N.result=Eue,N.round=Hde,N.runInContext=Y,N.sample=lce,N.size=dce,N.snakeCase=Kue,N.some=fce,N.sortedIndex=cle,N.sortedIndexBy=ule,N.sortedIndexOf=dle,N.sortedLastIndex=fle,N.sortedLastIndexBy=hle,N.sortedLastIndexOf=ple,N.startCase=Que,N.startsWith=Zue,N.subtract=Wde,N.sum=Ude,N.sumBy=qde,N.template=Jue,N.times=Dde,N.toFinite=zo,N.toInteger=ft,N.toLength=uN,N.toLower=ede,N.toNumber=mi,N.toSafeInteger=eue,N.toString=Lt,N.toUpper=tde,N.trim=nde,N.trimEnd=rde,N.trimStart=ide,N.truncate=ode,N.unescape=sde,N.uniqueId=Tde,N.upperCase=ade,N.upperFirst=K1,N.each=XI,N.eachRight=QI,N.first=qI,Z1(N,function(){var u={};return no(N,function(h,y){$t.call(N.prototype,y)||(u[y]=h)}),u}(),{chain:!1}),N.VERSION=r,ui(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){N[u].placeholder=N}),ui(["drop","take"],function(u,h){Ct.prototype[u]=function(y){y=y===n?1:Pn(ft(y),0);var E=this.__filtered__&&!h?new Ct(this):this.clone();return E.__filtered__?E.__takeCount__=Kn(y,E.__takeCount__):E.__views__.push({size:Kn(y,H),type:u+(E.__dir__<0?"Right":"")}),E},Ct.prototype[u+"Right"]=function(y){return this.reverse()[u](y).reverse()}}),ui(["filter","map","takeWhile"],function(u,h){var y=h+1,E=y==J||y==X;Ct.prototype[u]=function(M){var L=this.clone();return L.__iteratees__.push({iteratee:Ge(M,3),type:y}),L.__filtered__=L.__filtered__||E,L}}),ui(["head","last"],function(u,h){var y="take"+(h?"Right":"");Ct.prototype[u]=function(){return this[y](1).value()[0]}}),ui(["initial","tail"],function(u,h){var y="drop"+(h?"":"Right");Ct.prototype[u]=function(){return this.__filtered__?new Ct(this):this[y](1)}}),Ct.prototype.compact=function(){return this.filter(wr)},Ct.prototype.find=function(u){return this.filter(u).head()},Ct.prototype.findLast=function(u){return this.reverse().find(u)},Ct.prototype.invokeMap=vt(function(u,h){return typeof u=="function"?new Ct(this):this.map(function(y){return Xd(y,u,h)})}),Ct.prototype.reject=function(u){return this.filter(om(Ge(u)))},Ct.prototype.slice=function(u,h){u=ft(u);var y=this;return y.__filtered__&&(u>0||h<0)?new Ct(y):(u<0?y=y.takeRight(-u):u&&(y=y.drop(u)),h!==n&&(h=ft(h),y=h<0?y.dropRight(-h):y.take(h-u)),y)},Ct.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ct.prototype.toArray=function(){return this.take(H)},no(Ct.prototype,function(u,h){var y=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),M=N[E?"take"+(h=="last"?"Right":""):h],L=E||/^find/.test(h);M&&(N.prototype[h]=function(){var z=this.__wrapped__,U=E?[1]:arguments,Z=z instanceof Ct,be=U[0],ye=Z||st(z),Ce=function(St){var Et=M.apply(N,ks([St],U));return E&&Ae?Et[0]:Et};ye&&y&&typeof be=="function"&&be.length!=1&&(Z=ye=!1);var Ae=this.__chain__,ze=!!this.__actions__.length,Ye=L&&!Ae,mt=Z&&!ze;if(!L&&ye){z=mt?z:new Ct(this);var Ke=u.apply(z,U);return Ke.__actions__.push({func:tm,args:[Ce],thisArg:n}),new fi(Ke,Ae)}return Ye&&mt?u.apply(this,U):(Ke=this.thru(Ce),Ye?E?Ke.value()[0]:Ke.value():Ke)})}),ui(["pop","push","shift","sort","splice","unshift"],function(u){var h=Pg[u],y=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",E=/^(?:pop|shift)$/.test(u);N.prototype[u]=function(){var M=arguments;if(E&&!this.__chain__){var L=this.value();return h.apply(st(L)?L:[],M)}return this[y](function(z){return h.apply(st(z)?z:[],M)})}}),no(Ct.prototype,function(u,h){var y=N[h];if(y){var E=y.name+"";$t.call(Dc,E)||(Dc[E]=[]),Dc[E].push({name:h,func:y})}}),Dc[Yg(n,w).name]=[{name:"wrapper",func:n}],Ct.prototype.clone=sse,Ct.prototype.reverse=ase,Ct.prototype.value=lse,N.prototype.at=Fle,N.prototype.chain=$le,N.prototype.commit=jle,N.prototype.next=zle,N.prototype.plant=Vle,N.prototype.reverse=Hle,N.prototype.toJSON=N.prototype.valueOf=N.prototype.value=Wle,N.prototype.first=N.prototype.head,Hd&&(N.prototype[Hd]=Ble),N},Oc=joe();Qa?((Qa.exports=Oc)._=Oc,Qx._=Oc):zn._=Oc}).call(Ho)}(wf,wf.exports);var _f=wf.exports;const Vs=Lc(_f),fe=Mw()(Vw((e,t)=>({dashboard:{id:"",style:Am},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{addFilteringCard:n=>{e(r=>{var i;(i=r.filteringCards)==null||i.push(n)})},removeFilteringCard:n=>{e(r=>{var o,s;const i=(o=r.filteringCards)==null?void 0:o.findIndex(a=>a.id===n.id);i!==void 0&&i>-1&&((s=r.filteringCards)==null||s.splice(i,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,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&_f.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.title=i)})})},setCardDescription:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&_f.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.description=i)})})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.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(g=>g.id===r);f&&(f.sql=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setFrameCardData:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&_f.forEach(s.frames,c=>{var f;const d=(f=c.cards)==null?void 0:f.find(g=>g.id===r);d&&(d.data=i)})})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n);i>-1&&r.filterValues.splice(i,1)}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1&&r.filterValues.splice(i,1,n)}})},addFilter:n=>{e(r=>{var i;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1))}})},updateFrameCard:(n,r,i)=>{e(o=>{var l,c,d,f,g;const s=(c=(l=o.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(d=s==null?void 0:s.frames)==null?void 0:d.find(p=>p.id===r);if(a){const p=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===i.id);p>-1&&((g=a.cards)==null||g.splice(p,1,i))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){o.frames||(o.frames=[]),(l=o.frames)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:10};(c=o.layout)==null||c.push(f),(d=i.onAddFrame)==null||d.call(i,r,n)}})},removeFrame:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){const f=(l=o.frames)==null?void 0:l.findIndex(g=>g.id===r);f&&f>-1&&((c=o.frames)==null||c.splice(f,1),(d=o.layout)==null||d.splice(f,1))}})},updateFrame:(n,r)=>{e(i=>{var a,l,c,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=o==null?void 0:o.frames)==null?void 0:c.findIndex(f=>f.id===r.id);o&&((d=o.frames)==null||d.splice(s,1,r))})},updateCard:(n,r)=>{e(i=>{var a,l,c,d,f;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(g=>g.id===r.id);o&&((d=o.cards)==null||d.splice(s,1,r),(f=i.onUpdateCard)==null||f.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,d,f,g;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((d=o.cards)==null||d.splice(s,1),(f=o.layout)==null||f.splice(s,1),(g=i.onRemoveCard)==null||g.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(d=>d.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.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(i=>i.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.frames)==null?void 0:o.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.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=(o=a[l].cards)==null?void 0:o.find(d=>d.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{xR({card:n,dataPoint:r,set:e,get:t})}}}))),Gc=()=>fe(e=>e.actions);process.env.NODE_ENV==="development"&&Ww("DashboardStore",fe);const wR={theme:"system",setTheme:()=>null},f_=m.createContext(wR);function _R({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return _.jsx(f_.Provider,{...r,value:s,children:e})}const Bm=()=>{const e=m.useContext(f_);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function SR(e,t,n){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}&version=${t}`,{headers:{Authorization:`Bearer ${n}`}})).json()}function h_(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function p_(e,t){const n=h_(e);return n==="dark"?Vs.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function g_({id:e,version:t,authToken:n,customStyle:r,currentTheme:i,onSave:o,onEvent:s}){const{data:a,refetch:l,isLoading:c,isError:d}=Xr({queryKey:[e],queryFn:()=>SR(e,t||"",n==null?void 0:n.accessToken),enabled:!1}),{theme:f,setTheme:g}=Bm(),{setDashboard:p,setSelectedSheetId:v,setStyle:b,setOnSaveFunction:x}=fe(T=>T.actions);fe(T=>T.actions.setCustomCards);const w=fe(T=>T.actions.setFilterValues),S=fe(T=>T.actions.setBookmarkKey),C=fe(T=>T.actions.setAuthToken),P=fe(T=>T.actions.setThemeStyle),O=fe(T=>T.actions.setDashboardTheme),k=fe(T=>T.actions.setOnEvent);return m.useEffect(()=>{if(f){const T=h_(f);O(T)}},[f,O]),m.useEffect(()=>{i&&g(i)},[i,g]),m.useEffect(()=>{const T=Vs.cloneDeep(Am);if(r){const I=Vs.merge(T,r),F=p_(f,I);P(F),b(I)}else{const I=p_(f,T);P(I),b(Am)}},[f,r,b,P]),m.useEffect(()=>{var B;if(!a||!a.dashboard)return;const T=a.dashboard,I=gs(T.id),F=JSON.parse(localStorage.getItem(I)||"[]"),j=F.find(V=>V.default===!0);if(j)p(j.template),S(j.name),j.filterValues&&w(j.filterValues);else{p(T);const V=F.find(q=>(q==null?void 0:q.name)==="Original");V?V.template=T:F.push({name:"Original",template:T,default:!1}),localStorage.setItem(I,JSON.stringify(F))}v((B=T.sheets)==null?void 0:B[0].id)},[a,p,v,w,S]),m.useEffect(()=>{o&&x(o),s&&k(s)},[o,x,s,k]),m.useEffect(()=>{n&&n.accessToken&&(C(n),l())},[n,l,C]),{isLoading:c,isError:d}}function Sf({className:e,...t}){return _.jsx("div",{className:De("animate-pulse rounded-md bg-muted",e),...t})}function m_({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:d,customCards:f,...g}){fe(w=>w.selectedSheetId);const p=fe(w=>w.themeStyle),v=fe(w=>w.onEvent),{isLoading:b,isError:x}=g_({id:a,version:d,authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return b||!l?(v==null||v({type:"info",message:`isLoading: ${b}, accessToken: ${l==null?void 0:l.accessToken}`}),i?_.jsx(i,{message:"loading"}):_.jsx("div",{className:" flex items-center gap-3",children:_.jsx(Sf,{className:"dark:h-[2px] h-1 w-full"})})):x?(v==null||v({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),_.jsx(o,{})):_.jsx("div",{children:"Error"})):_.jsx("div",{className:De(" h-full flex flex-col justify-between",p==null?void 0:p.dashboardPanel,e),role:"dashboard-panel",...g})}function se(){return se=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},se.apply(this,arguments)}function Pe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function kn(e,t=[]){let n=[];function r(o,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:g,children:p,...v}=f,b=(g==null?void 0:g[e][l])||a,x=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:x},p)}function d(f,g){const p=(g==null?void 0:g[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const i=()=>{const o=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,CR(i,...t)]}function CR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ER(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Cf(...e){return t=>e.forEach(n=>ER(n,t))}function nt(...e){return m.useCallback(Cf(...e),e)}const oo=m.forwardRef((e,t)=>{const{children:n,...r}=e,i=m.Children.toArray(n),o=i.find(OR);if(o){const s=o.props.children,a=i.map(l=>l===o?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Vm,se({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Vm,se({},r,{ref:t}),n)});oo.displayName="Slot";const Vm=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...PR(r,n.props),ref:t?Cf(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Vm.displayName="SlotClone";const v_=({children:e})=>m.createElement(m.Fragment,null,e);function OR(e){return m.isValidElement(e)&&e.type===v_}function PR(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Ef(e){const t=e+"CollectionProvider",[n,r]=kn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:b}=p,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(i,{scope:v,itemMap:w,collectionRef:x},b)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:b,children:x}=p,w=o(a,b),S=nt(v,w.collectionRef);return m.createElement(oo,{ref:S},x)}),c=e+"CollectionItemSlot",d="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:b,children:x,...w}=p,S=m.useRef(null),C=nt(v,S),P=o(c,b);return m.useEffect(()=>(P.itemMap.set(S,{ref:S,...w}),()=>void P.itemMap.delete(S))),m.createElement(oo,{[d]:"",ref:C},x)});function g(p){const v=o(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((P,O)=>w.indexOf(P.ref.current)-w.indexOf(O.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,r]}const Vn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},kR=de.useId||(()=>{});let DR=0;function or(e){const[t,n]=de.useState(kR());return Vn(()=>{e||n(r=>r??String(DR++))},[e]),e||(t?`radix-${t}`:"")}const He=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=m.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?oo:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,se({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function b_(e,t){e&&kt.flushSync(()=>e.dispatchEvent(t))}function _n(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 Qn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=MR({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=_n(n),l=m.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else i(c)},[o,e,i,a]);return[s,l]}function MR({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,i=m.useRef(r),o=_n(t);return m.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const TR=m.createContext(void 0);function Hs(e){const t=m.useContext(TR);return e||t||"ltr"}const Hm="rovingFocusGroup.onEntryFocus",AR={bubbles:!1,cancelable:!0},Wm="RovingFocusGroup",[Um,y_,IR]=Ef(Wm),[NR,fl]=kn(Wm,[IR]),[RR,LR]=NR(Wm),FR=m.forwardRef((e,t)=>m.createElement(Um.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Um.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement($R,se({},e,{ref:t}))))),$R=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=e,f=m.useRef(null),g=nt(t,f),p=Hs(o),[v=null,b]=Qn({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),S=_n(c),C=y_(n),P=m.useRef(!1),[O,k]=m.useState(0);return m.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(Hm,S),()=>T.removeEventListener(Hm,S)},[S]),m.createElement(RR,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(T=>b(T),[b]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>k(T=>T-1),[])},m.createElement(He.div,se({tabIndex:x||O===0?-1:0,"data-orientation":r},d,{ref:g,style:{outline:"none",...e.style},onMouseDown:Pe(e.onMouseDown,()=>{P.current=!0}),onFocus:Pe(e.onFocus,T=>{const I=!P.current;if(T.target===T.currentTarget&&I&&!x){const F=new CustomEvent(Hm,AR);if(T.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=C().filter($=>$.focusable),B=j.find($=>$.active),V=j.find($=>$.id===v),J=[B,V,...j].filter(Boolean).map($=>$.ref.current);x_(J)}}P.current=!1}),onBlur:Pe(e.onBlur,()=>w(!1))})))}),jR="RovingFocusGroupItem",zR=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=or(),l=o||a,c=LR(jR,n),d=c.currentTabStopId===l,f=y_(n),{onFocusableItemAdd:g,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),m.createElement(Um.ItemSlot,{scope:n,id:l,focusable:r,active:i},m.createElement(He.span,se({tabIndex:d?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Pe(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Pe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Pe(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=HR(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let w=f().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=c.loop?WR(w,S+1):w.slice(S+1)}setTimeout(()=>x_(w))}})})))}),BR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function HR(e,t,n){const r=VR(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return BR[r]}function x_(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function WR(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const qm=FR,Gm=zR;function UR(e,t){return m.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const yn=e=>{const{present:t,children:n}=e,r=qR(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=nt(r.ref,i.ref);return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:o}):null};yn.displayName="Presence";function qR(e){const[t,n]=m.useState(),r=m.useRef({}),i=m.useRef(e),o=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=UR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Of(r.current);o.current=a==="mounted"?c:"none"},[a]),Vn(()=>{const c=r.current,d=i.current;if(d!==e){const g=o.current,p=Of(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&g!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Vn(()=>{if(t){const c=f=>{const p=Of(r.current).includes(f.animationName);f.target===t&&p&&kt.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=Of(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),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 Of(e){return(e==null?void 0:e.animationName)||"none"}const w_="Tabs",[GR,Zde]=kn(w_,[fl]),__=fl(),[YR,Ym]=GR(w_),KR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,d=Hs(a),[f,g]=Qn({prop:r,onChange:i,defaultProp:o});return m.createElement(YR,{scope:n,baseId:or(),value:f,onValueChange:g,orientation:s,dir:d,activationMode:l},m.createElement(He.div,se({dir:d,"data-orientation":s},c,{ref:t})))}),XR="TabsList",QR=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Ym(XR,n),s=__(n);return m.createElement(qm,se({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),m.createElement(He.div,se({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),ZR="TabsTrigger",JR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Ym(ZR,n),a=__(n),l=S_(s.baseId,r),c=C_(s.baseId,r),d=r===s.value;return m.createElement(Gm,se({asChild:!0},a,{focusable:!i,active:d}),m.createElement(He.button,se({type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:Pe(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Pe(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Pe(e.onFocus,()=>{const f=s.activationMode!=="manual";!d&&!i&&f&&s.onValueChange(r)})})))}),e4="TabsContent",t4=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=Ym(e4,n),l=S_(a.baseId,r),c=C_(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),m.createElement(yn,{present:i||d},({present:g})=>m.createElement(He.div,se({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),g&&o))});function S_(e,t){return`${e}-trigger-${t}`}function C_(e,t){return`${e}-content-${t}`}const n4=KR,E_=QR,O_=JR,P_=t4,k_=n4,D_=de.forwardRef(({className:e,...t},n)=>_.jsx(E_,{ref:n,className:De("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));D_.displayName=E_.displayName;const Km=de.forwardRef(({className:e,...t},n)=>_.jsx(O_,{ref:n,className:De("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}));Km.displayName=O_.displayName;const Pf=de.forwardRef(({className:e,...t},n)=>_.jsx(P_,{ref:n,className:De("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Pf.displayName=P_.displayName;var M_={exports:{}},Yc={},Xm={exports:{}};(function(e,t){(function(n,r){r(t)})(Ho,function(n){function r(ee){return function(ie,we,re,Ie,ae,Se,We){return ee(ie,we,We)}}function i(ee){return function(ie,we,re,Ie){if(!ie||!we||typeof ie!="object"||typeof we!="object")return ee(ie,we,re,Ie);var ae=Ie.get(ie),Se=Ie.get(we);if(ae&&Se)return ae===we&&Se===ie;Ie.set(ie,we),Ie.set(we,ie);var We=ee(ie,we,re,Ie);return Ie.delete(ie),Ie.delete(we),We}}function o(ee,Q){var ie={};for(var we in ee)ie[we]=ee[we];for(var we in Q)ie[we]=Q[we];return ie}function s(ee){return ee.constructor===Object||ee.constructor==null}function a(ee){return typeof ee.then=="function"}function l(ee,Q){return ee===Q||ee!==ee&&Q!==Q}var c="[object Arguments]",d="[object Boolean]",f="[object Date]",g="[object RegExp]",p="[object Map]",v="[object Number]",b="[object Object]",x="[object Set]",w="[object String]",S=Object.prototype.toString;function C(ee){var Q=ee.areArraysEqual,ie=ee.areDatesEqual,we=ee.areMapsEqual,re=ee.areObjectsEqual,Ie=ee.areRegExpsEqual,ae=ee.areSetsEqual,Se=ee.createIsNestedEqual,We=Se(dt);function dt(qe,gt,Gt){if(qe===gt)return!0;if(!qe||!gt||typeof qe!="object"||typeof gt!="object")return qe!==qe&&gt!==gt;if(s(qe)&&s(gt))return re(qe,gt,We,Gt);var Bt=Array.isArray(qe),gn=Array.isArray(gt);if(Bt||gn)return Bt===gn&&Q(qe,gt,We,Gt);var Rt=S.call(qe);return Rt!==S.call(gt)?!1:Rt===f?ie(qe,gt,We,Gt):Rt===g?Ie(qe,gt,We,Gt):Rt===p?we(qe,gt,We,Gt):Rt===x?ae(qe,gt,We,Gt):Rt===b||Rt===c?a(qe)||a(gt)?!1:re(qe,gt,We,Gt):Rt===d||Rt===v||Rt===w?l(qe.valueOf(),gt.valueOf()):!1}return dt}function P(ee,Q,ie,we){var re=ee.length;if(Q.length!==re)return!1;for(;re-- >0;)if(!ie(ee[re],Q[re],re,re,ee,Q,we))return!1;return!0}var O=i(P);function k(ee,Q){return l(ee.valueOf(),Q.valueOf())}function T(ee,Q,ie,we){var re=ee.size===Q.size;if(!re)return!1;if(!ee.size)return!0;var Ie={},ae=0;return ee.forEach(function(Se,We){if(re){var dt=!1,qe=0;Q.forEach(function(gt,Gt){!dt&&!Ie[qe]&&(dt=ie(We,Gt,ae,qe,ee,Q,we)&&ie(Se,gt,We,Gt,ee,Q,we))&&(Ie[qe]=!0),qe++}),ae++,re=dt}}),re}var I=i(T),F="_owner",j=Object.prototype.hasOwnProperty;function B(ee,Q,ie,we){var re=Object.keys(ee),Ie=re.length;if(Object.keys(Q).length!==Ie)return!1;for(var ae;Ie-- >0;){if(ae=re[Ie],ae===F){var Se=!!ee.$$typeof,We=!!Q.$$typeof;if((Se||We)&&Se!==We)return!1}if(!j.call(Q,ae)||!ie(ee[ae],Q[ae],ae,ae,ee,Q,we))return!1}return!0}var V=i(B);function q(ee,Q){return ee.source===Q.source&&ee.flags===Q.flags}function J(ee,Q,ie,we){var re=ee.size===Q.size;if(!re)return!1;if(!ee.size)return!0;var Ie={};return ee.forEach(function(ae,Se){if(re){var We=!1,dt=0;Q.forEach(function(qe,gt){!We&&!Ie[dt]&&(We=ie(ae,qe,Se,gt,ee,Q,we))&&(Ie[dt]=!0),dt++}),re=We}}),re}var $=i(J),X=Object.freeze({areArraysEqual:P,areDatesEqual:k,areMapsEqual:T,areObjectsEqual:B,areRegExpsEqual:q,areSetsEqual:J,createIsNestedEqual:r}),W=Object.freeze({areArraysEqual:O,areDatesEqual:k,areMapsEqual:I,areObjectsEqual:V,areRegExpsEqual:q,areSetsEqual:$,createIsNestedEqual:r}),te=C(X);function le(ee,Q){return te(ee,Q,void 0)}var A=C(o(X,{createIsNestedEqual:function(){return l}}));function H(ee,Q){return A(ee,Q,void 0)}var ne=C(W);function R(ee,Q){return ne(ee,Q,new WeakMap)}var ue=C(o(W,{createIsNestedEqual:function(){return l}}));function xe(ee,Q){return ue(ee,Q,new WeakMap)}function ge(ee){return C(o(X,ee(X)))}function pe(ee){var Q=C(o(W,ee(W)));return function(ie,we,re){return re===void 0&&(re=new WeakMap),Q(ie,we,re)}}n.circularDeepEqual=R,n.circularShallowEqual=xe,n.createCustomCircularEqual=pe,n.createCustomEqual=ge,n.deepEqual=le,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Xm,Xm.exports);var Qm=Xm.exports;const Zm=dm(PN);var bt={},r4=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(bt,"__esModule",{value:!0}),bt.bottom=Jm,bt.childrenEqual=a4,bt.cloneLayout=A_,bt.cloneLayoutItem=Ws,bt.collides=kf,bt.compact=N_,bt.compactItem=R_,bt.compactType=v4,bt.correctBounds=L_,bt.fastPositionEqual=c4,bt.fastRGLPropsEqual=void 0,bt.getAllCollisions=F_,bt.getFirstCollision=Us,bt.getLayoutItem=tv,bt.getStatics=nv,bt.modifyLayout=I_,bt.moveElement=Xc,bt.moveElementAwayFromCollision=rv,bt.noop=void 0,bt.perc=d4,bt.resizeItemInDirection=h4,bt.setTopLeft=g4,bt.setTransform=p4,bt.sortLayoutItems=cv,bt.sortLayoutItemsByColRow=V_,bt.sortLayoutItemsByRowCol=B_,bt.synchronizeLayoutWithChildren=m4,bt.validateLayout=H_,bt.withLayoutItem=s4;var T_=Qm,Kc=i4(m);function i4(e){return e&&e.__esModule?e:{default:e}}const o4=process.env.NODE_ENV==="production";function Jm(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function A_(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Ws(e[n]);return t}function I_(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function s4(e,t,n){let r=tv(e,t);return r?(r=n(Ws(r)),e=I_(e,r),[e,r]):[e,null]}function Ws(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 a4(e,t){return(0,T_.deepEqual)(Kc.default.Children.map(e,n=>n==null?void 0:n.key),Kc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,T_.deepEqual)(Kc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Kc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const l4=r4;bt.fastRGLPropsEqual=l4;function c4(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function kf(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 N_(e,t,n,r){const i=nv(e),o=cv(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=Ws(o[a]);c.static||(c=R_(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const u4={x:"w",y:"h"};function ev(e,t,n,r){const i=u4[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;kf(t,a)&&ev(e,a,n+t[i],r)}}t[r]=n}function R_(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Jm(e),t.y);t.y>0&&!Us(e,t);)t.y--;else if(a)for(;t.x>0&&!Us(e,t);)t.x--;let l;for(;(l=Us(e,t))&&!(n===null&&o);)if(a?ev(i,t,l.x+l.w,"x"):ev(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Us(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function L_(e,t){const n=nv(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Us(n,o);)o.y++}return e}function tv(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Us(e,t){for(let n=0,r=e.length;n<r;n++)if(kf(e[n],t))return e[n]}function F_(e,t){return e.filter(n=>kf(n,t))}function nv(e){return e.filter(t=>t.static)}function Xc(e,t,n,r,i,o,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,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=cv(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=F_(f,t),v=p.length>0;if(v&&l)return A_(e);if(v&&o)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=d,t.moved=!1,e;for(let b=0,x=p.length;b<x;b++){const w=p[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=rv(e,w,t,i,s):e=rv(e,t,w,i,s))}return e}function rv(e,t,n,r,i,o){const s=i==="horizontal",a=i==="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"},g=Us(e,f),p=g&&g.y+g.h>t.y,v=g&&t.x+t.w>g.x;if(g){if(p&&a)return Xc(e,n,void 0,t.y+1,r,l,i);if(p&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return Xc(e,t,n.x,void 0,r,l,i)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),Xc(e,n,s?f.x:void 0,a?f.y:void 0,r,l,i)}const c=s?n.x+1:void 0,d=a?n.y+1:void 0;return c==null&&d==null?e:Xc(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function d4(e){return e*100+"%"}const $_=(e,t,n,r)=>e+n>r?t:n,j_=(e,t,n)=>e<0?t:n,z_=e=>Math.max(0,e),iv=e=>Math.max(0,e),ov=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:j_(s,e.height,i),top:iv(s)}},sv=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:$_(e.left,e.width,s,n),left:z_(i)}},av=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:$_(e.left,e.width,o,n),top:iv(r),left:z_(s)}},lv=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:j_(r,e.height,o),top:iv(r)}},f4={n:ov,ne:function(){return ov(arguments.length<=0?void 0:arguments[0],sv(...arguments))},e:sv,se:function(){return lv(arguments.length<=0?void 0:arguments[0],sv(...arguments))},s:lv,sw:function(){return lv(arguments.length<=0?void 0:arguments[0],av(...arguments))},w:av,nw:function(){return ov(arguments.length<=0?void 0:arguments[0],av(...arguments))}};function h4(e,t,n,r){const i=f4[e];return i?i(t,{...t,...n},r):n}function p4(e){let{top:t,left:n,width:r,height:i}=e;const o="translate(".concat(n,"px,").concat(t,"px)");return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function g4(e){let{top:t,left:n,width:r,height:i}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function cv(e,t){return t==="horizontal"?V_(e):t==="vertical"?B_(e):e}function B_(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 V_(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 m4(e,t,n,r,i){e=e||[];const o=[];Kc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=tv(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(Ws(l)):c?(o4||H_([c],"ReactGridLayout.children"),o.push(Ws({...c,i:a.key}))):o.push(Ws({w:1,h:1,x:0,y:Jm(o),i:String(a.key)}))});const s=L_(o,{cols:n});return i?s:N_(s,r,n)}function H_(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,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++)if(typeof o[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function v4(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function rfe(){}const b4=()=>{};bt.noop=b4;var Ai={};Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.calcGridColWidth=Df,Ai.calcGridItemPosition=y4,Ai.calcGridItemWHPx=uv,Ai.calcWH=w4,Ai.calcXY=x4,Ai.clamp=qs;function Df(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function uv(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function y4(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Df(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=uv(r,c,s[0]),d.height=uv(i,l,s[1])),o&&o.dragging?(d.top=Math.round(o.dragging.top),d.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(d.top=Math.round(o.resizing.top),d.left=Math.round(o.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((c+s[0])*t+a[0])),d}function x4(e,t,n,r,i){const{margin:o,cols:s,rowHeight:a,maxRows:l}=e,c=Df(e);let d=Math.round((n-o[0])/(c+o[0])),f=Math.round((t-o[1])/(a+o[1]));return d=qs(d,0,s-r),f=qs(f,0,l-i),{x:d,y:f}}function w4(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,d=Df(e);let f=Math.round((t+s[0])/(d+s[0])),g=Math.round((n+s[1])/(c+s[1])),p=qs(f,0,l-r),v=qs(g,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(p=qs(f,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(v=qs(g,0,a)),{w:p,h:v}}function qs(e,t,n){return Math.max(Math.min(e,n),t)}var Mf={},dv={exports:{}},fv,W_;function hv(){if(W_)return fv;W_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return fv=e,fv}var pv,U_;function _4(){if(U_)return pv;U_=1;var e=hv();function t(){}function n(){}return n.resetWarningCache=t,pv=function(){function r(s,a,l,c,d,f){if(f!==e){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}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},pv}var Tf={exports:{}},At={};/** @license React v16.13.1
86
86
  * react-is.development.js
87
87
  *
88
88
  * Copyright (c) Facebook, Inc. and its affiliates.
89
89
  *
90
90
  * This source code is licensed under the MIT license found in the
91
91
  * LICENSE file in the root directory of this source tree.
92
- */var q_;function S4(){return q_||(q_=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,i=e?Symbol.for("react.strict_mode"):60108,o=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,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,p=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,S=e?Symbol.for("react.scope"):60119;function C(te){return typeof te=="string"||typeof te=="function"||te===r||te===c||te===o||te===i||te===f||te===g||typeof te=="object"&&te!==null&&(te.$$typeof===v||te.$$typeof===p||te.$$typeof===s||te.$$typeof===a||te.$$typeof===d||te.$$typeof===x||te.$$typeof===w||te.$$typeof===S||te.$$typeof===b)}function P(te){if(typeof te=="object"&&te!==null){var Ie=te.$$typeof;switch(Ie){case t:var ae=te.type;switch(ae){case l:case c:case r:case o:case i:case f:return ae;default:var Se=ae&&ae.$$typeof;switch(Se){case a:case d:case v:case p:case s:return Se;default:return Ie}}case n:return Ie}}}var O=l,k=c,T=a,I=s,F=t,j=d,B=r,V=v,q=p,J=n,$=o,X=i,W=f,ne=!1;function le(te){return ne||(ne=!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.")),A(te)||P(te)===l}function A(te){return P(te)===c}function H(te){return P(te)===a}function re(te){return P(te)===s}function R(te){return typeof te=="object"&&te!==null&&te.$$typeof===t}function ue(te){return P(te)===d}function xe(te){return P(te)===r}function ge(te){return P(te)===v}function pe(te){return P(te)===p}function ee(te){return P(te)===n}function Q(te){return P(te)===o}function ie(te){return P(te)===i}function we(te){return P(te)===f}At.AsyncMode=O,At.ConcurrentMode=k,At.ContextConsumer=T,At.ContextProvider=I,At.Element=F,At.ForwardRef=j,At.Fragment=B,At.Lazy=V,At.Memo=q,At.Portal=J,At.Profiler=$,At.StrictMode=X,At.Suspense=W,At.isAsyncMode=le,At.isConcurrentMode=A,At.isContextConsumer=H,At.isContextProvider=re,At.isElement=R,At.isForwardRef=ue,At.isFragment=xe,At.isLazy=ge,At.isMemo=pe,At.isPortal=ee,At.isProfiler=Q,At.isStrictMode=ie,At.isSuspense=we,At.isValidElementType=C,At.typeOf=P}()),At}var It={};/** @license React v16.13.1
92
+ */var q_;function S4(){return q_||(q_=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,i=e?Symbol.for("react.strict_mode"):60108,o=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,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,p=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,S=e?Symbol.for("react.scope"):60119;function C(re){return typeof re=="string"||typeof re=="function"||re===r||re===c||re===o||re===i||re===f||re===g||typeof re=="object"&&re!==null&&(re.$$typeof===v||re.$$typeof===p||re.$$typeof===s||re.$$typeof===a||re.$$typeof===d||re.$$typeof===x||re.$$typeof===w||re.$$typeof===S||re.$$typeof===b)}function P(re){if(typeof re=="object"&&re!==null){var Ie=re.$$typeof;switch(Ie){case t:var ae=re.type;switch(ae){case l:case c:case r:case o:case i:case f:return ae;default:var Se=ae&&ae.$$typeof;switch(Se){case a:case d:case v:case p:case s:return Se;default:return Ie}}case n:return Ie}}}var O=l,k=c,T=a,I=s,F=t,j=d,B=r,V=v,q=p,J=n,$=o,X=i,W=f,te=!1;function le(re){return te||(te=!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.")),A(re)||P(re)===l}function A(re){return P(re)===c}function H(re){return P(re)===a}function ne(re){return P(re)===s}function R(re){return typeof re=="object"&&re!==null&&re.$$typeof===t}function ue(re){return P(re)===d}function xe(re){return P(re)===r}function ge(re){return P(re)===v}function pe(re){return P(re)===p}function ee(re){return P(re)===n}function Q(re){return P(re)===o}function ie(re){return P(re)===i}function we(re){return P(re)===f}At.AsyncMode=O,At.ConcurrentMode=k,At.ContextConsumer=T,At.ContextProvider=I,At.Element=F,At.ForwardRef=j,At.Fragment=B,At.Lazy=V,At.Memo=q,At.Portal=J,At.Profiler=$,At.StrictMode=X,At.Suspense=W,At.isAsyncMode=le,At.isConcurrentMode=A,At.isContextConsumer=H,At.isContextProvider=ne,At.isElement=R,At.isForwardRef=ue,At.isFragment=xe,At.isLazy=ge,At.isMemo=pe,At.isPortal=ee,At.isProfiler=Q,At.isStrictMode=ie,At.isSuspense=we,At.isValidElementType=C,At.typeOf=P}()),At}var It={};/** @license React v16.13.1
93
93
  * react-is.production.min.js
94
94
  *
95
95
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -100,10 +100,10 @@ function print() { __p += __j.call(arguments, '') }
100
100
  object-assign
101
101
  (c) Sindre Sorhus
102
102
  @license MIT
103
- */var gv,X_;function E4(){if(X_)return gv;X_=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(d){return s[d]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(d){c[d]=d}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return gv=i()?Object.assign:function(o,s){for(var a,l=r(o),c,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var g=0;g<c.length;g++)n.call(a,c[g])&&(l[c[g]]=a[c[g]])}}return l},gv}var mv,Q_;function Z_(){return Q_||(Q_=1,mv=Function.call.bind(Object.prototype.hasOwnProperty)),mv}var vv,J_;function O4(){if(J_)return vv;J_=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=hv(),n={},r=Z_();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var d in o)if(r(o,d)){var f;try{if(typeof o[d]!="function"){var g=Error((l||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw g.name="Invariant Violation",g}f=o[d](s,d,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof 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 p=c?c():"";e("Failed "+a+" type: "+f.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},vv=i,vv}var bv,eS;function P4(){if(eS)return bv;eS=1;var e=K_(),t=E4(),n=hv(),r=Z_(),i=O4(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return bv=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(A){var H=A&&(c&&A[c]||A[d]);if(typeof H=="function")return H}var g="<<anonymous>>",p={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:S(),arrayOf:C,element:P(),elementType:O(),instanceOf:k,node:j(),objectOf:I,oneOf:T,oneOfType:F,shape:V,exact:q};function v(A,H){return A===H?A!==0||1/A===1/H:A!==A&&H!==H}function b(A,H){this.message=A,this.data=H&&typeof H=="object"?H:{},this.stack=""}b.prototype=Error.prototype;function x(A){if(process.env.NODE_ENV!=="production")var H={},re=0;function R(xe,ge,pe,ee,Q,ie,we){if(ee=ee||g,ie=ie||pe,we!==n){if(l){var te=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 te.name="Invariant Violation",te}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ie=ee+":"+pe;!H[Ie]&&re<3&&(o("You are manually calling a React.PropTypes validation function for the `"+ie+"` prop on `"+ee+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),H[Ie]=!0,re++)}}return ge[pe]==null?xe?ge[pe]===null?new b("The "+Q+" `"+ie+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new b("The "+Q+" `"+ie+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:A(ge,pe,ee,Q,ie)}var ue=R.bind(null,!1);return ue.isRequired=R.bind(null,!0),ue}function w(A){function H(re,R,ue,xe,ge,pe){var ee=re[R],Q=X(ee);if(Q!==A){var ie=W(ee);return new b("Invalid "+xe+" `"+ge+"` of type "+("`"+ie+"` supplied to `"+ue+"`, expected ")+("`"+A+"`."),{expectedType:A})}return null}return x(H)}function S(){return x(s)}function C(A){function H(re,R,ue,xe,ge){if(typeof A!="function")return new b("Property `"+ge+"` of component `"+ue+"` has invalid PropType notation inside arrayOf.");var pe=re[R];if(!Array.isArray(pe)){var ee=X(pe);return new b("Invalid "+xe+" `"+ge+"` of type "+("`"+ee+"` supplied to `"+ue+"`, expected an array."))}for(var Q=0;Q<pe.length;Q++){var ie=A(pe,Q,ue,xe,ge+"["+Q+"]",n);if(ie instanceof Error)return ie}return null}return x(H)}function P(){function A(H,re,R,ue,xe){var ge=H[re];if(!a(ge)){var pe=X(ge);return new b("Invalid "+ue+" `"+xe+"` of type "+("`"+pe+"` supplied to `"+R+"`, expected a single ReactElement."))}return null}return x(A)}function O(){function A(H,re,R,ue,xe){var ge=H[re];if(!e.isValidElementType(ge)){var pe=X(ge);return new b("Invalid "+ue+" `"+xe+"` of type "+("`"+pe+"` supplied to `"+R+"`, expected a single ReactElement type."))}return null}return x(A)}function k(A){function H(re,R,ue,xe,ge){if(!(re[R]instanceof A)){var pe=A.name||g,ee=le(re[R]);return new b("Invalid "+xe+" `"+ge+"` of type "+("`"+ee+"` supplied to `"+ue+"`, expected ")+("instance of `"+pe+"`."))}return null}return x(H)}function T(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("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])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function H(re,R,ue,xe,ge){for(var pe=re[R],ee=0;ee<A.length;ee++)if(v(pe,A[ee]))return null;var Q=JSON.stringify(A,function(we,te){var Ie=W(te);return Ie==="symbol"?String(te):te});return new b("Invalid "+xe+" `"+ge+"` of value `"+String(pe)+"` "+("supplied to `"+ue+"`, expected one of "+Q+"."))}return x(H)}function I(A){function H(re,R,ue,xe,ge){if(typeof A!="function")return new b("Property `"+ge+"` of component `"+ue+"` has invalid PropType notation inside objectOf.");var pe=re[R],ee=X(pe);if(ee!=="object")return new b("Invalid "+xe+" `"+ge+"` of type "+("`"+ee+"` supplied to `"+ue+"`, expected an object."));for(var Q in pe)if(r(pe,Q)){var ie=A(pe,Q,ue,xe,ge+"."+Q,n);if(ie instanceof Error)return ie}return null}return x(H)}function F(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var H=0;H<A.length;H++){var re=A[H];if(typeof re!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ne(re)+" at index "+H+"."),s}function R(ue,xe,ge,pe,ee){for(var Q=[],ie=0;ie<A.length;ie++){var we=A[ie],te=we(ue,xe,ge,pe,ee,n);if(te==null)return null;te.data&&r(te.data,"expectedType")&&Q.push(te.data.expectedType)}var Ie=Q.length>0?", expected one of type ["+Q.join(", ")+"]":"";return new b("Invalid "+pe+" `"+ee+"` supplied to "+("`"+ge+"`"+Ie+"."))}return x(R)}function j(){function A(H,re,R,ue,xe){return J(H[re])?null:new b("Invalid "+ue+" `"+xe+"` supplied to "+("`"+R+"`, expected a ReactNode."))}return x(A)}function B(A,H,re,R,ue){return new b((A||"React class")+": "+H+" type `"+re+"."+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ue+"`.")}function V(A){function H(re,R,ue,xe,ge){var pe=re[R],ee=X(pe);if(ee!=="object")return new b("Invalid "+xe+" `"+ge+"` of type `"+ee+"` "+("supplied to `"+ue+"`, expected `object`."));for(var Q in A){var ie=A[Q];if(typeof ie!="function")return B(ue,xe,ge,Q,W(ie));var we=ie(pe,Q,ue,xe,ge+"."+Q,n);if(we)return we}return null}return x(H)}function q(A){function H(re,R,ue,xe,ge){var pe=re[R],ee=X(pe);if(ee!=="object")return new b("Invalid "+xe+" `"+ge+"` of type `"+ee+"` "+("supplied to `"+ue+"`, expected `object`."));var Q=t({},re[R],A);for(var ie in Q){var we=A[ie];if(r(A,ie)&&typeof we!="function")return B(ue,xe,ge,ie,W(we));if(!we)return new b("Invalid "+xe+" `"+ge+"` key `"+ie+"` supplied to `"+ue+"`.\nBad object: "+JSON.stringify(re[R],null," ")+`
104
- Valid keys: `+JSON.stringify(Object.keys(A),null," "));var te=we(pe,ie,ue,xe,ge+"."+ie,n);if(te)return te}return null}return x(H)}function J(A){switch(typeof A){case"number":case"string":case"undefined":return!0;case"boolean":return!A;case"object":if(Array.isArray(A))return A.every(J);if(A===null||a(A))return!0;var H=f(A);if(H){var re=H.call(A),R;if(H!==A.entries){for(;!(R=re.next()).done;)if(!J(R.value))return!1}else for(;!(R=re.next()).done;){var ue=R.value;if(ue&&!J(ue[1]))return!1}}else return!1;return!0;default:return!1}}function $(A,H){return A==="symbol"?!0:H?H["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&H instanceof Symbol:!1}function X(A){var H=typeof A;return Array.isArray(A)?"array":A instanceof RegExp?"object":$(H,A)?"symbol":H}function W(A){if(typeof A>"u"||A===null)return""+A;var H=X(A);if(H==="object"){if(A instanceof Date)return"date";if(A instanceof RegExp)return"regexp"}return H}function ne(A){var H=W(A);switch(H){case"array":case"object":return"an "+H;case"boolean":case"date":case"regexp":return"a "+H;default:return H}}function le(A){return!A.constructor||!A.constructor.name?g:A.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},bv}if(process.env.NODE_ENV!=="production"){var k4=K_(),D4=!0;dv.exports=P4()(k4.isElement,D4)}else dv.exports=_4()();var Go=dv.exports,Af={exports:{}},tS={};function nS(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=nS(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function rS(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=nS(e))&&(r&&(r+=" "),r+=t);return r}const M4=dm(Object.freeze(Object.defineProperty({__proto__:null,clsx:rS,default:rS},Symbol.toStringTag,{value:"Module"})));var dn={},Ii={};Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.dontSetMe=R4,Ii.findInArray=T4,Ii.int=N4,Ii.isFunction=A4,Ii.isNum=I4;function T4(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function A4(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function I4(e){return typeof e=="number"&&!isNaN(e)}function N4(e){return parseInt(e,10)}function R4(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 Gs={};Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.browserPrefixToKey=oS,Gs.browserPrefixToStyle=L4,Gs.default=void 0,Gs.getPrefix=iS;const yv=["Moz","Webkit","O","ms"];function iS(){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<yv.length;r++)if(oS(t,yv[r])in n)return yv[r];return""}function oS(e,t){return t?"".concat(t).concat(F4(e)):e}function L4(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function F4(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}Gs.default=iS(),Object.defineProperty(dn,"__esModule",{value:!0}),dn.addClassName=cS,dn.addEvent=z4,dn.addUserSelectStyles=Q4,dn.createCSSTransform=G4,dn.createSVGTransform=Y4,dn.getTouch=K4,dn.getTouchIdentifier=X4,dn.getTranslation=xv,dn.innerHeight=W4,dn.innerWidth=U4,dn.matchesSelector=lS,dn.matchesSelectorAndParentsTo=j4,dn.offsetXYFromParent=q4,dn.outerHeight=V4,dn.outerWidth=H4,dn.removeClassName=uS,dn.removeEvent=B4,dn.removeUserSelectStyles=Z4;var Cr=Ii,sS=$4(Gs);function aS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(aS=function(r){return r?n:t})(e)}function $4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=aS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}let If="";function lS(e,t){return If||(If=(0,Cr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Cr.isFunction)(e[n])})),(0,Cr.isFunction)(e[If])?e[If](t):!1}function j4(e,t,n){let r=e;do{if(lS(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function z4(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function B4(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function V4(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Cr.int)(n.borderTopWidth),t+=(0,Cr.int)(n.borderBottomWidth),t}function H4(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Cr.int)(n.borderLeftWidth),t+=(0,Cr.int)(n.borderRightWidth),t}function W4(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Cr.int)(n.paddingTop),t-=(0,Cr.int)(n.paddingBottom),t}function U4(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Cr.int)(n.paddingLeft),t-=(0,Cr.int)(n.paddingRight),t}function q4(e,t,n){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-i.left)/n,s=(e.clientY+t.scrollTop-i.top)/n;return{x:o,y:s}}function G4(e,t){const n=xv(e,t,"px");return{[(0,sS.browserPrefixToKey)("transform",sS.default)]:n}}function Y4(e,t){return xv(e,t,"")}function xv(e,t,n){let{x:r,y:i}=e,o="translate(".concat(r).concat(n,",").concat(i).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);o="translate(".concat(s,", ").concat(a,")")+o}return o}function K4(e,t){return e.targetTouches&&(0,Cr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Cr.findInArray)(e.changedTouches,n=>t===n.identifier)}function X4(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Q4(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;}
103
+ */var gv,X_;function E4(){if(X_)return gv;X_=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(d){return s[d]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(d){c[d]=d}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return gv=i()?Object.assign:function(o,s){for(var a,l=r(o),c,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var g=0;g<c.length;g++)n.call(a,c[g])&&(l[c[g]]=a[c[g]])}}return l},gv}var mv,Q_;function Z_(){return Q_||(Q_=1,mv=Function.call.bind(Object.prototype.hasOwnProperty)),mv}var vv,J_;function O4(){if(J_)return vv;J_=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=hv(),n={},r=Z_();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var d in o)if(r(o,d)){var f;try{if(typeof o[d]!="function"){var g=Error((l||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw g.name="Invariant Violation",g}f=o[d](s,d,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof 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 p=c?c():"";e("Failed "+a+" type: "+f.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},vv=i,vv}var bv,eS;function P4(){if(eS)return bv;eS=1;var e=K_(),t=E4(),n=hv(),r=Z_(),i=O4(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return bv=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(A){var H=A&&(c&&A[c]||A[d]);if(typeof H=="function")return H}var g="<<anonymous>>",p={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:S(),arrayOf:C,element:P(),elementType:O(),instanceOf:k,node:j(),objectOf:I,oneOf:T,oneOfType:F,shape:V,exact:q};function v(A,H){return A===H?A!==0||1/A===1/H:A!==A&&H!==H}function b(A,H){this.message=A,this.data=H&&typeof H=="object"?H:{},this.stack=""}b.prototype=Error.prototype;function x(A){if(process.env.NODE_ENV!=="production")var H={},ne=0;function R(xe,ge,pe,ee,Q,ie,we){if(ee=ee||g,ie=ie||pe,we!==n){if(l){var re=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 re.name="Invariant Violation",re}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ie=ee+":"+pe;!H[Ie]&&ne<3&&(o("You are manually calling a React.PropTypes validation function for the `"+ie+"` prop on `"+ee+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),H[Ie]=!0,ne++)}}return ge[pe]==null?xe?ge[pe]===null?new b("The "+Q+" `"+ie+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new b("The "+Q+" `"+ie+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:A(ge,pe,ee,Q,ie)}var ue=R.bind(null,!1);return ue.isRequired=R.bind(null,!0),ue}function w(A){function H(ne,R,ue,xe,ge,pe){var ee=ne[R],Q=X(ee);if(Q!==A){var ie=W(ee);return new b("Invalid "+xe+" `"+ge+"` of type "+("`"+ie+"` supplied to `"+ue+"`, expected ")+("`"+A+"`."),{expectedType:A})}return null}return x(H)}function S(){return x(s)}function C(A){function H(ne,R,ue,xe,ge){if(typeof A!="function")return new b("Property `"+ge+"` of component `"+ue+"` has invalid PropType notation inside arrayOf.");var pe=ne[R];if(!Array.isArray(pe)){var ee=X(pe);return new b("Invalid "+xe+" `"+ge+"` of type "+("`"+ee+"` supplied to `"+ue+"`, expected an array."))}for(var Q=0;Q<pe.length;Q++){var ie=A(pe,Q,ue,xe,ge+"["+Q+"]",n);if(ie instanceof Error)return ie}return null}return x(H)}function P(){function A(H,ne,R,ue,xe){var ge=H[ne];if(!a(ge)){var pe=X(ge);return new b("Invalid "+ue+" `"+xe+"` of type "+("`"+pe+"` supplied to `"+R+"`, expected a single ReactElement."))}return null}return x(A)}function O(){function A(H,ne,R,ue,xe){var ge=H[ne];if(!e.isValidElementType(ge)){var pe=X(ge);return new b("Invalid "+ue+" `"+xe+"` of type "+("`"+pe+"` supplied to `"+R+"`, expected a single ReactElement type."))}return null}return x(A)}function k(A){function H(ne,R,ue,xe,ge){if(!(ne[R]instanceof A)){var pe=A.name||g,ee=le(ne[R]);return new b("Invalid "+xe+" `"+ge+"` of type "+("`"+ee+"` supplied to `"+ue+"`, expected ")+("instance of `"+pe+"`."))}return null}return x(H)}function T(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("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])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function H(ne,R,ue,xe,ge){for(var pe=ne[R],ee=0;ee<A.length;ee++)if(v(pe,A[ee]))return null;var Q=JSON.stringify(A,function(we,re){var Ie=W(re);return Ie==="symbol"?String(re):re});return new b("Invalid "+xe+" `"+ge+"` of value `"+String(pe)+"` "+("supplied to `"+ue+"`, expected one of "+Q+"."))}return x(H)}function I(A){function H(ne,R,ue,xe,ge){if(typeof A!="function")return new b("Property `"+ge+"` of component `"+ue+"` has invalid PropType notation inside objectOf.");var pe=ne[R],ee=X(pe);if(ee!=="object")return new b("Invalid "+xe+" `"+ge+"` of type "+("`"+ee+"` supplied to `"+ue+"`, expected an object."));for(var Q in pe)if(r(pe,Q)){var ie=A(pe,Q,ue,xe,ge+"."+Q,n);if(ie instanceof Error)return ie}return null}return x(H)}function F(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var H=0;H<A.length;H++){var ne=A[H];if(typeof ne!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+te(ne)+" at index "+H+"."),s}function R(ue,xe,ge,pe,ee){for(var Q=[],ie=0;ie<A.length;ie++){var we=A[ie],re=we(ue,xe,ge,pe,ee,n);if(re==null)return null;re.data&&r(re.data,"expectedType")&&Q.push(re.data.expectedType)}var Ie=Q.length>0?", expected one of type ["+Q.join(", ")+"]":"";return new b("Invalid "+pe+" `"+ee+"` supplied to "+("`"+ge+"`"+Ie+"."))}return x(R)}function j(){function A(H,ne,R,ue,xe){return J(H[ne])?null:new b("Invalid "+ue+" `"+xe+"` supplied to "+("`"+R+"`, expected a ReactNode."))}return x(A)}function B(A,H,ne,R,ue){return new b((A||"React class")+": "+H+" type `"+ne+"."+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ue+"`.")}function V(A){function H(ne,R,ue,xe,ge){var pe=ne[R],ee=X(pe);if(ee!=="object")return new b("Invalid "+xe+" `"+ge+"` of type `"+ee+"` "+("supplied to `"+ue+"`, expected `object`."));for(var Q in A){var ie=A[Q];if(typeof ie!="function")return B(ue,xe,ge,Q,W(ie));var we=ie(pe,Q,ue,xe,ge+"."+Q,n);if(we)return we}return null}return x(H)}function q(A){function H(ne,R,ue,xe,ge){var pe=ne[R],ee=X(pe);if(ee!=="object")return new b("Invalid "+xe+" `"+ge+"` of type `"+ee+"` "+("supplied to `"+ue+"`, expected `object`."));var Q=t({},ne[R],A);for(var ie in Q){var we=A[ie];if(r(A,ie)&&typeof we!="function")return B(ue,xe,ge,ie,W(we));if(!we)return new b("Invalid "+xe+" `"+ge+"` key `"+ie+"` supplied to `"+ue+"`.\nBad object: "+JSON.stringify(ne[R],null," ")+`
104
+ Valid keys: `+JSON.stringify(Object.keys(A),null," "));var re=we(pe,ie,ue,xe,ge+"."+ie,n);if(re)return re}return null}return x(H)}function J(A){switch(typeof A){case"number":case"string":case"undefined":return!0;case"boolean":return!A;case"object":if(Array.isArray(A))return A.every(J);if(A===null||a(A))return!0;var H=f(A);if(H){var ne=H.call(A),R;if(H!==A.entries){for(;!(R=ne.next()).done;)if(!J(R.value))return!1}else for(;!(R=ne.next()).done;){var ue=R.value;if(ue&&!J(ue[1]))return!1}}else return!1;return!0;default:return!1}}function $(A,H){return A==="symbol"?!0:H?H["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&H instanceof Symbol:!1}function X(A){var H=typeof A;return Array.isArray(A)?"array":A instanceof RegExp?"object":$(H,A)?"symbol":H}function W(A){if(typeof A>"u"||A===null)return""+A;var H=X(A);if(H==="object"){if(A instanceof Date)return"date";if(A instanceof RegExp)return"regexp"}return H}function te(A){var H=W(A);switch(H){case"array":case"object":return"an "+H;case"boolean":case"date":case"regexp":return"a "+H;default:return H}}function le(A){return!A.constructor||!A.constructor.name?g:A.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},bv}if(process.env.NODE_ENV!=="production"){var k4=K_(),D4=!0;dv.exports=P4()(k4.isElement,D4)}else dv.exports=_4()();var Go=dv.exports,Af={exports:{}},tS={};function nS(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=nS(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function rS(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=nS(e))&&(r&&(r+=" "),r+=t);return r}const M4=dm(Object.freeze(Object.defineProperty({__proto__:null,clsx:rS,default:rS},Symbol.toStringTag,{value:"Module"})));var dn={},Ii={};Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.dontSetMe=R4,Ii.findInArray=T4,Ii.int=N4,Ii.isFunction=A4,Ii.isNum=I4;function T4(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function A4(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function I4(e){return typeof e=="number"&&!isNaN(e)}function N4(e){return parseInt(e,10)}function R4(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 Gs={};Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.browserPrefixToKey=oS,Gs.browserPrefixToStyle=L4,Gs.default=void 0,Gs.getPrefix=iS;const yv=["Moz","Webkit","O","ms"];function iS(){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<yv.length;r++)if(oS(t,yv[r])in n)return yv[r];return""}function oS(e,t){return t?"".concat(t).concat(F4(e)):e}function L4(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function F4(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}Gs.default=iS(),Object.defineProperty(dn,"__esModule",{value:!0}),dn.addClassName=cS,dn.addEvent=z4,dn.addUserSelectStyles=Q4,dn.createCSSTransform=G4,dn.createSVGTransform=Y4,dn.getTouch=K4,dn.getTouchIdentifier=X4,dn.getTranslation=xv,dn.innerHeight=W4,dn.innerWidth=U4,dn.matchesSelector=lS,dn.matchesSelectorAndParentsTo=j4,dn.offsetXYFromParent=q4,dn.outerHeight=V4,dn.outerWidth=H4,dn.removeClassName=uS,dn.removeEvent=B4,dn.removeUserSelectStyles=Z4;var Cr=Ii,sS=$4(Gs);function aS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(aS=function(r){return r?n:t})(e)}function $4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=aS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}let If="";function lS(e,t){return If||(If=(0,Cr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Cr.isFunction)(e[n])})),(0,Cr.isFunction)(e[If])?e[If](t):!1}function j4(e,t,n){let r=e;do{if(lS(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function z4(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function B4(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function V4(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Cr.int)(n.borderTopWidth),t+=(0,Cr.int)(n.borderBottomWidth),t}function H4(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Cr.int)(n.borderLeftWidth),t+=(0,Cr.int)(n.borderRightWidth),t}function W4(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Cr.int)(n.paddingTop),t-=(0,Cr.int)(n.paddingBottom),t}function U4(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Cr.int)(n.paddingLeft),t-=(0,Cr.int)(n.paddingRight),t}function q4(e,t,n){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-i.left)/n,s=(e.clientY+t.scrollTop-i.top)/n;return{x:o,y:s}}function G4(e,t){const n=xv(e,t,"px");return{[(0,sS.browserPrefixToKey)("transform",sS.default)]:n}}function Y4(e,t){return xv(e,t,"")}function xv(e,t,n){let{x:r,y:i}=e,o="translate(".concat(r).concat(n,",").concat(i).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);o="translate(".concat(s,", ").concat(a,")")+o}return o}function K4(e,t){return e.targetTouches&&(0,Cr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Cr.findInArray)(e.changedTouches,n=>t===n.identifier)}function X4(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Q4(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;}
105
105
  `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
106
- `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&cS(e.body,"react-draggable-transparent-selection")}function Z4(e){if(e)try{if(e.body&&uS(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 cS(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function uS(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Ni={};Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.canDragX=t7,Ni.canDragY=n7,Ni.createCoreData=i7,Ni.createDraggableData=o7,Ni.getBoundPosition=J4,Ni.getControlPosition=r7,Ni.snapToGrid=e7;var Er=Ii,hl=dn;function J4(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:s7(r);const i=wv(e);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(i),d=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,Er.int)(d.paddingLeft)+(0,Er.int)(c.marginLeft),top:-i.offsetTop+(0,Er.int)(d.paddingTop)+(0,Er.int)(c.marginTop),right:(0,hl.innerWidth)(l)-(0,hl.outerWidth)(i)-i.offsetLeft+(0,Er.int)(d.paddingRight)-(0,Er.int)(c.marginRight),bottom:(0,hl.innerHeight)(l)-(0,hl.outerHeight)(i)-i.offsetTop+(0,Er.int)(d.paddingBottom)-(0,Er.int)(c.marginBottom)}}return(0,Er.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Er.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Er.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Er.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function e7(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function t7(e){return e.props.axis==="both"||e.props.axis==="x"}function n7(e){return e.props.axis==="both"||e.props.axis==="y"}function r7(e,t,n){const r=typeof t=="number"?(0,hl.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const i=wv(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,hl.offsetXYFromParent)(r||e,o,n.props.scale)}function i7(e,t,n){const r=!(0,Er.isNum)(e.lastX),i=wv(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function o7(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 s7(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function wv(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Nf={},Rf={};Object.defineProperty(Rf,"__esModule",{value:!0}),Rf.default=a7;function a7(){}Object.defineProperty(Nf,"__esModule",{value:!0}),Nf.default=void 0;var _v=c7(m),sr=Cv(Go),l7=Cv(kt),Hn=dn,Yo=Ni,Sv=Ii,Qc=Cv(Rf);function Cv(e){return e&&e.__esModule?e:{default:e}}function dS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(dS=function(r){return r?n:t})(e)}function c7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=dS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Zn(e,t,n){return t=u7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u7(e){var t=d7(e,"string");return typeof t=="symbol"?t:String(t)}function d7(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 bi={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Ko=bi.mouse,Lf=class extends _v.Component{constructor(){super(...arguments),Zn(this,"dragging",!1),Zn(this,"lastX",NaN),Zn(this,"lastY",NaN),Zn(this,"touchIdentifier",null),Zn(this,"mounted",!1),Zn(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,Hn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Hn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Hn.getTouchIdentifier)(t);this.touchIdentifier=i;const o=(0,Yo.getControlPosition)(t,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,Yo.createCoreData)(this,s,a);(0,Qc.default)("DraggableCore: handleDragStart: %j",l),(0,Qc.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Hn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Hn.addEvent)(r,Ko.move,this.handleDrag),(0,Hn.addEvent)(r,Ko.stop,this.handleDragStop))}),Zn(this,"handleDrag",t=>{const n=(0,Yo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=i-this.lastY;if([a,l]=(0,Yo.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,Yo.createCoreData)(this,r,i);if((0,Qc.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!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=i}),Zn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Yo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,Yo.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Yo.createCoreData)(this,r,i);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Hn.removeUserSelectStyles)(a.ownerDocument),(0,Qc.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Qc.default)("DraggableCore: Removing handlers"),(0,Hn.removeEvent)(a.ownerDocument,Ko.move,this.handleDrag),(0,Hn.removeEvent)(a.ownerDocument,Ko.stop,this.handleDragStop))}),Zn(this,"onMouseDown",t=>(Ko=bi.mouse,this.handleDragStart(t))),Zn(this,"onMouseUp",t=>(Ko=bi.mouse,this.handleDragStop(t))),Zn(this,"onTouchStart",t=>(Ko=bi.touch,this.handleDragStart(t))),Zn(this,"onTouchEnd",t=>(Ko=bi.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Hn.addEvent)(t,bi.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Hn.removeEvent)(n,bi.mouse.move,this.handleDrag),(0,Hn.removeEvent)(n,bi.touch.move,this.handleDrag),(0,Hn.removeEvent)(n,bi.mouse.stop,this.handleDragStop),(0,Hn.removeEvent)(n,bi.touch.stop,this.handleDragStop),(0,Hn.removeEvent)(t,bi.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Hn.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:l7.default.findDOMNode(this)}render(){return _v.cloneElement(_v.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Nf.default=Lf,Zn(Lf,"displayName","DraggableCore"),Zn(Lf,"propTypes",{allowAnyClick:sr.default.bool,children:sr.default.node.isRequired,disabled:sr.default.bool,enableUserSelectHack:sr.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:sr.default.arrayOf(sr.default.number),handle:sr.default.string,cancel:sr.default.string,nodeRef:sr.default.object,onStart:sr.default.func,onDrag:sr.default.func,onStop:sr.default.func,onMouseDown:sr.default.func,scale:sr.default.number,className:Sv.dontSetMe,style:Sv.dontSetMe,transform:Sv.dontSetMe}),Zn(Lf,"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=g(m),n=d(Go),r=d(kt),i=d(M4),o=dn,s=Ni,a=Ii,l=d(Nf),c=d(Rf);function d(S){return S&&S.__esModule?S:{default:S}}function f(S){if(typeof WeakMap!="function")return null;var C=new WeakMap,P=new WeakMap;return(f=function(O){return O?P:C})(S)}function g(S,C){if(!C&&S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var P=f(C);if(P&&P.has(S))return P.get(S);var O={},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in S)if(T!=="default"&&Object.prototype.hasOwnProperty.call(S,T)){var I=k?Object.getOwnPropertyDescriptor(S,T):null;I&&(I.get||I.set)?Object.defineProperty(O,T,I):O[T]=S[T]}return O.default=S,P&&P.set(S,O),O}function p(){return p=Object.assign?Object.assign.bind():function(S){for(var C=1;C<arguments.length;C++){var P=arguments[C];for(var O in P)Object.prototype.hasOwnProperty.call(P,O)&&(S[O]=P[O])}return S},p.apply(this,arguments)}function v(S,C,P){return C=b(C),C in S?Object.defineProperty(S,C,{value:P,enumerable:!0,configurable:!0,writable:!0}):S[C]=P,S}function b(S){var C=x(S,"string");return typeof C=="symbol"?C:String(C)}function x(S,C){if(typeof S!="object"||S===null)return S;var P=S[Symbol.toPrimitive];if(P!==void 0){var O=P.call(S,C||"default");if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(S)}class w extends t.Component{static getDerivedStateFromProps(C,P){let{position:O}=C,{prevPropsPosition:k}=P;return O&&(!k||O.x!==k.x||O.y!==k.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:O,prevPropsPosition:k}),{x:O.x,y:O.y,prevPropsPosition:{...O}}):null}constructor(C){super(C),v(this,"onDragStart",(P,O)=>{if((0,c.default)("Draggable: onDragStart: %j",O),this.props.onStart(P,(0,s.createDraggableData)(this,O))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(P,O)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",O);const k=(0,s.createDraggableData)(this,O),T={x:k.x,y:k.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:j}=T;T.x+=this.state.slackX,T.y+=this.state.slackY;const[B,V]=(0,s.getBoundPosition)(this,T.x,T.y);T.x=B,T.y=V,T.slackX=this.state.slackX+(F-T.x),T.slackY=this.state.slackY+(j-T.y),k.x=T.x,k.y=T.y,k.deltaX=T.x-this.state.x,k.deltaY=T.y-this.state.y}if(this.props.onDrag(P,k)===!1)return!1;this.setState(T)}),v(this,"onDragStop",(P,O)=>{if(!this.state.dragging||this.props.onStop(P,(0,s.createDraggableData)(this,O))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",O);const T={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:j}=this.props.position;T.x=F,T.y=j}this.setState(T)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var C,P;return(C=(P=this.props)===null||P===void 0||(P=P.nodeRef)===null||P===void 0?void 0:P.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:P,children:O,defaultPosition:k,defaultClassName:T,defaultClassNameDragging:I,defaultClassNameDragged:F,position:j,positionOffset:B,scale:V,...q}=this.props;let J={},$=null;const W=!!!j||this.state.dragging,ne=j||k,le={x:(0,s.canDragX)(this)&&W?this.state.x:ne.x,y:(0,s.canDragY)(this)&&W?this.state.y:ne.y};this.state.isElementSVG?$=(0,o.createSVGTransform)(le,B):J=(0,o.createCSSTransform)(le,B);const A=(0,i.default)(O.props.className||"",T,{[I]:this.state.dragging,[F]:this.state.dragged});return t.createElement(l.default,p({},q,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(O),{className:A,style:{...O.props.style,...J},transform:$}))}}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})}(tS);const{default:fS,DraggableCore:f7}=tS;Af.exports=fS,Af.exports.default=fS,Af.exports.DraggableCore=f7;var hS=Af.exports,Ff={exports:{}},Zc={},Ev={};Ev.__esModule=!0,Ev.cloneElement=b7;var h7=p7(m);function p7(e){return e&&e.__esModule?e:{default:e}}function pS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pS(Object(n),!0).forEach(function(r){g7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g7(e,t,n){return t=m7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m7(e){var t=v7(e,"string");return typeof t=="symbol"?t:String(t)}function v7(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 b7(e,t){return t.style&&e.props.style&&(t.style=gS(gS({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),h7.default.cloneElement(e,t)}var Jc={};Jc.__esModule=!0,Jc.resizableProps=void 0;var lt=y7(Go);function y7(e){return e&&e.__esModule?e:{default:e}}var x7={axis:lt.default.oneOf(["both","x","y","none"]),className:lt.default.string,children:lt.default.element.isRequired,draggableOpts:lt.default.shape({allowAnyClick:lt.default.bool,cancel:lt.default.string,children:lt.default.node,disabled:lt.default.bool,enableUserSelectHack:lt.default.bool,offsetParent:lt.default.node,grid:lt.default.arrayOf(lt.default.number),handle:lt.default.string,nodeRef:lt.default.object,onStart:lt.default.func,onDrag:lt.default.func,onStop:lt.default.func,onMouseDown:lt.default.func,scale:lt.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="y"){var o;return(o=lt.default.number).isRequired.apply(o,n)}return lt.default.number.apply(lt.default,n)},handle:lt.default.oneOfType([lt.default.node,lt.default.func]),handleSize:lt.default.arrayOf(lt.default.number),lockAspectRatio:lt.default.bool,maxConstraints:lt.default.arrayOf(lt.default.number),minConstraints:lt.default.arrayOf(lt.default.number),onResizeStop:lt.default.func,onResizeStart:lt.default.func,onResize:lt.default.func,resizeHandles:lt.default.arrayOf(lt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:lt.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="x"){var o;return(o=lt.default.number).isRequired.apply(o,n)}return lt.default.number.apply(lt.default,n)}};Jc.resizableProps=x7,Zc.__esModule=!0,Zc.default=void 0;var eu=E7(m),w7=hS,_7=Ev,S7=Jc,C7=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function mS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(mS=function(i){return i?n:t})(e)}function E7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=mS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Ov(){return Ov=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},Ov.apply(this,arguments)}function O7(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function vS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vS(Object(n),!0).forEach(function(r){P7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P7(e,t,n){return t=k7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k7(e){var t=D7(e,"string");return typeof t=="symbol"?t:String(t)}function D7(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 M7(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,kv(e,t)}function kv(e,t){return kv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},kv(e,t)}var Dv=function(e){M7(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||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(i,o){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[i,o];if(c){var d=this.props.width/this.props.height,f=i-this.props.width,g=o-this.props.height;Math.abs(f)>Math.abs(g*d)?o=i/d:i=o*d}var p=i,v=o,b=this.slack||[0,0],x=b[0],w=b[1];return i+=x,o+=w,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[x+(p-i),w+(v-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,d=l.deltaX,f=l.deltaY;i==="onResizeStart"&&s.resetData();var g=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!g&&!p)){var v=o[0],b=o[o.length-1],x=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var w=x.left-s.lastHandleRect.left;d+=w}if(v==="n"){var S=x.top-s.lastHandleRect.top;f+=S}}s.lastHandleRect=x,b==="w"&&(d=-d),v==="n"&&(f=-f);var C=s.props.width+(g?d/s.props.transformScale:0),P=s.props.height+(p?f/s.props.transformScale:0),O=s.runConstraints(C,P);C=O[0],P=O[1];var k=C!==s.props.width||P!==s.props.height,T=typeof s.props[i]=="function"?s.props[i]:null,I=i==="onResize"&&!k;T&&!I&&(a.persist==null||a.persist(),T(a,{node:c,size:{width:C,height:P},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return eu.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=Pv({ref:o},a?{}:{handleAxis:i});return eu.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var d=O7(o,C7);return(0,_7.cloneElement)(s,Pv(Pv({},d),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var g,p=(g=i.handleRefs[f])!=null?g:i.handleRefs[f]=eu.createRef();return eu.createElement(w7.DraggableCore,Ov({},l,{nodeRef:p,key:"resizableHandle-"+f,onStop:i.resizeHandler("onResizeStop",f),onStart:i.resizeHandler("onResizeStart",f),onDrag:i.resizeHandler("onResize",f)}),i.renderResizeHandle(f,p))}))}))},t}(eu.Component);Zc.default=Dv,Dv.propTypes=S7.resizableProps,Dv.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var $f={};$f.__esModule=!0,$f.default=void 0;var Mv=R7(m),T7=bS(Go),A7=bS(Zc),I7=Jc,N7=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function bS(e){return e&&e.__esModule?e:{default:e}}function yS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(yS=function(i){return i?n:t})(e)}function R7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=yS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Tv(){return Tv=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},Tv.apply(this,arguments)}function xS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xS(Object(n),!0).forEach(function(r){L7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function L7(e,t,n){return t=F7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F7(e){var t=$7(e,"string");return typeof t=="symbol"?t:String(t)}function $7(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 j7(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function z7(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Av(e,t)}function Av(e,t){return Av=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Av(e,t)}var wS=function(e){z7(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||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(i,o){return o.propsWidth!==i.width||o.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null};var n=t.prototype;return n.render=function(){var i=this.props,o=i.handle,s=i.handleSize;i.onResize;var a=i.onResizeStart,l=i.onResizeStop,c=i.draggableOpts,d=i.minConstraints,f=i.maxConstraints,g=i.lockAspectRatio,p=i.axis;i.width,i.height;var v=i.resizeHandles,b=i.style,x=i.transformScale,w=j7(i,N7);return Mv.createElement(A7.default,{axis:p,draggableOpts:c,handle:o,handleSize:s,height:this.state.height,lockAspectRatio:g,maxConstraints:f,minConstraints:d,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},Mv.createElement("div",Tv({},w,{style:jf(jf({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Mv.Component);$f.default=wS,wS.propTypes=jf(jf({},I7.resizableProps),{},{children:T7.default.element}),Ff.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ff.exports.Resizable=Zc.default,Ff.exports.ResizableBox=$f.default;var B7=Ff.exports,so={};Object.defineProperty(so,"__esModule",{value:!0}),so.resizeHandleType=so.resizeHandleAxesType=so.default=void 0;var pt=_S(Go),V7=_S(m);function _S(e){return e&&e.__esModule?e:{default:e}}const SS=pt.default.arrayOf(pt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));so.resizeHandleAxesType=SS;const CS=pt.default.oneOfType([pt.default.node,pt.default.func]);so.resizeHandleType=CS;var H7={className:pt.default.string,style:pt.default.object,width:pt.default.number,autoSize:pt.default.bool,cols:pt.default.number,draggableCancel:pt.default.string,draggableHandle:pt.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:pt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&bt.validateLayout(t,"layout")},margin:pt.default.arrayOf(pt.default.number),containerPadding:pt.default.arrayOf(pt.default.number),rowHeight:pt.default.number,maxRows:pt.default.number,isBounded:pt.default.bool,isDraggable:pt.default.bool,isResizable:pt.default.bool,allowOverlap:pt.default.bool,preventCollision:pt.default.bool,useCSSTransforms:pt.default.bool,transformScale:pt.default.number,isDroppable:pt.default.bool,resizeHandles:SS,resizeHandle:CS,onLayoutChange:pt.default.func,onDragStart:pt.default.func,onDrag:pt.default.func,onDragStop:pt.default.func,onResizeStart:pt.default.func,onResize:pt.default.func,onResizeStop:pt.default.func,onDrop:pt.default.func,droppingItem:pt.default.shape({i:pt.default.string.isRequired,w:pt.default.number.isRequired,h:pt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};V7.default.Children.forEach(n,function(i){if((i==null?void 0:i.key)!=null){if(r[i.key])throw new Error('Duplicate child key "'+i.key+'" found! This will cause problems in ReactGridLayout.');r[i.key]=!0}})},innerRef:pt.default.any};so.default=H7,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.default=void 0;var pl=Iv(m),Dt=Iv(Go),W7=hS,U7=B7,gl=bt,Rn=Ai,ES=so,q7=Iv(Zm);function Iv(e){return e&&e.__esModule?e:{default:e}}function Ri(e,t,n){return t=G7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G7(e){var t=Y7(e,"string");return typeof t=="symbol"?t:String(t)}function Y7(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 Nv extends pl.default.Component{constructor(){super(...arguments),Ri(this,"state",{resizing:null,dragging:null,className:""}),Ri(this,"elementRef",pl.default.createRef()),Ri(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:i,transformScale:o}=this.props;if(!i)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.left/o,f=l.left/o,g=c.top/o,p=l.top/o;s.left=d-f+a.scrollLeft,s.top=g-p+a.scrollTop,this.setState({dragging:s});const{x:v,y:b}=(0,Rn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return i.call(this,this.props.i,v,b,{e:t,node:r,newPosition:s})}),Ri(this,"onDrag",(t,n)=>{let{node:r,deltaX:i,deltaY:o}=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+o,l=this.state.dragging.left+i;const{isBounded:c,i:d,w:f,h:g,containerWidth:p}=this.props,v=this.getPositionParams();if(c){const{offsetParent:S}=r;if(S){const{margin:C,rowHeight:P}=this.props,O=S.clientHeight-(0,Rn.calcGridItemWHPx)(g,P,C[1]);a=(0,Rn.clamp)(a,0,O);const k=(0,Rn.calcGridColWidth)(v),T=p-(0,Rn.calcGridItemWHPx)(f,k,C[0]);l=(0,Rn.clamp)(l,0,T)}}const b={top:a,left:l};this.setState({dragging:b});const{x,y:w}=(0,Rn.calcXY)(v,a,l,f,g);return s.call(this,d,x,w,{e:t,node:r,newPosition:b})}),Ri(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,d={top:c,left:l};this.setState({dragging:null});const{x:f,y:g}=(0,Rn.calcXY)(this.getPositionParams(),c,l,o,s);return i.call(this,a,f,g,{e:t,node:r,newPosition:d})}),Ri(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Ri(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Ri(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,Rn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,Rn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,gl.fastPositionEqual)(r,i)||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 i=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,s=o&&n.left!==i.left||n.top!==i.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-o.left,l=n.top-o.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:i}=this.props;let o;return i?o=(0,gl.setTransform)(t):(o=(0,gl.setTopLeft)(t),n&&(o.left=(0,gl.perc)(t.left/r),o.width=(0,gl.perc)(t.width/r))),o}mixinDraggable(t,n){return pl.default.createElement(W7.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,i)=>n(r,i,t)}mixinResizable(t,n,r){const{cols:i,minW:o,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:d,resizeHandle:f}=this.props,g=this.getPositionParams(),p=(0,Rn.calcGridItemPosition)(g,0,0,i,0).width,v=(0,Rn.calcGridItemPosition)(g,0,0,o,s),b=(0,Rn.calcGridItemPosition)(g,0,0,a,l),x=[v.width,v.height],w=[Math.min(b.width,p),Math.min(b.height,1/0)];return pl.default.createElement(U7.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:d,handle:f},t)}onResizeHandler(t,n,r,i){let{node:o,size:s,handle:a}=n;const l=this.props[i];if(!l)return;const{x:c,y:d,i:f,maxH:g,minH:p,containerWidth:v}=this.props,{minW:b,maxW:x}=this.props;let w=s;o&&(w=(0,gl.resizeItemInDirection)(a,r,s,v),this.setState({resizing:i==="onResizeStop"?null:w}));let{w:S,h:C}=(0,Rn.calcWH)(this.getPositionParams(),w.width,w.height,c,d,a);S=(0,Rn.clamp)(S,Math.max(b,1),x),C=(0,Rn.clamp)(C,p,g),l.call(this,f,S,C,{e:t,node:o,size:w,handle:a})}render(){const{x:t,y:n,w:r,h:i,isDraggable:o,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Rn.calcGridItemPosition)(this.getPositionParams(),t,n,r,i,this.state),d=pl.default.Children.only(this.props.children);let f=pl.default.cloneElement(d,{ref:this.elementRef,className:(0,q7.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,o),f}}Mf.default=Nv,Ri(Nv,"propTypes",{children:Dt.default.element,cols:Dt.default.number.isRequired,containerWidth:Dt.default.number.isRequired,rowHeight:Dt.default.number.isRequired,margin:Dt.default.array.isRequired,maxRows:Dt.default.number.isRequired,containerPadding:Dt.default.array.isRequired,x:Dt.default.number.isRequired,y:Dt.default.number.isRequired,w:Dt.default.number.isRequired,h:Dt.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:Dt.default.string.isRequired,resizeHandles:ES.resizeHandleAxesType,resizeHandle:ES.resizeHandleType,onDragStop:Dt.default.func,onDragStart:Dt.default.func,onDrag:Dt.default.func,onResizeStop:Dt.default.func,onResizeStart:Dt.default.func,onResize:Dt.default.func,isDraggable:Dt.default.bool.isRequired,isResizable:Dt.default.bool.isRequired,isBounded:Dt.default.bool.isRequired,static:Dt.default.bool,useCSSTransforms:Dt.default.bool.isRequired,transformScale:Dt.default.number,className:Dt.default.string,handle:Dt.default.string,cancel:Dt.default.string,droppingPosition:Dt.default.shape({e:Dt.default.object.isRequired,left:Dt.default.number.isRequired,top:Dt.default.number.isRequired})}),Ri(Nv,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.default=void 0;var Ys=Z7(m),Rv=Qm,K7=Lv(Zm),Ze=bt,X7=Ai,OS=Lv(Mf),Q7=Lv(so);function Lv(e){return e&&e.__esModule?e:{default:e}}function PS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(PS=function(r){return r?n:t})(e)}function Z7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=PS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Wn(e,t,n){return t=J7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J7(e){var t=eL(e,"string");return typeof t=="symbol"?t:String(t)}function eL(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 kS="react-grid-layout";let DS=!1;try{DS=/firefox/i.test(navigator.userAgent)}catch{}class zf extends Ys.Component{constructor(){super(...arguments),Wn(this,"state",{activeDrag:null,layout:(0,Ze.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Ze.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Wn(this,"dragEnterCounter",0),Wn(this,"onDragStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Ze.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,Ze.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,o,s)}),Wn(this,"onDrag",(t,n,r,i)=>{let{e:o,node:s}=i;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:d,preventCollision:f}=this.props,g=(0,Ze.getLayoutItem)(l,t);if(!g)return;const p={w:g.w,h:g.h,x:g.x,y:g.y,placeholder:!0,i:t},v=!0;l=(0,Ze.moveElement)(l,g,n,r,v,f,(0,Ze.compactType)(this.props),c,d),this.props.onDrag(l,a,g,p,o,s),this.setState({layout:d?l:(0,Ze.compact)(l,(0,Ze.compactType)(this.props),c),activeDrag:p})}),Wn(this,"onDragStop",(t,n,r,i)=>{let{e:o,node:s}=i;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:d,allowOverlap:f}=this.props,g=(0,Ze.getLayoutItem)(l,t);if(!g)return;const p=!0;l=(0,Ze.moveElement)(l,g,n,r,p,d,(0,Ze.compactType)(this.props),c,f);const v=f?l:(0,Ze.compact)(l,(0,Ze.compactType)(this.props),c);this.props.onDragStop(v,a,g,null,o,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),Wn(this,"onResizeStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Ze.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,Ze.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,o,s))}),Wn(this,"onResize",(t,n,r,i)=>{let{e:o,node:s,size:a,handle:l}=i;const{oldResizeItem:c}=this.state;let{layout:d}=this.state;const{cols:f,preventCollision:g,allowOverlap:p}=this.props;let v=!1,b,x,w;const[S,C]=(0,Ze.withLayoutItem)(d,t,O=>{let k;return x=O.x,w=O.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=O.x+(O.w-n),n=O.x!==x&&x<0?O.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=O.y+(O.h-r),r=O.y!==w&&w<0?O.h:r,w=w<0?0:w),v=!0),g&&!p&&(k=(0,Ze.getAllCollisions)(d,{...O,w:n,h:r,x,y:w}).filter(I=>I.i!==O.i).length>0,k&&(w=O.y,r=O.h,x=O.x,n=O.w,v=!1)),O.w=n,O.h=r,O});if(!C)return;b=S,v&&(b=(0,Ze.moveElement)(S,C,x,w,!0,this.props.preventCollision,(0,Ze.compactType)(this.props),f,p));const P={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(b,c,C,P,o,s),this.setState({layout:p?b:(0,Ze.compact)(b,(0,Ze.compactType)(this.props),f),activeDrag:P})}),Wn(this,"onResizeStop",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:d}=this.props,f=(0,Ze.getLayoutItem)(a,t),g=d?a:(0,Ze.compact)(a,(0,Ze.compactType)(this.props),c);this.props.onResizeStop(g,l,f,null,o,s);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:g,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(g,p)}),Wn(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),DS&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(kS)))return!1;const{droppingItem:r,onDropDragOver:i,margin:o,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:d,transformScale:f}=this.props,g=i==null?void 0:i(t);if(g===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...g},{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:S,top:C}=this.state.droppingPosition;(S!=b||C!=x)&&this.setState({droppingPosition:w})}}else{const S={cols:s,margin:o,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:d||o},C=(0,X7.calcXY)(S,x,b,p.w,p.h);this.setState({droppingDOMNode:Ys.createElement("div",{key:p.i}),droppingPosition:w,layout:[...v,{...p,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),Wn(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,i=(0,Ze.compact)(r.filter(o=>o.i!==t.i),(0,Ze.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:i,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Wn(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Wn(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Wn(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,i=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,i,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,Rv.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Ze.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Ze.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Ze.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Ze.fastRGLPropsEqual)(this.props,t,Rv.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,i=n.layout;this.onLayoutMaybeChanged(r,i)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Ze.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,Rv.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:i,containerPadding:o,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Ys.createElement(OS.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:i,containerPadding:o||i,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Ys.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Ze.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:i,cols:o,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:d,isResizable:f,isBounded:g,useCSSTransforms:p,transformScale:v,draggableCancel:b,draggableHandle:x,resizeHandles:w,resizeHandle:S}=this.props,{mounted:C,droppingPosition:P}=this.state,O=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,k=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,T=r.resizeHandles||w,I=O&&g&&r.isBounded!==!1;return Ys.createElement(OS.default,{containerWidth:i,cols:o,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:O,isResizable:k,isBounded:I,useCSSTransforms:p&&C,usePercentages:!C,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?P:void 0,resizeHandles:T,resizeHandle:S},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:i}=this.props,o=(0,K7.default)(kS,t),s={height:this.containerHeight(),...n};return Ys.createElement("div",{ref:i,className:o,style:s,onDrop:r?this.onDrop:Ze.noop,onDragLeave:r?this.onDragLeave:Ze.noop,onDragEnter:r?this.onDragEnter:Ze.noop,onDragOver:r?this.onDragOver:Ze.noop},Ys.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Yc.default=zf,Wn(zf,"displayName","ReactGridLayout"),Wn(zf,"propTypes",Q7.default),Wn(zf,"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:Ze.noop,onDragStart:Ze.noop,onDrag:Ze.noop,onDragStop:Ze.noop,onResizeStart:Ze.noop,onResize:Ze.noop,onResizeStop:Ze.noop,onDrop:Ze.noop,onDropDragOver:Ze.noop});var Bf={},Ks={};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.findOrGenerateResponsiveLayout=rL,Ks.getBreakpointFromWidth=tL,Ks.getColsFromBreakpoint=nL,Ks.sortBreakpoints=Fv;var Vf=bt;function tL(e,t){const n=Fv(e);let r=n[0];for(let i=1,o=n.length;i<o;i++){const s=n[i];t>e[s]&&(r=s)}return r}function nL(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function rL(e,t,n,r,i,o){if(e[n])return(0,Vf.cloneLayout)(e[n]);let s=e[r];const a=Fv(t),l=a.slice(a.indexOf(n));for(let c=0,d=l.length;c<d;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,Vf.cloneLayout)(s||[]),(0,Vf.compact)((0,Vf.correctBounds)(s,{cols:i}),o,i)}function Fv(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.default=void 0;var MS=oL(m),ar=TS(Go),$v=Qm,ml=bt,Xs=Ks,iL=TS(Yc);function TS(e){return e&&e.__esModule?e:{default:e}}function AS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(AS=function(r){return r?n:t})(e)}function oL(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=AS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function jv(){return jv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jv.apply(this,arguments)}function Hf(e,t,n){return t=sL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sL(e){var t=aL(e,"string");return typeof t=="symbol"?t:String(t)}function aL(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 IS=e=>Object.prototype.toString.call(e);function Wf(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class zv extends MS.Component{constructor(){super(...arguments),Hf(this,"state",this.generateInitialState()),Hf(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:i}=this.props,o=(0,Xs.getBreakpointFromWidth)(n,t),s=(0,Xs.getColsFromBreakpoint)(o,i),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Xs.findOrGenerateResponsiveLayout)(r,n,o,o,s,a),breakpoint:o,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,$v.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:i}=n;return{layout:(0,Xs.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,i,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,$v.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,$v.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:i,compactType:o}=this.props,s=this.props.breakpoint||(0,Xs.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Xs.getColsFromBreakpoint)(s,r),c={...i};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,ml.cloneLayout)(this.state.layout));let g=(0,Xs.findOrGenerateResponsiveLayout)(c,n,s,a,l,o);g=(0,ml.synchronizeLayoutWithChildren)(g,this.props.children,l,o,this.props.allowOverlap),c[s]=g,this.props.onLayoutChange(g,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:g,cols:l})}const d=Wf(this.props.margin,s),f=Wf(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,d,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:i,margin:o,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...d}=this.props;return MS.createElement(iL.default,jv({},d,{margin:Wf(o,this.state.breakpoint),containerPadding:Wf(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Bf.default=zv,Hf(zv,"propTypes",{breakpoint:ar.default.string,breakpoints:ar.default.object,allowOverlap:ar.default.bool,cols:ar.default.object,margin:ar.default.oneOfType([ar.default.array,ar.default.object]),containerPadding:ar.default.oneOfType([ar.default.array,ar.default.object]),layouts(e,t){if(IS(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+IS(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,ml.validateLayout)(e.layouts[n],"layouts."+n)})},width:ar.default.number.isRequired,onBreakpointChange:ar.default.func,onLayoutChange:ar.default.func,onWidthChange:ar.default.func}),Hf(zv,"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:ml.noop,onLayoutChange:ml.noop,onWidthChange:ml.noop});var Bv={},NS=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(i,o){return i[0]===n?(r=o,!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),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,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 i=0,o=this.__entries__;i<o.length;i++){var s=o[i];n.call(r,s[1],s[0])}},t}()}(),Vv=typeof window<"u"&&typeof document<"u"&&window.document===document,Uf=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")()}(),lL=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Uf):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),cL=2;function uL(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){lL(o)}function a(){var l=Date.now();if(n){if(l-i<cL)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=l}return a}var dL=20,fL=["top","right","bottom","left","width","height","size","weight"],hL=typeof MutationObserver<"u",pL=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=uL(this.refresh.bind(this),dL)}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(){!Vv||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),hL?(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(){!Vv||!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,i=fL.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),RS=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},vl=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Uf},LS=Gf(0,0,0,0);function qf(e){return parseFloat(e)||0}function FS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var o=e["border-"+i+"-width"];return r+qf(o)},0)}function gL(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var o=i[r],s=e["padding-"+o];n[o]=qf(s)}return n}function mL(e){var t=e.getBBox();return Gf(0,0,t.width,t.height)}function vL(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return LS;var r=vl(e).getComputedStyle(e),i=gL(r),o=i.left+i.right,s=i.top+i.bottom,a=qf(r.width),l=qf(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=FS(r,"left","right")+o),Math.round(l+s)!==n&&(l-=FS(r,"top","bottom")+s)),!yL(e)){var c=Math.round(a+o)-t,d=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(d)!==1&&(l-=d)}return Gf(i.left,i.top,a,l)}var bL=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof vl(e).SVGGraphicsElement}:function(e){return e instanceof vl(e).SVGElement&&typeof e.getBBox=="function"}}();function yL(e){return e===vl(e).document.documentElement}function xL(e){return Vv?bL(e)?mL(e):vL(e):LS}function wL(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return RS(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function Gf(e,t,n,r){return{x:e,y:t,width:n,height:r}}var _L=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Gf(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=xL(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}(),SL=function(){function e(t,n){var r=wL(n);RS(this,{target:t,contentRect:r})}return e}(),CL=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new NS,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 vl(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new _L(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 vl(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 SL(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),$S=typeof WeakMap<"u"?new WeakMap:new NS,jS=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=pL.getInstance(),r=new CL(t,n,this);$S.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){jS.prototype[e]=function(){var t;return(t=$S.get(this))[e].apply(t,arguments)}});var EL=function(){return typeof Uf.ResizeObserver<"u"?Uf.ResizeObserver:jS}();const OL=dm(Object.freeze(Object.defineProperty({__proto__:null,default:EL},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(Bv,"__esModule",{value:!0}),Bv.default=NL;var Yf=ML(m),PL=Hv(Go),kL=Hv(OL),DL=Hv(Zm);function Hv(e){return e&&e.__esModule?e:{default:e}}function zS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(zS=function(r){return r?n:t})(e)}function ML(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=zS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Wv(){return Wv=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},Wv.apply(this,arguments)}function bl(e,t,n){return t=TL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TL(e){var t=AL(e,"string");return typeof t=="symbol"?t:String(t)}function AL(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 IL="react-grid-layout";function NL(e){var t;return t=class extends Yf.Component{constructor(){super(...arguments),bl(this,"state",{width:1280}),bl(this,"elementRef",Yf.createRef()),bl(this,"mounted",!1),bl(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new kL.default(i=>{if(this.elementRef.current instanceof HTMLElement){const s=i[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,...i}=this.props;return r&&!this.mounted?Yf.createElement("div",{className:(0,DL.default)(this.props.className,IL),style:this.props.style,ref:this.elementRef}):Yf.createElement(e,Wv({innerRef:this.elementRef},i,this.state))}},bl(t,"defaultProps",{measureBeforeMount:!1}),bl(t,"propTypes",{measureBeforeMount:PL.default.bool}),t}(function(e){e.exports=Yc.default,e.exports.utils=bt,e.exports.calculateUtils=Ai,e.exports.Responsive=Bf.default,e.exports.Responsive.utils=Ks,e.exports.WidthProvider=Bv.default})(M_);var BS=M_.exports;function ao({children:e,className:t,text:n,onSave:r}){const[i,o]=m.useState(!1),[s,a]=m.useState(n),l=fe(d=>d.isDashboardEditing),c=d=>{d.stopPropagation(),l&&o(!0)};return _.jsx("div",{role:"editable",onDoubleClick:c,children:i?_.jsx("input",{type:"text",className:De("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:d=>a(d.target.value),value:s,autoFocus:!0,onBlur:()=>o(!1),onKeyDown:d=>{(d.key==="Enter"||d.key==="Tab")&&(o(!1),r(s))}}):e})}const Kf=de.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Kf.displayName="Card";const tu=de.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De("flex flex-col space-y-1.5 p-6",e),...t}));tu.displayName="CardHeader";const nu=de.forwardRef(({className:e,...t},n)=>_.jsx("h3",{ref:n,className:De("text-2xl font-semibold leading-none tracking-tight",e),...t}));nu.displayName="CardTitle";const Xf=de.forwardRef(({className:e,...t},n)=>_.jsx("p",{ref:n,className:De("text-sm text-muted-foreground",e),...t}));Xf.displayName="CardDescription";const ru=de.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De("px-6 pb-6 pt-0",e),...t}));ru.displayName="CardContent";const Uv=de.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De("flex items-center p-6 pt-0",e),...t}));Uv.displayName="CardFooter";/*!
106
+ `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&cS(e.body,"react-draggable-transparent-selection")}function Z4(e){if(e)try{if(e.body&&uS(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 cS(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function uS(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Ni={};Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.canDragX=t7,Ni.canDragY=n7,Ni.createCoreData=i7,Ni.createDraggableData=o7,Ni.getBoundPosition=J4,Ni.getControlPosition=r7,Ni.snapToGrid=e7;var Er=Ii,hl=dn;function J4(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:s7(r);const i=wv(e);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(i),d=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,Er.int)(d.paddingLeft)+(0,Er.int)(c.marginLeft),top:-i.offsetTop+(0,Er.int)(d.paddingTop)+(0,Er.int)(c.marginTop),right:(0,hl.innerWidth)(l)-(0,hl.outerWidth)(i)-i.offsetLeft+(0,Er.int)(d.paddingRight)-(0,Er.int)(c.marginRight),bottom:(0,hl.innerHeight)(l)-(0,hl.outerHeight)(i)-i.offsetTop+(0,Er.int)(d.paddingBottom)-(0,Er.int)(c.marginBottom)}}return(0,Er.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Er.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Er.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Er.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function e7(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function t7(e){return e.props.axis==="both"||e.props.axis==="x"}function n7(e){return e.props.axis==="both"||e.props.axis==="y"}function r7(e,t,n){const r=typeof t=="number"?(0,hl.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const i=wv(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,hl.offsetXYFromParent)(r||e,o,n.props.scale)}function i7(e,t,n){const r=!(0,Er.isNum)(e.lastX),i=wv(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function o7(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 s7(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function wv(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Nf={},Rf={};Object.defineProperty(Rf,"__esModule",{value:!0}),Rf.default=a7;function a7(){}Object.defineProperty(Nf,"__esModule",{value:!0}),Nf.default=void 0;var _v=c7(m),sr=Cv(Go),l7=Cv(kt),Hn=dn,Yo=Ni,Sv=Ii,Qc=Cv(Rf);function Cv(e){return e&&e.__esModule?e:{default:e}}function dS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(dS=function(r){return r?n:t})(e)}function c7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=dS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Zn(e,t,n){return t=u7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u7(e){var t=d7(e,"string");return typeof t=="symbol"?t:String(t)}function d7(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 bi={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Ko=bi.mouse,Lf=class extends _v.Component{constructor(){super(...arguments),Zn(this,"dragging",!1),Zn(this,"lastX",NaN),Zn(this,"lastY",NaN),Zn(this,"touchIdentifier",null),Zn(this,"mounted",!1),Zn(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,Hn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Hn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Hn.getTouchIdentifier)(t);this.touchIdentifier=i;const o=(0,Yo.getControlPosition)(t,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,Yo.createCoreData)(this,s,a);(0,Qc.default)("DraggableCore: handleDragStart: %j",l),(0,Qc.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Hn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Hn.addEvent)(r,Ko.move,this.handleDrag),(0,Hn.addEvent)(r,Ko.stop,this.handleDragStop))}),Zn(this,"handleDrag",t=>{const n=(0,Yo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=i-this.lastY;if([a,l]=(0,Yo.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,Yo.createCoreData)(this,r,i);if((0,Qc.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!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=i}),Zn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Yo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,Yo.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Yo.createCoreData)(this,r,i);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Hn.removeUserSelectStyles)(a.ownerDocument),(0,Qc.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Qc.default)("DraggableCore: Removing handlers"),(0,Hn.removeEvent)(a.ownerDocument,Ko.move,this.handleDrag),(0,Hn.removeEvent)(a.ownerDocument,Ko.stop,this.handleDragStop))}),Zn(this,"onMouseDown",t=>(Ko=bi.mouse,this.handleDragStart(t))),Zn(this,"onMouseUp",t=>(Ko=bi.mouse,this.handleDragStop(t))),Zn(this,"onTouchStart",t=>(Ko=bi.touch,this.handleDragStart(t))),Zn(this,"onTouchEnd",t=>(Ko=bi.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Hn.addEvent)(t,bi.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Hn.removeEvent)(n,bi.mouse.move,this.handleDrag),(0,Hn.removeEvent)(n,bi.touch.move,this.handleDrag),(0,Hn.removeEvent)(n,bi.mouse.stop,this.handleDragStop),(0,Hn.removeEvent)(n,bi.touch.stop,this.handleDragStop),(0,Hn.removeEvent)(t,bi.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Hn.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:l7.default.findDOMNode(this)}render(){return _v.cloneElement(_v.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Nf.default=Lf,Zn(Lf,"displayName","DraggableCore"),Zn(Lf,"propTypes",{allowAnyClick:sr.default.bool,children:sr.default.node.isRequired,disabled:sr.default.bool,enableUserSelectHack:sr.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:sr.default.arrayOf(sr.default.number),handle:sr.default.string,cancel:sr.default.string,nodeRef:sr.default.object,onStart:sr.default.func,onDrag:sr.default.func,onStop:sr.default.func,onMouseDown:sr.default.func,scale:sr.default.number,className:Sv.dontSetMe,style:Sv.dontSetMe,transform:Sv.dontSetMe}),Zn(Lf,"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=g(m),n=d(Go),r=d(kt),i=d(M4),o=dn,s=Ni,a=Ii,l=d(Nf),c=d(Rf);function d(S){return S&&S.__esModule?S:{default:S}}function f(S){if(typeof WeakMap!="function")return null;var C=new WeakMap,P=new WeakMap;return(f=function(O){return O?P:C})(S)}function g(S,C){if(!C&&S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var P=f(C);if(P&&P.has(S))return P.get(S);var O={},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in S)if(T!=="default"&&Object.prototype.hasOwnProperty.call(S,T)){var I=k?Object.getOwnPropertyDescriptor(S,T):null;I&&(I.get||I.set)?Object.defineProperty(O,T,I):O[T]=S[T]}return O.default=S,P&&P.set(S,O),O}function p(){return p=Object.assign?Object.assign.bind():function(S){for(var C=1;C<arguments.length;C++){var P=arguments[C];for(var O in P)Object.prototype.hasOwnProperty.call(P,O)&&(S[O]=P[O])}return S},p.apply(this,arguments)}function v(S,C,P){return C=b(C),C in S?Object.defineProperty(S,C,{value:P,enumerable:!0,configurable:!0,writable:!0}):S[C]=P,S}function b(S){var C=x(S,"string");return typeof C=="symbol"?C:String(C)}function x(S,C){if(typeof S!="object"||S===null)return S;var P=S[Symbol.toPrimitive];if(P!==void 0){var O=P.call(S,C||"default");if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(S)}class w extends t.Component{static getDerivedStateFromProps(C,P){let{position:O}=C,{prevPropsPosition:k}=P;return O&&(!k||O.x!==k.x||O.y!==k.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:O,prevPropsPosition:k}),{x:O.x,y:O.y,prevPropsPosition:{...O}}):null}constructor(C){super(C),v(this,"onDragStart",(P,O)=>{if((0,c.default)("Draggable: onDragStart: %j",O),this.props.onStart(P,(0,s.createDraggableData)(this,O))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(P,O)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",O);const k=(0,s.createDraggableData)(this,O),T={x:k.x,y:k.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:j}=T;T.x+=this.state.slackX,T.y+=this.state.slackY;const[B,V]=(0,s.getBoundPosition)(this,T.x,T.y);T.x=B,T.y=V,T.slackX=this.state.slackX+(F-T.x),T.slackY=this.state.slackY+(j-T.y),k.x=T.x,k.y=T.y,k.deltaX=T.x-this.state.x,k.deltaY=T.y-this.state.y}if(this.props.onDrag(P,k)===!1)return!1;this.setState(T)}),v(this,"onDragStop",(P,O)=>{if(!this.state.dragging||this.props.onStop(P,(0,s.createDraggableData)(this,O))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",O);const T={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:j}=this.props.position;T.x=F,T.y=j}this.setState(T)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var C,P;return(C=(P=this.props)===null||P===void 0||(P=P.nodeRef)===null||P===void 0?void 0:P.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:P,children:O,defaultPosition:k,defaultClassName:T,defaultClassNameDragging:I,defaultClassNameDragged:F,position:j,positionOffset:B,scale:V,...q}=this.props;let J={},$=null;const W=!!!j||this.state.dragging,te=j||k,le={x:(0,s.canDragX)(this)&&W?this.state.x:te.x,y:(0,s.canDragY)(this)&&W?this.state.y:te.y};this.state.isElementSVG?$=(0,o.createSVGTransform)(le,B):J=(0,o.createCSSTransform)(le,B);const A=(0,i.default)(O.props.className||"",T,{[I]:this.state.dragging,[F]:this.state.dragged});return t.createElement(l.default,p({},q,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(O),{className:A,style:{...O.props.style,...J},transform:$}))}}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})}(tS);const{default:fS,DraggableCore:f7}=tS;Af.exports=fS,Af.exports.default=fS,Af.exports.DraggableCore=f7;var hS=Af.exports,Ff={exports:{}},Zc={},Ev={};Ev.__esModule=!0,Ev.cloneElement=b7;var h7=p7(m);function p7(e){return e&&e.__esModule?e:{default:e}}function pS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pS(Object(n),!0).forEach(function(r){g7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g7(e,t,n){return t=m7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m7(e){var t=v7(e,"string");return typeof t=="symbol"?t:String(t)}function v7(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 b7(e,t){return t.style&&e.props.style&&(t.style=gS(gS({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),h7.default.cloneElement(e,t)}var Jc={};Jc.__esModule=!0,Jc.resizableProps=void 0;var lt=y7(Go);function y7(e){return e&&e.__esModule?e:{default:e}}var x7={axis:lt.default.oneOf(["both","x","y","none"]),className:lt.default.string,children:lt.default.element.isRequired,draggableOpts:lt.default.shape({allowAnyClick:lt.default.bool,cancel:lt.default.string,children:lt.default.node,disabled:lt.default.bool,enableUserSelectHack:lt.default.bool,offsetParent:lt.default.node,grid:lt.default.arrayOf(lt.default.number),handle:lt.default.string,nodeRef:lt.default.object,onStart:lt.default.func,onDrag:lt.default.func,onStop:lt.default.func,onMouseDown:lt.default.func,scale:lt.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="y"){var o;return(o=lt.default.number).isRequired.apply(o,n)}return lt.default.number.apply(lt.default,n)},handle:lt.default.oneOfType([lt.default.node,lt.default.func]),handleSize:lt.default.arrayOf(lt.default.number),lockAspectRatio:lt.default.bool,maxConstraints:lt.default.arrayOf(lt.default.number),minConstraints:lt.default.arrayOf(lt.default.number),onResizeStop:lt.default.func,onResizeStart:lt.default.func,onResize:lt.default.func,resizeHandles:lt.default.arrayOf(lt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:lt.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="x"){var o;return(o=lt.default.number).isRequired.apply(o,n)}return lt.default.number.apply(lt.default,n)}};Jc.resizableProps=x7,Zc.__esModule=!0,Zc.default=void 0;var eu=E7(m),w7=hS,_7=Ev,S7=Jc,C7=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function mS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(mS=function(i){return i?n:t})(e)}function E7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=mS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Ov(){return Ov=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},Ov.apply(this,arguments)}function O7(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function vS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vS(Object(n),!0).forEach(function(r){P7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P7(e,t,n){return t=k7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k7(e){var t=D7(e,"string");return typeof t=="symbol"?t:String(t)}function D7(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 M7(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,kv(e,t)}function kv(e,t){return kv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},kv(e,t)}var Dv=function(e){M7(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||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(i,o){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[i,o];if(c){var d=this.props.width/this.props.height,f=i-this.props.width,g=o-this.props.height;Math.abs(f)>Math.abs(g*d)?o=i/d:i=o*d}var p=i,v=o,b=this.slack||[0,0],x=b[0],w=b[1];return i+=x,o+=w,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[x+(p-i),w+(v-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,d=l.deltaX,f=l.deltaY;i==="onResizeStart"&&s.resetData();var g=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!g&&!p)){var v=o[0],b=o[o.length-1],x=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var w=x.left-s.lastHandleRect.left;d+=w}if(v==="n"){var S=x.top-s.lastHandleRect.top;f+=S}}s.lastHandleRect=x,b==="w"&&(d=-d),v==="n"&&(f=-f);var C=s.props.width+(g?d/s.props.transformScale:0),P=s.props.height+(p?f/s.props.transformScale:0),O=s.runConstraints(C,P);C=O[0],P=O[1];var k=C!==s.props.width||P!==s.props.height,T=typeof s.props[i]=="function"?s.props[i]:null,I=i==="onResize"&&!k;T&&!I&&(a.persist==null||a.persist(),T(a,{node:c,size:{width:C,height:P},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return eu.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=Pv({ref:o},a?{}:{handleAxis:i});return eu.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var d=O7(o,C7);return(0,_7.cloneElement)(s,Pv(Pv({},d),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var g,p=(g=i.handleRefs[f])!=null?g:i.handleRefs[f]=eu.createRef();return eu.createElement(w7.DraggableCore,Ov({},l,{nodeRef:p,key:"resizableHandle-"+f,onStop:i.resizeHandler("onResizeStop",f),onStart:i.resizeHandler("onResizeStart",f),onDrag:i.resizeHandler("onResize",f)}),i.renderResizeHandle(f,p))}))}))},t}(eu.Component);Zc.default=Dv,Dv.propTypes=S7.resizableProps,Dv.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var $f={};$f.__esModule=!0,$f.default=void 0;var Mv=R7(m),T7=bS(Go),A7=bS(Zc),I7=Jc,N7=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function bS(e){return e&&e.__esModule?e:{default:e}}function yS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(yS=function(i){return i?n:t})(e)}function R7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=yS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Tv(){return Tv=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},Tv.apply(this,arguments)}function xS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xS(Object(n),!0).forEach(function(r){L7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function L7(e,t,n){return t=F7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F7(e){var t=$7(e,"string");return typeof t=="symbol"?t:String(t)}function $7(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 j7(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function z7(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Av(e,t)}function Av(e,t){return Av=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Av(e,t)}var wS=function(e){z7(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||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(i,o){return o.propsWidth!==i.width||o.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null};var n=t.prototype;return n.render=function(){var i=this.props,o=i.handle,s=i.handleSize;i.onResize;var a=i.onResizeStart,l=i.onResizeStop,c=i.draggableOpts,d=i.minConstraints,f=i.maxConstraints,g=i.lockAspectRatio,p=i.axis;i.width,i.height;var v=i.resizeHandles,b=i.style,x=i.transformScale,w=j7(i,N7);return Mv.createElement(A7.default,{axis:p,draggableOpts:c,handle:o,handleSize:s,height:this.state.height,lockAspectRatio:g,maxConstraints:f,minConstraints:d,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},Mv.createElement("div",Tv({},w,{style:jf(jf({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Mv.Component);$f.default=wS,wS.propTypes=jf(jf({},I7.resizableProps),{},{children:T7.default.element}),Ff.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ff.exports.Resizable=Zc.default,Ff.exports.ResizableBox=$f.default;var B7=Ff.exports,so={};Object.defineProperty(so,"__esModule",{value:!0}),so.resizeHandleType=so.resizeHandleAxesType=so.default=void 0;var pt=_S(Go),V7=_S(m);function _S(e){return e&&e.__esModule?e:{default:e}}const SS=pt.default.arrayOf(pt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));so.resizeHandleAxesType=SS;const CS=pt.default.oneOfType([pt.default.node,pt.default.func]);so.resizeHandleType=CS;var H7={className:pt.default.string,style:pt.default.object,width:pt.default.number,autoSize:pt.default.bool,cols:pt.default.number,draggableCancel:pt.default.string,draggableHandle:pt.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:pt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&bt.validateLayout(t,"layout")},margin:pt.default.arrayOf(pt.default.number),containerPadding:pt.default.arrayOf(pt.default.number),rowHeight:pt.default.number,maxRows:pt.default.number,isBounded:pt.default.bool,isDraggable:pt.default.bool,isResizable:pt.default.bool,allowOverlap:pt.default.bool,preventCollision:pt.default.bool,useCSSTransforms:pt.default.bool,transformScale:pt.default.number,isDroppable:pt.default.bool,resizeHandles:SS,resizeHandle:CS,onLayoutChange:pt.default.func,onDragStart:pt.default.func,onDrag:pt.default.func,onDragStop:pt.default.func,onResizeStart:pt.default.func,onResize:pt.default.func,onResizeStop:pt.default.func,onDrop:pt.default.func,droppingItem:pt.default.shape({i:pt.default.string.isRequired,w:pt.default.number.isRequired,h:pt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};V7.default.Children.forEach(n,function(i){if((i==null?void 0:i.key)!=null){if(r[i.key])throw new Error('Duplicate child key "'+i.key+'" found! This will cause problems in ReactGridLayout.');r[i.key]=!0}})},innerRef:pt.default.any};so.default=H7,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.default=void 0;var pl=Iv(m),Dt=Iv(Go),W7=hS,U7=B7,gl=bt,Rn=Ai,ES=so,q7=Iv(Zm);function Iv(e){return e&&e.__esModule?e:{default:e}}function Ri(e,t,n){return t=G7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G7(e){var t=Y7(e,"string");return typeof t=="symbol"?t:String(t)}function Y7(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 Nv extends pl.default.Component{constructor(){super(...arguments),Ri(this,"state",{resizing:null,dragging:null,className:""}),Ri(this,"elementRef",pl.default.createRef()),Ri(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:i,transformScale:o}=this.props;if(!i)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.left/o,f=l.left/o,g=c.top/o,p=l.top/o;s.left=d-f+a.scrollLeft,s.top=g-p+a.scrollTop,this.setState({dragging:s});const{x:v,y:b}=(0,Rn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return i.call(this,this.props.i,v,b,{e:t,node:r,newPosition:s})}),Ri(this,"onDrag",(t,n)=>{let{node:r,deltaX:i,deltaY:o}=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+o,l=this.state.dragging.left+i;const{isBounded:c,i:d,w:f,h:g,containerWidth:p}=this.props,v=this.getPositionParams();if(c){const{offsetParent:S}=r;if(S){const{margin:C,rowHeight:P}=this.props,O=S.clientHeight-(0,Rn.calcGridItemWHPx)(g,P,C[1]);a=(0,Rn.clamp)(a,0,O);const k=(0,Rn.calcGridColWidth)(v),T=p-(0,Rn.calcGridItemWHPx)(f,k,C[0]);l=(0,Rn.clamp)(l,0,T)}}const b={top:a,left:l};this.setState({dragging:b});const{x,y:w}=(0,Rn.calcXY)(v,a,l,f,g);return s.call(this,d,x,w,{e:t,node:r,newPosition:b})}),Ri(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,d={top:c,left:l};this.setState({dragging:null});const{x:f,y:g}=(0,Rn.calcXY)(this.getPositionParams(),c,l,o,s);return i.call(this,a,f,g,{e:t,node:r,newPosition:d})}),Ri(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Ri(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Ri(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,Rn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,Rn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,gl.fastPositionEqual)(r,i)||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 i=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,s=o&&n.left!==i.left||n.top!==i.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-o.left,l=n.top-o.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:i}=this.props;let o;return i?o=(0,gl.setTransform)(t):(o=(0,gl.setTopLeft)(t),n&&(o.left=(0,gl.perc)(t.left/r),o.width=(0,gl.perc)(t.width/r))),o}mixinDraggable(t,n){return pl.default.createElement(W7.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,i)=>n(r,i,t)}mixinResizable(t,n,r){const{cols:i,minW:o,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:d,resizeHandle:f}=this.props,g=this.getPositionParams(),p=(0,Rn.calcGridItemPosition)(g,0,0,i,0).width,v=(0,Rn.calcGridItemPosition)(g,0,0,o,s),b=(0,Rn.calcGridItemPosition)(g,0,0,a,l),x=[v.width,v.height],w=[Math.min(b.width,p),Math.min(b.height,1/0)];return pl.default.createElement(U7.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:d,handle:f},t)}onResizeHandler(t,n,r,i){let{node:o,size:s,handle:a}=n;const l=this.props[i];if(!l)return;const{x:c,y:d,i:f,maxH:g,minH:p,containerWidth:v}=this.props,{minW:b,maxW:x}=this.props;let w=s;o&&(w=(0,gl.resizeItemInDirection)(a,r,s,v),this.setState({resizing:i==="onResizeStop"?null:w}));let{w:S,h:C}=(0,Rn.calcWH)(this.getPositionParams(),w.width,w.height,c,d,a);S=(0,Rn.clamp)(S,Math.max(b,1),x),C=(0,Rn.clamp)(C,p,g),l.call(this,f,S,C,{e:t,node:o,size:w,handle:a})}render(){const{x:t,y:n,w:r,h:i,isDraggable:o,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Rn.calcGridItemPosition)(this.getPositionParams(),t,n,r,i,this.state),d=pl.default.Children.only(this.props.children);let f=pl.default.cloneElement(d,{ref:this.elementRef,className:(0,q7.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,o),f}}Mf.default=Nv,Ri(Nv,"propTypes",{children:Dt.default.element,cols:Dt.default.number.isRequired,containerWidth:Dt.default.number.isRequired,rowHeight:Dt.default.number.isRequired,margin:Dt.default.array.isRequired,maxRows:Dt.default.number.isRequired,containerPadding:Dt.default.array.isRequired,x:Dt.default.number.isRequired,y:Dt.default.number.isRequired,w:Dt.default.number.isRequired,h:Dt.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:Dt.default.string.isRequired,resizeHandles:ES.resizeHandleAxesType,resizeHandle:ES.resizeHandleType,onDragStop:Dt.default.func,onDragStart:Dt.default.func,onDrag:Dt.default.func,onResizeStop:Dt.default.func,onResizeStart:Dt.default.func,onResize:Dt.default.func,isDraggable:Dt.default.bool.isRequired,isResizable:Dt.default.bool.isRequired,isBounded:Dt.default.bool.isRequired,static:Dt.default.bool,useCSSTransforms:Dt.default.bool.isRequired,transformScale:Dt.default.number,className:Dt.default.string,handle:Dt.default.string,cancel:Dt.default.string,droppingPosition:Dt.default.shape({e:Dt.default.object.isRequired,left:Dt.default.number.isRequired,top:Dt.default.number.isRequired})}),Ri(Nv,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.default=void 0;var Ys=Z7(m),Rv=Qm,K7=Lv(Zm),Ze=bt,X7=Ai,OS=Lv(Mf),Q7=Lv(so);function Lv(e){return e&&e.__esModule?e:{default:e}}function PS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(PS=function(r){return r?n:t})(e)}function Z7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=PS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Wn(e,t,n){return t=J7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J7(e){var t=eL(e,"string");return typeof t=="symbol"?t:String(t)}function eL(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 kS="react-grid-layout";let DS=!1;try{DS=/firefox/i.test(navigator.userAgent)}catch{}class zf extends Ys.Component{constructor(){super(...arguments),Wn(this,"state",{activeDrag:null,layout:(0,Ze.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Ze.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Wn(this,"dragEnterCounter",0),Wn(this,"onDragStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Ze.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,Ze.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,o,s)}),Wn(this,"onDrag",(t,n,r,i)=>{let{e:o,node:s}=i;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:d,preventCollision:f}=this.props,g=(0,Ze.getLayoutItem)(l,t);if(!g)return;const p={w:g.w,h:g.h,x:g.x,y:g.y,placeholder:!0,i:t},v=!0;l=(0,Ze.moveElement)(l,g,n,r,v,f,(0,Ze.compactType)(this.props),c,d),this.props.onDrag(l,a,g,p,o,s),this.setState({layout:d?l:(0,Ze.compact)(l,(0,Ze.compactType)(this.props),c),activeDrag:p})}),Wn(this,"onDragStop",(t,n,r,i)=>{let{e:o,node:s}=i;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:d,allowOverlap:f}=this.props,g=(0,Ze.getLayoutItem)(l,t);if(!g)return;const p=!0;l=(0,Ze.moveElement)(l,g,n,r,p,d,(0,Ze.compactType)(this.props),c,f);const v=f?l:(0,Ze.compact)(l,(0,Ze.compactType)(this.props),c);this.props.onDragStop(v,a,g,null,o,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),Wn(this,"onResizeStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Ze.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,Ze.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,o,s))}),Wn(this,"onResize",(t,n,r,i)=>{let{e:o,node:s,size:a,handle:l}=i;const{oldResizeItem:c}=this.state;let{layout:d}=this.state;const{cols:f,preventCollision:g,allowOverlap:p}=this.props;let v=!1,b,x,w;const[S,C]=(0,Ze.withLayoutItem)(d,t,O=>{let k;return x=O.x,w=O.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=O.x+(O.w-n),n=O.x!==x&&x<0?O.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=O.y+(O.h-r),r=O.y!==w&&w<0?O.h:r,w=w<0?0:w),v=!0),g&&!p&&(k=(0,Ze.getAllCollisions)(d,{...O,w:n,h:r,x,y:w}).filter(I=>I.i!==O.i).length>0,k&&(w=O.y,r=O.h,x=O.x,n=O.w,v=!1)),O.w=n,O.h=r,O});if(!C)return;b=S,v&&(b=(0,Ze.moveElement)(S,C,x,w,!0,this.props.preventCollision,(0,Ze.compactType)(this.props),f,p));const P={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(b,c,C,P,o,s),this.setState({layout:p?b:(0,Ze.compact)(b,(0,Ze.compactType)(this.props),f),activeDrag:P})}),Wn(this,"onResizeStop",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:d}=this.props,f=(0,Ze.getLayoutItem)(a,t),g=d?a:(0,Ze.compact)(a,(0,Ze.compactType)(this.props),c);this.props.onResizeStop(g,l,f,null,o,s);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:g,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(g,p)}),Wn(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),DS&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(kS)))return!1;const{droppingItem:r,onDropDragOver:i,margin:o,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:d,transformScale:f}=this.props,g=i==null?void 0:i(t);if(g===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...g},{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:S,top:C}=this.state.droppingPosition;(S!=b||C!=x)&&this.setState({droppingPosition:w})}}else{const S={cols:s,margin:o,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:d||o},C=(0,X7.calcXY)(S,x,b,p.w,p.h);this.setState({droppingDOMNode:Ys.createElement("div",{key:p.i}),droppingPosition:w,layout:[...v,{...p,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),Wn(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,i=(0,Ze.compact)(r.filter(o=>o.i!==t.i),(0,Ze.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:i,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Wn(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Wn(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Wn(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,i=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,i,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,Rv.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Ze.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Ze.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Ze.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Ze.fastRGLPropsEqual)(this.props,t,Rv.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,i=n.layout;this.onLayoutMaybeChanged(r,i)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Ze.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,Rv.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:i,containerPadding:o,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Ys.createElement(OS.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:i,containerPadding:o||i,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Ys.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Ze.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:i,cols:o,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:d,isResizable:f,isBounded:g,useCSSTransforms:p,transformScale:v,draggableCancel:b,draggableHandle:x,resizeHandles:w,resizeHandle:S}=this.props,{mounted:C,droppingPosition:P}=this.state,O=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,k=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,T=r.resizeHandles||w,I=O&&g&&r.isBounded!==!1;return Ys.createElement(OS.default,{containerWidth:i,cols:o,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:O,isResizable:k,isBounded:I,useCSSTransforms:p&&C,usePercentages:!C,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?P:void 0,resizeHandles:T,resizeHandle:S},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:i}=this.props,o=(0,K7.default)(kS,t),s={height:this.containerHeight(),...n};return Ys.createElement("div",{ref:i,className:o,style:s,onDrop:r?this.onDrop:Ze.noop,onDragLeave:r?this.onDragLeave:Ze.noop,onDragEnter:r?this.onDragEnter:Ze.noop,onDragOver:r?this.onDragOver:Ze.noop},Ys.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Yc.default=zf,Wn(zf,"displayName","ReactGridLayout"),Wn(zf,"propTypes",Q7.default),Wn(zf,"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:Ze.noop,onDragStart:Ze.noop,onDrag:Ze.noop,onDragStop:Ze.noop,onResizeStart:Ze.noop,onResize:Ze.noop,onResizeStop:Ze.noop,onDrop:Ze.noop,onDropDragOver:Ze.noop});var Bf={},Ks={};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.findOrGenerateResponsiveLayout=rL,Ks.getBreakpointFromWidth=tL,Ks.getColsFromBreakpoint=nL,Ks.sortBreakpoints=Fv;var Vf=bt;function tL(e,t){const n=Fv(e);let r=n[0];for(let i=1,o=n.length;i<o;i++){const s=n[i];t>e[s]&&(r=s)}return r}function nL(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function rL(e,t,n,r,i,o){if(e[n])return(0,Vf.cloneLayout)(e[n]);let s=e[r];const a=Fv(t),l=a.slice(a.indexOf(n));for(let c=0,d=l.length;c<d;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,Vf.cloneLayout)(s||[]),(0,Vf.compact)((0,Vf.correctBounds)(s,{cols:i}),o,i)}function Fv(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.default=void 0;var MS=oL(m),ar=TS(Go),$v=Qm,ml=bt,Xs=Ks,iL=TS(Yc);function TS(e){return e&&e.__esModule?e:{default:e}}function AS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(AS=function(r){return r?n:t})(e)}function oL(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=AS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function jv(){return jv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jv.apply(this,arguments)}function Hf(e,t,n){return t=sL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sL(e){var t=aL(e,"string");return typeof t=="symbol"?t:String(t)}function aL(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 IS=e=>Object.prototype.toString.call(e);function Wf(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class zv extends MS.Component{constructor(){super(...arguments),Hf(this,"state",this.generateInitialState()),Hf(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:i}=this.props,o=(0,Xs.getBreakpointFromWidth)(n,t),s=(0,Xs.getColsFromBreakpoint)(o,i),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Xs.findOrGenerateResponsiveLayout)(r,n,o,o,s,a),breakpoint:o,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,$v.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:i}=n;return{layout:(0,Xs.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,i,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,$v.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,$v.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:i,compactType:o}=this.props,s=this.props.breakpoint||(0,Xs.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Xs.getColsFromBreakpoint)(s,r),c={...i};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,ml.cloneLayout)(this.state.layout));let g=(0,Xs.findOrGenerateResponsiveLayout)(c,n,s,a,l,o);g=(0,ml.synchronizeLayoutWithChildren)(g,this.props.children,l,o,this.props.allowOverlap),c[s]=g,this.props.onLayoutChange(g,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:g,cols:l})}const d=Wf(this.props.margin,s),f=Wf(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,d,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:i,margin:o,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...d}=this.props;return MS.createElement(iL.default,jv({},d,{margin:Wf(o,this.state.breakpoint),containerPadding:Wf(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Bf.default=zv,Hf(zv,"propTypes",{breakpoint:ar.default.string,breakpoints:ar.default.object,allowOverlap:ar.default.bool,cols:ar.default.object,margin:ar.default.oneOfType([ar.default.array,ar.default.object]),containerPadding:ar.default.oneOfType([ar.default.array,ar.default.object]),layouts(e,t){if(IS(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+IS(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,ml.validateLayout)(e.layouts[n],"layouts."+n)})},width:ar.default.number.isRequired,onBreakpointChange:ar.default.func,onLayoutChange:ar.default.func,onWidthChange:ar.default.func}),Hf(zv,"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:ml.noop,onLayoutChange:ml.noop,onWidthChange:ml.noop});var Bv={},NS=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(i,o){return i[0]===n?(r=o,!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),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,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 i=0,o=this.__entries__;i<o.length;i++){var s=o[i];n.call(r,s[1],s[0])}},t}()}(),Vv=typeof window<"u"&&typeof document<"u"&&window.document===document,Uf=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")()}(),lL=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Uf):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),cL=2;function uL(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){lL(o)}function a(){var l=Date.now();if(n){if(l-i<cL)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=l}return a}var dL=20,fL=["top","right","bottom","left","width","height","size","weight"],hL=typeof MutationObserver<"u",pL=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=uL(this.refresh.bind(this),dL)}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(){!Vv||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),hL?(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(){!Vv||!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,i=fL.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),RS=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},vl=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Uf},LS=Gf(0,0,0,0);function qf(e){return parseFloat(e)||0}function FS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var o=e["border-"+i+"-width"];return r+qf(o)},0)}function gL(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var o=i[r],s=e["padding-"+o];n[o]=qf(s)}return n}function mL(e){var t=e.getBBox();return Gf(0,0,t.width,t.height)}function vL(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return LS;var r=vl(e).getComputedStyle(e),i=gL(r),o=i.left+i.right,s=i.top+i.bottom,a=qf(r.width),l=qf(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=FS(r,"left","right")+o),Math.round(l+s)!==n&&(l-=FS(r,"top","bottom")+s)),!yL(e)){var c=Math.round(a+o)-t,d=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(d)!==1&&(l-=d)}return Gf(i.left,i.top,a,l)}var bL=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof vl(e).SVGGraphicsElement}:function(e){return e instanceof vl(e).SVGElement&&typeof e.getBBox=="function"}}();function yL(e){return e===vl(e).document.documentElement}function xL(e){return Vv?bL(e)?mL(e):vL(e):LS}function wL(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return RS(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function Gf(e,t,n,r){return{x:e,y:t,width:n,height:r}}var _L=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Gf(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=xL(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}(),SL=function(){function e(t,n){var r=wL(n);RS(this,{target:t,contentRect:r})}return e}(),CL=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new NS,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 vl(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new _L(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 vl(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 SL(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),$S=typeof WeakMap<"u"?new WeakMap:new NS,jS=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=pL.getInstance(),r=new CL(t,n,this);$S.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){jS.prototype[e]=function(){var t;return(t=$S.get(this))[e].apply(t,arguments)}});var EL=function(){return typeof Uf.ResizeObserver<"u"?Uf.ResizeObserver:jS}();const OL=dm(Object.freeze(Object.defineProperty({__proto__:null,default:EL},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(Bv,"__esModule",{value:!0}),Bv.default=NL;var Yf=ML(m),PL=Hv(Go),kL=Hv(OL),DL=Hv(Zm);function Hv(e){return e&&e.__esModule?e:{default:e}}function zS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(zS=function(r){return r?n:t})(e)}function ML(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=zS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Wv(){return Wv=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},Wv.apply(this,arguments)}function bl(e,t,n){return t=TL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TL(e){var t=AL(e,"string");return typeof t=="symbol"?t:String(t)}function AL(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 IL="react-grid-layout";function NL(e){var t;return t=class extends Yf.Component{constructor(){super(...arguments),bl(this,"state",{width:1280}),bl(this,"elementRef",Yf.createRef()),bl(this,"mounted",!1),bl(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new kL.default(i=>{if(this.elementRef.current instanceof HTMLElement){const s=i[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,...i}=this.props;return r&&!this.mounted?Yf.createElement("div",{className:(0,DL.default)(this.props.className,IL),style:this.props.style,ref:this.elementRef}):Yf.createElement(e,Wv({innerRef:this.elementRef},i,this.state))}},bl(t,"defaultProps",{measureBeforeMount:!1}),bl(t,"propTypes",{measureBeforeMount:PL.default.bool}),t}(function(e){e.exports=Yc.default,e.exports.utils=bt,e.exports.calculateUtils=Ai,e.exports.Responsive=Bf.default,e.exports.Responsive.utils=Ks,e.exports.WidthProvider=Bv.default})(M_);var BS=M_.exports;function ao({children:e,className:t,text:n,onSave:r}){const[i,o]=m.useState(!1),[s,a]=m.useState(n),l=fe(d=>d.isDashboardEditing),c=d=>{d.stopPropagation(),l&&o(!0)};return _.jsx("div",{role:"editable",onDoubleClick:c,children:i?_.jsx("input",{type:"text",className:De("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:d=>a(d.target.value),value:s,autoFocus:!0,onBlur:()=>o(!1),onKeyDown:d=>{(d.key==="Enter"||d.key==="Tab")&&(o(!1),r(s))}}):e})}const Kf=de.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Kf.displayName="Card";const tu=de.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De("flex flex-col space-y-1.5 p-6",e),...t}));tu.displayName="CardHeader";const nu=de.forwardRef(({className:e,...t},n)=>_.jsx("h3",{ref:n,className:De("text-2xl font-semibold leading-none tracking-tight",e),...t}));nu.displayName="CardTitle";const Xf=de.forwardRef(({className:e,...t},n)=>_.jsx("p",{ref:n,className:De("text-sm text-muted-foreground",e),...t}));Xf.displayName="CardDescription";const ru=de.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De("px-6 pb-6 pt-0",e),...t}));ru.displayName="CardContent";const Uv=de.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De("flex items-center p-6 pt-0",e),...t}));Uv.displayName="CardFooter";/*!
107
107
  * @kurkle/color v0.3.2
108
108
  * https://github.com/kurkle/color#readme
109
109
  * (c) 2023 Jukka Kurkela
@@ -118,7 +118,7 @@ Valid keys: `+JSON.stringify(Object.keys(A),null," "));var te=we(pe,ie,ue,xe,ge
118
118
  * https://www.chartjs.org
119
119
  * (c) 2023 Chart.js Contributors
120
120
  * Released under the MIT License
121
- */class xF{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.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=aC.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.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,i)=>Math.max(r,i._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 i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var po=new xF;const FC="transparent",wF={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=hC(e||FC),i=r.valid&&hC(t||FC);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class _F{constructor(t,n,r,i){const o=n[r];i=en([t.to,i,o,t.from]);const s=en([t.from,o,i]);this._active=!0,this._fn=t.fn||wF[t.type||typeof s],this._easing=du[t.easing]||du.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=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=en([t.to,n,i,t.from]),this._from=en([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,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 i=0;i<r.length;i++)r[i][n]()}}class $C{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!_t(t))return;const n=Object.keys(an.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!_t(o))return;const s={};for(const a of n)s[a]=o[a];(Qt(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=CF(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&SF(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=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"){i.push(...this._animateOptions(t,n));continue}const d=n[c];let f=o[c];const g=r.get(c);if(f)if(g&&f.active()){f.update(g,d,a);continue}else f.cancel();if(!g||!g.duration){t[c]=d;continue}o[c]=f=new _F(g,t,c,d),i.push(f)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return po.add(this._chart,r),!0}}function SF(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function CF(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 jC(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function EF(e,t,n){if(n===!1)return!1;const r=jC(e,n),i=jC(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function OF(e){let t,n,r,i;return _t(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function zC(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function BC(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let s,a,l,c;if(t!==null){for(s=0,a=i.length;s<a;++s){if(l=+i[s],l===n){if(r.all)continue;break}c=e.values[l],fn(c)&&(o||t===0||Fi(t)===Fi(c))&&(t+=c)}return t}}function PF(e){const t=Object.keys(e),n=new Array(t.length);let r,i,o;for(r=0,i=t.length;r<i;++r)o=t[r],n[r]={x:o,y:e[o]};return n}function VC(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function kF(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function DF(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function MF(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function HC(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function WC(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,d=kF(o,s,r),f=t.length;let g;for(let p=0;p<f;++p){const v=t[p],{[l]:b,[c]:x}=v,w=v._stacks||(v._stacks={});g=w[c]=MF(i,d,b),g[a]=x,g._top=HC(g,s,!0,r.type),g._bottom=HC(g,s,!1,r.type);const S=g._visualValues||(g._visualValues={});S[a]=x}}function hb(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function TF(e,t){return ts(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function AF(e,t,n){return ts(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function gu(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const pb=e=>e==="reset"||e==="none",UC=(e,t)=>t?e:Object.assign({},e),IF=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:zC(n,!0),values:null};class xi{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=VC(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&&gu(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(f,g,p,v)=>f==="x"?g:f==="r"?v:p,o=n.xAxisID=rt(r.xAxisID,hb(t,"x")),s=n.yAxisID=rt(r.yAxisID,hb(t,"y")),a=n.rAxisID=rt(r.rAxisID,hb(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),d=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&oC(this._data,this),t._stacked&&gu(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(_t(n))this._data=PF(n);else if(r!==n){if(r){oC(r,this);const i=this._cachedMeta;gu(i),i._parsed=[]}n&&Object.isExtensible(n)&&b9(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 i=!1;this._dataCheck();const o=n._stacked;n._stacked=VC(n.vScale,n),n.stack!==r.stack&&(i=!0,gu(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&WC(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:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],d,f,g;if(this._parsing===!1)r._parsed=i,r._sorted=!0,g=i;else{Qt(i[t])?g=this.parseArrayData(r,i,t,n):_t(i[t])?g=this.parseObjectData(r,i,t,n):g=this.parsePrimitiveData(r,i,t,n);const p=()=>f[a]===null||c&&f[a]<c[a];for(d=0;d<n;++d)r._parsed[d+t]=f=g[d],l&&(p()&&(l=!1),c=f);r._sorted=l}s&&WC(this,g)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:s}=t,a=o.axis,l=s.axis,c=o.getLabels(),d=o===s,f=new Array(i);let g,p,v;for(g=0,p=i;g<p;++g)v=g+r,f[g]={[a]:d||o.parse(c[v],v),[l]:s.parse(n[v],v)};return f}parseArrayData(t,n,r,i){const{xScale:o,yScale:s}=t,a=new Array(i);let l,c,d,f;for(l=0,c=i;l<c;++l)d=l+r,f=n[d],a[l]={x:o.parse(f[0],d),y:s.parse(f[1],d)};return a}parseObjectData(t,n,r,i){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let d,f,g,p;for(d=0,f=i;d<f;++d)g=d+r,p=n[g],c[d]={x:o.parse(Zo(p,a),g),y:s.parse(Zo(p,l),g)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,s=n[t.axis],a={keys:zC(i,!0),values:n._stacks[t.axis]._visualValues};return BC(a,s,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let s=o===null?NaN:o;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,s=BC(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,s=i.length,a=this._getOtherScale(t),l=IF(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=DF(a);let g,p;function v(){p=i[g];const b=p[a.axis];return!fn(p[t.axis])||d>b||f<b}for(g=0;g<s&&!(!v()&&(this.updateRangeFromParsed(c,t,p,l),o));++g);if(o){for(g=s-1;g>=0;--g)if(!v()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i<o;++i)s=n[i][t.axis],fn(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=OF(rt(this.options.clip,EF(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(t,o,a,l),d=a;d<a+l;++d){const f=i[d];f.hidden||(f.active&&c?s.push(f):f.draw(t,o))}for(d=0;d<s.length;++d)s[d].draw(t,o)}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 i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];o=s.$context||(s.$context=AF(this.getContext(),t,s)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=TF(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}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 i=n==="active",o=this._cachedDataOpts,s=t+"-"+n,a=o[s],l=this.enableOptionSharing&&lu(r);if(a)return UC(a,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],g=c.getOptionScopes(this.getDataset(),d),p=Object.keys(an.elements[t]),v=()=>this.getContext(r,i,n),b=c.resolveNamedOptions(g,p,v,f);return b.$shared&&(b.$shared=l,o[s]=Object.freeze(UC(b,l))),b}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.options.animation!==!1){const d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,n),g=d.getOptionScopes(this.getDataset(),f);l=d.createResolver(g,this.getContext(t,r,n))}const c=new $C(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||pb(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){pb(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!pb(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}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 i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.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(o),a=t;a<s;++a)o[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&gu(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}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])}}Me(xi,"defaults",{}),Me(xi,"datasetElementType",null),Me(xi,"dataElementType",null);function NF(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=sC(r.sort((i,o)=>i-o))}return e._cache.$bar}function RF(e){const t=e.iScale,n=NF(t,e.type);let r=t._length,i,o,s,a;const l=()=>{s===32767||s===-32768||(lu(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(i=0,o=n.length;i<o;++i)s=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=t.ticks.length;i<o;++i)s=t.getPixelForTick(i),l();return r}function LF(e,t,n,r){const i=n.barThickness;let o,s;return yt(i)?(o=t.min*n.categoryPercentage,s=n.barPercentage):(o=i*r,s=1),{chunk:o/r,ratio:s,start:t.pixels[e]-o/2}}function FF(e,t,n,r){const i=t.pixels,o=i[e];let s=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;s===null&&(s=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-s);const c=o-(o-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function $F(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),s=Math.min(i,o),a=Math.max(i,o);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:i,end:o,min:s,max:a}}function qC(e,t,n,r){return Qt(e)?$F(e,t,n,r):t[n.axis]=n.parse(e,r),t}function GC(e,t,n,r){const i=e.iScale,o=e.vScale,s=i.getLabels(),a=i===o,l=[];let c,d,f,g;for(c=n,d=n+r;c<d;++c)g=t[c],f={},f[i.axis]=a||i.parse(s[c],c),l.push(qC(g,f,o,c));return l}function gb(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function jF(e,t,n){return e!==0?Fi(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function zF(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function BF(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:d}=zF(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=d:(o[YC(d,s,a,l)]=!0,i=c)),o[YC(i,s,a,l)]=!0,e.borderSkipped=o}function YC(e,t,n,r){return r?(e=VF(e,t,n),e=KC(e,n,t)):e=KC(e,t,n),e}function VF(e,t,n){return e===t?n:e===n?t:e}function KC(e,t,n){return e==="start"?t:e==="end"?n:e}function HF(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class fh extends xi{parsePrimitiveData(t,n,r,i){return GC(t,n,r,i)}parseArrayData(t,n,r,i){return GC(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,d=s.axis==="x"?a:l,f=[];let g,p,v,b;for(g=r,p=r+i;g<p;++g)b=n[g],v={},v[o.axis]=o.parse(Zo(b,c),g),f.push(qC(Zo(b,d),v,s,g));return f}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),s=o._custom,a=gb(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[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,i){const o=i==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:f,includeOptions:g}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const v=this.getParsed(p),b=o||yt(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),x=this._calculateBarIndexPixels(p,d),w=(v._stacks||{})[a.axis],S={horizontal:c,base:b.base,enableBorderRadius:!w||gb(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};g&&(S.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const C=S.options||t[p].options;BF(S,C,w,s),HF(S,C,d.ratio),this.updateElement(t[p],p,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=r.options.stacked,s=[],a=l=>{const c=l.controller.getParsed(n),d=c&&c[l.vScale.axis];if(yt(d)||isNaN(d))return!0};for(const l of i)if(!(n!==void 0&&a(l))&&((o===!1||s.indexOf(l.stack)===-1||o===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 i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,s;for(o=0,s=n.data.length;o<s;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||RF(n),pixels:i,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:i},options:{base:o,minBarLength:s}}=this,a=o||0,l=this.getParsed(t),c=l._custom,d=gb(c);let f=l[n.axis],g=0,p=r?this.applyStack(n,l,r):f,v,b;p!==f&&(g=p-f,p=f),d&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&Fi(f)!==Fi(c.barEnd)&&(g=0),g+=f);const x=!yt(o)&&!d?o:g;let w=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(g+p):v=w,b=v-w,Math.abs(b)<s){b=jF(b,n,a)*s,f===a&&(w-=b/2);const S=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),P=Math.min(S,C),O=Math.max(S,C);w=Math.max(Math.min(w,O),P),v=w+b,r&&!d&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(v)-n.getValueForPixel(w))}if(w===n.getPixelForValue(a)){const S=Fi(b)*n.getLineWidthForValue(a)/2;w+=S,b-=S}return{size:b,base:w,head:v,center:v+b/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,s=rt(i.maxBarThickness,1/0);let a,l;if(n.grouped){const c=o?this._getStackCount(t):n.stackCount,d=i.barThickness==="flex"?FF(t,n,i,c):LF(t,n,i,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=d.start+d.chunk*f+d.chunk/2,l=Math.min(s,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&r[o].draw(this._ctx)}}Me(fh,"id","bar"),Me(fh,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Me(fh,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class hh extends xi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const o=super.parsePrimitiveData(t,n,r,i);for(let s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+r).radius;return o}parseArrayData(t,n,r,i){const o=super.parseArrayData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=rt(a[2],this.resolveDataElementOptions(s+r).radius)}return o}parseObjectData(t,n,r,i){const o=super.parseObjectData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=rt(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return o}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:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.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,i){const o=i==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),d=s.axis,f=a.axis;for(let g=n;g<n+r;g++){const p=t[g],v=!o&&this.getParsed(g),b={},x=b[d]=o?s.getPixelForDecimal(.5):s.getPixelForValue(v[d]),w=b[f]=o?a.getBasePixel():a.getPixelForValue(v[f]);b.skip=isNaN(x)||isNaN(w),c&&(b.options=l||this.resolveDataElementOptions(g,p.active?"active":i),o&&(b.options.radius=0)),this.updateElement(p,g,b,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return n!=="active"&&(i.radius=0),i.radius+=rt(r&&r._custom,o),i}}Me(hh,"id","bubble"),Me(hh,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Me(hh,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function WF(e,t,n){let r=1,i=1,o=0,s=0;if(t<Jt){const a=e,l=a+t,c=Math.cos(a),d=Math.sin(a),f=Math.cos(l),g=Math.sin(l),p=(C,P,O)=>uu(C,a,l,!0)?1:Math.max(P,P*n,O,O*n),v=(C,P,O)=>uu(C,a,l,!0)?-1:Math.min(P,P*n,O,O*n),b=p(0,c,f),x=p(pn,d,g),w=v(Zt,c,f),S=v(Zt+pn,d,g);r=(b-w)/2,i=(x-S)/2,o=-(b+w)/2,s=-(x+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}class oa extends xi{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,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(_t(r[t])){const{key:l="value"}=this._parsing;o=c=>+Zo(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)i._parsed[s]=o(s)}}_getRotation(){return yi(this.options.rotation-90)}_getCircumference(){return yi(this.options.circumference)}_getRotationExtents(){let t=Jt,n=-Jt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),s=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(i9(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:g,ratioY:p,offsetX:v,offsetY:b}=WF(f,d,l),x=(r.width-s)/g,w=(r.height-s)/p,S=Math.max(Math.min(x,w)/2,0),C=KS(this.options.radius,S),P=Math.max(C*l,0),O=(C-P)/this._getVisibleDatasetWeightTotal();this.offsetX=v*C,this.offsetY=b*C,i.total=this.calculateTotal(),this.outerRadius=C-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/Jt)}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,d=(a.left+a.right)/2,f=(a.top+a.bottom)/2,g=o&&c.animateScale,p=g?0:this.innerRadius,v=g?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(n,i);let w=this._getRotation(),S;for(S=0;S<n;++S)w+=this._circumference(S,o);for(S=n;S<n+r;++S){const C=this._circumference(S,o),P=t[S],O={x:d+this.offsetX,y:f+this.offsetY,startAngle:w,endAngle:w+C,circumference:C,outerRadius:v,innerRadius:p};x&&(O.options=b||this.resolveDataElementOptions(S,P.active?"active":i)),w+=C,this.updateElement(P,S,O,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Jt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=fu(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,s,a,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,a=s.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.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(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Me(oa,"id","doughnut"),Me(oa,"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"}),Me(oa,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Me(oa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,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 ph extends xi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=cC(n,i,s);this._drawStart=a,this._drawCount=l,uC(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;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(i,a,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,i),g=s.axis,p=a.axis,{spanGaps:v,segment:b}=this.options,x=xl(v)?v:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||i==="none",S=n+r,C=t.length;let P=n>0&&this.getParsed(n-1);for(let O=0;O<C;++O){const k=t[O],T=w?k:{};if(O<n||O>=S){T.skip=!0;continue}const I=this.getParsed(O),F=yt(I[p]),j=T[g]=s.getPixelForValue(I[g],O),B=T[p]=o||F?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,I,l):I[p],O);T.skip=isNaN(j)||isNaN(B)||F,T.stop=O>0&&Math.abs(I[g]-P[g])>x,b&&(T.parsed=I,T.raw=c.data[O]),f&&(T.options=d||this.resolveDataElementOptions(O,k.active?"active":i)),w||this.updateElement(k,O,T,i),P=I}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Me(ph,"id","line"),Me(ph,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Me(ph,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class mu extends xi{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=fu(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,r,i){return EC.bind(this)(t,n,r,i)}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,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-s)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,f=c.yCenter,g=c.getIndexAngle(0)-.5*Zt;let p=g,v;const b=360/this.countVisibleElements();for(v=0;v<n;++v)p+=this._computeAngle(v,i,b);for(v=n;v<n+r;v++){const x=t[v];let w=p,S=p+this._computeAngle(v,i,b),C=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;p=S,o&&(l.animateScale&&(C=0),l.animateRotate&&(w=S=g));const P={x:d,y:f,innerRadius:0,outerRadius:C,startAngle:w,endAngle:S,options:this.resolveDataElementOptions(v,x.active?"active":i)};this.updateElement(x,v,P,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?yi(this.resolveDataElementOptions(t,n).angle||r):0}}Me(mu,"id","polarArea"),Me(mu,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Me(mu,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,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 mb extends oa{}Me(mb,"id","pie"),Me(mb,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class gh extends xi{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,i){return EC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const o=this._cachedMeta.rScale,s=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),d=o.getPointPositionForValue(a,this.getParsed(a).r),f=s?o.xCenter:d.x,g=s?o.yCenter:d.y,p={x:f,y:g,angle:d.angle,skip:isNaN(f)||isNaN(g),options:c};this.updateElement(l,a,p,i)}}}Me(gh,"id","radar"),Me(gh,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Me(gh,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class mh extends xi{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:o,count:s}=cC(n,r,i);if(this._drawStart=o,this._drawCount=s,uC(n)&&(o=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:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(d),g=this.includeOptions(i,f),p=s.axis,v=a.axis,{spanGaps:b,segment:x}=this.options,w=xl(b)?b:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||o||i==="none";let C=n>0&&this.getParsed(n-1);for(let P=n;P<n+r;++P){const O=t[P],k=this.getParsed(P),T=S?O:{},I=yt(k[v]),F=T[p]=s.getPixelForValue(k[p],P),j=T[v]=o||I?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[v],P);T.skip=isNaN(F)||isNaN(j)||I,T.stop=P>0&&Math.abs(k[p]-C[p])>w,x&&(T.parsed=k,T.raw=c.data[P]),g&&(T.options=f||this.resolveDataElementOptions(P,O.active?"active":i)),S||this.updateElement(O,P,T,i),C=k}this.updateSharedOptions(f,i,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,s)/2}}Me(mh,"id","scatter"),Me(mh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Me(mh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var UF=Object.freeze({__proto__:null,BarController:fh,BubbleController:hh,DoughnutController:oa,LineController:ph,PieController:mb,PolarAreaController:mu,RadarController:gh,ScatterController:mh});function sa(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vb{constructor(t){Me(this,"options");this.options=t||{}}static override(t){Object.assign(vb.prototype,t)}init(){}formats(){return sa()}parse(){return sa()}format(){return sa()}add(){return sa()}diff(){return sa()}startOf(){return sa()}endOf(){return sa()}}var qF={_date:vb};function GF(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?m9:fo;if(r){if(i._sharedOptions){const c=o[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=l(o,t,n-d),g=l(o,t,n+d);return{lo:f.lo,hi:g.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function vu(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:d}=o[a],{lo:f,hi:g}=GF(o[a],t,s,i);for(let p=f;p<=g;++p){const v=d[p];v.skip||r(v,c,p)}}}function YF(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,s=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function bb(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||vu(e,n,t,function(a,l,c){!i&&!ho(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function KF(e,t,n,r){let i=[];function o(s,a,l){const{startAngle:c,endAngle:d}=s.getProps(["startAngle","endAngle"],r),{angle:f}=rC(s,{x:t.x,y:t.y});uu(f,c,d)&&i.push({element:s,datasetIndex:a,index:l})}return vu(e,n,t,o),i}function XF(e,t,n,r,i,o){let s=[];const a=YF(n);let l=Number.POSITIVE_INFINITY;function c(d,f,g){const p=d.inRange(t.x,t.y,i);if(r&&!p)return;const v=d.getCenterPoint(i);if(!(!!o||e.isPointInArea(v))&&!p)return;const x=a(t,v);x<l?(s=[{element:d,datasetIndex:f,index:g}],l=x):x===l&&s.push({element:d,datasetIndex:f,index:g})}return vu(e,n,t,c),s}function yb(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?KF(e,t,n,i):XF(e,t,n,r,i,o)}function XC(e,t,n,r,i){const o=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return vu(e,n,t,(l,c,d)=>{l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var QF={evaluateInteractionItems:vu,modes:{index(e,t,n,r){const i=ra(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?bb(e,i,o,r,s):yb(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const d=a[0].index,f=c.data[d];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,n,r){const i=ra(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?bb(e,i,o,r,s):yb(e,i,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(e,t,n,r){const i=ra(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return bb(e,i,o,r,s)},nearest(e,t,n,r){const i=ra(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return yb(e,i,o,n.intersect,r,s)},x(e,t,n,r){const i=ra(t,e);return XC(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=ra(t,e);return XC(e,i,"y",n.intersect,r)}}};const QC=["left","top","right","bottom"];function bu(e,t){return e.filter(n=>n.pos===t)}function ZC(e,t){return e.filter(n=>QC.indexOf(n.pos)===-1&&n.box.axis===t)}function yu(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function ZF(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:s,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&o+s,stackWeight:a});return t}function JF(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!QC.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return t}function e8(e,t){const n=JF(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,s,a;for(o=0,s=e.length;o<s;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=d?d*i:l&&t.availableHeight)}return n}function t8(e){const t=ZF(e),n=yu(t.filter(c=>c.box.fullSize),!0),r=yu(bu(t,"left"),!0),i=yu(bu(t,"right")),o=yu(bu(t,"top"),!0),s=yu(bu(t,"bottom")),a=ZC(t,"x"),l=ZC(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:bu(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function JC(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function eE(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 n8(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!_t(i)){n.size&&(e[i]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[i]+=n.size}o.getPadding&&eE(s,o.getPadding());const a=Math.max(0,t.outerWidth-JC(s,e,"left","right")),l=Math.max(0,t.outerHeight-JC(s,e,"top","bottom")),c=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function r8(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function i8(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function xu(e,t,n,r){const i=[];let o,s,a,l,c,d;for(o=0,s=e.length,c=0;o<s;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,i8(a.horizontal,t));const{same:f,other:g}=n8(t,n,a,r);c|=f&&i.length,d=d||g,l.fullSize||i.push(a)}return c&&xu(i,t,n,r)||d}function vh(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function tE(e,t,n,r){const i=n.padding;let{x:o,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*d,g=c.size||l.height;lu(c.start)&&(s=c.start),l.fullSize?vh(l,i.left,s,n.outerWidth-i.right-i.left,g):vh(l,t.left+c.placed,s,f,g),c.start=s,c.placed+=f,s=l.bottom}else{const f=t.h*d,g=c.size||l.width;lu(c.start)&&(o=c.start),l.fullSize?vh(l,o,i.top,g,n.outerHeight-i.bottom-i.top):vh(l,o,t.top+c.placed,g,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=s}var qn={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 i=Ln(e.options.layout.padding),o=Math.max(t-i.width,0),s=Math.max(n-i.height,0),a=t8(e.boxes),l=a.vertical,c=a.horizontal;Nt(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const d=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:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/d,hBoxMaxHeight:s/2}),g=Object.assign({},i);eE(g,Ln(r));const p=Object.assign({maxPadding:g,w:o,h:s,x:i.left,y:i.top},i),v=e8(l.concat(c),f);xu(a.fullSize,p,f,v),xu(l,p,f,v),xu(c,p,f,v)&&xu(l,p,f,v),r8(p),tE(a.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,tE(a.rightAndBottom,p,f,v),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Nt(a.chartArea,b=>{const x=b.box;Object.assign(x,e.chartArea),x.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class nE{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class o8 extends nE{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const bh="$chartjs",s8={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},rE=e=>e===null||e==="";function a8(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[bh]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",rE(i)){const o=kC(e,"width");o!==void 0&&(e.width=o)}if(rE(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=kC(e,"height");o!==void 0&&(e.height=o)}return e}const iE=cF?{passive:!0}:!1;function l8(e,t,n){e.addEventListener(t,n,iE)}function c8(e,t,n){e.canvas.removeEventListener(t,n,iE)}function u8(e,t){const n=s8[e.type]||e.type,{x:r,y:i}=ra(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function yh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function d8(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||yh(a.addedNodes,r),s=s&&!yh(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function f8(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||yh(a.removedNodes,r),s=s&&!yh(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const wu=new Map;let oE=0;function sE(){const e=window.devicePixelRatio;e!==oE&&(oE=e,wu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function h8(e,t){wu.size||window.addEventListener("resize",sE),wu.set(e,t)}function p8(e){wu.delete(e),wu.size||window.removeEventListener("resize",sE)}function g8(e,t,n){const r=e.canvas,i=r&&fb(r);if(!i)return;const o=lC((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return s.observe(i),h8(e,o),s}function xb(e,t,n){n&&n.disconnect(),t==="resize"&&p8(e)}function m8(e,t,n){const r=e.canvas,i=lC(o=>{e.ctx!==null&&n(u8(o,e))},e);return l8(r,t,i),i}class v8 extends nE{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(a8(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[bh])return!1;const r=n[bh].initial;["height","width"].forEach(o=>{const s=r[o];yt(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[bh],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:d8,detach:f8,resize:g8}[n]||m8;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:xb,detach:xb,resize:xb}[n]||c8)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return lF(t,n,r,i)}isAttached(t){const n=fb(t);return!!(n&&n.isConnected)}}function b8(e){return!db()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?o8:v8}let go=(_g=class{constructor(){Me(this,"x");Me(this,"y");Me(this,"active",!1);Me(this,"options");Me(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return xl(this.x)&&xl(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}},Me(_g,"defaults",{}),Me(_g,"defaultRoutes"),_g);function y8(e,t){const n=e.options.ticks,r=x8(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?_8(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return S8(t,c,o,s/i),c;const d=w8(o,t,i);if(s>0){let f,g;const p=s>1?Math.round((l-a)/(s-1)):null;for(xh(t,c,d,yt(p)?0:a-p,a),f=0,g=s-1;f<g;f++)xh(t,c,d,o[f],o[f+1]);return xh(t,c,d,l,yt(p)?t.length:l+p),c}return xh(t,c,d),c}function x8(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function w8(e,t,n){const r=C8(e),i=t.length/n;if(!r)return Math.max(i,1);const o=f9(r);for(let s=0,a=o.length-1;s<a;s++){const l=o[s];if(l>i)return l}return Math.max(i,1)}function _8(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function S8(e,t,n,r){let i=0,o=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===o&&(t.push(e[s]),i++,o=n[i*r])}function xh(e,t,n,r,i){const o=rt(r,0),s=Math.min(rt(i,e.length),e.length);let a=0,l,c,d;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),d=o;d<0;)a++,d=Math.round(o+a*n);for(c=Math.max(o,0);c<s;c++)c===d&&(t.push(e[c]),a++,d=Math.round(o+a*n))}function C8(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 E8=e=>e==="left"?"right":e==="right"?"left":e,aE=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,lE=(e,t)=>Math.min(t||e,e);function cE(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function O8(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-a||l>s+a)))return l}function P8(e,t){Nt(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function _u(e){return e.drawTicks?e.tickLength:0}function uE(e,t){if(!e.display)return 0;const n=xn(e.font,t),r=Ln(e.padding);return(Qt(e.text)?e.text.length:1)*n.lineHeight+r.height}function k8(e,t){return ts(e,{scale:t,type:"scale"})}function D8(e,t,n){return ts(e,{tick:n,index:t,type:"tick"})}function M8(e,t,n){let r=tb(e);return(n&&t!=="right"||!n&&t==="right")&&(r=E8(r)),r}function T8(e,t,n,r){const{top:i,left:o,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:d}=l;let f=0,g,p,v;const b=s-i,x=a-o;if(e.isHorizontal()){if(p=Un(r,o,a),_t(n)){const w=Object.keys(n)[0],S=n[w];v=d[w].getPixelForValue(S)+b-t}else n==="center"?v=(c.bottom+c.top)/2+b-t:v=aE(e,n,t);g=a-o}else{if(_t(n)){const w=Object.keys(n)[0],S=n[w];p=d[w].getPixelForValue(S)-x+t}else n==="center"?p=(c.left+c.right)/2-x+t:p=aE(e,n,t);v=Un(r,s,i),f=n==="left"?-pn:pn}return{titleX:p,titleY:v,maxWidth:g,rotation:f}}class aa extends go{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:i}=this;return t=Or(t,Number.POSITIVE_INFINITY),n=Or(n,Number.NEGATIVE_INFINITY),r=Or(r,Number.POSITIVE_INFINITY),i=Or(i,Number.NEGATIVE_INFINITY),{min:Or(t,r),max:Or(n,i),minDefined:fn(t),maxDefined:fn(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),s;if(i&&o)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),i||(n=Math.min(n,s.min)),o||(r=Math.max(r,s.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Or(n,Or(r,n)),max:Or(r,Or(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(){jt(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,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=z9(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?cE(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=y8(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(){jt(this.options.afterUpdate,[this])}beforeSetDimensions(){jt(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(){jt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),jt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){jt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=jt(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){jt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){jt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=lE(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let s=i,a,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const d=this._getLabelSizes(),f=d.widest.width,g=d.highest.height,p=Dn(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-_u(t.grid)-n.padding-uE(t.title,this.chart.options.font),c=Math.sqrt(f*f+g*g),s=Zv(Math.min(Math.asin(Dn((d.highest.height+6)/a,-1,1)),Math.asin(Dn(l/c,-1,1))-Math.asin(Dn(g/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){jt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){jt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=uE(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=_u(o)+l):(t.height=this.maxHeight,t.width=_u(o)+l),r.display&&this.ticks.length){const{first:c,last:d,widest:f,highest:g}=this._getLabelSizes(),p=r.padding*2,v=yi(this.labelRotation),b=Math.cos(v),x=Math.sin(v);if(a){const w=r.mirror?0:x*f.width+b*g.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{const w=r.mirror?0:b*f.width+x*g.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,d,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,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,p=0;l?c?(g=i*t.width,p=r*n.height):(g=r*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?g=t.width:o!=="inner"&&(g=t.width/2,p=n.width/2),this.paddingLeft=Math.max((g-d+s)*this.width/(this.width-d),0),this.paddingRight=Math.max((p-f+s)*this.width/(this.width-f),0)}else{let d=n.height/2,f=t.height/2;o==="start"?(d=0,f=t.height):o==="end"&&(d=n.height,f=0),this.paddingTop=d+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(){jt(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++)yt(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=cE(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,s=[],a=[],l=Math.floor(n/lE(n,r));let c=0,d=0,f,g,p,v,b,x,w,S,C,P,O;for(f=0;f<n;f+=l){if(v=t[f].label,b=this._resolveTickFontOptions(f),i.font=x=b.string,w=o[x]=o[x]||{data:{},gc:[]},S=b.lineHeight,C=P=0,!yt(v)&&!Qt(v))C=oh(i,w.data,w.gc,C,v),P=S;else if(Qt(v))for(g=0,p=v.length;g<p;++g)O=v[g],!yt(O)&&!Qt(O)&&(C=oh(i,w.data,w.gc,C,O),P+=S);s.push(C),a.push(P),c=Math.max(C,c),d=Math.max(P,d)}P8(o,n);const k=s.indexOf(c),T=a.indexOf(d),I=F=>({width:s[F]||0,height:a[F]||0});return{first:I(0),last:I(n-1),widest:I(k),highest:I(T),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 g9(this._alignToPixels?Js(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=D8(this.getContext(),t,r))}return this.$context||(this.$context=k8(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=yi(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),s=t.autoSkipPadding||0,a=o?o.widest.width+s:0,l=o?o.highest.height+s:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),g=_u(o),p=[],v=a.setContext(this.getContext()),b=v.display?v.width:0,x=b/2,w=function(X){return Js(r,X,b)};let S,C,P,O,k,T,I,F,j,B,V,q;if(s==="top")S=w(this.bottom),T=this.bottom-g,F=S-x,B=w(t.top)+x,q=t.bottom;else if(s==="bottom")S=w(this.top),B=t.top,q=w(t.bottom)-x,T=S+x,F=this.top+g;else if(s==="left")S=w(this.right),k=this.right-g,I=S-x,j=w(t.left)+x,V=t.right;else if(s==="right")S=w(this.left),j=t.left,V=w(t.right)-x,k=S+x,I=this.left+g;else if(n==="x"){if(s==="center")S=w((t.top+t.bottom)/2+.5);else if(_t(s)){const X=Object.keys(s)[0],W=s[X];S=w(this.chart.scales[X].getPixelForValue(W))}B=t.top,q=t.bottom,T=S+x,F=T+g}else if(n==="y"){if(s==="center")S=w((t.left+t.right)/2);else if(_t(s)){const X=Object.keys(s)[0],W=s[X];S=w(this.chart.scales[X].getPixelForValue(W))}k=S-x,I=k-g,j=t.left,V=t.right}const J=rt(i.ticks.maxTicksLimit,f),$=Math.max(1,Math.ceil(f/J));for(C=0;C<f;C+=$){const X=this.getContext(C),W=o.setContext(X),ne=a.setContext(X),le=W.lineWidth,A=W.color,H=ne.dash||[],re=ne.dashOffset,R=W.tickWidth,ue=W.tickColor,xe=W.tickBorderDash||[],ge=W.tickBorderDashOffset;P=O8(this,C,l),P!==void 0&&(O=Js(r,P,le),c?k=I=j=V=O:T=F=B=q=O,p.push({tx1:k,ty1:T,tx2:I,ty2:F,x1:j,y1:B,x2:V,y2:q,width:le,color:A,borderDash:H,borderDashOffset:re,tickWidth:R,tickColor:ue,tickBorderDash:xe,tickBorderDashOffset:ge}))}return this._ticksLength=f,this._borderValue=S,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:f}=o,g=_u(r.grid),p=g+d,v=f?-d:p,b=-yi(this.labelRotation),x=[];let w,S,C,P,O,k,T,I,F,j,B,V,q="middle";if(i==="top")k=this.bottom-v,T=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+v,T=this._getXAxisLabelAlignment();else if(i==="left"){const $=this._getYAxisLabelAlignment(g);T=$.textAlign,O=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(g);T=$.textAlign,O=$.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+p;else if(_t(i)){const $=Object.keys(i)[0],X=i[$];k=this.chart.scales[$].getPixelForValue(X)+p}T=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")O=(t.left+t.right)/2-p;else if(_t(i)){const $=Object.keys(i)[0],X=i[$];O=this.chart.scales[$].getPixelForValue(X)}T=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(l==="start"?q="top":l==="end"&&(q="bottom"));const J=this._getLabelSizes();for(w=0,S=a.length;w<S;++w){C=a[w],P=C.label;const $=o.setContext(this.getContext(w));I=this.getPixelForTick(w)+o.labelOffset,F=this._resolveTickFontOptions(w),j=F.lineHeight,B=Qt(P)?P.length:1;const X=B/2,W=$.color,ne=$.textStrokeColor,le=$.textStrokeWidth;let A=T;s?(O=I,T==="inner"&&(w===S-1?A=this.options.reverse?"left":"right":w===0?A=this.options.reverse?"right":"left":A="center"),i==="top"?c==="near"||b!==0?V=-B*j+j/2:c==="center"?V=-J.highest.height/2-X*j+j:V=-J.highest.height+j/2:c==="near"||b!==0?V=j/2:c==="center"?V=J.highest.height/2-X*j:V=J.highest.height-B*j,f&&(V*=-1),b!==0&&!$.showLabelBackdrop&&(O+=j/2*Math.sin(b))):(k=I,V=(1-B)*j/2);let H;if($.showLabelBackdrop){const re=Ln($.backdropPadding),R=J.heights[w],ue=J.widths[w];let xe=V-re.top,ge=0-re.left;switch(q){case"middle":xe-=R/2;break;case"bottom":xe-=R;break}switch(T){case"center":ge-=ue/2;break;case"right":ge-=ue;break;case"inner":w===S-1?ge-=ue:w>0&&(ge-=ue/2);break}H={left:ge,top:xe,width:ue+re.width,height:R+re.height,color:$.backdropColor}}x.push({label:P,font:F,textOffset:V,options:{rotation:b,color:W,strokeColor:ne,strokeWidth:le,textAlign:A,textBaseline:q,translation:[O,k],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-yi(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,d;return n==="left"?i?(d=this.right+o,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?i?(d=this.left+o,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,c,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o<s;++o){const l=i[o];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:i}}=this,o=r.setContext(this.getContext()),s=r.display?o.width:0;if(!s)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,f,g;this.isHorizontal()?(c=Js(t,this.left,s)-s/2,d=Js(t,this.right,a)+a/2,f=g=l):(f=Js(t,this.top,s)-s/2,g=Js(t,this.bottom,a)+a/2,c=d=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,f),n.lineTo(d,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&sh(r,i);const o=this.getLabelItems(t);for(const s of o){const a=s.options,l=s.font,c=s.label,d=s.textOffset;ea(r,c,0,d,l,a)}i&&ah(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=xn(r.font),s=Ln(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||_t(n)?(l+=s.bottom,Qt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:d,maxWidth:f,rotation:g}=T8(this,l,n,a);ea(t,r.text,0,0,o,{color:r.color,maxWidth:f,rotation:g,textAlign:M8(a,n,i),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=rt(t.grid&&t.grid.z,-1),i=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==aa.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o<s;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return xn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class wh{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;N8(n)&&(r=this.register(n));const i=this.items,o=t.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,A8(t,s,r),this.override&&an.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in an[i]&&(delete an[i][r],this.override&&delete Zs[r])}}function A8(e,t,n){const r=Li(Object.create(null),[n?an.get(n):{},an.get(t),e.defaults]);an.set(t,r),e.defaultRoutes&&I8(t,e.defaultRoutes),e.descriptors&&an.describe(t,e.descriptors)}function I8(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");an.route(o,i,l,a)})}function N8(e){return"id"in e&&"defaults"in e}class R8{constructor(){this.controllers=new wh(xi,"datasets",!0),this.elements=new wh(go,"elements"),this.plugins=new wh(Object,"plugins"),this.scales=new wh(aa,"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(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Nt(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=Qv(t);jt(r["before"+i],[],r),n[t](r),jt(r["after"+i],[],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 i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var $i=new R8;class L8{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,i){i=i||{};for(const o of t){const s=o.plugin,a=s[r],l=[n,i,o.options];if(jt(a,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){yt(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,i=rt(r.options&&r.options.plugins,{}),o=F8(r);return i===!1&&!n?[]:j8(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,s)=>o.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function F8(e){const t={},n=[],r=Object.keys($i.plugins.items);for(let o=0;o<r.length;o++)n.push($i.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const s=i[o];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function $8(e,t){return!t&&e===!1?null:e===!0?{}:e}function j8(e,{plugins:t,localIds:n},r,i){const o=[],s=e.getContext();for(const a of t){const l=a.id,c=$8(r[l],i);c!==null&&o.push({plugin:a,options:z8(e.config,{plugin:a,local:n[l]},c,s)})}return o}function z8(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),s=e.getOptionScopes(r,o);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function wb(e,t){const n=an.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function B8(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function V8(e,t){return e===t?"_index_":"_value_"}function dE(e){if(e==="x"||e==="y"||e==="r")return e}function H8(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function _b(e,...t){if(dE(e))return e;for(const n of t){const r=n.axis||H8(n.position)||e.length>1&&dE(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function fE(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function W8(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 fE(e,"x",n[0])||fE(e,"y",n[0])}return{}}function U8(e,t){const n=Zs[e.type]||{scales:{}},r=t.scales||{},i=wb(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!_t(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=_b(s,a,W8(s,e),an.scales[a.type]),c=V8(l,i),d=n.scales||{};o[s]=au(Object.create(null),[{axis:l},a,d[l],d[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||wb(a,t),d=(Zs[a]||{}).scales||{};Object.keys(d).forEach(f=>{const g=B8(f,l),p=s[g+"AxisID"]||g;o[p]=o[p]||Object.create(null),au(o[p],[{axis:g},r[p],d[f]])})}),Object.keys(o).forEach(s=>{const a=o[s];au(a,[an.scales[a.type],an.scale])}),o}function hE(e){const t=e.options||(e.options={});t.plugins=rt(t.plugins,{}),t.scales=U8(e,t)}function pE(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function q8(e){return e=e||{},e.data=pE(e.data),hE(e),e}const gE=new Map,mE=new Set;function _h(e,t){let n=gE.get(e);return n||(n=t(),gE.set(e,n),mE.add(n)),n}const Su=(e,t,n)=>{const r=Zo(t,n);r!==void 0&&e.add(r)};class G8{constructor(t){this._config=q8(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=pE(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(),hE(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 i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(f=>Su(l,t,f))),d.forEach(f=>Su(l,i,f)),d.forEach(f=>Su(l,Zs[o]||{},f)),d.forEach(f=>Su(l,an,f)),d.forEach(f=>Su(l,ib,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),mE.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Zs[n]||{},an.datasets[n]||{},{type:n},an,ib]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=vE(this._resolverCache,t,i);let l=s;if(K8(s,n)){o.$shared=!1,r=Jo(r)?r():r;const c=this.createResolver(t,r,a);l=wl(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=vE(this._resolverCache,t,r);return _t(n)?wl(o,n,void 0,i):o}}function vE(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:lb(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const Y8=e=>_t(e)&&Object.getOwnPropertyNames(e).some(t=>Jo(e[t]));function K8(e,t){const{isScriptable:n,isIndexable:r}=yC(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Jo(a)||Y8(a))||s&&Qt(a))return!0}return!1}var X8="4.4.1";const Q8=["top","bottom","left","right","chartArea"];function bE(e,t){return e==="top"||e==="bottom"||Q8.indexOf(e)===-1&&t==="x"}function yE(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function xE(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),jt(n&&n.onComplete,[e],t)}function Z8(e){const t=e.chart,n=t.options.animation;jt(n&&n.onProgress,[e],t)}function wE(e){return db()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Sh={},_E=e=>{const t=wE(e);return Object.values(Sh).filter(n=>n.canvas===t).pop()};function J8(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function e$(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Ch(e,t,n){return e.options.clip?e[n]:t[n]}function t$(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Ch(n,t,"left"),right:Ch(n,t,"right"),top:Ch(r,t,"top"),bottom:Ch(r,t,"bottom")}:t}class Zr{static register(...t){$i.add(...t),SE()}static unregister(...t){$i.remove(...t),SE()}constructor(t,n){const r=this.config=new G8(n),i=wE(t),o=_E(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||b8(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=r9(),this.ctx=a,this.canvas=l,this.width=d,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 L8,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=y9(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],Sh[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}po.listen(this,"complete",xE),po.listen(this,"progress",Z8),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return yt(t)?n&&o?o:i?r/i: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 $i}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():PC(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return mC(this.canvas,this.ctx),this}stop(){return po.stop(this),this}resize(t,n){po.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,PC(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),jt(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Nt(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=_b(s,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),Nt(o,s=>{const a=s.options,l=a.id,c=_b(l,a),d=rt(a.type,s.dtype);(a.position===void 0||bE(a.position,c)!==bE(s.dposition))&&(a.position=s.dposition),i[l]=!0;let f=null;if(l in r&&r[l].type===d)f=r[l];else{const g=$i.getScale(d);f=new g({id:l,type:d,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),Nt(i,(s,a)=>{s||delete r[a]}),Nt(r,s=>{qn.configure(this,s,s.options),qn.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(yE("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let s=this.getDatasetMeta(r);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=o.indexAxis||wb(a,this.options),s.order=o.order||0,s.index=r,s.label=""+o.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=$i.getController(a),{datasetElementType:c,dataElementType:d}=an.datasets[a];Object.assign(l,{dataElementType:$i.getElement(d),datasetElementType:c&&$i.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Nt(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()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:f}=this.getDatasetMeta(c),g=!i&&o.indexOf(f)===-1;f.buildOrUpdateElements(g),s=Math.max(+f.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||Nt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(yE("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Nt(this.scales,t=>{qn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ZS(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;J8(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!ZS(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;qn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Nt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),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,Jo(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(po.has(this)?this.attached&&!po.running(this)&&po.start(this):(this.draw(),xE({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),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 i,o;for(i=0,o=n.length;i<o;++i){const s=n[i];(!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,i=!r.disabled,o=t$(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&sh(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&ah(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ho(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=QF.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={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(i)),i}getContext(){return this.$context||(this.$context=ts(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 i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);lu(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i: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(),po.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(),mC(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Sh[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=(o,s)=>{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Nt(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Nt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Nt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!eh(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 i=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(f=>d.datasetIndex===f.datasetIndex&&d.index===f.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=c9(t),c=e$(t,this._lastEvent,r,l);r&&(this._lastEvent=null,jt(o.onHover,[t,a,this],this),l&&jt(o.onClick,[t,a,this],this));const d=!eh(a,i);return(d||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,d}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}Me(Zr,"defaults",an),Me(Zr,"instances",Sh),Me(Zr,"overrides",Zs),Me(Zr,"registry",$i),Me(Zr,"version",X8),Me(Zr,"getChart",_E);function SE(){return Nt(Zr.instances,e=>e._plugins.invalidate())}function n$(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:s,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(o,s,a,r-c,n+c),l>i?(c=i/l,e.arc(o,s,l,n+c,r-c,!0)):e.arc(o,s,i,n+pn,r-pn),e.closePath(),e.clip()}function r$(e){return ab(e,["outerStart","outerEnd","innerStart","innerEnd"])}function i$(e,t,n,r){const i=r$(e.options.borderRadius),o=(n-t)/2,s=Math.min(o,r*t/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return Dn(l,0,Math.min(o,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:Dn(i.innerStart,0,s),innerEnd:Dn(i.innerEnd,0,s)}}function Cl(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Eh(e,t,n,r,i,o){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,f=Math.max(t.outerRadius+r+n-c,0),g=d>0?d+r+n+c:0;let p=0;const v=i-l;if(r){const $=d>0?d-r:0,X=f>0?f-r:0,W=($+X)/2,ne=W!==0?v*W/(W+r):v;p=(v-ne)/2}const b=Math.max(.001,v*f-n/Zt)/f,x=(v-b)/2,w=l+x+p,S=i-x-p,{outerStart:C,outerEnd:P,innerStart:O,innerEnd:k}=i$(t,g,f,S-w),T=f-C,I=f-P,F=w+C/T,j=S-P/I,B=g+O,V=g+k,q=w+O/B,J=S-k/V;if(e.beginPath(),o){const $=(F+j)/2;if(e.arc(s,a,f,F,$),e.arc(s,a,f,$,j),P>0){const le=Cl(I,j,s,a);e.arc(le.x,le.y,P,j,S+pn)}const X=Cl(V,S,s,a);if(e.lineTo(X.x,X.y),k>0){const le=Cl(V,J,s,a);e.arc(le.x,le.y,k,S+pn,J+Math.PI)}const W=(S-k/g+(w+O/g))/2;if(e.arc(s,a,g,S-k/g,W,!0),e.arc(s,a,g,W,w+O/g,!0),O>0){const le=Cl(B,q,s,a);e.arc(le.x,le.y,O,q+Math.PI,w-pn)}const ne=Cl(T,w,s,a);if(e.lineTo(ne.x,ne.y),C>0){const le=Cl(T,F,s,a);e.arc(le.x,le.y,C,w-pn,F)}}else{e.moveTo(s,a);const $=Math.cos(F)*f+s,X=Math.sin(F)*f+a;e.lineTo($,X);const W=Math.cos(j)*f+s,ne=Math.sin(j)*f+a;e.lineTo(W,ne)}e.closePath()}function o$(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){Eh(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=s+(a%Jt||Jt))}return Eh(e,t,n,r,l,i),e.fill(),l}function s$(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:f,borderDashOffset:g}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=g,p?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let v=t.endAngle;if(o){Eh(e,t,n,r,v,i);for(let b=0;b<o;++b)e.stroke();isNaN(a)||(v=s+(a%Jt||Jt))}p&&n$(e,t,v),o||(Eh(e,t,n,r,v,i),e.stroke())}class El extends go{constructor(n){super();Me(this,"circumference");Me(this,"endAngle");Me(this,"fullCircles");Me(this,"innerRadius");Me(this,"outerRadius");Me(this,"pixelMargin");Me(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,i){const o=this.getProps(["x","y"],i),{angle:s,distance:a}=rC(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:f,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,b=rt(g,c-l)>=Jt||uu(s,l,c),x=uo(a,d+p,f+p);return b&&x}getCenterPoint(n){const{x:r,y:i,startAngle:o,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:d}=this.options,f=(o+s)/2,g=(a+l+d+c)/2;return{x:r+Math.cos(f)*g,y:i+Math.sin(f)*g}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,o=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>Jt?Math.floor(i/Jt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(Zt,i||0)),d=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,o$(n,this,d,s,a),s$(n,this,d,s,a),n.restore()}}Me(El,"id","arc"),Me(El,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Me(El,"defaultRoutes",{backgroundColor:"backgroundColor"}),Me(El,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function CE(e,t,n=t){e.lineCap=rt(n.borderCapStyle,t.borderCapStyle),e.setLineDash(rt(n.borderDash,t.borderDash)),e.lineDashOffset=rt(n.borderDashOffset,t.borderDashOffset),e.lineJoin=rt(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=rt(n.borderWidth,t.borderWidth),e.strokeStyle=rt(n.borderColor,t.borderColor)}function a$(e,t,n){e.lineTo(n.x,n.y)}function l$(e){return e.stepped?T9:e.tension||e.cubicInterpolationMode==="monotone"?A9:a$}function EE(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),d=i<s&&o<s||i>a&&o>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!d?r+c-l:c-l}}function c$(e,t,n,r){const{points:i,options:o}=t,{count:s,start:a,loop:l,ilen:c}=EE(i,n,r),d=l$(o);let{move:f=!0,reverse:g}=r||{},p,v,b;for(p=0;p<=c;++p)v=i[(a+(g?c-p:p))%s],!v.skip&&(f?(e.moveTo(v.x,v.y),f=!1):d(e,b,v,g,o.stepped),b=v);return l&&(v=i[(a+(g?c:0))%s],d(e,b,v,g,o.stepped)),!!l}function u$(e,t,n,r){const i=t.points,{count:o,start:s,ilen:a}=EE(i,n,r),{move:l=!0,reverse:c}=r||{};let d=0,f=0,g,p,v,b,x,w;const S=P=>(s+(c?a-P:P))%o,C=()=>{b!==x&&(e.lineTo(d,x),e.lineTo(d,b),e.lineTo(d,w))};for(l&&(p=i[S(0)],e.moveTo(p.x,p.y)),g=0;g<=a;++g){if(p=i[S(g)],p.skip)continue;const P=p.x,O=p.y,k=P|0;k===v?(O<b?b=O:O>x&&(x=O),d=(f*d+P)/++f):(C(),e.lineTo(P,O),v=k,f=0,b=x=O),w=O}C()}function Sb(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?u$:c$}function d$(e){return e.stepped?uF:e.tension||e.cubicInterpolationMode==="monotone"?dF:ia}function f$(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),CE(e,t.options),e.stroke(i)}function h$(e,t,n,r){const{segments:i,options:o}=t,s=Sb(t);for(const a of i)CE(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const p$=typeof Path2D=="function";function g$(e,t,n,r){p$&&!t.options.segment?f$(e,t,n,r):h$(e,t,n,r)}class ns extends go{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 i=r.spanGaps?this._loop:this._fullLoop;nF(this._points,r,t,i,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=vF(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,i=t[n],o=this.points,s=NC(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=d$(r);let c,d;for(c=0,d=s.length;c<d;++c){const{start:f,end:g}=s[c],p=o[f],v=o[g];if(p===v){a.push(p);continue}const b=Math.abs((i-p[n])/(v[n]-p[n])),x=l(p,v,b,r.stepped);x[n]=t[n],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,n,r){return Sb(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=Sb(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)s&=o(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),g$(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Me(ns,"id","line"),Me(ns,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Me(ns,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Me(ns,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function OE(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class Cu extends go{constructor(n){super();Me(this,"parsed");Me(this,"skip");Me(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,i){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,r){return OE(this,n,"x",r)}inYRange(n,r){return OE(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!ho(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,sb(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Me(Cu,"id","point"),Me(Cu,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Me(Cu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function PE(e,t){const{x:n,y:r,base:i,width:o,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,d,f;return e.horizontal?(f=s/2,a=Math.min(n,i),l=Math.max(n,i),c=r-f,d=r+f):(f=o/2,a=n-f,l=n+f,c=Math.min(r,i),d=Math.max(r,i)),{left:a,top:c,right:l,bottom:d}}function rs(e,t,n,r){return e?0:Dn(t,n,r)}function m$(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=bC(r);return{t:rs(i.top,o.top,0,n),r:rs(i.right,o.right,0,t),b:rs(i.bottom,o.bottom,0,n),l:rs(i.left,o.left,0,t)}}function v$(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=ta(i),s=Math.min(t,n),a=e.borderSkipped,l=r||_t(i);return{topLeft:rs(!l||a.top||a.left,o.topLeft,0,s),topRight:rs(!l||a.top||a.right,o.topRight,0,s),bottomLeft:rs(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:rs(!l||a.bottom||a.right,o.bottomRight,0,s)}}function b$(e){const t=PE(e),n=t.right-t.left,r=t.bottom-t.top,i=m$(e,n/2,r/2),o=v$(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function Cb(e,t,n,r){const i=t===null,o=n===null,a=e&&!(i&&o)&&PE(e,r);return a&&(i||uo(t,a.left,a.right))&&(o||uo(n,a.top,a.bottom))}function y$(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function x$(e,t){e.rect(t.x,t.y,t.w,t.h)}function Eb(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+s,radius:e.radius}}class Eu extends go{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:i}}=this,{inner:o,outer:s}=b$(this),a=y$(s.radius)?pu:x$;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,Eb(s,n,o)),t.clip(),a(t,Eb(o,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Eb(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return Cb(this,t,n,r)}inXRange(t,n){return Cb(this,t,null,n)}inYRange(t,n){return Cb(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Me(Eu,"id","bar"),Me(Eu,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Me(Eu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var w$=Object.freeze({__proto__:null,ArcElement:El,BarElement:Eu,LineElement:ns,PointElement:Cu});const Ob=["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)"],kE=Ob.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function DE(e){return Ob[e%Ob.length]}function ME(e){return kE[e%kE.length]}function _$(e,t){return e.borderColor=DE(t),e.backgroundColor=ME(t),++t}function S$(e,t){return e.backgroundColor=e.data.map(()=>DE(t++)),t}function C$(e,t){return e.backgroundColor=e.data.map(()=>ME(t++)),t}function E$(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof oa?t=S$(n,t):i instanceof mu?t=C$(n,t):i&&(t=_$(n,t))}}function TE(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function O$(e){return e&&(e.borderColor||e.backgroundColor)}var P$={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:o}=i;if(!n.forceOverride&&(TE(r)||O$(i)||o&&TE(o)))return;const s=E$(e);r.forEach(s)}};function k$(e,t,n,r,i){const o=i.samples||r;if(o>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let d=t,f,g,p,v,b;for(s[l++]=e[d],f=0;f<o-2;f++){let x=0,w=0,S;const C=Math.floor((f+1)*a)+1+t,P=Math.min(Math.floor((f+2)*a)+1,n)+t,O=P-C;for(S=C;S<P;S++)x+=e[S].x,w+=e[S].y;x/=O,w/=O;const k=Math.floor(f*a)+1+t,T=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:I,y:F}=e[d];for(p=v=-1,S=k;S<T;S++)v=.5*Math.abs((I-x)*(e[S].y-F)-(I-e[S].x)*(w-F)),v>p&&(p=v,g=e[S],b=S);s[l++]=g,d=b}return s[l++]=e[c],s}function D$(e,t,n,r){let i=0,o=0,s,a,l,c,d,f,g,p,v,b;const x=[],w=t+n-1,S=e[t].x,P=e[w].x-S;for(s=t;s<t+n;++s){a=e[s],l=(a.x-S)/P*r,c=a.y;const O=l|0;if(O===d)c<v?(v=c,f=s):c>b&&(b=c,g=s),i=(o*i+a.x)/++o;else{const k=s-1;if(!yt(f)&&!yt(g)){const T=Math.min(f,g),I=Math.max(f,g);T!==p&&T!==k&&x.push({...e[T],x:i}),I!==p&&I!==k&&x.push({...e[I],x:i})}s>0&&k!==p&&x.push(e[k]),x.push(a),d=O,o=0,v=b=c,f=g=p=s}}return x}function AE(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 IE(e){e.data.datasets.forEach(t=>{AE(t)})}function M$(e,t){const n=t.length;let r=0,i;const{iScale:o}=e,{min:s,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=Dn(fo(t,o.axis,s).lo,0,n-1)),c?i=Dn(fo(t,o.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var T$={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){IE(e);return}const r=e.width;e.data.datasets.forEach((i,o)=>{const{_data:s,indexAxis:a}=i,l=e.getDatasetMeta(o),c=s||i.data;if(en([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:f,count:g}=M$(l,c);const p=n.threshold||4*r;if(g<=p){AE(i);return}yt(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let v;switch(n.algorithm){case"lttb":v=k$(c,f,g,r,n);break;case"min-max":v=D$(c,f,g,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=v})},destroy(e){IE(e)}};function A$(e,t,n){const r=e.segments,i=e.points,o=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=kb(l,c,i);const d=Pb(n,i[l],i[c],a.loop);if(!t.segments){s.push({source:a,target:d,start:i[l],end:i[c]});continue}const f=NC(t,d);for(const g of f){const p=Pb(n,o[g.start],o[g.end],g.loop),v=IC(a,i,p);for(const b of v)s.push({source:b,target:g,start:{[n]:NE(d,p,"start",Math.max)},end:{[n]:NE(d,p,"end",Math.min)}})}}return s}function Pb(e,t,n,r){if(r)return;let i=t[e],o=n[e];return e==="angle"&&(i=Pr(i),o=Pr(o)),{property:e,start:i,end:o}}function I$(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=kb(s,a,i);const l=i[s],c=i[a];r!==null?(o.push({x:l.x,y:r}),o.push({x:c.x,y:r})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function kb(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function NE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function RE(e,t){let n=[],r=!1;return Qt(e)?(r=!0,n=e):n=I$(e,t),n.length?new ns({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function LE(e){return e&&e.fill!==!1}function N$(e,t,n){let i=e[t].fill;const o=[t];let s;if(!n)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!fn(i))return i;if(s=e[i],!s)return!1;if(s.visible)return i;o.push(i),i=s.fill}return!1}function R$(e,t,n){const r=j$(e);if(_t(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return fn(i)&&Math.floor(i)===i?L$(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function L$(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function F$(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:_t(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function $$(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:_t(e)?r=e.value:r=t.getBaseValue(),r}function j$(e){const t=e.options,n=t.fill;let r=rt(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function z$(e){const{scale:t,index:n,line:r}=e,i=[],o=r.segments,s=r.points,a=B$(t,n);a.push(RE({x:null,y:t.bottom},r));for(let l=0;l<o.length;l++){const c=o[l];for(let d=c.start;d<=c.end;d++)V$(i,s[d],a)}return new ns({points:i,options:{}})}function B$(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const o=r[i];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function V$(e,t,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:s,last:a,point:l}=H$(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function H$(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],o=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const d=o[c],f=s[d.start][n],g=s[d.end][n];if(uo(i,f,g)){a=i===f,l=i===g;break}}return{first:a,last:l,point:r}}class FE{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:o,radius:s}=this;return n=n||{start:0,end:Jt},t.arc(i,o,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,o=t.angle;return{x:n+Math.cos(o)*i,y:r+Math.sin(o)*i,angle:o}}}function W$(e){const{chart:t,fill:n,line:r}=e;if(fn(n))return U$(t,n);if(n==="stack")return z$(e);if(n==="shape")return!0;const i=q$(e);return i instanceof FE?i:RE(i,r)}function U$(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function q$(e){return(e.scale||{}).getPointPositionForValue?Y$(e):G$(e)}function G$(e){const{scale:t={},fill:n}=e,r=F$(n,t);if(fn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function Y$(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,o=r.reverse?t.max:t.min,s=$$(n,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new FE({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,s));return a}function Db(e,t,n){const r=W$(t),{line:i,scale:o,axis:s}=t,a=i.options,l=a.fill,c=a.backgroundColor,{above:d=c,below:f=c}=l||{};r&&i.points.length&&(sh(e,n),K$(e,{line:i,target:r,above:d,below:f,area:n,scale:o,axis:s}),ah(e))}function K$(e,t){const{line:n,target:r,above:i,below:o,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&o!==i&&($E(e,r,s.top),jE(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),$E(e,r,s.bottom)),jE(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore()}function $E(e,t,n){const{segments:r,points:i}=t;let o=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,d=i[l],f=i[kb(l,c,i)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.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 jE(e,t){const{line:n,target:r,property:i,color:o,scale:s}=t,a=A$(n,r,i);for(const{source:l,target:c,start:d,end:f}of a){const{style:{backgroundColor:g=o}={}}=l,p=r!==!0;e.save(),e.fillStyle=g,X$(e,s,p&&Pb(i,d,f)),e.beginPath();const v=!!n.pathSegment(e,l);let b;if(p){v?e.closePath():zE(e,r,f,i);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});b=v&&x,b||zE(e,r,d,i)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function X$(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:o,start:s,end:a}=n||{};o==="x"&&(e.beginPath(),e.rect(s,r,a-s,i-r),e.clip())}function zE(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Q$={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let o,s,a,l;for(s=0;s<r;++s)o=e.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof ns&&(l={visible:e.isDatasetVisible(s),index:s,fill:R$(a,s,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=N$(i,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let s=i.length-1;s>=0;--s){const a=i[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&Db(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const o=r[i].$filler;LE(o)&&Db(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!LE(r)||n.drawTime!=="beforeDatasetDraw"||Db(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const BE=(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)}},Z$=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class VE extends go{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=jt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,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,i=xn(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=BE(r,o);let c,d;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(s,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(s,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=i+a;let f=t;o.textAlign="left",o.textBaseline="middle";let g=-1,p=-d;return this.legendItems.forEach((v,b)=>{const x=r+n/2+o.measureText(v.text).width;(b===0||c[c.length-1]+x+2*a>s)&&(f+=d,c[c.length-(b>0?0:1)]=0,p+=d,g++),l[b]={left:0,top:p,row:g,width:x,height:i},c[c.length-1]+=x+a}),f}_fitCols(t,n,r,i){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=s-t;let f=a,g=0,p=0,v=0,b=0;return this.legendItems.forEach((x,w)=>{const{itemWidth:S,itemHeight:C}=J$(r,n,o,x,i);w>0&&p+C+2*a>d&&(f+=g+a,c.push({width:g,height:p}),v+=g+a,b++,g=p=0),l[w]={left:v,top:p,col:b,width:S,height:C},g=Math.max(g,S),p+=C+a}),f+=g,c.push({width:g,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,s=Sl(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Un(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Un(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let a=0,l=Un(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Un(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;sh(t,this),this._draw(),ah(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=an.color,l=Sl(t.rtl,this.left,this.width),c=xn(s.font),{padding:d}=s,f=c.size,g=f/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:v,boxHeight:b,itemHeight:x}=BE(s,f),w=function(k,T,I){if(isNaN(v)||v<=0||isNaN(b)||b<0)return;i.save();const F=rt(I.lineWidth,1);if(i.fillStyle=rt(I.fillStyle,a),i.lineCap=rt(I.lineCap,"butt"),i.lineDashOffset=rt(I.lineDashOffset,0),i.lineJoin=rt(I.lineJoin,"miter"),i.lineWidth=F,i.strokeStyle=rt(I.strokeStyle,a),i.setLineDash(rt(I.lineDash,[])),s.usePointStyle){const j={radius:b*Math.SQRT2/2,pointStyle:I.pointStyle,rotation:I.rotation,borderWidth:F},B=l.xPlus(k,v/2),V=T+g;vC(i,j,B,V,s.pointStyleWidth&&v)}else{const j=T+Math.max((f-b)/2,0),B=l.leftForLtr(k,v),V=ta(I.borderRadius);i.beginPath(),Object.values(V).some(q=>q!==0)?pu(i,{x:B,y:j,w:v,h:b,radius:V}):i.rect(B,j,v,b),i.fill(),F!==0&&i.stroke()}i.restore()},S=function(k,T,I){ea(i,I.text,k,T+x/2,c,{strikethrough:I.hidden,textAlign:l.textAlign(I.textAlign)})},C=this.isHorizontal(),P=this._computeTitleHeight();C?p={x:Un(o,this.left+d,this.right-r[0]),y:this.top+d+P,line:0}:p={x:this.left+d,y:Un(o,this.top+P+d,this.bottom-n[0].height),line:0},DC(this.ctx,t.textDirection);const O=x+d;this.legendItems.forEach((k,T)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const I=i.measureText(k.text).width,F=l.textAlign(k.textAlign||(k.textAlign=s.textAlign)),j=v+g+I;let B=p.x,V=p.y;l.setWidth(this.width),C?T>0&&B+j+d>this.right&&(V=p.y+=O,p.line++,B=p.x=Un(o,this.left+d,this.right-r[p.line])):T>0&&V+O>this.bottom&&(B=p.x=B+n[p.line].width+d,p.line++,V=p.y=Un(o,this.top+P+d,this.bottom-n[p.line].height));const q=l.x(B);if(w(q,V,k),B=x9(F,B+v+g,C?B+j:this.right,t.rtl),S(l.x(B),V,k),C)p.x+=j+d;else if(typeof k.text!="string"){const J=c.lineHeight;p.y+=HE(k,J)+d}else p.y+=O}),MC(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=xn(n.font),i=Ln(n.padding);if(!n.display)return;const o=Sl(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let d,f=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),d=this.top+c,f=Un(t.align,f,this.right-g);else{const v=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);d=c+Un(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const p=Un(a,f,f+g);s.textAlign=o.textAlign(tb(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,ea(s,n.text,p,d,r)}_computeTitleHeight(){const t=this.options.title,n=xn(t.font),r=Ln(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(uo(t,this.left,this.right)&&uo(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],uo(t,i.left,i.left+i.width)&&uo(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!nj(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=Z$(i,r);i&&!o&&jt(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&jt(n.onHover,[t,r,this],this)}else r&&jt(n.onClick,[t,r,this],this)}}function J$(e,t,n,r,i){const o=ej(r,e,t,n),s=tj(i,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function ej(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,s)=>o.length>s.length?o:s)),t+n.size/2+r.measureText(i).width}function tj(e,t,n){let r=e;return typeof t.text!="string"&&(r=HE(t,n)),r}function HE(e,t){const n=e.text?e.text.length:0;return t*n}function nj(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var rj={id:"legend",_element:VE,start(e,t,n){const r=e.legend=new VE({ctx:e.ctx,options:n,chart:e});qn.configure(e,r,n),qn.addBox(e,r)},stop(e){qn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;qn.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,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.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:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=Ln(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||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 Mb extends go{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 i=Qt(r.text)?r.text.length:1;this._padding=Ln(r.padding);const o=i*xn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:o,options:s}=this,a=s.align;let l=0,c,d,f;return this.isHorizontal()?(d=Un(a,r,o),f=n+t,c=o-r):(s.position==="left"?(d=r+t,f=Un(a,i,n),l=Zt*-.5):(d=o-t,f=Un(a,n,i),l=Zt*.5),c=i-n),{titleX:d,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=xn(n.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);ea(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:tb(n.align),textBaseline:"middle",translation:[s,a]})}}function ij(e,t){const n=new Mb({ctx:e.ctx,options:t,chart:e});qn.configure(e,n,t),qn.addBox(e,n),e.titleBlock=n}var oj={id:"title",_element:Mb,start(e,t,n){ij(e,n)},stop(e){const t=e.titleBlock;qn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;qn.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 Oh=new WeakMap;var sj={id:"subtitle",start(e,t,n){const r=new Mb({ctx:e.ctx,options:n,chart:e});qn.configure(e,r,n),qn.addBox(e,r),Oh.set(e,r)},stop(e){qn.removeBox(e,Oh.get(e)),Oh.delete(e)},beforeUpdate(e,t,n){const r=Oh.get(e);qn.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 Ou={average(e){if(!e.length)return!1;let t,n,r=0,i=0,o=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,i+=a.y,++o}}return{x:r/o,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=e.length;o<s;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=Jv(t,c);d<i&&(i=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function ji(e,t){return t&&(Qt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function mo(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
121
+ */class xF{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.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=aC.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.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,i)=>Math.max(r,i._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 i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var po=new xF;const FC="transparent",wF={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=hC(e||FC),i=r.valid&&hC(t||FC);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class _F{constructor(t,n,r,i){const o=n[r];i=en([t.to,i,o,t.from]);const s=en([t.from,o,i]);this._active=!0,this._fn=t.fn||wF[t.type||typeof s],this._easing=du[t.easing]||du.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=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=en([t.to,n,i,t.from]),this._from=en([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,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 i=0;i<r.length;i++)r[i][n]()}}class $C{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!_t(t))return;const n=Object.keys(an.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!_t(o))return;const s={};for(const a of n)s[a]=o[a];(Qt(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=CF(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&SF(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=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"){i.push(...this._animateOptions(t,n));continue}const d=n[c];let f=o[c];const g=r.get(c);if(f)if(g&&f.active()){f.update(g,d,a);continue}else f.cancel();if(!g||!g.duration){t[c]=d;continue}o[c]=f=new _F(g,t,c,d),i.push(f)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return po.add(this._chart,r),!0}}function SF(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function CF(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 jC(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function EF(e,t,n){if(n===!1)return!1;const r=jC(e,n),i=jC(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function OF(e){let t,n,r,i;return _t(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function zC(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function BC(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let s,a,l,c;if(t!==null){for(s=0,a=i.length;s<a;++s){if(l=+i[s],l===n){if(r.all)continue;break}c=e.values[l],fn(c)&&(o||t===0||Fi(t)===Fi(c))&&(t+=c)}return t}}function PF(e){const t=Object.keys(e),n=new Array(t.length);let r,i,o;for(r=0,i=t.length;r<i;++r)o=t[r],n[r]={x:o,y:e[o]};return n}function VC(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function kF(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function DF(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function MF(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function HC(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function WC(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,d=kF(o,s,r),f=t.length;let g;for(let p=0;p<f;++p){const v=t[p],{[l]:b,[c]:x}=v,w=v._stacks||(v._stacks={});g=w[c]=MF(i,d,b),g[a]=x,g._top=HC(g,s,!0,r.type),g._bottom=HC(g,s,!1,r.type);const S=g._visualValues||(g._visualValues={});S[a]=x}}function hb(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function TF(e,t){return ts(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function AF(e,t,n){return ts(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function gu(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const pb=e=>e==="reset"||e==="none",UC=(e,t)=>t?e:Object.assign({},e),IF=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:zC(n,!0),values:null};class xi{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=VC(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&&gu(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(f,g,p,v)=>f==="x"?g:f==="r"?v:p,o=n.xAxisID=rt(r.xAxisID,hb(t,"x")),s=n.yAxisID=rt(r.yAxisID,hb(t,"y")),a=n.rAxisID=rt(r.rAxisID,hb(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),d=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&oC(this._data,this),t._stacked&&gu(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(_t(n))this._data=PF(n);else if(r!==n){if(r){oC(r,this);const i=this._cachedMeta;gu(i),i._parsed=[]}n&&Object.isExtensible(n)&&b9(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 i=!1;this._dataCheck();const o=n._stacked;n._stacked=VC(n.vScale,n),n.stack!==r.stack&&(i=!0,gu(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&WC(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:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],d,f,g;if(this._parsing===!1)r._parsed=i,r._sorted=!0,g=i;else{Qt(i[t])?g=this.parseArrayData(r,i,t,n):_t(i[t])?g=this.parseObjectData(r,i,t,n):g=this.parsePrimitiveData(r,i,t,n);const p=()=>f[a]===null||c&&f[a]<c[a];for(d=0;d<n;++d)r._parsed[d+t]=f=g[d],l&&(p()&&(l=!1),c=f);r._sorted=l}s&&WC(this,g)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:s}=t,a=o.axis,l=s.axis,c=o.getLabels(),d=o===s,f=new Array(i);let g,p,v;for(g=0,p=i;g<p;++g)v=g+r,f[g]={[a]:d||o.parse(c[v],v),[l]:s.parse(n[v],v)};return f}parseArrayData(t,n,r,i){const{xScale:o,yScale:s}=t,a=new Array(i);let l,c,d,f;for(l=0,c=i;l<c;++l)d=l+r,f=n[d],a[l]={x:o.parse(f[0],d),y:s.parse(f[1],d)};return a}parseObjectData(t,n,r,i){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let d,f,g,p;for(d=0,f=i;d<f;++d)g=d+r,p=n[g],c[d]={x:o.parse(Zo(p,a),g),y:s.parse(Zo(p,l),g)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,s=n[t.axis],a={keys:zC(i,!0),values:n._stacks[t.axis]._visualValues};return BC(a,s,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let s=o===null?NaN:o;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,s=BC(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,s=i.length,a=this._getOtherScale(t),l=IF(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=DF(a);let g,p;function v(){p=i[g];const b=p[a.axis];return!fn(p[t.axis])||d>b||f<b}for(g=0;g<s&&!(!v()&&(this.updateRangeFromParsed(c,t,p,l),o));++g);if(o){for(g=s-1;g>=0;--g)if(!v()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i<o;++i)s=n[i][t.axis],fn(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=OF(rt(this.options.clip,EF(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(t,o,a,l),d=a;d<a+l;++d){const f=i[d];f.hidden||(f.active&&c?s.push(f):f.draw(t,o))}for(d=0;d<s.length;++d)s[d].draw(t,o)}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 i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];o=s.$context||(s.$context=AF(this.getContext(),t,s)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=TF(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}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 i=n==="active",o=this._cachedDataOpts,s=t+"-"+n,a=o[s],l=this.enableOptionSharing&&lu(r);if(a)return UC(a,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],g=c.getOptionScopes(this.getDataset(),d),p=Object.keys(an.elements[t]),v=()=>this.getContext(r,i,n),b=c.resolveNamedOptions(g,p,v,f);return b.$shared&&(b.$shared=l,o[s]=Object.freeze(UC(b,l))),b}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.options.animation!==!1){const d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,n),g=d.getOptionScopes(this.getDataset(),f);l=d.createResolver(g,this.getContext(t,r,n))}const c=new $C(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||pb(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){pb(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!pb(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}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 i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.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(o),a=t;a<s;++a)o[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&gu(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}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])}}Me(xi,"defaults",{}),Me(xi,"datasetElementType",null),Me(xi,"dataElementType",null);function NF(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=sC(r.sort((i,o)=>i-o))}return e._cache.$bar}function RF(e){const t=e.iScale,n=NF(t,e.type);let r=t._length,i,o,s,a;const l=()=>{s===32767||s===-32768||(lu(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(i=0,o=n.length;i<o;++i)s=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=t.ticks.length;i<o;++i)s=t.getPixelForTick(i),l();return r}function LF(e,t,n,r){const i=n.barThickness;let o,s;return yt(i)?(o=t.min*n.categoryPercentage,s=n.barPercentage):(o=i*r,s=1),{chunk:o/r,ratio:s,start:t.pixels[e]-o/2}}function FF(e,t,n,r){const i=t.pixels,o=i[e];let s=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;s===null&&(s=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-s);const c=o-(o-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function $F(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),s=Math.min(i,o),a=Math.max(i,o);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:i,end:o,min:s,max:a}}function qC(e,t,n,r){return Qt(e)?$F(e,t,n,r):t[n.axis]=n.parse(e,r),t}function GC(e,t,n,r){const i=e.iScale,o=e.vScale,s=i.getLabels(),a=i===o,l=[];let c,d,f,g;for(c=n,d=n+r;c<d;++c)g=t[c],f={},f[i.axis]=a||i.parse(s[c],c),l.push(qC(g,f,o,c));return l}function gb(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function jF(e,t,n){return e!==0?Fi(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function zF(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function BF(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:d}=zF(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=d:(o[YC(d,s,a,l)]=!0,i=c)),o[YC(i,s,a,l)]=!0,e.borderSkipped=o}function YC(e,t,n,r){return r?(e=VF(e,t,n),e=KC(e,n,t)):e=KC(e,t,n),e}function VF(e,t,n){return e===t?n:e===n?t:e}function KC(e,t,n){return e==="start"?t:e==="end"?n:e}function HF(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class fh extends xi{parsePrimitiveData(t,n,r,i){return GC(t,n,r,i)}parseArrayData(t,n,r,i){return GC(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,d=s.axis==="x"?a:l,f=[];let g,p,v,b;for(g=r,p=r+i;g<p;++g)b=n[g],v={},v[o.axis]=o.parse(Zo(b,c),g),f.push(qC(Zo(b,d),v,s,g));return f}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),s=o._custom,a=gb(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[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,i){const o=i==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:f,includeOptions:g}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const v=this.getParsed(p),b=o||yt(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),x=this._calculateBarIndexPixels(p,d),w=(v._stacks||{})[a.axis],S={horizontal:c,base:b.base,enableBorderRadius:!w||gb(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};g&&(S.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const C=S.options||t[p].options;BF(S,C,w,s),HF(S,C,d.ratio),this.updateElement(t[p],p,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=r.options.stacked,s=[],a=l=>{const c=l.controller.getParsed(n),d=c&&c[l.vScale.axis];if(yt(d)||isNaN(d))return!0};for(const l of i)if(!(n!==void 0&&a(l))&&((o===!1||s.indexOf(l.stack)===-1||o===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 i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,s;for(o=0,s=n.data.length;o<s;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||RF(n),pixels:i,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:i},options:{base:o,minBarLength:s}}=this,a=o||0,l=this.getParsed(t),c=l._custom,d=gb(c);let f=l[n.axis],g=0,p=r?this.applyStack(n,l,r):f,v,b;p!==f&&(g=p-f,p=f),d&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&Fi(f)!==Fi(c.barEnd)&&(g=0),g+=f);const x=!yt(o)&&!d?o:g;let w=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(g+p):v=w,b=v-w,Math.abs(b)<s){b=jF(b,n,a)*s,f===a&&(w-=b/2);const S=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),P=Math.min(S,C),O=Math.max(S,C);w=Math.max(Math.min(w,O),P),v=w+b,r&&!d&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(v)-n.getValueForPixel(w))}if(w===n.getPixelForValue(a)){const S=Fi(b)*n.getLineWidthForValue(a)/2;w+=S,b-=S}return{size:b,base:w,head:v,center:v+b/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,s=rt(i.maxBarThickness,1/0);let a,l;if(n.grouped){const c=o?this._getStackCount(t):n.stackCount,d=i.barThickness==="flex"?FF(t,n,i,c):LF(t,n,i,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=d.start+d.chunk*f+d.chunk/2,l=Math.min(s,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&r[o].draw(this._ctx)}}Me(fh,"id","bar"),Me(fh,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Me(fh,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class hh extends xi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const o=super.parsePrimitiveData(t,n,r,i);for(let s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+r).radius;return o}parseArrayData(t,n,r,i){const o=super.parseArrayData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=rt(a[2],this.resolveDataElementOptions(s+r).radius)}return o}parseObjectData(t,n,r,i){const o=super.parseObjectData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=rt(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return o}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:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.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,i){const o=i==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),d=s.axis,f=a.axis;for(let g=n;g<n+r;g++){const p=t[g],v=!o&&this.getParsed(g),b={},x=b[d]=o?s.getPixelForDecimal(.5):s.getPixelForValue(v[d]),w=b[f]=o?a.getBasePixel():a.getPixelForValue(v[f]);b.skip=isNaN(x)||isNaN(w),c&&(b.options=l||this.resolveDataElementOptions(g,p.active?"active":i),o&&(b.options.radius=0)),this.updateElement(p,g,b,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return n!=="active"&&(i.radius=0),i.radius+=rt(r&&r._custom,o),i}}Me(hh,"id","bubble"),Me(hh,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Me(hh,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function WF(e,t,n){let r=1,i=1,o=0,s=0;if(t<Jt){const a=e,l=a+t,c=Math.cos(a),d=Math.sin(a),f=Math.cos(l),g=Math.sin(l),p=(C,P,O)=>uu(C,a,l,!0)?1:Math.max(P,P*n,O,O*n),v=(C,P,O)=>uu(C,a,l,!0)?-1:Math.min(P,P*n,O,O*n),b=p(0,c,f),x=p(pn,d,g),w=v(Zt,c,f),S=v(Zt+pn,d,g);r=(b-w)/2,i=(x-S)/2,o=-(b+w)/2,s=-(x+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}class oa extends xi{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,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(_t(r[t])){const{key:l="value"}=this._parsing;o=c=>+Zo(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)i._parsed[s]=o(s)}}_getRotation(){return yi(this.options.rotation-90)}_getCircumference(){return yi(this.options.circumference)}_getRotationExtents(){let t=Jt,n=-Jt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),s=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(i9(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:g,ratioY:p,offsetX:v,offsetY:b}=WF(f,d,l),x=(r.width-s)/g,w=(r.height-s)/p,S=Math.max(Math.min(x,w)/2,0),C=KS(this.options.radius,S),P=Math.max(C*l,0),O=(C-P)/this._getVisibleDatasetWeightTotal();this.offsetX=v*C,this.offsetY=b*C,i.total=this.calculateTotal(),this.outerRadius=C-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/Jt)}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,d=(a.left+a.right)/2,f=(a.top+a.bottom)/2,g=o&&c.animateScale,p=g?0:this.innerRadius,v=g?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(n,i);let w=this._getRotation(),S;for(S=0;S<n;++S)w+=this._circumference(S,o);for(S=n;S<n+r;++S){const C=this._circumference(S,o),P=t[S],O={x:d+this.offsetX,y:f+this.offsetY,startAngle:w,endAngle:w+C,circumference:C,outerRadius:v,innerRadius:p};x&&(O.options=b||this.resolveDataElementOptions(S,P.active?"active":i)),w+=C,this.updateElement(P,S,O,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Jt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=fu(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,s,a,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,a=s.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.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(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Me(oa,"id","doughnut"),Me(oa,"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"}),Me(oa,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Me(oa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,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 ph extends xi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=cC(n,i,s);this._drawStart=a,this._drawCount=l,uC(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;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(i,a,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,i),g=s.axis,p=a.axis,{spanGaps:v,segment:b}=this.options,x=xl(v)?v:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||i==="none",S=n+r,C=t.length;let P=n>0&&this.getParsed(n-1);for(let O=0;O<C;++O){const k=t[O],T=w?k:{};if(O<n||O>=S){T.skip=!0;continue}const I=this.getParsed(O),F=yt(I[p]),j=T[g]=s.getPixelForValue(I[g],O),B=T[p]=o||F?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,I,l):I[p],O);T.skip=isNaN(j)||isNaN(B)||F,T.stop=O>0&&Math.abs(I[g]-P[g])>x,b&&(T.parsed=I,T.raw=c.data[O]),f&&(T.options=d||this.resolveDataElementOptions(O,k.active?"active":i)),w||this.updateElement(k,O,T,i),P=I}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Me(ph,"id","line"),Me(ph,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Me(ph,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class mu extends xi{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=fu(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,r,i){return EC.bind(this)(t,n,r,i)}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,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-s)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,f=c.yCenter,g=c.getIndexAngle(0)-.5*Zt;let p=g,v;const b=360/this.countVisibleElements();for(v=0;v<n;++v)p+=this._computeAngle(v,i,b);for(v=n;v<n+r;v++){const x=t[v];let w=p,S=p+this._computeAngle(v,i,b),C=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;p=S,o&&(l.animateScale&&(C=0),l.animateRotate&&(w=S=g));const P={x:d,y:f,innerRadius:0,outerRadius:C,startAngle:w,endAngle:S,options:this.resolveDataElementOptions(v,x.active?"active":i)};this.updateElement(x,v,P,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?yi(this.resolveDataElementOptions(t,n).angle||r):0}}Me(mu,"id","polarArea"),Me(mu,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Me(mu,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,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 mb extends oa{}Me(mb,"id","pie"),Me(mb,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class gh extends xi{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,i){return EC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const o=this._cachedMeta.rScale,s=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),d=o.getPointPositionForValue(a,this.getParsed(a).r),f=s?o.xCenter:d.x,g=s?o.yCenter:d.y,p={x:f,y:g,angle:d.angle,skip:isNaN(f)||isNaN(g),options:c};this.updateElement(l,a,p,i)}}}Me(gh,"id","radar"),Me(gh,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Me(gh,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class mh extends xi{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:o,count:s}=cC(n,r,i);if(this._drawStart=o,this._drawCount=s,uC(n)&&(o=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:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(d),g=this.includeOptions(i,f),p=s.axis,v=a.axis,{spanGaps:b,segment:x}=this.options,w=xl(b)?b:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||o||i==="none";let C=n>0&&this.getParsed(n-1);for(let P=n;P<n+r;++P){const O=t[P],k=this.getParsed(P),T=S?O:{},I=yt(k[v]),F=T[p]=s.getPixelForValue(k[p],P),j=T[v]=o||I?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[v],P);T.skip=isNaN(F)||isNaN(j)||I,T.stop=P>0&&Math.abs(k[p]-C[p])>w,x&&(T.parsed=k,T.raw=c.data[P]),g&&(T.options=f||this.resolveDataElementOptions(P,O.active?"active":i)),S||this.updateElement(O,P,T,i),C=k}this.updateSharedOptions(f,i,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,s)/2}}Me(mh,"id","scatter"),Me(mh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Me(mh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var UF=Object.freeze({__proto__:null,BarController:fh,BubbleController:hh,DoughnutController:oa,LineController:ph,PieController:mb,PolarAreaController:mu,RadarController:gh,ScatterController:mh});function sa(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vb{constructor(t){Me(this,"options");this.options=t||{}}static override(t){Object.assign(vb.prototype,t)}init(){}formats(){return sa()}parse(){return sa()}format(){return sa()}add(){return sa()}diff(){return sa()}startOf(){return sa()}endOf(){return sa()}}var qF={_date:vb};function GF(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?m9:fo;if(r){if(i._sharedOptions){const c=o[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=l(o,t,n-d),g=l(o,t,n+d);return{lo:f.lo,hi:g.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function vu(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:d}=o[a],{lo:f,hi:g}=GF(o[a],t,s,i);for(let p=f;p<=g;++p){const v=d[p];v.skip||r(v,c,p)}}}function YF(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,s=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function bb(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||vu(e,n,t,function(a,l,c){!i&&!ho(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function KF(e,t,n,r){let i=[];function o(s,a,l){const{startAngle:c,endAngle:d}=s.getProps(["startAngle","endAngle"],r),{angle:f}=rC(s,{x:t.x,y:t.y});uu(f,c,d)&&i.push({element:s,datasetIndex:a,index:l})}return vu(e,n,t,o),i}function XF(e,t,n,r,i,o){let s=[];const a=YF(n);let l=Number.POSITIVE_INFINITY;function c(d,f,g){const p=d.inRange(t.x,t.y,i);if(r&&!p)return;const v=d.getCenterPoint(i);if(!(!!o||e.isPointInArea(v))&&!p)return;const x=a(t,v);x<l?(s=[{element:d,datasetIndex:f,index:g}],l=x):x===l&&s.push({element:d,datasetIndex:f,index:g})}return vu(e,n,t,c),s}function yb(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?KF(e,t,n,i):XF(e,t,n,r,i,o)}function XC(e,t,n,r,i){const o=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return vu(e,n,t,(l,c,d)=>{l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var QF={evaluateInteractionItems:vu,modes:{index(e,t,n,r){const i=ra(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?bb(e,i,o,r,s):yb(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const d=a[0].index,f=c.data[d];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,n,r){const i=ra(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?bb(e,i,o,r,s):yb(e,i,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(e,t,n,r){const i=ra(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return bb(e,i,o,r,s)},nearest(e,t,n,r){const i=ra(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return yb(e,i,o,n.intersect,r,s)},x(e,t,n,r){const i=ra(t,e);return XC(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=ra(t,e);return XC(e,i,"y",n.intersect,r)}}};const QC=["left","top","right","bottom"];function bu(e,t){return e.filter(n=>n.pos===t)}function ZC(e,t){return e.filter(n=>QC.indexOf(n.pos)===-1&&n.box.axis===t)}function yu(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function ZF(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:s,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&o+s,stackWeight:a});return t}function JF(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!QC.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return t}function e8(e,t){const n=JF(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,s,a;for(o=0,s=e.length;o<s;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=d?d*i:l&&t.availableHeight)}return n}function t8(e){const t=ZF(e),n=yu(t.filter(c=>c.box.fullSize),!0),r=yu(bu(t,"left"),!0),i=yu(bu(t,"right")),o=yu(bu(t,"top"),!0),s=yu(bu(t,"bottom")),a=ZC(t,"x"),l=ZC(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:bu(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function JC(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function eE(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 n8(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!_t(i)){n.size&&(e[i]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[i]+=n.size}o.getPadding&&eE(s,o.getPadding());const a=Math.max(0,t.outerWidth-JC(s,e,"left","right")),l=Math.max(0,t.outerHeight-JC(s,e,"top","bottom")),c=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function r8(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function i8(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function xu(e,t,n,r){const i=[];let o,s,a,l,c,d;for(o=0,s=e.length,c=0;o<s;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,i8(a.horizontal,t));const{same:f,other:g}=n8(t,n,a,r);c|=f&&i.length,d=d||g,l.fullSize||i.push(a)}return c&&xu(i,t,n,r)||d}function vh(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function tE(e,t,n,r){const i=n.padding;let{x:o,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*d,g=c.size||l.height;lu(c.start)&&(s=c.start),l.fullSize?vh(l,i.left,s,n.outerWidth-i.right-i.left,g):vh(l,t.left+c.placed,s,f,g),c.start=s,c.placed+=f,s=l.bottom}else{const f=t.h*d,g=c.size||l.width;lu(c.start)&&(o=c.start),l.fullSize?vh(l,o,i.top,g,n.outerHeight-i.bottom-i.top):vh(l,o,t.top+c.placed,g,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=s}var qn={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 i=Ln(e.options.layout.padding),o=Math.max(t-i.width,0),s=Math.max(n-i.height,0),a=t8(e.boxes),l=a.vertical,c=a.horizontal;Nt(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const d=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:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/d,hBoxMaxHeight:s/2}),g=Object.assign({},i);eE(g,Ln(r));const p=Object.assign({maxPadding:g,w:o,h:s,x:i.left,y:i.top},i),v=e8(l.concat(c),f);xu(a.fullSize,p,f,v),xu(l,p,f,v),xu(c,p,f,v)&&xu(l,p,f,v),r8(p),tE(a.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,tE(a.rightAndBottom,p,f,v),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Nt(a.chartArea,b=>{const x=b.box;Object.assign(x,e.chartArea),x.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class nE{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class o8 extends nE{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const bh="$chartjs",s8={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},rE=e=>e===null||e==="";function a8(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[bh]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",rE(i)){const o=kC(e,"width");o!==void 0&&(e.width=o)}if(rE(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=kC(e,"height");o!==void 0&&(e.height=o)}return e}const iE=cF?{passive:!0}:!1;function l8(e,t,n){e.addEventListener(t,n,iE)}function c8(e,t,n){e.canvas.removeEventListener(t,n,iE)}function u8(e,t){const n=s8[e.type]||e.type,{x:r,y:i}=ra(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function yh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function d8(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||yh(a.addedNodes,r),s=s&&!yh(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function f8(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||yh(a.removedNodes,r),s=s&&!yh(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const wu=new Map;let oE=0;function sE(){const e=window.devicePixelRatio;e!==oE&&(oE=e,wu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function h8(e,t){wu.size||window.addEventListener("resize",sE),wu.set(e,t)}function p8(e){wu.delete(e),wu.size||window.removeEventListener("resize",sE)}function g8(e,t,n){const r=e.canvas,i=r&&fb(r);if(!i)return;const o=lC((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return s.observe(i),h8(e,o),s}function xb(e,t,n){n&&n.disconnect(),t==="resize"&&p8(e)}function m8(e,t,n){const r=e.canvas,i=lC(o=>{e.ctx!==null&&n(u8(o,e))},e);return l8(r,t,i),i}class v8 extends nE{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(a8(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[bh])return!1;const r=n[bh].initial;["height","width"].forEach(o=>{const s=r[o];yt(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[bh],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:d8,detach:f8,resize:g8}[n]||m8;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:xb,detach:xb,resize:xb}[n]||c8)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return lF(t,n,r,i)}isAttached(t){const n=fb(t);return!!(n&&n.isConnected)}}function b8(e){return!db()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?o8:v8}let go=(_g=class{constructor(){Me(this,"x");Me(this,"y");Me(this,"active",!1);Me(this,"options");Me(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return xl(this.x)&&xl(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}},Me(_g,"defaults",{}),Me(_g,"defaultRoutes"),_g);function y8(e,t){const n=e.options.ticks,r=x8(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?_8(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return S8(t,c,o,s/i),c;const d=w8(o,t,i);if(s>0){let f,g;const p=s>1?Math.round((l-a)/(s-1)):null;for(xh(t,c,d,yt(p)?0:a-p,a),f=0,g=s-1;f<g;f++)xh(t,c,d,o[f],o[f+1]);return xh(t,c,d,l,yt(p)?t.length:l+p),c}return xh(t,c,d),c}function x8(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function w8(e,t,n){const r=C8(e),i=t.length/n;if(!r)return Math.max(i,1);const o=f9(r);for(let s=0,a=o.length-1;s<a;s++){const l=o[s];if(l>i)return l}return Math.max(i,1)}function _8(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function S8(e,t,n,r){let i=0,o=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===o&&(t.push(e[s]),i++,o=n[i*r])}function xh(e,t,n,r,i){const o=rt(r,0),s=Math.min(rt(i,e.length),e.length);let a=0,l,c,d;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),d=o;d<0;)a++,d=Math.round(o+a*n);for(c=Math.max(o,0);c<s;c++)c===d&&(t.push(e[c]),a++,d=Math.round(o+a*n))}function C8(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 E8=e=>e==="left"?"right":e==="right"?"left":e,aE=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,lE=(e,t)=>Math.min(t||e,e);function cE(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function O8(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-a||l>s+a)))return l}function P8(e,t){Nt(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function _u(e){return e.drawTicks?e.tickLength:0}function uE(e,t){if(!e.display)return 0;const n=xn(e.font,t),r=Ln(e.padding);return(Qt(e.text)?e.text.length:1)*n.lineHeight+r.height}function k8(e,t){return ts(e,{scale:t,type:"scale"})}function D8(e,t,n){return ts(e,{tick:n,index:t,type:"tick"})}function M8(e,t,n){let r=tb(e);return(n&&t!=="right"||!n&&t==="right")&&(r=E8(r)),r}function T8(e,t,n,r){const{top:i,left:o,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:d}=l;let f=0,g,p,v;const b=s-i,x=a-o;if(e.isHorizontal()){if(p=Un(r,o,a),_t(n)){const w=Object.keys(n)[0],S=n[w];v=d[w].getPixelForValue(S)+b-t}else n==="center"?v=(c.bottom+c.top)/2+b-t:v=aE(e,n,t);g=a-o}else{if(_t(n)){const w=Object.keys(n)[0],S=n[w];p=d[w].getPixelForValue(S)-x+t}else n==="center"?p=(c.left+c.right)/2-x+t:p=aE(e,n,t);v=Un(r,s,i),f=n==="left"?-pn:pn}return{titleX:p,titleY:v,maxWidth:g,rotation:f}}class aa extends go{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:i}=this;return t=Or(t,Number.POSITIVE_INFINITY),n=Or(n,Number.NEGATIVE_INFINITY),r=Or(r,Number.POSITIVE_INFINITY),i=Or(i,Number.NEGATIVE_INFINITY),{min:Or(t,r),max:Or(n,i),minDefined:fn(t),maxDefined:fn(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),s;if(i&&o)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),i||(n=Math.min(n,s.min)),o||(r=Math.max(r,s.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Or(n,Or(r,n)),max:Or(r,Or(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(){jt(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,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=z9(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?cE(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=y8(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(){jt(this.options.afterUpdate,[this])}beforeSetDimensions(){jt(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(){jt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),jt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){jt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=jt(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){jt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){jt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=lE(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let s=i,a,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const d=this._getLabelSizes(),f=d.widest.width,g=d.highest.height,p=Dn(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-_u(t.grid)-n.padding-uE(t.title,this.chart.options.font),c=Math.sqrt(f*f+g*g),s=Zv(Math.min(Math.asin(Dn((d.highest.height+6)/a,-1,1)),Math.asin(Dn(l/c,-1,1))-Math.asin(Dn(g/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){jt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){jt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=uE(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=_u(o)+l):(t.height=this.maxHeight,t.width=_u(o)+l),r.display&&this.ticks.length){const{first:c,last:d,widest:f,highest:g}=this._getLabelSizes(),p=r.padding*2,v=yi(this.labelRotation),b=Math.cos(v),x=Math.sin(v);if(a){const w=r.mirror?0:x*f.width+b*g.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{const w=r.mirror?0:b*f.width+x*g.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,d,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,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,p=0;l?c?(g=i*t.width,p=r*n.height):(g=r*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?g=t.width:o!=="inner"&&(g=t.width/2,p=n.width/2),this.paddingLeft=Math.max((g-d+s)*this.width/(this.width-d),0),this.paddingRight=Math.max((p-f+s)*this.width/(this.width-f),0)}else{let d=n.height/2,f=t.height/2;o==="start"?(d=0,f=t.height):o==="end"&&(d=n.height,f=0),this.paddingTop=d+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(){jt(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++)yt(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=cE(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,s=[],a=[],l=Math.floor(n/lE(n,r));let c=0,d=0,f,g,p,v,b,x,w,S,C,P,O;for(f=0;f<n;f+=l){if(v=t[f].label,b=this._resolveTickFontOptions(f),i.font=x=b.string,w=o[x]=o[x]||{data:{},gc:[]},S=b.lineHeight,C=P=0,!yt(v)&&!Qt(v))C=oh(i,w.data,w.gc,C,v),P=S;else if(Qt(v))for(g=0,p=v.length;g<p;++g)O=v[g],!yt(O)&&!Qt(O)&&(C=oh(i,w.data,w.gc,C,O),P+=S);s.push(C),a.push(P),c=Math.max(C,c),d=Math.max(P,d)}P8(o,n);const k=s.indexOf(c),T=a.indexOf(d),I=F=>({width:s[F]||0,height:a[F]||0});return{first:I(0),last:I(n-1),widest:I(k),highest:I(T),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 g9(this._alignToPixels?Js(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=D8(this.getContext(),t,r))}return this.$context||(this.$context=k8(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=yi(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),s=t.autoSkipPadding||0,a=o?o.widest.width+s:0,l=o?o.highest.height+s:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),g=_u(o),p=[],v=a.setContext(this.getContext()),b=v.display?v.width:0,x=b/2,w=function(X){return Js(r,X,b)};let S,C,P,O,k,T,I,F,j,B,V,q;if(s==="top")S=w(this.bottom),T=this.bottom-g,F=S-x,B=w(t.top)+x,q=t.bottom;else if(s==="bottom")S=w(this.top),B=t.top,q=w(t.bottom)-x,T=S+x,F=this.top+g;else if(s==="left")S=w(this.right),k=this.right-g,I=S-x,j=w(t.left)+x,V=t.right;else if(s==="right")S=w(this.left),j=t.left,V=w(t.right)-x,k=S+x,I=this.left+g;else if(n==="x"){if(s==="center")S=w((t.top+t.bottom)/2+.5);else if(_t(s)){const X=Object.keys(s)[0],W=s[X];S=w(this.chart.scales[X].getPixelForValue(W))}B=t.top,q=t.bottom,T=S+x,F=T+g}else if(n==="y"){if(s==="center")S=w((t.left+t.right)/2);else if(_t(s)){const X=Object.keys(s)[0],W=s[X];S=w(this.chart.scales[X].getPixelForValue(W))}k=S-x,I=k-g,j=t.left,V=t.right}const J=rt(i.ticks.maxTicksLimit,f),$=Math.max(1,Math.ceil(f/J));for(C=0;C<f;C+=$){const X=this.getContext(C),W=o.setContext(X),te=a.setContext(X),le=W.lineWidth,A=W.color,H=te.dash||[],ne=te.dashOffset,R=W.tickWidth,ue=W.tickColor,xe=W.tickBorderDash||[],ge=W.tickBorderDashOffset;P=O8(this,C,l),P!==void 0&&(O=Js(r,P,le),c?k=I=j=V=O:T=F=B=q=O,p.push({tx1:k,ty1:T,tx2:I,ty2:F,x1:j,y1:B,x2:V,y2:q,width:le,color:A,borderDash:H,borderDashOffset:ne,tickWidth:R,tickColor:ue,tickBorderDash:xe,tickBorderDashOffset:ge}))}return this._ticksLength=f,this._borderValue=S,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:f}=o,g=_u(r.grid),p=g+d,v=f?-d:p,b=-yi(this.labelRotation),x=[];let w,S,C,P,O,k,T,I,F,j,B,V,q="middle";if(i==="top")k=this.bottom-v,T=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+v,T=this._getXAxisLabelAlignment();else if(i==="left"){const $=this._getYAxisLabelAlignment(g);T=$.textAlign,O=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(g);T=$.textAlign,O=$.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+p;else if(_t(i)){const $=Object.keys(i)[0],X=i[$];k=this.chart.scales[$].getPixelForValue(X)+p}T=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")O=(t.left+t.right)/2-p;else if(_t(i)){const $=Object.keys(i)[0],X=i[$];O=this.chart.scales[$].getPixelForValue(X)}T=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(l==="start"?q="top":l==="end"&&(q="bottom"));const J=this._getLabelSizes();for(w=0,S=a.length;w<S;++w){C=a[w],P=C.label;const $=o.setContext(this.getContext(w));I=this.getPixelForTick(w)+o.labelOffset,F=this._resolveTickFontOptions(w),j=F.lineHeight,B=Qt(P)?P.length:1;const X=B/2,W=$.color,te=$.textStrokeColor,le=$.textStrokeWidth;let A=T;s?(O=I,T==="inner"&&(w===S-1?A=this.options.reverse?"left":"right":w===0?A=this.options.reverse?"right":"left":A="center"),i==="top"?c==="near"||b!==0?V=-B*j+j/2:c==="center"?V=-J.highest.height/2-X*j+j:V=-J.highest.height+j/2:c==="near"||b!==0?V=j/2:c==="center"?V=J.highest.height/2-X*j:V=J.highest.height-B*j,f&&(V*=-1),b!==0&&!$.showLabelBackdrop&&(O+=j/2*Math.sin(b))):(k=I,V=(1-B)*j/2);let H;if($.showLabelBackdrop){const ne=Ln($.backdropPadding),R=J.heights[w],ue=J.widths[w];let xe=V-ne.top,ge=0-ne.left;switch(q){case"middle":xe-=R/2;break;case"bottom":xe-=R;break}switch(T){case"center":ge-=ue/2;break;case"right":ge-=ue;break;case"inner":w===S-1?ge-=ue:w>0&&(ge-=ue/2);break}H={left:ge,top:xe,width:ue+ne.width,height:R+ne.height,color:$.backdropColor}}x.push({label:P,font:F,textOffset:V,options:{rotation:b,color:W,strokeColor:te,strokeWidth:le,textAlign:A,textBaseline:q,translation:[O,k],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-yi(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,d;return n==="left"?i?(d=this.right+o,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?i?(d=this.left+o,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,c,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o<s;++o){const l=i[o];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:i}}=this,o=r.setContext(this.getContext()),s=r.display?o.width:0;if(!s)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,f,g;this.isHorizontal()?(c=Js(t,this.left,s)-s/2,d=Js(t,this.right,a)+a/2,f=g=l):(f=Js(t,this.top,s)-s/2,g=Js(t,this.bottom,a)+a/2,c=d=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,f),n.lineTo(d,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&sh(r,i);const o=this.getLabelItems(t);for(const s of o){const a=s.options,l=s.font,c=s.label,d=s.textOffset;ea(r,c,0,d,l,a)}i&&ah(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=xn(r.font),s=Ln(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||_t(n)?(l+=s.bottom,Qt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:d,maxWidth:f,rotation:g}=T8(this,l,n,a);ea(t,r.text,0,0,o,{color:r.color,maxWidth:f,rotation:g,textAlign:M8(a,n,i),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=rt(t.grid&&t.grid.z,-1),i=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==aa.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o<s;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return xn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class wh{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;N8(n)&&(r=this.register(n));const i=this.items,o=t.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,A8(t,s,r),this.override&&an.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in an[i]&&(delete an[i][r],this.override&&delete Zs[r])}}function A8(e,t,n){const r=Li(Object.create(null),[n?an.get(n):{},an.get(t),e.defaults]);an.set(t,r),e.defaultRoutes&&I8(t,e.defaultRoutes),e.descriptors&&an.describe(t,e.descriptors)}function I8(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");an.route(o,i,l,a)})}function N8(e){return"id"in e&&"defaults"in e}class R8{constructor(){this.controllers=new wh(xi,"datasets",!0),this.elements=new wh(go,"elements"),this.plugins=new wh(Object,"plugins"),this.scales=new wh(aa,"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(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Nt(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=Qv(t);jt(r["before"+i],[],r),n[t](r),jt(r["after"+i],[],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 i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var $i=new R8;class L8{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,i){i=i||{};for(const o of t){const s=o.plugin,a=s[r],l=[n,i,o.options];if(jt(a,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){yt(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,i=rt(r.options&&r.options.plugins,{}),o=F8(r);return i===!1&&!n?[]:j8(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,s)=>o.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function F8(e){const t={},n=[],r=Object.keys($i.plugins.items);for(let o=0;o<r.length;o++)n.push($i.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const s=i[o];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function $8(e,t){return!t&&e===!1?null:e===!0?{}:e}function j8(e,{plugins:t,localIds:n},r,i){const o=[],s=e.getContext();for(const a of t){const l=a.id,c=$8(r[l],i);c!==null&&o.push({plugin:a,options:z8(e.config,{plugin:a,local:n[l]},c,s)})}return o}function z8(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),s=e.getOptionScopes(r,o);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function wb(e,t){const n=an.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function B8(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function V8(e,t){return e===t?"_index_":"_value_"}function dE(e){if(e==="x"||e==="y"||e==="r")return e}function H8(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function _b(e,...t){if(dE(e))return e;for(const n of t){const r=n.axis||H8(n.position)||e.length>1&&dE(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function fE(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function W8(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 fE(e,"x",n[0])||fE(e,"y",n[0])}return{}}function U8(e,t){const n=Zs[e.type]||{scales:{}},r=t.scales||{},i=wb(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!_t(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=_b(s,a,W8(s,e),an.scales[a.type]),c=V8(l,i),d=n.scales||{};o[s]=au(Object.create(null),[{axis:l},a,d[l],d[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||wb(a,t),d=(Zs[a]||{}).scales||{};Object.keys(d).forEach(f=>{const g=B8(f,l),p=s[g+"AxisID"]||g;o[p]=o[p]||Object.create(null),au(o[p],[{axis:g},r[p],d[f]])})}),Object.keys(o).forEach(s=>{const a=o[s];au(a,[an.scales[a.type],an.scale])}),o}function hE(e){const t=e.options||(e.options={});t.plugins=rt(t.plugins,{}),t.scales=U8(e,t)}function pE(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function q8(e){return e=e||{},e.data=pE(e.data),hE(e),e}const gE=new Map,mE=new Set;function _h(e,t){let n=gE.get(e);return n||(n=t(),gE.set(e,n),mE.add(n)),n}const Su=(e,t,n)=>{const r=Zo(t,n);r!==void 0&&e.add(r)};class G8{constructor(t){this._config=q8(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=pE(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(),hE(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 i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(f=>Su(l,t,f))),d.forEach(f=>Su(l,i,f)),d.forEach(f=>Su(l,Zs[o]||{},f)),d.forEach(f=>Su(l,an,f)),d.forEach(f=>Su(l,ib,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),mE.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Zs[n]||{},an.datasets[n]||{},{type:n},an,ib]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=vE(this._resolverCache,t,i);let l=s;if(K8(s,n)){o.$shared=!1,r=Jo(r)?r():r;const c=this.createResolver(t,r,a);l=wl(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=vE(this._resolverCache,t,r);return _t(n)?wl(o,n,void 0,i):o}}function vE(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:lb(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const Y8=e=>_t(e)&&Object.getOwnPropertyNames(e).some(t=>Jo(e[t]));function K8(e,t){const{isScriptable:n,isIndexable:r}=yC(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Jo(a)||Y8(a))||s&&Qt(a))return!0}return!1}var X8="4.4.1";const Q8=["top","bottom","left","right","chartArea"];function bE(e,t){return e==="top"||e==="bottom"||Q8.indexOf(e)===-1&&t==="x"}function yE(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function xE(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),jt(n&&n.onComplete,[e],t)}function Z8(e){const t=e.chart,n=t.options.animation;jt(n&&n.onProgress,[e],t)}function wE(e){return db()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Sh={},_E=e=>{const t=wE(e);return Object.values(Sh).filter(n=>n.canvas===t).pop()};function J8(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function e$(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Ch(e,t,n){return e.options.clip?e[n]:t[n]}function t$(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Ch(n,t,"left"),right:Ch(n,t,"right"),top:Ch(r,t,"top"),bottom:Ch(r,t,"bottom")}:t}class Zr{static register(...t){$i.add(...t),SE()}static unregister(...t){$i.remove(...t),SE()}constructor(t,n){const r=this.config=new G8(n),i=wE(t),o=_E(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||b8(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=r9(),this.ctx=a,this.canvas=l,this.width=d,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 L8,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=y9(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],Sh[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}po.listen(this,"complete",xE),po.listen(this,"progress",Z8),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return yt(t)?n&&o?o:i?r/i: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 $i}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():PC(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return mC(this.canvas,this.ctx),this}stop(){return po.stop(this),this}resize(t,n){po.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,PC(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),jt(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Nt(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=_b(s,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),Nt(o,s=>{const a=s.options,l=a.id,c=_b(l,a),d=rt(a.type,s.dtype);(a.position===void 0||bE(a.position,c)!==bE(s.dposition))&&(a.position=s.dposition),i[l]=!0;let f=null;if(l in r&&r[l].type===d)f=r[l];else{const g=$i.getScale(d);f=new g({id:l,type:d,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),Nt(i,(s,a)=>{s||delete r[a]}),Nt(r,s=>{qn.configure(this,s,s.options),qn.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(yE("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let s=this.getDatasetMeta(r);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=o.indexAxis||wb(a,this.options),s.order=o.order||0,s.index=r,s.label=""+o.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=$i.getController(a),{datasetElementType:c,dataElementType:d}=an.datasets[a];Object.assign(l,{dataElementType:$i.getElement(d),datasetElementType:c&&$i.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Nt(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()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:f}=this.getDatasetMeta(c),g=!i&&o.indexOf(f)===-1;f.buildOrUpdateElements(g),s=Math.max(+f.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||Nt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(yE("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Nt(this.scales,t=>{qn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ZS(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;J8(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!ZS(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;qn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Nt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),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,Jo(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(po.has(this)?this.attached&&!po.running(this)&&po.start(this):(this.draw(),xE({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),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 i,o;for(i=0,o=n.length;i<o;++i){const s=n[i];(!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,i=!r.disabled,o=t$(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&sh(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&ah(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ho(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=QF.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={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(i)),i}getContext(){return this.$context||(this.$context=ts(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 i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);lu(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i: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(),po.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(),mC(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Sh[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=(o,s)=>{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Nt(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Nt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Nt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!eh(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 i=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(f=>d.datasetIndex===f.datasetIndex&&d.index===f.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=c9(t),c=e$(t,this._lastEvent,r,l);r&&(this._lastEvent=null,jt(o.onHover,[t,a,this],this),l&&jt(o.onClick,[t,a,this],this));const d=!eh(a,i);return(d||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,d}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}Me(Zr,"defaults",an),Me(Zr,"instances",Sh),Me(Zr,"overrides",Zs),Me(Zr,"registry",$i),Me(Zr,"version",X8),Me(Zr,"getChart",_E);function SE(){return Nt(Zr.instances,e=>e._plugins.invalidate())}function n$(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:s,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(o,s,a,r-c,n+c),l>i?(c=i/l,e.arc(o,s,l,n+c,r-c,!0)):e.arc(o,s,i,n+pn,r-pn),e.closePath(),e.clip()}function r$(e){return ab(e,["outerStart","outerEnd","innerStart","innerEnd"])}function i$(e,t,n,r){const i=r$(e.options.borderRadius),o=(n-t)/2,s=Math.min(o,r*t/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return Dn(l,0,Math.min(o,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:Dn(i.innerStart,0,s),innerEnd:Dn(i.innerEnd,0,s)}}function Cl(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Eh(e,t,n,r,i,o){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,f=Math.max(t.outerRadius+r+n-c,0),g=d>0?d+r+n+c:0;let p=0;const v=i-l;if(r){const $=d>0?d-r:0,X=f>0?f-r:0,W=($+X)/2,te=W!==0?v*W/(W+r):v;p=(v-te)/2}const b=Math.max(.001,v*f-n/Zt)/f,x=(v-b)/2,w=l+x+p,S=i-x-p,{outerStart:C,outerEnd:P,innerStart:O,innerEnd:k}=i$(t,g,f,S-w),T=f-C,I=f-P,F=w+C/T,j=S-P/I,B=g+O,V=g+k,q=w+O/B,J=S-k/V;if(e.beginPath(),o){const $=(F+j)/2;if(e.arc(s,a,f,F,$),e.arc(s,a,f,$,j),P>0){const le=Cl(I,j,s,a);e.arc(le.x,le.y,P,j,S+pn)}const X=Cl(V,S,s,a);if(e.lineTo(X.x,X.y),k>0){const le=Cl(V,J,s,a);e.arc(le.x,le.y,k,S+pn,J+Math.PI)}const W=(S-k/g+(w+O/g))/2;if(e.arc(s,a,g,S-k/g,W,!0),e.arc(s,a,g,W,w+O/g,!0),O>0){const le=Cl(B,q,s,a);e.arc(le.x,le.y,O,q+Math.PI,w-pn)}const te=Cl(T,w,s,a);if(e.lineTo(te.x,te.y),C>0){const le=Cl(T,F,s,a);e.arc(le.x,le.y,C,w-pn,F)}}else{e.moveTo(s,a);const $=Math.cos(F)*f+s,X=Math.sin(F)*f+a;e.lineTo($,X);const W=Math.cos(j)*f+s,te=Math.sin(j)*f+a;e.lineTo(W,te)}e.closePath()}function o$(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){Eh(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=s+(a%Jt||Jt))}return Eh(e,t,n,r,l,i),e.fill(),l}function s$(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:f,borderDashOffset:g}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=g,p?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let v=t.endAngle;if(o){Eh(e,t,n,r,v,i);for(let b=0;b<o;++b)e.stroke();isNaN(a)||(v=s+(a%Jt||Jt))}p&&n$(e,t,v),o||(Eh(e,t,n,r,v,i),e.stroke())}class El extends go{constructor(n){super();Me(this,"circumference");Me(this,"endAngle");Me(this,"fullCircles");Me(this,"innerRadius");Me(this,"outerRadius");Me(this,"pixelMargin");Me(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,i){const o=this.getProps(["x","y"],i),{angle:s,distance:a}=rC(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:f,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,b=rt(g,c-l)>=Jt||uu(s,l,c),x=uo(a,d+p,f+p);return b&&x}getCenterPoint(n){const{x:r,y:i,startAngle:o,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:d}=this.options,f=(o+s)/2,g=(a+l+d+c)/2;return{x:r+Math.cos(f)*g,y:i+Math.sin(f)*g}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,o=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>Jt?Math.floor(i/Jt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(Zt,i||0)),d=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,o$(n,this,d,s,a),s$(n,this,d,s,a),n.restore()}}Me(El,"id","arc"),Me(El,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Me(El,"defaultRoutes",{backgroundColor:"backgroundColor"}),Me(El,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function CE(e,t,n=t){e.lineCap=rt(n.borderCapStyle,t.borderCapStyle),e.setLineDash(rt(n.borderDash,t.borderDash)),e.lineDashOffset=rt(n.borderDashOffset,t.borderDashOffset),e.lineJoin=rt(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=rt(n.borderWidth,t.borderWidth),e.strokeStyle=rt(n.borderColor,t.borderColor)}function a$(e,t,n){e.lineTo(n.x,n.y)}function l$(e){return e.stepped?T9:e.tension||e.cubicInterpolationMode==="monotone"?A9:a$}function EE(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),d=i<s&&o<s||i>a&&o>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!d?r+c-l:c-l}}function c$(e,t,n,r){const{points:i,options:o}=t,{count:s,start:a,loop:l,ilen:c}=EE(i,n,r),d=l$(o);let{move:f=!0,reverse:g}=r||{},p,v,b;for(p=0;p<=c;++p)v=i[(a+(g?c-p:p))%s],!v.skip&&(f?(e.moveTo(v.x,v.y),f=!1):d(e,b,v,g,o.stepped),b=v);return l&&(v=i[(a+(g?c:0))%s],d(e,b,v,g,o.stepped)),!!l}function u$(e,t,n,r){const i=t.points,{count:o,start:s,ilen:a}=EE(i,n,r),{move:l=!0,reverse:c}=r||{};let d=0,f=0,g,p,v,b,x,w;const S=P=>(s+(c?a-P:P))%o,C=()=>{b!==x&&(e.lineTo(d,x),e.lineTo(d,b),e.lineTo(d,w))};for(l&&(p=i[S(0)],e.moveTo(p.x,p.y)),g=0;g<=a;++g){if(p=i[S(g)],p.skip)continue;const P=p.x,O=p.y,k=P|0;k===v?(O<b?b=O:O>x&&(x=O),d=(f*d+P)/++f):(C(),e.lineTo(P,O),v=k,f=0,b=x=O),w=O}C()}function Sb(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?u$:c$}function d$(e){return e.stepped?uF:e.tension||e.cubicInterpolationMode==="monotone"?dF:ia}function f$(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),CE(e,t.options),e.stroke(i)}function h$(e,t,n,r){const{segments:i,options:o}=t,s=Sb(t);for(const a of i)CE(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const p$=typeof Path2D=="function";function g$(e,t,n,r){p$&&!t.options.segment?f$(e,t,n,r):h$(e,t,n,r)}class ns extends go{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 i=r.spanGaps?this._loop:this._fullLoop;nF(this._points,r,t,i,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=vF(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,i=t[n],o=this.points,s=NC(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=d$(r);let c,d;for(c=0,d=s.length;c<d;++c){const{start:f,end:g}=s[c],p=o[f],v=o[g];if(p===v){a.push(p);continue}const b=Math.abs((i-p[n])/(v[n]-p[n])),x=l(p,v,b,r.stepped);x[n]=t[n],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,n,r){return Sb(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=Sb(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)s&=o(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),g$(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Me(ns,"id","line"),Me(ns,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Me(ns,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Me(ns,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function OE(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class Cu extends go{constructor(n){super();Me(this,"parsed");Me(this,"skip");Me(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,i){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,r){return OE(this,n,"x",r)}inYRange(n,r){return OE(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!ho(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,sb(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Me(Cu,"id","point"),Me(Cu,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Me(Cu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function PE(e,t){const{x:n,y:r,base:i,width:o,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,d,f;return e.horizontal?(f=s/2,a=Math.min(n,i),l=Math.max(n,i),c=r-f,d=r+f):(f=o/2,a=n-f,l=n+f,c=Math.min(r,i),d=Math.max(r,i)),{left:a,top:c,right:l,bottom:d}}function rs(e,t,n,r){return e?0:Dn(t,n,r)}function m$(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=bC(r);return{t:rs(i.top,o.top,0,n),r:rs(i.right,o.right,0,t),b:rs(i.bottom,o.bottom,0,n),l:rs(i.left,o.left,0,t)}}function v$(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=ta(i),s=Math.min(t,n),a=e.borderSkipped,l=r||_t(i);return{topLeft:rs(!l||a.top||a.left,o.topLeft,0,s),topRight:rs(!l||a.top||a.right,o.topRight,0,s),bottomLeft:rs(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:rs(!l||a.bottom||a.right,o.bottomRight,0,s)}}function b$(e){const t=PE(e),n=t.right-t.left,r=t.bottom-t.top,i=m$(e,n/2,r/2),o=v$(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function Cb(e,t,n,r){const i=t===null,o=n===null,a=e&&!(i&&o)&&PE(e,r);return a&&(i||uo(t,a.left,a.right))&&(o||uo(n,a.top,a.bottom))}function y$(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function x$(e,t){e.rect(t.x,t.y,t.w,t.h)}function Eb(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+s,radius:e.radius}}class Eu extends go{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:i}}=this,{inner:o,outer:s}=b$(this),a=y$(s.radius)?pu:x$;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,Eb(s,n,o)),t.clip(),a(t,Eb(o,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Eb(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return Cb(this,t,n,r)}inXRange(t,n){return Cb(this,t,null,n)}inYRange(t,n){return Cb(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Me(Eu,"id","bar"),Me(Eu,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Me(Eu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var w$=Object.freeze({__proto__:null,ArcElement:El,BarElement:Eu,LineElement:ns,PointElement:Cu});const Ob=["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)"],kE=Ob.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function DE(e){return Ob[e%Ob.length]}function ME(e){return kE[e%kE.length]}function _$(e,t){return e.borderColor=DE(t),e.backgroundColor=ME(t),++t}function S$(e,t){return e.backgroundColor=e.data.map(()=>DE(t++)),t}function C$(e,t){return e.backgroundColor=e.data.map(()=>ME(t++)),t}function E$(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof oa?t=S$(n,t):i instanceof mu?t=C$(n,t):i&&(t=_$(n,t))}}function TE(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function O$(e){return e&&(e.borderColor||e.backgroundColor)}var P$={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:o}=i;if(!n.forceOverride&&(TE(r)||O$(i)||o&&TE(o)))return;const s=E$(e);r.forEach(s)}};function k$(e,t,n,r,i){const o=i.samples||r;if(o>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let d=t,f,g,p,v,b;for(s[l++]=e[d],f=0;f<o-2;f++){let x=0,w=0,S;const C=Math.floor((f+1)*a)+1+t,P=Math.min(Math.floor((f+2)*a)+1,n)+t,O=P-C;for(S=C;S<P;S++)x+=e[S].x,w+=e[S].y;x/=O,w/=O;const k=Math.floor(f*a)+1+t,T=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:I,y:F}=e[d];for(p=v=-1,S=k;S<T;S++)v=.5*Math.abs((I-x)*(e[S].y-F)-(I-e[S].x)*(w-F)),v>p&&(p=v,g=e[S],b=S);s[l++]=g,d=b}return s[l++]=e[c],s}function D$(e,t,n,r){let i=0,o=0,s,a,l,c,d,f,g,p,v,b;const x=[],w=t+n-1,S=e[t].x,P=e[w].x-S;for(s=t;s<t+n;++s){a=e[s],l=(a.x-S)/P*r,c=a.y;const O=l|0;if(O===d)c<v?(v=c,f=s):c>b&&(b=c,g=s),i=(o*i+a.x)/++o;else{const k=s-1;if(!yt(f)&&!yt(g)){const T=Math.min(f,g),I=Math.max(f,g);T!==p&&T!==k&&x.push({...e[T],x:i}),I!==p&&I!==k&&x.push({...e[I],x:i})}s>0&&k!==p&&x.push(e[k]),x.push(a),d=O,o=0,v=b=c,f=g=p=s}}return x}function AE(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 IE(e){e.data.datasets.forEach(t=>{AE(t)})}function M$(e,t){const n=t.length;let r=0,i;const{iScale:o}=e,{min:s,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=Dn(fo(t,o.axis,s).lo,0,n-1)),c?i=Dn(fo(t,o.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var T$={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){IE(e);return}const r=e.width;e.data.datasets.forEach((i,o)=>{const{_data:s,indexAxis:a}=i,l=e.getDatasetMeta(o),c=s||i.data;if(en([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:f,count:g}=M$(l,c);const p=n.threshold||4*r;if(g<=p){AE(i);return}yt(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let v;switch(n.algorithm){case"lttb":v=k$(c,f,g,r,n);break;case"min-max":v=D$(c,f,g,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=v})},destroy(e){IE(e)}};function A$(e,t,n){const r=e.segments,i=e.points,o=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=kb(l,c,i);const d=Pb(n,i[l],i[c],a.loop);if(!t.segments){s.push({source:a,target:d,start:i[l],end:i[c]});continue}const f=NC(t,d);for(const g of f){const p=Pb(n,o[g.start],o[g.end],g.loop),v=IC(a,i,p);for(const b of v)s.push({source:b,target:g,start:{[n]:NE(d,p,"start",Math.max)},end:{[n]:NE(d,p,"end",Math.min)}})}}return s}function Pb(e,t,n,r){if(r)return;let i=t[e],o=n[e];return e==="angle"&&(i=Pr(i),o=Pr(o)),{property:e,start:i,end:o}}function I$(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=kb(s,a,i);const l=i[s],c=i[a];r!==null?(o.push({x:l.x,y:r}),o.push({x:c.x,y:r})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function kb(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function NE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function RE(e,t){let n=[],r=!1;return Qt(e)?(r=!0,n=e):n=I$(e,t),n.length?new ns({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function LE(e){return e&&e.fill!==!1}function N$(e,t,n){let i=e[t].fill;const o=[t];let s;if(!n)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!fn(i))return i;if(s=e[i],!s)return!1;if(s.visible)return i;o.push(i),i=s.fill}return!1}function R$(e,t,n){const r=j$(e);if(_t(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return fn(i)&&Math.floor(i)===i?L$(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function L$(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function F$(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:_t(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function $$(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:_t(e)?r=e.value:r=t.getBaseValue(),r}function j$(e){const t=e.options,n=t.fill;let r=rt(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function z$(e){const{scale:t,index:n,line:r}=e,i=[],o=r.segments,s=r.points,a=B$(t,n);a.push(RE({x:null,y:t.bottom},r));for(let l=0;l<o.length;l++){const c=o[l];for(let d=c.start;d<=c.end;d++)V$(i,s[d],a)}return new ns({points:i,options:{}})}function B$(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const o=r[i];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function V$(e,t,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:s,last:a,point:l}=H$(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function H$(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],o=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const d=o[c],f=s[d.start][n],g=s[d.end][n];if(uo(i,f,g)){a=i===f,l=i===g;break}}return{first:a,last:l,point:r}}class FE{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:o,radius:s}=this;return n=n||{start:0,end:Jt},t.arc(i,o,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,o=t.angle;return{x:n+Math.cos(o)*i,y:r+Math.sin(o)*i,angle:o}}}function W$(e){const{chart:t,fill:n,line:r}=e;if(fn(n))return U$(t,n);if(n==="stack")return z$(e);if(n==="shape")return!0;const i=q$(e);return i instanceof FE?i:RE(i,r)}function U$(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function q$(e){return(e.scale||{}).getPointPositionForValue?Y$(e):G$(e)}function G$(e){const{scale:t={},fill:n}=e,r=F$(n,t);if(fn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function Y$(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,o=r.reverse?t.max:t.min,s=$$(n,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new FE({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,s));return a}function Db(e,t,n){const r=W$(t),{line:i,scale:o,axis:s}=t,a=i.options,l=a.fill,c=a.backgroundColor,{above:d=c,below:f=c}=l||{};r&&i.points.length&&(sh(e,n),K$(e,{line:i,target:r,above:d,below:f,area:n,scale:o,axis:s}),ah(e))}function K$(e,t){const{line:n,target:r,above:i,below:o,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&o!==i&&($E(e,r,s.top),jE(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),$E(e,r,s.bottom)),jE(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore()}function $E(e,t,n){const{segments:r,points:i}=t;let o=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,d=i[l],f=i[kb(l,c,i)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.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 jE(e,t){const{line:n,target:r,property:i,color:o,scale:s}=t,a=A$(n,r,i);for(const{source:l,target:c,start:d,end:f}of a){const{style:{backgroundColor:g=o}={}}=l,p=r!==!0;e.save(),e.fillStyle=g,X$(e,s,p&&Pb(i,d,f)),e.beginPath();const v=!!n.pathSegment(e,l);let b;if(p){v?e.closePath():zE(e,r,f,i);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});b=v&&x,b||zE(e,r,d,i)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function X$(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:o,start:s,end:a}=n||{};o==="x"&&(e.beginPath(),e.rect(s,r,a-s,i-r),e.clip())}function zE(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Q$={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let o,s,a,l;for(s=0;s<r;++s)o=e.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof ns&&(l={visible:e.isDatasetVisible(s),index:s,fill:R$(a,s,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=N$(i,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let s=i.length-1;s>=0;--s){const a=i[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&Db(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const o=r[i].$filler;LE(o)&&Db(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!LE(r)||n.drawTime!=="beforeDatasetDraw"||Db(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const BE=(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)}},Z$=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class VE extends go{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=jt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,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,i=xn(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=BE(r,o);let c,d;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(s,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(s,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=i+a;let f=t;o.textAlign="left",o.textBaseline="middle";let g=-1,p=-d;return this.legendItems.forEach((v,b)=>{const x=r+n/2+o.measureText(v.text).width;(b===0||c[c.length-1]+x+2*a>s)&&(f+=d,c[c.length-(b>0?0:1)]=0,p+=d,g++),l[b]={left:0,top:p,row:g,width:x,height:i},c[c.length-1]+=x+a}),f}_fitCols(t,n,r,i){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=s-t;let f=a,g=0,p=0,v=0,b=0;return this.legendItems.forEach((x,w)=>{const{itemWidth:S,itemHeight:C}=J$(r,n,o,x,i);w>0&&p+C+2*a>d&&(f+=g+a,c.push({width:g,height:p}),v+=g+a,b++,g=p=0),l[w]={left:v,top:p,col:b,width:S,height:C},g=Math.max(g,S),p+=C+a}),f+=g,c.push({width:g,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,s=Sl(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Un(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Un(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let a=0,l=Un(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Un(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;sh(t,this),this._draw(),ah(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=an.color,l=Sl(t.rtl,this.left,this.width),c=xn(s.font),{padding:d}=s,f=c.size,g=f/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:v,boxHeight:b,itemHeight:x}=BE(s,f),w=function(k,T,I){if(isNaN(v)||v<=0||isNaN(b)||b<0)return;i.save();const F=rt(I.lineWidth,1);if(i.fillStyle=rt(I.fillStyle,a),i.lineCap=rt(I.lineCap,"butt"),i.lineDashOffset=rt(I.lineDashOffset,0),i.lineJoin=rt(I.lineJoin,"miter"),i.lineWidth=F,i.strokeStyle=rt(I.strokeStyle,a),i.setLineDash(rt(I.lineDash,[])),s.usePointStyle){const j={radius:b*Math.SQRT2/2,pointStyle:I.pointStyle,rotation:I.rotation,borderWidth:F},B=l.xPlus(k,v/2),V=T+g;vC(i,j,B,V,s.pointStyleWidth&&v)}else{const j=T+Math.max((f-b)/2,0),B=l.leftForLtr(k,v),V=ta(I.borderRadius);i.beginPath(),Object.values(V).some(q=>q!==0)?pu(i,{x:B,y:j,w:v,h:b,radius:V}):i.rect(B,j,v,b),i.fill(),F!==0&&i.stroke()}i.restore()},S=function(k,T,I){ea(i,I.text,k,T+x/2,c,{strikethrough:I.hidden,textAlign:l.textAlign(I.textAlign)})},C=this.isHorizontal(),P=this._computeTitleHeight();C?p={x:Un(o,this.left+d,this.right-r[0]),y:this.top+d+P,line:0}:p={x:this.left+d,y:Un(o,this.top+P+d,this.bottom-n[0].height),line:0},DC(this.ctx,t.textDirection);const O=x+d;this.legendItems.forEach((k,T)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const I=i.measureText(k.text).width,F=l.textAlign(k.textAlign||(k.textAlign=s.textAlign)),j=v+g+I;let B=p.x,V=p.y;l.setWidth(this.width),C?T>0&&B+j+d>this.right&&(V=p.y+=O,p.line++,B=p.x=Un(o,this.left+d,this.right-r[p.line])):T>0&&V+O>this.bottom&&(B=p.x=B+n[p.line].width+d,p.line++,V=p.y=Un(o,this.top+P+d,this.bottom-n[p.line].height));const q=l.x(B);if(w(q,V,k),B=x9(F,B+v+g,C?B+j:this.right,t.rtl),S(l.x(B),V,k),C)p.x+=j+d;else if(typeof k.text!="string"){const J=c.lineHeight;p.y+=HE(k,J)+d}else p.y+=O}),MC(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=xn(n.font),i=Ln(n.padding);if(!n.display)return;const o=Sl(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let d,f=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),d=this.top+c,f=Un(t.align,f,this.right-g);else{const v=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);d=c+Un(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const p=Un(a,f,f+g);s.textAlign=o.textAlign(tb(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,ea(s,n.text,p,d,r)}_computeTitleHeight(){const t=this.options.title,n=xn(t.font),r=Ln(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(uo(t,this.left,this.right)&&uo(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],uo(t,i.left,i.left+i.width)&&uo(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!nj(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=Z$(i,r);i&&!o&&jt(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&jt(n.onHover,[t,r,this],this)}else r&&jt(n.onClick,[t,r,this],this)}}function J$(e,t,n,r,i){const o=ej(r,e,t,n),s=tj(i,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function ej(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,s)=>o.length>s.length?o:s)),t+n.size/2+r.measureText(i).width}function tj(e,t,n){let r=e;return typeof t.text!="string"&&(r=HE(t,n)),r}function HE(e,t){const n=e.text?e.text.length:0;return t*n}function nj(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var rj={id:"legend",_element:VE,start(e,t,n){const r=e.legend=new VE({ctx:e.ctx,options:n,chart:e});qn.configure(e,r,n),qn.addBox(e,r)},stop(e){qn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;qn.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,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.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:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=Ln(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||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 Mb extends go{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 i=Qt(r.text)?r.text.length:1;this._padding=Ln(r.padding);const o=i*xn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:o,options:s}=this,a=s.align;let l=0,c,d,f;return this.isHorizontal()?(d=Un(a,r,o),f=n+t,c=o-r):(s.position==="left"?(d=r+t,f=Un(a,i,n),l=Zt*-.5):(d=o-t,f=Un(a,n,i),l=Zt*.5),c=i-n),{titleX:d,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=xn(n.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);ea(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:tb(n.align),textBaseline:"middle",translation:[s,a]})}}function ij(e,t){const n=new Mb({ctx:e.ctx,options:t,chart:e});qn.configure(e,n,t),qn.addBox(e,n),e.titleBlock=n}var oj={id:"title",_element:Mb,start(e,t,n){ij(e,n)},stop(e){const t=e.titleBlock;qn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;qn.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 Oh=new WeakMap;var sj={id:"subtitle",start(e,t,n){const r=new Mb({ctx:e.ctx,options:n,chart:e});qn.configure(e,r,n),qn.addBox(e,r),Oh.set(e,r)},stop(e){qn.removeBox(e,Oh.get(e)),Oh.delete(e)},beforeUpdate(e,t,n){const r=Oh.get(e);qn.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 Ou={average(e){if(!e.length)return!1;let t,n,r=0,i=0,o=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,i+=a.y,++o}}return{x:r/o,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=e.length;o<s;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=Jv(t,c);d<i&&(i=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function ji(e,t){return t&&(Qt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function mo(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
122
122
  `)>-1?e.split(`
123
123
  `):e}function aj(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(i);return{chart:e,label:s,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function WE(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,l=xn(t.bodyFont),c=xn(t.titleFont),d=xn(t.footerFont),f=o.length,g=i.length,p=r.length,v=Ln(t.padding);let b=v.height,x=0,w=r.reduce((P,O)=>P+O.before.length+O.lines.length+O.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,f&&(b+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),w){const P=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=p*P+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}g&&(b+=t.footerMarginTop+g*d.lineHeight+(g-1)*t.footerSpacing);let S=0;const C=function(P){x=Math.max(x,n.measureText(P).width+S)};return n.save(),n.font=c.string,Nt(e.title,C),n.font=l.string,Nt(e.beforeBody.concat(e.afterBody),C),S=t.displayColors?s+2+t.boxPadding:0,Nt(r,P=>{Nt(P.before,C),Nt(P.lines,C),Nt(P.after,C)}),S=0,n.font=d.string,Nt(e.footer,C),n.restore(),x+=v.width,{width:x,height:b}}function lj(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function cj(e,t,n,r){const{x:i,width:o}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&i+o+s>t.width||e==="right"&&i-o-s<0)return!0}function uj(e,t,n,r){const{x:i,width:o}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=o/2?c="left":i>=s-o/2&&(c="right"),cj(c,e,t,n)&&(c="center"),c}function UE(e,t,n){const r=n.yAlign||t.yAlign||lj(e,n);return{xAlign:n.xAlign||t.xAlign||uj(e,t,n,r),yAlign:r}}function dj(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function fj(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function qE(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=i+o,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=ta(s);let v=dj(t,a);const b=fj(t,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(d,g)+i:a==="right"&&(v+=Math.max(f,p)+i),{x:Dn(v,0,r.width-t.width),y:Dn(b,0,r.height-t.height)}}function Ph(e,t,n){const r=Ln(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function GE(e){return ji([],mo(e))}function hj(e,t,n){return ts(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function YE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const KE={beforeTitle:co,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:co,beforeBody:co,beforeLabel:co,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 yt(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:co,afterBody:co,beforeFooter:co,footer:co,afterFooter:co};function lr(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?KE[t].call(n,r):i}let XE=(Ux=class extends go{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()),i=r.enabled&&n.options.animation&&r.animations,o=new $C(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=hj(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=lr(r,"beforeTitle",this,t),o=lr(r,"title",this,t),s=lr(r,"afterTitle",this,t);let a=[];return a=ji(a,mo(i)),a=ji(a,mo(o)),a=ji(a,mo(s)),a}getBeforeBody(t,n){return GE(lr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Nt(t,o=>{const s={before:[],lines:[],after:[]},a=YE(r,o);ji(s.before,mo(lr(a,"beforeLabel",this,o))),ji(s.lines,lr(a,"label",this,o)),ji(s.after,mo(lr(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return GE(lr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=lr(r,"beforeFooter",this,t),o=lr(r,"footer",this,t),s=lr(r,"afterFooter",this,t);let a=[];return a=ji(a,mo(i)),a=ji(a,mo(o)),a=ji(a,mo(s)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(aj(this.chart,n[l]));return t.filter&&(a=a.filter((d,f,g)=>t.filter(d,f,g,r))),t.itemSort&&(a=a.sort((d,f)=>t.itemSort(d,f,r))),Nt(a,d=>{const f=YE(t.callbacks,d);i.push(lr(f,"labelColor",this,d)),o.push(lr(f,"labelPointStyle",this,d)),s.push(lr(f,"labelTextColor",this,d))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,s=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=Ou[r.position].call(this,i,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=WE(this,r),c=Object.assign({},a,l),d=UE(this.chart,r,c),f=qE(r,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={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,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:f}=ta(a),{x:g,y:p}=t,{width:v,height:b}=n;let x,w,S,C,P,O;return o==="center"?(P=p+b/2,i==="left"?(x=g,w=x-s,C=P+s,O=P-s):(x=g+v,w=x+s,C=P-s,O=P+s),S=x):(i==="left"?w=g+Math.max(l,d)+s:i==="right"?w=g+v-Math.max(c,f)-s:w=this.caretX,o==="top"?(C=p,P=C-s,x=w-s,S=w+s):(C=p+b,P=C+s,x=w+s,S=w-s),O=C),{x1:x,x2:w,x3:S,y1:C,y2:P,y3:O}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,l;if(o){const c=Sl(r.rtl,this.x,this.width);for(t.x=Ph(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=xn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,o){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,d=xn(o.bodyFont),f=Ph(this,"left",o),g=i.x(f),p=l<d.lineHeight?(d.lineHeight-l)/2:0,v=n.y+p;if(o.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=i.leftForLtr(g,c)+c/2,w=v+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,sb(t,b,x,w),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,sb(t,b,x,w)}else{t.lineWidth=_t(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=i.leftForLtr(g,c),x=i.leftForLtr(i.xPlus(g,1),c-2),w=ta(s.borderRadius);Object.values(w).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,pu(t,{x:b,y:v,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),pu(t,{x,y:v+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.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:i}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=r,f=xn(r.bodyFont);let g=f.lineHeight,p=0;const v=Sl(r.rtl,this.x,this.width),b=function(I){n.fillText(I,v.x(t.x+p),t.y+g/2),t.y+=g+o},x=v.textAlign(s);let w,S,C,P,O,k,T;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=Ph(this,x,r),n.fillStyle=r.bodyColor,Nt(this.beforeBody,b),p=a&&x!=="right"?s==="center"?c/2+d:c+2+d:0,P=0,k=i.length;P<k;++P){for(w=i[P],S=this.labelTextColors[P],n.fillStyle=S,Nt(w.before,b),C=w.lines,a&&C.length&&(this._drawColorBox(n,t,P,v,r),g=Math.max(f.lineHeight,l)),O=0,T=C.length;O<T;++O)b(C[O]),g=f.lineHeight;Nt(w.after,b)}p=0,g=f.lineHeight,Nt(this.afterBody,b),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let s,a;if(o){const l=Sl(r.rtl,this.x,this.width);for(t.x=Ph(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=xn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<o;++a)n.fillText(i[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:d}=r,{topLeft:f,topRight:g,bottomLeft:p,bottomRight:v}=ta(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,l),s==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-g,l),n.quadraticCurveTo(a+c,l,a+c,l+g),s==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+d-v),n.quadraticCurveTo(a+c,l+d,a+c-v,l+d),s==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+p,l+d),n.quadraticCurveTo(a,l+d,a,l+d-p),s==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const s=Ou[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=WE(this,t),l=Object.assign({},s,this._size),c=UE(n,t,l),d=qE(t,l,c,n);(i._to!==d.x||o._to!==d.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,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Ln(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(o,t,i,n),DC(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),MC(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=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}}),o=!eh(r,i),s=this._positionChanged(i,n);(o||s)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],s=this._getActiveElements(t,o,n,r),a=this._positionChanged(s,t),l=n||!eh(s,o)||a;return l&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)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,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,s=Ou[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}},Me(Ux,"positioners",Ou),Ux);var pj={id:"tooltip",_element:XE,positioners:Ou,afterInit(e,t,n){n&&(e.tooltip=new XE({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:KE},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"]},gj=Object.freeze({__proto__:null,Colors:P$,Decimation:T$,Filler:Q$,Legend:rj,SubTitle:sj,Title:oj,Tooltip:pj});const mj=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function vj(e,t,n,r){const i=e.indexOf(t);if(i===-1)return mj(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const bj=(e,t)=>e===null?null:Dn(Math.round(e),0,t);function QE(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Tb extends aa{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:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(yt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:vj(r,t,rt(n,t),this._addedLabels),bj(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)i.push({value:s});return i}getLabelForValue(t){return QE.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}}Me(Tb,"id","category"),Me(Tb,"defaults",{ticks:{callback:QE}});function yj(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:d,maxDigits:f,includeBounds:g}=e,p=o||1,v=d-1,{min:b,max:x}=t,w=!yt(s),S=!yt(a),C=!yt(c),P=(x-b)/(f+1);let O=eC((x-b)/v/p)*p,k,T,I,F;if(O<1e-14&&!w&&!S)return[{value:b},{value:x}];F=Math.ceil(x/O)-Math.floor(b/O),F>v&&(O=eC(F*O/v/p)*p),yt(l)||(k=Math.pow(10,l),O=Math.ceil(O*k)/k),i==="ticks"?(T=Math.floor(b/O)*O,I=Math.ceil(x/O)*O):(T=b,I=x),w&&S&&o&&h9((a-s)/o,O/1e3)?(F=Math.round(Math.min((a-s)/O,d)),O=(a-s)/F,T=s,I=a):C?(T=w?s:T,I=S?a:I,F=c-1,O=(I-T)/F):(F=(I-T)/O,cu(F,Math.round(F),O/1e3)?F=Math.round(F):F=Math.ceil(F));const j=Math.max(nC(O),nC(T));k=Math.pow(10,yt(l)?j:l),T=Math.round(T*k)/k,I=Math.round(I*k)/k;let B=0;for(w&&(g&&T!==s?(n.push({value:s}),T<s&&B++,cu(Math.round((T+B*O)*k)/k,s,ZE(s,P,e))&&B++):T<s&&B++);B<F;++B){const V=Math.round((T+B*O)*k)/k;if(S&&V>a)break;n.push({value:V})}return S&&g&&I!==a?n.length&&cu(n[n.length-1].value,a,ZE(a,P,e))?n[n.length-1].value=a:n.push({value:a}):(!S||I===a)&&n.push({value:I}),n}function ZE(e,t,{horizontal:n,minRotation:r}){const i=yi(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class kh extends aa{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 yt(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:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=Fi(i),c=Fi(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={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},o=this._range||this,s=yj(i,o);return t.bounds==="ticks"&&tC(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 i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return fu(t,this.chart.options.locale,this.options.ticks.format)}}class Ab extends kh{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=fn(t)?t:0,this.max=fn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=yi(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Me(Ab,"id","linear"),Me(Ab,"defaults",{ticks:{callback:ih.formatters.numeric}});const Pu=e=>Math.floor(es(e)),la=(e,t)=>Math.pow(10,Pu(e)+t);function JE(e){return e/Math.pow(10,Pu(e))===1}function e2(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function xj(e,t){const n=t-e;let r=Pu(n);for(;e2(e,t,r)>10;)r++;for(;e2(e,t,r)<10;)r--;return Math.min(r,Pu(e))}function wj(e,{min:t,max:n}){t=Or(e.min,t);const r=[],i=Pu(t);let o=xj(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,d=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-d)/Math.pow(10,o)),g=Or(e.min,Math.round((l+d+f*Math.pow(10,o))*s)/s);for(;g<n;)r.push({value:g,major:JE(g),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,s=o>=0?1:s),g=Math.round((l+d+f*Math.pow(10,o))*s)/s;const p=Or(e.max,g);return r.push({value:p,major:JE(p),significand:f}),r}class Ib extends aa{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=kh.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return fn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=fn(t)?Math.max(0,t):null,this.max=fn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!fn(this._userMin)&&(this.min=t===la(this.min,0)?la(this.min,-1):la(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(la(r,-1)),s(la(i,1)))),r<=0&&o(la(i,-1)),i<=0&&s(la(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=wj(n,this);return t.bounds==="ticks"&&tC(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":fu(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)}}Me(Ib,"id","logarithmic"),Me(Ib,"defaults",{ticks:{callback:ih.formatters.logarithmic,major:{enabled:!0}}});function Nb(e){const t=e.ticks;if(t.display&&e.display){const n=Ln(t.backdropPadding);return rt(t.font&&t.font.size,an.font.size)+n.height}return 0}function _j(e,t,n){return n=Qt(n)?n:[n],{w:M9(e,t.string,n),h:n.length*t.lineHeight}}function t2(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Sj(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=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Zt/o:0;for(let l=0;l<o;l++){const c=s.setContext(e.getPointLabelContext(l));i[l]=c.padding;const d=e.getPointPosition(l,e.drawingArea+i[l],a),f=xn(c.font),g=_j(e.ctx,f,e._pointLabels[l]);r[l]=g;const p=Pr(e.getIndexAngle(l)+a),v=Math.round(Zv(p)),b=t2(v,d.x,g.w,0,180),x=t2(v,d.y,g.h,90,270);Cj(n,t,p,b,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Pj(e,r,i)}function Cj(e,t,n,r,i){const o=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)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/s,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function Ej(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(Zv(Pr(l.angle+pn))),d=Mj(l.y,a.h,c),f=kj(c),g=Dj(l.x,a.w,f);return{visible:!0,x:l.x,y:d,textAlign:f,left:g,top:d,right:g+a.w,bottom:d+a.h}}function Oj(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(ho({x:n,y:r},t)||ho({x:n,y:o},t)||ho({x:i,y:r},t)||ho({x:i,y:o},t))}function Pj(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:Nb(o)/2,additionalAngle:s?Zt/i:0};let c;for(let d=0;d<i;d++){l.padding=n[d],l.size=t[d];const f=Ej(e,d,l);r.push(f),a==="auto"&&(f.visible=Oj(f,c),f.visible&&(c=f))}return r}function kj(e){return e===0||e===180?"center":e<180?"left":"right"}function Dj(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Mj(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Tj(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!yt(a)){const l=ta(t.borderRadius),c=Ln(t.backdropPadding);e.fillStyle=a;const d=r-c.left,f=i-c.top,g=o-r+c.width,p=s-i+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),pu(e,{x:d,y:f,w:g,h:p,radius:l}),e.fill()):e.fillRect(d,f,g,p)}}function Aj(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));Tj(n,s,o);const a=xn(s.font),{x:l,y:c,textAlign:d}=o;ea(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:d,textBaseline:"middle"})}}function n2(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Jt);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s<r;s++)o=e.getPointPosition(s,t),i.lineTo(o.x,o.y)}}function Ij(e,t,n,r,i){const o=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(i.dash),o.lineDashOffset=i.dashOffset,o.beginPath(),n2(e,n,s,r),o.closePath(),o.stroke(),o.restore())}function Nj(e,t,n){return ts(e,{label:n,index:t,type:"pointLabel"})}class ku extends kh{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=Ln(Nb(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=fn(t)&&!isNaN(t)?t:0,this.max=fn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Nb(this.options))}generateTickLabels(t){kh.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=jt(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?Sj(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=Jt/(this._pointLabels.length||1),r=this.options.startAngle||0;return Pr(t*n+yi(r))}getDistanceFromCenterForValue(t){if(yt(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(yt(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 Nj(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-pn+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}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:i,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),n2(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:i,border:o}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&Aj(this,s),i.display&&this.ticks.forEach((d,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(d.value);const g=this.getContext(f),p=i.setContext(g),v=o.setContext(g);Ij(this,p,l,s,v)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const d=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:g}=d;!g||!f||(t.lineWidth=g,t.strokeStyle=f,t.setLineDash(d.borderDash),t.lineDashOffset=d.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 i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),d=xn(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=Ln(c.backdropPadding);t.fillRect(-s/2-f.left,-o-d.size/2-f.top,s+f.width,d.size+f.height)}ea(t,a.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Me(ku,"id","radialLinear"),Me(ku,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ih.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Me(ku,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Me(ku,"descriptors",{angleLines:{_fallback:"grid"}});const Dh={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}},cr=Object.keys(Dh);function r2(e,t){return e-t}function i2(e,t){if(yt(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),fn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(xl(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function o2(e,t,n,r){const i=cr.length;for(let o=cr.indexOf(e);o<i-1;++o){const s=Dh[cr[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return cr[o]}return cr[i-1]}function Rj(e,t,n,r,i){for(let o=cr.length-1;o>=cr.indexOf(n);o--){const s=cr[o];if(Dh[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return cr[n?cr.indexOf(n):0]}function Lj(e){for(let t=cr.indexOf(e)+1,n=cr.length;t<n;++t)if(Dh[cr[t]].common)return cr[t]}function s2(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=eb(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function Fj(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function a2(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s<o;++s)a=t[s],i[a]=s,r.push({value:a,major:!1});return o===0||!n?r:Fj(e,r,i,n)}class Du extends aa{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={}),i=this._adapter=new qF._date(t.adapters.date);i.init(n),au(r.displayFormats,i.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:i2(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:i,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=fn(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=fn(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_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,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,s=this.max,a=v9(i,o,s);return this._unit=n.unit||(r.autoSkip?o2(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Rj(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Lj(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),a2(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Dn(n,0,s),r=Dn(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||o2(o.minUnit,n,r,this._getLabelCapacity(n)),a=rt(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=xl(l)||l===!0,d={};let f=n,g,p;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=i.ticks.source==="data"&&this.getDataTimestamps();for(g=f,p=0;g<r;g=+t.add(g,a,s),p++)s2(d,g,v);return(g===r||i.bounds==="ticks"||p===1)&&s2(d,g,v),Object.keys(d).sort(r2).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 i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return jt(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],f=c&&a[c],g=r[n],p=c&&f&&g&&g.major;return this._adapter.format(t,i||(p?f:d))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.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,i=yi(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),s=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*s,h:r*s+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,a2(this,[t],this._majorUnit),i),s=this._getLabelSize(o),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 i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[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 i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(i2(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return sC(t.sort(r2))}}Me(Du,"id","time"),Me(Du,"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,i=e.length-1,o,s,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=fo(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=fo(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class Rb extends Du{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,i=[],o=[];let s,a,l,c,d;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;s<a;++s)d=i[s+1],l=i[s-1],c=i[s],Math.round((d+l)/2)!==c&&o.push({time:c,pos:s/(a-1)});return o}_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((i,o)=>i-o)}_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)}}Me(Rb,"id","timeseries"),Me(Rb,"defaults",Du.defaults);var $j=Object.freeze({__proto__:null,CategoryScale:Tb,LinearScale:Ab,LogarithmicScale:Ib,RadialLinearScale:ku,TimeScale:Du,TimeSeriesScale:Rb});const jj=[UF,w$,gj,$j];/*!
124
124
  * chartjs-plugin-datalabels v2.2.0
@@ -126,7 +126,7 @@ Valid keys: `+JSON.stringify(Object.keys(A),null," "));var te=we(pe,ie,ue,xe,ge
126
126
  * (c) 2017-2022 chartjs-plugin-datalabels contributors
127
127
  * Released under the MIT license
128
128
  */var l2=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}(),Mu={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
129
- `)):Array.isArray(n)?e.push.apply(e,n):yt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),i=r.length,o=e.font,s=0,a;for(e.font=n.string,a=0;a<i;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=o,{height:i*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=[],i,o,s,a;for(i=0,s=t.length;i<s;++i)a=t[i],o=n.indexOf(a),o===-1?r.push([a,1]):n.splice(o,1);for(i=0,s=n.length;i<s;++i)r.push([n[i],-1]);return r},rasterize:function(e){return Math.round(e*l2)/l2}};function Lb(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 i=e.x-n,o=e.y-r,s=Math.sqrt(i*i+o*o);return{x:s?i/s:0,y:s?o/s:-1}}function zj(e,t,n,r,i){switch(i){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:i*=Math.PI/180,n=Math.cos(i),r=Math.sin(i);break}return{x:e,y:t,vx:n,vy:r}}var Bj=0,c2=1,u2=2,d2=4,f2=8;function Th(e,t,n){var r=Bj;return e<n.left?r|=c2:e>n.right&&(r|=u2),t<n.top?r|=f2:t>n.bottom&&(r|=d2),r}function Vj(e,t){for(var n=e.x0,r=e.y0,i=e.x1,o=e.y1,s=Th(n,r,t),a=Th(i,o,t),l,c,d;!(!(s|a)||s&a);)l=s||a,l&f2?(c=n+(i-n)*(t.top-r)/(o-r),d=t.top):l&d2?(c=n+(i-n)*(t.bottom-r)/(o-r),d=t.bottom):l&u2?(d=r+(o-r)*(t.right-n)/(i-n),c=t.right):l&c2&&(d=r+(o-r)*(t.left-n)/(i-n),c=t.left),l===s?(n=c,r=d,s=Th(n,r,t)):(i=c,o=d,a=Th(i,o,t));return{x0:n,x1:i,y0:r,y1:o}}function Ah(e,t){var n=t.anchor,r=e,i,o;return t.clamp&&(r=Vj(r,t.area)),n==="start"?(i=r.x0,o=r.y0):n==="end"?(i=r.x1,o=r.y1):(i=(r.x0+r.x1)/2,o=(r.y0+r.y1)/2),zj(i,o,e.vx,e.vy,t.align)}var Ih={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),i=Math.sin(n),o=e.innerRadius,s=e.outerRadius;return Ah({x0:e.x+r*o,y0:e.y+i*o,x1:e.x+r*s,y1:e.y+i*s,vx:r,vy:i},t)},point:function(e,t){var n=Lb(e,t.origin),r=n.x*e.options.radius,i=n.y*e.options.radius;return Ah({x0:e.x-r,y0:e.y-i,x1:e.x+r,y1:e.y+i,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=Lb(e,t.origin),r=e.x,i=e.y,o=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),o=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),Ah({x0:r,y0:i+s,x1:r+o,y1:i,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=Lb(e,t.origin);return Ah({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)}},vo=Mu.rasterize;function Hj(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,i=e.size.width,o=-i/2,s=-r/2;return{frame:{x:o-n.left-t,y:s-n.top-t,w:i+n.width+t*2,h:r+n.height+t*2},text:{x:o,y:s,w:i,h:r}}}function Wj(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 Uj(e){return e instanceof El?Ih.arc:e instanceof Cu?Ih.point:e instanceof Eu?Ih.bar:Ih.fallback}function qj(e,t,n,r,i,o){var s=Math.PI/2;if(o){var a=Math.min(o,i/2,r/2),l=t+a,c=n+a,d=t+r-a,f=n+i-a;e.moveTo(t,c),l<d&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(d,c,a,-s,0),e.arc(d,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<d?(e.moveTo(l,n),e.arc(d,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,i)}function Gj(e,t,n){var r=n.backgroundColor,i=n.borderColor,o=n.borderWidth;!r&&(!i||!o)||(e.beginPath(),qj(e,vo(t.x)+o/2,vo(t.y)+o/2,vo(t.w)-o,vo(t.h)-o,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),i&&o&&(e.strokeStyle=i,e.lineWidth=o,e.lineJoin="miter",e.stroke()))}function Yj(e,t,n){var r=n.lineHeight,i=e.w,o=e.x,s=e.y+r/2;return t==="center"?o+=i/2:(t==="end"||t==="right")&&(o+=i),{h:r,w:i,x:o,y:s}}function Kj(e,t,n){var r=e.shadowBlur,i=n.stroked,o=vo(n.x),s=vo(n.y),a=vo(n.w);i&&e.strokeText(t,o,s,a),n.filled&&(r&&i&&(e.shadowBlur=0),e.fillText(t,o,s,a),r&&i&&(e.shadowBlur=r))}function Xj(e,t,n,r){var i=r.textAlign,o=r.color,s=!!o,a=r.font,l=t.length,c=r.textStrokeColor,d=r.textStrokeWidth,f=c&&d,g;if(!(!l||!s&&!f))for(n=Yj(n,i,a),e.font=a.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=o),f&&(e.lineJoin="round",e.lineWidth=d,e.strokeStyle=c),g=0,l=t.length;g<l;++g)Kj(e,t[g],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*g})}var h2=function(e,t,n,r){var i=this;i._config=e,i._index=r,i._model=null,i._rects=null,i._ctx=t,i._el=n};Li(h2.prototype,{_modelize:function(e,t,n,r){var i=this,o=i._index,s=xn(en([n.font,{}],r,o)),a=en([n.color,an.color],r,o);return{align:en([n.align,"center"],r,o),anchor:en([n.anchor,"center"],r,o),area:r.chart.chartArea,backgroundColor:en([n.backgroundColor,null],r,o),borderColor:en([n.borderColor,null],r,o),borderRadius:en([n.borderRadius,0],r,o),borderWidth:en([n.borderWidth,0],r,o),clamp:en([n.clamp,!1],r,o),clip:en([n.clip,!1],r,o),color:a,display:e,font:s,lines:t,offset:en([n.offset,4],r,o),opacity:en([n.opacity,1],r,o),origin:Wj(i._el,r),padding:Ln(en([n.padding,4],r,o)),positioner:Uj(i._el),rotation:en([n.rotation,0],r,o)*(Math.PI/180),size:Mu.textSize(i._ctx,t,s),textAlign:en([n.textAlign,"start"],r,o),textShadowBlur:en([n.textShadowBlur,0],r,o),textShadowColor:en([n.textShadowColor,a],r,o),textStrokeColor:en([n.textStrokeColor,a],r,o),textStrokeWidth:en([n.textStrokeWidth,0],r,o)}},update:function(e){var t=this,n=null,r=null,i=t._index,o=t._config,s,a,l,c=en([o.display,!0],e,i);c&&(s=e.dataset.data[i],a=rt(jt(o.formatter,[s,e]),s),l=yt(a)?[]:Mu.toTextLines(a),l.length&&(n=t._modelize(c,l,o,e),r=Hj(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,i=n._model,o=n._rects,s;this.visible()&&(r.save(),i.clip&&(s=i.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=Mu.bound(0,i.opacity,1),r.translate(vo(t.x),vo(t.y)),r.rotate(i.rotation),Gj(r,o.frame,i),Xj(r,i.lines,o.text,i),r.restore())}});var Qj=Number.MIN_SAFE_INTEGER||-9007199254740991,Zj=Number.MAX_SAFE_INTEGER||9007199254740991;function Tu(e,t,n){var r=Math.cos(n),i=Math.sin(n),o=t.x,s=t.y;return{x:o+r*(e.x-o)-i*(e.y-s),y:s+i*(e.x-o)+r*(e.y-s)}}function p2(e,t){var n=Zj,r=Qj,i=t.origin,o,s,a,l,c;for(o=0;o<e.length;++o)s=e[o],a=s.x-i.x,l=s.y-i.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function Nh(e,t){var n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var g2=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Li(g2.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=Tu(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[Nh(t[0],t[1]),Nh(t[0],t[3])],i,o,s;for(this._rotation!==e._rotation&&r.push(Nh(n[0],n[1]),Nh(n[0],n[3])),i=0;i<r.length;++i)if(o=p2(t,r[i]),s=p2(n,r[i]),o.max<s.min||s.max<o.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Tu({x:t.x,y:t.y},r,n),Tu({x:t.x+t.w,y:t.y},r,n),Tu({x:t.x+t.w,y:t.y+t.h},r,n),Tu({x:t.x,y:t.y+t.h},r,n)]}});function m2(e,t,n){var r=t.positioner(e,t),i=r.vx,o=r.vy;if(!i&&!o)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)),d=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(i),Math.abs(o));return c*=i*f,d*=o*f,c+=t.offset*i,d+=t.offset*o,{x:r.x+c,y:r.y+d}}function Jj(e,t){var n,r,i,o;for(n=e.length-1;n>=0;--n)for(i=e[n].$layout,r=n-1;r>=0&&i._visible;--r)o=e[r].$layout,o._visible&&i._box.intersects(o._box)&&t(i,o);return e}function ez(e){var t,n,r,i,o,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],i=r.$layout,i._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=r.geometry(),s=m2(a,r.model(),o),i._box.update(s,o,r.rotation()));return Jj(e,function(l,c){var d=l._hidable,f=c._hidable;d&&f||f?c._visible=!1:d&&(l._visible=!1)})}var Au={prepare:function(e){var t=[],n,r,i,o,s;for(n=0,i=e.length;n<i;++n)for(r=0,o=e[n].length;r<o;++r)s=e[n][r],t.push(s),s.$layout={_box:new g2,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,d=l.$layout;return c._idx===d._idx?d._set-c._set:d._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,i,o,s;for(n=0,r=e.length;n<r;++n)i=e[n],o=i.model(),s=i.$layout,s._hidable=o&&o.display==="auto",s._visible=i.visible(),t|=s._hidable;t&&ez(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,i,o,s,a;for(n=0,r=t.length;n<r;++n)i=t[n],o=i.$layout,o._visible&&(s=i.geometry(),a=m2(i._el,i.model(),s),o._box.update(a,s,i.rotation()),i.draw(e,a))}},tz=function(e){if(yt(e))return null;var t=e,n,r,i;if(_t(e))if(!yt(e.label))t=e.label;else if(!yt(e.r))t=e.r;else for(t="",n=Object.keys(e),i=0,r=n.length;i<r;++i)t+=(i!==0?", ":"")+n[i]+": "+e[n[i]];return""+t},nz={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:tz,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},ur="$datalabels",v2="$default";function rz(e,t){var n=e.datalabels,r={},i=[],o,s;return n===!1?null:(n===!0&&(n={}),t=Li({},[t,n]),o=t.labels||{},s=Object.keys(o),delete t.labels,s.length?s.forEach(function(a){o[a]&&i.push(Li({},[t,o[a],{_key:a}]))}):i.push(t),r=i.reduce(function(a,l){return Nt(l.listeners||{},function(c,d){a[d]=a[d]||{},a[d][l._key||v2]=c}),delete l.listeners,a},{}),{labels:i,listeners:r})}function Fb(e,t,n,r){if(t){var i=n.$context,o=n.$groups,s;t[o._set]&&(s=t[o._set][o._key],s&&jt(s,[i,r])===!0&&(e[ur]._dirty=!0,n.update(i)))}}function iz(e,t,n,r,i){var o,s;!n&&!r||(n?r?n!==r&&(s=o=!0):s=!0:o=!0,s&&Fb(e,t.leave,n,i),o&&Fb(e,t.enter,r,i))}function oz(e,t){var n=e[ur],r=n._listeners,i,o;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")o=Au.lookup(n._labels,t);else if(t.type!=="mouseout")return;i=n._hovered,n._hovered=o,iz(e,r,i,o,t)}}function sz(e,t){var n=e[ur],r=n._listeners.click,i=r&&Au.lookup(n._labels,t);i&&Fb(e,r,i,t)}var az={id:"datalabels",defaults:nz,beforeInit:function(e){e[ur]={_actives:[]}},beforeUpdate:function(e){var t=e[ur];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,i=e[ur],o=i._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=rz(a,n),c=t.meta.data||[],d=e.ctx,f,g,p,v,b,x,w,S;for(d.save(),f=0,p=c.length;f<p;++f)if(w=c[f],w[ur]=[],s&&w&&e.getDataVisibility(f)&&!w.skip)for(g=0,v=l.labels.length;g<v;++g)b=l.labels[g],x=b._key,S=new h2(b,d,w,f),S.$groups={_set:r,_key:x||v2},S.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},S.update(S.$context),w[ur].push(S),o.push(S);d.restore(),Li(i._listeners,l.listeners,{merger:function(C,P,O){P[C]=P[C]||{},P[C][t.index]=O[C],i._listened=!0}})},afterUpdate:function(e){e[ur]._labels=Au.prepare(e[ur]._datasets)},afterDatasetsDraw:function(e){Au.draw(e,e[ur]._labels)},beforeEvent:function(e,t){if(e[ur]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":oz(e,n);break;case"click":sz(e,n);break}}},afterEvent:function(e){var t=e[ur],n=t._actives,r=t._actives=e.getActiveElements(),i=Mu.arrayDiff(n,r),o,s,a,l,c,d,f;for(o=0,s=i.length;o<s;++o)if(c=i[o],c[1])for(f=c[0].element[ur]||[],a=0,l=f.length;a<l;++a)d=f[a],d.$context.active=c[1]===1,d.update(d.$context);(t._dirty||i.length)&&(Au.update(t._labels),e.render()),delete t._dirty}};Zr.register(...jj),Zr.register(az);function $b({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,i]=m.useState(),o=fe(l=>l.themeStyle);m.useEffect(()=>{var d,f,g,p;(f=(d=o==null?void 0:o.chart)==null?void 0:d.font)!=null&&f.family&&(Zr.defaults.font={...Zr.defaults.font,...(g=o==null?void 0:o.chart)==null?void 0:g.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(p=n==null?void 0:n.current)==null?void 0:p.getContext("2d");if(!l)return;let c;try{c=new Zr(l,e),i(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=o==null?void 0:o.chart)==null?void 0:a.font]);function s(l){var d,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const g=c[0].datasetIndex,p=c[0].index,v=(f=(d=c[0].element)==null?void 0:d.$context)==null?void 0:f.raw;t==null||t(r,g,p,v)}else console.log("no points")}return _.jsx("div",{onClick:s,className:" relative h-[99%] xbg-red-100",children:_.jsx("canvas",{ref:n})})}function Jr(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var lz=["color"],b2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,lz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),cz=["color"],uz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,cz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),dz=["color"],y2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,dz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),fz=["color"],ca=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,fz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),hz=["color"],pz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,hz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),gz=["color"],mz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,gz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),vz=["color"],bz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,vz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),yz=["color"],jb=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,yz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),xz=["color"],wz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,xz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),_z=["color"],Sz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,_z);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),Cz=["color"],x2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,Cz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),Ez=["color"],w2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,Ez);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});function Oz({frame:e}){const t=fe(w=>w.isDashboardEditing),n=fe(w=>w.filterValues),r=fe(w=>w.isVisualEditing),i=fe(w=>w.selectedSheetId),{removeFrame:o}=fe(w=>w.actions),s=fe(w=>w.actions.setIsVisualEditing),a=ve(w=>w.actions.setFilterValues),l=ve(w=>w.actions.setApplyFilters),{setCard:c,setFrame:d}=ve(w=>w.actions),f=ve(w=>w.actions.setSelectedConnectionId),g=ve(w=>w.actions.setSelectedDatabaseName),p=ve(w=>w.actions.setSelectedSchemaName),v=ve(w=>w.actions.setSelectedTableName),b=e.cards.find(w=>w.id===e.activeCardId);function x(){s(!r),c(b),d(e),b!=null&&b.connectionId&&f(b==null?void 0:b.connectionId),b!=null&&b.lastSelectedDatabase&&g(b==null?void 0:b.lastSelectedDatabase),b!=null&&b.lastSelectedSchema&&p(b==null?void 0:b.lastSelectedSchema),b!=null&&b.lastSelectedTable&&v(b==null?void 0:b.lastSelectedTable),n&&(a(n),l(!0))}return _.jsx("section",{className:"absolute right-2 top-2 z-10",children:t&&_.jsxs("div",{className:"flex items-center gap-2",children:[r?_.jsx(mz,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}):_.jsx(bz,{role:"edit-visual",onClick:x,className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}),_.jsx(ca,{onClick:()=>o(i,e.id),className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"})]})})}function Pz(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e);m.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const zb="dismissableLayer.update",kz="dismissableLayer.pointerDownOutside",Dz="dismissableLayer.focusOutside";let _2;const Mz=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ol=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,d=m.useContext(Mz),[f,g]=m.useState(null),p=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),b=nt(t,I=>g(I)),x=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(w),C=f?x.indexOf(f):-1,P=d.layersWithOutsidePointerEventsDisabled.size>0,O=C>=S,k=Tz(I=>{const F=I.target,j=[...d.branches].some(B=>B.contains(F));!O||j||(o==null||o(I),a==null||a(I),I.defaultPrevented||l==null||l())},p),T=Az(I=>{const F=I.target;[...d.branches].some(B=>B.contains(F))||(s==null||s(I),a==null||a(I),I.defaultPrevented||l==null||l())},p);return Pz(I=>{C===d.layers.size-1&&(i==null||i(I),!I.defaultPrevented&&l&&(I.preventDefault(),l()))},p),m.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(_2=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),S2(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=_2)}},[f,p,r,d]),m.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),S2())},[f,d]),m.useEffect(()=>{const I=()=>v({});return document.addEventListener(zb,I),()=>document.removeEventListener(zb,I)},[]),m.createElement(He.div,se({},c,{ref:b,style:{pointerEvents:P?O?"auto":"none":void 0,...e.style},onFocusCapture:Pe(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Pe(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Pe(e.onPointerDownCapture,k.onPointerDownCapture)}))});function Tz(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e),r=m.useRef(!1),i=m.useRef(()=>{});return m.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){C2(kz,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Az(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e),r=m.useRef(!1);return m.useEffect(()=>{const i=o=>{o.target&&!r.current&&C2(Dz,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function S2(){const e=new CustomEvent(zb);document.dispatchEvent(e)}function C2(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?b_(i,o):i.dispatchEvent(o)}const Iz=["top","right","bottom","left"],is=Math.min,kr=Math.max,Rh=Math.round,Lh=Math.floor,os=e=>({x:e,y:e}),Nz={left:"right",right:"left",bottom:"top",top:"bottom"},Rz={start:"end",end:"start"};function Bb(e,t,n){return kr(e,is(t,n))}function bo(e,t){return typeof e=="function"?e(t):e}function yo(e){return e.split("-")[0]}function Pl(e){return e.split("-")[1]}function Vb(e){return e==="x"?"y":"x"}function Hb(e){return e==="y"?"height":"width"}function kl(e){return["top","bottom"].includes(yo(e))?"y":"x"}function Wb(e){return Vb(kl(e))}function Lz(e,t,n){n===void 0&&(n=!1);const r=Pl(e),i=Wb(e),o=Hb(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Fh(s)),[s,Fh(s)]}function Fz(e){const t=Fh(e);return[Ub(e),t,Ub(t)]}function Ub(e){return e.replace(/start|end/g,t=>Rz[t])}function $z(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function jz(e,t,n,r){const i=Pl(e);let o=$z(yo(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Ub)))),o}function Fh(e){return e.replace(/left|right|bottom|top/g,t=>Nz[t])}function zz(e){return{top:0,right:0,bottom:0,left:0,...e}}function E2(e){return typeof e!="number"?zz(e):{top:e,right:e,bottom:e,left:e}}function $h(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function O2(e,t,n){let{reference:r,floating:i}=e;const o=kl(t),s=Wb(t),a=Hb(s),l=yo(t),c=o==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Pl(t)){case"start":p[s]-=g*(n&&c?-1:1);break;case"end":p[s]+=g*(n&&c?-1:1);break}return p}const Bz=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=O2(c,r,l),g=r,p={},v=0;for(let b=0;b<a.length;b++){const{name:x,fn:w}=a[b],{x:S,y:C,data:P,reset:O}=await w({x:d,y:f,initialPlacement:r,placement:g,strategy:i,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});if(d=S??d,f=C??f,p={...p,[x]:{...p[x],...P}},O&&v<=50){v++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:d,y:f}=O2(c,g,l)),b=-1;continue}}return{x:d,y:f,placement:g,strategy:i,middlewareData:p}};async function Iu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=bo(t,e),v=E2(p),x=a[g?f==="floating"?"reference":"floating":f],w=$h(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),S=f==="floating"?{...s.floating,x:r,y:i}:s.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),P=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},O=$h(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:C,strategy:l}):S);return{top:(w.top-O.top+v.top)/P.y,bottom:(O.bottom-w.bottom+v.bottom)/P.y,left:(w.left-O.left+v.left)/P.x,right:(O.right-w.right+v.right)/P.x}}const P2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=bo(e,t)||{};if(c==null)return{};const f=E2(d),g={x:n,y:r},p=Wb(i),v=Hb(p),b=await s.getDimensions(c),x=p==="y",w=x?"top":"left",S=x?"bottom":"right",C=x?"clientHeight":"clientWidth",P=o.reference[v]+o.reference[p]-g[p]-o.floating[v],O=g[p]-o.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=k?k[C]:0;(!T||!await(s.isElement==null?void 0:s.isElement(k)))&&(T=a.floating[C]||o.floating[v]);const I=P/2-O/2,F=T/2-b[v]/2-1,j=is(f[w],F),B=is(f[S],F),V=j,q=T-b[v]-B,J=T/2-b[v]/2+I,$=Bb(V,J,q),X=!l.arrow&&Pl(i)!=null&&J!=$&&o.reference[v]/2-(J<V?j:B)-b[v]/2<0,W=X?J<V?J-V:J-q:0;return{[p]:g[p]+W,data:{[p]:$,centerOffset:J-$-W,...X&&{alignmentOffset:W}},reset:X}}}),Vz=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...x}=bo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=yo(i),S=yo(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),P=g||(S||!b?[Fh(a)]:Fz(a));!g&&v!=="none"&&P.push(...jz(a,b,v,C));const O=[a,...P],k=await Iu(t,x),T=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&T.push(k[w]),f){const V=Lz(i,s,C);T.push(k[V[0]],k[V[1]])}if(I=[...I,{placement:i,overflows:T}],!T.every(V=>V<=0)){var F,j;const V=(((F=o.flip)==null?void 0:F.index)||0)+1,q=O[V];if(q)return{data:{index:V,overflows:I},reset:{placement:q}};let J=(j=I.filter($=>$.overflows[0]<=0).sort(($,X)=>$.overflows[1]-X.overflows[1])[0])==null?void 0:j.placement;if(!J)switch(p){case"bestFit":{var B;const $=(B=I.map(X=>[X.placement,X.overflows.filter(W=>W>0).reduce((W,ne)=>W+ne,0)]).sort((X,W)=>X[1]-W[1])[0])==null?void 0:B[0];$&&(J=$);break}case"initialPlacement":J=a;break}if(i!==J)return{reset:{placement:J}}}return{}}}};function k2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function D2(e){return Iz.some(t=>e[t]>=0)}const Hz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=bo(e,t);switch(r){case"referenceHidden":{const o=await Iu(t,{...i,elementContext:"reference"}),s=k2(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:D2(s)}}}case"escaped":{const o=await Iu(t,{...i,altBoundary:!0}),s=k2(o,n.floating);return{data:{escapedOffsets:s,escaped:D2(s)}}}default:return{}}}}};async function Wz(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=yo(n),a=Pl(n),l=kl(n)==="y",c=["left","top"].includes(s)?-1:1,d=o&&l?-1:1,f=bo(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),l?{x:p*d,y:g*c}:{x:g*c,y:p*d}}const Uz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await Wz(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},qz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:w,y:S}=x;return{x:w,y:S}}},...l}=bo(e,t),c={x:n,y:r},d=await Iu(t,l),f=kl(yo(i)),g=Vb(f);let p=c[g],v=c[f];if(o){const x=g==="y"?"top":"left",w=g==="y"?"bottom":"right",S=p+d[x],C=p-d[w];p=Bb(S,p,C)}if(s){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",S=v+d[x],C=v-d[w];v=Bb(S,v,C)}const b=a.fn({...t,[g]:p,[f]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},Gz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=bo(e,t),d={x:n,y:r},f=kl(i),g=Vb(f);let p=d[g],v=d[f];const b=bo(a,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const C=g==="y"?"height":"width",P=o.reference[g]-o.floating[C]+x.mainAxis,O=o.reference[g]+o.reference[C]-x.mainAxis;p<P?p=P:p>O&&(p=O)}if(c){var w,S;const C=g==="y"?"width":"height",P=["top","left"].includes(yo(i)),O=o.reference[f]-o.floating[C]+(P&&((w=s.offset)==null?void 0:w[f])||0)+(P?0:x.crossAxis),k=o.reference[f]+o.reference[C]+(P?0:((S=s.offset)==null?void 0:S[f])||0)-(P?x.crossAxis:0);v<O?v=O:v>k&&(v=k)}return{[g]:p,[f]:v}}}},Yz=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=()=>{},...a}=bo(e,t),l=await Iu(t,a),c=yo(n),d=Pl(n),f=kl(n)==="y",{width:g,height:p}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=d===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(b=c,v=d==="end"?"top":"bottom");const x=p-l[v],w=g-l[b],S=!t.middlewareData.shift;let C=x,P=w;if(f){const k=g-l.left-l.right;P=d||S?is(w,k):k}else{const k=p-l.top-l.bottom;C=d||S?is(x,k):k}if(S&&!d){const k=kr(l.left,0),T=kr(l.right,0),I=kr(l.top,0),F=kr(l.bottom,0);f?P=g-2*(k!==0||T!==0?k+T:kr(l.left,l.right)):C=p-2*(I!==0||F!==0?I+F:kr(l.top,l.bottom))}await s({...t,availableWidth:P,availableHeight:C});const O=await i.getDimensions(o.floating);return g!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}};function ss(e){return M2(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xo(e){var t;return(t=(M2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function M2(e){return e instanceof Node||e instanceof Dr(e).Node}function wo(e){return e instanceof Element||e instanceof Dr(e).Element}function zi(e){return e instanceof HTMLElement||e instanceof Dr(e).HTMLElement}function T2(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot}function Nu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ei(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Kz(e){return["table","td","th"].includes(ss(e))}function qb(e){const t=Gb(),n=ei(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 Xz(e){let t=Dl(e);for(;zi(t)&&!jh(t);){if(qb(t))return t;t=Dl(t)}return null}function Gb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jh(e){return["html","body","#document"].includes(ss(e))}function ei(e){return Dr(e).getComputedStyle(e)}function zh(e){return wo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Dl(e){if(ss(e)==="html")return e;const t=e.assignedSlot||e.parentNode||T2(e)&&e.host||xo(e);return T2(t)?t.host:t}function A2(e){const t=Dl(e);return jh(t)?e.ownerDocument?e.ownerDocument.body:e.body:zi(t)&&Nu(t)?t:A2(t)}function Ru(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=A2(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Dr(i);return o?t.concat(s,s.visualViewport||[],Nu(i)?i:[],s.frameElement&&n?Ru(s.frameElement):[]):t.concat(i,Ru(i,[],n))}function I2(e){const t=ei(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=zi(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Rh(n)!==o||Rh(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Yb(e){return wo(e)?e:e.contextElement}function Ml(e){const t=Yb(e);if(!zi(t))return os(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=I2(t);let s=(o?Rh(n.width):n.width)/r,a=(o?Rh(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Qz=os(0);function N2(e){const t=Dr(e);return!Gb()||!t.visualViewport?Qz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zz(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Dr(e)?!1:t}function ua(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Yb(e);let s=os(1);t&&(r?wo(r)&&(s=Ml(r)):s=Ml(e));const a=Zz(o,n,r)?N2(o):os(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(o){const g=Dr(o),p=r&&wo(r)?Dr(r):r;let v=g.frameElement;for(;v&&r&&p!==g;){const b=Ml(v),x=v.getBoundingClientRect(),w=ei(v),S=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*b.x,C=x.top+(v.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,f*=b.y,l+=S,c+=C,v=Dr(v).frameElement}}return $h({width:d,height:f,x:l,y:c})}function Jz(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=zi(n),o=xo(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0},a=os(1);const l=os(0);if((i||!i&&r!=="fixed")&&((ss(n)!=="body"||Nu(o))&&(s=zh(n)),zi(n))){const c=ua(n);a=Ml(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 eB(e){return Array.from(e.getClientRects())}function R2(e){return ua(xo(e)).left+zh(e).scrollLeft}function tB(e){const t=xo(e),n=zh(e),r=e.ownerDocument.body,i=kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+R2(e);const a=-n.scrollTop;return ei(r).direction==="rtl"&&(s+=kr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function nB(e,t){const n=Dr(e),r=xo(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=Gb();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function rB(e,t){const n=ua(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=zi(e)?Ml(e):os(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function L2(e,t,n){let r;if(t==="viewport")r=nB(e,n);else if(t==="document")r=tB(xo(e));else if(wo(t))r=rB(t,n);else{const i=N2(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return $h(r)}function F2(e,t){const n=Dl(e);return n===t||!wo(n)||jh(n)?!1:ei(n).position==="fixed"||F2(n,t)}function iB(e,t){const n=t.get(e);if(n)return n;let r=Ru(e,[],!1).filter(a=>wo(a)&&ss(a)!=="body"),i=null;const o=ei(e).position==="fixed";let s=o?Dl(e):e;for(;wo(s)&&!jh(s);){const a=ei(s),l=qb(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Nu(s)&&!l&&F2(e,s))?r=r.filter(d=>d!==s):i=a,s=Dl(s)}return t.set(e,r),r}function oB(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?iB(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const f=L2(t,d,i);return c.top=kr(f.top,c.top),c.right=is(f.right,c.right),c.bottom=is(f.bottom,c.bottom),c.left=kr(f.left,c.left),c},L2(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sB(e){return I2(e)}function aB(e,t,n){const r=zi(t),i=xo(t),o=n==="fixed",s=ua(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=os(0);if(r||!r&&!o)if((ss(t)!=="body"||Nu(i))&&(a=zh(t)),r){const c=ua(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=R2(i));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function $2(e,t){return!zi(e)||ei(e).position==="fixed"?null:t?t(e):e.offsetParent}function j2(e,t){const n=Dr(e);if(!zi(e))return n;let r=$2(e,t);for(;r&&Kz(r)&&ei(r).position==="static";)r=$2(r,t);return r&&(ss(r)==="html"||ss(r)==="body"&&ei(r).position==="static"&&!qb(r))?n:r||Xz(e)||n}const lB=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||j2,o=this.getDimensions;return{reference:aB(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function cB(e){return ei(e).direction==="rtl"}const uB={convertOffsetParentRelativeRectToViewportRelativeRect:Jz,getDocumentElement:xo,getClippingRect:oB,getOffsetParent:j2,getElementRects:lB,getClientRects:eB,getDimensions:sB,getScale:Ml,isElement:wo,isRTL:cB};function dB(e,t){let n=null,r;const i=xo(e);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:d,width:f,height:g}=e.getBoundingClientRect();if(a||t(),!f||!g)return;const p=Lh(d),v=Lh(i.clientWidth-(c+f)),b=Lh(i.clientHeight-(d+g)),x=Lh(c),S={rootMargin:-p+"px "+-v+"px "+-b+"px "+-x+"px",threshold:kr(0,is(1,l))||1};let C=!0;function P(O){const k=O[0].intersectionRatio;if(k!==l){if(!C)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(P,{...S,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,S)}n.observe(e)}return s(!0),o}function fB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Yb(e),d=i||o?[...c?Ru(c):[],...Ru(t)]:[];d.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const f=c&&a?dB(c,n):null;let g=-1,p=null;s&&(p=new ResizeObserver(w=>{let[S]=w;S&&S.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let v,b=l?ua(e):null;l&&x();function x(){const w=ua(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(),()=>{d.forEach(w=>{i&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),f&&f(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const hB=(e,t,n)=>{const r=new Map,i={platform:uB,...n},o={...i.platform,_c:r};return Bz(e,t,{...i,platform:o})},pB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?P2({element:r.current,padding:i}).fn(n):{}:r?P2({element:r,padding:i}).fn(n):{}}}};var Bh=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Vh(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,i;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(!Vh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Vh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function z2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function B2(e,t){const n=z2(e);return Math.round(t*n)/n}function V2(e){const t=de.useRef(e);return Bh(()=>{t.current=e}),t}function gB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=de.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=de.useState(r);Vh(g,r)||p(r);const[v,b]=de.useState(null),[x,w]=de.useState(null),S=de.useCallback(X=>{X!=k.current&&(k.current=X,b(X))},[b]),C=de.useCallback(X=>{X!==T.current&&(T.current=X,w(X))},[w]),P=o||v,O=s||x,k=de.useRef(null),T=de.useRef(null),I=de.useRef(d),F=V2(l),j=V2(i),B=de.useCallback(()=>{if(!k.current||!T.current)return;const X={placement:t,strategy:n,middleware:g};j.current&&(X.platform=j.current),hB(k.current,T.current,X).then(W=>{const ne={...W,isPositioned:!0};V.current&&!Vh(I.current,ne)&&(I.current=ne,CN.flushSync(()=>{f(ne)}))})},[g,t,n,j]);Bh(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(X=>({...X,isPositioned:!1})))},[c]);const V=de.useRef(!1);Bh(()=>(V.current=!0,()=>{V.current=!1}),[]),Bh(()=>{if(P&&(k.current=P),O&&(T.current=O),P&&O){if(F.current)return F.current(P,O,B);B()}},[P,O,B,F]);const q=de.useMemo(()=>({reference:k,floating:T,setReference:S,setFloating:C}),[S,C]),J=de.useMemo(()=>({reference:P,floating:O}),[P,O]),$=de.useMemo(()=>{const X={position:n,left:0,top:0};if(!J.floating)return X;const W=B2(J.floating,d.x),ne=B2(J.floating,d.y);return a?{...X,transform:"translate("+W+"px, "+ne+"px)",...z2(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:ne}},[n,a,J.floating,d.x,d.y]);return de.useMemo(()=>({...d,update:B,refs:q,elements:J,floatingStyles:$}),[d,B,q,J,$])}function Hh(e){const[t,n]=m.useState(void 0);return Vn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.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 H2="Popper",[W2,Bi]=kn(H2),[mB,U2]=W2(H2),vB=e=>{const{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return m.createElement(mB,{scope:t,anchor:r,onAnchorChange:i},n)},bB="PopperAnchor",yB=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=U2(bB,n),s=m.useRef(null),a=nt(t,s);return m.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(He.div,se({},i,{ref:a}))}),q2="PopperContent",[xB,sfe]=W2(q2),wB=m.forwardRef((e,t)=>{var n,r,i,o,s,a,l,c;const{__scopePopper:d,side:f="bottom",sideOffset:g=0,align:p="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:x=!0,collisionBoundary:w=[],collisionPadding:S=0,sticky:C="partial",hideWhenDetached:P=!1,updatePositionStrategy:O="optimized",onPlaced:k,...T}=e,I=U2(q2,d),[F,j]=m.useState(null),B=nt(t,Se=>j(Se)),[V,q]=m.useState(null),J=Hh(V),$=(n=J==null?void 0:J.width)!==null&&n!==void 0?n:0,X=(r=J==null?void 0:J.height)!==null&&r!==void 0?r:0,W=f+(p!=="center"?"-"+p:""),ne=typeof S=="number"?S:{top:0,right:0,bottom:0,left:0,...S},le=Array.isArray(w)?w:[w],A=le.length>0,H={padding:ne,boundary:le.filter(_B),altBoundary:A},{refs:re,floatingStyles:R,placement:ue,isPositioned:xe,middlewareData:ge}=gB({strategy:"fixed",placement:W,whileElementsMounted:(...Se)=>fB(...Se,{animationFrame:O==="always"}),elements:{reference:I.anchor},middleware:[Uz({mainAxis:g+X,alignmentAxis:v}),x&&qz({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?Gz():void 0,...H}),x&&Vz({...H}),Yz({...H,apply:({elements:Se,rects:We,availableWidth:dt,availableHeight:qe})=>{const{width:gt,height:Gt}=We.reference,Bt=Se.floating.style;Bt.setProperty("--radix-popper-available-width",`${dt}px`),Bt.setProperty("--radix-popper-available-height",`${qe}px`),Bt.setProperty("--radix-popper-anchor-width",`${gt}px`),Bt.setProperty("--radix-popper-anchor-height",`${Gt}px`)}}),V&&pB({element:V,padding:b}),SB({arrowWidth:$,arrowHeight:X}),P&&Hz({strategy:"referenceHidden",...H})]}),[pe,ee]=G2(ue),Q=_n(k);Vn(()=>{xe&&(Q==null||Q())},[xe,Q]);const ie=(i=ge.arrow)===null||i===void 0?void 0:i.x,we=(o=ge.arrow)===null||o===void 0?void 0:o.y,te=((s=ge.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Ie,ae]=m.useState();return Vn(()=>{F&&ae(window.getComputedStyle(F).zIndex)},[F]),m.createElement("div",{ref:re.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:xe?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ie,"--radix-popper-transform-origin":[(a=ge.transformOrigin)===null||a===void 0?void 0:a.x,(l=ge.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(xB,{scope:d,placedSide:pe,onArrowChange:q,arrowX:ie,arrowY:we,shouldHideArrow:te},m.createElement(He.div,se({"data-side":pe,"data-align":ee},T,{ref:B,style:{...T.style,animation:xe?void 0:"none",opacity:(c=ge.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function _B(e){return e!==null}const SB=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,g=f?0:e.arrowWidth,p=f?0:e.arrowHeight,[v,b]=G2(a),x={start:"0%",center:"50%",end:"100%"}[b],w=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+g/2,S=((o=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:0)+p/2;let C="",P="";return v==="bottom"?(C=f?x:`${w}px`,P=`${-p}px`):v==="top"?(C=f?x:`${w}px`,P=`${l.floating.height+p}px`):v==="right"?(C=`${-p}px`,P=f?x:`${S}px`):v==="left"&&(C=`${l.floating.width+p}px`,P=f?x:`${S}px`),{data:{x:C,y:P}}}});function G2(e){const[t,n="center"]=e.split("-");return[t,n]}const Lu=vB,Fu=yB,$u=wB,Wh=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?kt.createPortal(m.createElement(He.div,se({},i,{ref:t})),r):null}),Y2=m.forwardRef((e,t)=>m.createElement(He.span,se({},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}}))),CB=Y2,[Uh,afe]=kn("Tooltip",[Bi]),Kb=Bi(),EB="TooltipProvider",OB=700,Xb="tooltip.open",[PB,Qb]=Uh(EB),kB=e=>{const{__scopeTooltip:t,delayDuration:n=OB,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),m.createElement(PB,{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(d=>{l.current=d},[]),disableHoverableContent:i},o)},Zb="Tooltip",[DB,qh]=Uh(Zb),MB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=e,l=Qb(Zb,e.__scopeTooltip),c=Kb(t),[d,f]=m.useState(null),g=or(),p=m.useRef(0),v=s??l.disableHoverableContent,b=a??l.delayDuration,x=m.useRef(!1),[w=!1,S]=Qn({prop:r,defaultProp:i,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(Xb))):l.onClose(),o==null||o(T)}}),C=m.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),P=m.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,S(!0)},[S]),O=m.useCallback(()=>{window.clearTimeout(p.current),S(!1)},[S]),k=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,S(!0)},b)},[b,S]);return m.useEffect(()=>()=>window.clearTimeout(p.current),[]),m.createElement(Lu,c,m.createElement(DB,{scope:t,contentId:g,open:w,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?k():P()},[l.isOpenDelayed,k,P]),onTriggerLeave:m.useCallback(()=>{v?O():window.clearTimeout(p.current)},[O,v]),onOpen:P,onClose:O,disableHoverableContent:v},n))},K2="TooltipTrigger",X2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=qh(K2,n),o=Qb(K2,n),s=Kb(n),a=m.useRef(null),l=nt(t,a,i.onTriggerChange),c=m.useRef(!1),d=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(Fu,se({asChild:!0},s),m.createElement(He.button,se({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:Pe(e.onPointerMove,g=>{g.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Pe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Pe(e.onBlur,i.onClose),onClick:Pe(e.onClick,i.onClose)})))}),TB="TooltipPortal",[lfe,AB]=Uh(TB,{forceMount:void 0}),ju="TooltipContent",IB=m.forwardRef((e,t)=>{const n=AB(ju,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=qh(ju,e.__scopeTooltip);return m.createElement(yn,{present:r||s.open},s.disableHoverableContent?m.createElement(Q2,se({side:i},o,{ref:t})):m.createElement(NB,se({side:i},o,{ref:t})))}),NB=m.forwardRef((e,t)=>{const n=qh(ju,e.__scopeTooltip),r=Qb(ju,e.__scopeTooltip),i=m.useRef(null),o=nt(t,i),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,d=i.current,{onPointerInTransitChange:f}=r,g=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((v,b)=>{const x=v.currentTarget,w={x:v.clientX,y:v.clientY},S=LB(w,x.getBoundingClientRect()),C=FB(w,S),P=$B(b.getBoundingClientRect()),O=zB([...C,...P]);a(O),f(!0)},[f]);return m.useEffect(()=>()=>g(),[g]),m.useEffect(()=>{if(l&&d){const v=x=>p(x,d),b=x=>p(x,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",b)}}},[l,d,p,g]),m.useEffect(()=>{if(s){const v=b=>{const x=b.target,w={x:b.clientX,y:b.clientY},S=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),C=!jB(w,s);S?g():C&&(g(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,s,c,g]),m.createElement(Q2,se({},e,{ref:o}))}),[RB,cfe]=Uh(Zb,{isInside:!1}),Q2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,l=qh(ju,n),c=Kb(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(Xb,d),()=>document.removeEventListener(Xb,d)),[d]),m.useEffect(()=>{if(l.trigger){const f=g=>{const p=g.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),m.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:d},m.createElement($u,se({"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(v_,null,r),m.createElement(RB,{scope:n,isInside:!0},m.createElement(CB,{id:l.contentId,role:"tooltip"},i||r))))});function LB(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function FB(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function $B(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function jB(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,d=t[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function zB(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),BB(t)}function BB(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}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 VB=kB,HB=MB,WB=X2,Z2=IB,UB=VB,zu=HB,Gh=WB,Tl=de.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(Z2,{ref:r,sideOffset:t,className:De("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}));Tl.displayName=Z2.displayName;const J2=de.forwardRef(({className:e,...t},n)=>_.jsx("div",{className:"relative w-full overflow-auto",children:_.jsx("table",{ref:n,className:De("w-full caption-bottom text-sm",e),...t})}));J2.displayName="Table";const eO=de.forwardRef(({className:e,...t},n)=>_.jsx("thead",{ref:n,className:De("[&_tr]:border-b",e),...t}));eO.displayName="TableHeader";const tO=de.forwardRef(({className:e,...t},n)=>_.jsx("tbody",{ref:n,className:De("[&_tr:last-child]:border-0",e),...t}));tO.displayName="TableBody";const qB=de.forwardRef(({className:e,...t},n)=>_.jsx("tfoot",{ref:n,className:De("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));qB.displayName="TableFooter";const Yh=de.forwardRef(({className:e,...t},n)=>_.jsx("tr",{ref:n,className:De("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Yh.displayName="TableRow";const nO=de.forwardRef(({className:e,...t},n)=>_.jsx("th",{ref:n,className:De("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));nO.displayName="TableHead";const Jb=de.forwardRef(({className:e,...t},n)=>_.jsx("td",{ref:n,className:De("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Jb.displayName="TableCell";const GB=de.forwardRef(({className:e,...t},n)=>_.jsx("caption",{ref:n,className:De("mt-4 text-sm text-muted-foreground",e),...t}));GB.displayName="TableCaption";/**
129
+ `)):Array.isArray(n)?e.push.apply(e,n):yt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),i=r.length,o=e.font,s=0,a;for(e.font=n.string,a=0;a<i;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=o,{height:i*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=[],i,o,s,a;for(i=0,s=t.length;i<s;++i)a=t[i],o=n.indexOf(a),o===-1?r.push([a,1]):n.splice(o,1);for(i=0,s=n.length;i<s;++i)r.push([n[i],-1]);return r},rasterize:function(e){return Math.round(e*l2)/l2}};function Lb(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 i=e.x-n,o=e.y-r,s=Math.sqrt(i*i+o*o);return{x:s?i/s:0,y:s?o/s:-1}}function zj(e,t,n,r,i){switch(i){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:i*=Math.PI/180,n=Math.cos(i),r=Math.sin(i);break}return{x:e,y:t,vx:n,vy:r}}var Bj=0,c2=1,u2=2,d2=4,f2=8;function Th(e,t,n){var r=Bj;return e<n.left?r|=c2:e>n.right&&(r|=u2),t<n.top?r|=f2:t>n.bottom&&(r|=d2),r}function Vj(e,t){for(var n=e.x0,r=e.y0,i=e.x1,o=e.y1,s=Th(n,r,t),a=Th(i,o,t),l,c,d;!(!(s|a)||s&a);)l=s||a,l&f2?(c=n+(i-n)*(t.top-r)/(o-r),d=t.top):l&d2?(c=n+(i-n)*(t.bottom-r)/(o-r),d=t.bottom):l&u2?(d=r+(o-r)*(t.right-n)/(i-n),c=t.right):l&c2&&(d=r+(o-r)*(t.left-n)/(i-n),c=t.left),l===s?(n=c,r=d,s=Th(n,r,t)):(i=c,o=d,a=Th(i,o,t));return{x0:n,x1:i,y0:r,y1:o}}function Ah(e,t){var n=t.anchor,r=e,i,o;return t.clamp&&(r=Vj(r,t.area)),n==="start"?(i=r.x0,o=r.y0):n==="end"?(i=r.x1,o=r.y1):(i=(r.x0+r.x1)/2,o=(r.y0+r.y1)/2),zj(i,o,e.vx,e.vy,t.align)}var Ih={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),i=Math.sin(n),o=e.innerRadius,s=e.outerRadius;return Ah({x0:e.x+r*o,y0:e.y+i*o,x1:e.x+r*s,y1:e.y+i*s,vx:r,vy:i},t)},point:function(e,t){var n=Lb(e,t.origin),r=n.x*e.options.radius,i=n.y*e.options.radius;return Ah({x0:e.x-r,y0:e.y-i,x1:e.x+r,y1:e.y+i,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=Lb(e,t.origin),r=e.x,i=e.y,o=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),o=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),Ah({x0:r,y0:i+s,x1:r+o,y1:i,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=Lb(e,t.origin);return Ah({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)}},vo=Mu.rasterize;function Hj(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,i=e.size.width,o=-i/2,s=-r/2;return{frame:{x:o-n.left-t,y:s-n.top-t,w:i+n.width+t*2,h:r+n.height+t*2},text:{x:o,y:s,w:i,h:r}}}function Wj(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 Uj(e){return e instanceof El?Ih.arc:e instanceof Cu?Ih.point:e instanceof Eu?Ih.bar:Ih.fallback}function qj(e,t,n,r,i,o){var s=Math.PI/2;if(o){var a=Math.min(o,i/2,r/2),l=t+a,c=n+a,d=t+r-a,f=n+i-a;e.moveTo(t,c),l<d&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(d,c,a,-s,0),e.arc(d,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<d?(e.moveTo(l,n),e.arc(d,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,i)}function Gj(e,t,n){var r=n.backgroundColor,i=n.borderColor,o=n.borderWidth;!r&&(!i||!o)||(e.beginPath(),qj(e,vo(t.x)+o/2,vo(t.y)+o/2,vo(t.w)-o,vo(t.h)-o,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),i&&o&&(e.strokeStyle=i,e.lineWidth=o,e.lineJoin="miter",e.stroke()))}function Yj(e,t,n){var r=n.lineHeight,i=e.w,o=e.x,s=e.y+r/2;return t==="center"?o+=i/2:(t==="end"||t==="right")&&(o+=i),{h:r,w:i,x:o,y:s}}function Kj(e,t,n){var r=e.shadowBlur,i=n.stroked,o=vo(n.x),s=vo(n.y),a=vo(n.w);i&&e.strokeText(t,o,s,a),n.filled&&(r&&i&&(e.shadowBlur=0),e.fillText(t,o,s,a),r&&i&&(e.shadowBlur=r))}function Xj(e,t,n,r){var i=r.textAlign,o=r.color,s=!!o,a=r.font,l=t.length,c=r.textStrokeColor,d=r.textStrokeWidth,f=c&&d,g;if(!(!l||!s&&!f))for(n=Yj(n,i,a),e.font=a.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=o),f&&(e.lineJoin="round",e.lineWidth=d,e.strokeStyle=c),g=0,l=t.length;g<l;++g)Kj(e,t[g],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*g})}var h2=function(e,t,n,r){var i=this;i._config=e,i._index=r,i._model=null,i._rects=null,i._ctx=t,i._el=n};Li(h2.prototype,{_modelize:function(e,t,n,r){var i=this,o=i._index,s=xn(en([n.font,{}],r,o)),a=en([n.color,an.color],r,o);return{align:en([n.align,"center"],r,o),anchor:en([n.anchor,"center"],r,o),area:r.chart.chartArea,backgroundColor:en([n.backgroundColor,null],r,o),borderColor:en([n.borderColor,null],r,o),borderRadius:en([n.borderRadius,0],r,o),borderWidth:en([n.borderWidth,0],r,o),clamp:en([n.clamp,!1],r,o),clip:en([n.clip,!1],r,o),color:a,display:e,font:s,lines:t,offset:en([n.offset,4],r,o),opacity:en([n.opacity,1],r,o),origin:Wj(i._el,r),padding:Ln(en([n.padding,4],r,o)),positioner:Uj(i._el),rotation:en([n.rotation,0],r,o)*(Math.PI/180),size:Mu.textSize(i._ctx,t,s),textAlign:en([n.textAlign,"start"],r,o),textShadowBlur:en([n.textShadowBlur,0],r,o),textShadowColor:en([n.textShadowColor,a],r,o),textStrokeColor:en([n.textStrokeColor,a],r,o),textStrokeWidth:en([n.textStrokeWidth,0],r,o)}},update:function(e){var t=this,n=null,r=null,i=t._index,o=t._config,s,a,l,c=en([o.display,!0],e,i);c&&(s=e.dataset.data[i],a=rt(jt(o.formatter,[s,e]),s),l=yt(a)?[]:Mu.toTextLines(a),l.length&&(n=t._modelize(c,l,o,e),r=Hj(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,i=n._model,o=n._rects,s;this.visible()&&(r.save(),i.clip&&(s=i.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=Mu.bound(0,i.opacity,1),r.translate(vo(t.x),vo(t.y)),r.rotate(i.rotation),Gj(r,o.frame,i),Xj(r,i.lines,o.text,i),r.restore())}});var Qj=Number.MIN_SAFE_INTEGER||-9007199254740991,Zj=Number.MAX_SAFE_INTEGER||9007199254740991;function Tu(e,t,n){var r=Math.cos(n),i=Math.sin(n),o=t.x,s=t.y;return{x:o+r*(e.x-o)-i*(e.y-s),y:s+i*(e.x-o)+r*(e.y-s)}}function p2(e,t){var n=Zj,r=Qj,i=t.origin,o,s,a,l,c;for(o=0;o<e.length;++o)s=e[o],a=s.x-i.x,l=s.y-i.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function Nh(e,t){var n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var g2=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Li(g2.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=Tu(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[Nh(t[0],t[1]),Nh(t[0],t[3])],i,o,s;for(this._rotation!==e._rotation&&r.push(Nh(n[0],n[1]),Nh(n[0],n[3])),i=0;i<r.length;++i)if(o=p2(t,r[i]),s=p2(n,r[i]),o.max<s.min||s.max<o.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Tu({x:t.x,y:t.y},r,n),Tu({x:t.x+t.w,y:t.y},r,n),Tu({x:t.x+t.w,y:t.y+t.h},r,n),Tu({x:t.x,y:t.y+t.h},r,n)]}});function m2(e,t,n){var r=t.positioner(e,t),i=r.vx,o=r.vy;if(!i&&!o)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)),d=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(i),Math.abs(o));return c*=i*f,d*=o*f,c+=t.offset*i,d+=t.offset*o,{x:r.x+c,y:r.y+d}}function Jj(e,t){var n,r,i,o;for(n=e.length-1;n>=0;--n)for(i=e[n].$layout,r=n-1;r>=0&&i._visible;--r)o=e[r].$layout,o._visible&&i._box.intersects(o._box)&&t(i,o);return e}function ez(e){var t,n,r,i,o,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],i=r.$layout,i._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=r.geometry(),s=m2(a,r.model(),o),i._box.update(s,o,r.rotation()));return Jj(e,function(l,c){var d=l._hidable,f=c._hidable;d&&f||f?c._visible=!1:d&&(l._visible=!1)})}var Au={prepare:function(e){var t=[],n,r,i,o,s;for(n=0,i=e.length;n<i;++n)for(r=0,o=e[n].length;r<o;++r)s=e[n][r],t.push(s),s.$layout={_box:new g2,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,d=l.$layout;return c._idx===d._idx?d._set-c._set:d._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,i,o,s;for(n=0,r=e.length;n<r;++n)i=e[n],o=i.model(),s=i.$layout,s._hidable=o&&o.display==="auto",s._visible=i.visible(),t|=s._hidable;t&&ez(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,i,o,s,a;for(n=0,r=t.length;n<r;++n)i=t[n],o=i.$layout,o._visible&&(s=i.geometry(),a=m2(i._el,i.model(),s),o._box.update(a,s,i.rotation()),i.draw(e,a))}},tz=function(e){if(yt(e))return null;var t=e,n,r,i;if(_t(e))if(!yt(e.label))t=e.label;else if(!yt(e.r))t=e.r;else for(t="",n=Object.keys(e),i=0,r=n.length;i<r;++i)t+=(i!==0?", ":"")+n[i]+": "+e[n[i]];return""+t},nz={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:tz,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},ur="$datalabels",v2="$default";function rz(e,t){var n=e.datalabels,r={},i=[],o,s;return n===!1?null:(n===!0&&(n={}),t=Li({},[t,n]),o=t.labels||{},s=Object.keys(o),delete t.labels,s.length?s.forEach(function(a){o[a]&&i.push(Li({},[t,o[a],{_key:a}]))}):i.push(t),r=i.reduce(function(a,l){return Nt(l.listeners||{},function(c,d){a[d]=a[d]||{},a[d][l._key||v2]=c}),delete l.listeners,a},{}),{labels:i,listeners:r})}function Fb(e,t,n,r){if(t){var i=n.$context,o=n.$groups,s;t[o._set]&&(s=t[o._set][o._key],s&&jt(s,[i,r])===!0&&(e[ur]._dirty=!0,n.update(i)))}}function iz(e,t,n,r,i){var o,s;!n&&!r||(n?r?n!==r&&(s=o=!0):s=!0:o=!0,s&&Fb(e,t.leave,n,i),o&&Fb(e,t.enter,r,i))}function oz(e,t){var n=e[ur],r=n._listeners,i,o;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")o=Au.lookup(n._labels,t);else if(t.type!=="mouseout")return;i=n._hovered,n._hovered=o,iz(e,r,i,o,t)}}function sz(e,t){var n=e[ur],r=n._listeners.click,i=r&&Au.lookup(n._labels,t);i&&Fb(e,r,i,t)}var az={id:"datalabels",defaults:nz,beforeInit:function(e){e[ur]={_actives:[]}},beforeUpdate:function(e){var t=e[ur];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,i=e[ur],o=i._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=rz(a,n),c=t.meta.data||[],d=e.ctx,f,g,p,v,b,x,w,S;for(d.save(),f=0,p=c.length;f<p;++f)if(w=c[f],w[ur]=[],s&&w&&e.getDataVisibility(f)&&!w.skip)for(g=0,v=l.labels.length;g<v;++g)b=l.labels[g],x=b._key,S=new h2(b,d,w,f),S.$groups={_set:r,_key:x||v2},S.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},S.update(S.$context),w[ur].push(S),o.push(S);d.restore(),Li(i._listeners,l.listeners,{merger:function(C,P,O){P[C]=P[C]||{},P[C][t.index]=O[C],i._listened=!0}})},afterUpdate:function(e){e[ur]._labels=Au.prepare(e[ur]._datasets)},afterDatasetsDraw:function(e){Au.draw(e,e[ur]._labels)},beforeEvent:function(e,t){if(e[ur]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":oz(e,n);break;case"click":sz(e,n);break}}},afterEvent:function(e){var t=e[ur],n=t._actives,r=t._actives=e.getActiveElements(),i=Mu.arrayDiff(n,r),o,s,a,l,c,d,f;for(o=0,s=i.length;o<s;++o)if(c=i[o],c[1])for(f=c[0].element[ur]||[],a=0,l=f.length;a<l;++a)d=f[a],d.$context.active=c[1]===1,d.update(d.$context);(t._dirty||i.length)&&(Au.update(t._labels),e.render()),delete t._dirty}};Zr.register(...jj),Zr.register(az);function $b({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,i]=m.useState(),o=fe(l=>l.themeStyle);m.useEffect(()=>{var d,f,g,p;(f=(d=o==null?void 0:o.chart)==null?void 0:d.font)!=null&&f.family&&(Zr.defaults.font={...Zr.defaults.font,...(g=o==null?void 0:o.chart)==null?void 0:g.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(p=n==null?void 0:n.current)==null?void 0:p.getContext("2d");if(!l)return;let c;try{c=new Zr(l,e),i(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=o==null?void 0:o.chart)==null?void 0:a.font]);function s(l){var d,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const g=c[0].datasetIndex,p=c[0].index,v=(f=(d=c[0].element)==null?void 0:d.$context)==null?void 0:f.raw;t==null||t(r,g,p,v)}else console.log("no points")}return _.jsx("div",{onClick:s,className:" relative h-[99%] xbg-red-100",children:_.jsx("canvas",{ref:n})})}function Jr(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var lz=["color"],b2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,lz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),cz=["color"],uz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,cz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),dz=["color"],y2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,dz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),fz=["color"],ca=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,fz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),hz=["color"],pz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,hz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),gz=["color"],mz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,gz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),vz=["color"],bz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,vz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),yz=["color"],jb=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,yz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),xz=["color"],wz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,xz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),_z=["color"],Sz=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,_z);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{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"}))}),Cz=["color"],x2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,Cz);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),Ez=["color"],w2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Jr(e,Ez);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});function Oz({frame:e}){const t=fe(w=>w.isDashboardEditing),n=fe(w=>w.filterValues),r=fe(w=>w.isVisualEditing),i=fe(w=>w.selectedSheetId),{removeFrame:o}=fe(w=>w.actions),s=fe(w=>w.actions.setIsVisualEditing),a=ve(w=>w.actions.setFilterValues),l=ve(w=>w.actions.setApplyFilters),{setCard:c,setFrame:d}=ve(w=>w.actions),f=ve(w=>w.actions.setSelectedConnectionId),g=ve(w=>w.actions.setSelectedDatabaseName),p=ve(w=>w.actions.setSelectedSchemaName),v=ve(w=>w.actions.setSelectedTableName),b=e.cards.find(w=>w.id===e.activeCardId);function x(){s(!r),c(b),d(e),b!=null&&b.connectionId&&f(b==null?void 0:b.connectionId),b!=null&&b.lastSelectedDatabase&&g(b==null?void 0:b.lastSelectedDatabase),b!=null&&b.lastSelectedSchema&&p(b==null?void 0:b.lastSelectedSchema),b!=null&&b.lastSelectedTable&&v(b==null?void 0:b.lastSelectedTable),n&&(a(n),l(!0))}return _.jsx("section",{className:"absolute right-2 top-2 z-10",children:t&&_.jsxs("div",{className:"flex items-center gap-2",children:[r?_.jsx(mz,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}):_.jsx(bz,{role:"edit-visual",onClick:x,className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}),_.jsx(ca,{onClick:()=>o(i,e.id),className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"})]})})}function Pz(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e);m.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const zb="dismissableLayer.update",kz="dismissableLayer.pointerDownOutside",Dz="dismissableLayer.focusOutside";let _2;const Mz=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ol=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,d=m.useContext(Mz),[f,g]=m.useState(null),p=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),b=nt(t,I=>g(I)),x=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(w),C=f?x.indexOf(f):-1,P=d.layersWithOutsidePointerEventsDisabled.size>0,O=C>=S,k=Tz(I=>{const F=I.target,j=[...d.branches].some(B=>B.contains(F));!O||j||(o==null||o(I),a==null||a(I),I.defaultPrevented||l==null||l())},p),T=Az(I=>{const F=I.target;[...d.branches].some(B=>B.contains(F))||(s==null||s(I),a==null||a(I),I.defaultPrevented||l==null||l())},p);return Pz(I=>{C===d.layers.size-1&&(i==null||i(I),!I.defaultPrevented&&l&&(I.preventDefault(),l()))},p),m.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(_2=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),S2(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=_2)}},[f,p,r,d]),m.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),S2())},[f,d]),m.useEffect(()=>{const I=()=>v({});return document.addEventListener(zb,I),()=>document.removeEventListener(zb,I)},[]),m.createElement(He.div,se({},c,{ref:b,style:{pointerEvents:P?O?"auto":"none":void 0,...e.style},onFocusCapture:Pe(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Pe(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Pe(e.onPointerDownCapture,k.onPointerDownCapture)}))});function Tz(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e),r=m.useRef(!1),i=m.useRef(()=>{});return m.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){C2(kz,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Az(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e),r=m.useRef(!1);return m.useEffect(()=>{const i=o=>{o.target&&!r.current&&C2(Dz,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function S2(){const e=new CustomEvent(zb);document.dispatchEvent(e)}function C2(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?b_(i,o):i.dispatchEvent(o)}const Iz=["top","right","bottom","left"],is=Math.min,kr=Math.max,Rh=Math.round,Lh=Math.floor,os=e=>({x:e,y:e}),Nz={left:"right",right:"left",bottom:"top",top:"bottom"},Rz={start:"end",end:"start"};function Bb(e,t,n){return kr(e,is(t,n))}function bo(e,t){return typeof e=="function"?e(t):e}function yo(e){return e.split("-")[0]}function Pl(e){return e.split("-")[1]}function Vb(e){return e==="x"?"y":"x"}function Hb(e){return e==="y"?"height":"width"}function kl(e){return["top","bottom"].includes(yo(e))?"y":"x"}function Wb(e){return Vb(kl(e))}function Lz(e,t,n){n===void 0&&(n=!1);const r=Pl(e),i=Wb(e),o=Hb(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Fh(s)),[s,Fh(s)]}function Fz(e){const t=Fh(e);return[Ub(e),t,Ub(t)]}function Ub(e){return e.replace(/start|end/g,t=>Rz[t])}function $z(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function jz(e,t,n,r){const i=Pl(e);let o=$z(yo(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Ub)))),o}function Fh(e){return e.replace(/left|right|bottom|top/g,t=>Nz[t])}function zz(e){return{top:0,right:0,bottom:0,left:0,...e}}function E2(e){return typeof e!="number"?zz(e):{top:e,right:e,bottom:e,left:e}}function $h(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function O2(e,t,n){let{reference:r,floating:i}=e;const o=kl(t),s=Wb(t),a=Hb(s),l=yo(t),c=o==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Pl(t)){case"start":p[s]-=g*(n&&c?-1:1);break;case"end":p[s]+=g*(n&&c?-1:1);break}return p}const Bz=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=O2(c,r,l),g=r,p={},v=0;for(let b=0;b<a.length;b++){const{name:x,fn:w}=a[b],{x:S,y:C,data:P,reset:O}=await w({x:d,y:f,initialPlacement:r,placement:g,strategy:i,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});if(d=S??d,f=C??f,p={...p,[x]:{...p[x],...P}},O&&v<=50){v++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:d,y:f}=O2(c,g,l)),b=-1;continue}}return{x:d,y:f,placement:g,strategy:i,middlewareData:p}};async function Iu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=bo(t,e),v=E2(p),x=a[g?f==="floating"?"reference":"floating":f],w=$h(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),S=f==="floating"?{...s.floating,x:r,y:i}:s.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),P=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},O=$h(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:C,strategy:l}):S);return{top:(w.top-O.top+v.top)/P.y,bottom:(O.bottom-w.bottom+v.bottom)/P.y,left:(w.left-O.left+v.left)/P.x,right:(O.right-w.right+v.right)/P.x}}const P2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=bo(e,t)||{};if(c==null)return{};const f=E2(d),g={x:n,y:r},p=Wb(i),v=Hb(p),b=await s.getDimensions(c),x=p==="y",w=x?"top":"left",S=x?"bottom":"right",C=x?"clientHeight":"clientWidth",P=o.reference[v]+o.reference[p]-g[p]-o.floating[v],O=g[p]-o.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=k?k[C]:0;(!T||!await(s.isElement==null?void 0:s.isElement(k)))&&(T=a.floating[C]||o.floating[v]);const I=P/2-O/2,F=T/2-b[v]/2-1,j=is(f[w],F),B=is(f[S],F),V=j,q=T-b[v]-B,J=T/2-b[v]/2+I,$=Bb(V,J,q),X=!l.arrow&&Pl(i)!=null&&J!=$&&o.reference[v]/2-(J<V?j:B)-b[v]/2<0,W=X?J<V?J-V:J-q:0;return{[p]:g[p]+W,data:{[p]:$,centerOffset:J-$-W,...X&&{alignmentOffset:W}},reset:X}}}),Vz=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...x}=bo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=yo(i),S=yo(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),P=g||(S||!b?[Fh(a)]:Fz(a));!g&&v!=="none"&&P.push(...jz(a,b,v,C));const O=[a,...P],k=await Iu(t,x),T=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&T.push(k[w]),f){const V=Lz(i,s,C);T.push(k[V[0]],k[V[1]])}if(I=[...I,{placement:i,overflows:T}],!T.every(V=>V<=0)){var F,j;const V=(((F=o.flip)==null?void 0:F.index)||0)+1,q=O[V];if(q)return{data:{index:V,overflows:I},reset:{placement:q}};let J=(j=I.filter($=>$.overflows[0]<=0).sort(($,X)=>$.overflows[1]-X.overflows[1])[0])==null?void 0:j.placement;if(!J)switch(p){case"bestFit":{var B;const $=(B=I.map(X=>[X.placement,X.overflows.filter(W=>W>0).reduce((W,te)=>W+te,0)]).sort((X,W)=>X[1]-W[1])[0])==null?void 0:B[0];$&&(J=$);break}case"initialPlacement":J=a;break}if(i!==J)return{reset:{placement:J}}}return{}}}};function k2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function D2(e){return Iz.some(t=>e[t]>=0)}const Hz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=bo(e,t);switch(r){case"referenceHidden":{const o=await Iu(t,{...i,elementContext:"reference"}),s=k2(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:D2(s)}}}case"escaped":{const o=await Iu(t,{...i,altBoundary:!0}),s=k2(o,n.floating);return{data:{escapedOffsets:s,escaped:D2(s)}}}default:return{}}}}};async function Wz(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=yo(n),a=Pl(n),l=kl(n)==="y",c=["left","top"].includes(s)?-1:1,d=o&&l?-1:1,f=bo(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),l?{x:p*d,y:g*c}:{x:g*c,y:p*d}}const Uz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await Wz(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},qz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:w,y:S}=x;return{x:w,y:S}}},...l}=bo(e,t),c={x:n,y:r},d=await Iu(t,l),f=kl(yo(i)),g=Vb(f);let p=c[g],v=c[f];if(o){const x=g==="y"?"top":"left",w=g==="y"?"bottom":"right",S=p+d[x],C=p-d[w];p=Bb(S,p,C)}if(s){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",S=v+d[x],C=v-d[w];v=Bb(S,v,C)}const b=a.fn({...t,[g]:p,[f]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},Gz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=bo(e,t),d={x:n,y:r},f=kl(i),g=Vb(f);let p=d[g],v=d[f];const b=bo(a,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const C=g==="y"?"height":"width",P=o.reference[g]-o.floating[C]+x.mainAxis,O=o.reference[g]+o.reference[C]-x.mainAxis;p<P?p=P:p>O&&(p=O)}if(c){var w,S;const C=g==="y"?"width":"height",P=["top","left"].includes(yo(i)),O=o.reference[f]-o.floating[C]+(P&&((w=s.offset)==null?void 0:w[f])||0)+(P?0:x.crossAxis),k=o.reference[f]+o.reference[C]+(P?0:((S=s.offset)==null?void 0:S[f])||0)-(P?x.crossAxis:0);v<O?v=O:v>k&&(v=k)}return{[g]:p,[f]:v}}}},Yz=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=()=>{},...a}=bo(e,t),l=await Iu(t,a),c=yo(n),d=Pl(n),f=kl(n)==="y",{width:g,height:p}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=d===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(b=c,v=d==="end"?"top":"bottom");const x=p-l[v],w=g-l[b],S=!t.middlewareData.shift;let C=x,P=w;if(f){const k=g-l.left-l.right;P=d||S?is(w,k):k}else{const k=p-l.top-l.bottom;C=d||S?is(x,k):k}if(S&&!d){const k=kr(l.left,0),T=kr(l.right,0),I=kr(l.top,0),F=kr(l.bottom,0);f?P=g-2*(k!==0||T!==0?k+T:kr(l.left,l.right)):C=p-2*(I!==0||F!==0?I+F:kr(l.top,l.bottom))}await s({...t,availableWidth:P,availableHeight:C});const O=await i.getDimensions(o.floating);return g!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}};function ss(e){return M2(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xo(e){var t;return(t=(M2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function M2(e){return e instanceof Node||e instanceof Dr(e).Node}function wo(e){return e instanceof Element||e instanceof Dr(e).Element}function zi(e){return e instanceof HTMLElement||e instanceof Dr(e).HTMLElement}function T2(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot}function Nu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ei(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Kz(e){return["table","td","th"].includes(ss(e))}function qb(e){const t=Gb(),n=ei(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 Xz(e){let t=Dl(e);for(;zi(t)&&!jh(t);){if(qb(t))return t;t=Dl(t)}return null}function Gb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jh(e){return["html","body","#document"].includes(ss(e))}function ei(e){return Dr(e).getComputedStyle(e)}function zh(e){return wo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Dl(e){if(ss(e)==="html")return e;const t=e.assignedSlot||e.parentNode||T2(e)&&e.host||xo(e);return T2(t)?t.host:t}function A2(e){const t=Dl(e);return jh(t)?e.ownerDocument?e.ownerDocument.body:e.body:zi(t)&&Nu(t)?t:A2(t)}function Ru(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=A2(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Dr(i);return o?t.concat(s,s.visualViewport||[],Nu(i)?i:[],s.frameElement&&n?Ru(s.frameElement):[]):t.concat(i,Ru(i,[],n))}function I2(e){const t=ei(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=zi(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Rh(n)!==o||Rh(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Yb(e){return wo(e)?e:e.contextElement}function Ml(e){const t=Yb(e);if(!zi(t))return os(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=I2(t);let s=(o?Rh(n.width):n.width)/r,a=(o?Rh(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Qz=os(0);function N2(e){const t=Dr(e);return!Gb()||!t.visualViewport?Qz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zz(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Dr(e)?!1:t}function ua(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Yb(e);let s=os(1);t&&(r?wo(r)&&(s=Ml(r)):s=Ml(e));const a=Zz(o,n,r)?N2(o):os(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(o){const g=Dr(o),p=r&&wo(r)?Dr(r):r;let v=g.frameElement;for(;v&&r&&p!==g;){const b=Ml(v),x=v.getBoundingClientRect(),w=ei(v),S=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*b.x,C=x.top+(v.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,f*=b.y,l+=S,c+=C,v=Dr(v).frameElement}}return $h({width:d,height:f,x:l,y:c})}function Jz(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=zi(n),o=xo(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0},a=os(1);const l=os(0);if((i||!i&&r!=="fixed")&&((ss(n)!=="body"||Nu(o))&&(s=zh(n)),zi(n))){const c=ua(n);a=Ml(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 eB(e){return Array.from(e.getClientRects())}function R2(e){return ua(xo(e)).left+zh(e).scrollLeft}function tB(e){const t=xo(e),n=zh(e),r=e.ownerDocument.body,i=kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+R2(e);const a=-n.scrollTop;return ei(r).direction==="rtl"&&(s+=kr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function nB(e,t){const n=Dr(e),r=xo(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=Gb();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function rB(e,t){const n=ua(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=zi(e)?Ml(e):os(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function L2(e,t,n){let r;if(t==="viewport")r=nB(e,n);else if(t==="document")r=tB(xo(e));else if(wo(t))r=rB(t,n);else{const i=N2(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return $h(r)}function F2(e,t){const n=Dl(e);return n===t||!wo(n)||jh(n)?!1:ei(n).position==="fixed"||F2(n,t)}function iB(e,t){const n=t.get(e);if(n)return n;let r=Ru(e,[],!1).filter(a=>wo(a)&&ss(a)!=="body"),i=null;const o=ei(e).position==="fixed";let s=o?Dl(e):e;for(;wo(s)&&!jh(s);){const a=ei(s),l=qb(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Nu(s)&&!l&&F2(e,s))?r=r.filter(d=>d!==s):i=a,s=Dl(s)}return t.set(e,r),r}function oB(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?iB(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const f=L2(t,d,i);return c.top=kr(f.top,c.top),c.right=is(f.right,c.right),c.bottom=is(f.bottom,c.bottom),c.left=kr(f.left,c.left),c},L2(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sB(e){return I2(e)}function aB(e,t,n){const r=zi(t),i=xo(t),o=n==="fixed",s=ua(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=os(0);if(r||!r&&!o)if((ss(t)!=="body"||Nu(i))&&(a=zh(t)),r){const c=ua(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=R2(i));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function $2(e,t){return!zi(e)||ei(e).position==="fixed"?null:t?t(e):e.offsetParent}function j2(e,t){const n=Dr(e);if(!zi(e))return n;let r=$2(e,t);for(;r&&Kz(r)&&ei(r).position==="static";)r=$2(r,t);return r&&(ss(r)==="html"||ss(r)==="body"&&ei(r).position==="static"&&!qb(r))?n:r||Xz(e)||n}const lB=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||j2,o=this.getDimensions;return{reference:aB(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function cB(e){return ei(e).direction==="rtl"}const uB={convertOffsetParentRelativeRectToViewportRelativeRect:Jz,getDocumentElement:xo,getClippingRect:oB,getOffsetParent:j2,getElementRects:lB,getClientRects:eB,getDimensions:sB,getScale:Ml,isElement:wo,isRTL:cB};function dB(e,t){let n=null,r;const i=xo(e);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:d,width:f,height:g}=e.getBoundingClientRect();if(a||t(),!f||!g)return;const p=Lh(d),v=Lh(i.clientWidth-(c+f)),b=Lh(i.clientHeight-(d+g)),x=Lh(c),S={rootMargin:-p+"px "+-v+"px "+-b+"px "+-x+"px",threshold:kr(0,is(1,l))||1};let C=!0;function P(O){const k=O[0].intersectionRatio;if(k!==l){if(!C)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(P,{...S,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,S)}n.observe(e)}return s(!0),o}function fB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Yb(e),d=i||o?[...c?Ru(c):[],...Ru(t)]:[];d.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const f=c&&a?dB(c,n):null;let g=-1,p=null;s&&(p=new ResizeObserver(w=>{let[S]=w;S&&S.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let v,b=l?ua(e):null;l&&x();function x(){const w=ua(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(),()=>{d.forEach(w=>{i&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),f&&f(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const hB=(e,t,n)=>{const r=new Map,i={platform:uB,...n},o={...i.platform,_c:r};return Bz(e,t,{...i,platform:o})},pB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?P2({element:r.current,padding:i}).fn(n):{}:r?P2({element:r,padding:i}).fn(n):{}}}};var Bh=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Vh(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,i;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(!Vh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Vh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function z2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function B2(e,t){const n=z2(e);return Math.round(t*n)/n}function V2(e){const t=de.useRef(e);return Bh(()=>{t.current=e}),t}function gB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=de.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=de.useState(r);Vh(g,r)||p(r);const[v,b]=de.useState(null),[x,w]=de.useState(null),S=de.useCallback(X=>{X!=k.current&&(k.current=X,b(X))},[b]),C=de.useCallback(X=>{X!==T.current&&(T.current=X,w(X))},[w]),P=o||v,O=s||x,k=de.useRef(null),T=de.useRef(null),I=de.useRef(d),F=V2(l),j=V2(i),B=de.useCallback(()=>{if(!k.current||!T.current)return;const X={placement:t,strategy:n,middleware:g};j.current&&(X.platform=j.current),hB(k.current,T.current,X).then(W=>{const te={...W,isPositioned:!0};V.current&&!Vh(I.current,te)&&(I.current=te,CN.flushSync(()=>{f(te)}))})},[g,t,n,j]);Bh(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(X=>({...X,isPositioned:!1})))},[c]);const V=de.useRef(!1);Bh(()=>(V.current=!0,()=>{V.current=!1}),[]),Bh(()=>{if(P&&(k.current=P),O&&(T.current=O),P&&O){if(F.current)return F.current(P,O,B);B()}},[P,O,B,F]);const q=de.useMemo(()=>({reference:k,floating:T,setReference:S,setFloating:C}),[S,C]),J=de.useMemo(()=>({reference:P,floating:O}),[P,O]),$=de.useMemo(()=>{const X={position:n,left:0,top:0};if(!J.floating)return X;const W=B2(J.floating,d.x),te=B2(J.floating,d.y);return a?{...X,transform:"translate("+W+"px, "+te+"px)",...z2(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:te}},[n,a,J.floating,d.x,d.y]);return de.useMemo(()=>({...d,update:B,refs:q,elements:J,floatingStyles:$}),[d,B,q,J,$])}function Hh(e){const[t,n]=m.useState(void 0);return Vn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.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 H2="Popper",[W2,Bi]=kn(H2),[mB,U2]=W2(H2),vB=e=>{const{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return m.createElement(mB,{scope:t,anchor:r,onAnchorChange:i},n)},bB="PopperAnchor",yB=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=U2(bB,n),s=m.useRef(null),a=nt(t,s);return m.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(He.div,se({},i,{ref:a}))}),q2="PopperContent",[xB,sfe]=W2(q2),wB=m.forwardRef((e,t)=>{var n,r,i,o,s,a,l,c;const{__scopePopper:d,side:f="bottom",sideOffset:g=0,align:p="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:x=!0,collisionBoundary:w=[],collisionPadding:S=0,sticky:C="partial",hideWhenDetached:P=!1,updatePositionStrategy:O="optimized",onPlaced:k,...T}=e,I=U2(q2,d),[F,j]=m.useState(null),B=nt(t,Se=>j(Se)),[V,q]=m.useState(null),J=Hh(V),$=(n=J==null?void 0:J.width)!==null&&n!==void 0?n:0,X=(r=J==null?void 0:J.height)!==null&&r!==void 0?r:0,W=f+(p!=="center"?"-"+p:""),te=typeof S=="number"?S:{top:0,right:0,bottom:0,left:0,...S},le=Array.isArray(w)?w:[w],A=le.length>0,H={padding:te,boundary:le.filter(_B),altBoundary:A},{refs:ne,floatingStyles:R,placement:ue,isPositioned:xe,middlewareData:ge}=gB({strategy:"fixed",placement:W,whileElementsMounted:(...Se)=>fB(...Se,{animationFrame:O==="always"}),elements:{reference:I.anchor},middleware:[Uz({mainAxis:g+X,alignmentAxis:v}),x&&qz({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?Gz():void 0,...H}),x&&Vz({...H}),Yz({...H,apply:({elements:Se,rects:We,availableWidth:dt,availableHeight:qe})=>{const{width:gt,height:Gt}=We.reference,Bt=Se.floating.style;Bt.setProperty("--radix-popper-available-width",`${dt}px`),Bt.setProperty("--radix-popper-available-height",`${qe}px`),Bt.setProperty("--radix-popper-anchor-width",`${gt}px`),Bt.setProperty("--radix-popper-anchor-height",`${Gt}px`)}}),V&&pB({element:V,padding:b}),SB({arrowWidth:$,arrowHeight:X}),P&&Hz({strategy:"referenceHidden",...H})]}),[pe,ee]=G2(ue),Q=_n(k);Vn(()=>{xe&&(Q==null||Q())},[xe,Q]);const ie=(i=ge.arrow)===null||i===void 0?void 0:i.x,we=(o=ge.arrow)===null||o===void 0?void 0:o.y,re=((s=ge.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Ie,ae]=m.useState();return Vn(()=>{F&&ae(window.getComputedStyle(F).zIndex)},[F]),m.createElement("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:xe?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ie,"--radix-popper-transform-origin":[(a=ge.transformOrigin)===null||a===void 0?void 0:a.x,(l=ge.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(xB,{scope:d,placedSide:pe,onArrowChange:q,arrowX:ie,arrowY:we,shouldHideArrow:re},m.createElement(He.div,se({"data-side":pe,"data-align":ee},T,{ref:B,style:{...T.style,animation:xe?void 0:"none",opacity:(c=ge.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function _B(e){return e!==null}const SB=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,g=f?0:e.arrowWidth,p=f?0:e.arrowHeight,[v,b]=G2(a),x={start:"0%",center:"50%",end:"100%"}[b],w=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+g/2,S=((o=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:0)+p/2;let C="",P="";return v==="bottom"?(C=f?x:`${w}px`,P=`${-p}px`):v==="top"?(C=f?x:`${w}px`,P=`${l.floating.height+p}px`):v==="right"?(C=`${-p}px`,P=f?x:`${S}px`):v==="left"&&(C=`${l.floating.width+p}px`,P=f?x:`${S}px`),{data:{x:C,y:P}}}});function G2(e){const[t,n="center"]=e.split("-");return[t,n]}const Lu=vB,Fu=yB,$u=wB,Wh=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?kt.createPortal(m.createElement(He.div,se({},i,{ref:t})),r):null}),Y2=m.forwardRef((e,t)=>m.createElement(He.span,se({},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}}))),CB=Y2,[Uh,afe]=kn("Tooltip",[Bi]),Kb=Bi(),EB="TooltipProvider",OB=700,Xb="tooltip.open",[PB,Qb]=Uh(EB),kB=e=>{const{__scopeTooltip:t,delayDuration:n=OB,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),m.createElement(PB,{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(d=>{l.current=d},[]),disableHoverableContent:i},o)},Zb="Tooltip",[DB,qh]=Uh(Zb),MB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=e,l=Qb(Zb,e.__scopeTooltip),c=Kb(t),[d,f]=m.useState(null),g=or(),p=m.useRef(0),v=s??l.disableHoverableContent,b=a??l.delayDuration,x=m.useRef(!1),[w=!1,S]=Qn({prop:r,defaultProp:i,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(Xb))):l.onClose(),o==null||o(T)}}),C=m.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),P=m.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,S(!0)},[S]),O=m.useCallback(()=>{window.clearTimeout(p.current),S(!1)},[S]),k=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,S(!0)},b)},[b,S]);return m.useEffect(()=>()=>window.clearTimeout(p.current),[]),m.createElement(Lu,c,m.createElement(DB,{scope:t,contentId:g,open:w,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?k():P()},[l.isOpenDelayed,k,P]),onTriggerLeave:m.useCallback(()=>{v?O():window.clearTimeout(p.current)},[O,v]),onOpen:P,onClose:O,disableHoverableContent:v},n))},K2="TooltipTrigger",X2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=qh(K2,n),o=Qb(K2,n),s=Kb(n),a=m.useRef(null),l=nt(t,a,i.onTriggerChange),c=m.useRef(!1),d=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(Fu,se({asChild:!0},s),m.createElement(He.button,se({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:Pe(e.onPointerMove,g=>{g.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Pe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Pe(e.onBlur,i.onClose),onClick:Pe(e.onClick,i.onClose)})))}),TB="TooltipPortal",[lfe,AB]=Uh(TB,{forceMount:void 0}),ju="TooltipContent",IB=m.forwardRef((e,t)=>{const n=AB(ju,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=qh(ju,e.__scopeTooltip);return m.createElement(yn,{present:r||s.open},s.disableHoverableContent?m.createElement(Q2,se({side:i},o,{ref:t})):m.createElement(NB,se({side:i},o,{ref:t})))}),NB=m.forwardRef((e,t)=>{const n=qh(ju,e.__scopeTooltip),r=Qb(ju,e.__scopeTooltip),i=m.useRef(null),o=nt(t,i),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,d=i.current,{onPointerInTransitChange:f}=r,g=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((v,b)=>{const x=v.currentTarget,w={x:v.clientX,y:v.clientY},S=LB(w,x.getBoundingClientRect()),C=FB(w,S),P=$B(b.getBoundingClientRect()),O=zB([...C,...P]);a(O),f(!0)},[f]);return m.useEffect(()=>()=>g(),[g]),m.useEffect(()=>{if(l&&d){const v=x=>p(x,d),b=x=>p(x,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",b)}}},[l,d,p,g]),m.useEffect(()=>{if(s){const v=b=>{const x=b.target,w={x:b.clientX,y:b.clientY},S=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),C=!jB(w,s);S?g():C&&(g(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,s,c,g]),m.createElement(Q2,se({},e,{ref:o}))}),[RB,cfe]=Uh(Zb,{isInside:!1}),Q2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,l=qh(ju,n),c=Kb(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(Xb,d),()=>document.removeEventListener(Xb,d)),[d]),m.useEffect(()=>{if(l.trigger){const f=g=>{const p=g.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),m.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:d},m.createElement($u,se({"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(v_,null,r),m.createElement(RB,{scope:n,isInside:!0},m.createElement(CB,{id:l.contentId,role:"tooltip"},i||r))))});function LB(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function FB(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function $B(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function jB(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,d=t[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function zB(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),BB(t)}function BB(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}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 VB=kB,HB=MB,WB=X2,Z2=IB,UB=VB,zu=HB,Gh=WB,Tl=de.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(Z2,{ref:r,sideOffset:t,className:De("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}));Tl.displayName=Z2.displayName;const J2=de.forwardRef(({className:e,...t},n)=>_.jsx("div",{className:"relative w-full overflow-auto",children:_.jsx("table",{ref:n,className:De("w-full caption-bottom text-sm",e),...t})}));J2.displayName="Table";const eO=de.forwardRef(({className:e,...t},n)=>_.jsx("thead",{ref:n,className:De("[&_tr]:border-b",e),...t}));eO.displayName="TableHeader";const tO=de.forwardRef(({className:e,...t},n)=>_.jsx("tbody",{ref:n,className:De("[&_tr:last-child]:border-0",e),...t}));tO.displayName="TableBody";const qB=de.forwardRef(({className:e,...t},n)=>_.jsx("tfoot",{ref:n,className:De("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));qB.displayName="TableFooter";const Yh=de.forwardRef(({className:e,...t},n)=>_.jsx("tr",{ref:n,className:De("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Yh.displayName="TableRow";const nO=de.forwardRef(({className:e,...t},n)=>_.jsx("th",{ref:n,className:De("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));nO.displayName="TableHead";const Jb=de.forwardRef(({className:e,...t},n)=>_.jsx("td",{ref:n,className:De("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Jb.displayName="TableCell";const GB=de.forwardRef(({className:e,...t},n)=>_.jsx("caption",{ref:n,className:De("mt-4 text-sm text-muted-foreground",e),...t}));GB.displayName="TableCaption";/**
130
130
  * table-core
131
131
  *
132
132
  * Copyright (c) TanStack
@@ -348,7 +348,7 @@ Valid keys: `+JSON.stringify(Object.keys(A),null," "));var te=we(pe,ie,ue,xe,ge
348
348
  */var BH=typeof document<"u"?de.useLayoutEffect:de.useEffect;function VH(e){var t=de.useReducer(function(){return{}},{})[1],n=op({},e,{onChange:function(s,a){a?kt.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=de.useState(function(){return new jH(n)}),i=r[0];return i.setOptions(n),de.useEffect(function(){return i._didMount()},[]),BH(function(){return i._willUpdate()}),i}function HH(e){return VH(op({observeElementRect:RH,observeElementOffset:LH,scrollToFn:$H},e))}var WH=Object.defineProperty,UH=(e,t,n)=>t in e?WH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P0=(e,t,n)=>(UH(e,typeof t!="symbol"?t+"":t,n),n);let qH=class{constructor(){P0(this,"current",this.detect()),P0(this,"handoffState","pending"),P0(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},ga=new qH,Sn=(e,t)=>{ga.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function Vi(e){let t=m.useRef(e);return Sn(()=>{t.current=e},[e]),t}function k0(e,t){let[n,r]=m.useState(e),i=Vi(e);return Sn(()=>r(i.current),[i,r,...t]),n}let xt=function(e){let t=Vi(e);return m.useCallback((...n)=>t.current(...n),[t])};function GH(e,t,n){let[r,i]=m.useState(n),o=e!==void 0,s=m.useRef(o),a=m.useRef(!1),l=m.useRef(!1);return o&&!s.current&&!a.current?(a.current=!0,s.current=o,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.")):!o&&s.current&&!l.current&&(l.current=!0,s.current=o,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.")),[o?e:r,xt(c=>(o||i(c),t==null?void 0:t(c)))]}function YH(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ma(){let e=[],t={addEventListener(n,r,i,o){return n.addEventListener(r,i,o),t.add(()=>n.removeEventListener(r,i,o))},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 YH(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,i){let o=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:o})})},group(n){let r=ma();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let i of e.splice(r,1))i()}},dispose(){for(let n of e.splice(0))n()}};return t}function Vu(){let[e]=m.useState(ma);return m.useEffect(()=>()=>e.dispose(),[e]),e}function KH(){let e=typeof document>"u";return"useSyncExternalStore"in de?(t=>t.useSyncExternalStore)(de)(()=>()=>{},()=>!1,()=>!e):!1}function D0(){let e=KH(),[t,n]=de.useState(ga.isHandoffComplete);return t&&ga.isHandoffComplete===!1&&n(!1),de.useEffect(()=>{t!==!0&&n(!0)},[t]),de.useEffect(()=>ga.handoff(),[]),e?!1:t}var qO;let Hu=(qO=m.useId)!=null?qO:function(){let e=D0(),[t,n]=m.useState(e?()=>ga.nextId():null);return Sn(()=>{t===null&&n(ga.nextId())},[t]),t!=null?""+t:void 0};function Fn(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Fn),r}function M0(e){return ga.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let GO=["[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 XH=(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))(XH||{}),QH=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(QH||{}),ZH=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(ZH||{}),YO=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(YO||{});function JH(e,t=0){var n;return e===((n=M0(e))==null?void 0:n.body)?!1:Fn(t,{0(){return e.matches(GO)},1(){let r=e;for(;r!==null;){if(r.matches(GO))return!0;r=r.parentElement}return!1}})}var e6=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(e6||{});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 t6(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),o=t(r);if(i===null||o===null)return 0;let s=i.compareDocumentPosition(o);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function n6(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function r6(){return/Android/gi.test(window.navigator.userAgent)}function KO(){return n6()||r6()}function ap(e,t,n){let r=Vi(t);m.useEffect(()=>{function i(o){r.current(o)}return document.addEventListener(e,i,n),()=>document.removeEventListener(e,i,n)},[e,n])}function i6(e,t,n){let r=Vi(t);m.useEffect(()=>{function i(o){r.current(o)}return window.addEventListener(e,i,n),()=>window.removeEventListener(e,i,n)},[e,n])}function o6(e,t,n=!0){let r=m.useRef(!1);m.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function i(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 d(f){return typeof f=="function"?d(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let d of c){if(d===null)continue;let f=d instanceof HTMLElement?d:d.current;if(f!=null&&f.contains(l)||s.composed&&s.composedPath().includes(f))return}return!JH(l,YO.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let o=m.useRef(null);ap("pointerdown",s=>{var a,l;r.current&&(o.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),ap("mousedown",s=>{var a,l;r.current&&(o.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),ap("click",s=>{KO()||o.current&&(i(s,()=>o.current),o.current=null)},!0),ap("touchend",s=>i(s,()=>s.target instanceof HTMLElement?s.target:null),!0),i6("blur",s=>i(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function s6(...e){return m.useMemo(()=>M0(...e),[...e])}function XO(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 a6(e,t){let[n,r]=m.useState(()=>XO(e));return Sn(()=>{r(XO(e))},[e.type,e.as]),Sn(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let l6=Symbol();function va(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=xt(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[l6]))?void 0:n}function QO(e){return[e.screenX,e.screenY]}function c6(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=QO(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=QO(t)}}}function u6({container:e,accept:t,walk:n,enabled:r=!0}){let i=m.useRef(t),o=m.useRef(n);m.useEffect(()=>{i.current=t,o.current=n},[t,n]),Sn(()=>{if(!e||!r)return;let s=M0(e);if(!s)return;let a=i.current,l=o.current,c=Object.assign(f=>a(f),{acceptNode:a}),d=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,c,!1);for(;d.nextNode();)l(d.currentNode)},[e,r,i,o])}function ZO(e,t){let n=m.useRef([]),r=xt(e);m.useEffect(()=>{let i=[...n.current];for(let[o,s]of t.entries())if(n.current[o]!==s){let a=r(t,i);return n.current=t,a}},[r,...t])}function lp(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var cp=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(cp||{}),cs=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(cs||{});function Co({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:a}){a=a??d6;let l=JO(t,e);if(o)return up(l,n,r,s,a);let c=i??0;if(c&2){let{static:d=!1,...f}=l;if(d)return up(f,n,r,s,a)}if(c&1){let{unmount:d=!0,...f}=l;return Fn(d?0:1,{0(){return null},1(){return up({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return up(l,n,r,s,a)}function up(e,t={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=A0(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},d=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let f={};if(t){let g=!1,p=[];for(let[v,b]of Object.entries(t))typeof b=="boolean"&&(g=!0),b===!0&&p.push(v);g&&(f["data-headlessui-state"]=p.join(" "))}if(o===m.Fragment&&Object.keys(T0(l)).length>0){if(!m.isValidElement(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(b=>` - ${b}`).join(`
349
349
  `),"","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(`
350
350
  `)].join(`
351
- `));let g=d.props,p=typeof(g==null?void 0:g.className)=="function"?(...b)=>lp(g==null?void 0:g.className(...b),l.className):lp(g==null?void 0:g.className,l.className),v=p?{className:p}:{};return m.cloneElement(d,Object.assign({},JO(d.props,T0(A0(l,["ref"]))),f,c,{ref:i(d.ref,c.ref)},v))}return m.createElement(o,Object.assign({},A0(l,["ref"]),o!==m.Fragment&&c,o!==m.Fragment&&f),d)}function d6(...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 JO(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];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](i,...o){let s=n[r];for(let a of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...o)}}});return t}function Hi(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function T0(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function A0(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let f6="div";var eP=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(eP||{});function h6(e,t){var n;let{features:r=1,...i}=e,o={ref:t,"aria-hidden":(r&2)===2?!0:(n=i["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 Co({ourProps:o,theirProps:i,slot:{},defaultTag:f6,name:"Hidden"})}let p6=Hi(h6),I0=m.createContext(null);I0.displayName="OpenClosedContext";var Tr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Tr||{});function N0(){return m.useContext(I0)}function tP({value:e,children:t}){return m.createElement(I0.Provider,{value:e},t)}function g6(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let ba=[];g6(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&ba[0]!==t.target&&(ba.unshift(t.target),ba=ba.filter(n=>n!=null&&n.isConnected),ba.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 m6(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&&v6(n)?!1:r}function v6(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function b6(e){throw new Error("Unexpected object: "+e)}var Cn=(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))(Cn||{});function nP(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 1:{for(let o=i-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 2:{for(let o=i+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return r}case 5:return null;default:b6(e)}}function rP(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))oP(n,iP(t,r),i);return n}function iP(e,t){return e?e+"["+t+"]":t}function oP(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())oP(e,iP(t,r.toString()),i);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,""]):rP(n,t,e)}var Ar=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ar||{}),y6=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(y6||{}),x6=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(x6||{}),w6=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(w6||{}),_6=(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))(_6||{});function R0(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),i=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):t6(r,s=>s.dataRef.current.domRef.current),o=n?i.indexOf(n):null;return o===-1&&(o=null),{options:i,activeOptionIndex:o}}let S6={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,i,o,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((i=e.dataRef.current)!=null&&i.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let d=t.focus===Cn.Specific?t.idx:nP(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var g,p;return(p=(g=e.activeOptionIndex)!=null?g:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?p:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===f?e:{...e,activeOptionIndex:d,activationTrigger:f}}let a=R0(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(f=>!f.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let l=t.focus===Cn.Specific?t.idx:nP(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.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,i;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let o=t.payload,s=R0(e,l=>(l.push(o),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(o));let a={...e,...s,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__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(i=>i.id!==t.id)};let r=R0(e,i=>{let o=i.findIndex(s=>s.id===t.id);return o!==-1&&i.splice(o,1),i});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 i=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?r=i:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},L0=m.createContext(null);L0.displayName="ComboboxActionsContext";function Wu(e){let t=m.useContext(L0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Wu),n}return t}let sP=m.createContext(null);function C6(e){var t;let n=ya("VirtualProvider"),[r,i]=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]),o=HH({scrollPaddingStart:r,scrollPaddingEnd:i,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 Sn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(sP.Provider,{value:o},m.createElement("div",{style:{position:"relative",width:"100%",height:`${o.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&&o.scrollToIndex(n.activeOptionIndex)}}},o.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 F0=m.createContext(null);F0.displayName="ComboboxDataContext";function ya(e){let t=m.useContext(F0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ya),n}return t}function E6(e,t){return Fn(t.type,S6,e,t)}let O6=m.Fragment;function P6(e,t){let{value:n,defaultValue:r,onChange:i,form:o,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:d=!1,multiple:f=!1,immediate:g=!1,virtual:p=null,...v}=e,b=!1,x=null,[w=f?[]:void 0,S]=GH(n,i,r),[C,P]=m.useReducer(E6,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),O=m.useRef(!1),k=m.useRef({static:!1,hold:!1}),T=m.useRef(null),I=m.useRef(null),F=m.useRef(null),j=m.useRef(null),B=xt(typeof a=="string"?(Q,ie)=>{let we=a;return(Q==null?void 0:Q[we])===(ie==null?void 0:ie[we])}:a??((Q,ie)=>Q===ie)),V=xt(Q=>C.options.findIndex(ie=>B(ie.dataRef.current.value,Q))),q=m.useCallback(Q=>Fn($.mode,{1:()=>w.some(ie=>B(ie,Q)),0:()=>B(w,Q)}),[w]),J=xt(Q=>C.activeOptionIndex===V(Q)),$=m.useMemo(()=>({...C,immediate:b,optionsPropsRef:k,labelRef:T,inputRef:I,buttonRef:F,optionsRef:j,value:w,defaultValue:r,disabled:l,mode:f?1:0,virtual:C.virtual,get activeOptionIndex(){if(O.current&&C.activeOptionIndex===null&&C.options.length>0){let Q=C.options.findIndex(ie=>!ie.dataRef.current.disabled);if(Q!==-1)return Q}return C.activeOptionIndex},calculateIndex:V,compare:B,isSelected:q,isActive:J,nullable:d,__demoMode:c}),[w,r,l,f,d,c,C,x]);Sn(()=>{},[x,void 0]),Sn(()=>{C.dataRef.current=$},[$]),o6([$.buttonRef,$.inputRef,$.optionsRef],()=>xe.closeCombobox(),$.comboboxState===0);let X=m.useMemo(()=>{var Q,ie,we;return{open:$.comboboxState===0,disabled:l,activeIndex:$.activeOptionIndex,activeOption:$.activeOptionIndex===null?null:$.virtual?$.virtual.options[(Q=$.activeOptionIndex)!=null?Q:0]:(we=(ie=$.options[$.activeOptionIndex])==null?void 0:ie.dataRef.current.value)!=null?we:null,value:w}},[$,l,w]),W=xt(()=>{if($.activeOptionIndex!==null){if($.virtual)R($.virtual.options[$.activeOptionIndex]);else{let{dataRef:Q}=$.options[$.activeOptionIndex];R(Q.current.value)}xe.goToOption(Cn.Specific,$.activeOptionIndex)}}),ne=xt(()=>{P({type:0}),O.current=!0}),le=xt(()=>{P({type:1}),O.current=!1}),A=xt((Q,ie,we)=>(O.current=!1,Q===Cn.Specific?P({type:2,focus:Cn.Specific,idx:ie,trigger:we}):P({type:2,focus:Q,trigger:we}))),H=xt((Q,ie)=>(P({type:3,payload:{id:Q,dataRef:ie}}),()=>{$.isActive(ie.current.value)&&(O.current=!0),P({type:4,id:Q})})),re=xt(Q=>(P({type:5,id:Q}),()=>P({type:5,id:null}))),R=xt(Q=>Fn($.mode,{0(){return S==null?void 0:S(Q)},1(){let ie=$.value.slice(),we=ie.findIndex(te=>B(te,Q));return we===-1?ie.push(Q):ie.splice(we,1),S==null?void 0:S(ie)}})),ue=xt(Q=>{P({type:6,trigger:Q})}),xe=m.useMemo(()=>({onChange:R,registerOption:H,registerLabel:re,goToOption:A,closeCombobox:le,openCombobox:ne,setActivationTrigger:ue,selectActiveOption:W}),[]),ge=t===null?{}:{ref:t},pe=m.useRef(null),ee=Vu();return m.useEffect(()=>{pe.current&&r!==void 0&&ee.addEventListener(pe.current,"reset",()=>{S==null||S(r)})},[pe,S]),m.createElement(L0.Provider,{value:xe},m.createElement(F0.Provider,{value:$},m.createElement(tP,{value:Fn($.comboboxState,{0:Tr.Open,1:Tr.Closed})},s!=null&&w!=null&&rP({[s]:w}).map(([Q,ie],we)=>m.createElement(p6,{features:eP.Hidden,ref:we===0?te=>{var Ie;pe.current=(Ie=te==null?void 0:te.closest("form"))!=null?Ie:null}:void 0,...T0({key:Q,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,name:Q,value:ie})})),Co({ourProps:ge,theirProps:v,slot:X,defaultTag:O6,name:"Combobox"}))))}let k6="input";function D6(e,t){var n,r,i,o,s;let a=Hu(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:d,type:f="text",...g}=e,p=ya("Combobox.Input"),v=Wu("Combobox.Input"),b=va(p.inputRef,t),x=s6(p.inputRef),w=m.useRef(!1),S=Vu(),C=xt(()=>{v.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),v.goToOption(Cn.Nothing)}),P=function(){var $;return typeof d=="function"&&p.value!==void 0?($=d(p.value))!=null?$:"":typeof p.value=="string"?p.value:""}();ZO(([$,X],[W,ne])=>{if(w.current)return;let le=p.inputRef.current;le&&((ne===0&&X===1||$!==W)&&(le.value=$),requestAnimationFrame(()=>{if(w.current||!le||(x==null?void 0:x.activeElement)!==le)return;let{selectionStart:A,selectionEnd:H}=le;Math.abs((H??0)-(A??0))===0&&A===0&&le.setSelectionRange(le.value.length,le.value.length)}))},[P,p.comboboxState,x]),ZO(([$],[X])=>{if($===0&&X===1){if(w.current)return;let W=p.inputRef.current;if(!W)return;let ne=W.value,{selectionStart:le,selectionEnd:A,selectionDirection:H}=W;W.value="",W.value=ne,H!==null?W.setSelectionRange(le,A,H):W.setSelectionRange(le,A)}},[p.comboboxState]);let O=m.useRef(!1),k=xt(()=>{O.current=!0}),T=xt(()=>{S.nextFrame(()=>{O.current=!1})}),I=xt($=>{switch(w.current=!0,$.key){case Ar.Enter:if(w.current=!1,p.comboboxState!==0||O.current)return;if($.preventDefault(),$.stopPropagation(),p.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),p.mode===0&&v.closeCombobox();break;case Ar.ArrowDown:return w.current=!1,$.preventDefault(),$.stopPropagation(),Fn(p.comboboxState,{0:()=>v.goToOption(Cn.Next),1:()=>v.openCombobox()});case Ar.ArrowUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),Fn(p.comboboxState,{0:()=>v.goToOption(Cn.Previous),1:()=>{v.openCombobox(),S.nextFrame(()=>{p.value||v.goToOption(Cn.Last)})}});case Ar.Home:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(Cn.First);case Ar.PageUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(Cn.First);case Ar.End:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(Cn.Last);case Ar.PageDown:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(Cn.Last);case Ar.Escape:return w.current=!1,p.comboboxState!==0?void 0:($.preventDefault(),p.optionsRef.current&&!p.optionsPropsRef.current.static&&$.stopPropagation(),p.nullable&&p.mode===0&&p.value===null&&C(),v.closeCombobox());case Ar.Tab:if(w.current=!1,p.comboboxState!==0)return;p.mode===0&&p.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),F=xt($=>{c==null||c($),p.nullable&&p.mode===0&&$.target.value===""&&C(),v.openCombobox()}),j=xt($=>{var X,W,ne;let le=(X=$.relatedTarget)!=null?X:ba.find(A=>A!==$.currentTarget);if(w.current=!1,!((W=p.optionsRef.current)!=null&&W.contains(le))&&!((ne=p.buttonRef.current)!=null&&ne.contains(le))&&p.comboboxState===0)return $.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?C():p.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),B=xt($=>{var X,W,ne;let le=(X=$.relatedTarget)!=null?X:ba.find(A=>A!==$.currentTarget);(W=p.buttonRef.current)!=null&&W.contains(le)||(ne=p.optionsRef.current)!=null&&ne.contains(le)||p.disabled||p.immediate&&p.comboboxState!==0&&(v.openCombobox(),S.nextFrame(()=>{v.setActivationTrigger(1)}))}),V=k0(()=>{if(p.labelId)return[p.labelId].join(" ")},[p.labelId]),q=m.useMemo(()=>({open:p.comboboxState===0,disabled:p.disabled}),[p]),J={ref:b,id:l,role:"combobox",type:f,"aria-controls":(n=p.optionsRef.current)==null?void 0:n.id,"aria-expanded":p.comboboxState===0,"aria-activedescendant":p.activeOptionIndex===null?void 0:p.virtual?(r=p.options.find($=>{var X;return!((X=p.virtual)!=null&&X.disabled($.dataRef.current.value))&&p.compare($.dataRef.current.value,p.virtual.options[p.activeOptionIndex])}))==null?void 0:r.id:(i=p.options[p.activeOptionIndex])==null?void 0:i.id,"aria-labelledby":V,"aria-autocomplete":"list",defaultValue:(s=(o=e.defaultValue)!=null?o:p.defaultValue!==void 0?d==null?void 0:d(p.defaultValue):null)!=null?s:p.defaultValue,disabled:p.disabled,onCompositionStart:k,onCompositionEnd:T,onKeyDown:I,onChange:F,onFocus:B,onBlur:j};return Co({ourProps:J,theirProps:g,slot:q,defaultTag:k6,name:"Combobox.Input"})}let M6="button";function T6(e,t){var n;let r=ya("Combobox.Button"),i=Wu("Combobox.Button"),o=va(r.buttonRef,t),s=Hu(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=Vu(),d=xt(b=>{switch(b.key){case Ar.ArrowDown:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&i.openCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Ar.ArrowUp:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&(i.openCombobox(),c.nextFrame(()=>{r.value||i.goToOption(Cn.Last)})),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Ar.Escape:return r.comboboxState!==0?void 0:(b.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&b.stopPropagation(),i.closeCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})}));default:return}}),f=xt(b=>{if(m6(b.currentTarget))return b.preventDefault();r.comboboxState===0?i.closeCombobox():(b.preventDefault(),i.openCombobox()),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),g=k0(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),p=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:o,id:a,type:a6(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":g,disabled:r.disabled,onClick:f,onKeyDown:d};return Co({ourProps:v,theirProps:l,slot:p,defaultTag:M6,name:"Combobox.Button"})}let A6="label";function I6(e,t){let n=Hu(),{id:r=`headlessui-combobox-label-${n}`,...i}=e,o=ya("Combobox.Label"),s=Wu("Combobox.Label"),a=va(o.labelRef,t);Sn(()=>s.registerLabel(r),[r]);let l=xt(()=>{var d;return(d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]);return Co({ourProps:{ref:a,id:r,onClick:l},theirProps:i,slot:c,defaultTag:A6,name:"Combobox.Label"})}let N6="ul",R6=cp.RenderStrategy|cp.Static;function L6(e,t){let n=Hu(),{id:r=`headlessui-combobox-options-${n}`,hold:i=!1,...o}=e,s=ya("Combobox.Options"),a=va(s.optionsRef,t),l=N0(),c=l!==null?(l&Tr.Open)===Tr.Open:s.comboboxState===0;Sn(()=>{var p;s.optionsPropsRef.current.static=(p=e.static)!=null?p:!1},[s.optionsPropsRef,e.static]),Sn(()=>{s.optionsPropsRef.current.hold=i},[s.optionsPropsRef,i]),u6({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(p){return p.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:p.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(p){p.setAttribute("role","none")}});let d=k0(()=>{var p,v;return(v=s.labelId)!=null?v:(p=s.buttonRef.current)==null?void 0:p.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),g={"aria-labelledby":d,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(o,{children:m.createElement(C6,null,o.children)}),Co({ourProps:g,theirProps:o,slot:f,defaultTag:N6,features:R6,visible:c,name:"Combobox.Options"})}let F6="li";function $6(e,t){var n;let r=Hu(),{id:i=`headlessui-combobox-option-${r}`,disabled:o=!1,value:s,order:a=null,...l}=e,c=ya("Combobox.Option"),d=Wu("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===i,g=c.isSelected(s),p=m.useRef(null),v=Vi({disabled:o,value:s,domRef:p,order:a}),b=m.useContext(sP),x=va(t,p,b?b.measureElement:null),w=xt(()=>d.onChange(s));Sn(()=>d.registerOption(i,v),[v,i]);let S=m.useRef(!(c.virtual||c.__demoMode));Sn(()=>{if(!c.virtual||!c.__demoMode)return;let j=ma();return j.requestAnimationFrame(()=>{S.current=!0}),j.dispose},[c.virtual,c.__demoMode]),Sn(()=>{if(!S.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let j=ma();return j.requestAnimationFrame(()=>{var B,V;(V=(B=p.current)==null?void 0:B.scrollIntoView)==null||V.call(B,{block:"nearest"})}),j.dispose},[p,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let C=xt(j=>{var B;if(o||(B=c.virtual)!=null&&B.disabled(s))return j.preventDefault();w(),KO()||requestAnimationFrame(()=>{var V;return(V=c.inputRef.current)==null?void 0:V.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),P=xt(()=>{var j;if(o||(j=c.virtual)!=null&&j.disabled(s))return d.goToOption(Cn.Nothing);let B=c.calculateIndex(s);d.goToOption(Cn.Specific,B)}),O=c6(),k=xt(j=>O.update(j)),T=xt(j=>{var B;if(!O.wasMoved(j)||o||(B=c.virtual)!=null&&B.disabled(s)||f)return;let V=c.calculateIndex(s);d.goToOption(Cn.Specific,V,0)}),I=xt(j=>{var B;O.wasMoved(j)&&(o||(B=c.virtual)!=null&&B.disabled(s)||f&&(c.optionsPropsRef.current.hold||d.goToOption(Cn.Nothing)))}),F=m.useMemo(()=>({active:f,selected:g,disabled:o}),[f,g,o]);return Co({ourProps:{id:i,ref:x,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":g,disabled:void 0,onClick:C,onFocus:P,onPointerEnter:k,onMouseEnter:k,onPointerMove:T,onMouseMove:T,onPointerLeave:I,onMouseLeave:I},theirProps:l,slot:F,defaultTag:F6,name:"Combobox.Option"})}let j6=Hi(P6),z6=Hi(T6),B6=Hi(D6),V6=Hi(I6),H6=Hi(L6),W6=Hi($6),jl=Object.assign(j6,{Input:B6,Button:z6,Label:V6,Options:H6,Option:W6});function $0(){let e=m.useRef(!1);return Sn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function U6(e=0){let[t,n]=m.useState(e),r=$0(),i=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),o=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:i,hasFlag:o,removeFlag:s,toggleFlag:a}}function q6(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function j0(e,...t){e&&t.length>0&&e.classList.add(...t)}function z0(e,...t){e&&t.length>0&&e.classList.remove(...t)}function G6(e,t){let n=ma();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,s]=[r,i].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,f)=>f-d);return c}),a=o+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",d=>{d.target===d.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 Y6(e,t,n,r){let i=n?"enter":"leave",o=ma(),s=r!==void 0?q6(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Fn(i,{enter:()=>t.enter,leave:()=>t.leave}),l=Fn(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Fn(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return z0(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),j0(e,...t.base,...a,...c),o.nextFrame(()=>{z0(e,...t.base,...a,...c),j0(e,...t.base,...a,...l),G6(e,()=>(z0(e,...t.base,...a),j0(e,...t.base,...t.entered),s()))}),o.dispose}function K6({immediate:e,container:t,direction:n,classes:r,onStart:i,onStop:o}){let s=$0(),a=Vu(),l=Vi(n);Sn(()=>{e&&(l.current="enter")},[e]),Sn(()=>{let c=ma();a.add(c.dispose);let d=t.current;if(d&&l.current!=="idle"&&s.current)return c.dispose(),i.current(l.current),c.add(Y6(d,r.current,l.current==="enter",()=>{c.dispose(),o.current(l.current)})),c.dispose},[n])}function us(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let dp=m.createContext(null);dp.displayName="TransitionContext";var X6=(e=>(e.Visible="visible",e.Hidden="hidden",e))(X6||{});function Q6(){let e=m.useContext(dp);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Z6(){let e=m.useContext(fp);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let fp=m.createContext(null);fp.displayName="NestingContext";function hp(e){return"children"in e?hp(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function aP(e,t){let n=Vi(e),r=m.useRef([]),i=$0(),o=Vu(),s=xt((p,v=cs.Hidden)=>{let b=r.current.findIndex(({el:x})=>x===p);b!==-1&&(Fn(v,{[cs.Unmount](){r.current.splice(b,1)},[cs.Hidden](){r.current[b].state="hidden"}}),o.microTask(()=>{var x;!hp(r)&&i.current&&((x=n.current)==null||x.call(n))}))}),a=xt(p=>{let v=r.current.find(({el:b})=>b===p);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,cs.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[],idle:[]}),f=xt((p,v,b)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([x])=>x!==p)),t==null||t.chains.current[v].push([p,new Promise(x=>{l.current.push(x)})]),t==null||t.chains.current[v].push([p,new Promise(x=>{Promise.all(d.current[v].map(([w,S])=>S)).then(()=>x())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(v)):b(v)}),g=xt((p,v,b)=>{Promise.all(d.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:g,wait:c,chains:d}),[a,s,r,f,g,d,c])}function J6(){}let eW=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function lP(e){var t;let n={};for(let r of eW)n[r]=(t=e[r])!=null?t:J6;return n}function tW(e){let t=m.useRef(lP(e));return m.useEffect(()=>{t.current=lP(e)},[e]),t}let nW="div",cP=cp.RenderStrategy;function rW(e,t){var n,r;let{beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:d,entered:f,leave:g,leaveFrom:p,leaveTo:v,...b}=e,x=m.useRef(null),w=va(x,t),S=(n=b.unmount)==null||n?cs.Unmount:cs.Hidden,{show:C,appear:P,initial:O}=Q6(),[k,T]=m.useState(C?"visible":"hidden"),I=Z6(),{register:F,unregister:j}=I;m.useEffect(()=>F(x),[F,x]),m.useEffect(()=>{if(S===cs.Hidden&&x.current){if(C&&k!=="visible"){T("visible");return}return Fn(k,{hidden:()=>j(x),visible:()=>F(x)})}},[k,x,F,j,C,S]);let B=Vi({base:us(b.className),enter:us(l),enterFrom:us(c),enterTo:us(d),entered:us(f),leave:us(g),leaveFrom:us(p),leaveTo:us(v)}),V=tW({beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a}),q=D0();m.useEffect(()=>{if(q&&k==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,k,q]);let J=O&&!P,$=P&&C&&O,X=!q||J?"idle":C?"enter":"leave",W=U6(0),ne=xt(ue=>Fn(ue,{enter:()=>{W.addFlag(Tr.Opening),V.current.beforeEnter()},leave:()=>{W.addFlag(Tr.Closing),V.current.beforeLeave()},idle:()=>{}})),le=xt(ue=>Fn(ue,{enter:()=>{W.removeFlag(Tr.Opening),V.current.afterEnter()},leave:()=>{W.removeFlag(Tr.Closing),V.current.afterLeave()},idle:()=>{}})),A=aP(()=>{T("hidden"),j(x)},I),H=m.useRef(!1);K6({immediate:$,container:x,classes:B,direction:X,onStart:Vi(ue=>{H.current=!0,A.onStart(x,ue,ne)}),onStop:Vi(ue=>{H.current=!1,A.onStop(x,ue,le),ue==="leave"&&!hp(A)&&(T("hidden"),j(x))})});let re=b,R={ref:w};return $?re={...re,className:lp(b.className,...B.current.enter,...B.current.enterFrom)}:H.current&&(re.className=lp(b.className,(r=x.current)==null?void 0:r.className),re.className===""&&delete re.className),m.createElement(fp.Provider,{value:A},m.createElement(tP,{value:Fn(k,{visible:Tr.Open,hidden:Tr.Closed})|W.flags},Co({ourProps:R,theirProps:re,defaultTag:nW,features:cP,visible:k==="visible",name:"Transition.Child"})))}function iW(e,t){let{show:n,appear:r=!1,unmount:i=!0,...o}=e,s=m.useRef(null),a=va(s,t);D0();let l=N0();if(n===void 0&&l!==null&&(n=(l&Tr.Open)===Tr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=m.useState(n?"visible":"hidden"),f=aP(()=>{d("hidden")}),[g,p]=m.useState(!0),v=m.useRef([n]);Sn(()=>{g!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))},[v,n]);let b=m.useMemo(()=>({show:n,appear:r,initial:g}),[n,r,g]);m.useEffect(()=>{if(n)d("visible");else if(!hp(f))d("hidden");else{let C=s.current;if(!C)return;let P=C.getBoundingClientRect();P.x===0&&P.y===0&&P.width===0&&P.height===0&&d("hidden")}},[n,f]);let x={unmount:i},w=xt(()=>{var C;g&&p(!1),(C=e.beforeEnter)==null||C.call(e)}),S=xt(()=>{var C;g&&p(!1),(C=e.beforeLeave)==null||C.call(e)});return m.createElement(fp.Provider,{value:f},m.createElement(dp.Provider,{value:b},Co({ourProps:{...x,as:m.Fragment,children:m.createElement(uP,{ref:a,...x,...o,beforeEnter:w,beforeLeave:S})},theirProps:{},defaultTag:m.Fragment,features:cP,visible:c==="visible",name:"Transition"})))}function oW(e,t){let n=m.useContext(dp)!==null,r=N0()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(B0,{ref:t,...e}):m.createElement(uP,{ref:t,...e}))}let B0=Hi(iW),uP=Hi(rW),sW=Hi(oW),aW=Object.assign(B0,{Child:sW,Root:B0});const Uu=["text","varchar","nvarchar","nvarchar2","char","character","nchar","char varying","nchar varying","character varying","string"],ds=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],xa=["date","datetime","time","timestamp","timestamp without time zone"],pp=["boolean"];function _i(e){return e.match(/[A-Z]/)?`"${e}"`:e}function V0(e,t,n){const{measures:r,dimensions:i}=e,o=r==null?void 0:r.map(c=>`${c.calc}(${c.name}) as ${c.calc}_${c.name}`).join(", "),s=(i==null?void 0:i.join(", "))||"";let a="";const l=mp(t,n);if(o&&s)return a=`SELECT ${s}, COUNT(*), ${o} FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(!o&&s)return a=`SELECT ${s}, COUNT(*) FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(o&&!s)return a=`SELECT ${o} FROM ${l}`,a}function H0(e,t,n="AVG"){var o,s,a,l;let r={};const i=_i(e.column_name);return Uu.includes(e.data_type)&&(((o=t.dimensions)==null?void 0:o.includes(i))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(d=>d!==i)}:r={...t,dimensions:[...t.dimensions||[],i]}),ds.includes(e.data_type)&&(((a=t.measures)==null?void 0:a.some(d=>d.name===i&&d.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(d=>!(d.name===i&&d.calc===n))}:r={...t,measures:[...t.measures||[],{name:i,calc:n||"SUM"}]}),r}function gp(e){return Uu.includes(e.dataType)?"string":ds.includes(e.dataType)?"number":xa.includes(e.dataType)?"date":pp.includes(e.dataType)?"boolean":"string"}function lW(e){let t;const n=e.data_type.toLowerCase();return Uu.includes(n)?t="T":ds.includes(n)?t="#":xa.includes(n)?t="D":pp.includes(n)?t="B":t="?",t}function dP(e,t){const{dimensions:n,measures:r}=t,i=n==null?void 0:n.includes(e.column_name),o=r==null?void 0:r.some(s=>s.name===e.column_name);return i||o}function mp(e,t){return e==="public"?t:e?`${e}.${t}`:`${t}`}function cW(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[i,o]=e.split(r);return{operation:r,value:o.trim()}}else return null}const fP=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,hP=of,pP=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return hP(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const d=n==null?void 0:n[c],f=o==null?void 0:o[c];if(d===null)return null;const g=fP(d)||fP(f);return i[c][g]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,g]=d;return g===void 0||(c[f]=g),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:g,...p}=d;return Object.entries(p).every(v=>{let[b,x]=v;return Array.isArray(x)?x.includes({...o,...a}[b]):{...o,...a}[b]===x})?[...c,f,g]:c},[]);return hP(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},W0=pP("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"}}),it=de.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?oo:"button";return _.jsx(s,{className:De(W0({variant:t,size:n,className:e})),ref:o,...i})});it.displayName="Button";function uW({filter:e}){const[t,n]=m.useState([]),[r,i]=m.useState(""),[o,s]=m.useState(""),a=m.useRef(null),l=fe(k=>k.authToken),c=fe(k=>k.filterValues),d=fe(k=>k.actions.addOrUpdateFilterValue),f=fe(k=>k.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:b,refetch:x}=Xr({queryKey:[e.sql],queryFn:()=>ll("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database}),w=m.useMemo(()=>{var k;return(k=g==null?void 0:g.records)==null?void 0:k.map(T=>({id:T[e.column.split(".").slice(-1)[0].toLowerCase()],value:T[e.column.split(".").slice(-1)[0].toLowerCase()]}))},[g,e.column]);m.useEffect(()=>{if(c){const k=c.find(T=>T.filterId===e.id);if(!k){n([]);return}if(k.operation==="in"){const T=w==null?void 0:w.filter(I=>k.values.includes(I.value));T&&n(T)}else i(`${k.operation} ${k.values[0]}`)}},[g]),m.useEffect(()=>{if(c&&!c.find(T=>T.filterId===e.id)){n([]);return}},[c,e.id]);function S(k){const T=cW(k[0].toString());if(!(T!=null&&T.value)||!(T!=null&&T.operation))return;const I={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:gp(e),name:e.column,operation:T.operation,values:[T.value]};d(I)}function C(k){if(console.log("onComboBoxChange",k),k.length===1&&w.find(I=>I.value===k[0].value)===void 0){S(k);return}if(n(k),k.length===0){f(e.id);return}const T={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:gp(e),operation:"in",values:k.map(I=>I.value)};d(T)}function P(){var k;i(""),f(e.id),console.log(e.id),(k=a.current)==null||k.click()}if(p)return _.jsx("div",{children:_.jsx(Sf,{className:" bg-foreground/10 h-8 w-[180px]"})});if(b)return _.jsx("div",{className:"bg-muted h-8 w-[180px] px-2",children:"Error"});if(!g)return null;let O=[];return ds.includes(e.dataType)?O=w:O=o===""?w:w.filter(k=>k.value.toLowerCase().replace(/\s+/g,"").includes(o.toLowerCase().replace(/\s+/g,""))),_.jsx(jl,{value:t,onChange:C,multiple:!0,children:_.jsxs("div",{className:"relative",children:[_.jsxs("div",{className:" border relative w-full cursor-default overflow-hidden rounded-sm 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:[_.jsx(jl.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:k=>k.map(I=>I.value).join(", ")||r,onChange:k=>{i(k.target.value),s(k.target.value)}}),_.jsx(jl.Button,{ref:a,className:"absolute bg-background pl-1 inset-y-0 right-0 flex items-center pr-2",children:_.jsx(uz,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),_.jsx(aW,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:_.jsxs(jl.Options,{className:" z-10 absolute mt-1 max-h-60 w-full overflow-auto rounded-sm bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm border",children:[ds.includes(e.dataType)&&_.jsxs(jl.Option,{value:r,className:" flex items-center px-3 justify-between gap-2 py-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:" font-thin",children:"#"}),_.jsx("span",{children:r})]}),r&&_.jsx(it,{variant:"link",className:" h-4 w-3 text-foreground/50 hover:text-foreground/100 cursor-pointer",onClick:k=>{k.stopPropagation(),P()},children:"Clear"})]}),O.length===0&&o!==""?_.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):O.map(k=>_.jsx(jl.Option,{className:({active:T})=>`relative cursor-default select-none py-2 pl-10 pr-4 ${T?"bg-muted ":"text-foreground-900"}`,value:k,children:({selected:T,active:I})=>(T&&console.log("record",k,T),_.jsxs(_.Fragment,{children:[_.jsx("span",{className:`block truncate ${T?"font-medium":"font-normal"}`,children:typeof k.value=="boolean"?k.value?"True":"False":k.value}),T?_.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:_.jsx(b2,{className:"h-5 w-5","aria-hidden":"true"})}):null]}))},k.value))]})})]})})}const gP=m.forwardRef((e,t)=>m.createElement(He.label,se({},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()}}))),dW=pP("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ni=de.forwardRef(({className:e,...t},n)=>_.jsx(gP,{ref:n,className:De(dW(),e),...t}));ni.displayName=gP.displayName;function Ot(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 Ir(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Jn(e,t){const n=Ot(e);return isNaN(t)?Ir(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Si(e,t){const n=Ot(e);if(isNaN(t))return Ir(e,NaN);if(!t)return n;const r=n.getDate(),i=Ir(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}const U0=6048e5,fW=864e5;let hW={};function qu(){return hW}function Wi(e,t){var a,l,c,d;const n=qu(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,i=Ot(e),o=i.getDay(),s=(o<r?7:0)+o-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function wa(e){return Wi(e,{weekStartsOn:1})}function mP(e){const t=Ot(e),n=t.getFullYear(),r=Ir(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=wa(r),o=Ir(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=wa(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function zl(e){const t=Ot(e);return t.setHours(0,0,0,0),t}function vp(e){const t=Ot(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 Ui(e,t){const n=zl(e),r=zl(t),i=+n-vp(n),o=+r-vp(r);return Math.round((i-o)/fW)}function pW(e){const t=mP(e),n=Ir(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),wa(n)}function q0(e,t){const n=t*7;return Jn(e,n)}function gW(e,t){return Si(e,t*12)}function mW(e){let t;return e.forEach(function(n){const r=Ot(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function vW(e){let t;return e.forEach(n=>{const r=Ot(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function dr(e,t){const n=zl(e),r=zl(t);return+n==+r}function G0(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function bW(e){if(!G0(e)&&typeof e!="number")return!1;const t=Ot(e);return!isNaN(Number(t))}function Gu(e,t){const n=Ot(e),r=Ot(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function yW(e,t,n){const r=Wi(e,n),i=Wi(t,n),o=+r-vp(r),s=+i-vp(i);return Math.round((o-s)/U0)}function Y0(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function fr(e){const t=Ot(e);return t.setDate(1),t.setHours(0,0,0,0),t}function vP(e){const t=Ot(e),n=Ir(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function K0(e,t){var a,l,c,d;const n=qu(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,i=Ot(e),o=i.getDay(),s=(o<r?-7:0)+6-(o-r);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function bP(e){return K0(e,{weekStartsOn:1})}const xW={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"}},wW=(e,t,n)=>{let r;const i=xW[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function X0(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const _W={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},SW={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},CW={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},EW={date:X0({formats:_W,defaultWidth:"full"}),time:X0({formats:SW,defaultWidth:"full"}),dateTime:X0({formats:CW,defaultWidth:"full"})},OW={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},PW=(e,t,n,r)=>OW[e];function Yu(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[s]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const kW={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},DW={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},MW={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"]},TW={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"]},AW={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"}},IW={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"}},NW={ordinalNumber:(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"},era:Yu({values:kW,defaultWidth:"wide"}),quarter:Yu({values:DW,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yu({values:MW,defaultWidth:"wide"}),day:Yu({values:TW,defaultWidth:"wide"}),dayPeriod:Yu({values:AW,defaultWidth:"wide",formattingValues:IW,defaultFormattingWidth:"wide"})};function Ku(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?LW(a,f=>f.test(s)):RW(a,f=>f.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(s.length);return{value:c,rest:d}}}function RW(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function LW(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function FW(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(i.length);return{value:s,rest:a}}}const $W=/^(\d+)(th|st|nd|rd)?/i,jW=/\d+/i,zW={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},BW={any:[/^b/i,/^(a|c)/i]},VW={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},HW={any:[/1/i,/2/i,/3/i,/4/i]},WW={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},UW={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]},qW={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},GW={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]},YW={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},KW={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}},XW={ordinalNumber:FW({matchPattern:$W,parsePattern:jW,valueCallback:e=>parseInt(e,10)}),era:Ku({matchPatterns:zW,defaultMatchWidth:"wide",parsePatterns:BW,defaultParseWidth:"any"}),quarter:Ku({matchPatterns:VW,defaultMatchWidth:"wide",parsePatterns:HW,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ku({matchPatterns:WW,defaultMatchWidth:"wide",parsePatterns:UW,defaultParseWidth:"any"}),day:Ku({matchPatterns:qW,defaultMatchWidth:"wide",parsePatterns:GW,defaultParseWidth:"any"}),dayPeriod:Ku({matchPatterns:YW,defaultMatchWidth:"any",parsePatterns:KW,defaultParseWidth:"any"})},yP={code:"en-US",formatDistance:wW,formatLong:EW,formatRelative:PW,localize:NW,match:XW,options:{weekStartsOn:0,firstWeekContainsDate:1}};function QW(e){const t=Ot(e);return Ui(t,vP(t))+1}function xP(e){const t=Ot(e),n=+wa(t)-+pW(t);return Math.round(n/U0)+1}function wP(e,t){var d,f,g,p;const n=Ot(e),r=n.getFullYear(),i=qu(),o=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.firstWeekContainsDate)??1,s=Ir(e,0);s.setFullYear(r+1,0,o),s.setHours(0,0,0,0);const a=Wi(s,t),l=Ir(e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=Wi(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function ZW(e,t){var a,l,c,d;const n=qu(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,i=wP(e,t),o=Ir(e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Wi(o,t)}function _P(e,t){const n=Ot(e),r=+Wi(n,t)-+ZW(n,t);return Math.round(r/U0)+1}function Ft(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const fs={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ft(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ft(n+1,2)},d(e,t){return Ft(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 Ft(e.getHours()%12||12,t.length)},H(e,t){return Ft(e.getHours(),t.length)},m(e,t){return Ft(e.getMinutes(),t.length)},s(e,t){return Ft(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ft(i,t.length)}},Bl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},SP={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(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return fs.y(e,t)},Y:function(e,t,n,r){const i=wP(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return Ft(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Ft(o,t.length)},R:function(e,t){const n=mP(e);return Ft(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ft(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 Ft(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 Ft(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 fs.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 Ft(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 i=_P(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ft(i,t.length)},I:function(e,t,n){const r=xP(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ft(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):fs.d(e,t)},D:function(e,t,n){const r=QW(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ft(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 i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Ft(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Ft(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Ft(i,t.length);case"io":return n.ordinalNumber(i,{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 i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Bl.noon:r===0?i=Bl.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Bl.evening:r>=12?i=Bl.afternoon:r>=4?i=Bl.morning:i=Bl.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{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 fs.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):fs.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ft(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ft(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):fs.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):fs.s(e,t)},S:function(e,t){return fs.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return EP(r);case"XXXX":case"XX":return _a(r);case"XXXXX":case"XXX":default:return _a(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return EP(r);case"xxxx":case"xx":return _a(r);case"xxxxx":case"xxx":default:return _a(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+CP(r,":");case"OOOO":default:return"GMT"+_a(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+CP(r,":");case"zzzz":default:return"GMT"+_a(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Ft(r,t.length)},T:function(e,t,n){const r=e.getTime();return Ft(r,t.length)}};function CP(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Ft(o,2)}function EP(e,t){return e%60===0?(e>0?"-":"+")+Ft(Math.abs(e)/60,2):_a(e,t)}function _a(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Ft(Math.trunc(r/60),2),o=Ft(r%60,2);return n+i+t+o}const OP=(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"})}},PP=(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"})}},JW={p:PP,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return OP(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",OP(r,t)).replace("{{time}}",PP(i,t))}},eU=/^D+$/,tU=/^Y+$/,nU=["D","DD","YY","YYYY"];function rU(e){return eU.test(e)}function iU(e){return tU.test(e)}function oU(e,t,n){const r=sU(e,t,n);if(console.warn(r),nU.includes(e))throw new RangeError(r)}function sU(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 aU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cU=/^'([^]*?)'?$/,uU=/''/g,dU=/[a-zA-Z]/;function qi(e,t,n){var d,f,g,p,v,b,x,w;const r=qu(),i=(n==null?void 0:n.locale)??r.locale??yP,o=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(g=r.locale)==null?void 0:g.options)==null?void 0:p.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=Ot(e);if(!bW(a))throw new RangeError("Invalid time value");let l=t.match(lU).map(S=>{const C=S[0];if(C==="p"||C==="P"){const P=JW[C];return P(S,i.formatLong)}return S}).join("").match(aU).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:fU(S)};if(SP[C])return{isToken:!0,value:S};if(C.match(dU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const C=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&iU(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&rU(C))&&oU(C,t,String(e));const P=SP[C[0]];return P(a,C,i.localize,c)}).join("")}function fU(e){const t=e.match(cU);return t?t[1].replace(uU,"'"):e}function hU(e){const t=Ot(e),n=t.getFullYear(),r=t.getMonth(),i=Ir(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function pU(e){return Math.trunc(+Ot(e)/1e3)}function gU(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function mU(e,t){return yW(gU(e),fr(e),t)+1}function Q0(e,t){const n=Ot(e),r=Ot(t);return n.getTime()>r.getTime()}function kP(e,t){const n=Ot(e),r=Ot(t);return+n<+r}function Z0(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function vU(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()}function J0(e,t){return Jn(e,-t)}function ey(e,t){const n=Ot(e),r=n.getFullYear(),i=n.getDate(),o=Ir(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const s=hU(o);return n.setMonth(t,Math.min(i,s)),n}function DP(e,t){const n=Ot(e);return isNaN(+n)?Ir(e,NaN):(n.setFullYear(t),n)}var Xe=function(){return Xe=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Xe.apply(this,arguments)};function bU(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function MP(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ty={exports:{}},Xu={};/**
351
+ `));let g=d.props,p=typeof(g==null?void 0:g.className)=="function"?(...b)=>lp(g==null?void 0:g.className(...b),l.className):lp(g==null?void 0:g.className,l.className),v=p?{className:p}:{};return m.cloneElement(d,Object.assign({},JO(d.props,T0(A0(l,["ref"]))),f,c,{ref:i(d.ref,c.ref)},v))}return m.createElement(o,Object.assign({},A0(l,["ref"]),o!==m.Fragment&&c,o!==m.Fragment&&f),d)}function d6(...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 JO(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];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](i,...o){let s=n[r];for(let a of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...o)}}});return t}function Hi(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function T0(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function A0(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let f6="div";var eP=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(eP||{});function h6(e,t){var n;let{features:r=1,...i}=e,o={ref:t,"aria-hidden":(r&2)===2?!0:(n=i["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 Co({ourProps:o,theirProps:i,slot:{},defaultTag:f6,name:"Hidden"})}let p6=Hi(h6),I0=m.createContext(null);I0.displayName="OpenClosedContext";var Tr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Tr||{});function N0(){return m.useContext(I0)}function tP({value:e,children:t}){return m.createElement(I0.Provider,{value:e},t)}function g6(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let ba=[];g6(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&ba[0]!==t.target&&(ba.unshift(t.target),ba=ba.filter(n=>n!=null&&n.isConnected),ba.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 m6(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&&v6(n)?!1:r}function v6(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function b6(e){throw new Error("Unexpected object: "+e)}var Cn=(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))(Cn||{});function nP(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 1:{for(let o=i-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 2:{for(let o=i+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return r}case 5:return null;default:b6(e)}}function rP(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))oP(n,iP(t,r),i);return n}function iP(e,t){return e?e+"["+t+"]":t}function oP(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())oP(e,iP(t,r.toString()),i);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,""]):rP(n,t,e)}var Ar=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ar||{}),y6=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(y6||{}),x6=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(x6||{}),w6=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(w6||{}),_6=(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))(_6||{});function R0(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),i=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):t6(r,s=>s.dataRef.current.domRef.current),o=n?i.indexOf(n):null;return o===-1&&(o=null),{options:i,activeOptionIndex:o}}let S6={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,i,o,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((i=e.dataRef.current)!=null&&i.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let d=t.focus===Cn.Specific?t.idx:nP(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var g,p;return(p=(g=e.activeOptionIndex)!=null?g:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?p:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===f?e:{...e,activeOptionIndex:d,activationTrigger:f}}let a=R0(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(f=>!f.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let l=t.focus===Cn.Specific?t.idx:nP(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.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,i;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let o=t.payload,s=R0(e,l=>(l.push(o),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(o));let a={...e,...s,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__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(i=>i.id!==t.id)};let r=R0(e,i=>{let o=i.findIndex(s=>s.id===t.id);return o!==-1&&i.splice(o,1),i});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 i=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?r=i:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},L0=m.createContext(null);L0.displayName="ComboboxActionsContext";function Wu(e){let t=m.useContext(L0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Wu),n}return t}let sP=m.createContext(null);function C6(e){var t;let n=ya("VirtualProvider"),[r,i]=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]),o=HH({scrollPaddingStart:r,scrollPaddingEnd:i,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 Sn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(sP.Provider,{value:o},m.createElement("div",{style:{position:"relative",width:"100%",height:`${o.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&&o.scrollToIndex(n.activeOptionIndex)}}},o.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 F0=m.createContext(null);F0.displayName="ComboboxDataContext";function ya(e){let t=m.useContext(F0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ya),n}return t}function E6(e,t){return Fn(t.type,S6,e,t)}let O6=m.Fragment;function P6(e,t){let{value:n,defaultValue:r,onChange:i,form:o,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:d=!1,multiple:f=!1,immediate:g=!1,virtual:p=null,...v}=e,b=!1,x=null,[w=f?[]:void 0,S]=GH(n,i,r),[C,P]=m.useReducer(E6,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),O=m.useRef(!1),k=m.useRef({static:!1,hold:!1}),T=m.useRef(null),I=m.useRef(null),F=m.useRef(null),j=m.useRef(null),B=xt(typeof a=="string"?(Q,ie)=>{let we=a;return(Q==null?void 0:Q[we])===(ie==null?void 0:ie[we])}:a??((Q,ie)=>Q===ie)),V=xt(Q=>C.options.findIndex(ie=>B(ie.dataRef.current.value,Q))),q=m.useCallback(Q=>Fn($.mode,{1:()=>w.some(ie=>B(ie,Q)),0:()=>B(w,Q)}),[w]),J=xt(Q=>C.activeOptionIndex===V(Q)),$=m.useMemo(()=>({...C,immediate:b,optionsPropsRef:k,labelRef:T,inputRef:I,buttonRef:F,optionsRef:j,value:w,defaultValue:r,disabled:l,mode:f?1:0,virtual:C.virtual,get activeOptionIndex(){if(O.current&&C.activeOptionIndex===null&&C.options.length>0){let Q=C.options.findIndex(ie=>!ie.dataRef.current.disabled);if(Q!==-1)return Q}return C.activeOptionIndex},calculateIndex:V,compare:B,isSelected:q,isActive:J,nullable:d,__demoMode:c}),[w,r,l,f,d,c,C,x]);Sn(()=>{},[x,void 0]),Sn(()=>{C.dataRef.current=$},[$]),o6([$.buttonRef,$.inputRef,$.optionsRef],()=>xe.closeCombobox(),$.comboboxState===0);let X=m.useMemo(()=>{var Q,ie,we;return{open:$.comboboxState===0,disabled:l,activeIndex:$.activeOptionIndex,activeOption:$.activeOptionIndex===null?null:$.virtual?$.virtual.options[(Q=$.activeOptionIndex)!=null?Q:0]:(we=(ie=$.options[$.activeOptionIndex])==null?void 0:ie.dataRef.current.value)!=null?we:null,value:w}},[$,l,w]),W=xt(()=>{if($.activeOptionIndex!==null){if($.virtual)R($.virtual.options[$.activeOptionIndex]);else{let{dataRef:Q}=$.options[$.activeOptionIndex];R(Q.current.value)}xe.goToOption(Cn.Specific,$.activeOptionIndex)}}),te=xt(()=>{P({type:0}),O.current=!0}),le=xt(()=>{P({type:1}),O.current=!1}),A=xt((Q,ie,we)=>(O.current=!1,Q===Cn.Specific?P({type:2,focus:Cn.Specific,idx:ie,trigger:we}):P({type:2,focus:Q,trigger:we}))),H=xt((Q,ie)=>(P({type:3,payload:{id:Q,dataRef:ie}}),()=>{$.isActive(ie.current.value)&&(O.current=!0),P({type:4,id:Q})})),ne=xt(Q=>(P({type:5,id:Q}),()=>P({type:5,id:null}))),R=xt(Q=>Fn($.mode,{0(){return S==null?void 0:S(Q)},1(){let ie=$.value.slice(),we=ie.findIndex(re=>B(re,Q));return we===-1?ie.push(Q):ie.splice(we,1),S==null?void 0:S(ie)}})),ue=xt(Q=>{P({type:6,trigger:Q})}),xe=m.useMemo(()=>({onChange:R,registerOption:H,registerLabel:ne,goToOption:A,closeCombobox:le,openCombobox:te,setActivationTrigger:ue,selectActiveOption:W}),[]),ge=t===null?{}:{ref:t},pe=m.useRef(null),ee=Vu();return m.useEffect(()=>{pe.current&&r!==void 0&&ee.addEventListener(pe.current,"reset",()=>{S==null||S(r)})},[pe,S]),m.createElement(L0.Provider,{value:xe},m.createElement(F0.Provider,{value:$},m.createElement(tP,{value:Fn($.comboboxState,{0:Tr.Open,1:Tr.Closed})},s!=null&&w!=null&&rP({[s]:w}).map(([Q,ie],we)=>m.createElement(p6,{features:eP.Hidden,ref:we===0?re=>{var Ie;pe.current=(Ie=re==null?void 0:re.closest("form"))!=null?Ie:null}:void 0,...T0({key:Q,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,name:Q,value:ie})})),Co({ourProps:ge,theirProps:v,slot:X,defaultTag:O6,name:"Combobox"}))))}let k6="input";function D6(e,t){var n,r,i,o,s;let a=Hu(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:d,type:f="text",...g}=e,p=ya("Combobox.Input"),v=Wu("Combobox.Input"),b=va(p.inputRef,t),x=s6(p.inputRef),w=m.useRef(!1),S=Vu(),C=xt(()=>{v.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),v.goToOption(Cn.Nothing)}),P=function(){var $;return typeof d=="function"&&p.value!==void 0?($=d(p.value))!=null?$:"":typeof p.value=="string"?p.value:""}();ZO(([$,X],[W,te])=>{if(w.current)return;let le=p.inputRef.current;le&&((te===0&&X===1||$!==W)&&(le.value=$),requestAnimationFrame(()=>{if(w.current||!le||(x==null?void 0:x.activeElement)!==le)return;let{selectionStart:A,selectionEnd:H}=le;Math.abs((H??0)-(A??0))===0&&A===0&&le.setSelectionRange(le.value.length,le.value.length)}))},[P,p.comboboxState,x]),ZO(([$],[X])=>{if($===0&&X===1){if(w.current)return;let W=p.inputRef.current;if(!W)return;let te=W.value,{selectionStart:le,selectionEnd:A,selectionDirection:H}=W;W.value="",W.value=te,H!==null?W.setSelectionRange(le,A,H):W.setSelectionRange(le,A)}},[p.comboboxState]);let O=m.useRef(!1),k=xt(()=>{O.current=!0}),T=xt(()=>{S.nextFrame(()=>{O.current=!1})}),I=xt($=>{switch(w.current=!0,$.key){case Ar.Enter:if(w.current=!1,p.comboboxState!==0||O.current)return;if($.preventDefault(),$.stopPropagation(),p.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),p.mode===0&&v.closeCombobox();break;case Ar.ArrowDown:return w.current=!1,$.preventDefault(),$.stopPropagation(),Fn(p.comboboxState,{0:()=>v.goToOption(Cn.Next),1:()=>v.openCombobox()});case Ar.ArrowUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),Fn(p.comboboxState,{0:()=>v.goToOption(Cn.Previous),1:()=>{v.openCombobox(),S.nextFrame(()=>{p.value||v.goToOption(Cn.Last)})}});case Ar.Home:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(Cn.First);case Ar.PageUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(Cn.First);case Ar.End:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(Cn.Last);case Ar.PageDown:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(Cn.Last);case Ar.Escape:return w.current=!1,p.comboboxState!==0?void 0:($.preventDefault(),p.optionsRef.current&&!p.optionsPropsRef.current.static&&$.stopPropagation(),p.nullable&&p.mode===0&&p.value===null&&C(),v.closeCombobox());case Ar.Tab:if(w.current=!1,p.comboboxState!==0)return;p.mode===0&&p.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),F=xt($=>{c==null||c($),p.nullable&&p.mode===0&&$.target.value===""&&C(),v.openCombobox()}),j=xt($=>{var X,W,te;let le=(X=$.relatedTarget)!=null?X:ba.find(A=>A!==$.currentTarget);if(w.current=!1,!((W=p.optionsRef.current)!=null&&W.contains(le))&&!((te=p.buttonRef.current)!=null&&te.contains(le))&&p.comboboxState===0)return $.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?C():p.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),B=xt($=>{var X,W,te;let le=(X=$.relatedTarget)!=null?X:ba.find(A=>A!==$.currentTarget);(W=p.buttonRef.current)!=null&&W.contains(le)||(te=p.optionsRef.current)!=null&&te.contains(le)||p.disabled||p.immediate&&p.comboboxState!==0&&(v.openCombobox(),S.nextFrame(()=>{v.setActivationTrigger(1)}))}),V=k0(()=>{if(p.labelId)return[p.labelId].join(" ")},[p.labelId]),q=m.useMemo(()=>({open:p.comboboxState===0,disabled:p.disabled}),[p]),J={ref:b,id:l,role:"combobox",type:f,"aria-controls":(n=p.optionsRef.current)==null?void 0:n.id,"aria-expanded":p.comboboxState===0,"aria-activedescendant":p.activeOptionIndex===null?void 0:p.virtual?(r=p.options.find($=>{var X;return!((X=p.virtual)!=null&&X.disabled($.dataRef.current.value))&&p.compare($.dataRef.current.value,p.virtual.options[p.activeOptionIndex])}))==null?void 0:r.id:(i=p.options[p.activeOptionIndex])==null?void 0:i.id,"aria-labelledby":V,"aria-autocomplete":"list",defaultValue:(s=(o=e.defaultValue)!=null?o:p.defaultValue!==void 0?d==null?void 0:d(p.defaultValue):null)!=null?s:p.defaultValue,disabled:p.disabled,onCompositionStart:k,onCompositionEnd:T,onKeyDown:I,onChange:F,onFocus:B,onBlur:j};return Co({ourProps:J,theirProps:g,slot:q,defaultTag:k6,name:"Combobox.Input"})}let M6="button";function T6(e,t){var n;let r=ya("Combobox.Button"),i=Wu("Combobox.Button"),o=va(r.buttonRef,t),s=Hu(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=Vu(),d=xt(b=>{switch(b.key){case Ar.ArrowDown:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&i.openCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Ar.ArrowUp:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&(i.openCombobox(),c.nextFrame(()=>{r.value||i.goToOption(Cn.Last)})),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Ar.Escape:return r.comboboxState!==0?void 0:(b.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&b.stopPropagation(),i.closeCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})}));default:return}}),f=xt(b=>{if(m6(b.currentTarget))return b.preventDefault();r.comboboxState===0?i.closeCombobox():(b.preventDefault(),i.openCombobox()),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),g=k0(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),p=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:o,id:a,type:a6(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":g,disabled:r.disabled,onClick:f,onKeyDown:d};return Co({ourProps:v,theirProps:l,slot:p,defaultTag:M6,name:"Combobox.Button"})}let A6="label";function I6(e,t){let n=Hu(),{id:r=`headlessui-combobox-label-${n}`,...i}=e,o=ya("Combobox.Label"),s=Wu("Combobox.Label"),a=va(o.labelRef,t);Sn(()=>s.registerLabel(r),[r]);let l=xt(()=>{var d;return(d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]);return Co({ourProps:{ref:a,id:r,onClick:l},theirProps:i,slot:c,defaultTag:A6,name:"Combobox.Label"})}let N6="ul",R6=cp.RenderStrategy|cp.Static;function L6(e,t){let n=Hu(),{id:r=`headlessui-combobox-options-${n}`,hold:i=!1,...o}=e,s=ya("Combobox.Options"),a=va(s.optionsRef,t),l=N0(),c=l!==null?(l&Tr.Open)===Tr.Open:s.comboboxState===0;Sn(()=>{var p;s.optionsPropsRef.current.static=(p=e.static)!=null?p:!1},[s.optionsPropsRef,e.static]),Sn(()=>{s.optionsPropsRef.current.hold=i},[s.optionsPropsRef,i]),u6({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(p){return p.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:p.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(p){p.setAttribute("role","none")}});let d=k0(()=>{var p,v;return(v=s.labelId)!=null?v:(p=s.buttonRef.current)==null?void 0:p.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),g={"aria-labelledby":d,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(o,{children:m.createElement(C6,null,o.children)}),Co({ourProps:g,theirProps:o,slot:f,defaultTag:N6,features:R6,visible:c,name:"Combobox.Options"})}let F6="li";function $6(e,t){var n;let r=Hu(),{id:i=`headlessui-combobox-option-${r}`,disabled:o=!1,value:s,order:a=null,...l}=e,c=ya("Combobox.Option"),d=Wu("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===i,g=c.isSelected(s),p=m.useRef(null),v=Vi({disabled:o,value:s,domRef:p,order:a}),b=m.useContext(sP),x=va(t,p,b?b.measureElement:null),w=xt(()=>d.onChange(s));Sn(()=>d.registerOption(i,v),[v,i]);let S=m.useRef(!(c.virtual||c.__demoMode));Sn(()=>{if(!c.virtual||!c.__demoMode)return;let j=ma();return j.requestAnimationFrame(()=>{S.current=!0}),j.dispose},[c.virtual,c.__demoMode]),Sn(()=>{if(!S.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let j=ma();return j.requestAnimationFrame(()=>{var B,V;(V=(B=p.current)==null?void 0:B.scrollIntoView)==null||V.call(B,{block:"nearest"})}),j.dispose},[p,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let C=xt(j=>{var B;if(o||(B=c.virtual)!=null&&B.disabled(s))return j.preventDefault();w(),KO()||requestAnimationFrame(()=>{var V;return(V=c.inputRef.current)==null?void 0:V.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),P=xt(()=>{var j;if(o||(j=c.virtual)!=null&&j.disabled(s))return d.goToOption(Cn.Nothing);let B=c.calculateIndex(s);d.goToOption(Cn.Specific,B)}),O=c6(),k=xt(j=>O.update(j)),T=xt(j=>{var B;if(!O.wasMoved(j)||o||(B=c.virtual)!=null&&B.disabled(s)||f)return;let V=c.calculateIndex(s);d.goToOption(Cn.Specific,V,0)}),I=xt(j=>{var B;O.wasMoved(j)&&(o||(B=c.virtual)!=null&&B.disabled(s)||f&&(c.optionsPropsRef.current.hold||d.goToOption(Cn.Nothing)))}),F=m.useMemo(()=>({active:f,selected:g,disabled:o}),[f,g,o]);return Co({ourProps:{id:i,ref:x,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":g,disabled:void 0,onClick:C,onFocus:P,onPointerEnter:k,onMouseEnter:k,onPointerMove:T,onMouseMove:T,onPointerLeave:I,onMouseLeave:I},theirProps:l,slot:F,defaultTag:F6,name:"Combobox.Option"})}let j6=Hi(P6),z6=Hi(T6),B6=Hi(D6),V6=Hi(I6),H6=Hi(L6),W6=Hi($6),jl=Object.assign(j6,{Input:B6,Button:z6,Label:V6,Options:H6,Option:W6});function $0(){let e=m.useRef(!1);return Sn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function U6(e=0){let[t,n]=m.useState(e),r=$0(),i=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),o=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:i,hasFlag:o,removeFlag:s,toggleFlag:a}}function q6(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function j0(e,...t){e&&t.length>0&&e.classList.add(...t)}function z0(e,...t){e&&t.length>0&&e.classList.remove(...t)}function G6(e,t){let n=ma();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,s]=[r,i].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,f)=>f-d);return c}),a=o+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",d=>{d.target===d.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 Y6(e,t,n,r){let i=n?"enter":"leave",o=ma(),s=r!==void 0?q6(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Fn(i,{enter:()=>t.enter,leave:()=>t.leave}),l=Fn(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Fn(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return z0(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),j0(e,...t.base,...a,...c),o.nextFrame(()=>{z0(e,...t.base,...a,...c),j0(e,...t.base,...a,...l),G6(e,()=>(z0(e,...t.base,...a),j0(e,...t.base,...t.entered),s()))}),o.dispose}function K6({immediate:e,container:t,direction:n,classes:r,onStart:i,onStop:o}){let s=$0(),a=Vu(),l=Vi(n);Sn(()=>{e&&(l.current="enter")},[e]),Sn(()=>{let c=ma();a.add(c.dispose);let d=t.current;if(d&&l.current!=="idle"&&s.current)return c.dispose(),i.current(l.current),c.add(Y6(d,r.current,l.current==="enter",()=>{c.dispose(),o.current(l.current)})),c.dispose},[n])}function us(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let dp=m.createContext(null);dp.displayName="TransitionContext";var X6=(e=>(e.Visible="visible",e.Hidden="hidden",e))(X6||{});function Q6(){let e=m.useContext(dp);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Z6(){let e=m.useContext(fp);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let fp=m.createContext(null);fp.displayName="NestingContext";function hp(e){return"children"in e?hp(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function aP(e,t){let n=Vi(e),r=m.useRef([]),i=$0(),o=Vu(),s=xt((p,v=cs.Hidden)=>{let b=r.current.findIndex(({el:x})=>x===p);b!==-1&&(Fn(v,{[cs.Unmount](){r.current.splice(b,1)},[cs.Hidden](){r.current[b].state="hidden"}}),o.microTask(()=>{var x;!hp(r)&&i.current&&((x=n.current)==null||x.call(n))}))}),a=xt(p=>{let v=r.current.find(({el:b})=>b===p);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,cs.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[],idle:[]}),f=xt((p,v,b)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([x])=>x!==p)),t==null||t.chains.current[v].push([p,new Promise(x=>{l.current.push(x)})]),t==null||t.chains.current[v].push([p,new Promise(x=>{Promise.all(d.current[v].map(([w,S])=>S)).then(()=>x())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(v)):b(v)}),g=xt((p,v,b)=>{Promise.all(d.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:g,wait:c,chains:d}),[a,s,r,f,g,d,c])}function J6(){}let eW=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function lP(e){var t;let n={};for(let r of eW)n[r]=(t=e[r])!=null?t:J6;return n}function tW(e){let t=m.useRef(lP(e));return m.useEffect(()=>{t.current=lP(e)},[e]),t}let nW="div",cP=cp.RenderStrategy;function rW(e,t){var n,r;let{beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:d,entered:f,leave:g,leaveFrom:p,leaveTo:v,...b}=e,x=m.useRef(null),w=va(x,t),S=(n=b.unmount)==null||n?cs.Unmount:cs.Hidden,{show:C,appear:P,initial:O}=Q6(),[k,T]=m.useState(C?"visible":"hidden"),I=Z6(),{register:F,unregister:j}=I;m.useEffect(()=>F(x),[F,x]),m.useEffect(()=>{if(S===cs.Hidden&&x.current){if(C&&k!=="visible"){T("visible");return}return Fn(k,{hidden:()=>j(x),visible:()=>F(x)})}},[k,x,F,j,C,S]);let B=Vi({base:us(b.className),enter:us(l),enterFrom:us(c),enterTo:us(d),entered:us(f),leave:us(g),leaveFrom:us(p),leaveTo:us(v)}),V=tW({beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a}),q=D0();m.useEffect(()=>{if(q&&k==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,k,q]);let J=O&&!P,$=P&&C&&O,X=!q||J?"idle":C?"enter":"leave",W=U6(0),te=xt(ue=>Fn(ue,{enter:()=>{W.addFlag(Tr.Opening),V.current.beforeEnter()},leave:()=>{W.addFlag(Tr.Closing),V.current.beforeLeave()},idle:()=>{}})),le=xt(ue=>Fn(ue,{enter:()=>{W.removeFlag(Tr.Opening),V.current.afterEnter()},leave:()=>{W.removeFlag(Tr.Closing),V.current.afterLeave()},idle:()=>{}})),A=aP(()=>{T("hidden"),j(x)},I),H=m.useRef(!1);K6({immediate:$,container:x,classes:B,direction:X,onStart:Vi(ue=>{H.current=!0,A.onStart(x,ue,te)}),onStop:Vi(ue=>{H.current=!1,A.onStop(x,ue,le),ue==="leave"&&!hp(A)&&(T("hidden"),j(x))})});let ne=b,R={ref:w};return $?ne={...ne,className:lp(b.className,...B.current.enter,...B.current.enterFrom)}:H.current&&(ne.className=lp(b.className,(r=x.current)==null?void 0:r.className),ne.className===""&&delete ne.className),m.createElement(fp.Provider,{value:A},m.createElement(tP,{value:Fn(k,{visible:Tr.Open,hidden:Tr.Closed})|W.flags},Co({ourProps:R,theirProps:ne,defaultTag:nW,features:cP,visible:k==="visible",name:"Transition.Child"})))}function iW(e,t){let{show:n,appear:r=!1,unmount:i=!0,...o}=e,s=m.useRef(null),a=va(s,t);D0();let l=N0();if(n===void 0&&l!==null&&(n=(l&Tr.Open)===Tr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=m.useState(n?"visible":"hidden"),f=aP(()=>{d("hidden")}),[g,p]=m.useState(!0),v=m.useRef([n]);Sn(()=>{g!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))},[v,n]);let b=m.useMemo(()=>({show:n,appear:r,initial:g}),[n,r,g]);m.useEffect(()=>{if(n)d("visible");else if(!hp(f))d("hidden");else{let C=s.current;if(!C)return;let P=C.getBoundingClientRect();P.x===0&&P.y===0&&P.width===0&&P.height===0&&d("hidden")}},[n,f]);let x={unmount:i},w=xt(()=>{var C;g&&p(!1),(C=e.beforeEnter)==null||C.call(e)}),S=xt(()=>{var C;g&&p(!1),(C=e.beforeLeave)==null||C.call(e)});return m.createElement(fp.Provider,{value:f},m.createElement(dp.Provider,{value:b},Co({ourProps:{...x,as:m.Fragment,children:m.createElement(uP,{ref:a,...x,...o,beforeEnter:w,beforeLeave:S})},theirProps:{},defaultTag:m.Fragment,features:cP,visible:c==="visible",name:"Transition"})))}function oW(e,t){let n=m.useContext(dp)!==null,r=N0()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(B0,{ref:t,...e}):m.createElement(uP,{ref:t,...e}))}let B0=Hi(iW),uP=Hi(rW),sW=Hi(oW),aW=Object.assign(B0,{Child:sW,Root:B0});const Uu=["text","varchar","nvarchar","nvarchar2","char","character","nchar","char varying","nchar varying","character varying","string"],ds=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],xa=["date","datetime","time","timestamp","timestamp without time zone"],pp=["boolean"];function _i(e){return e.match(/[A-Z]/)?`"${e}"`:e}function V0(e,t,n){const{measures:r,dimensions:i}=e,o=r==null?void 0:r.map(c=>`${c.calc}(${c.name}) as ${c.calc}_${c.name}`).join(", "),s=(i==null?void 0:i.join(", "))||"";let a="";const l=mp(t,n);if(o&&s)return a=`SELECT ${s}, COUNT(*), ${o} FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(!o&&s)return a=`SELECT ${s}, COUNT(*) FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(o&&!s)return a=`SELECT ${o} FROM ${l}`,a}function H0(e,t,n="AVG"){var o,s,a,l;let r={};const i=_i(e.column_name);return Uu.includes(e.data_type)&&(((o=t.dimensions)==null?void 0:o.includes(i))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(d=>d!==i)}:r={...t,dimensions:[...t.dimensions||[],i]}),ds.includes(e.data_type)&&(((a=t.measures)==null?void 0:a.some(d=>d.name===i&&d.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(d=>!(d.name===i&&d.calc===n))}:r={...t,measures:[...t.measures||[],{name:i,calc:n||"SUM"}]}),r}function gp(e){return Uu.includes(e.dataType)?"string":ds.includes(e.dataType)?"number":xa.includes(e.dataType)?"date":pp.includes(e.dataType)?"boolean":"string"}function lW(e){let t;const n=e.data_type.toLowerCase();return Uu.includes(n)?t="T":ds.includes(n)?t="#":xa.includes(n)?t="D":pp.includes(n)?t="B":t="?",t}function dP(e,t){const{dimensions:n,measures:r}=t,i=n==null?void 0:n.includes(e.column_name),o=r==null?void 0:r.some(s=>s.name===e.column_name);return i||o}function mp(e,t){return e==="public"?t:e?`${e}.${t}`:`${t}`}function cW(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[i,o]=e.split(r);return{operation:r,value:o.trim()}}else return null}const fP=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,hP=of,pP=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return hP(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const d=n==null?void 0:n[c],f=o==null?void 0:o[c];if(d===null)return null;const g=fP(d)||fP(f);return i[c][g]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,g]=d;return g===void 0||(c[f]=g),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:g,...p}=d;return Object.entries(p).every(v=>{let[b,x]=v;return Array.isArray(x)?x.includes({...o,...a}[b]):{...o,...a}[b]===x})?[...c,f,g]:c},[]);return hP(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},W0=pP("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"}}),it=de.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?oo:"button";return _.jsx(s,{className:De(W0({variant:t,size:n,className:e})),ref:o,...i})});it.displayName="Button";function uW({filter:e}){const[t,n]=m.useState([]),[r,i]=m.useState(""),[o,s]=m.useState(""),a=m.useRef(null),l=fe(k=>k.authToken),c=fe(k=>k.filterValues),d=fe(k=>k.actions.addOrUpdateFilterValue),f=fe(k=>k.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:b,refetch:x}=Xr({queryKey:[e.sql],queryFn:()=>ll("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database}),w=m.useMemo(()=>{var k;return(k=g==null?void 0:g.records)==null?void 0:k.map(T=>({id:T[e.column.split(".").slice(-1)[0].toLowerCase()],value:T[e.column.split(".").slice(-1)[0].toLowerCase()]}))},[g,e.column]);m.useEffect(()=>{if(c){const k=c.find(T=>T.filterId===e.id);if(!k){n([]);return}if(k.operation==="in"){const T=w==null?void 0:w.filter(I=>k.values.includes(I.value));T&&n(T)}else i(`${k.operation} ${k.values[0]}`)}},[g]),m.useEffect(()=>{if(c&&!c.find(T=>T.filterId===e.id)){n([]);return}},[c,e.id]);function S(k){const T=cW(k[0].toString());if(!(T!=null&&T.value)||!(T!=null&&T.operation))return;const I={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:gp(e),name:e.column,operation:T.operation,values:[T.value]};d(I)}function C(k){if(console.log("onComboBoxChange",k),k.length===1&&w.find(I=>I.value===k[0].value)===void 0){S(k);return}if(n(k),k.length===0){f(e.id);return}const T={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:gp(e),operation:"in",values:k.map(I=>I.value)};d(T)}function P(){var k;i(""),f(e.id),console.log(e.id),(k=a.current)==null||k.click()}if(p)return _.jsx("div",{children:_.jsx(Sf,{className:" bg-foreground/10 h-8 w-[180px]"})});if(b)return _.jsx("div",{className:"bg-muted h-8 w-[180px] px-2",children:"Error"});if(!g)return null;let O=[];return ds.includes(e.dataType)?O=w:O=o===""?w:w.filter(k=>k.value.toLowerCase().replace(/\s+/g,"").includes(o.toLowerCase().replace(/\s+/g,""))),_.jsx(jl,{value:t,onChange:C,multiple:!0,children:_.jsxs("div",{className:"relative",children:[_.jsxs("div",{className:" border relative w-full cursor-default overflow-hidden rounded-sm 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:[_.jsx(jl.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:k=>k.map(I=>I.value).join(", ")||r,onChange:k=>{i(k.target.value),s(k.target.value)}}),_.jsx(jl.Button,{ref:a,className:"absolute bg-background pl-1 inset-y-0 right-0 flex items-center pr-2",children:_.jsx(uz,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),_.jsx(aW,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:_.jsxs(jl.Options,{className:" z-10 absolute mt-1 max-h-60 w-full overflow-auto rounded-sm bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm border",children:[ds.includes(e.dataType)&&_.jsxs(jl.Option,{value:r,className:" flex items-center px-3 justify-between gap-2 py-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:" font-thin",children:"#"}),_.jsx("span",{children:r})]}),r&&_.jsx(it,{variant:"link",className:" h-4 w-3 text-foreground/50 hover:text-foreground/100 cursor-pointer",onClick:k=>{k.stopPropagation(),P()},children:"Clear"})]}),O.length===0&&o!==""?_.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):O.map(k=>_.jsx(jl.Option,{className:({active:T})=>`relative cursor-default select-none py-2 pl-10 pr-4 ${T?"bg-muted ":"text-foreground-900"}`,value:k,children:({selected:T,active:I})=>(T&&console.log("record",k,T),_.jsxs(_.Fragment,{children:[_.jsx("span",{className:`block truncate ${T?"font-medium":"font-normal"}`,children:typeof k.value=="boolean"?k.value?"True":"False":k.value}),T?_.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:_.jsx(b2,{className:"h-5 w-5","aria-hidden":"true"})}):null]}))},k.value))]})})]})})}const gP=m.forwardRef((e,t)=>m.createElement(He.label,se({},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()}}))),dW=pP("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ni=de.forwardRef(({className:e,...t},n)=>_.jsx(gP,{ref:n,className:De(dW(),e),...t}));ni.displayName=gP.displayName;function Ot(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 Ir(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Jn(e,t){const n=Ot(e);return isNaN(t)?Ir(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Si(e,t){const n=Ot(e);if(isNaN(t))return Ir(e,NaN);if(!t)return n;const r=n.getDate(),i=Ir(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}const U0=6048e5,fW=864e5;let hW={};function qu(){return hW}function Wi(e,t){var a,l,c,d;const n=qu(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,i=Ot(e),o=i.getDay(),s=(o<r?7:0)+o-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function wa(e){return Wi(e,{weekStartsOn:1})}function mP(e){const t=Ot(e),n=t.getFullYear(),r=Ir(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=wa(r),o=Ir(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=wa(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function zl(e){const t=Ot(e);return t.setHours(0,0,0,0),t}function vp(e){const t=Ot(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 Ui(e,t){const n=zl(e),r=zl(t),i=+n-vp(n),o=+r-vp(r);return Math.round((i-o)/fW)}function pW(e){const t=mP(e),n=Ir(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),wa(n)}function q0(e,t){const n=t*7;return Jn(e,n)}function gW(e,t){return Si(e,t*12)}function mW(e){let t;return e.forEach(function(n){const r=Ot(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function vW(e){let t;return e.forEach(n=>{const r=Ot(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function dr(e,t){const n=zl(e),r=zl(t);return+n==+r}function G0(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function bW(e){if(!G0(e)&&typeof e!="number")return!1;const t=Ot(e);return!isNaN(Number(t))}function Gu(e,t){const n=Ot(e),r=Ot(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function yW(e,t,n){const r=Wi(e,n),i=Wi(t,n),o=+r-vp(r),s=+i-vp(i);return Math.round((o-s)/U0)}function Y0(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function fr(e){const t=Ot(e);return t.setDate(1),t.setHours(0,0,0,0),t}function vP(e){const t=Ot(e),n=Ir(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function K0(e,t){var a,l,c,d;const n=qu(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,i=Ot(e),o=i.getDay(),s=(o<r?-7:0)+6-(o-r);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function bP(e){return K0(e,{weekStartsOn:1})}const xW={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"}},wW=(e,t,n)=>{let r;const i=xW[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function X0(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const _W={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},SW={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},CW={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},EW={date:X0({formats:_W,defaultWidth:"full"}),time:X0({formats:SW,defaultWidth:"full"}),dateTime:X0({formats:CW,defaultWidth:"full"})},OW={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},PW=(e,t,n,r)=>OW[e];function Yu(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[s]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const kW={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},DW={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},MW={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"]},TW={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"]},AW={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"}},IW={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"}},NW={ordinalNumber:(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"},era:Yu({values:kW,defaultWidth:"wide"}),quarter:Yu({values:DW,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yu({values:MW,defaultWidth:"wide"}),day:Yu({values:TW,defaultWidth:"wide"}),dayPeriod:Yu({values:AW,defaultWidth:"wide",formattingValues:IW,defaultFormattingWidth:"wide"})};function Ku(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?LW(a,f=>f.test(s)):RW(a,f=>f.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(s.length);return{value:c,rest:d}}}function RW(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function LW(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function FW(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(i.length);return{value:s,rest:a}}}const $W=/^(\d+)(th|st|nd|rd)?/i,jW=/\d+/i,zW={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},BW={any:[/^b/i,/^(a|c)/i]},VW={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},HW={any:[/1/i,/2/i,/3/i,/4/i]},WW={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},UW={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]},qW={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},GW={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]},YW={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},KW={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}},XW={ordinalNumber:FW({matchPattern:$W,parsePattern:jW,valueCallback:e=>parseInt(e,10)}),era:Ku({matchPatterns:zW,defaultMatchWidth:"wide",parsePatterns:BW,defaultParseWidth:"any"}),quarter:Ku({matchPatterns:VW,defaultMatchWidth:"wide",parsePatterns:HW,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ku({matchPatterns:WW,defaultMatchWidth:"wide",parsePatterns:UW,defaultParseWidth:"any"}),day:Ku({matchPatterns:qW,defaultMatchWidth:"wide",parsePatterns:GW,defaultParseWidth:"any"}),dayPeriod:Ku({matchPatterns:YW,defaultMatchWidth:"any",parsePatterns:KW,defaultParseWidth:"any"})},yP={code:"en-US",formatDistance:wW,formatLong:EW,formatRelative:PW,localize:NW,match:XW,options:{weekStartsOn:0,firstWeekContainsDate:1}};function QW(e){const t=Ot(e);return Ui(t,vP(t))+1}function xP(e){const t=Ot(e),n=+wa(t)-+pW(t);return Math.round(n/U0)+1}function wP(e,t){var d,f,g,p;const n=Ot(e),r=n.getFullYear(),i=qu(),o=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.firstWeekContainsDate)??1,s=Ir(e,0);s.setFullYear(r+1,0,o),s.setHours(0,0,0,0);const a=Wi(s,t),l=Ir(e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=Wi(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function ZW(e,t){var a,l,c,d;const n=qu(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,i=wP(e,t),o=Ir(e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Wi(o,t)}function _P(e,t){const n=Ot(e),r=+Wi(n,t)-+ZW(n,t);return Math.round(r/U0)+1}function Ft(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const fs={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ft(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ft(n+1,2)},d(e,t){return Ft(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 Ft(e.getHours()%12||12,t.length)},H(e,t){return Ft(e.getHours(),t.length)},m(e,t){return Ft(e.getMinutes(),t.length)},s(e,t){return Ft(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ft(i,t.length)}},Bl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},SP={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(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return fs.y(e,t)},Y:function(e,t,n,r){const i=wP(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return Ft(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Ft(o,t.length)},R:function(e,t){const n=mP(e);return Ft(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ft(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 Ft(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 Ft(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 fs.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 Ft(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 i=_P(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ft(i,t.length)},I:function(e,t,n){const r=xP(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ft(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):fs.d(e,t)},D:function(e,t,n){const r=QW(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ft(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 i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Ft(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Ft(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Ft(i,t.length);case"io":return n.ordinalNumber(i,{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 i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Bl.noon:r===0?i=Bl.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Bl.evening:r>=12?i=Bl.afternoon:r>=4?i=Bl.morning:i=Bl.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{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 fs.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):fs.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ft(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ft(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):fs.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):fs.s(e,t)},S:function(e,t){return fs.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return EP(r);case"XXXX":case"XX":return _a(r);case"XXXXX":case"XXX":default:return _a(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return EP(r);case"xxxx":case"xx":return _a(r);case"xxxxx":case"xxx":default:return _a(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+CP(r,":");case"OOOO":default:return"GMT"+_a(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+CP(r,":");case"zzzz":default:return"GMT"+_a(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Ft(r,t.length)},T:function(e,t,n){const r=e.getTime();return Ft(r,t.length)}};function CP(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Ft(o,2)}function EP(e,t){return e%60===0?(e>0?"-":"+")+Ft(Math.abs(e)/60,2):_a(e,t)}function _a(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Ft(Math.trunc(r/60),2),o=Ft(r%60,2);return n+i+t+o}const OP=(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"})}},PP=(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"})}},JW={p:PP,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return OP(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",OP(r,t)).replace("{{time}}",PP(i,t))}},eU=/^D+$/,tU=/^Y+$/,nU=["D","DD","YY","YYYY"];function rU(e){return eU.test(e)}function iU(e){return tU.test(e)}function oU(e,t,n){const r=sU(e,t,n);if(console.warn(r),nU.includes(e))throw new RangeError(r)}function sU(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 aU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cU=/^'([^]*?)'?$/,uU=/''/g,dU=/[a-zA-Z]/;function qi(e,t,n){var d,f,g,p,v,b,x,w;const r=qu(),i=(n==null?void 0:n.locale)??r.locale??yP,o=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(g=r.locale)==null?void 0:g.options)==null?void 0:p.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=Ot(e);if(!bW(a))throw new RangeError("Invalid time value");let l=t.match(lU).map(S=>{const C=S[0];if(C==="p"||C==="P"){const P=JW[C];return P(S,i.formatLong)}return S}).join("").match(aU).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:fU(S)};if(SP[C])return{isToken:!0,value:S};if(C.match(dU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const C=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&iU(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&rU(C))&&oU(C,t,String(e));const P=SP[C[0]];return P(a,C,i.localize,c)}).join("")}function fU(e){const t=e.match(cU);return t?t[1].replace(uU,"'"):e}function hU(e){const t=Ot(e),n=t.getFullYear(),r=t.getMonth(),i=Ir(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function pU(e){return Math.trunc(+Ot(e)/1e3)}function gU(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function mU(e,t){return yW(gU(e),fr(e),t)+1}function Q0(e,t){const n=Ot(e),r=Ot(t);return n.getTime()>r.getTime()}function kP(e,t){const n=Ot(e),r=Ot(t);return+n<+r}function Z0(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function vU(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()}function J0(e,t){return Jn(e,-t)}function ey(e,t){const n=Ot(e),r=n.getFullYear(),i=n.getDate(),o=Ir(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const s=hU(o);return n.setMonth(t,Math.min(i,s)),n}function DP(e,t){const n=Ot(e);return isNaN(+n)?Ir(e,NaN):(n.setFullYear(t),n)}var Xe=function(){return Xe=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Xe.apply(this,arguments)};function bU(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function MP(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ty={exports:{}},Xu={};/**
352
352
  * @license React
353
353
  * react-jsx-runtime.development.js
354
354
  *
@@ -356,11 +356,11 @@ Valid keys: `+JSON.stringify(Object.keys(A),null," "));var te=we(pe,ie,ue,xe,ge
356
356
  *
357
357
  * This source code is licensed under the MIT license found in the
358
358
  * LICENSE file in the root directory of this source tree.
359
- */var TP;function yU(){return TP||(TP=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"),i=Symbol.for("react.strict_mode"),o=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"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function x(D){if(D===null||typeof D!="object")return null;var G=v&&D[v]||D[b];return typeof G=="function"?G:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(D){{for(var G=arguments.length,oe=new Array(G>1?G-1:0),Oe=1;Oe<G;Oe++)oe[Oe-1]=arguments[Oe];C("error",D,oe)}}function C(D,G,oe){{var Oe=w.ReactDebugCurrentFrame,$e=Oe.getStackAddendum();$e!==""&&(G+="%s",oe=oe.concat([$e]));var Be=oe.map(function(Re){return String(Re)});Be.unshift("Warning: "+G),Function.prototype.apply.call(console[D],console,Be)}}var P=!1,O=!1,k=!1,T=!1,I=!1,F;F=Symbol.for("react.module.reference");function j(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===o||I||D===i||D===c||D===d||T||D===p||P||O||k||typeof D=="object"&&D!==null&&(D.$$typeof===g||D.$$typeof===f||D.$$typeof===s||D.$$typeof===a||D.$$typeof===l||D.$$typeof===F||D.getModuleId!==void 0))}function B(D,G,oe){var Oe=D.displayName;if(Oe)return Oe;var $e=G.displayName||G.name||"";return $e!==""?oe+"("+$e+")":oe}function V(D){return D.displayName||"Context"}function q(D){if(D==null)return null;if(typeof D.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if(typeof D=="object")switch(D.$$typeof){case a:var G=D;return V(G)+".Consumer";case s:var oe=D;return V(oe._context)+".Provider";case l:return B(D,D.render,"ForwardRef");case f:var Oe=D.displayName||null;return Oe!==null?Oe:q(D.type)||"Memo";case g:{var $e=D,Be=$e._payload,Re=$e._init;try{return q(Re(Be))}catch{return null}}}return null}var J=Object.assign,$=0,X,W,ne,le,A,H,re;function R(){}R.__reactDisabledLog=!0;function ue(){{if($===0){X=console.log,W=console.info,ne=console.warn,le=console.error,A=console.group,H=console.groupCollapsed,re=console.groupEnd;var D={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}$++}}function xe(){{if($--,$===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:J({},D,{value:X}),info:J({},D,{value:W}),warn:J({},D,{value:ne}),error:J({},D,{value:le}),group:J({},D,{value:A}),groupCollapsed:J({},D,{value:H}),groupEnd:J({},D,{value:re})})}$<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=w.ReactCurrentDispatcher,pe;function ee(D,G,oe){{if(pe===void 0)try{throw Error()}catch($e){var Oe=$e.stack.trim().match(/\n( *(at )?)/);pe=Oe&&Oe[1]||""}return`
360
- `+pe+D}}var Q=!1,ie;{var we=typeof WeakMap=="function"?WeakMap:Map;ie=new we}function te(D,G){if(!D||Q)return"";{var oe=ie.get(D);if(oe!==void 0)return oe}var Oe;Q=!0;var $e=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Be;Be=ge.current,ge.current=null,ue();try{if(G){var Re=function(){throw Error()};if(Object.defineProperty(Re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Re,[])}catch(on){Oe=on}Reflect.construct(D,[],Re)}else{try{Re.call()}catch(on){Oe=on}D.call(Re.prototype)}}else{try{throw Error()}catch(on){Oe=on}D()}}catch(on){if(on&&Oe&&typeof on.stack=="string"){for(var Te=on.stack.split(`
359
+ */var TP;function yU(){return TP||(TP=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"),i=Symbol.for("react.strict_mode"),o=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"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function x(D){if(D===null||typeof D!="object")return null;var G=v&&D[v]||D[b];return typeof G=="function"?G:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(D){{for(var G=arguments.length,oe=new Array(G>1?G-1:0),Oe=1;Oe<G;Oe++)oe[Oe-1]=arguments[Oe];C("error",D,oe)}}function C(D,G,oe){{var Oe=w.ReactDebugCurrentFrame,$e=Oe.getStackAddendum();$e!==""&&(G+="%s",oe=oe.concat([$e]));var Be=oe.map(function(Re){return String(Re)});Be.unshift("Warning: "+G),Function.prototype.apply.call(console[D],console,Be)}}var P=!1,O=!1,k=!1,T=!1,I=!1,F;F=Symbol.for("react.module.reference");function j(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===o||I||D===i||D===c||D===d||T||D===p||P||O||k||typeof D=="object"&&D!==null&&(D.$$typeof===g||D.$$typeof===f||D.$$typeof===s||D.$$typeof===a||D.$$typeof===l||D.$$typeof===F||D.getModuleId!==void 0))}function B(D,G,oe){var Oe=D.displayName;if(Oe)return Oe;var $e=G.displayName||G.name||"";return $e!==""?oe+"("+$e+")":oe}function V(D){return D.displayName||"Context"}function q(D){if(D==null)return null;if(typeof D.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if(typeof D=="object")switch(D.$$typeof){case a:var G=D;return V(G)+".Consumer";case s:var oe=D;return V(oe._context)+".Provider";case l:return B(D,D.render,"ForwardRef");case f:var Oe=D.displayName||null;return Oe!==null?Oe:q(D.type)||"Memo";case g:{var $e=D,Be=$e._payload,Re=$e._init;try{return q(Re(Be))}catch{return null}}}return null}var J=Object.assign,$=0,X,W,te,le,A,H,ne;function R(){}R.__reactDisabledLog=!0;function ue(){{if($===0){X=console.log,W=console.info,te=console.warn,le=console.error,A=console.group,H=console.groupCollapsed,ne=console.groupEnd;var D={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}$++}}function xe(){{if($--,$===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:J({},D,{value:X}),info:J({},D,{value:W}),warn:J({},D,{value:te}),error:J({},D,{value:le}),group:J({},D,{value:A}),groupCollapsed:J({},D,{value:H}),groupEnd:J({},D,{value:ne})})}$<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=w.ReactCurrentDispatcher,pe;function ee(D,G,oe){{if(pe===void 0)try{throw Error()}catch($e){var Oe=$e.stack.trim().match(/\n( *(at )?)/);pe=Oe&&Oe[1]||""}return`
360
+ `+pe+D}}var Q=!1,ie;{var we=typeof WeakMap=="function"?WeakMap:Map;ie=new we}function re(D,G){if(!D||Q)return"";{var oe=ie.get(D);if(oe!==void 0)return oe}var Oe;Q=!0;var $e=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Be;Be=ge.current,ge.current=null,ue();try{if(G){var Re=function(){throw Error()};if(Object.defineProperty(Re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Re,[])}catch(on){Oe=on}Reflect.construct(D,[],Re)}else{try{Re.call()}catch(on){Oe=on}D.call(Re.prototype)}}else{try{throw Error()}catch(on){Oe=on}D()}}catch(on){if(on&&Oe&&typeof on.stack=="string"){for(var Te=on.stack.split(`
361
361
  `),Pt=Oe.stack.split(`
362
362
  `),et=Te.length-1,ot=Pt.length-1;et>=1&&ot>=0&&Te[et]!==Pt[ot];)ot--;for(;et>=1&&ot>=0;et--,ot--)if(Te[et]!==Pt[ot]){if(et!==1||ot!==1)do if(et--,ot--,ot<0||Te[et]!==Pt[ot]){var Vt=`
363
- `+Te[et].replace(" at new "," at ");return D.displayName&&Vt.includes("<anonymous>")&&(Vt=Vt.replace("<anonymous>",D.displayName)),typeof D=="function"&&ie.set(D,Vt),Vt}while(et>=1&&ot>=0);break}}}finally{Q=!1,ge.current=Be,xe(),Error.prepareStackTrace=$e}var Tn=D?D.displayName||D.name:"",Xa=Tn?ee(Tn):"";return typeof D=="function"&&ie.set(D,Xa),Xa}function Ie(D,G,oe){return te(D,!1)}function ae(D){var G=D.prototype;return!!(G&&G.isReactComponent)}function Se(D,G,oe){if(D==null)return"";if(typeof D=="function")return te(D,ae(D));if(typeof D=="string")return ee(D);switch(D){case c:return ee("Suspense");case d:return ee("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case l:return Ie(D.render);case f:return Se(D.type,G,oe);case g:{var Oe=D,$e=Oe._payload,Be=Oe._init;try{return Se(Be($e),G,oe)}catch{}}}return""}var We=Object.prototype.hasOwnProperty,dt={},qe=w.ReactDebugCurrentFrame;function gt(D){if(D){var G=D._owner,oe=Se(D.type,D._source,G?G.type:null);qe.setExtraStackFrame(oe)}else qe.setExtraStackFrame(null)}function Gt(D,G,oe,Oe,$e){{var Be=Function.call.bind(We);for(var Re in D)if(Be(D,Re)){var Te=void 0;try{if(typeof D[Re]!="function"){var Pt=Error((Oe||"React class")+": "+oe+" type `"+Re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[Re]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pt.name="Invariant Violation",Pt}Te=D[Re](G,Re,Oe,oe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(et){Te=et}Te&&!(Te instanceof Error)&&(gt($e),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Oe||"React class",oe,Re,typeof Te),gt(null)),Te instanceof Error&&!(Te.message in dt)&&(dt[Te.message]=!0,gt($e),S("Failed %s type: %s",oe,Te.message),gt(null))}}}var Bt=Array.isArray;function gn(D){return Bt(D)}function Rt(D){{var G=typeof Symbol=="function"&&Symbol.toStringTag,oe=G&&D[Symbol.toStringTag]||D.constructor.name||"Object";return oe}}function mr(D){try{return he(D),!1}catch{return!0}}function he(D){return""+D}function Ee(D){if(mr(D))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Rt(D)),he(D)}var Ne=w.ReactCurrentOwner,Ue={key:!0,ref:!0,__self:!0,__source:!0},at,ln,cn;cn={};function $n(D){if(We.call(D,"ref")){var G=Object.getOwnPropertyDescriptor(D,"ref").get;if(G&&G.isReactWarning)return!1}return D.ref!==void 0}function Br(D){if(We.call(D,"key")){var G=Object.getOwnPropertyDescriptor(D,"key").get;if(G&&G.isReactWarning)return!1}return D.key!==void 0}function Vr(D,G){if(typeof D.ref=="string"&&Ne.current&&G&&Ne.current.stateNode!==G){var oe=q(Ne.current.type);cn[oe]||(S('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(Ne.current.type),D.ref),cn[oe]=!0)}}function mn(D,G){{var oe=function(){at||(at=!0,S("%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)",G))};oe.isReactWarning=!0,Object.defineProperty(D,"key",{get:oe,configurable:!0})}}function vr(D,G){{var oe=function(){ln||(ln=!0,S("%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)",G))};oe.isReactWarning=!0,Object.defineProperty(D,"ref",{get:oe,configurable:!0})}}var jn=function(D,G,oe,Oe,$e,Be,Re){var Te={$$typeof:t,type:D,key:G,ref:oe,props:Re,_owner:Be};return Te._store={},Object.defineProperty(Te._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Te,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.defineProperty(Te,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$e}),Object.freeze&&(Object.freeze(Te.props),Object.freeze(Te)),Te};function Ld(D,G,oe,Oe,$e){{var Be,Re={},Te=null,Pt=null;oe!==void 0&&(Ee(oe),Te=""+oe),Br(G)&&(Ee(G.key),Te=""+G.key),$n(G)&&(Pt=G.ref,Vr(G,$e));for(Be in G)We.call(G,Be)&&!Ue.hasOwnProperty(Be)&&(Re[Be]=G[Be]);if(D&&D.defaultProps){var et=D.defaultProps;for(Be in et)Re[Be]===void 0&&(Re[Be]=et[Be])}if(Te||Pt){var ot=typeof D=="function"?D.displayName||D.name||"Unknown":D;Te&&mn(Re,ot),Pt&&vr(Re,ot)}return jn(D,Te,Pt,$e,Oe,Ne.current,Re)}}var To=w.ReactCurrentOwner,Va=w.ReactDebugCurrentFrame;function Yn(D){if(D){var G=D._owner,oe=Se(D.type,D._source,G?G.type:null);Va.setExtraStackFrame(oe)}else Va.setExtraStackFrame(null)}var to;to=!1;function Ao(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Ha(){{if(To.current){var D=q(To.current.type);if(D)return`
363
+ `+Te[et].replace(" at new "," at ");return D.displayName&&Vt.includes("<anonymous>")&&(Vt=Vt.replace("<anonymous>",D.displayName)),typeof D=="function"&&ie.set(D,Vt),Vt}while(et>=1&&ot>=0);break}}}finally{Q=!1,ge.current=Be,xe(),Error.prepareStackTrace=$e}var Tn=D?D.displayName||D.name:"",Xa=Tn?ee(Tn):"";return typeof D=="function"&&ie.set(D,Xa),Xa}function Ie(D,G,oe){return re(D,!1)}function ae(D){var G=D.prototype;return!!(G&&G.isReactComponent)}function Se(D,G,oe){if(D==null)return"";if(typeof D=="function")return re(D,ae(D));if(typeof D=="string")return ee(D);switch(D){case c:return ee("Suspense");case d:return ee("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case l:return Ie(D.render);case f:return Se(D.type,G,oe);case g:{var Oe=D,$e=Oe._payload,Be=Oe._init;try{return Se(Be($e),G,oe)}catch{}}}return""}var We=Object.prototype.hasOwnProperty,dt={},qe=w.ReactDebugCurrentFrame;function gt(D){if(D){var G=D._owner,oe=Se(D.type,D._source,G?G.type:null);qe.setExtraStackFrame(oe)}else qe.setExtraStackFrame(null)}function Gt(D,G,oe,Oe,$e){{var Be=Function.call.bind(We);for(var Re in D)if(Be(D,Re)){var Te=void 0;try{if(typeof D[Re]!="function"){var Pt=Error((Oe||"React class")+": "+oe+" type `"+Re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[Re]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pt.name="Invariant Violation",Pt}Te=D[Re](G,Re,Oe,oe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(et){Te=et}Te&&!(Te instanceof Error)&&(gt($e),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Oe||"React class",oe,Re,typeof Te),gt(null)),Te instanceof Error&&!(Te.message in dt)&&(dt[Te.message]=!0,gt($e),S("Failed %s type: %s",oe,Te.message),gt(null))}}}var Bt=Array.isArray;function gn(D){return Bt(D)}function Rt(D){{var G=typeof Symbol=="function"&&Symbol.toStringTag,oe=G&&D[Symbol.toStringTag]||D.constructor.name||"Object";return oe}}function mr(D){try{return he(D),!1}catch{return!0}}function he(D){return""+D}function Ee(D){if(mr(D))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Rt(D)),he(D)}var Ne=w.ReactCurrentOwner,Ue={key:!0,ref:!0,__self:!0,__source:!0},at,ln,cn;cn={};function $n(D){if(We.call(D,"ref")){var G=Object.getOwnPropertyDescriptor(D,"ref").get;if(G&&G.isReactWarning)return!1}return D.ref!==void 0}function Br(D){if(We.call(D,"key")){var G=Object.getOwnPropertyDescriptor(D,"key").get;if(G&&G.isReactWarning)return!1}return D.key!==void 0}function Vr(D,G){if(typeof D.ref=="string"&&Ne.current&&G&&Ne.current.stateNode!==G){var oe=q(Ne.current.type);cn[oe]||(S('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(Ne.current.type),D.ref),cn[oe]=!0)}}function mn(D,G){{var oe=function(){at||(at=!0,S("%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)",G))};oe.isReactWarning=!0,Object.defineProperty(D,"key",{get:oe,configurable:!0})}}function vr(D,G){{var oe=function(){ln||(ln=!0,S("%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)",G))};oe.isReactWarning=!0,Object.defineProperty(D,"ref",{get:oe,configurable:!0})}}var jn=function(D,G,oe,Oe,$e,Be,Re){var Te={$$typeof:t,type:D,key:G,ref:oe,props:Re,_owner:Be};return Te._store={},Object.defineProperty(Te._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Te,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.defineProperty(Te,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$e}),Object.freeze&&(Object.freeze(Te.props),Object.freeze(Te)),Te};function Ld(D,G,oe,Oe,$e){{var Be,Re={},Te=null,Pt=null;oe!==void 0&&(Ee(oe),Te=""+oe),Br(G)&&(Ee(G.key),Te=""+G.key),$n(G)&&(Pt=G.ref,Vr(G,$e));for(Be in G)We.call(G,Be)&&!Ue.hasOwnProperty(Be)&&(Re[Be]=G[Be]);if(D&&D.defaultProps){var et=D.defaultProps;for(Be in et)Re[Be]===void 0&&(Re[Be]=et[Be])}if(Te||Pt){var ot=typeof D=="function"?D.displayName||D.name||"Unknown":D;Te&&mn(Re,ot),Pt&&vr(Re,ot)}return jn(D,Te,Pt,$e,Oe,Ne.current,Re)}}var To=w.ReactCurrentOwner,Va=w.ReactDebugCurrentFrame;function Yn(D){if(D){var G=D._owner,oe=Se(D.type,D._source,G?G.type:null);Va.setExtraStackFrame(oe)}else Va.setExtraStackFrame(null)}var to;to=!1;function Ao(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Ha(){{if(To.current){var D=q(To.current.type);if(D)return`
364
364
 
365
365
  Check the render method of \``+D+"`."}return""}}function Fd(D){{if(D!==void 0){var G=D.fileName.replace(/^.*[\\\/]/,""),oe=D.lineNumber;return`
366
366
 
@@ -374,7 +374,7 @@ Check the top-level render call using <`+oe+">.")}return G}}function Ua(D,G){{if
374
374
  *
375
375
  * This source code is licensed under the MIT license found in the
376
376
  * LICENSE file in the root directory of this source tree.
377
- */var AP;function xU(){if(AP)return Qu;AP=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var d,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)r.call(l,d)&&!o.hasOwnProperty(d)&&(f[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)f[d]===void 0&&(f[d]=l[d]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return Qu.Fragment=n,Qu.jsx=s,Qu.jsxs=s,Qu}process.env.NODE_ENV==="production"?ty.exports=xU():ty.exports=yU();var _e=ty.exports;function Zu(e){return e.mode==="multiple"}function Ju(e){return e.mode==="range"}function bp(e){return e.mode==="single"}var wU={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 _U(e,t){return qi(e,"LLLL y",t)}function SU(e,t){return qi(e,"d",t)}function CU(e,t){return qi(e,"LLLL",t)}function EU(e){return"".concat(e)}function OU(e,t){return qi(e,"cccccc",t)}function PU(e,t){return qi(e,"yyyy",t)}var kU=Object.freeze({__proto__:null,formatCaption:_U,formatDay:SU,formatMonthCaption:CU,formatWeekNumber:EU,formatWeekdayName:OU,formatYearCaption:PU}),DU=function(e,t,n){return qi(e,"do MMMM (EEEE)",n)},MU=function(){return"Month: "},TU=function(){return"Go to next month"},AU=function(){return"Go to previous month"},IU=function(e,t){return qi(e,"cccc",t)},NU=function(e){return"Week n. ".concat(e)},RU=function(){return"Year: "},LU=Object.freeze({__proto__:null,labelDay:DU,labelMonthDropdown:MU,labelNext:TU,labelPrevious:AU,labelWeekNumber:NU,labelWeekday:IU,labelYearDropdown:RU});function FU(){var e="buttons",t=wU,n=yP,r={},i={},o=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:kU,labels:LU,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:o,styles:s,today:a,mode:"default"}}function $U(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,o=e.fromDate,s=e.toDate;return r?o=fr(r):t&&(o=new Date(t,0,1)),i?s=Y0(i):n&&(s=new Date(n,11,31)),{fromDate:o?zl(o):void 0,toDate:s?zl(s):void 0}}var IP=m.createContext(void 0);function jU(e){var t,n=e.initialProps,r=FU(),i=$U(n),o=i.fromDate,s=i.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!o||!s)&&(a="buttons");var l;(bp(n)||Zu(n)||Ju(n))&&(l=n.onSelect);var c=Xe(Xe(Xe({},r),n),{captionLayout:a,classNames:Xe(Xe({},r.classNames),n.classNames),components:Xe({},n.components),formatters:Xe(Xe({},r.formatters),n.formatters),fromDate:o,labels:Xe(Xe({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Xe(Xe({},r.modifiers),n.modifiers),modifiersClassNames:Xe(Xe({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Xe(Xe({},r.styles),n.styles),toDate:s});return _e.jsx(IP.Provider,{value:c,children:e.children})}function Wt(){var e=m.useContext(IP);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function NP(e){var t=Wt(),n=t.locale,r=t.classNames,i=t.styles,o=t.formatters.formatCaption;return _e.jsx("div",{className:r.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:n})})}function zU(e){return _e.jsx("svg",Xe({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:_e.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 RP(e){var t,n,r=e.onChange,i=e.value,o=e.children,s=e.caption,a=e.className,l=e.style,c=Wt(),d=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:zU;return _e.jsxs("div",{className:a,style:l,children:[_e.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),_e.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:i,onChange:r,children:o}),_e.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,_e.jsx(d,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function BU(e){var t,n=Wt(),r=n.fromDate,i=n.toDate,o=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,d=n.labels.labelMonthDropdown;if(!r)return _e.jsx(_e.Fragment,{});if(!i)return _e.jsx(_e.Fragment,{});var f=[];if(vU(r,i))for(var g=fr(r),p=r.getMonth();p<=i.getMonth();p++)f.push(ey(g,p));else for(var g=fr(new Date),p=0;p<=11;p++)f.push(ey(g,p));var v=function(x){var w=Number(x.target.value),S=ey(fr(e.displayMonth),w);e.onChange(S)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:RP;return _e.jsx(b,{name:"months","aria-label":d(),className:l.dropdown_month,style:o.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(x){return _e.jsx("option",{value:x.getMonth(),children:a(x,{locale:s})},x.getMonth())})})}function VU(e){var t,n=e.displayMonth,r=Wt(),i=r.fromDate,o=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,d=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,g=[];if(!i)return _e.jsx(_e.Fragment,{});if(!o)return _e.jsx(_e.Fragment,{});for(var p=i.getFullYear(),v=o.getFullYear(),b=p;b<=v;b++)g.push(DP(vP(new Date),b));var x=function(S){var C=DP(fr(n),Number(S.target.value));e.onChange(C)},w=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:RP;return _e.jsx(w,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:x,value:n.getFullYear(),caption:d(n,{locale:s}),children:g.map(function(S){return _e.jsx("option",{value:S.getFullYear(),children:d(S,{locale:s})},S.getFullYear())})})}function HU(e,t){var n=m.useState(e),r=n[0],i=n[1],o=t===void 0?r:t;return[o,i]}function WU(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,o=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(o&&Gu(o,i)<0){var c=-1*(l-1);i=Si(o,c)}return s&&Gu(i,s)<0&&(i=s),fr(i)}function UU(){var e=Wt(),t=WU(e),n=HU(t,e.month),r=n[0],i=n[1],o=function(s){var a;if(!e.disableNavigation){var l=fr(s);i(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,o]}function qU(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=fr(e),o=fr(Si(i,r)),s=Gu(o,i),a=[],l=0;l<s;l++){var c=Si(i,l);a.push(c)}return n&&(a=a.reverse()),a}function GU(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=fr(e);if(!n)return Si(a,s);var l=Gu(n,e);if(!(l<o))return Si(a,s)}}function YU(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=fr(e);if(!n)return Si(a,-s);var l=Gu(a,n);if(!(l<=0))return Si(a,-s)}}var LP=m.createContext(void 0);function KU(e){var t=Wt(),n=UU(),r=n[0],i=n[1],o=qU(r,t),s=GU(r,t),a=YU(r,t),l=function(f){return o.some(function(g){return Z0(f,g)})},c=function(f,g){l(f)||(g&&kP(f,g)?i(Si(f,1+t.numberOfMonths*-1)):i(f))},d={currentMonth:r,displayMonths:o,goToMonth:i,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return _e.jsx(LP.Provider,{value:d,children:e.children})}function ed(){var e=m.useContext(LP);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function FP(e){var t,n=Wt(),r=n.classNames,i=n.styles,o=n.components,s=ed().goToMonth,a=function(d){s(Si(d,e.displayIndex?-e.displayIndex:0))},l=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:NP,c=_e.jsx(l,{id:e.id,displayMonth:e.displayMonth});return _e.jsxs("div",{className:r.caption_dropdowns,style:i.caption_dropdowns,children:[_e.jsx("div",{className:r.vhidden,children:c}),_e.jsx(BU,{onChange:a,displayMonth:e.displayMonth}),_e.jsx(VU,{onChange:a,displayMonth:e.displayMonth})]})}function XU(e){return _e.jsx("svg",Xe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:_e.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 QU(e){return _e.jsx("svg",Xe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:_e.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 yp=m.forwardRef(function(e,t){var n=Wt(),r=n.classNames,i=n.styles,o=[r.button_reset,r.button];e.className&&o.push(e.className);var s=o.join(" "),a=Xe(Xe({},i.button_reset),i.button);return e.style&&Object.assign(a,e.style),_e.jsx("button",Xe({},e,{ref:t,type:"button",className:s,style:a}))});function ZU(e){var t,n,r=Wt(),i=r.dir,o=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,d=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return _e.jsx(_e.Fragment,{});var g=c(e.previousMonth,{locale:o}),p=[s.nav_button,s.nav_button_previous].join(" "),v=d(e.nextMonth,{locale:o}),b=[s.nav_button,s.nav_button_next].join(" "),x=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:QU,w=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:XU;return _e.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&_e.jsx(yp,{name:"previous-month","aria-label":g,className:p,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:i==="rtl"?_e.jsx(x,{className:s.nav_icon,style:a.nav_icon}):_e.jsx(w,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&_e.jsx(yp,{name:"next-month","aria-label":v,className:b,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:i==="rtl"?_e.jsx(w,{className:s.nav_icon,style:a.nav_icon}):_e.jsx(x,{className:s.nav_icon,style:a.nav_icon})})]})}function $P(e){var t=Wt().numberOfMonths,n=ed(),r=n.previousMonth,i=n.nextMonth,o=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(v){return Z0(e.displayMonth,v)}),l=a===0,c=a===s.length-1,d=t>1&&(l||!c),f=t>1&&(c||!l),g=function(){r&&o(r)},p=function(){i&&o(i)};return _e.jsx(ZU,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:i,previousMonth:r,onPreviousClick:g,onNextClick:p})}function JU(e){var t,n=Wt(),r=n.classNames,i=n.disableNavigation,o=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:NP,c;return i?c=_e.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=_e.jsx(FP,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=_e.jsxs(_e.Fragment,{children:[_e.jsx(FP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),_e.jsx($P,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=_e.jsxs(_e.Fragment,{children:[_e.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_e.jsx($P,{displayMonth:e.displayMonth,id:e.id})]}),_e.jsx("div",{className:r.caption,style:o.caption,children:c})}function eq(e){var t=Wt(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?_e.jsx("tfoot",{className:i,style:r.tfoot,children:_e.jsx("tr",{children:_e.jsx("td",{colSpan:8,children:n})})}):_e.jsx(_e.Fragment,{})}function tq(e,t,n){for(var r=n?wa(new Date):Wi(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var s=Jn(r,o);i.push(s)}return i}function nq(){var e=Wt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=tq(i,o,s);return _e.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&_e.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(d,f){return _e.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(d,{locale:i}),children:a(d,{locale:i})},f)})]})}function rq(){var e,t=Wt(),n=t.classNames,r=t.styles,i=t.components,o=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:nq;return _e.jsx("thead",{style:r.head,className:n.head,children:_e.jsx(o,{})})}function iq(e){var t=Wt(),n=t.locale,r=t.formatters.formatDay;return _e.jsx(_e.Fragment,{children:r(e.date,{locale:n})})}var ny=m.createContext(void 0);function oq(e){if(!Zu(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return _e.jsx(ny.Provider,{value:t,children:e.children})}return _e.jsx(sq,{initialProps:e.initialProps,children:e.children})}function sq(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,s=function(c,d,f){var g,p;(g=t.onDayClick)===null||g===void 0||g.call(t,c,d,f);var v=!!(d.selected&&i&&(r==null?void 0:r.length)===i);if(!v){var b=!!(!d.selected&&o&&(r==null?void 0:r.length)===o);if(!b){var x=r?MP([],r,!0):[];if(d.selected){var w=x.findIndex(function(S){return dr(c,S)});x.splice(w,1)}else x.push(c);(p=t.onSelect)===null||p===void 0||p.call(t,x,c,d,f)}}},a={disabled:[]};r&&a.disabled.push(function(c){var d=o&&r.length>o-1,f=r.some(function(g){return dr(g,c)});return!!(d&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return _e.jsx(ny.Provider,{value:l,children:n})}function ry(){var e=m.useContext(ny);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function aq(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?dr(i,e)&&dr(r,e)?void 0:dr(i,e)?{from:i,to:void 0}:dr(r,e)?void 0:Q0(r,e)?{from:e,to:i}:{from:r,to:e}:i?Q0(e,i)?{from:i,to:e}:{from:e,to:i}:r?kP(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var iy=m.createContext(void 0);function lq(e){if(!Ju(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return _e.jsx(iy.Provider,{value:t,children:e.children})}return _e.jsx(cq,{initialProps:e.initialProps,children:e.children})}function cq(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,s=i.to,a=t.min,l=t.max,c=function(p,v,b){var x,w;(x=t.onDayClick)===null||x===void 0||x.call(t,p,v,b);var S=aq(p,r);(w=t.onSelect)===null||w===void 0||w.call(t,S,p,v,b)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(d.range_start=[o],s?(d.range_end=[s],dr(o,s)||(d.range_middle=[{after:o,before:s}])):d.range_end=[o]):s&&(d.range_start=[s],d.range_end=[s]),a&&(o&&!s&&d.disabled.push({after:J0(o,a-1),before:Jn(o,a-1)}),o&&s&&d.disabled.push({after:o,before:Jn(o,a-1)}),!o&&s&&d.disabled.push({after:J0(s,a-1),before:Jn(s,a-1)})),l){if(o&&!s&&(d.disabled.push({before:Jn(o,-l+1)}),d.disabled.push({after:Jn(o,l-1)})),o&&s){var f=Ui(s,o)+1,g=l-f;d.disabled.push({before:J0(o,g)}),d.disabled.push({after:Jn(s,g)})}!o&&s&&(d.disabled.push({before:Jn(s,-l+1)}),d.disabled.push({after:Jn(s,l-1)}))}return _e.jsx(iy.Provider,{value:{selected:r,onDayClick:c,modifiers:d},children:n})}function oy(){var e=m.useContext(iy);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function xp(e){return Array.isArray(e)?MP([],e,!0):e!==void 0?[e]:[]}function uq(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=xp(i)}),t}var Ci;(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"})(Ci||(Ci={}));var dq=Ci.Selected,Eo=Ci.Disabled,fq=Ci.Hidden,hq=Ci.Today,sy=Ci.RangeEnd,ay=Ci.RangeMiddle,ly=Ci.RangeStart,pq=Ci.Outside;function gq(e,t,n){var r,i=(r={},r[dq]=xp(e.selected),r[Eo]=xp(e.disabled),r[fq]=xp(e.hidden),r[hq]=[e.today],r[sy]=[],r[ay]=[],r[ly]=[],r[pq]=[],r);return e.fromDate&&i[Eo].push({before:e.fromDate}),e.toDate&&i[Eo].push({after:e.toDate}),Zu(e)?i[Eo]=i[Eo].concat(t.modifiers[Eo]):Ju(e)&&(i[Eo]=i[Eo].concat(n.modifiers[Eo]),i[ly]=n.modifiers[ly],i[ay]=n.modifiers[ay],i[sy]=n.modifiers[sy]),i}var jP=m.createContext(void 0);function mq(e){var t=Wt(),n=ry(),r=oy(),i=gq(t,n,r),o=uq(t.modifiers),s=Xe(Xe({},i),o);return _e.jsx(jP.Provider,{value:s,children:e.children})}function zP(){var e=m.useContext(jP);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function vq(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function bq(e){return!!(e&&typeof e=="object"&&"from"in e)}function yq(e){return!!(e&&typeof e=="object"&&"after"in e)}function xq(e){return!!(e&&typeof e=="object"&&"before"in e)}function wq(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function _q(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=Ui(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var s=Ui(e,r)>=0&&Ui(i,e)>=0;return s}return i?dr(i,e):r?dr(r,e):!1}function Sq(e){return G0(e)}function Cq(e){return Array.isArray(e)&&e.every(G0)}function Eq(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Sq(n))return dr(e,n);if(Cq(n))return n.includes(e);if(bq(n))return _q(e,n);if(wq(n))return n.dayOfWeek.includes(e.getDay());if(vq(n)){var r=Ui(n.before,e),i=Ui(n.after,e),o=r>0,s=i<0,a=Q0(n.before,n.after);return a?s&&o:o||s}return yq(n)?Ui(e,n.after)>0:xq(n)?Ui(n.before,e)>0:typeof n=="function"?n(e):!1})}function cy(e,t,n){var r=Object.keys(t).reduce(function(o,s){var a=t[s];return Eq(e,a)&&o.push(s),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!Z0(e,n)&&(i.outside=!0),i}function Oq(e,t){for(var n=fr(e[0]),r=Y0(e[e.length-1]),i,o,s=n;s<=r;){var a=cy(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Jn(s,1);continue}if(a.selected)return s;a.today&&!o&&(o=s),i||(i=s),s=Jn(s,1)}return o||i}var Pq=365;function BP(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=i.weekStartsOn,c=i.fromDate,d=i.toDate,f=i.locale,g={day:Jn,week:q0,month:Si,year:gW,startOfWeek:function(x){return i.ISOWeek?wa(x):Wi(x,{locale:f,weekStartsOn:l})},endOfWeek:function(x){return i.ISOWeek?bP(x):K0(x,{locale:f,weekStartsOn:l})}},p=g[n](e,r==="after"?1:-1);r==="before"&&c?p=mW([c,p]):r==="after"&&d&&(p=vW([d,p]));var v=!0;if(o){var b=cy(p,o);v=!b.disabled&&!b.hidden}return v?p:a.count>Pq?a.lastFocused:BP(p,{moveBy:n,direction:r,context:i,modifiers:o,retry:Xe(Xe({},a),{count:a.count+1})})}var VP=m.createContext(void 0);function kq(e){var t=ed(),n=zP(),r=m.useState(),i=r[0],o=r[1],s=m.useState(),a=s[0],l=s[1],c=Oq(t.displayMonths,n),d=i??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(i),o(void 0)},g=function(x){o(x)},p=Wt(),v=function(x,w){if(i){var S=BP(i,{moveBy:x,direction:w,context:p,modifiers:n});dr(i,S)||(t.goToDate(S,i),g(S))}},b={focusedDay:i,focusTarget:d,blur:f,focus:g,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 _e.jsx(VP.Provider,{value:b,children:e.children})}function uy(){var e=m.useContext(VP);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Dq(e,t){var n=zP(),r=cy(e,n,t);return r}var dy=m.createContext(void 0);function Mq(e){if(!bp(e.initialProps)){var t={selected:void 0};return _e.jsx(dy.Provider,{value:t,children:e.children})}return _e.jsx(Tq,{initialProps:e.initialProps,children:e.children})}function Tq(e){var t=e.initialProps,n=e.children,r=function(o,s,a){var l,c,d;if((l=t.onDayClick)===null||l===void 0||l.call(t,o,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,o,s,a);return}(d=t.onSelect)===null||d===void 0||d.call(t,o,o,s,a)},i={selected:t.selected,onDayClick:r};return _e.jsx(dy.Provider,{value:i,children:n})}function HP(){var e=m.useContext(dy);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Aq(e,t){var n=Wt(),r=HP(),i=ry(),o=oy(),s=uy(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,d=s.focusWeekBefore,f=s.blur,g=s.focus,p=s.focusMonthBefore,v=s.focusMonthAfter,b=s.focusYearBefore,x=s.focusYearAfter,w=s.focusStartOfWeek,S=s.focusEndOfWeek,C=function(W){var ne,le,A,H;bp(n)?(ne=r.onDayClick)===null||ne===void 0||ne.call(r,e,t,W):Zu(n)?(le=i.onDayClick)===null||le===void 0||le.call(i,e,t,W):Ju(n)?(A=o.onDayClick)===null||A===void 0||A.call(o,e,t,W):(H=n.onDayClick)===null||H===void 0||H.call(n,e,t,W)},P=function(W){var ne;g(e),(ne=n.onDayFocus)===null||ne===void 0||ne.call(n,e,t,W)},O=function(W){var ne;f(),(ne=n.onDayBlur)===null||ne===void 0||ne.call(n,e,t,W)},k=function(W){var ne;(ne=n.onDayMouseEnter)===null||ne===void 0||ne.call(n,e,t,W)},T=function(W){var ne;(ne=n.onDayMouseLeave)===null||ne===void 0||ne.call(n,e,t,W)},I=function(W){var ne;(ne=n.onDayPointerEnter)===null||ne===void 0||ne.call(n,e,t,W)},F=function(W){var ne;(ne=n.onDayPointerLeave)===null||ne===void 0||ne.call(n,e,t,W)},j=function(W){var ne;(ne=n.onDayTouchCancel)===null||ne===void 0||ne.call(n,e,t,W)},B=function(W){var ne;(ne=n.onDayTouchEnd)===null||ne===void 0||ne.call(n,e,t,W)},V=function(W){var ne;(ne=n.onDayTouchMove)===null||ne===void 0||ne.call(n,e,t,W)},q=function(W){var ne;(ne=n.onDayTouchStart)===null||ne===void 0||ne.call(n,e,t,W)},J=function(W){var ne;(ne=n.onDayKeyUp)===null||ne===void 0||ne.call(n,e,t,W)},$=function(W){var ne;switch(W.key){case"ArrowLeft":W.preventDefault(),W.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":W.preventDefault(),W.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":W.preventDefault(),W.stopPropagation(),c();break;case"ArrowUp":W.preventDefault(),W.stopPropagation(),d();break;case"PageUp":W.preventDefault(),W.stopPropagation(),W.shiftKey?b():p();break;case"PageDown":W.preventDefault(),W.stopPropagation(),W.shiftKey?x():v();break;case"Home":W.preventDefault(),W.stopPropagation(),w();break;case"End":W.preventDefault(),W.stopPropagation(),S();break}(ne=n.onDayKeyDown)===null||ne===void 0||ne.call(n,e,t,W)},X={onClick:C,onFocus:P,onBlur:O,onKeyDown:$,onKeyUp:J,onMouseEnter:k,onMouseLeave:T,onPointerEnter:I,onPointerLeave:F,onTouchCancel:j,onTouchEnd:B,onTouchMove:V,onTouchStart:q};return X}function Iq(){var e=Wt(),t=HP(),n=ry(),r=oy(),i=bp(e)?t.selected:Zu(e)?n.selected:Ju(e)?r.selected:void 0;return i}function Nq(e){return Object.values(Ci).includes(e)}function Rq(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(Nq(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function Lq(e,t){var n=Xe({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Xe(Xe({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function Fq(e,t,n){var r,i,o,s=Wt(),a=uy(),l=Dq(e,t),c=Aq(e,l),d=Iq(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var k;l.outside||a.focusedDay&&f&&dr(a.focusedDay,e)&&((k=n.current)===null||k===void 0||k.focus())},[a.focusedDay,e,n,f,l.outside]);var g=Rq(s,l).join(" "),p=Lq(s,l),v=!!(l.outside&&!s.showOutsideDays||l.hidden),b=(o=(i=s.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:iq,x=_e.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),w={style:p,className:g,children:x,role:"gridcell"},S=a.focusTarget&&dr(a.focusTarget,e)&&!l.outside,C=a.focusedDay&&dr(a.focusedDay,e),P=Xe(Xe(Xe({},w),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=C||S?0:-1,r)),c),O={isButton:f,isHidden:v,activeModifiers:l,selectedDays:d,buttonProps:P,divProps:w};return O}function $q(e){var t=m.useRef(null),n=Fq(e.date,e.displayMonth,t);return n.isHidden?_e.jsx("div",{role:"gridcell"}):n.isButton?_e.jsx(yp,Xe({name:"day",ref:t},n.buttonProps)):_e.jsx("div",Xe({},n.divProps))}function jq(e){var t=e.number,n=e.dates,r=Wt(),i=r.onWeekNumberClick,o=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,d=c(Number(t),{locale:a});if(!i)return _e.jsx("span",{className:s.weeknumber,style:o.weeknumber,children:d});var f=l(Number(t),{locale:a}),g=function(p){i(t,n,p)};return _e.jsx(yp,{name:"week-number","aria-label":f,className:s.weeknumber,style:o.weeknumber,onClick:g,children:d})}function zq(e){var t,n,r=Wt(),i=r.styles,o=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:$q,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:jq,d;return s&&(d=_e.jsx("td",{className:o.cell,style:i.cell,children:_e.jsx(c,{number:e.weekNumber,dates:e.dates})})),_e.jsxs("tr",{className:o.row,style:i.row,children:[d,e.dates.map(function(f){return _e.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:_e.jsx(l,{displayMonth:e.displayMonth,date:f})},pU(f))})]})}function WP(e,t,n){for(var r=n!=null&&n.ISOWeek?bP(t):K0(t,n),i=n!=null&&n.ISOWeek?wa(e):Wi(e,n),o=Ui(r,i),s=[],a=0;a<=o;a++)s.push(Jn(i,a));var l=s.reduce(function(c,d){var f=n!=null&&n.ISOWeek?xP(d):_P(d,n),g=c.find(function(p){return p.weekNumber===f});return g?(g.dates.push(d),c):(c.push({weekNumber:f,dates:[d]}),c)},[]);return l}function Bq(e,t){var n=WP(fr(e),Y0(e),t);if(t!=null&&t.useFixedWeeks){var r=mU(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],s=q0(o,6-r),a=WP(q0(o,1),s,t);n.push.apply(n,a)}}return n}function Vq(e){var t,n,r,i=Wt(),o=i.locale,s=i.classNames,a=i.styles,l=i.hideHead,c=i.fixedWeeks,d=i.components,f=i.weekStartsOn,g=i.firstWeekContainsDate,p=i.ISOWeek,v=Bq(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:g}),b=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:rq,x=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:zq,w=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:eq;return _e.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&_e.jsx(b,{}),_e.jsx("tbody",{className:s.tbody,style:a.tbody,children:v.map(function(S){return _e.jsx(x,{displayMonth:e.displayMonth,dates:S.dates,weekNumber:S.weekNumber},S.weekNumber)})}),_e.jsx(w,{displayMonth:e.displayMonth})]})}function Hq(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Wq=Hq()?m.useLayoutEffect:m.useEffect,fy=!1,Uq=0;function UP(){return"react-day-picker-".concat(++Uq)}function qq(e){var t,n=e??(fy?UP():null),r=m.useState(n),i=r[0],o=r[1];return Wq(function(){i===null&&o(UP())},[]),m.useEffect(function(){fy===!1&&(fy=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function Gq(e){var t,n,r=Wt(),i=r.dir,o=r.classNames,s=r.styles,a=r.components,l=ed().displayMonths,c=qq(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[o.month],g=s.month,p=e.displayIndex===0,v=e.displayIndex===l.length-1,b=!p&&!v;i==="rtl"&&(t=[p,v],v=t[0],p=t[1]),p&&(f.push(o.caption_start),g=Xe(Xe({},g),s.caption_start)),v&&(f.push(o.caption_end),g=Xe(Xe({},g),s.caption_end)),b&&(f.push(o.caption_between),g=Xe(Xe({},g),s.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:JU;return _e.jsxs("div",{className:f.join(" "),style:g,children:[_e.jsx(x,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_e.jsx(Vq,{id:d,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function Yq(e){var t=Wt(),n=t.classNames,r=t.styles;return _e.jsx("div",{className:n.months,style:r.months,children:e.children})}function Kq(e){var t,n,r=e.initialProps,i=Wt(),o=uy(),s=ed(),a=m.useState(!1),l=a[0],c=a[1];m.useEffect(function(){i.initialFocus&&o.focusTarget&&(l||(o.focus(o.focusTarget),c(!0)))},[i.initialFocus,l,o.focus,o.focusTarget,o]);var d=[i.classNames.root,i.className];i.numberOfMonths>1&&d.push(i.classNames.multiple_months),i.showWeekNumber&&d.push(i.classNames.with_weeknumber);var f=Xe(Xe({},i.styles.root),i.style),g=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,b){var x;return Xe(Xe({},v),(x={},x[b]=r[b],x))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:Yq;return _e.jsx("div",Xe({className:d.join(" "),style:f,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},g,{children:_e.jsx(p,{children:s.displayMonths.map(function(v,b){return _e.jsx(Gq,{displayIndex:b,displayMonth:v},b)})})}))}function Xq(e){var t=e.children,n=bU(e,["children"]);return _e.jsx(jU,{initialProps:n,children:_e.jsx(KU,{children:_e.jsx(Mq,{initialProps:n,children:_e.jsx(oq,{initialProps:n,children:_e.jsx(lq,{initialProps:n,children:_e.jsx(mq,{children:_e.jsx(kq,{children:t})})})})})})})}function Qq(e){return _e.jsx(Xq,Xe({},e,{children:_e.jsx(Kq,{initialProps:e})}))}function qP({className:e,classNames:t,showOutsideDays:n=!0,...r}){return _.jsx(Qq,{showOutsideDays:n,className:De("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:De(W0({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:De(W0({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...i})=>_.jsx(UV,{...i,className:"h-4 w-4"}),IconRight:({...i})=>_.jsx(MO,{...i,className:"h-4 w-4"})},...r})}qP.displayName="Calendar";let hy=0;function wp(){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:GP()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:GP()),hy++,()=>{hy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),hy--}},[])}function GP(){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 py="focusScope.autoFocusOnMount",gy="focusScope.autoFocusOnUnmount",YP={bubbles:!1,cancelable:!0},_p=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=m.useState(null),c=_n(i),d=_n(o),f=m.useRef(null),g=nt(t,b=>l(b)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let b=function(C){if(p.paused||!a)return;const P=C.target;a.contains(P)?f.current=P:hs(f.current,{select:!0})},x=function(C){if(p.paused||!a)return;const P=C.relatedTarget;P!==null&&(a.contains(P)||hs(f.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const O of C)O.removedNodes.length>0&&hs(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const S=new MutationObserver(w);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),S.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){QP.add(p);const b=document.activeElement;if(!a.contains(b)){const w=new CustomEvent(py,YP);a.addEventListener(py,c),a.dispatchEvent(w),w.defaultPrevented||(Zq(rG(KP(a)),{select:!0}),document.activeElement===b&&hs(a))}return()=>{a.removeEventListener(py,c),setTimeout(()=>{const w=new CustomEvent(gy,YP);a.addEventListener(gy,d),a.dispatchEvent(w),w.defaultPrevented||hs(b??document.body,{select:!0}),a.removeEventListener(gy,d),QP.remove(p)},0)}}},[a,c,d,p]);const v=m.useCallback(b=>{if(!n&&!r||p.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,w=document.activeElement;if(x&&w){const S=b.currentTarget,[C,P]=Jq(S);C&&P?!b.shiftKey&&w===P?(b.preventDefault(),n&&hs(C,{select:!0})):b.shiftKey&&w===C&&(b.preventDefault(),n&&hs(P,{select:!0})):w===S&&b.preventDefault()}},[n,r,p.paused]);return m.createElement(He.div,se({tabIndex:-1},s,{ref:g,onKeyDown:v}))});function Zq(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(hs(r,{select:t}),document.activeElement!==n)return}function Jq(e){const t=KP(e),n=XP(t,e),r=XP(t.reverse(),e);return[n,r]}function KP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function XP(e,t){for(const n of e)if(!eG(n,{upTo:t}))return n}function eG(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 tG(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&&tG(e)&&t&&e.select()}}const QP=nG();function nG(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ZP(e,t),e.unshift(t)},remove(t){var n;e=ZP(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function ZP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rG(e){return e.filter(t=>t.tagName!=="A")}var iG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vl=new WeakMap,Sp=new WeakMap,Cp={},my=0,JP=function(e){return e&&(e.host||JP(e.parentNode))},oG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=JP(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})},sG=function(e,t,n,r){var i=oG(t,Array.isArray(e)?e:[e]);Cp[n]||(Cp[n]=new WeakMap);var o=Cp[n],s=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))d(g);else{var p=g.getAttribute(r),v=p!==null&&p!=="false",b=(Vl.get(g)||0)+1,x=(o.get(g)||0)+1;Vl.set(g,b),o.set(g,x),s.push(g),b===1&&v&&Sp.set(g,!0),x===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}})};return d(t),a.clear(),my++,function(){s.forEach(function(f){var g=Vl.get(f)-1,p=o.get(f)-1;Vl.set(f,g),o.set(f,p),g||(Sp.has(f)||f.removeAttribute(r),Sp.delete(f)),p||f.removeAttribute(n)}),my--,my||(Vl=new WeakMap,Vl=new WeakMap,Sp=new WeakMap,Cp={})}},Ep=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||iG(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),sG(r,i,n,"aria-hidden")):function(){return null}},Gi=function(){return Gi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Gi.apply(this,arguments)};function ek(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function aG(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Op="right-scroll-bar-position",Pp="width-before-scroll-bar",lG="with-scroll-bars-hidden",cG="--removed-body-scroll-bar-size";function uG(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function dG(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function fG(e,t){return dG(t||null,function(n){return e.forEach(function(r){return uG(r,n)})})}function hG(e){return e}function pG(e,t){t===void 0&&(t=hG);var n=[],r=!1,i={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(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var d=s;s=[],d.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),n}}}};return i}function gG(e){e===void 0&&(e={});var t=pG(null);return t.options=Gi({async:!0,ssr:!1},e),t}var tk=function(e){var t=e.sideCar,n=ek(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 de.createElement(r,Gi({},n))};tk.isSideCarExport=!0;function mG(e,t){return e.useMedium(t),tk}var nk=gG(),vy=function(){},kp=de.forwardRef(function(e,t){var n=de.useRef(null),r=de.useState({onScrollCapture:vy,onWheelCapture:vy,onTouchMoveCapture:vy}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,g=e.sideCar,p=e.noIsolation,v=e.inert,b=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=ek(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=g,P=fG([n,t]),O=Gi(Gi({},S),i);return de.createElement(de.Fragment,null,d&&de.createElement(C,{sideCar:nk,removeScrollBar:c,shards:f,noIsolation:p,inert:v,setCallbacks:o,allowPinchZoom:!!b,lockRef:n}),s?de.cloneElement(de.Children.only(a),Gi(Gi({},O),{ref:P})):de.createElement(w,Gi({},O,{className:l,ref:P}),a))});kp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},kp.classNames={fullWidth:Pp,zeroRight:Op};var rk,vG=function(){if(rk)return rk;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=vG();return t&&e.setAttribute("nonce",t),e}function yG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=bG())&&(yG(t,n),xG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_G=function(){var e=wG();return function(t,n){de.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ik=function(){var e=_G(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},SG={left:0,top:0,right:0,gap:0},by=function(e){return parseInt(e||"",10)||0},CG=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[by(n),by(r),by(i)]},EG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return SG;var t=CG(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])}},OG=ik(),PG=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
377
+ */var AP;function xU(){if(AP)return Qu;AP=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var d,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)r.call(l,d)&&!o.hasOwnProperty(d)&&(f[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)f[d]===void 0&&(f[d]=l[d]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return Qu.Fragment=n,Qu.jsx=s,Qu.jsxs=s,Qu}process.env.NODE_ENV==="production"?ty.exports=xU():ty.exports=yU();var _e=ty.exports;function Zu(e){return e.mode==="multiple"}function Ju(e){return e.mode==="range"}function bp(e){return e.mode==="single"}var wU={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 _U(e,t){return qi(e,"LLLL y",t)}function SU(e,t){return qi(e,"d",t)}function CU(e,t){return qi(e,"LLLL",t)}function EU(e){return"".concat(e)}function OU(e,t){return qi(e,"cccccc",t)}function PU(e,t){return qi(e,"yyyy",t)}var kU=Object.freeze({__proto__:null,formatCaption:_U,formatDay:SU,formatMonthCaption:CU,formatWeekNumber:EU,formatWeekdayName:OU,formatYearCaption:PU}),DU=function(e,t,n){return qi(e,"do MMMM (EEEE)",n)},MU=function(){return"Month: "},TU=function(){return"Go to next month"},AU=function(){return"Go to previous month"},IU=function(e,t){return qi(e,"cccc",t)},NU=function(e){return"Week n. ".concat(e)},RU=function(){return"Year: "},LU=Object.freeze({__proto__:null,labelDay:DU,labelMonthDropdown:MU,labelNext:TU,labelPrevious:AU,labelWeekNumber:NU,labelWeekday:IU,labelYearDropdown:RU});function FU(){var e="buttons",t=wU,n=yP,r={},i={},o=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:kU,labels:LU,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:o,styles:s,today:a,mode:"default"}}function $U(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,o=e.fromDate,s=e.toDate;return r?o=fr(r):t&&(o=new Date(t,0,1)),i?s=Y0(i):n&&(s=new Date(n,11,31)),{fromDate:o?zl(o):void 0,toDate:s?zl(s):void 0}}var IP=m.createContext(void 0);function jU(e){var t,n=e.initialProps,r=FU(),i=$U(n),o=i.fromDate,s=i.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!o||!s)&&(a="buttons");var l;(bp(n)||Zu(n)||Ju(n))&&(l=n.onSelect);var c=Xe(Xe(Xe({},r),n),{captionLayout:a,classNames:Xe(Xe({},r.classNames),n.classNames),components:Xe({},n.components),formatters:Xe(Xe({},r.formatters),n.formatters),fromDate:o,labels:Xe(Xe({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Xe(Xe({},r.modifiers),n.modifiers),modifiersClassNames:Xe(Xe({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Xe(Xe({},r.styles),n.styles),toDate:s});return _e.jsx(IP.Provider,{value:c,children:e.children})}function Wt(){var e=m.useContext(IP);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function NP(e){var t=Wt(),n=t.locale,r=t.classNames,i=t.styles,o=t.formatters.formatCaption;return _e.jsx("div",{className:r.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:n})})}function zU(e){return _e.jsx("svg",Xe({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:_e.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 RP(e){var t,n,r=e.onChange,i=e.value,o=e.children,s=e.caption,a=e.className,l=e.style,c=Wt(),d=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:zU;return _e.jsxs("div",{className:a,style:l,children:[_e.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),_e.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:i,onChange:r,children:o}),_e.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,_e.jsx(d,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function BU(e){var t,n=Wt(),r=n.fromDate,i=n.toDate,o=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,d=n.labels.labelMonthDropdown;if(!r)return _e.jsx(_e.Fragment,{});if(!i)return _e.jsx(_e.Fragment,{});var f=[];if(vU(r,i))for(var g=fr(r),p=r.getMonth();p<=i.getMonth();p++)f.push(ey(g,p));else for(var g=fr(new Date),p=0;p<=11;p++)f.push(ey(g,p));var v=function(x){var w=Number(x.target.value),S=ey(fr(e.displayMonth),w);e.onChange(S)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:RP;return _e.jsx(b,{name:"months","aria-label":d(),className:l.dropdown_month,style:o.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(x){return _e.jsx("option",{value:x.getMonth(),children:a(x,{locale:s})},x.getMonth())})})}function VU(e){var t,n=e.displayMonth,r=Wt(),i=r.fromDate,o=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,d=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,g=[];if(!i)return _e.jsx(_e.Fragment,{});if(!o)return _e.jsx(_e.Fragment,{});for(var p=i.getFullYear(),v=o.getFullYear(),b=p;b<=v;b++)g.push(DP(vP(new Date),b));var x=function(S){var C=DP(fr(n),Number(S.target.value));e.onChange(C)},w=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:RP;return _e.jsx(w,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:x,value:n.getFullYear(),caption:d(n,{locale:s}),children:g.map(function(S){return _e.jsx("option",{value:S.getFullYear(),children:d(S,{locale:s})},S.getFullYear())})})}function HU(e,t){var n=m.useState(e),r=n[0],i=n[1],o=t===void 0?r:t;return[o,i]}function WU(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,o=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(o&&Gu(o,i)<0){var c=-1*(l-1);i=Si(o,c)}return s&&Gu(i,s)<0&&(i=s),fr(i)}function UU(){var e=Wt(),t=WU(e),n=HU(t,e.month),r=n[0],i=n[1],o=function(s){var a;if(!e.disableNavigation){var l=fr(s);i(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,o]}function qU(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=fr(e),o=fr(Si(i,r)),s=Gu(o,i),a=[],l=0;l<s;l++){var c=Si(i,l);a.push(c)}return n&&(a=a.reverse()),a}function GU(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=fr(e);if(!n)return Si(a,s);var l=Gu(n,e);if(!(l<o))return Si(a,s)}}function YU(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=fr(e);if(!n)return Si(a,-s);var l=Gu(a,n);if(!(l<=0))return Si(a,-s)}}var LP=m.createContext(void 0);function KU(e){var t=Wt(),n=UU(),r=n[0],i=n[1],o=qU(r,t),s=GU(r,t),a=YU(r,t),l=function(f){return o.some(function(g){return Z0(f,g)})},c=function(f,g){l(f)||(g&&kP(f,g)?i(Si(f,1+t.numberOfMonths*-1)):i(f))},d={currentMonth:r,displayMonths:o,goToMonth:i,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return _e.jsx(LP.Provider,{value:d,children:e.children})}function ed(){var e=m.useContext(LP);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function FP(e){var t,n=Wt(),r=n.classNames,i=n.styles,o=n.components,s=ed().goToMonth,a=function(d){s(Si(d,e.displayIndex?-e.displayIndex:0))},l=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:NP,c=_e.jsx(l,{id:e.id,displayMonth:e.displayMonth});return _e.jsxs("div",{className:r.caption_dropdowns,style:i.caption_dropdowns,children:[_e.jsx("div",{className:r.vhidden,children:c}),_e.jsx(BU,{onChange:a,displayMonth:e.displayMonth}),_e.jsx(VU,{onChange:a,displayMonth:e.displayMonth})]})}function XU(e){return _e.jsx("svg",Xe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:_e.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 QU(e){return _e.jsx("svg",Xe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:_e.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 yp=m.forwardRef(function(e,t){var n=Wt(),r=n.classNames,i=n.styles,o=[r.button_reset,r.button];e.className&&o.push(e.className);var s=o.join(" "),a=Xe(Xe({},i.button_reset),i.button);return e.style&&Object.assign(a,e.style),_e.jsx("button",Xe({},e,{ref:t,type:"button",className:s,style:a}))});function ZU(e){var t,n,r=Wt(),i=r.dir,o=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,d=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return _e.jsx(_e.Fragment,{});var g=c(e.previousMonth,{locale:o}),p=[s.nav_button,s.nav_button_previous].join(" "),v=d(e.nextMonth,{locale:o}),b=[s.nav_button,s.nav_button_next].join(" "),x=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:QU,w=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:XU;return _e.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&_e.jsx(yp,{name:"previous-month","aria-label":g,className:p,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:i==="rtl"?_e.jsx(x,{className:s.nav_icon,style:a.nav_icon}):_e.jsx(w,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&_e.jsx(yp,{name:"next-month","aria-label":v,className:b,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:i==="rtl"?_e.jsx(w,{className:s.nav_icon,style:a.nav_icon}):_e.jsx(x,{className:s.nav_icon,style:a.nav_icon})})]})}function $P(e){var t=Wt().numberOfMonths,n=ed(),r=n.previousMonth,i=n.nextMonth,o=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(v){return Z0(e.displayMonth,v)}),l=a===0,c=a===s.length-1,d=t>1&&(l||!c),f=t>1&&(c||!l),g=function(){r&&o(r)},p=function(){i&&o(i)};return _e.jsx(ZU,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:i,previousMonth:r,onPreviousClick:g,onNextClick:p})}function JU(e){var t,n=Wt(),r=n.classNames,i=n.disableNavigation,o=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:NP,c;return i?c=_e.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=_e.jsx(FP,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=_e.jsxs(_e.Fragment,{children:[_e.jsx(FP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),_e.jsx($P,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=_e.jsxs(_e.Fragment,{children:[_e.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_e.jsx($P,{displayMonth:e.displayMonth,id:e.id})]}),_e.jsx("div",{className:r.caption,style:o.caption,children:c})}function eq(e){var t=Wt(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?_e.jsx("tfoot",{className:i,style:r.tfoot,children:_e.jsx("tr",{children:_e.jsx("td",{colSpan:8,children:n})})}):_e.jsx(_e.Fragment,{})}function tq(e,t,n){for(var r=n?wa(new Date):Wi(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var s=Jn(r,o);i.push(s)}return i}function nq(){var e=Wt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=tq(i,o,s);return _e.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&_e.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(d,f){return _e.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(d,{locale:i}),children:a(d,{locale:i})},f)})]})}function rq(){var e,t=Wt(),n=t.classNames,r=t.styles,i=t.components,o=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:nq;return _e.jsx("thead",{style:r.head,className:n.head,children:_e.jsx(o,{})})}function iq(e){var t=Wt(),n=t.locale,r=t.formatters.formatDay;return _e.jsx(_e.Fragment,{children:r(e.date,{locale:n})})}var ny=m.createContext(void 0);function oq(e){if(!Zu(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return _e.jsx(ny.Provider,{value:t,children:e.children})}return _e.jsx(sq,{initialProps:e.initialProps,children:e.children})}function sq(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,s=function(c,d,f){var g,p;(g=t.onDayClick)===null||g===void 0||g.call(t,c,d,f);var v=!!(d.selected&&i&&(r==null?void 0:r.length)===i);if(!v){var b=!!(!d.selected&&o&&(r==null?void 0:r.length)===o);if(!b){var x=r?MP([],r,!0):[];if(d.selected){var w=x.findIndex(function(S){return dr(c,S)});x.splice(w,1)}else x.push(c);(p=t.onSelect)===null||p===void 0||p.call(t,x,c,d,f)}}},a={disabled:[]};r&&a.disabled.push(function(c){var d=o&&r.length>o-1,f=r.some(function(g){return dr(g,c)});return!!(d&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return _e.jsx(ny.Provider,{value:l,children:n})}function ry(){var e=m.useContext(ny);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function aq(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?dr(i,e)&&dr(r,e)?void 0:dr(i,e)?{from:i,to:void 0}:dr(r,e)?void 0:Q0(r,e)?{from:e,to:i}:{from:r,to:e}:i?Q0(e,i)?{from:i,to:e}:{from:e,to:i}:r?kP(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var iy=m.createContext(void 0);function lq(e){if(!Ju(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return _e.jsx(iy.Provider,{value:t,children:e.children})}return _e.jsx(cq,{initialProps:e.initialProps,children:e.children})}function cq(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,s=i.to,a=t.min,l=t.max,c=function(p,v,b){var x,w;(x=t.onDayClick)===null||x===void 0||x.call(t,p,v,b);var S=aq(p,r);(w=t.onSelect)===null||w===void 0||w.call(t,S,p,v,b)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(d.range_start=[o],s?(d.range_end=[s],dr(o,s)||(d.range_middle=[{after:o,before:s}])):d.range_end=[o]):s&&(d.range_start=[s],d.range_end=[s]),a&&(o&&!s&&d.disabled.push({after:J0(o,a-1),before:Jn(o,a-1)}),o&&s&&d.disabled.push({after:o,before:Jn(o,a-1)}),!o&&s&&d.disabled.push({after:J0(s,a-1),before:Jn(s,a-1)})),l){if(o&&!s&&(d.disabled.push({before:Jn(o,-l+1)}),d.disabled.push({after:Jn(o,l-1)})),o&&s){var f=Ui(s,o)+1,g=l-f;d.disabled.push({before:J0(o,g)}),d.disabled.push({after:Jn(s,g)})}!o&&s&&(d.disabled.push({before:Jn(s,-l+1)}),d.disabled.push({after:Jn(s,l-1)}))}return _e.jsx(iy.Provider,{value:{selected:r,onDayClick:c,modifiers:d},children:n})}function oy(){var e=m.useContext(iy);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function xp(e){return Array.isArray(e)?MP([],e,!0):e!==void 0?[e]:[]}function uq(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=xp(i)}),t}var Ci;(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"})(Ci||(Ci={}));var dq=Ci.Selected,Eo=Ci.Disabled,fq=Ci.Hidden,hq=Ci.Today,sy=Ci.RangeEnd,ay=Ci.RangeMiddle,ly=Ci.RangeStart,pq=Ci.Outside;function gq(e,t,n){var r,i=(r={},r[dq]=xp(e.selected),r[Eo]=xp(e.disabled),r[fq]=xp(e.hidden),r[hq]=[e.today],r[sy]=[],r[ay]=[],r[ly]=[],r[pq]=[],r);return e.fromDate&&i[Eo].push({before:e.fromDate}),e.toDate&&i[Eo].push({after:e.toDate}),Zu(e)?i[Eo]=i[Eo].concat(t.modifiers[Eo]):Ju(e)&&(i[Eo]=i[Eo].concat(n.modifiers[Eo]),i[ly]=n.modifiers[ly],i[ay]=n.modifiers[ay],i[sy]=n.modifiers[sy]),i}var jP=m.createContext(void 0);function mq(e){var t=Wt(),n=ry(),r=oy(),i=gq(t,n,r),o=uq(t.modifiers),s=Xe(Xe({},i),o);return _e.jsx(jP.Provider,{value:s,children:e.children})}function zP(){var e=m.useContext(jP);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function vq(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function bq(e){return!!(e&&typeof e=="object"&&"from"in e)}function yq(e){return!!(e&&typeof e=="object"&&"after"in e)}function xq(e){return!!(e&&typeof e=="object"&&"before"in e)}function wq(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function _q(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=Ui(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var s=Ui(e,r)>=0&&Ui(i,e)>=0;return s}return i?dr(i,e):r?dr(r,e):!1}function Sq(e){return G0(e)}function Cq(e){return Array.isArray(e)&&e.every(G0)}function Eq(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Sq(n))return dr(e,n);if(Cq(n))return n.includes(e);if(bq(n))return _q(e,n);if(wq(n))return n.dayOfWeek.includes(e.getDay());if(vq(n)){var r=Ui(n.before,e),i=Ui(n.after,e),o=r>0,s=i<0,a=Q0(n.before,n.after);return a?s&&o:o||s}return yq(n)?Ui(e,n.after)>0:xq(n)?Ui(n.before,e)>0:typeof n=="function"?n(e):!1})}function cy(e,t,n){var r=Object.keys(t).reduce(function(o,s){var a=t[s];return Eq(e,a)&&o.push(s),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!Z0(e,n)&&(i.outside=!0),i}function Oq(e,t){for(var n=fr(e[0]),r=Y0(e[e.length-1]),i,o,s=n;s<=r;){var a=cy(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Jn(s,1);continue}if(a.selected)return s;a.today&&!o&&(o=s),i||(i=s),s=Jn(s,1)}return o||i}var Pq=365;function BP(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=i.weekStartsOn,c=i.fromDate,d=i.toDate,f=i.locale,g={day:Jn,week:q0,month:Si,year:gW,startOfWeek:function(x){return i.ISOWeek?wa(x):Wi(x,{locale:f,weekStartsOn:l})},endOfWeek:function(x){return i.ISOWeek?bP(x):K0(x,{locale:f,weekStartsOn:l})}},p=g[n](e,r==="after"?1:-1);r==="before"&&c?p=mW([c,p]):r==="after"&&d&&(p=vW([d,p]));var v=!0;if(o){var b=cy(p,o);v=!b.disabled&&!b.hidden}return v?p:a.count>Pq?a.lastFocused:BP(p,{moveBy:n,direction:r,context:i,modifiers:o,retry:Xe(Xe({},a),{count:a.count+1})})}var VP=m.createContext(void 0);function kq(e){var t=ed(),n=zP(),r=m.useState(),i=r[0],o=r[1],s=m.useState(),a=s[0],l=s[1],c=Oq(t.displayMonths,n),d=i??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(i),o(void 0)},g=function(x){o(x)},p=Wt(),v=function(x,w){if(i){var S=BP(i,{moveBy:x,direction:w,context:p,modifiers:n});dr(i,S)||(t.goToDate(S,i),g(S))}},b={focusedDay:i,focusTarget:d,blur:f,focus:g,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 _e.jsx(VP.Provider,{value:b,children:e.children})}function uy(){var e=m.useContext(VP);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Dq(e,t){var n=zP(),r=cy(e,n,t);return r}var dy=m.createContext(void 0);function Mq(e){if(!bp(e.initialProps)){var t={selected:void 0};return _e.jsx(dy.Provider,{value:t,children:e.children})}return _e.jsx(Tq,{initialProps:e.initialProps,children:e.children})}function Tq(e){var t=e.initialProps,n=e.children,r=function(o,s,a){var l,c,d;if((l=t.onDayClick)===null||l===void 0||l.call(t,o,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,o,s,a);return}(d=t.onSelect)===null||d===void 0||d.call(t,o,o,s,a)},i={selected:t.selected,onDayClick:r};return _e.jsx(dy.Provider,{value:i,children:n})}function HP(){var e=m.useContext(dy);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Aq(e,t){var n=Wt(),r=HP(),i=ry(),o=oy(),s=uy(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,d=s.focusWeekBefore,f=s.blur,g=s.focus,p=s.focusMonthBefore,v=s.focusMonthAfter,b=s.focusYearBefore,x=s.focusYearAfter,w=s.focusStartOfWeek,S=s.focusEndOfWeek,C=function(W){var te,le,A,H;bp(n)?(te=r.onDayClick)===null||te===void 0||te.call(r,e,t,W):Zu(n)?(le=i.onDayClick)===null||le===void 0||le.call(i,e,t,W):Ju(n)?(A=o.onDayClick)===null||A===void 0||A.call(o,e,t,W):(H=n.onDayClick)===null||H===void 0||H.call(n,e,t,W)},P=function(W){var te;g(e),(te=n.onDayFocus)===null||te===void 0||te.call(n,e,t,W)},O=function(W){var te;f(),(te=n.onDayBlur)===null||te===void 0||te.call(n,e,t,W)},k=function(W){var te;(te=n.onDayMouseEnter)===null||te===void 0||te.call(n,e,t,W)},T=function(W){var te;(te=n.onDayMouseLeave)===null||te===void 0||te.call(n,e,t,W)},I=function(W){var te;(te=n.onDayPointerEnter)===null||te===void 0||te.call(n,e,t,W)},F=function(W){var te;(te=n.onDayPointerLeave)===null||te===void 0||te.call(n,e,t,W)},j=function(W){var te;(te=n.onDayTouchCancel)===null||te===void 0||te.call(n,e,t,W)},B=function(W){var te;(te=n.onDayTouchEnd)===null||te===void 0||te.call(n,e,t,W)},V=function(W){var te;(te=n.onDayTouchMove)===null||te===void 0||te.call(n,e,t,W)},q=function(W){var te;(te=n.onDayTouchStart)===null||te===void 0||te.call(n,e,t,W)},J=function(W){var te;(te=n.onDayKeyUp)===null||te===void 0||te.call(n,e,t,W)},$=function(W){var te;switch(W.key){case"ArrowLeft":W.preventDefault(),W.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":W.preventDefault(),W.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":W.preventDefault(),W.stopPropagation(),c();break;case"ArrowUp":W.preventDefault(),W.stopPropagation(),d();break;case"PageUp":W.preventDefault(),W.stopPropagation(),W.shiftKey?b():p();break;case"PageDown":W.preventDefault(),W.stopPropagation(),W.shiftKey?x():v();break;case"Home":W.preventDefault(),W.stopPropagation(),w();break;case"End":W.preventDefault(),W.stopPropagation(),S();break}(te=n.onDayKeyDown)===null||te===void 0||te.call(n,e,t,W)},X={onClick:C,onFocus:P,onBlur:O,onKeyDown:$,onKeyUp:J,onMouseEnter:k,onMouseLeave:T,onPointerEnter:I,onPointerLeave:F,onTouchCancel:j,onTouchEnd:B,onTouchMove:V,onTouchStart:q};return X}function Iq(){var e=Wt(),t=HP(),n=ry(),r=oy(),i=bp(e)?t.selected:Zu(e)?n.selected:Ju(e)?r.selected:void 0;return i}function Nq(e){return Object.values(Ci).includes(e)}function Rq(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(Nq(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function Lq(e,t){var n=Xe({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Xe(Xe({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function Fq(e,t,n){var r,i,o,s=Wt(),a=uy(),l=Dq(e,t),c=Aq(e,l),d=Iq(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var k;l.outside||a.focusedDay&&f&&dr(a.focusedDay,e)&&((k=n.current)===null||k===void 0||k.focus())},[a.focusedDay,e,n,f,l.outside]);var g=Rq(s,l).join(" "),p=Lq(s,l),v=!!(l.outside&&!s.showOutsideDays||l.hidden),b=(o=(i=s.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:iq,x=_e.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),w={style:p,className:g,children:x,role:"gridcell"},S=a.focusTarget&&dr(a.focusTarget,e)&&!l.outside,C=a.focusedDay&&dr(a.focusedDay,e),P=Xe(Xe(Xe({},w),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=C||S?0:-1,r)),c),O={isButton:f,isHidden:v,activeModifiers:l,selectedDays:d,buttonProps:P,divProps:w};return O}function $q(e){var t=m.useRef(null),n=Fq(e.date,e.displayMonth,t);return n.isHidden?_e.jsx("div",{role:"gridcell"}):n.isButton?_e.jsx(yp,Xe({name:"day",ref:t},n.buttonProps)):_e.jsx("div",Xe({},n.divProps))}function jq(e){var t=e.number,n=e.dates,r=Wt(),i=r.onWeekNumberClick,o=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,d=c(Number(t),{locale:a});if(!i)return _e.jsx("span",{className:s.weeknumber,style:o.weeknumber,children:d});var f=l(Number(t),{locale:a}),g=function(p){i(t,n,p)};return _e.jsx(yp,{name:"week-number","aria-label":f,className:s.weeknumber,style:o.weeknumber,onClick:g,children:d})}function zq(e){var t,n,r=Wt(),i=r.styles,o=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:$q,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:jq,d;return s&&(d=_e.jsx("td",{className:o.cell,style:i.cell,children:_e.jsx(c,{number:e.weekNumber,dates:e.dates})})),_e.jsxs("tr",{className:o.row,style:i.row,children:[d,e.dates.map(function(f){return _e.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:_e.jsx(l,{displayMonth:e.displayMonth,date:f})},pU(f))})]})}function WP(e,t,n){for(var r=n!=null&&n.ISOWeek?bP(t):K0(t,n),i=n!=null&&n.ISOWeek?wa(e):Wi(e,n),o=Ui(r,i),s=[],a=0;a<=o;a++)s.push(Jn(i,a));var l=s.reduce(function(c,d){var f=n!=null&&n.ISOWeek?xP(d):_P(d,n),g=c.find(function(p){return p.weekNumber===f});return g?(g.dates.push(d),c):(c.push({weekNumber:f,dates:[d]}),c)},[]);return l}function Bq(e,t){var n=WP(fr(e),Y0(e),t);if(t!=null&&t.useFixedWeeks){var r=mU(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],s=q0(o,6-r),a=WP(q0(o,1),s,t);n.push.apply(n,a)}}return n}function Vq(e){var t,n,r,i=Wt(),o=i.locale,s=i.classNames,a=i.styles,l=i.hideHead,c=i.fixedWeeks,d=i.components,f=i.weekStartsOn,g=i.firstWeekContainsDate,p=i.ISOWeek,v=Bq(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:g}),b=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:rq,x=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:zq,w=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:eq;return _e.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&_e.jsx(b,{}),_e.jsx("tbody",{className:s.tbody,style:a.tbody,children:v.map(function(S){return _e.jsx(x,{displayMonth:e.displayMonth,dates:S.dates,weekNumber:S.weekNumber},S.weekNumber)})}),_e.jsx(w,{displayMonth:e.displayMonth})]})}function Hq(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Wq=Hq()?m.useLayoutEffect:m.useEffect,fy=!1,Uq=0;function UP(){return"react-day-picker-".concat(++Uq)}function qq(e){var t,n=e??(fy?UP():null),r=m.useState(n),i=r[0],o=r[1];return Wq(function(){i===null&&o(UP())},[]),m.useEffect(function(){fy===!1&&(fy=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function Gq(e){var t,n,r=Wt(),i=r.dir,o=r.classNames,s=r.styles,a=r.components,l=ed().displayMonths,c=qq(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[o.month],g=s.month,p=e.displayIndex===0,v=e.displayIndex===l.length-1,b=!p&&!v;i==="rtl"&&(t=[p,v],v=t[0],p=t[1]),p&&(f.push(o.caption_start),g=Xe(Xe({},g),s.caption_start)),v&&(f.push(o.caption_end),g=Xe(Xe({},g),s.caption_end)),b&&(f.push(o.caption_between),g=Xe(Xe({},g),s.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:JU;return _e.jsxs("div",{className:f.join(" "),style:g,children:[_e.jsx(x,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_e.jsx(Vq,{id:d,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function Yq(e){var t=Wt(),n=t.classNames,r=t.styles;return _e.jsx("div",{className:n.months,style:r.months,children:e.children})}function Kq(e){var t,n,r=e.initialProps,i=Wt(),o=uy(),s=ed(),a=m.useState(!1),l=a[0],c=a[1];m.useEffect(function(){i.initialFocus&&o.focusTarget&&(l||(o.focus(o.focusTarget),c(!0)))},[i.initialFocus,l,o.focus,o.focusTarget,o]);var d=[i.classNames.root,i.className];i.numberOfMonths>1&&d.push(i.classNames.multiple_months),i.showWeekNumber&&d.push(i.classNames.with_weeknumber);var f=Xe(Xe({},i.styles.root),i.style),g=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,b){var x;return Xe(Xe({},v),(x={},x[b]=r[b],x))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:Yq;return _e.jsx("div",Xe({className:d.join(" "),style:f,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},g,{children:_e.jsx(p,{children:s.displayMonths.map(function(v,b){return _e.jsx(Gq,{displayIndex:b,displayMonth:v},b)})})}))}function Xq(e){var t=e.children,n=bU(e,["children"]);return _e.jsx(jU,{initialProps:n,children:_e.jsx(KU,{children:_e.jsx(Mq,{initialProps:n,children:_e.jsx(oq,{initialProps:n,children:_e.jsx(lq,{initialProps:n,children:_e.jsx(mq,{children:_e.jsx(kq,{children:t})})})})})})})}function Qq(e){return _e.jsx(Xq,Xe({},e,{children:_e.jsx(Kq,{initialProps:e})}))}function qP({className:e,classNames:t,showOutsideDays:n=!0,...r}){return _.jsx(Qq,{showOutsideDays:n,className:De("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:De(W0({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:De(W0({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...i})=>_.jsx(UV,{...i,className:"h-4 w-4"}),IconRight:({...i})=>_.jsx(MO,{...i,className:"h-4 w-4"})},...r})}qP.displayName="Calendar";let hy=0;function wp(){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:GP()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:GP()),hy++,()=>{hy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),hy--}},[])}function GP(){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 py="focusScope.autoFocusOnMount",gy="focusScope.autoFocusOnUnmount",YP={bubbles:!1,cancelable:!0},_p=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=m.useState(null),c=_n(i),d=_n(o),f=m.useRef(null),g=nt(t,b=>l(b)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let b=function(C){if(p.paused||!a)return;const P=C.target;a.contains(P)?f.current=P:hs(f.current,{select:!0})},x=function(C){if(p.paused||!a)return;const P=C.relatedTarget;P!==null&&(a.contains(P)||hs(f.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const O of C)O.removedNodes.length>0&&hs(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const S=new MutationObserver(w);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),S.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){QP.add(p);const b=document.activeElement;if(!a.contains(b)){const w=new CustomEvent(py,YP);a.addEventListener(py,c),a.dispatchEvent(w),w.defaultPrevented||(Zq(rG(KP(a)),{select:!0}),document.activeElement===b&&hs(a))}return()=>{a.removeEventListener(py,c),setTimeout(()=>{const w=new CustomEvent(gy,YP);a.addEventListener(gy,d),a.dispatchEvent(w),w.defaultPrevented||hs(b??document.body,{select:!0}),a.removeEventListener(gy,d),QP.remove(p)},0)}}},[a,c,d,p]);const v=m.useCallback(b=>{if(!n&&!r||p.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,w=document.activeElement;if(x&&w){const S=b.currentTarget,[C,P]=Jq(S);C&&P?!b.shiftKey&&w===P?(b.preventDefault(),n&&hs(C,{select:!0})):b.shiftKey&&w===C&&(b.preventDefault(),n&&hs(P,{select:!0})):w===S&&b.preventDefault()}},[n,r,p.paused]);return m.createElement(He.div,se({tabIndex:-1},s,{ref:g,onKeyDown:v}))});function Zq(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(hs(r,{select:t}),document.activeElement!==n)return}function Jq(e){const t=KP(e),n=XP(t,e),r=XP(t.reverse(),e);return[n,r]}function KP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function XP(e,t){for(const n of e)if(!eG(n,{upTo:t}))return n}function eG(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 tG(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&&tG(e)&&t&&e.select()}}const QP=nG();function nG(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ZP(e,t),e.unshift(t)},remove(t){var n;e=ZP(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function ZP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rG(e){return e.filter(t=>t.tagName!=="A")}var iG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vl=new WeakMap,Sp=new WeakMap,Cp={},my=0,JP=function(e){return e&&(e.host||JP(e.parentNode))},oG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=JP(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})},sG=function(e,t,n,r){var i=oG(t,Array.isArray(e)?e:[e]);Cp[n]||(Cp[n]=new WeakMap);var o=Cp[n],s=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))d(g);else{var p=g.getAttribute(r),v=p!==null&&p!=="false",b=(Vl.get(g)||0)+1,x=(o.get(g)||0)+1;Vl.set(g,b),o.set(g,x),s.push(g),b===1&&v&&Sp.set(g,!0),x===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}})};return d(t),a.clear(),my++,function(){s.forEach(function(f){var g=Vl.get(f)-1,p=o.get(f)-1;Vl.set(f,g),o.set(f,p),g||(Sp.has(f)||f.removeAttribute(r),Sp.delete(f)),p||f.removeAttribute(n)}),my--,my||(Vl=new WeakMap,Vl=new WeakMap,Sp=new WeakMap,Cp={})}},Ep=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||iG(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),sG(r,i,n,"aria-hidden")):function(){return null}},Gi=function(){return Gi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Gi.apply(this,arguments)};function ek(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function aG(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Op="right-scroll-bar-position",Pp="width-before-scroll-bar",lG="with-scroll-bars-hidden",cG="--removed-body-scroll-bar-size";function uG(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function dG(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function fG(e,t){return dG(t||null,function(n){return e.forEach(function(r){return uG(r,n)})})}function hG(e){return e}function pG(e,t){t===void 0&&(t=hG);var n=[],r=!1,i={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(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var d=s;s=[],d.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),n}}}};return i}function gG(e){e===void 0&&(e={});var t=pG(null);return t.options=Gi({async:!0,ssr:!1},e),t}var tk=function(e){var t=e.sideCar,n=ek(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 de.createElement(r,Gi({},n))};tk.isSideCarExport=!0;function mG(e,t){return e.useMedium(t),tk}var nk=gG(),vy=function(){},kp=de.forwardRef(function(e,t){var n=de.useRef(null),r=de.useState({onScrollCapture:vy,onWheelCapture:vy,onTouchMoveCapture:vy}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,g=e.sideCar,p=e.noIsolation,v=e.inert,b=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=ek(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=g,P=fG([n,t]),O=Gi(Gi({},S),i);return de.createElement(de.Fragment,null,d&&de.createElement(C,{sideCar:nk,removeScrollBar:c,shards:f,noIsolation:p,inert:v,setCallbacks:o,allowPinchZoom:!!b,lockRef:n}),s?de.cloneElement(de.Children.only(a),Gi(Gi({},O),{ref:P})):de.createElement(w,Gi({},O,{className:l,ref:P}),a))});kp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},kp.classNames={fullWidth:Pp,zeroRight:Op};var rk,vG=function(){if(rk)return rk;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=vG();return t&&e.setAttribute("nonce",t),e}function yG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=bG())&&(yG(t,n),xG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_G=function(){var e=wG();return function(t,n){de.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ik=function(){var e=_G(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},SG={left:0,top:0,right:0,gap:0},by=function(e){return parseInt(e||"",10)||0},CG=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[by(n),by(r),by(i)]},EG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return SG;var t=CG(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])}},OG=ik(),PG=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
378
378
  .`.concat(lG,` {
379
379
  overflow: hidden `).concat(r,`;
380
380
  padding-right: `).concat(a,"px ").concat(r,`;
@@ -414,8 +414,8 @@ Check the top-level render call using <`+oe+">.")}return G}}function Ua(D,G){{if
414
414
  `)},kG=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=de.useMemo(function(){return EG(i)},[i]);return de.createElement(OG,{styles:PG(o,!t,i,n?"":"!important")})},yy=!1;if(typeof window<"u")try{var Dp=Object.defineProperty({},"passive",{get:function(){return yy=!0,!0}});window.addEventListener("test",Dp,Dp),window.removeEventListener("test",Dp,Dp)}catch{yy=!1}var Hl=yy?{passive:!1}:!1,DG=function(e){return e.tagName==="TEXTAREA"},ok=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!DG(e)&&n[t]==="visible")},MG=function(e){return ok(e,"overflowY")},TG=function(e){return ok(e,"overflowX")},sk=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=ak(e,n);if(r){var i=lk(e,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},AG=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},IG=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ak=function(e,t){return e==="v"?MG(t):TG(t)},lk=function(e,t){return e==="v"?AG(t):IG(t)},NG=function(e,t){return e==="h"&&t==="rtl"?-1:1},RG=function(e,t,n,r,i){var o=NG(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),c=!1,d=s>0,f=0,g=0;do{var p=lk(e,a),v=p[0],b=p[1],x=p[2],w=b-x-o*v;(v||w)&&ak(e,a)&&(f+=w,g+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(i&&f===0||!i&&s>f)||!d&&(i&&g===0||!i&&-s>g))&&(c=!0),c},Mp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ck=function(e){return[e.deltaX,e.deltaY]},uk=function(e){return e&&"current"in e?e.current:e},LG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},FG=function(e){return`
415
415
  .block-interactivity-`.concat(e,` {pointer-events: none;}
416
416
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
417
- `)},$G=0,Wl=[];function jG(e){var t=de.useRef([]),n=de.useRef([0,0]),r=de.useRef(),i=de.useState($G++)[0],o=de.useState(function(){return ik()})[0],s=de.useRef(e);de.useEffect(function(){s.current=e},[e]),de.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=aG([e.lockRef.current],(e.shards||[]).map(uk),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=de.useCallback(function(b,x){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var w=Mp(b),S=n.current,C="deltaX"in b?b.deltaX:S[0]-w[0],P="deltaY"in b?b.deltaY:S[1]-w[1],O,k=b.target,T=Math.abs(C)>Math.abs(P)?"h":"v";if("touches"in b&&T==="h"&&k.type==="range")return!1;var I=sk(T,k);if(!I)return!0;if(I?O=T:(O=T==="v"?"h":"v",I=sk(T,k)),!I)return!1;if(!r.current&&"changedTouches"in b&&(C||P)&&(r.current=O),!O)return!0;var F=r.current||O;return RG(F,x,b,F==="h"?C:P,!0)},[]),l=de.useCallback(function(b){var x=b;if(!(!Wl.length||Wl[Wl.length-1]!==o)){var w="deltaY"in x?ck(x):Mp(x),S=t.current.filter(function(O){return O.name===x.type&&O.target===x.target&&LG(O.delta,w)})[0];if(S&&S.should){x.cancelable&&x.preventDefault();return}if(!S){var C=(s.current.shards||[]).map(uk).filter(Boolean).filter(function(O){return O.contains(x.target)}),P=C.length>0?a(x,C[0]):!s.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),c=de.useCallback(function(b,x,w,S){var C={name:b,delta:x,target:w,should:S};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(P){return P!==C})},1)},[]),d=de.useCallback(function(b){n.current=Mp(b),r.current=void 0},[]),f=de.useCallback(function(b){c(b.type,ck(b),b.target,a(b,e.lockRef.current))},[]),g=de.useCallback(function(b){c(b.type,Mp(b),b.target,a(b,e.lockRef.current))},[]);de.useEffect(function(){return Wl.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",l,Hl),document.addEventListener("touchmove",l,Hl),document.addEventListener("touchstart",d,Hl),function(){Wl=Wl.filter(function(b){return b!==o}),document.removeEventListener("wheel",l,Hl),document.removeEventListener("touchmove",l,Hl),document.removeEventListener("touchstart",d,Hl)}},[]);var p=e.removeScrollBar,v=e.inert;return de.createElement(de.Fragment,null,v?de.createElement(o,{styles:FG(i)}):null,p?de.createElement(kG,{gapMode:"margin"}):null)}const zG=mG(nk,jG);var dk=de.forwardRef(function(e,t){return de.createElement(kp,Gi({},e,{ref:t,sideCar:zG}))});dk.classNames=kp.classNames;const Tp=dk,fk="Popover",[hk,Efe]=kn(fk,[Bi]),xy=Bi(),[BG,Ul]=hk(fk),VG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=xy(t),l=m.useRef(null),[c,d]=m.useState(!1),[f=!1,g]=Qn({prop:r,defaultProp:i,onChange:o});return m.createElement(Lu,a,m.createElement(BG,{scope:t,contentId:or(),triggerRef:l,open:f,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(p=>!p),[g]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:s},n))},HG="PopoverTrigger",WG=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Ul(HG,n),o=xy(n),s=nt(t,i.triggerRef),a=m.createElement(He.button,se({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":mk(i.open)},r,{ref:s,onClick:Pe(e.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:m.createElement(Fu,se({asChild:!0},o),a)}),pk="PopoverPortal",[UG,qG]=hk(pk,{forceMount:void 0}),GG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=Ul(pk,t);return m.createElement(UG,{scope:t,forceMount:n},m.createElement(yn,{present:n||o.open},m.createElement(Wh,{asChild:!0,container:i},r)))},td="PopoverContent",YG=m.forwardRef((e,t)=>{const n=qG(td,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=Ul(td,e.__scopePopover);return m.createElement(yn,{present:r||o.open},o.modal?m.createElement(KG,se({},i,{ref:t})):m.createElement(XG,se({},i,{ref:t})))}),KG=m.forwardRef((e,t)=>{const n=Ul(td,e.__scopePopover),r=m.useRef(null),i=nt(t,r),o=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return Ep(s)},[]),m.createElement(Tp,{as:oo,allowPinchZoom:!0},m.createElement(gk,se({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),XG=m.forwardRef((e,t)=>{const n=Ul(td,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(gk,se({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),gk=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...f}=e,g=Ul(td,n),p=xy(n);return wp(),m.createElement(_p,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>g.onOpenChange(!1)},m.createElement($u,se({"data-state":mk(g.open),role:"dialog",id:g.contentId},p,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 mk(e){return e?"open":"closed"}const QG=VG,ZG=WG,JG=GG,vk=YG,Ap=QG,Ip=ZG,nd=de.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>_.jsx(JG,{children:_.jsx(vk,{ref:i,align:t,sideOffset:n,className:De("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})}));nd.displayName=vk.displayName;function eY({filter:e,className:t}){const[n,r]=m.useState(!1),[i,o]=m.useState(),[s,a]=m.useState(),l=fe(C=>C.filterValues),c=fe(C=>C.authToken),d=fe(C=>C.actions.addOrUpdateFilterValue),f=fe(C=>C.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:b,refetch:x}=Xr({queryKey:[e.sql],queryFn:()=>ll("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database});m.useEffect(()=>{var C;if(((C=g==null?void 0:g.records)==null?void 0:C.length)>0){const P=g.records[0];if(!P.min||!P.max)return;o({from:new Date(P.min),to:new Date(P.max)}),a({from:new Date(P.min),to:new Date(P.max)})}},[g]),m.useEffect(()=>{if(l&&!l.find(P=>P.filterId===e.id)){o(s);return}},[l,e.id,s]);function w(){f(e.id),o(s),r(!1)}function S(){if(!i)return;console.log(i);const C=[i==null?void 0:i.from,i==null?void 0:i.to];console.log(C);const P={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:gp(e),name:e.column,operation:"between",values:C};d(P),r(!1)}return p?_.jsx("div",{children:_.jsx(Sf,{className:" bg-foreground/10 h-8 w-[250px]"})}):b?_.jsx("div",{className:"bg-muted h-8 w-[250px] px-2",children:"Error"}):g?_.jsx("div",{className:De("grid gap-2",t),children:_.jsxs(Ap,{open:n,onOpenChange:r,children:[_.jsx(Ip,{asChild:!0,children:_.jsxs(it,{size:"sm",id:"date",variant:"outline",className:De("w-[250px] justify-start text-left font-normal rounded-sm h-[34px]",!i&&"text-muted-foreground"),children:[_.jsx(WV,{className:"mr-2 h-4 w-4"}),i!=null&&i.from?i.to?_.jsxs(_.Fragment,{children:[qi(i.from,"LLL dd, y")," -"," ",qi(i.to,"LLL dd, y")]}):qi(i.from,"LLL dd, y"):_.jsx("span",{children:"Pick a date"})]})}),_.jsxs(nd,{className:"w-auto p-0",align:"start",children:[_.jsx(qP,{initialFocus:!0,mode:"range",defaultMonth:i==null?void 0:i.from,selected:i,onSelect:o,numberOfMonths:2}),_.jsxs("div",{className:"flex justify-end px-4 py-3 gap-2",children:[_.jsx(it,{size:"sm",variant:"outline",onClick:S,children:"Apply"}),_.jsx(it,{size:"sm",variant:"outline",onClick:w,children:"Clear"})]})]})]})}):null}function tY(){const e=fe(s=>s.dashboard.filters),t=fe(s=>s.isDashboardEditing),n=fe(s=>s.actions.removeFilter),r=fe(s=>s.actions.updateFilter),i=fe(s=>s.actions.removeFilterValue);if(!e)return null;const o=s=>xa.includes(s.dataType)?_.jsx(eY,{filter:s}):_.jsx(uW,{filter:s});return _.jsx("section",{role:"dashboard-filters",className:" px-[10px] pt-2 grow w-full items-center flex gap-2 flex-wrap ",children:e.map(s=>_.jsxs("div",{children:[_.jsx(ao,{className:" my-1 ",text:s.title||s.column,onSave:a=>r({...s,title:a}),children:_.jsxs("div",{className:"flex items-center justify-between group mb-1",children:[_.jsxs("div",{className:"flex gap-1 items-center ",children:[_.jsx(ni,{className:" inline-block text-sm ",children:s.title}),t&&_.jsx(ca,{onClick:()=>{i(s.id),n(s.id)},className:"w-3 h-3 invisible text-muted-foreground group-hover:visible hover:text-foreground cursor-pointer"})]}),_.jsx("div",{onClick:()=>i(s.id),className:" text-xs invisible group-hover:visible group-hover:underline cursor-pointer text-muted-foreground hover:text-foreground",children:"Clear"})]})}),o(s)]},s.id))})}function bk(){const e=fe(i=>{var o;return(o=i.dashboard)==null?void 0:o.sheets});fe(i=>i.isDashboardEditing);const t=fe(i=>i.themeStyle);fe(i=>i.isVisualEditing);const n=fe(i=>i.selectedSheetId),r=fe(i=>i.actions.setSelectedSheetId);return e?_.jsxs(k_,{role:"dashboard-tabs-container",className:De(" grow ",t==null?void 0:t.dashboardTabsContainer),onValueChange:i=>{r(i)},value:n||e[0].id,children:[_.jsx(tY,{}),e==null?void 0:e.map(i=>_.jsx(Pf,{className:"mt-0",value:i.id,children:_.jsx(TH,{})},i.id))]}):null}function yk({children:e}){const t=new o_;return _.jsx(eR,{client:t,children:e})}function wy({children:e}){return new o_,_.jsx(_R,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:_.jsx(UB,{delayDuration:0,children:_.jsx(yk,{children:e})})})}function xk(e){return _.jsx(HO,{dashboardProps:e,children:_.jsx(wy,{children:_.jsx(m_,{...e,children:_.jsx(bk,{})})})})}var nY=Object.defineProperty,rY=(e,t,n)=>t in e?nY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Np=(e,t,n)=>(rY(e,typeof t!="symbol"?t+"":t,n),n);const iY={stringify:e=>e,parse:e=>e},oY={stringify:e=>`${e}`,parse:e=>parseFloat(e)},sY={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},aY={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}},lY={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},_y={string:iY,number:oY,boolean:sY,function:aY,json:lY},Sy=Symbol.for("r2wc.render"),Rp=Symbol.for("r2wc.connected"),Sa=Symbol.for("r2wc.context"),ps=Symbol.for("r2wc.props");function cY(e,t,n){var r,i,o;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 g=uY(f);l[f]=g,c[g]=f}class d extends HTMLElement{constructor(){super(),Np(this,r,!0),Np(this,i),Np(this,o,{}),Np(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[ps].container=this.container;for(const g of s){const p=l[g],v=this.getAttribute(p),b=a[g],x=_y[b];v&&x!=null&&x.parse&&(this[ps][g]=x.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[Rp]=!0,this[Sy]()}disconnectedCallback(){this[Rp]=!1,this[Sa]&&n.unmount(this[Sa]),delete this[Sa]}attributeChangedCallback(g,p,v){const b=c[g],x=a[b],w=_y[x];b in a&&w!=null&&w.parse&&(this[ps][b]=w.parse(v,this),this[Sy]())}[(r=Rp,i=Sa,o=ps,Sy)](){this[Rp]&&(this[Sa]?n.update(this[Sa],this[ps]):this[Sa]=n.mount(this.container,e,this[ps]))}}for(const f of s){const g=l[f],p=a[f];Object.defineProperty(d.prototype,f,{enumerable:!0,configurable:!0,get(){return this[ps][f]},set(v){this[ps][f]=v;const b=_y[p];if(b!=null&&b.stringify){const x=b.stringify(v);this.getAttribute(g)!==x&&this.setAttribute(g,x)}}})}return d}function uY(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function dY(e,t,n){const r=pf(e),i=m.createElement(t,n);return r.render(i),{root:r,ReactComponent:t}}function fY({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function hY({root:e}){e.unmount()}function pY(e,t={}){return cY(e,t,{mount:dY,update:fY,unmount:hY})}const gY=pY(xk,{props:{id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",style:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function"}}),Cy=["Enter"," "],mY=["ArrowDown","PageUp","Home"],wk=["ArrowUp","PageDown","End"],vY=[...mY,...wk],bY={ltr:[...Cy,"ArrowRight"],rtl:[...Cy,"ArrowLeft"]},yY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Lp="Menu",[rd,xY,wY]=Ef(Lp),[Ca,_k]=kn(Lp,[wY,Bi,fl]),Ey=Bi(),Sk=fl(),[_Y,Ea]=Ca(Lp),[SY,id]=Ca(Lp),CY=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=Ey(t),[l,c]=m.useState(null),d=m.useRef(!1),f=_n(o),g=Hs(i);return m.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Lu,a,m.createElement(_Y,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(SY,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:g,modal:s},r)))},Ck=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Ey(n);return m.createElement(Fu,se({},i,r,{ref:t}))}),Ek="MenuPortal",[EY,Ok]=Ca(Ek,{forceMount:void 0}),OY=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Ea(Ek,t);return m.createElement(EY,{scope:t,forceMount:n},m.createElement(yn,{present:n||o.open},m.createElement(Wh,{asChild:!0,container:i},r)))},Ei="MenuContent",[PY,Oy]=Ca(Ei),kY=m.forwardRef((e,t)=>{const n=Ok(Ei,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Ea(Ei,e.__scopeMenu),s=id(Ei,e.__scopeMenu);return m.createElement(rd.Provider,{scope:e.__scopeMenu},m.createElement(yn,{present:r||o.open},m.createElement(rd.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(DY,se({},i,{ref:t})):m.createElement(MY,se({},i,{ref:t})))))}),DY=m.forwardRef((e,t)=>{const n=Ea(Ei,e.__scopeMenu),r=m.useRef(null),i=nt(t,r);return m.useEffect(()=>{const o=r.current;if(o)return Ep(o)},[]),m.createElement(Py,se({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),MY=m.forwardRef((e,t)=>{const n=Ea(Ei,e.__scopeMenu);return m.createElement(Py,se({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),Py=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:p,disableOutsideScroll:v,...b}=e,x=Ea(Ei,n),w=id(Ei,n),S=Ey(n),C=Sk(n),P=xY(n),[O,k]=m.useState(null),T=m.useRef(null),I=nt(t,T,x.onContentChange),F=m.useRef(0),j=m.useRef(""),B=m.useRef(0),V=m.useRef(null),q=m.useRef("right"),J=m.useRef(0),$=v?Tp:m.Fragment,X=v?{as:oo,allowPinchZoom:!0}:void 0,W=le=>{var A,H;const re=j.current+le,R=P().filter(Q=>!Q.disabled),ue=document.activeElement,xe=(A=R.find(Q=>Q.ref.current===ue))===null||A===void 0?void 0:A.textValue,ge=R.map(Q=>Q.textValue),pe=KY(ge,re,xe),ee=(H=R.find(Q=>Q.textValue===pe))===null||H===void 0?void 0:H.ref.current;(function Q(ie){j.current=ie,window.clearTimeout(F.current),ie!==""&&(F.current=window.setTimeout(()=>Q(""),1e3))})(re),ee&&setTimeout(()=>ee.focus())};m.useEffect(()=>()=>window.clearTimeout(F.current),[]),wp();const ne=m.useCallback(le=>{var A,H;return q.current===((A=V.current)===null||A===void 0?void 0:A.side)&&QY(le,(H=V.current)===null||H===void 0?void 0:H.area)},[]);return m.createElement(PY,{scope:n,searchRef:j,onItemEnter:m.useCallback(le=>{ne(le)&&le.preventDefault()},[ne]),onItemLeave:m.useCallback(le=>{var A;ne(le)||((A=T.current)===null||A===void 0||A.focus(),k(null))},[ne]),onTriggerLeave:m.useCallback(le=>{ne(le)&&le.preventDefault()},[ne]),pointerGraceTimerRef:B,onPointerGraceIntentChange:m.useCallback(le=>{V.current=le},[])},m.createElement($,X,m.createElement(_p,{asChild:!0,trapped:i,onMountAutoFocus:Pe(o,le=>{var A;le.preventDefault(),(A=T.current)===null||A===void 0||A.focus()}),onUnmountAutoFocus:s},m.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:p},m.createElement(qm,se({asChild:!0},C,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:k,onEntryFocus:Pe(l,le=>{w.isUsingKeyboardRef.current||le.preventDefault()})}),m.createElement($u,se({role:"menu","aria-orientation":"vertical","data-state":Ak(x.open),"data-radix-menu-content":"",dir:w.dir},S,b,{ref:I,style:{outline:"none",...b.style},onKeyDown:Pe(b.onKeyDown,le=>{const H=le.target.closest("[data-radix-menu-content]")===le.currentTarget,re=le.ctrlKey||le.altKey||le.metaKey,R=le.key.length===1;H&&(le.key==="Tab"&&le.preventDefault(),!re&&R&&W(le.key));const ue=T.current;if(le.target!==ue||!vY.includes(le.key))return;le.preventDefault();const ge=P().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);wk.includes(le.key)&&ge.reverse(),GY(ge)}),onBlur:Pe(e.onBlur,le=>{le.currentTarget.contains(le.target)||(window.clearTimeout(F.current),j.current="")}),onPointerMove:Pe(e.onPointerMove,od(le=>{const A=le.target,H=J.current!==le.clientX;if(le.currentTarget.contains(A)&&H){const re=le.clientX>J.current?"right":"left";q.current=re,J.current=le.clientX}}))})))))))}),TY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(He.div,se({role:"group"},r,{ref:t}))}),AY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(He.div,se({},r,{ref:t}))}),ky="MenuItem",Pk="menu.itemSelect",Dy=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=m.useRef(null),s=id(ky,e.__scopeMenu),a=Oy(ky,e.__scopeMenu),l=nt(t,o),c=m.useRef(!1),d=()=>{const f=o.current;if(!n&&f){const g=new CustomEvent(Pk,{bubbles:!0,cancelable:!0});f.addEventListener(Pk,p=>r==null?void 0:r(p),{once:!0}),b_(f,g),g.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(kk,se({},i,{ref:l,disabled:n,onClick:Pe(e.onClick,d),onPointerDown:f=>{var g;(g=e.onPointerDown)===null||g===void 0||g.call(e,f),c.current=!0},onPointerUp:Pe(e.onPointerUp,f=>{var g;c.current||(g=f.currentTarget)===null||g===void 0||g.click()}),onKeyDown:Pe(e.onKeyDown,f=>{const g=a.searchRef.current!=="";n||g&&f.key===" "||Cy.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),kk=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=Oy(ky,n),a=Sk(n),l=m.useRef(null),c=nt(t,l),[d,f]=m.useState(!1),[g,p]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var b;p(((b=v.textContent)!==null&&b!==void 0?b:"").trim())}},[o.children]),m.createElement(rd.ItemSlot,{scope:n,disabled:r,textValue:i??g},m.createElement(Gm,se({asChild:!0},a,{focusable:!r}),m.createElement(He.div,se({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:c,onPointerMove:Pe(e.onPointerMove,od(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Pe(e.onPointerLeave,od(v=>s.onItemLeave(v))),onFocus:Pe(e.onFocus,()=>f(!0)),onBlur:Pe(e.onBlur,()=>f(!1))}))))}),IY=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return m.createElement(Mk,{scope:e.__scopeMenu,checked:n},m.createElement(Dy,se({role:"menuitemcheckbox","aria-checked":$p(n)?"mixed":n},i,{ref:t,"data-state":My(n),onSelect:Pe(i.onSelect,()=>r==null?void 0:r($p(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),NY="MenuRadioGroup",[RY,LY]=Ca(NY,{value:void 0,onValueChange:()=>{}}),FY=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=_n(r);return m.createElement(RY,{scope:e.__scopeMenu,value:n,onValueChange:o},m.createElement(TY,se({},i,{ref:t})))}),$Y="MenuRadioItem",jY=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=LY($Y,e.__scopeMenu),o=n===i.value;return m.createElement(Mk,{scope:e.__scopeMenu,checked:o},m.createElement(Dy,se({role:"menuitemradio","aria-checked":o},r,{ref:t,"data-state":My(o),onSelect:Pe(r.onSelect,()=>{var s;return(s=i.onValueChange)===null||s===void 0?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})))}),Dk="MenuItemIndicator",[Mk,zY]=Ca(Dk,{checked:!1}),BY=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=zY(Dk,n);return m.createElement(yn,{present:r||$p(o.checked)||o.checked===!0},m.createElement(He.span,se({},i,{ref:t,"data-state":My(o.checked)})))}),VY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(He.div,se({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),HY="MenuSub",[Pfe,Tk]=Ca(HY),Fp="MenuSubTrigger",WY=m.forwardRef((e,t)=>{const n=Ea(Fp,e.__scopeMenu),r=id(Fp,e.__scopeMenu),i=Tk(Fp,e.__scopeMenu),o=Oy(Fp,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(Ck,se({asChild:!0},c),m.createElement(kk,se({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Ak(n.open)},e,{ref:Cf(t,i.onTriggerChange),onClick:f=>{var g;(g=e.onClick)===null||g===void 0||g.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,od(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Pe(e.onPointerLeave,od(f=>{var g;d();const p=(g=n.content)===null||g===void 0?void 0:g.getBoundingClientRect();if(p){var v;const b=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=b==="right",w=x?-5:5,S=p[x?"left":"right"],C=p[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:S,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:S,y:p.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,f=>{const g=o.searchRef.current!=="";if(!(e.disabled||g&&f.key===" ")&&bY[r.dir].includes(f.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),f.preventDefault()}})})))}),UY="MenuSubContent",qY=m.forwardRef((e,t)=>{const n=Ok(Ei,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Ea(Ei,e.__scopeMenu),s=id(Ei,e.__scopeMenu),a=Tk(UY,e.__scopeMenu),l=m.useRef(null),c=nt(t,l);return m.createElement(rd.Provider,{scope:e.__scopeMenu},m.createElement(yn,{present:r||o.open},m.createElement(rd.Slot,{scope:e.__scopeMenu},m.createElement(Py,se({id:a.contentId,"aria-labelledby":a.triggerId},i,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:Pe(e.onKeyDown,d=>{const f=d.currentTarget.contains(d.target),g=yY[s.dir].includes(d.key);if(f&&g){var p;o.onOpenChange(!1),(p=a.trigger)===null||p===void 0||p.focus(),d.preventDefault()}})})))))});function Ak(e){return e?"open":"closed"}function $p(e){return e==="indeterminate"}function My(e){return $p(e)?"indeterminate":e?"checked":"unchecked"}function GY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function YY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function KY(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=YY(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function XY(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,d=t[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function QY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return XY(n,t)}function od(e){return t=>t.pointerType==="mouse"?e(t):void 0}const ZY=CY,JY=Ck,eK=OY,tK=kY,nK=AY,rK=Dy,iK=IY,oK=FY,sK=jY,aK=BY,lK=VY,cK=WY,uK=qY,Ik="DropdownMenu",[dK,kfe]=kn(Ik,[_k]),Nr=_k(),[fK,Nk]=dK(Ik),hK=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=Nr(t),c=m.useRef(null),[d=!1,f]=Qn({prop:i,defaultProp:o,onChange:s});return m.createElement(fK,{scope:t,triggerId:or(),triggerRef:c,contentId:or(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(g=>!g),[f]),modal:a},m.createElement(ZY,se({},l,{open:d,onOpenChange:f,dir:r,modal:a}),n))},pK="DropdownMenuTrigger",gK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=Nk(pK,n),s=Nr(n);return m.createElement(JY,se({asChild:!0},s),m.createElement(He.button,se({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:Cf(t,o.triggerRef),onPointerDown:Pe(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Pe(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),mK=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Nr(t);return m.createElement(eK,se({},r,n))},vK="DropdownMenuContent",bK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nk(vK,n),o=Nr(n),s=m.useRef(!1);return m.createElement(tK,se({id:i.contentId,"aria-labelledby":i.triggerId},o,r,{ref:t,onCloseAutoFocus:Pe(e.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Pe(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!i.modal||d)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),yK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(nK,se({},i,r,{ref:t}))}),xK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(rK,se({},i,r,{ref:t}))}),wK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(iK,se({},i,r,{ref:t}))}),_K=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(oK,se({},i,r,{ref:t}))}),SK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(sK,se({},i,r,{ref:t}))}),CK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(aK,se({},i,r,{ref:t}))}),EK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(lK,se({},i,r,{ref:t}))}),OK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(cK,se({},i,r,{ref:t}))}),PK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(uK,se({},i,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)"}}))}),kK=hK,DK=gK,MK=mK,Rk=bK,Lk=yK,Fk=xK,$k=wK,TK=_K,jk=SK,zk=CK,Bk=EK,Vk=OK,Hk=PK,Wk=kK,Uk=DK,AK=TK,IK=de.forwardRef(({className:e,inset:t,children:n,...r},i)=>_.jsxs(Vk,{ref:i,className:De("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,_.jsx(MO,{className:"ml-auto h-4 w-4"})]}));IK.displayName=Vk.displayName;const NK=de.forwardRef(({className:e,...t},n)=>_.jsx(Hk,{ref:n,className:De("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}));NK.displayName=Hk.displayName;const Ty=de.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(MK,{children:_.jsx(Rk,{ref:r,sideOffset:t,className:De("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})}));Ty.displayName=Rk.displayName;const jp=de.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(Fk,{ref:r,className:De("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}));jp.displayName=Fk.displayName;const RK=de.forwardRef(({className:e,children:t,checked:n,...r},i)=>_.jsxs($k,{ref:i,className:De("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:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(zk,{children:_.jsx(rp,{className:"h-4 w-4"})})}),t]}));RK.displayName=$k.displayName;const Ay=de.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(jk,{ref:r,className:De("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:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(zk,{children:_.jsx(TO,{className:"h-2 w-2 fill-current"})})}),t]}));Ay.displayName=jk.displayName;const qk=de.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(Lk,{ref:r,className:De("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));qk.displayName=Lk.displayName;const Gk=de.forwardRef(({className:e,...t},n)=>_.jsx(Bk,{ref:n,className:De("-mx-1 my-1 h-px bg-muted",e),...t}));Gk.displayName=Bk.displayName;function LK(){const{setTheme:e}=Bm(),t=fe(n=>n.actions.setDashboardTheme);return _.jsxs(Wk,{children:[_.jsx(Uk,{asChild:!0,children:_.jsxs(it,{className:"h-7 p-2",variant:"outline",size:"sm",children:[_.jsx(rH,{strokeWidth:1.5,className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),_.jsx(QV,{strokeWidth:1.5,className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),_.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),_.jsxs(Ty,{align:"end",children:[_.jsx(jp,{onClick:()=>{e("light"),t("light")},children:"Light"}),_.jsx(jp,{onClick:()=>{e("dark"),t("dark")},children:"Dark"}),_.jsx(jp,{onClick:()=>{e("system"),t("system")},children:"System"})]})]})}function Iy(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(i=>{var o;return{...i,cards:(o=i.cards)==null?void 0:o.map(s=>Yk(s))}})}})}}function Yk(e){var t,n,r,i;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(i=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:i.map(o=>({...o,data:[]}))}},customCfg:FK(e.customCfg),data:[]}}function FK(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 gs(e){return`semaphor:bookmark:${e}`}const Kk="Dialog",[Xk,Dfe]=kn(Kk),[$K,Oi]=Xk(Kk),jK=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,d]=Qn({prop:r,defaultProp:i,onChange:o});return m.createElement($K,{scope:t,triggerRef:a,contentRef:l,contentId:or(),titleId:or(),descriptionId:or(),open:c,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:s},n)},zK="DialogTrigger",BK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Oi(zK,n),o=nt(t,i.triggerRef);return m.createElement(He.button,se({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ry(i.open)},r,{ref:o,onClick:Pe(e.onClick,i.onOpenToggle)}))}),Qk="DialogPortal",[VK,Zk]=Xk(Qk,{forceMount:void 0}),HK=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Oi(Qk,t);return m.createElement(VK,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(yn,{present:n||o.open},m.createElement(Wh,{asChild:!0,container:i},s))))},Ny="DialogOverlay",WK=m.forwardRef((e,t)=>{const n=Zk(Ny,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Oi(Ny,e.__scopeDialog);return o.modal?m.createElement(yn,{present:r||o.open},m.createElement(UK,se({},i,{ref:t}))):null}),UK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Oi(Ny,n);return m.createElement(Tp,{as:oo,allowPinchZoom:!0,shards:[i.contentRef]},m.createElement(He.div,se({"data-state":Ry(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),sd="DialogContent",qK=m.forwardRef((e,t)=>{const n=Zk(sd,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Oi(sd,e.__scopeDialog);return m.createElement(yn,{present:r||o.open},o.modal?m.createElement(GK,se({},i,{ref:t})):m.createElement(YK,se({},i,{ref:t})))}),GK=m.forwardRef((e,t)=>{const n=Oi(sd,e.__scopeDialog),r=m.useRef(null),i=nt(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return Ep(o)},[]),m.createElement(Jk,se({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault())}))}),YK=m.forwardRef((e,t)=>{const n=Oi(sd,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(Jk,se({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),Jk=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=Oi(sd,n),l=m.useRef(null),c=nt(t,l);return wp(),m.createElement(m.Fragment,null,m.createElement(_p,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(Ol,se({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Ry(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),KK="DialogTitle",XK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Oi(KK,n);return m.createElement(He.h2,se({id:i.titleId},r,{ref:t}))}),QK="DialogDescription",ZK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Oi(QK,n);return m.createElement(He.p,se({id:i.descriptionId},r,{ref:t}))}),JK="DialogClose",eX=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Oi(JK,n);return m.createElement(He.button,se({type:"button"},r,{ref:t,onClick:Pe(e.onClick,()=>i.onOpenChange(!1))}))});function Ry(e){return e?"open":"closed"}const tX=jK,nX=BK,rX=HK,eD=WK,tD=qK,nD=XK,rD=ZK,iX=eX,Ly=tX,Fy=nX,oX=rX,iD=de.forwardRef(({className:e,...t},n)=>_.jsx(eD,{ref:n,className:De("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}));iD.displayName=eD.displayName;const zp=de.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(oX,{children:[_.jsx(iD,{}),_.jsxs(tD,{ref:r,className:De("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,_.jsxs(iX,{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:[_.jsx(oH,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zp.displayName=tD.displayName;const Bp=({className:e,...t})=>_.jsx("div",{className:De("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Bp.displayName="DialogHeader";const $y=({className:e,...t})=>_.jsx("div",{className:De("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});$y.displayName="DialogFooter";const Vp=de.forwardRef(({className:e,...t},n)=>_.jsx(nD,{ref:n,className:De("text-lg font-semibold leading-none tracking-tight",e),...t}));Vp.displayName=nD.displayName;const Hp=de.forwardRef(({className:e,...t},n)=>_.jsx(rD,{ref:n,className:De("text-sm text-muted-foreground",e),...t}));Hp.displayName=rD.displayName;const Oo=de.forwardRef(({className:e,type:t,...n},r)=>_.jsx("input",{type:t,className:De("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}));Oo.displayName="Input";function sX(){const[e,t]=m.useState(""),[n,r]=m.useState(!1),[i,o]=m.useState(!1),s=fe(l=>l.dashboard);function a(){const l=Iy(s),c=gs(s.id),d=JSON.parse(localStorage.getItem(c)||"[]");if(d.some(g=>g.name===e)){r(!0);return}d.push({name:e,template:l}),localStorage.setItem(c,JSON.stringify(d)),o(!1)}return _.jsxs(Ly,{open:i,onOpenChange:o,children:[_.jsx(Fy,{asChild:!0,children:_.jsxs(it,{variant:"outline",className:"h-7 p-2",size:"sm",children:[_.jsx(RO,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Lens"]})}),_.jsxs(zp,{className:"sm:max-w-[425px]",children:[_.jsxs(Bp,{children:[_.jsx(Vp,{children:"Add a Lens"}),_.jsx(Hp,{children:"Lenses are private by default and are only visible to you."})]}),_.jsx("div",{className:"grid gap-4 py-4",children:_.jsxs("div",{className:"grid grid-cols-8 items-center gap-4",children:[_.jsx(ni,{className:"text-right",children:"Name"}),_.jsx(Oo,{value:e,onChange:l=>{n&&r(!1),t(l.target.value)},id:"name",className:"col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"})]})}),n&&_.jsx("p",{className:"text-sm",children:"The bookmark name already exists. Use a differnet name."}),_.jsx($y,{children:_.jsx(it,{variant:"outline",type:"submit",disabled:!e,onClick:a,children:"Save"})})]})]})}function aX(){const[e,t]=m.useState(!1),[n,r]=m.useState(""),i=fe(p=>p.dashboard),o=fe(p=>p.bookmarkKey),[s,a]=m.useState([]),l=fe(p=>p.actions.setDashboard),c=fe(p=>p.actions.setFilterValues),d=fe(p=>p.actions.setBookmarkKey);m.useEffect(()=>{const p=gs(i.id),v=JSON.parse(localStorage.getItem(p)||"[]");a(v);const b=v.find(x=>x.default);b&&b.name===o&&r(b.name)},[e,i,o]);function f(p){if(p===n)return;const v=s.find(x=>x.name===p),b=v==null?void 0:v.template;b&&(l(b),c(v.filterValues||[]),d(p==="Original"?"":p)),r(p)}function g(p){const v=gs(i.id),x=JSON.parse(localStorage.getItem(v)||"[]").filter(w=>w.name!==p);localStorage.setItem(v,JSON.stringify(x)),a(x)}return _.jsxs(Wk,{open:e,onOpenChange:t,children:[_.jsx(Uk,{asChild:!0,children:_.jsx(it,{variant:"outline",className:"h-7 p-2",children:_.jsx(KV,{className:"h-4 w-4",strokeWidth:1.5})})}),_.jsxs(Ty,{className:"w-56",children:[_.jsx(qk,{children:"Lenses"}),_.jsx(Gk,{}),_.jsxs(AK,{value:n,onValueChange:f,children:[_.jsx(Ay,{value:"Original",children:"Original"}),s.filter(p=>p.name!="Original").map((p,v)=>_.jsxs(Ay,{className:"xbg-red-100 flex justify-between",value:p.name,defaultChecked:p.name===o,children:[_.jsx("p",{children:p.name}),_.jsx(ca,{onClick:b=>{b.preventDefault(),g(p.name)},className:"h-3 w-3 hover:cursor-pointer",strokeWidth:1.5})]},v))]})]})]})}function Wp(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const oD="Checkbox",[lX,Mfe]=kn(oD),[cX,uX]=lX(oD),dX=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,g]=m.useState(null),p=nt(t,C=>g(C)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[x=!1,w]=Qn({prop:i,defaultProp:o,onChange:c}),S=m.useRef(x);return m.useEffect(()=>{const C=f==null?void 0:f.form;if(C){const P=()=>w(S.current);return C.addEventListener("reset",P),()=>C.removeEventListener("reset",P)}},[f,w]),m.createElement(cX,{scope:n,state:x,disabled:a},m.createElement(He.button,se({type:"button",role:"checkbox","aria-checked":Oa(x)?"mixed":x,"aria-required":s,"data-state":sD(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:p,onKeyDown:Pe(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:Pe(e.onClick,C=>{w(P=>Oa(P)?!0:!P),b&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})})),b&&m.createElement(pX,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),fX="CheckboxIndicator",hX=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=uX(fX,n);return m.createElement(yn,{present:r||Oa(o.state)||o.state===!0},m.createElement(He.span,se({"data-state":sD(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}),pX=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Wp(n),a=Hh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});l.indeterminate=Oa(n),f.call(l,Oa(n)?!1:n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",se({type:"checkbox","aria-hidden":!0,defaultChecked:Oa(n)?!1:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Oa(e){return e==="indeterminate"}function sD(e){return Oa(e)?"indeterminate":e?"checked":"unchecked"}const aD=dX,gX=hX,ad=de.forwardRef(({className:e,...t},n)=>_.jsx(aD,{ref:n,className:De("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:_.jsx(gX,{className:De("flex items-center justify-center text-current"),children:_.jsx(rp,{className:"h-4 w-4"})})}));ad.displayName=aD.displayName;function mX(){const[e,t]=m.useState(!1),n=fe(o=>o.dashboard),r=fe(o=>o.bookmarkKey);m.useEffect(()=>{if(!r){t(!1);return}const o=gs(n.id),a=JSON.parse(localStorage.getItem(o)||"[]").find(l=>l.name===r);t(a?a.default:!1)},[r,n.id]);function i(o){if(t(o),!r)return;const s=gs(n.id),l=JSON.parse(localStorage.getItem(s)||"[]").map(c=>(c.name===r?c.default=o:c.default=!1,c));console.log(l),localStorage.setItem(s,JSON.stringify(l))}return _.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(ad,{checked:e,onCheckedChange:i,id:"terms"}),_.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Set as default"})]})}function vX(){const e=fe(C=>C.bookmarkKey),t=fe(C=>C.dashboard);fe(C=>C.selectedSheetId);const n=fe(C=>C.isDashboardEditing),r=fe(C=>C.filterValues),i=fe(C=>C.isVisualEditing),o=fe(C=>C.showFilters),s=fe(C=>C.showDashboardJSON),a=fe(C=>C.actions.setShowDashboardJSON),l=fe(C=>C.onSaveFunction),c=fe(C=>C.actions.setShowFilters),{addFrame:d,setSelectedFrameId:f}=fe(C=>C.actions),{getSelectedSheet:g,setIsDashboardEditing:p,setSelectedCardId:v}=fe(C=>C.actions),b=g(),x=()=>{if(!n||!b)return;const C={id:qo(),title:"Title",description:"Description",preferences:{filterOnClick:!0},type:"bar",sql:"select COUNT(*) from YOUR_TABLE",data:[]},P={id:qo(),cards:[C],activeCardId:C.id};d(b.id,P),f(P.id)},w=()=>{p(!0)};function S(){if(!e||e==="")return;const C=Iy(t),P=gs(t.id),O=JSON.parse(localStorage.getItem(P)||"[]"),k=O.findIndex(T=>T.name===e);k!==-1?O[k]={name:e,template:C,default:O[k].default,filterValues:r}:O.push({name:e,template:C,filterValues:r}),localStorage.setItem(P,JSON.stringify(O)),l==null||l(C)}return _.jsxs("div",{className:`flex items-center justify-between gap-2
418
- py-2 `,role:"dashboard-controls",children:[!i&&_.jsxs("div",{className:"flex gap-3 items-center",children:[_.jsx(ni,{children:e}),!!e&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:" text-muted-foreground",children:"|"}),_.jsx(mX,{})]})]}),_.jsxs("div",{className:"flex gap-2",children:[n&&!i&&_.jsx(sX,{}),!i&&_.jsx(aX,{}),n&&!i&&_.jsxs(it,{variant:"outline",className:"h-7 p-2",size:"sm",disabled:!n,onClick:x,children:[_.jsx(RO,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Frame"]}),!n&&_.jsx(it,{variant:"outline",className:"h-7 p-2",onClick:w,size:"sm",children:_.jsx(JV,{className:"h-4 w-4",strokeWidth:1.5})}),n&&!i&&_.jsx(it,{variant:"outline",role:"close",className:"h-7 p-2",onClick:()=>p(!1),size:"sm",children:_.jsx(ca,{className:"h-4 w-4",strokeWidth:1.5})}),n&&!i&&_.jsx(it,{className:"h-7 p-2",variant:"outline",onClick:S,size:"sm",children:_.jsx(tH,{className:"h-4 w-4",strokeWidth:1.5})}),!o&&!i&&n&&_.jsx(it,{className:"h-7 p-2",variant:"outline",onClick:()=>c(!0),size:"sm",children:_.jsx(AO,{className:"h-4 w-4",strokeWidth:1.5})}),!i&&n&&_.jsx("div",{className:" flex items-center space-x-2",children:_.jsx(it,{className:"h-7 p-2",onClick:()=>a(!s),size:"sm",variant:"outline",children:_.jsx(GV,{className:"h-4 w-4",strokeWidth:1.5})})}),!i&&_.jsx(LK,{})]})]})}const lD=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{role:"editor-panel",ref:n,className:De("flex grow min-h-[80vh]",e),...t}));lD.displayName="EditorPanel";const cD=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De(" flex flex-col space-y-2 w-[270px]",e),...t}));cD.displayName="EditorAside";const uD=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De(" grow",e),...t}));uD.displayName="EditorMain";const bX=[" ","Enter","ArrowUp","ArrowDown"],yX=[" ","Enter"],Up="Select",[qp,Gp,xX]=Ef(Up),[ql,Tfe]=kn(Up,[xX,Bi]),jy=Bi(),[wX,Pa]=ql(Up),[_X,SX]=ql(Up),CX=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:f,disabled:g,required:p}=e,v=jy(t),[b,x]=m.useState(null),[w,S]=m.useState(null),[C,P]=m.useState(!1),O=Hs(c),[k=!1,T]=Qn({prop:r,defaultProp:i,onChange:o}),[I,F]=Qn({prop:s,defaultProp:a,onChange:l}),j=m.useRef(null),B=b?!!b.closest("form"):!0,[V,q]=m.useState(new Set),J=Array.from(V).map($=>$.props.value).join(";");return m.createElement(Lu,v,m.createElement(wX,{required:p,scope:t,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:P,contentId:or(),value:I,onValueChange:F,open:k,onOpenChange:T,dir:O,triggerPointerDownPosRef:j,disabled:g},m.createElement(qp.Provider,{scope:t},m.createElement(_X,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback($=>{q(X=>new Set(X).add($))},[]),onNativeOptionRemove:m.useCallback($=>{q(X=>{const W=new Set(X);return W.delete($),W})},[])},n)),B?m.createElement(yD,{key:J,"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:I,onChange:$=>F($.target.value),disabled:g},I===void 0?m.createElement("option",{value:""}):null,Array.from(V)):null))},EX="SelectTrigger",OX=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=jy(n),s=Pa(EX,n),a=s.disabled||r,l=nt(t,s.onTriggerChange),c=Gp(n),[d,f,g]=xD(v=>{const b=c().filter(S=>!S.disabled),x=b.find(S=>S.value===s.value),w=wD(b,v,x);w!==void 0&&s.onValueChange(w.value)}),p=()=>{a||(s.onOpenChange(!0),g())};return m.createElement(Fu,se({asChild:!0},o),m.createElement(He.button,se({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":bD(s.value)?"":void 0},i,{ref:l,onClick:Pe(i.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Pe(i.onPointerDown,v=>{const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Pe(i.onKeyDown,v=>{const b=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(b&&v.key===" ")&&bX.includes(v.key)&&(p(),v.preventDefault())})})))}),PX="SelectValue",kX=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=Pa(PX,n),{onValueNodeHasChildrenChange:c}=l,d=o!==void 0,f=nt(t,l.onValueNodeChange);return Vn(()=>{c(d)},[c,d]),m.createElement(He.span,se({},a,{ref:f,style:{pointerEvents:"none"}}),bD(l.value)?m.createElement(m.Fragment,null,s):o)}),DX=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return m.createElement(He.span,se({"aria-hidden":!0},i,{ref:t}),r||"▼")}),MX=e=>m.createElement(Wh,se({asChild:!0},e)),Gl="SelectContent",TX=m.forwardRef((e,t)=>{const n=Pa(Gl,e.__scopeSelect),[r,i]=m.useState();if(Vn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?kt.createPortal(m.createElement(dD,{scope:e.__scopeSelect},m.createElement(qp.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),o):null}return m.createElement(AX,se({},e,{ref:t}))}),Po=10,[dD,ka]=ql(Gl),AX=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:b,avoidCollisions:x,...w}=e,S=Pa(Gl,n),[C,P]=m.useState(null),[O,k]=m.useState(null),T=nt(t,pe=>P(pe)),[I,F]=m.useState(null),[j,B]=m.useState(null),V=Gp(n),[q,J]=m.useState(!1),$=m.useRef(!1);m.useEffect(()=>{if(C)return Ep(C)},[C]),wp();const X=m.useCallback(pe=>{const[ee,...Q]=V().map(te=>te.ref.current),[ie]=Q.slice(-1),we=document.activeElement;for(const te of pe)if(te===we||(te==null||te.scrollIntoView({block:"nearest"}),te===ee&&O&&(O.scrollTop=0),te===ie&&O&&(O.scrollTop=O.scrollHeight),te==null||te.focus(),document.activeElement!==we))return},[V,O]),W=m.useCallback(()=>X([I,C]),[X,I,C]);m.useEffect(()=>{q&&W()},[q,W]);const{onOpenChange:ne,triggerPointerDownPosRef:le}=S;m.useEffect(()=>{if(C){let pe={x:0,y:0};const ee=ie=>{var we,te,Ie,ae;pe={x:Math.abs(Math.round(ie.pageX)-((we=(te=le.current)===null||te===void 0?void 0:te.x)!==null&&we!==void 0?we:0)),y:Math.abs(Math.round(ie.pageY)-((Ie=(ae=le.current)===null||ae===void 0?void 0:ae.y)!==null&&Ie!==void 0?Ie:0))}},Q=ie=>{pe.x<=10&&pe.y<=10?ie.preventDefault():C.contains(ie.target)||ne(!1),document.removeEventListener("pointermove",ee),le.current=null};return le.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",Q,{capture:!0})}}},[C,ne,le]),m.useEffect(()=>{const pe=()=>ne(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[ne]);const[A,H]=xD(pe=>{const ee=V().filter(we=>!we.disabled),Q=ee.find(we=>we.ref.current===document.activeElement),ie=wD(ee,pe,Q);ie&&setTimeout(()=>ie.ref.current.focus())}),re=m.useCallback((pe,ee,Q)=>{const ie=!$.current&&!Q;(S.value!==void 0&&S.value===ee||ie)&&(F(pe),ie&&($.current=!0))},[S.value]),R=m.useCallback(()=>C==null?void 0:C.focus(),[C]),ue=m.useCallback((pe,ee,Q)=>{const ie=!$.current&&!Q;(S.value!==void 0&&S.value===ee||ie)&&B(pe)},[S.value]),xe=r==="popper"?fD:IX,ge=xe===fD?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:b,avoidCollisions:x}:{};return m.createElement(dD,{scope:n,content:C,viewport:O,onViewportChange:k,itemRefCallback:re,selectedItem:I,onItemLeave:R,itemTextRefCallback:ue,focusSelectedItem:W,selectedItemText:j,position:r,isPositioned:q,searchRef:A},m.createElement(Tp,{as:oo,allowPinchZoom:!0},m.createElement(_p,{asChild:!0,trapped:S.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:Pe(i,pe=>{var ee;(ee=S.trigger)===null||ee===void 0||ee.focus({preventScroll:!0}),pe.preventDefault()})},m.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>S.onOpenChange(!1)},m.createElement(xe,se({role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:pe=>pe.preventDefault()},w,ge,{onPlaced:()=>J(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Pe(w.onKeyDown,pe=>{const ee=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!ee&&pe.key.length===1&&H(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let ie=V().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const we=pe.target,te=ie.indexOf(we);ie=ie.slice(te+1)}setTimeout(()=>X(ie)),pe.preventDefault()}})}))))))}),IX=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Pa(Gl,n),s=ka(Gl,n),[a,l]=m.useState(null),[c,d]=m.useState(null),f=nt(t,T=>d(T)),g=Gp(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:w,focusSelectedItem:S}=s,C=m.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&b&&x&&w){const T=o.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),j=w.getBoundingClientRect();if(o.dir!=="rtl"){const we=j.left-I.left,te=F.left-we,Ie=T.left-te,ae=T.width+Ie,Se=Math.max(ae,I.width),We=window.innerWidth-Po,dt=g0(te,[Po,We-Se]);a.style.minWidth=ae+"px",a.style.left=dt+"px"}else{const we=I.right-j.right,te=window.innerWidth-F.right-we,Ie=window.innerWidth-T.right-te,ae=T.width+Ie,Se=Math.max(ae,I.width),We=window.innerWidth-Po,dt=g0(te,[Po,We-Se]);a.style.minWidth=ae+"px",a.style.right=dt+"px"}const B=g(),V=window.innerHeight-Po*2,q=b.scrollHeight,J=window.getComputedStyle(c),$=parseInt(J.borderTopWidth,10),X=parseInt(J.paddingTop,10),W=parseInt(J.borderBottomWidth,10),ne=parseInt(J.paddingBottom,10),le=$+X+q+ne+W,A=Math.min(x.offsetHeight*5,le),H=window.getComputedStyle(b),re=parseInt(H.paddingTop,10),R=parseInt(H.paddingBottom,10),ue=T.top+T.height/2-Po,xe=V-ue,ge=x.offsetHeight/2,pe=x.offsetTop+ge,ee=$+X+pe,Q=le-ee;if(ee<=ue){const we=x===B[B.length-1].ref.current;a.style.bottom="0px";const te=c.clientHeight-b.offsetTop-b.offsetHeight,Ie=Math.max(xe,ge+(we?R:0)+te+W),ae=ee+Ie;a.style.height=ae+"px"}else{const we=x===B[0].ref.current;a.style.top="0px";const Ie=Math.max(ue,$+b.offsetTop+(we?re:0)+ge)+Q;a.style.height=Ie+"px",b.scrollTop=ee-ue+b.offsetTop}a.style.margin=`${Po}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=V+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[g,o.trigger,o.valueNode,a,c,b,x,w,o.dir,r]);Vn(()=>C(),[C]);const[P,O]=m.useState();Vn(()=>{c&&O(window.getComputedStyle(c).zIndex)},[c]);const k=m.useCallback(T=>{T&&v.current===!0&&(C(),S==null||S(),v.current=!1)},[C,S]);return m.createElement(NX,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:k},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P}},m.createElement(He.div,se({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),fD=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Po,...o}=e,s=jy(n);return m.createElement($u,se({},s,o,{ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.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)"}}))}),[NX,zy]=ql(Gl,{}),hD="SelectViewport",RX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ka(hD,n),o=zy(hD,n),s=nt(t,i.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(qp.Slot,{scope:n},m.createElement(He.div,se({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Pe(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&d){const g=Math.abs(a.current-c.scrollTop);if(g>0){const p=window.innerHeight-Po*2,v=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),x=Math.max(v,b);if(x<p){const w=x+g,S=Math.min(p,w),C=w-S;d.style.height=S+"px",d.style.bottom==="0px"&&(c.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),LX="SelectGroup",[FX,$X]=ql(LX),jX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=or();return m.createElement(FX,{scope:n,id:i},m.createElement(He.div,se({role:"group","aria-labelledby":i},r,{ref:t})))}),zX="SelectLabel",BX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=$X(zX,n);return m.createElement(He.div,se({id:i.id},r,{ref:t}))}),By="SelectItem",[VX,pD]=ql(By),HX=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=Pa(By,n),l=ka(By,n),c=a.value===r,[d,f]=m.useState(o??""),[g,p]=m.useState(!1),v=nt(t,w=>{var S;return(S=l.itemRefCallback)===null||S===void 0?void 0:S.call(l,w,r,i)}),b=or(),x=()=>{i||(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(VX,{scope:n,value:r,disabled:i,textId:b,isSelected:c,onItemTextChange:m.useCallback(w=>{f(S=>{var C;return S||((C=w==null?void 0:w.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(qp.ItemSlot,{scope:n,value:r,disabled:i,textValue:d},m.createElement(He.div,se({role:"option","aria-labelledby":b,"data-highlighted":g?"":void 0,"aria-selected":c&&g,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},s,{ref:v,onFocus:Pe(s.onFocus,()=>p(!0)),onBlur:Pe(s.onBlur,()=>p(!1)),onPointerUp:Pe(s.onPointerUp,x),onPointerMove:Pe(s.onPointerMove,w=>{if(i){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}else w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(s.onPointerLeave,w=>{if(w.currentTarget===document.activeElement){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}}),onKeyDown:Pe(s.onKeyDown,w=>{var S;((S=l.searchRef)===null||S===void 0?void 0:S.current)!==""&&w.key===" "||(yX.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})}))))}),Yp="SelectItemText",WX=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=Pa(Yp,n),a=ka(Yp,n),l=pD(Yp,n),c=SX(Yp,n),[d,f]=m.useState(null),g=nt(t,w=>f(w),l.onItemTextChange,w=>{var S;return(S=a.itemTextRefCallback)===null||S===void 0?void 0:S.call(a,w,l.value,l.disabled)}),p=d==null?void 0:d.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=c;return Vn(()=>(b(v),()=>x(v)),[b,x,v]),m.createElement(m.Fragment,null,m.createElement(He.span,se({id:l.textId},o,{ref:g})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?kt.createPortal(o.children,s.valueNode):null)}),UX="SelectItemIndicator",qX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return pD(UX,n).isSelected?m.createElement(He.span,se({"aria-hidden":!0},r,{ref:t})):null}),gD="SelectScrollUpButton",GX=m.forwardRef((e,t)=>{const n=ka(gD,e.__scopeSelect),r=zy(gD,e.__scopeSelect),[i,o]=m.useState(!1),s=nt(t,r.onScrollButtonChange);return Vn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;o(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(vD,se({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),mD="SelectScrollDownButton",YX=m.forwardRef((e,t)=>{const n=ka(mD,e.__scopeSelect),r=zy(mD,e.__scopeSelect),[i,o]=m.useState(!1),s=nt(t,r.onScrollButtonChange);return Vn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<c;o(d)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(vD,se({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),vD=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ka("SelectScrollButton",n),s=m.useRef(null),a=Gp(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),Vn(()=>{var c;const d=a().find(f=>f.ref.current===document.activeElement);d==null||(c=d.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(He.div,se({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Pe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Pe(i.onPointerMove,()=>{var c;(c=o.onItemLeave)===null||c===void 0||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Pe(i.onPointerLeave,()=>{l()})}))}),KX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(He.div,se({"aria-hidden":!0},r,{ref:t}))});function bD(e){return e===""||e===void 0}const yD=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=m.useRef(null),o=nt(t,i),s=Wp(n);return m.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&d){const f=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(Y2,{asChild:!0},m.createElement("select",se({},r,{ref:o,defaultValue:n})))});yD.displayName="BubbleSelect";function xD(e){const t=_n(e),n=m.useRef(""),r=m.useRef(0),i=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]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function wD(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=XX(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function XX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const QX=CX,_D=OX,ZX=kX,JX=DX,eQ=MX,SD=TX,tQ=RX,nQ=jX,CD=BX,ED=HX,rQ=WX,iQ=qX,OD=GX,PD=YX,kD=KX,DD=QX,MD=nQ,TD=ZX,Vy=de.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(_D,{ref:r,className:De("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,_.jsx(JX,{asChild:!0,children:_.jsx(b0,{className:"h-4 w-4 opacity-50"})})]}));Vy.displayName=_D.displayName;const AD=de.forwardRef(({className:e,...t},n)=>_.jsx(OD,{ref:n,className:De("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(qV,{className:"h-4 w-4"})}));AD.displayName=OD.displayName;const ID=de.forwardRef(({className:e,...t},n)=>_.jsx(PD,{ref:n,className:De("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(b0,{className:"h-4 w-4"})}));ID.displayName=PD.displayName;const Hy=de.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>_.jsx(eQ,{children:_.jsxs(SD,{ref:i,className:De("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:[_.jsx(AD,{}),_.jsx(tQ,{className:De("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),_.jsx(ID,{})]})}));Hy.displayName=SD.displayName;const Kp=de.forwardRef(({className:e,...t},n)=>_.jsx(CD,{ref:n,className:De("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Kp.displayName=CD.displayName;const Da=de.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(ED,{ref:r,className:De("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:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(iQ,{children:_.jsx(rp,{className:"h-4 w-4"})})}),_.jsx(rQ,{children:t})]}));Da.displayName=ED.displayName;const oQ=de.forwardRef(({className:e,...t},n)=>_.jsx(kD,{ref:n,className:De("-mx-1 my-1 h-px bg-muted",e),...t}));oQ.displayName=kD.displayName;function ld({title:e,items:t,value:n,isLoading:r,isError:i,onChange:o}){const s=r?"Loading...":i?"Error":n;function a(){if(e==="Connection")return _.jsx(eH,{className:" rotate-90",strokeWidth:1,size:16});if(e==="Database")return _.jsx(YV,{strokeWidth:1,size:16});if(e==="Schema")return _.jsx(ZV,{strokeWidth:1,size:16});if(e==="Table")return _.jsx(y0,{strokeWidth:1,size:16})}return _.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx("div",{className:" shrink-0",children:a()}),_.jsxs(DD,{value:s,onValueChange:o,children:[_.jsx(Vy,{className:"focus:ring-offset-0 focus:ring-1 h-7 w-[190px] ",children:_.jsx(TD,{placeholder:r?"Loading...":i?"Error":`Select ${e}`})}),_.jsx(Hy,{children:_.jsxs(MD,{children:[r?_.jsx(Kp,{children:"Loading..."}):_.jsx(Kp,{children:e}),_.jsx(_.Fragment,{children:t&&t.map(l=>_.jsx(Da,{value:l.id,children:l.name},l.id))}),(r||i)&&_.jsx(Da,{value:s,children:s})]})})]})]})}function sQ({column:e}){const[t,n]=m.useState(!1),r=ve(d=>d.selectedTableName),i=ve(d=>d.selectedSchemaName),o=ve(d=>d.sqlGen),s=ve(d=>d.actions.setSqlGen),a=ve(d=>d.actions.setCardSql),l=ve(d=>d.actions.setRunSql);function c(d,f){const g=H0(d,o,f);s(g);const p=V0(g,_i(i||""),_i(r));p&&(a(p),l(!0)),n(!1)}return _.jsxs(Ap,{open:t,onOpenChange:n,children:[_.jsx(Ip,{asChild:!0,children:_.jsx(pz,{className:"w-3 h-3 text-foreground/40 cursor-pointer"})}),_.jsx(nd,{align:"center",className:" p-0 w-18 rounded-none shadow-none ",children:_.jsxs("ul",{className:"text-xs ",children:[_.jsx("li",{onClick:()=>c(e,"COUNT"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Count"}),_.jsx("li",{onClick:()=>c(e,"AVG"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Avg"}),_.jsx("li",{onClick:()=>c(e,"SUM"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Sum"}),_.jsx("li",{onClick:()=>c(e,"MAX"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Max"}),_.jsx("li",{onClick:()=>c(e,"MIN"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Min"})]})})]})}function ND({column:e}){return _.jsxs(zu,{children:[_.jsx(X2,{asChild:!0,children:Uu.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"T"}):ds.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"#"}):xa.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"D"}):pp.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"B"}):_.jsx("span",{className:" font-thin",children:"?"})}),_.jsx(Tl,{children:_.jsx("p",{className:"text-xs font-mono",children:e.data_type})})]})}function aQ({schemaName:e,tableName:t,columns:n,status:r}){const i=ve(f=>f.sqlGen),o=ve(f=>f.actions.setRunSql),s=ve(f=>f.actions.setSqlGen),a=ve(f=>f.actions.setIsShowingVisual),l=ve(f=>f.actions.setCardSql);function c(f){const g=H0(f,i);s(g);const p=V0(g,_i(e),_i(t));p&&(l(p),o(!0))}function d(){let g=mp(e,t);(v=>v.charAt(0)===v.charAt(0).toUpperCase())(t)&&(g=`"${t}"`),a(!1),l(`SELECT * FROM ${g} LIMIT 10`),o(!0)}return _.jsxs("div",{className:"px-4",children:[_.jsx("div",{className:" font-medium px-2 pt-2 pb-3",children:_.jsxs(it,{disabled:r!=="Success",onClick:d,variant:"secondary",className:" h-7 flex w-full",children:[r!=="Success"&&_.jsx(Nl,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"}),"Show top 10 rows"]})}),_.jsxs(da,{className:`w-full ${t==="api"?"h-[74vh]":"h-[60vh]"}`,children:[n==null?void 0:n.map(f=>_.jsxs("div",{onClick:()=>c(f),className:De(" text-sm flex items-center justify-between px-3 py-[6px] transition-colors hover:bg-muted/50 cursor-pointer rounded ",{" bg-muted":dP(f,i)}),children:[_.jsxs("div",{className:"flex items-center space-x-2 ",children:[_.jsx(ND,{column:f}),_.jsx("span",{children:f.column_name})]}),ds.includes(f.data_type)&&_.jsx("div",{onClick:g=>g.stopPropagation(),className:" flex items-center justify-end ",children:_.jsx(sQ,{column:f})})]},f.column_name)),_.jsx(Il,{orientation:"vertical"}),_.jsx(Il,{orientation:"horizontal"})]})]})}function RD({ColumnsComponent:e}){const t=ve(j=>j.selectedConnectionId),n=ve(j=>j.selectedDatabaseName),r=ve(j=>j.selectedSchemaName),i=ve(j=>j.selectedTableName),o=ve(j=>j.actions.setSelectedTableName),{connectionItems:s,schemaItems:a,databaseItems:l,tableItems:c,columns:d,isConnectionsLoading:f,isConnectionsError:g,isDatabasesLoadingOrFetching:p,isDatabaseError:v,isSchemaLoadingOrFetching:b,isSchemaError:x,isColumnsError:w,isColumnsLoadingOrFetching:S,isAPIConnection:C,handleConnectionChange:P,handleDatabaseChange:O,handleSchemaChange:k,tableName:T,schemaName:I}=d_();function F(){return e?e(I,T,d):_.jsx(aQ,{schemaName:I,tableName:T,columns:d,status:S?"Loading...":w?"Error":"Success"})}return _.jsxs("aside",{className:" grow flex flex-col xbg-red-100 ",children:[_.jsxs("section",{className:"space-y-3 pt-4 pb-3 px-6",children:[_.jsx(ld,{items:s,title:"Connection",value:t||"",onChange:P,isLoading:f,isError:g}),!C&&_.jsxs(_.Fragment,{children:[_.jsx(ld,{onChange:O,isError:v,isLoading:p,items:l,value:n||"",title:"Database"}),_.jsx(ld,{onChange:k,isError:x,isLoading:b,items:a,value:r||"",title:"Schema"}),_.jsx(ld,{onChange:o,isError:v,items:c,isLoading:p,value:i||"",title:"Table"})]})]}),F(),_.jsx("div",{className:" grow justify-end flex flex-col pt-6 "})]})}const{createElement:Yl,createContext:lQ,createRef:Afe,forwardRef:LD,useCallback:Rr,useContext:FD,useEffect:Ma,useImperativeHandle:$D,useLayoutEffect:cQ,useMemo:uQ,useRef:ri,useState:Xp}=de,jD=de.useId,Qp=lQ(null);Qp.displayName="PanelGroupContext";const cd=cQ,dQ=typeof jD=="function"?jD:()=>null;let fQ=0;function Wy(e=null){const t=dQ(),n=ri(e||t||null);return n.current===null&&(n.current=""+fQ++),e??n.current}function zD({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:d,onResize:f,order:g,style:p,tagName:v="div",...b}){const x=FD(Qp);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:S,getPanelSize:C,getPanelStyle:P,groupId:O,isPanelCollapsed:k,registerPanel:T,resizePanel:I,unregisterPanel:F}=x,j=Wy(s),B=ri({callbacks:{onCollapse:c,onExpand:d,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:j,idIsFromProps:s!==void 0,order:g});ri({didLogMissingDefaultSizeWarning:!1}),cd(()=>{const{callbacks:q,constraints:J}=B.current;B.current.id=j,B.current.idIsFromProps=s!==void 0,B.current.order=g,q.onCollapse=c,q.onExpand=d,q.onResize=f,J.collapsedSize=n,J.collapsible=r,J.defaultSize=i,J.maxSize=a,J.minSize=l}),cd(()=>{const q=B.current;return T(q),()=>{F(q)}},[g,j,T,F]),$D(o,()=>({collapse:()=>{w(B.current)},expand:()=>{S(B.current)},getId(){return j},getSize(){return C(B.current)},isCollapsed(){return k(B.current)},isExpanded(){return!k(B.current)},resize:q=>{I(B.current,q)}}),[w,S,C,k,j,I]);const V=P(B.current,i);return Yl(v,{...b,children:e,className:t,style:{...V,...p},"data-panel":"","data-panel-id":j,"data-panel-group-id":O,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const BD=LD((e,t)=>Yl(zD,{...e,forwardedRef:t}));zD.displayName="Panel",BD.displayName="forwardRef(Panel)";function ct(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const VD=10;function ud(e,t,n=VD){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Lr(e,t,n){return ud(e,t,n)===0}function Kl({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];ct(r!=null);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(ud(n,a)<0)if(o){const l=(i+a)/2;ud(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(VD)),n}function dd({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:i}){if(Lr(e,0))return t;const o=[...t],[s,a]=r;ct(s!=null),ct(a!=null);let l=0;if(i==="keyboard"){{const d=e<0?a:s,f=n[d];if(ct(f),f.collapsible){const g=t[d];ct(g!=null);const p=n[d];ct(p);const{collapsedSize:v=0,minSize:b=0}=p;if(Lr(g,v)){const x=b-g;ud(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?s:a,f=n[d];ct(f);const{collapsible:g}=f;if(g){const p=t[d];ct(p!=null);const v=n[d];ct(v);const{collapsedSize:b=0,minSize:x=0}=v;if(Lr(p,x)){const w=p-b;ud(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const d=e<0?1:-1;let f=e<0?a:s,g=0;for(;;){const v=t[f];ct(v!=null);const x=Kl({panelConstraints:n,panelIndex:f,size:100})-v;if(g+=x,f+=d,f<0||f>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-p:p}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(l),p=t[f];ct(p!=null);const v=p-g,b=Kl({panelConstraints:n,panelIndex:f,size:v});if(!Lr(p,b)&&(l+=p-b,o[f]=b,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Lr(l,0))return t;{const d=e<0?a:s,f=t[d];ct(f!=null);const g=f+l,p=Kl({panelConstraints:n,panelIndex:d,size:g});if(o[d]=p,!Lr(p,g)){let v=g-p,x=e<0?a:s;for(;x>=0&&x<n.length;){const w=o[x];ct(w!=null);const S=w+v,C=Kl({panelConstraints:n,panelIndex:x,size:S});if(Lr(w,C)||(v-=C-w,o[x]=C),Lr(v,0))break;e>0?x--:x++}}}const c=o.reduce((d,f)=>f+d,0);return Lr(c,100)?o:t}function hQ({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];ct(a!=null),t.forEach((f,g)=>{const{constraints:p}=f,{maxSize:v=100,minSize:b=0}=p;g===a?(r=b,i=v):(o+=b,s+=v)});const l=Math.min(i,100-o),c=Math.max(r,100-s),d=e[a];return{valueMax:l,valueMin:c,valueNow:d}}function fd(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function HD(e,t){const r=fd(e).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return r??null}function WD(e,t){const n=HD(e,t);return n!=null?[n,n+1]:[-1,-1]}function UD(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function Zp(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function pQ(e,t,n){var r,i,o,s;const a=Zp(t),l=fd(e),c=a?l.indexOf(a):-1,d=(r=(i=n[c])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,f=(o=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&o!==void 0?o:null;return[d,f]}function gQ({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,setLayout:o}){ri({didWarnAboutMissingResizeHandle:!1}),cd(()=>{const s=fd(n);for(let a=0;a<i.length-1;a++){const{valueMax:l,valueMin:c,valueNow:d}=hQ({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const g=i[a];ct(g),f.setAttribute("aria-controls",g.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,i]),Ma(()=>{const s=t.current;ct(s);const{panelDataArray:a}=s,l=UD(n);ct(l!=null,`No group found for id "${n}"`);const c=fd(n);ct(c);const d=c.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");ct(g);const[p,v]=pQ(n,g,a);if(p==null||v==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=a.findIndex(S=>S.id===p);if(w>=0){const S=a[w];ct(S);const C=r[w],{collapsedSize:P=0,collapsible:O,minSize:k=0}=S.constraints;if(C!=null&&O){const T=dd({delta:Lr(C,P)?k-P:P-C,layout:r,panelConstraints:a.map(I=>I.constraints),pivotIndices:WD(n,g),trigger:"keyboard"});r!==T&&o(T)}}break}}};return f.addEventListener("keydown",b),()=>{f.removeEventListener("keydown",b)}});return()=>{d.forEach(f=>f())}},[e,t,n,r,i,o])}function qD(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 GD(e){return e.type==="keydown"}function YD(e){return e.type.startsWith("mouse")}function KD(e){return e.type.startsWith("touch")}function XD(e,t){const n=e==="horizontal";if(YD(t))return n?t.clientX:t.clientY;if(KD(t)){const r=t.touches[0];return ct(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function mQ(e,t,n,r){const i=n==="horizontal",o=Zp(t);ct(o);const s=o.getAttribute("data-panel-group-id");ct(s);let{initialCursorPosition:a}=r;const l=XD(n,e),c=UD(s);ct(c);const d=c.getBoundingClientRect(),f=i?d.width:d.height;return(l-a)/f*100}function vQ(e,t,n,r,i){if(GD(e)){const o=n==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=o?0:s;break;case"ArrowLeft":a=o?-s:0;break;case"ArrowRight":a=o?s:0;break;case"ArrowUp":a=o?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:mQ(e,t,n,r)}function bQ({panelDataArray:e}){const t=Array(e.length),n=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const s=n[o];ct(s);const{defaultSize:a}=s;a!=null&&(r++,t[o]=a,i-=a)}for(let o=0;o<e.length;o++){const s=n[o];ct(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=i/l;r++,t[o]=c,i-=c}return t}function Xl(e,t,n){t.forEach((r,i)=>{const o=e[i];ct(o);const{callbacks:s,constraints:a,id:l}=o,{collapsedSize:c=0,collapsible:d}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:g,onExpand:p,onResize:v}=s;v&&v(r,f),d&&(g||p)&&(p&&(f==null||f===c)&&r!==c&&p(),g&&(f==null||f!==c)&&r===c&&g())}})}function Jp(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 yQ({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:o=3}){const s=n[i];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let Uy=null,Ta=null;function QD(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 xQ(){Ta!==null&&(document.head.removeChild(Ta),Uy=null,Ta=null)}function qy(e){if(Uy===e)return;Uy=e;const t=QD(e);Ta===null&&(Ta=document.createElement("style"),document.head.appendChild(Ta)),Ta.innerHTML=`*{cursor: ${t}!important;}`}function wQ(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function ZD(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function JD(e){return`react-resizable-panels:${e}`}function eM(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function tM(e,t){try{const n=JD(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function _Q(e,t,n){var r,i;const o=(r=tM(e,n))!==null&&r!==void 0?r:{},s=eM(t);return(i=o[s])!==null&&i!==void 0?i:null}function SQ(e,t,n,r,i){var o;const s=JD(e),a=eM(t),l=(o=tM(e,i))!==null&&o!==void 0?o:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function nM({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!Lr(r,100))for(let o=0;o<t.length;o++){const s=n[o];ct(s!=null);const a=100/r*s;n[o]=a}let i=0;for(let o=0;o<t.length;o++){const s=n[o];ct(s!=null);const a=Kl({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!Lr(i,0))for(let o=0;o<t.length;o++){const s=n[o];ct(s!=null);const a=s+i,l=Kl({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,Lr(i,0)))break}return n}const CQ=100,hd={getItem:e=>(ZD(hd),hd.getItem(e)),setItem:(e,t)=>{ZD(hd),hd.setItem(e,t)}},rM={};function iM({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=hd,style:c,tagName:d="div",...f}){const g=Wy(o),[p,v]=Xp(null),[b,x]=Xp([]),w=ri({}),S=ri(new Map),C=ri(0),P=ri({autoSaveId:e,direction:r,dragState:p,id:g,keyboardResizeBy:a,onLayout:s,storage:l}),O=ri({layout:b,panelDataArray:[],panelDataArrayChanged:!1});ri({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),$D(i,()=>({getId:()=>P.current.id,getLayout:()=>{const{layout:A}=O.current;return A},setLayout:A=>{const{onLayout:H}=P.current,{layout:re,panelDataArray:R}=O.current,ue=nM({layout:A,panelConstraints:R.map(xe=>xe.constraints)});qD(re,ue)||(x(ue),O.current.layout=ue,H&&H(ue),Xl(R,ue,w.current))}}),[]),cd(()=>{P.current.autoSaveId=e,P.current.direction=r,P.current.dragState=p,P.current.id=g,P.current.onLayout=s,P.current.storage=l}),gQ({committedValuesRef:P,eagerValuesRef:O,groupId:g,layout:b,panelDataArray:O.current.panelDataArray,setLayout:x}),Ma(()=>{const{panelDataArray:A}=O.current;if(e){if(b.length===0||b.length!==A.length)return;let H=rM[e];H==null&&(H=wQ(SQ,CQ),rM[e]=H);const re=[...A],R=new Map(S.current);H(e,re,R,b,l)}},[e,b,l]),Ma(()=>{});const k=Rr(A=>{const{onLayout:H}=P.current,{layout:re,panelDataArray:R}=O.current;if(A.constraints.collapsible){const ue=R.map(ee=>ee.constraints),{collapsedSize:xe=0,panelSize:ge,pivotIndices:pe}=Zl(R,A,re);if(ct(ge!=null),ge!==xe){S.current.set(A.id,ge);const Q=Ql(R,A)===R.length-1?ge-xe:xe-ge,ie=dd({delta:Q,layout:re,panelConstraints:ue,pivotIndices:pe,trigger:"imperative-api"});Jp(re,ie)||(x(ie),O.current.layout=ie,H&&H(ie),Xl(R,ie,w.current))}}},[]),T=Rr(A=>{const{onLayout:H}=P.current,{layout:re,panelDataArray:R}=O.current;if(A.constraints.collapsible){const ue=R.map(Q=>Q.constraints),{collapsedSize:xe=0,panelSize:ge,minSize:pe=0,pivotIndices:ee}=Zl(R,A,re);if(ge===xe){const Q=S.current.get(A.id),ie=Q!=null&&Q>=pe?Q:pe,te=Ql(R,A)===R.length-1?ge-ie:ie-ge,Ie=dd({delta:te,layout:re,panelConstraints:ue,pivotIndices:ee,trigger:"imperative-api"});Jp(re,Ie)||(x(Ie),O.current.layout=Ie,H&&H(Ie),Xl(R,Ie,w.current))}}},[]),I=Rr(A=>{const{layout:H,panelDataArray:re}=O.current,{panelSize:R}=Zl(re,A,H);return ct(R!=null),R},[]),F=Rr((A,H)=>{const{panelDataArray:re}=O.current,R=Ql(re,A);return yQ({defaultSize:H,dragState:p,layout:b,panelData:re,panelIndex:R})},[p,b]),j=Rr(A=>{const{layout:H,panelDataArray:re}=O.current,{collapsedSize:R=0,collapsible:ue,panelSize:xe}=Zl(re,A,H);return ue===!0&&xe===R},[]),B=Rr(A=>{const{layout:H,panelDataArray:re}=O.current,{collapsedSize:R=0,collapsible:ue,panelSize:xe}=Zl(re,A,H);return ct(xe!=null),!ue||xe>R},[]),V=Rr(A=>{const{panelDataArray:H}=O.current;H.push(A),H.sort((re,R)=>{const ue=re.order,xe=R.order;return ue==null&&xe==null?0:ue==null?-1:xe==null?1:ue-xe}),O.current.panelDataArrayChanged=!0},[]);cd(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:A,onLayout:H,storage:re}=P.current,{layout:R,panelDataArray:ue}=O.current;let xe=null;if(A){const pe=_Q(A,ue,re);pe&&(S.current=new Map(Object.entries(pe.expandToSizes)),xe=pe.layout)}xe==null&&(xe=bQ({panelDataArray:ue}));const ge=nM({layout:xe,panelConstraints:ue.map(pe=>pe.constraints)});qD(R,ge)||(x(ge),O.current.layout=ge,H&&H(ge),Xl(ue,ge,w.current))}});const q=Rr(A=>function(re){re.preventDefault();const{direction:R,dragState:ue,id:xe,keyboardResizeBy:ge,onLayout:pe}=P.current,{layout:ee,panelDataArray:Q}=O.current,{initialLayout:ie}=ue??{},we=WD(xe,A);let te=vQ(re,A,R,ue,ge);if(te===0)return;const Ie=R==="horizontal";document.dir==="rtl"&&Ie&&(te=-te);const ae=Q.map(dt=>dt.constraints),Se=dd({delta:te,layout:ie??ee,panelConstraints:ae,pivotIndices:we,trigger:GD(re)?"keyboard":"mouse-or-touch"}),We=!Jp(ee,Se);(YD(re)||KD(re))&&C.current!=te&&(C.current=te,qy(We?Ie?"horizontal":"vertical":Ie?te<0?"horizontal-min":"horizontal-max":te<0?"vertical-min":"vertical-max")),We&&(x(Se),O.current.layout=Se,pe&&pe(Se),Xl(Q,Se,w.current))},[]),J=Rr((A,H)=>{const{onLayout:re}=P.current,{layout:R,panelDataArray:ue}=O.current,xe=ue.map(we=>we.constraints),{panelSize:ge,pivotIndices:pe}=Zl(ue,A,R);ct(ge!=null);const Q=Ql(ue,A)===ue.length-1?ge-H:H-ge,ie=dd({delta:Q,layout:R,panelConstraints:xe,pivotIndices:pe,trigger:"imperative-api"});Jp(R,ie)||(x(ie),O.current.layout=ie,re&&re(ie),Xl(ue,ie,w.current))},[]),$=Rr((A,H)=>{const{direction:re}=P.current,{layout:R}=O.current,ue=Zp(A);ct(ue);const xe=XD(re,H);v({dragHandleId:A,dragHandleRect:ue.getBoundingClientRect(),initialCursorPosition:xe,initialLayout:R})},[]),X=Rr(()=>{xQ(),v(null)},[]),W=Rr(A=>{const{panelDataArray:H}=O.current,re=Ql(H,A);re>=0&&(H.splice(re,1),delete w.current[A.id],O.current.panelDataArrayChanged=!0)},[]),ne=uQ(()=>({collapsePanel:k,direction:r,dragState:p,expandPanel:T,getPanelSize:I,getPanelStyle:F,groupId:g,isPanelCollapsed:j,isPanelExpanded:B,registerPanel:V,registerResizeHandle:q,resizePanel:J,startDragging:$,stopDragging:X,unregisterPanel:W}),[k,p,r,T,I,F,g,j,B,V,q,J,$,X,W]),le={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Yl(Qp.Provider,{value:ne},Yl(d,{...f,children:t,className:n,style:{...le,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g}))}const oM=LD((e,t)=>Yl(iM,{...e,forwardedRef:t}));iM.displayName="PanelGroup",oM.displayName="forwardRef(PanelGroup)";function Ql(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Zl(e,t,n){const r=e.map(c=>c.constraints),i=Ql(e,t),o=r[i],a=i===e.length-1?[i-1,i]:[i,i+1],l=n[i];return{...o,panelSize:l,pivotIndices:a}}function EQ({disabled:e,handleId:t,resizeHandler:n}){Ma(()=>{if(e||n==null)return;const r=Zp(t);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const s=r.getAttribute("data-panel-group-id");ct(s);const a=fd(s),l=HD(s,t);ct(l!==null);const c=o.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[e,t,n])}function sM({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:i,style:o={},tabIndex:s=0,tagName:a="div",...l}){const c=ri(null),d=ri({onDragging:i});Ma(()=>{d.current.onDragging=i});const f=FD(Qp);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,dragState:p,groupId:v,registerResizeHandle:b,startDragging:x,stopDragging:w}=f,S=Wy(r),C=(p==null?void 0:p.dragHandleId)===S,[P,O]=Xp(!1),[k,T]=Xp(null),I=Rr(()=>{const j=c.current;ct(j),j.blur(),w();const{onDragging:B}=d.current;B&&B(!1)},[w]);Ma(()=>{if(n)T(null);else{const j=b(S);T(()=>j)}},[n,S,b]),Ma(()=>{if(n||k==null||!C)return;const j=J=>{k(J)},B=J=>{k(J)},V=c.current;ct(V);const q=V.ownerDocument;return q.body.addEventListener("contextmenu",I),q.body.addEventListener("mousemove",j),q.body.addEventListener("touchmove",j),q.body.addEventListener("mouseleave",B),window.addEventListener("mouseup",I),window.addEventListener("touchend",I),()=>{q.body.removeEventListener("contextmenu",I),q.body.removeEventListener("mousemove",j),q.body.removeEventListener("touchmove",j),q.body.removeEventListener("mouseleave",B),window.removeEventListener("mouseup",I),window.removeEventListener("touchend",I)}},[g,n,C,k,I]),EQ({disabled:n,handleId:S,resizeHandler:k});const F={cursor:QD(g),touchAction:"none",userSelect:"none"};return Yl(a,{...l,children:e,className:t,onBlur:()=>O(!1),onFocus:()=>O(!0),onMouseDown:j=>{x(S,j.nativeEvent);const B=d.current;ct(B);const{onDragging:V}=B;V&&V(!0)},onMouseUp:I,onTouchCancel:I,onTouchEnd:I,onTouchStart:j=>{x(S,j.nativeEvent);const B=d.current;ct(B);const{onDragging:V}=B;V&&V(!0)},ref:c,role:"separator",style:{...F,...o},tabIndex:s,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":C?"pointer":P?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":S})}sM.displayName="PanelResizeHandle";const aM=({className:e,...t})=>_.jsx(oM,{className:De("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),eg=BD,lM=({withHandle:e,className:t,...n})=>_.jsx(sM,{className:De("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&&_.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:_.jsx(XV,{className:"h-2.5 w-2.5"})})});function OQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cM(Object(n),!0).forEach(function(r){OQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PQ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function kQ(e,t){if(e==null)return{};var n=PQ(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DQ(e,t){return MQ(e)||TQ(e,t)||AQ(e,t)||IQ()}function MQ(e){if(Array.isArray(e))return e}function TQ(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=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){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function AQ(e,t){if(e){if(typeof e=="string")return dM(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 dM(e,t)}}function dM(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 IQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
417
+ `)},$G=0,Wl=[];function jG(e){var t=de.useRef([]),n=de.useRef([0,0]),r=de.useRef(),i=de.useState($G++)[0],o=de.useState(function(){return ik()})[0],s=de.useRef(e);de.useEffect(function(){s.current=e},[e]),de.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=aG([e.lockRef.current],(e.shards||[]).map(uk),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=de.useCallback(function(b,x){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var w=Mp(b),S=n.current,C="deltaX"in b?b.deltaX:S[0]-w[0],P="deltaY"in b?b.deltaY:S[1]-w[1],O,k=b.target,T=Math.abs(C)>Math.abs(P)?"h":"v";if("touches"in b&&T==="h"&&k.type==="range")return!1;var I=sk(T,k);if(!I)return!0;if(I?O=T:(O=T==="v"?"h":"v",I=sk(T,k)),!I)return!1;if(!r.current&&"changedTouches"in b&&(C||P)&&(r.current=O),!O)return!0;var F=r.current||O;return RG(F,x,b,F==="h"?C:P,!0)},[]),l=de.useCallback(function(b){var x=b;if(!(!Wl.length||Wl[Wl.length-1]!==o)){var w="deltaY"in x?ck(x):Mp(x),S=t.current.filter(function(O){return O.name===x.type&&O.target===x.target&&LG(O.delta,w)})[0];if(S&&S.should){x.cancelable&&x.preventDefault();return}if(!S){var C=(s.current.shards||[]).map(uk).filter(Boolean).filter(function(O){return O.contains(x.target)}),P=C.length>0?a(x,C[0]):!s.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),c=de.useCallback(function(b,x,w,S){var C={name:b,delta:x,target:w,should:S};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(P){return P!==C})},1)},[]),d=de.useCallback(function(b){n.current=Mp(b),r.current=void 0},[]),f=de.useCallback(function(b){c(b.type,ck(b),b.target,a(b,e.lockRef.current))},[]),g=de.useCallback(function(b){c(b.type,Mp(b),b.target,a(b,e.lockRef.current))},[]);de.useEffect(function(){return Wl.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",l,Hl),document.addEventListener("touchmove",l,Hl),document.addEventListener("touchstart",d,Hl),function(){Wl=Wl.filter(function(b){return b!==o}),document.removeEventListener("wheel",l,Hl),document.removeEventListener("touchmove",l,Hl),document.removeEventListener("touchstart",d,Hl)}},[]);var p=e.removeScrollBar,v=e.inert;return de.createElement(de.Fragment,null,v?de.createElement(o,{styles:FG(i)}):null,p?de.createElement(kG,{gapMode:"margin"}):null)}const zG=mG(nk,jG);var dk=de.forwardRef(function(e,t){return de.createElement(kp,Gi({},e,{ref:t,sideCar:zG}))});dk.classNames=kp.classNames;const Tp=dk,fk="Popover",[hk,Efe]=kn(fk,[Bi]),xy=Bi(),[BG,Ul]=hk(fk),VG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=xy(t),l=m.useRef(null),[c,d]=m.useState(!1),[f=!1,g]=Qn({prop:r,defaultProp:i,onChange:o});return m.createElement(Lu,a,m.createElement(BG,{scope:t,contentId:or(),triggerRef:l,open:f,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(p=>!p),[g]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:s},n))},HG="PopoverTrigger",WG=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Ul(HG,n),o=xy(n),s=nt(t,i.triggerRef),a=m.createElement(He.button,se({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":mk(i.open)},r,{ref:s,onClick:Pe(e.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:m.createElement(Fu,se({asChild:!0},o),a)}),pk="PopoverPortal",[UG,qG]=hk(pk,{forceMount:void 0}),GG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=Ul(pk,t);return m.createElement(UG,{scope:t,forceMount:n},m.createElement(yn,{present:n||o.open},m.createElement(Wh,{asChild:!0,container:i},r)))},td="PopoverContent",YG=m.forwardRef((e,t)=>{const n=qG(td,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=Ul(td,e.__scopePopover);return m.createElement(yn,{present:r||o.open},o.modal?m.createElement(KG,se({},i,{ref:t})):m.createElement(XG,se({},i,{ref:t})))}),KG=m.forwardRef((e,t)=>{const n=Ul(td,e.__scopePopover),r=m.useRef(null),i=nt(t,r),o=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return Ep(s)},[]),m.createElement(Tp,{as:oo,allowPinchZoom:!0},m.createElement(gk,se({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),XG=m.forwardRef((e,t)=>{const n=Ul(td,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(gk,se({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),gk=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...f}=e,g=Ul(td,n),p=xy(n);return wp(),m.createElement(_p,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>g.onOpenChange(!1)},m.createElement($u,se({"data-state":mk(g.open),role:"dialog",id:g.contentId},p,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 mk(e){return e?"open":"closed"}const QG=VG,ZG=WG,JG=GG,vk=YG,Ap=QG,Ip=ZG,nd=de.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>_.jsx(JG,{children:_.jsx(vk,{ref:i,align:t,sideOffset:n,className:De("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})}));nd.displayName=vk.displayName;function eY({filter:e,className:t}){const[n,r]=m.useState(!1),[i,o]=m.useState(),[s,a]=m.useState(),l=fe(C=>C.filterValues),c=fe(C=>C.authToken),d=fe(C=>C.actions.addOrUpdateFilterValue),f=fe(C=>C.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:b,refetch:x}=Xr({queryKey:[e.sql],queryFn:()=>ll("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database});m.useEffect(()=>{var C;if(((C=g==null?void 0:g.records)==null?void 0:C.length)>0){const P=g.records[0];if(!P.min||!P.max)return;o({from:new Date(P.min),to:new Date(P.max)}),a({from:new Date(P.min),to:new Date(P.max)})}},[g]),m.useEffect(()=>{if(l&&!l.find(P=>P.filterId===e.id)){o(s);return}},[l,e.id,s]);function w(){f(e.id),o(s),r(!1)}function S(){if(!i)return;console.log(i);const C=[i==null?void 0:i.from,i==null?void 0:i.to];console.log(C);const P={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:gp(e),name:e.column,operation:"between",values:C};d(P),r(!1)}return p?_.jsx("div",{children:_.jsx(Sf,{className:" bg-foreground/10 h-8 w-[250px]"})}):b?_.jsx("div",{className:"bg-muted h-8 w-[250px] px-2",children:"Error"}):g?_.jsx("div",{className:De("grid gap-2",t),children:_.jsxs(Ap,{open:n,onOpenChange:r,children:[_.jsx(Ip,{asChild:!0,children:_.jsxs(it,{size:"sm",id:"date",variant:"outline",className:De("w-[250px] justify-start text-left font-normal rounded-sm h-[34px]",!i&&"text-muted-foreground"),children:[_.jsx(WV,{className:"mr-2 h-4 w-4"}),i!=null&&i.from?i.to?_.jsxs(_.Fragment,{children:[qi(i.from,"LLL dd, y")," -"," ",qi(i.to,"LLL dd, y")]}):qi(i.from,"LLL dd, y"):_.jsx("span",{children:"Pick a date"})]})}),_.jsxs(nd,{className:"w-auto p-0",align:"start",children:[_.jsx(qP,{initialFocus:!0,mode:"range",defaultMonth:i==null?void 0:i.from,selected:i,onSelect:o,numberOfMonths:2}),_.jsxs("div",{className:"flex justify-end px-4 py-3 gap-2",children:[_.jsx(it,{size:"sm",variant:"outline",onClick:S,children:"Apply"}),_.jsx(it,{size:"sm",variant:"outline",onClick:w,children:"Clear"})]})]})]})}):null}function tY(){const e=fe(s=>s.dashboard.filters),t=fe(s=>s.isDashboardEditing),n=fe(s=>s.actions.removeFilter),r=fe(s=>s.actions.updateFilter),i=fe(s=>s.actions.removeFilterValue);if(!e)return null;const o=s=>xa.includes(s.dataType)?_.jsx(eY,{filter:s}):_.jsx(uW,{filter:s});return _.jsx("section",{role:"dashboard-filters",className:" px-[10px] pt-2 grow w-full items-center flex gap-2 flex-wrap ",children:e.map(s=>_.jsxs("div",{children:[_.jsx(ao,{className:" my-1 ",text:s.title||s.column,onSave:a=>r({...s,title:a}),children:_.jsxs("div",{className:"flex items-center justify-between group mb-1",children:[_.jsxs("div",{className:"flex gap-1 items-center ",children:[_.jsx(ni,{className:" inline-block text-sm ",children:s.title}),t&&_.jsx(ca,{onClick:()=>{i(s.id),n(s.id)},className:"w-3 h-3 invisible text-muted-foreground group-hover:visible hover:text-foreground cursor-pointer"})]}),_.jsx("div",{onClick:()=>i(s.id),className:" text-xs invisible group-hover:visible group-hover:underline cursor-pointer text-muted-foreground hover:text-foreground",children:"Clear"})]})}),o(s)]},s.id))})}function bk(){const e=fe(i=>{var o;return(o=i.dashboard)==null?void 0:o.sheets});fe(i=>i.isDashboardEditing);const t=fe(i=>i.themeStyle);fe(i=>i.isVisualEditing);const n=fe(i=>i.selectedSheetId),r=fe(i=>i.actions.setSelectedSheetId);return e?_.jsxs(k_,{role:"dashboard-tabs-container",className:De(" grow ",t==null?void 0:t.dashboardTabsContainer),onValueChange:i=>{r(i)},value:n||e[0].id,children:[_.jsx(tY,{}),e==null?void 0:e.map(i=>_.jsx(Pf,{className:"mt-0",value:i.id,children:_.jsx(TH,{})},i.id))]}):null}function yk({children:e}){const t=new o_;return _.jsx(eR,{client:t,children:e})}function wy({children:e}){return new o_,_.jsx(_R,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:_.jsx(UB,{delayDuration:0,children:_.jsx(yk,{children:e})})})}function xk(e){return _.jsx(HO,{dashboardProps:e,children:_.jsx(wy,{children:_.jsx(m_,{...e,children:_.jsx(bk,{})})})})}var nY=Object.defineProperty,rY=(e,t,n)=>t in e?nY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Np=(e,t,n)=>(rY(e,typeof t!="symbol"?t+"":t,n),n);const iY={stringify:e=>e,parse:e=>e},oY={stringify:e=>`${e}`,parse:e=>parseFloat(e)},sY={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},aY={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}},lY={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},_y={string:iY,number:oY,boolean:sY,function:aY,json:lY},Sy=Symbol.for("r2wc.render"),Rp=Symbol.for("r2wc.connected"),Sa=Symbol.for("r2wc.context"),ps=Symbol.for("r2wc.props");function cY(e,t,n){var r,i,o;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 g=uY(f);l[f]=g,c[g]=f}class d extends HTMLElement{constructor(){super(),Np(this,r,!0),Np(this,i),Np(this,o,{}),Np(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[ps].container=this.container;for(const g of s){const p=l[g],v=this.getAttribute(p),b=a[g],x=_y[b];v&&x!=null&&x.parse&&(this[ps][g]=x.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[Rp]=!0,this[Sy]()}disconnectedCallback(){this[Rp]=!1,this[Sa]&&n.unmount(this[Sa]),delete this[Sa]}attributeChangedCallback(g,p,v){const b=c[g],x=a[b],w=_y[x];b in a&&w!=null&&w.parse&&(this[ps][b]=w.parse(v,this),this[Sy]())}[(r=Rp,i=Sa,o=ps,Sy)](){this[Rp]&&(this[Sa]?n.update(this[Sa],this[ps]):this[Sa]=n.mount(this.container,e,this[ps]))}}for(const f of s){const g=l[f],p=a[f];Object.defineProperty(d.prototype,f,{enumerable:!0,configurable:!0,get(){return this[ps][f]},set(v){this[ps][f]=v;const b=_y[p];if(b!=null&&b.stringify){const x=b.stringify(v);this.getAttribute(g)!==x&&this.setAttribute(g,x)}}})}return d}function uY(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function dY(e,t,n){const r=pf(e),i=m.createElement(t,n);return r.render(i),{root:r,ReactComponent:t}}function fY({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function hY({root:e}){e.unmount()}function pY(e,t={}){return cY(e,t,{mount:dY,update:fY,unmount:hY})}const gY=pY(xk,{props:{id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",style:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function"}}),Cy=["Enter"," "],mY=["ArrowDown","PageUp","Home"],wk=["ArrowUp","PageDown","End"],vY=[...mY,...wk],bY={ltr:[...Cy,"ArrowRight"],rtl:[...Cy,"ArrowLeft"]},yY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Lp="Menu",[rd,xY,wY]=Ef(Lp),[Ca,_k]=kn(Lp,[wY,Bi,fl]),Ey=Bi(),Sk=fl(),[_Y,Ea]=Ca(Lp),[SY,id]=Ca(Lp),CY=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=Ey(t),[l,c]=m.useState(null),d=m.useRef(!1),f=_n(o),g=Hs(i);return m.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Lu,a,m.createElement(_Y,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(SY,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:g,modal:s},r)))},Ck=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Ey(n);return m.createElement(Fu,se({},i,r,{ref:t}))}),Ek="MenuPortal",[EY,Ok]=Ca(Ek,{forceMount:void 0}),OY=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Ea(Ek,t);return m.createElement(EY,{scope:t,forceMount:n},m.createElement(yn,{present:n||o.open},m.createElement(Wh,{asChild:!0,container:i},r)))},Ei="MenuContent",[PY,Oy]=Ca(Ei),kY=m.forwardRef((e,t)=>{const n=Ok(Ei,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Ea(Ei,e.__scopeMenu),s=id(Ei,e.__scopeMenu);return m.createElement(rd.Provider,{scope:e.__scopeMenu},m.createElement(yn,{present:r||o.open},m.createElement(rd.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(DY,se({},i,{ref:t})):m.createElement(MY,se({},i,{ref:t})))))}),DY=m.forwardRef((e,t)=>{const n=Ea(Ei,e.__scopeMenu),r=m.useRef(null),i=nt(t,r);return m.useEffect(()=>{const o=r.current;if(o)return Ep(o)},[]),m.createElement(Py,se({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),MY=m.forwardRef((e,t)=>{const n=Ea(Ei,e.__scopeMenu);return m.createElement(Py,se({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),Py=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:p,disableOutsideScroll:v,...b}=e,x=Ea(Ei,n),w=id(Ei,n),S=Ey(n),C=Sk(n),P=xY(n),[O,k]=m.useState(null),T=m.useRef(null),I=nt(t,T,x.onContentChange),F=m.useRef(0),j=m.useRef(""),B=m.useRef(0),V=m.useRef(null),q=m.useRef("right"),J=m.useRef(0),$=v?Tp:m.Fragment,X=v?{as:oo,allowPinchZoom:!0}:void 0,W=le=>{var A,H;const ne=j.current+le,R=P().filter(Q=>!Q.disabled),ue=document.activeElement,xe=(A=R.find(Q=>Q.ref.current===ue))===null||A===void 0?void 0:A.textValue,ge=R.map(Q=>Q.textValue),pe=KY(ge,ne,xe),ee=(H=R.find(Q=>Q.textValue===pe))===null||H===void 0?void 0:H.ref.current;(function Q(ie){j.current=ie,window.clearTimeout(F.current),ie!==""&&(F.current=window.setTimeout(()=>Q(""),1e3))})(ne),ee&&setTimeout(()=>ee.focus())};m.useEffect(()=>()=>window.clearTimeout(F.current),[]),wp();const te=m.useCallback(le=>{var A,H;return q.current===((A=V.current)===null||A===void 0?void 0:A.side)&&QY(le,(H=V.current)===null||H===void 0?void 0:H.area)},[]);return m.createElement(PY,{scope:n,searchRef:j,onItemEnter:m.useCallback(le=>{te(le)&&le.preventDefault()},[te]),onItemLeave:m.useCallback(le=>{var A;te(le)||((A=T.current)===null||A===void 0||A.focus(),k(null))},[te]),onTriggerLeave:m.useCallback(le=>{te(le)&&le.preventDefault()},[te]),pointerGraceTimerRef:B,onPointerGraceIntentChange:m.useCallback(le=>{V.current=le},[])},m.createElement($,X,m.createElement(_p,{asChild:!0,trapped:i,onMountAutoFocus:Pe(o,le=>{var A;le.preventDefault(),(A=T.current)===null||A===void 0||A.focus()}),onUnmountAutoFocus:s},m.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:p},m.createElement(qm,se({asChild:!0},C,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:k,onEntryFocus:Pe(l,le=>{w.isUsingKeyboardRef.current||le.preventDefault()})}),m.createElement($u,se({role:"menu","aria-orientation":"vertical","data-state":Ak(x.open),"data-radix-menu-content":"",dir:w.dir},S,b,{ref:I,style:{outline:"none",...b.style},onKeyDown:Pe(b.onKeyDown,le=>{const H=le.target.closest("[data-radix-menu-content]")===le.currentTarget,ne=le.ctrlKey||le.altKey||le.metaKey,R=le.key.length===1;H&&(le.key==="Tab"&&le.preventDefault(),!ne&&R&&W(le.key));const ue=T.current;if(le.target!==ue||!vY.includes(le.key))return;le.preventDefault();const ge=P().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);wk.includes(le.key)&&ge.reverse(),GY(ge)}),onBlur:Pe(e.onBlur,le=>{le.currentTarget.contains(le.target)||(window.clearTimeout(F.current),j.current="")}),onPointerMove:Pe(e.onPointerMove,od(le=>{const A=le.target,H=J.current!==le.clientX;if(le.currentTarget.contains(A)&&H){const ne=le.clientX>J.current?"right":"left";q.current=ne,J.current=le.clientX}}))})))))))}),TY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(He.div,se({role:"group"},r,{ref:t}))}),AY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(He.div,se({},r,{ref:t}))}),ky="MenuItem",Pk="menu.itemSelect",Dy=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=m.useRef(null),s=id(ky,e.__scopeMenu),a=Oy(ky,e.__scopeMenu),l=nt(t,o),c=m.useRef(!1),d=()=>{const f=o.current;if(!n&&f){const g=new CustomEvent(Pk,{bubbles:!0,cancelable:!0});f.addEventListener(Pk,p=>r==null?void 0:r(p),{once:!0}),b_(f,g),g.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(kk,se({},i,{ref:l,disabled:n,onClick:Pe(e.onClick,d),onPointerDown:f=>{var g;(g=e.onPointerDown)===null||g===void 0||g.call(e,f),c.current=!0},onPointerUp:Pe(e.onPointerUp,f=>{var g;c.current||(g=f.currentTarget)===null||g===void 0||g.click()}),onKeyDown:Pe(e.onKeyDown,f=>{const g=a.searchRef.current!=="";n||g&&f.key===" "||Cy.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),kk=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=Oy(ky,n),a=Sk(n),l=m.useRef(null),c=nt(t,l),[d,f]=m.useState(!1),[g,p]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var b;p(((b=v.textContent)!==null&&b!==void 0?b:"").trim())}},[o.children]),m.createElement(rd.ItemSlot,{scope:n,disabled:r,textValue:i??g},m.createElement(Gm,se({asChild:!0},a,{focusable:!r}),m.createElement(He.div,se({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:c,onPointerMove:Pe(e.onPointerMove,od(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Pe(e.onPointerLeave,od(v=>s.onItemLeave(v))),onFocus:Pe(e.onFocus,()=>f(!0)),onBlur:Pe(e.onBlur,()=>f(!1))}))))}),IY=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return m.createElement(Mk,{scope:e.__scopeMenu,checked:n},m.createElement(Dy,se({role:"menuitemcheckbox","aria-checked":$p(n)?"mixed":n},i,{ref:t,"data-state":My(n),onSelect:Pe(i.onSelect,()=>r==null?void 0:r($p(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),NY="MenuRadioGroup",[RY,LY]=Ca(NY,{value:void 0,onValueChange:()=>{}}),FY=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=_n(r);return m.createElement(RY,{scope:e.__scopeMenu,value:n,onValueChange:o},m.createElement(TY,se({},i,{ref:t})))}),$Y="MenuRadioItem",jY=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=LY($Y,e.__scopeMenu),o=n===i.value;return m.createElement(Mk,{scope:e.__scopeMenu,checked:o},m.createElement(Dy,se({role:"menuitemradio","aria-checked":o},r,{ref:t,"data-state":My(o),onSelect:Pe(r.onSelect,()=>{var s;return(s=i.onValueChange)===null||s===void 0?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})))}),Dk="MenuItemIndicator",[Mk,zY]=Ca(Dk,{checked:!1}),BY=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=zY(Dk,n);return m.createElement(yn,{present:r||$p(o.checked)||o.checked===!0},m.createElement(He.span,se({},i,{ref:t,"data-state":My(o.checked)})))}),VY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(He.div,se({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),HY="MenuSub",[Pfe,Tk]=Ca(HY),Fp="MenuSubTrigger",WY=m.forwardRef((e,t)=>{const n=Ea(Fp,e.__scopeMenu),r=id(Fp,e.__scopeMenu),i=Tk(Fp,e.__scopeMenu),o=Oy(Fp,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(Ck,se({asChild:!0},c),m.createElement(kk,se({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Ak(n.open)},e,{ref:Cf(t,i.onTriggerChange),onClick:f=>{var g;(g=e.onClick)===null||g===void 0||g.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,od(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Pe(e.onPointerLeave,od(f=>{var g;d();const p=(g=n.content)===null||g===void 0?void 0:g.getBoundingClientRect();if(p){var v;const b=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=b==="right",w=x?-5:5,S=p[x?"left":"right"],C=p[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:S,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:S,y:p.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,f=>{const g=o.searchRef.current!=="";if(!(e.disabled||g&&f.key===" ")&&bY[r.dir].includes(f.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),f.preventDefault()}})})))}),UY="MenuSubContent",qY=m.forwardRef((e,t)=>{const n=Ok(Ei,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Ea(Ei,e.__scopeMenu),s=id(Ei,e.__scopeMenu),a=Tk(UY,e.__scopeMenu),l=m.useRef(null),c=nt(t,l);return m.createElement(rd.Provider,{scope:e.__scopeMenu},m.createElement(yn,{present:r||o.open},m.createElement(rd.Slot,{scope:e.__scopeMenu},m.createElement(Py,se({id:a.contentId,"aria-labelledby":a.triggerId},i,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:Pe(e.onKeyDown,d=>{const f=d.currentTarget.contains(d.target),g=yY[s.dir].includes(d.key);if(f&&g){var p;o.onOpenChange(!1),(p=a.trigger)===null||p===void 0||p.focus(),d.preventDefault()}})})))))});function Ak(e){return e?"open":"closed"}function $p(e){return e==="indeterminate"}function My(e){return $p(e)?"indeterminate":e?"checked":"unchecked"}function GY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function YY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function KY(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=YY(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function XY(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,d=t[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function QY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return XY(n,t)}function od(e){return t=>t.pointerType==="mouse"?e(t):void 0}const ZY=CY,JY=Ck,eK=OY,tK=kY,nK=AY,rK=Dy,iK=IY,oK=FY,sK=jY,aK=BY,lK=VY,cK=WY,uK=qY,Ik="DropdownMenu",[dK,kfe]=kn(Ik,[_k]),Nr=_k(),[fK,Nk]=dK(Ik),hK=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=Nr(t),c=m.useRef(null),[d=!1,f]=Qn({prop:i,defaultProp:o,onChange:s});return m.createElement(fK,{scope:t,triggerId:or(),triggerRef:c,contentId:or(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(g=>!g),[f]),modal:a},m.createElement(ZY,se({},l,{open:d,onOpenChange:f,dir:r,modal:a}),n))},pK="DropdownMenuTrigger",gK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=Nk(pK,n),s=Nr(n);return m.createElement(JY,se({asChild:!0},s),m.createElement(He.button,se({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:Cf(t,o.triggerRef),onPointerDown:Pe(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Pe(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),mK=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Nr(t);return m.createElement(eK,se({},r,n))},vK="DropdownMenuContent",bK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nk(vK,n),o=Nr(n),s=m.useRef(!1);return m.createElement(tK,se({id:i.contentId,"aria-labelledby":i.triggerId},o,r,{ref:t,onCloseAutoFocus:Pe(e.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Pe(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!i.modal||d)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),yK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(nK,se({},i,r,{ref:t}))}),xK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(rK,se({},i,r,{ref:t}))}),wK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(iK,se({},i,r,{ref:t}))}),_K=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(oK,se({},i,r,{ref:t}))}),SK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(sK,se({},i,r,{ref:t}))}),CK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(aK,se({},i,r,{ref:t}))}),EK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(lK,se({},i,r,{ref:t}))}),OK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(cK,se({},i,r,{ref:t}))}),PK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(uK,se({},i,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)"}}))}),kK=hK,DK=gK,MK=mK,Rk=bK,Lk=yK,Fk=xK,$k=wK,TK=_K,jk=SK,zk=CK,Bk=EK,Vk=OK,Hk=PK,Wk=kK,Uk=DK,AK=TK,IK=de.forwardRef(({className:e,inset:t,children:n,...r},i)=>_.jsxs(Vk,{ref:i,className:De("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,_.jsx(MO,{className:"ml-auto h-4 w-4"})]}));IK.displayName=Vk.displayName;const NK=de.forwardRef(({className:e,...t},n)=>_.jsx(Hk,{ref:n,className:De("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}));NK.displayName=Hk.displayName;const Ty=de.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(MK,{children:_.jsx(Rk,{ref:r,sideOffset:t,className:De("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})}));Ty.displayName=Rk.displayName;const jp=de.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(Fk,{ref:r,className:De("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}));jp.displayName=Fk.displayName;const RK=de.forwardRef(({className:e,children:t,checked:n,...r},i)=>_.jsxs($k,{ref:i,className:De("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:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(zk,{children:_.jsx(rp,{className:"h-4 w-4"})})}),t]}));RK.displayName=$k.displayName;const Ay=de.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(jk,{ref:r,className:De("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:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(zk,{children:_.jsx(TO,{className:"h-2 w-2 fill-current"})})}),t]}));Ay.displayName=jk.displayName;const qk=de.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(Lk,{ref:r,className:De("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));qk.displayName=Lk.displayName;const Gk=de.forwardRef(({className:e,...t},n)=>_.jsx(Bk,{ref:n,className:De("-mx-1 my-1 h-px bg-muted",e),...t}));Gk.displayName=Bk.displayName;function LK(){const{setTheme:e}=Bm(),t=fe(n=>n.actions.setDashboardTheme);return _.jsxs(Wk,{children:[_.jsx(Uk,{asChild:!0,children:_.jsxs(it,{className:"h-7 p-2",variant:"outline",size:"sm",children:[_.jsx(rH,{strokeWidth:1.5,className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),_.jsx(QV,{strokeWidth:1.5,className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),_.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),_.jsxs(Ty,{align:"end",children:[_.jsx(jp,{onClick:()=>{e("light"),t("light")},children:"Light"}),_.jsx(jp,{onClick:()=>{e("dark"),t("dark")},children:"Dark"}),_.jsx(jp,{onClick:()=>{e("system"),t("system")},children:"System"})]})]})}function Iy(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(i=>{var o;return{...i,cards:(o=i.cards)==null?void 0:o.map(s=>Yk(s))}})}})}}function Yk(e){var t,n,r,i;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(i=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:i.map(o=>({...o,data:[]}))}},customCfg:FK(e.customCfg),data:[]}}function FK(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 gs(e){return`semaphor:bookmark:${e}`}const Kk="Dialog",[Xk,Dfe]=kn(Kk),[$K,Oi]=Xk(Kk),jK=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,d]=Qn({prop:r,defaultProp:i,onChange:o});return m.createElement($K,{scope:t,triggerRef:a,contentRef:l,contentId:or(),titleId:or(),descriptionId:or(),open:c,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:s},n)},zK="DialogTrigger",BK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Oi(zK,n),o=nt(t,i.triggerRef);return m.createElement(He.button,se({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ry(i.open)},r,{ref:o,onClick:Pe(e.onClick,i.onOpenToggle)}))}),Qk="DialogPortal",[VK,Zk]=Xk(Qk,{forceMount:void 0}),HK=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Oi(Qk,t);return m.createElement(VK,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(yn,{present:n||o.open},m.createElement(Wh,{asChild:!0,container:i},s))))},Ny="DialogOverlay",WK=m.forwardRef((e,t)=>{const n=Zk(Ny,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Oi(Ny,e.__scopeDialog);return o.modal?m.createElement(yn,{present:r||o.open},m.createElement(UK,se({},i,{ref:t}))):null}),UK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Oi(Ny,n);return m.createElement(Tp,{as:oo,allowPinchZoom:!0,shards:[i.contentRef]},m.createElement(He.div,se({"data-state":Ry(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),sd="DialogContent",qK=m.forwardRef((e,t)=>{const n=Zk(sd,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Oi(sd,e.__scopeDialog);return m.createElement(yn,{present:r||o.open},o.modal?m.createElement(GK,se({},i,{ref:t})):m.createElement(YK,se({},i,{ref:t})))}),GK=m.forwardRef((e,t)=>{const n=Oi(sd,e.__scopeDialog),r=m.useRef(null),i=nt(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return Ep(o)},[]),m.createElement(Jk,se({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault())}))}),YK=m.forwardRef((e,t)=>{const n=Oi(sd,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(Jk,se({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),Jk=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=Oi(sd,n),l=m.useRef(null),c=nt(t,l);return wp(),m.createElement(m.Fragment,null,m.createElement(_p,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(Ol,se({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Ry(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),KK="DialogTitle",XK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Oi(KK,n);return m.createElement(He.h2,se({id:i.titleId},r,{ref:t}))}),QK="DialogDescription",ZK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Oi(QK,n);return m.createElement(He.p,se({id:i.descriptionId},r,{ref:t}))}),JK="DialogClose",eX=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Oi(JK,n);return m.createElement(He.button,se({type:"button"},r,{ref:t,onClick:Pe(e.onClick,()=>i.onOpenChange(!1))}))});function Ry(e){return e?"open":"closed"}const tX=jK,nX=BK,rX=HK,eD=WK,tD=qK,nD=XK,rD=ZK,iX=eX,Ly=tX,Fy=nX,oX=rX,iD=de.forwardRef(({className:e,...t},n)=>_.jsx(eD,{ref:n,className:De("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}));iD.displayName=eD.displayName;const zp=de.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(oX,{children:[_.jsx(iD,{}),_.jsxs(tD,{ref:r,className:De("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,_.jsxs(iX,{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:[_.jsx(oH,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zp.displayName=tD.displayName;const Bp=({className:e,...t})=>_.jsx("div",{className:De("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Bp.displayName="DialogHeader";const $y=({className:e,...t})=>_.jsx("div",{className:De("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});$y.displayName="DialogFooter";const Vp=de.forwardRef(({className:e,...t},n)=>_.jsx(nD,{ref:n,className:De("text-lg font-semibold leading-none tracking-tight",e),...t}));Vp.displayName=nD.displayName;const Hp=de.forwardRef(({className:e,...t},n)=>_.jsx(rD,{ref:n,className:De("text-sm text-muted-foreground",e),...t}));Hp.displayName=rD.displayName;const Oo=de.forwardRef(({className:e,type:t,...n},r)=>_.jsx("input",{type:t,className:De("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}));Oo.displayName="Input";function sX(){const[e,t]=m.useState(""),[n,r]=m.useState(!1),[i,o]=m.useState(!1),s=fe(l=>l.dashboard);function a(){const l=Iy(s),c=gs(s.id),d=JSON.parse(localStorage.getItem(c)||"[]");if(d.some(g=>g.name===e)){r(!0);return}d.push({name:e,template:l}),localStorage.setItem(c,JSON.stringify(d)),o(!1)}return _.jsxs(Ly,{open:i,onOpenChange:o,children:[_.jsx(Fy,{asChild:!0,children:_.jsxs(it,{variant:"outline",className:"h-7 p-2",size:"sm",children:[_.jsx(RO,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Lens"]})}),_.jsxs(zp,{className:"sm:max-w-[425px]",children:[_.jsxs(Bp,{children:[_.jsx(Vp,{children:"Add a Lens"}),_.jsx(Hp,{children:"Lenses are private by default and are only visible to you."})]}),_.jsx("div",{className:"grid gap-4 py-4",children:_.jsxs("div",{className:"grid grid-cols-8 items-center gap-4",children:[_.jsx(ni,{className:"text-right",children:"Name"}),_.jsx(Oo,{value:e,onChange:l=>{n&&r(!1),t(l.target.value)},id:"name",className:"col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"})]})}),n&&_.jsx("p",{className:"text-sm",children:"The bookmark name already exists. Use a differnet name."}),_.jsx($y,{children:_.jsx(it,{variant:"outline",type:"submit",disabled:!e,onClick:a,children:"Save"})})]})]})}function aX(){const[e,t]=m.useState(!1),[n,r]=m.useState(""),i=fe(p=>p.dashboard),o=fe(p=>p.bookmarkKey),[s,a]=m.useState([]),l=fe(p=>p.actions.setDashboard),c=fe(p=>p.actions.setFilterValues),d=fe(p=>p.actions.setBookmarkKey);m.useEffect(()=>{const p=gs(i.id),v=JSON.parse(localStorage.getItem(p)||"[]");a(v);const b=v.find(x=>x.default);b&&b.name===o&&r(b.name)},[e,i,o]);function f(p){if(p===n)return;const v=s.find(x=>x.name===p),b=v==null?void 0:v.template;b&&(l(b),c(v.filterValues||[]),d(p==="Original"?"":p)),r(p)}function g(p){const v=gs(i.id),x=JSON.parse(localStorage.getItem(v)||"[]").filter(w=>w.name!==p);localStorage.setItem(v,JSON.stringify(x)),a(x)}return _.jsxs(Wk,{open:e,onOpenChange:t,children:[_.jsx(Uk,{asChild:!0,children:_.jsx(it,{variant:"outline",className:"h-7 p-2",children:_.jsx(KV,{className:"h-4 w-4",strokeWidth:1.5})})}),_.jsxs(Ty,{className:"w-56",children:[_.jsx(qk,{children:"Lenses"}),_.jsx(Gk,{}),_.jsxs(AK,{value:n,onValueChange:f,children:[_.jsx(Ay,{value:"Original",children:"Original"}),s.filter(p=>p.name!="Original").map((p,v)=>_.jsxs(Ay,{className:"xbg-red-100 flex justify-between",value:p.name,defaultChecked:p.name===o,children:[_.jsx("p",{children:p.name}),_.jsx(ca,{onClick:b=>{b.preventDefault(),g(p.name)},className:"h-3 w-3 hover:cursor-pointer",strokeWidth:1.5})]},v))]})]})]})}function Wp(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const oD="Checkbox",[lX,Mfe]=kn(oD),[cX,uX]=lX(oD),dX=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,g]=m.useState(null),p=nt(t,C=>g(C)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[x=!1,w]=Qn({prop:i,defaultProp:o,onChange:c}),S=m.useRef(x);return m.useEffect(()=>{const C=f==null?void 0:f.form;if(C){const P=()=>w(S.current);return C.addEventListener("reset",P),()=>C.removeEventListener("reset",P)}},[f,w]),m.createElement(cX,{scope:n,state:x,disabled:a},m.createElement(He.button,se({type:"button",role:"checkbox","aria-checked":Oa(x)?"mixed":x,"aria-required":s,"data-state":sD(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:p,onKeyDown:Pe(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:Pe(e.onClick,C=>{w(P=>Oa(P)?!0:!P),b&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})})),b&&m.createElement(pX,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),fX="CheckboxIndicator",hX=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=uX(fX,n);return m.createElement(yn,{present:r||Oa(o.state)||o.state===!0},m.createElement(He.span,se({"data-state":sD(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}),pX=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Wp(n),a=Hh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});l.indeterminate=Oa(n),f.call(l,Oa(n)?!1:n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",se({type:"checkbox","aria-hidden":!0,defaultChecked:Oa(n)?!1:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Oa(e){return e==="indeterminate"}function sD(e){return Oa(e)?"indeterminate":e?"checked":"unchecked"}const aD=dX,gX=hX,ad=de.forwardRef(({className:e,...t},n)=>_.jsx(aD,{ref:n,className:De("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:_.jsx(gX,{className:De("flex items-center justify-center text-current"),children:_.jsx(rp,{className:"h-4 w-4"})})}));ad.displayName=aD.displayName;function mX(){const[e,t]=m.useState(!1),n=fe(o=>o.dashboard),r=fe(o=>o.bookmarkKey);m.useEffect(()=>{if(!r){t(!1);return}const o=gs(n.id),a=JSON.parse(localStorage.getItem(o)||"[]").find(l=>l.name===r);t(a?a.default:!1)},[r,n.id]);function i(o){if(t(o),!r)return;const s=gs(n.id),l=JSON.parse(localStorage.getItem(s)||"[]").map(c=>(c.name===r?c.default=o:c.default=!1,c));console.log(l),localStorage.setItem(s,JSON.stringify(l))}return _.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(ad,{checked:e,onCheckedChange:i,id:"terms"}),_.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Set as default"})]})}function vX(){const e=fe(C=>C.bookmarkKey),t=fe(C=>C.dashboard);fe(C=>C.selectedSheetId);const n=fe(C=>C.isDashboardEditing),r=fe(C=>C.filterValues),i=fe(C=>C.isVisualEditing),o=fe(C=>C.showFilters),s=fe(C=>C.showDashboardJSON),a=fe(C=>C.actions.setShowDashboardJSON),l=fe(C=>C.onSaveFunction),c=fe(C=>C.actions.setShowFilters),{addFrame:d,setSelectedFrameId:f}=fe(C=>C.actions),{getSelectedSheet:g,setIsDashboardEditing:p,setSelectedCardId:v}=fe(C=>C.actions),b=g(),x=()=>{if(!n||!b)return;const C={id:qo(),title:"Title",description:"Description",preferences:{filterOnClick:!0},type:"bar",sql:"select COUNT(*) from YOUR_TABLE",data:[]},P={id:qo(),cards:[C],activeCardId:C.id};d(b.id,P),f(P.id)},w=()=>{p(!0)};function S(){if(!e||e==="")return;const C=Iy(t),P=gs(t.id),O=JSON.parse(localStorage.getItem(P)||"[]"),k=O.findIndex(T=>T.name===e);k!==-1?O[k]={name:e,template:C,default:O[k].default,filterValues:r}:O.push({name:e,template:C,filterValues:r}),localStorage.setItem(P,JSON.stringify(O)),l==null||l(C)}return _.jsxs("div",{className:`flex items-center justify-between gap-2
418
+ py-2 `,role:"dashboard-controls",children:[!i&&_.jsxs("div",{className:"flex gap-3 items-center",children:[_.jsx(ni,{children:e}),!!e&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:" text-muted-foreground",children:"|"}),_.jsx(mX,{})]})]}),_.jsxs("div",{className:"flex gap-2",children:[n&&!i&&_.jsx(sX,{}),!i&&_.jsx(aX,{}),n&&!i&&_.jsxs(it,{variant:"outline",className:"h-7 p-2",size:"sm",disabled:!n,onClick:x,children:[_.jsx(RO,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Frame"]}),!n&&_.jsx(it,{variant:"outline",className:"h-7 p-2",onClick:w,size:"sm",children:_.jsx(JV,{className:"h-4 w-4",strokeWidth:1.5})}),n&&!i&&_.jsx(it,{variant:"outline",role:"close",className:"h-7 p-2",onClick:()=>p(!1),size:"sm",children:_.jsx(ca,{className:"h-4 w-4",strokeWidth:1.5})}),n&&!i&&_.jsx(it,{className:"h-7 p-2",variant:"outline",onClick:S,size:"sm",children:_.jsx(tH,{className:"h-4 w-4",strokeWidth:1.5})}),!o&&!i&&n&&_.jsx(it,{className:"h-7 p-2",variant:"outline",onClick:()=>c(!0),size:"sm",children:_.jsx(AO,{className:"h-4 w-4",strokeWidth:1.5})}),!i&&n&&_.jsx("div",{className:" flex items-center space-x-2",children:_.jsx(it,{className:"h-7 p-2",onClick:()=>a(!s),size:"sm",variant:"outline",children:_.jsx(GV,{className:"h-4 w-4",strokeWidth:1.5})})}),!i&&_.jsx(LK,{})]})]})}const lD=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{role:"editor-panel",ref:n,className:De("flex grow min-h-[80vh]",e),...t}));lD.displayName="EditorPanel";const cD=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De(" flex flex-col space-y-2 w-[270px]",e),...t}));cD.displayName="EditorAside";const uD=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:De(" grow",e),...t}));uD.displayName="EditorMain";const bX=[" ","Enter","ArrowUp","ArrowDown"],yX=[" ","Enter"],Up="Select",[qp,Gp,xX]=Ef(Up),[ql,Tfe]=kn(Up,[xX,Bi]),jy=Bi(),[wX,Pa]=ql(Up),[_X,SX]=ql(Up),CX=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:f,disabled:g,required:p}=e,v=jy(t),[b,x]=m.useState(null),[w,S]=m.useState(null),[C,P]=m.useState(!1),O=Hs(c),[k=!1,T]=Qn({prop:r,defaultProp:i,onChange:o}),[I,F]=Qn({prop:s,defaultProp:a,onChange:l}),j=m.useRef(null),B=b?!!b.closest("form"):!0,[V,q]=m.useState(new Set),J=Array.from(V).map($=>$.props.value).join(";");return m.createElement(Lu,v,m.createElement(wX,{required:p,scope:t,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:P,contentId:or(),value:I,onValueChange:F,open:k,onOpenChange:T,dir:O,triggerPointerDownPosRef:j,disabled:g},m.createElement(qp.Provider,{scope:t},m.createElement(_X,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback($=>{q(X=>new Set(X).add($))},[]),onNativeOptionRemove:m.useCallback($=>{q(X=>{const W=new Set(X);return W.delete($),W})},[])},n)),B?m.createElement(yD,{key:J,"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:I,onChange:$=>F($.target.value),disabled:g},I===void 0?m.createElement("option",{value:""}):null,Array.from(V)):null))},EX="SelectTrigger",OX=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=jy(n),s=Pa(EX,n),a=s.disabled||r,l=nt(t,s.onTriggerChange),c=Gp(n),[d,f,g]=xD(v=>{const b=c().filter(S=>!S.disabled),x=b.find(S=>S.value===s.value),w=wD(b,v,x);w!==void 0&&s.onValueChange(w.value)}),p=()=>{a||(s.onOpenChange(!0),g())};return m.createElement(Fu,se({asChild:!0},o),m.createElement(He.button,se({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":bD(s.value)?"":void 0},i,{ref:l,onClick:Pe(i.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Pe(i.onPointerDown,v=>{const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Pe(i.onKeyDown,v=>{const b=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(b&&v.key===" ")&&bX.includes(v.key)&&(p(),v.preventDefault())})})))}),PX="SelectValue",kX=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=Pa(PX,n),{onValueNodeHasChildrenChange:c}=l,d=o!==void 0,f=nt(t,l.onValueNodeChange);return Vn(()=>{c(d)},[c,d]),m.createElement(He.span,se({},a,{ref:f,style:{pointerEvents:"none"}}),bD(l.value)?m.createElement(m.Fragment,null,s):o)}),DX=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return m.createElement(He.span,se({"aria-hidden":!0},i,{ref:t}),r||"▼")}),MX=e=>m.createElement(Wh,se({asChild:!0},e)),Gl="SelectContent",TX=m.forwardRef((e,t)=>{const n=Pa(Gl,e.__scopeSelect),[r,i]=m.useState();if(Vn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?kt.createPortal(m.createElement(dD,{scope:e.__scopeSelect},m.createElement(qp.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),o):null}return m.createElement(AX,se({},e,{ref:t}))}),Po=10,[dD,ka]=ql(Gl),AX=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:b,avoidCollisions:x,...w}=e,S=Pa(Gl,n),[C,P]=m.useState(null),[O,k]=m.useState(null),T=nt(t,pe=>P(pe)),[I,F]=m.useState(null),[j,B]=m.useState(null),V=Gp(n),[q,J]=m.useState(!1),$=m.useRef(!1);m.useEffect(()=>{if(C)return Ep(C)},[C]),wp();const X=m.useCallback(pe=>{const[ee,...Q]=V().map(re=>re.ref.current),[ie]=Q.slice(-1),we=document.activeElement;for(const re of pe)if(re===we||(re==null||re.scrollIntoView({block:"nearest"}),re===ee&&O&&(O.scrollTop=0),re===ie&&O&&(O.scrollTop=O.scrollHeight),re==null||re.focus(),document.activeElement!==we))return},[V,O]),W=m.useCallback(()=>X([I,C]),[X,I,C]);m.useEffect(()=>{q&&W()},[q,W]);const{onOpenChange:te,triggerPointerDownPosRef:le}=S;m.useEffect(()=>{if(C){let pe={x:0,y:0};const ee=ie=>{var we,re,Ie,ae;pe={x:Math.abs(Math.round(ie.pageX)-((we=(re=le.current)===null||re===void 0?void 0:re.x)!==null&&we!==void 0?we:0)),y:Math.abs(Math.round(ie.pageY)-((Ie=(ae=le.current)===null||ae===void 0?void 0:ae.y)!==null&&Ie!==void 0?Ie:0))}},Q=ie=>{pe.x<=10&&pe.y<=10?ie.preventDefault():C.contains(ie.target)||te(!1),document.removeEventListener("pointermove",ee),le.current=null};return le.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",Q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",Q,{capture:!0})}}},[C,te,le]),m.useEffect(()=>{const pe=()=>te(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[te]);const[A,H]=xD(pe=>{const ee=V().filter(we=>!we.disabled),Q=ee.find(we=>we.ref.current===document.activeElement),ie=wD(ee,pe,Q);ie&&setTimeout(()=>ie.ref.current.focus())}),ne=m.useCallback((pe,ee,Q)=>{const ie=!$.current&&!Q;(S.value!==void 0&&S.value===ee||ie)&&(F(pe),ie&&($.current=!0))},[S.value]),R=m.useCallback(()=>C==null?void 0:C.focus(),[C]),ue=m.useCallback((pe,ee,Q)=>{const ie=!$.current&&!Q;(S.value!==void 0&&S.value===ee||ie)&&B(pe)},[S.value]),xe=r==="popper"?fD:IX,ge=xe===fD?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:b,avoidCollisions:x}:{};return m.createElement(dD,{scope:n,content:C,viewport:O,onViewportChange:k,itemRefCallback:ne,selectedItem:I,onItemLeave:R,itemTextRefCallback:ue,focusSelectedItem:W,selectedItemText:j,position:r,isPositioned:q,searchRef:A},m.createElement(Tp,{as:oo,allowPinchZoom:!0},m.createElement(_p,{asChild:!0,trapped:S.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:Pe(i,pe=>{var ee;(ee=S.trigger)===null||ee===void 0||ee.focus({preventScroll:!0}),pe.preventDefault()})},m.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>S.onOpenChange(!1)},m.createElement(xe,se({role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:pe=>pe.preventDefault()},w,ge,{onPlaced:()=>J(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Pe(w.onKeyDown,pe=>{const ee=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!ee&&pe.key.length===1&&H(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let ie=V().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const we=pe.target,re=ie.indexOf(we);ie=ie.slice(re+1)}setTimeout(()=>X(ie)),pe.preventDefault()}})}))))))}),IX=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Pa(Gl,n),s=ka(Gl,n),[a,l]=m.useState(null),[c,d]=m.useState(null),f=nt(t,T=>d(T)),g=Gp(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:w,focusSelectedItem:S}=s,C=m.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&b&&x&&w){const T=o.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),j=w.getBoundingClientRect();if(o.dir!=="rtl"){const we=j.left-I.left,re=F.left-we,Ie=T.left-re,ae=T.width+Ie,Se=Math.max(ae,I.width),We=window.innerWidth-Po,dt=g0(re,[Po,We-Se]);a.style.minWidth=ae+"px",a.style.left=dt+"px"}else{const we=I.right-j.right,re=window.innerWidth-F.right-we,Ie=window.innerWidth-T.right-re,ae=T.width+Ie,Se=Math.max(ae,I.width),We=window.innerWidth-Po,dt=g0(re,[Po,We-Se]);a.style.minWidth=ae+"px",a.style.right=dt+"px"}const B=g(),V=window.innerHeight-Po*2,q=b.scrollHeight,J=window.getComputedStyle(c),$=parseInt(J.borderTopWidth,10),X=parseInt(J.paddingTop,10),W=parseInt(J.borderBottomWidth,10),te=parseInt(J.paddingBottom,10),le=$+X+q+te+W,A=Math.min(x.offsetHeight*5,le),H=window.getComputedStyle(b),ne=parseInt(H.paddingTop,10),R=parseInt(H.paddingBottom,10),ue=T.top+T.height/2-Po,xe=V-ue,ge=x.offsetHeight/2,pe=x.offsetTop+ge,ee=$+X+pe,Q=le-ee;if(ee<=ue){const we=x===B[B.length-1].ref.current;a.style.bottom="0px";const re=c.clientHeight-b.offsetTop-b.offsetHeight,Ie=Math.max(xe,ge+(we?R:0)+re+W),ae=ee+Ie;a.style.height=ae+"px"}else{const we=x===B[0].ref.current;a.style.top="0px";const Ie=Math.max(ue,$+b.offsetTop+(we?ne:0)+ge)+Q;a.style.height=Ie+"px",b.scrollTop=ee-ue+b.offsetTop}a.style.margin=`${Po}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=V+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[g,o.trigger,o.valueNode,a,c,b,x,w,o.dir,r]);Vn(()=>C(),[C]);const[P,O]=m.useState();Vn(()=>{c&&O(window.getComputedStyle(c).zIndex)},[c]);const k=m.useCallback(T=>{T&&v.current===!0&&(C(),S==null||S(),v.current=!1)},[C,S]);return m.createElement(NX,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:k},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P}},m.createElement(He.div,se({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),fD=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Po,...o}=e,s=jy(n);return m.createElement($u,se({},s,o,{ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.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)"}}))}),[NX,zy]=ql(Gl,{}),hD="SelectViewport",RX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ka(hD,n),o=zy(hD,n),s=nt(t,i.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(qp.Slot,{scope:n},m.createElement(He.div,se({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Pe(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&d){const g=Math.abs(a.current-c.scrollTop);if(g>0){const p=window.innerHeight-Po*2,v=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),x=Math.max(v,b);if(x<p){const w=x+g,S=Math.min(p,w),C=w-S;d.style.height=S+"px",d.style.bottom==="0px"&&(c.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),LX="SelectGroup",[FX,$X]=ql(LX),jX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=or();return m.createElement(FX,{scope:n,id:i},m.createElement(He.div,se({role:"group","aria-labelledby":i},r,{ref:t})))}),zX="SelectLabel",BX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=$X(zX,n);return m.createElement(He.div,se({id:i.id},r,{ref:t}))}),By="SelectItem",[VX,pD]=ql(By),HX=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=Pa(By,n),l=ka(By,n),c=a.value===r,[d,f]=m.useState(o??""),[g,p]=m.useState(!1),v=nt(t,w=>{var S;return(S=l.itemRefCallback)===null||S===void 0?void 0:S.call(l,w,r,i)}),b=or(),x=()=>{i||(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(VX,{scope:n,value:r,disabled:i,textId:b,isSelected:c,onItemTextChange:m.useCallback(w=>{f(S=>{var C;return S||((C=w==null?void 0:w.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(qp.ItemSlot,{scope:n,value:r,disabled:i,textValue:d},m.createElement(He.div,se({role:"option","aria-labelledby":b,"data-highlighted":g?"":void 0,"aria-selected":c&&g,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},s,{ref:v,onFocus:Pe(s.onFocus,()=>p(!0)),onBlur:Pe(s.onBlur,()=>p(!1)),onPointerUp:Pe(s.onPointerUp,x),onPointerMove:Pe(s.onPointerMove,w=>{if(i){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}else w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(s.onPointerLeave,w=>{if(w.currentTarget===document.activeElement){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}}),onKeyDown:Pe(s.onKeyDown,w=>{var S;((S=l.searchRef)===null||S===void 0?void 0:S.current)!==""&&w.key===" "||(yX.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})}))))}),Yp="SelectItemText",WX=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=Pa(Yp,n),a=ka(Yp,n),l=pD(Yp,n),c=SX(Yp,n),[d,f]=m.useState(null),g=nt(t,w=>f(w),l.onItemTextChange,w=>{var S;return(S=a.itemTextRefCallback)===null||S===void 0?void 0:S.call(a,w,l.value,l.disabled)}),p=d==null?void 0:d.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=c;return Vn(()=>(b(v),()=>x(v)),[b,x,v]),m.createElement(m.Fragment,null,m.createElement(He.span,se({id:l.textId},o,{ref:g})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?kt.createPortal(o.children,s.valueNode):null)}),UX="SelectItemIndicator",qX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return pD(UX,n).isSelected?m.createElement(He.span,se({"aria-hidden":!0},r,{ref:t})):null}),gD="SelectScrollUpButton",GX=m.forwardRef((e,t)=>{const n=ka(gD,e.__scopeSelect),r=zy(gD,e.__scopeSelect),[i,o]=m.useState(!1),s=nt(t,r.onScrollButtonChange);return Vn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;o(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(vD,se({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),mD="SelectScrollDownButton",YX=m.forwardRef((e,t)=>{const n=ka(mD,e.__scopeSelect),r=zy(mD,e.__scopeSelect),[i,o]=m.useState(!1),s=nt(t,r.onScrollButtonChange);return Vn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<c;o(d)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(vD,se({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),vD=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ka("SelectScrollButton",n),s=m.useRef(null),a=Gp(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),Vn(()=>{var c;const d=a().find(f=>f.ref.current===document.activeElement);d==null||(c=d.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(He.div,se({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Pe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Pe(i.onPointerMove,()=>{var c;(c=o.onItemLeave)===null||c===void 0||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Pe(i.onPointerLeave,()=>{l()})}))}),KX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(He.div,se({"aria-hidden":!0},r,{ref:t}))});function bD(e){return e===""||e===void 0}const yD=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=m.useRef(null),o=nt(t,i),s=Wp(n);return m.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&d){const f=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(Y2,{asChild:!0},m.createElement("select",se({},r,{ref:o,defaultValue:n})))});yD.displayName="BubbleSelect";function xD(e){const t=_n(e),n=m.useRef(""),r=m.useRef(0),i=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]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function wD(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=XX(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function XX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const QX=CX,_D=OX,ZX=kX,JX=DX,eQ=MX,SD=TX,tQ=RX,nQ=jX,CD=BX,ED=HX,rQ=WX,iQ=qX,OD=GX,PD=YX,kD=KX,DD=QX,MD=nQ,TD=ZX,Vy=de.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(_D,{ref:r,className:De("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,_.jsx(JX,{asChild:!0,children:_.jsx(b0,{className:"h-4 w-4 opacity-50"})})]}));Vy.displayName=_D.displayName;const AD=de.forwardRef(({className:e,...t},n)=>_.jsx(OD,{ref:n,className:De("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(qV,{className:"h-4 w-4"})}));AD.displayName=OD.displayName;const ID=de.forwardRef(({className:e,...t},n)=>_.jsx(PD,{ref:n,className:De("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(b0,{className:"h-4 w-4"})}));ID.displayName=PD.displayName;const Hy=de.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>_.jsx(eQ,{children:_.jsxs(SD,{ref:i,className:De("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:[_.jsx(AD,{}),_.jsx(tQ,{className:De("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),_.jsx(ID,{})]})}));Hy.displayName=SD.displayName;const Kp=de.forwardRef(({className:e,...t},n)=>_.jsx(CD,{ref:n,className:De("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Kp.displayName=CD.displayName;const Da=de.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(ED,{ref:r,className:De("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:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(iQ,{children:_.jsx(rp,{className:"h-4 w-4"})})}),_.jsx(rQ,{children:t})]}));Da.displayName=ED.displayName;const oQ=de.forwardRef(({className:e,...t},n)=>_.jsx(kD,{ref:n,className:De("-mx-1 my-1 h-px bg-muted",e),...t}));oQ.displayName=kD.displayName;function ld({title:e,items:t,value:n,isLoading:r,isError:i,onChange:o}){const s=r?"Loading...":i?"Error":n;function a(){if(e==="Connection")return _.jsx(eH,{className:" rotate-90",strokeWidth:1,size:16});if(e==="Database")return _.jsx(YV,{strokeWidth:1,size:16});if(e==="Schema")return _.jsx(ZV,{strokeWidth:1,size:16});if(e==="Table")return _.jsx(y0,{strokeWidth:1,size:16})}return _.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx("div",{className:" shrink-0",children:a()}),_.jsxs(DD,{value:s,onValueChange:o,children:[_.jsx(Vy,{className:"focus:ring-offset-0 focus:ring-1 h-7 w-[190px] ",children:_.jsx(TD,{placeholder:r?"Loading...":i?"Error":`Select ${e}`})}),_.jsx(Hy,{children:_.jsxs(MD,{children:[r?_.jsx(Kp,{children:"Loading..."}):_.jsx(Kp,{children:e}),_.jsx(_.Fragment,{children:t&&t.map(l=>_.jsx(Da,{value:l.id,children:l.name},l.id))}),(r||i)&&_.jsx(Da,{value:s,children:s})]})})]})]})}function sQ({column:e}){const[t,n]=m.useState(!1),r=ve(d=>d.selectedTableName),i=ve(d=>d.selectedSchemaName),o=ve(d=>d.sqlGen),s=ve(d=>d.actions.setSqlGen),a=ve(d=>d.actions.setCardSql),l=ve(d=>d.actions.setRunSql);function c(d,f){const g=H0(d,o,f);s(g);const p=V0(g,_i(i||""),_i(r));p&&(a(p),l(!0)),n(!1)}return _.jsxs(Ap,{open:t,onOpenChange:n,children:[_.jsx(Ip,{asChild:!0,children:_.jsx(pz,{className:"w-3 h-3 text-foreground/40 cursor-pointer"})}),_.jsx(nd,{align:"center",className:" p-0 w-18 rounded-none shadow-none ",children:_.jsxs("ul",{className:"text-xs ",children:[_.jsx("li",{onClick:()=>c(e,"COUNT"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Count"}),_.jsx("li",{onClick:()=>c(e,"AVG"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Avg"}),_.jsx("li",{onClick:()=>c(e,"SUM"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Sum"}),_.jsx("li",{onClick:()=>c(e,"MAX"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Max"}),_.jsx("li",{onClick:()=>c(e,"MIN"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Min"})]})})]})}function ND({column:e}){return _.jsxs(zu,{children:[_.jsx(X2,{asChild:!0,children:Uu.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"T"}):ds.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"#"}):xa.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"D"}):pp.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"B"}):_.jsx("span",{className:" font-thin",children:"?"})}),_.jsx(Tl,{children:_.jsx("p",{className:"text-xs font-mono",children:e.data_type})})]})}function aQ({schemaName:e,tableName:t,columns:n,status:r}){const i=ve(f=>f.sqlGen),o=ve(f=>f.actions.setRunSql),s=ve(f=>f.actions.setSqlGen),a=ve(f=>f.actions.setIsShowingVisual),l=ve(f=>f.actions.setCardSql);function c(f){const g=H0(f,i);s(g);const p=V0(g,_i(e),_i(t));p&&(l(p),o(!0))}function d(){let g=mp(e,t);(v=>v.charAt(0)===v.charAt(0).toUpperCase())(t)&&(g=`"${t}"`),a(!1),l(`SELECT * FROM ${g} LIMIT 10`),o(!0)}return _.jsxs("div",{className:"px-4",children:[_.jsx("div",{className:" font-medium px-2 pt-2 pb-3",children:_.jsxs(it,{disabled:r!=="Success",onClick:d,variant:"secondary",className:" h-7 flex w-full",children:[r!=="Success"&&_.jsx(Nl,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"}),"Show top 10 rows"]})}),_.jsxs(da,{className:`w-full ${t==="api"?"h-[74vh]":"h-[60vh]"}`,children:[n==null?void 0:n.map(f=>_.jsxs("div",{onClick:()=>c(f),className:De(" text-sm flex items-center justify-between px-3 py-[6px] transition-colors hover:bg-muted/50 cursor-pointer rounded ",{" bg-muted":dP(f,i)}),children:[_.jsxs("div",{className:"flex items-center space-x-2 ",children:[_.jsx(ND,{column:f}),_.jsx("span",{children:f.column_name})]}),ds.includes(f.data_type)&&_.jsx("div",{onClick:g=>g.stopPropagation(),className:" flex items-center justify-end ",children:_.jsx(sQ,{column:f})})]},f.column_name)),_.jsx(Il,{orientation:"vertical"}),_.jsx(Il,{orientation:"horizontal"})]})]})}function RD({ColumnsComponent:e}){const t=ve(j=>j.selectedConnectionId),n=ve(j=>j.selectedDatabaseName),r=ve(j=>j.selectedSchemaName),i=ve(j=>j.selectedTableName),o=ve(j=>j.actions.setSelectedTableName),{connectionItems:s,schemaItems:a,databaseItems:l,tableItems:c,columns:d,isConnectionsLoading:f,isConnectionsError:g,isDatabasesLoadingOrFetching:p,isDatabaseError:v,isSchemaLoadingOrFetching:b,isSchemaError:x,isColumnsError:w,isColumnsLoadingOrFetching:S,isAPIConnection:C,handleConnectionChange:P,handleDatabaseChange:O,handleSchemaChange:k,tableName:T,schemaName:I}=d_();function F(){return e?e(I,T,d):_.jsx(aQ,{schemaName:I,tableName:T,columns:d,status:S?"Loading...":w?"Error":"Success"})}return _.jsxs("aside",{className:" grow flex flex-col xbg-red-100 ",children:[_.jsxs("section",{className:"space-y-3 pt-4 pb-3 px-6",children:[_.jsx(ld,{items:s,title:"Connection",value:t||"",onChange:P,isLoading:f,isError:g}),!C&&_.jsxs(_.Fragment,{children:[_.jsx(ld,{onChange:O,isError:v,isLoading:p,items:l,value:n||"",title:"Database"}),_.jsx(ld,{onChange:k,isError:x,isLoading:b,items:a,value:r||"",title:"Schema"}),_.jsx(ld,{onChange:o,isError:v,items:c,isLoading:p,value:i||"",title:"Table"})]})]}),F(),_.jsx("div",{className:" grow justify-end flex flex-col pt-6 "})]})}const{createElement:Yl,createContext:lQ,createRef:Afe,forwardRef:LD,useCallback:Rr,useContext:FD,useEffect:Ma,useImperativeHandle:$D,useLayoutEffect:cQ,useMemo:uQ,useRef:ri,useState:Xp}=de,jD=de.useId,Qp=lQ(null);Qp.displayName="PanelGroupContext";const cd=cQ,dQ=typeof jD=="function"?jD:()=>null;let fQ=0;function Wy(e=null){const t=dQ(),n=ri(e||t||null);return n.current===null&&(n.current=""+fQ++),e??n.current}function zD({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:d,onResize:f,order:g,style:p,tagName:v="div",...b}){const x=FD(Qp);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:S,getPanelSize:C,getPanelStyle:P,groupId:O,isPanelCollapsed:k,registerPanel:T,resizePanel:I,unregisterPanel:F}=x,j=Wy(s),B=ri({callbacks:{onCollapse:c,onExpand:d,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:j,idIsFromProps:s!==void 0,order:g});ri({didLogMissingDefaultSizeWarning:!1}),cd(()=>{const{callbacks:q,constraints:J}=B.current;B.current.id=j,B.current.idIsFromProps=s!==void 0,B.current.order=g,q.onCollapse=c,q.onExpand=d,q.onResize=f,J.collapsedSize=n,J.collapsible=r,J.defaultSize=i,J.maxSize=a,J.minSize=l}),cd(()=>{const q=B.current;return T(q),()=>{F(q)}},[g,j,T,F]),$D(o,()=>({collapse:()=>{w(B.current)},expand:()=>{S(B.current)},getId(){return j},getSize(){return C(B.current)},isCollapsed(){return k(B.current)},isExpanded(){return!k(B.current)},resize:q=>{I(B.current,q)}}),[w,S,C,k,j,I]);const V=P(B.current,i);return Yl(v,{...b,children:e,className:t,style:{...V,...p},"data-panel":"","data-panel-id":j,"data-panel-group-id":O,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const BD=LD((e,t)=>Yl(zD,{...e,forwardedRef:t}));zD.displayName="Panel",BD.displayName="forwardRef(Panel)";function ct(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const VD=10;function ud(e,t,n=VD){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Lr(e,t,n){return ud(e,t,n)===0}function Kl({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];ct(r!=null);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(ud(n,a)<0)if(o){const l=(i+a)/2;ud(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(VD)),n}function dd({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:i}){if(Lr(e,0))return t;const o=[...t],[s,a]=r;ct(s!=null),ct(a!=null);let l=0;if(i==="keyboard"){{const d=e<0?a:s,f=n[d];if(ct(f),f.collapsible){const g=t[d];ct(g!=null);const p=n[d];ct(p);const{collapsedSize:v=0,minSize:b=0}=p;if(Lr(g,v)){const x=b-g;ud(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?s:a,f=n[d];ct(f);const{collapsible:g}=f;if(g){const p=t[d];ct(p!=null);const v=n[d];ct(v);const{collapsedSize:b=0,minSize:x=0}=v;if(Lr(p,x)){const w=p-b;ud(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const d=e<0?1:-1;let f=e<0?a:s,g=0;for(;;){const v=t[f];ct(v!=null);const x=Kl({panelConstraints:n,panelIndex:f,size:100})-v;if(g+=x,f+=d,f<0||f>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-p:p}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(l),p=t[f];ct(p!=null);const v=p-g,b=Kl({panelConstraints:n,panelIndex:f,size:v});if(!Lr(p,b)&&(l+=p-b,o[f]=b,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Lr(l,0))return t;{const d=e<0?a:s,f=t[d];ct(f!=null);const g=f+l,p=Kl({panelConstraints:n,panelIndex:d,size:g});if(o[d]=p,!Lr(p,g)){let v=g-p,x=e<0?a:s;for(;x>=0&&x<n.length;){const w=o[x];ct(w!=null);const S=w+v,C=Kl({panelConstraints:n,panelIndex:x,size:S});if(Lr(w,C)||(v-=C-w,o[x]=C),Lr(v,0))break;e>0?x--:x++}}}const c=o.reduce((d,f)=>f+d,0);return Lr(c,100)?o:t}function hQ({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];ct(a!=null),t.forEach((f,g)=>{const{constraints:p}=f,{maxSize:v=100,minSize:b=0}=p;g===a?(r=b,i=v):(o+=b,s+=v)});const l=Math.min(i,100-o),c=Math.max(r,100-s),d=e[a];return{valueMax:l,valueMin:c,valueNow:d}}function fd(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function HD(e,t){const r=fd(e).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return r??null}function WD(e,t){const n=HD(e,t);return n!=null?[n,n+1]:[-1,-1]}function UD(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function Zp(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function pQ(e,t,n){var r,i,o,s;const a=Zp(t),l=fd(e),c=a?l.indexOf(a):-1,d=(r=(i=n[c])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,f=(o=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&o!==void 0?o:null;return[d,f]}function gQ({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,setLayout:o}){ri({didWarnAboutMissingResizeHandle:!1}),cd(()=>{const s=fd(n);for(let a=0;a<i.length-1;a++){const{valueMax:l,valueMin:c,valueNow:d}=hQ({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const g=i[a];ct(g),f.setAttribute("aria-controls",g.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,i]),Ma(()=>{const s=t.current;ct(s);const{panelDataArray:a}=s,l=UD(n);ct(l!=null,`No group found for id "${n}"`);const c=fd(n);ct(c);const d=c.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");ct(g);const[p,v]=pQ(n,g,a);if(p==null||v==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=a.findIndex(S=>S.id===p);if(w>=0){const S=a[w];ct(S);const C=r[w],{collapsedSize:P=0,collapsible:O,minSize:k=0}=S.constraints;if(C!=null&&O){const T=dd({delta:Lr(C,P)?k-P:P-C,layout:r,panelConstraints:a.map(I=>I.constraints),pivotIndices:WD(n,g),trigger:"keyboard"});r!==T&&o(T)}}break}}};return f.addEventListener("keydown",b),()=>{f.removeEventListener("keydown",b)}});return()=>{d.forEach(f=>f())}},[e,t,n,r,i,o])}function qD(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 GD(e){return e.type==="keydown"}function YD(e){return e.type.startsWith("mouse")}function KD(e){return e.type.startsWith("touch")}function XD(e,t){const n=e==="horizontal";if(YD(t))return n?t.clientX:t.clientY;if(KD(t)){const r=t.touches[0];return ct(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function mQ(e,t,n,r){const i=n==="horizontal",o=Zp(t);ct(o);const s=o.getAttribute("data-panel-group-id");ct(s);let{initialCursorPosition:a}=r;const l=XD(n,e),c=UD(s);ct(c);const d=c.getBoundingClientRect(),f=i?d.width:d.height;return(l-a)/f*100}function vQ(e,t,n,r,i){if(GD(e)){const o=n==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=o?0:s;break;case"ArrowLeft":a=o?-s:0;break;case"ArrowRight":a=o?s:0;break;case"ArrowUp":a=o?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:mQ(e,t,n,r)}function bQ({panelDataArray:e}){const t=Array(e.length),n=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const s=n[o];ct(s);const{defaultSize:a}=s;a!=null&&(r++,t[o]=a,i-=a)}for(let o=0;o<e.length;o++){const s=n[o];ct(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=i/l;r++,t[o]=c,i-=c}return t}function Xl(e,t,n){t.forEach((r,i)=>{const o=e[i];ct(o);const{callbacks:s,constraints:a,id:l}=o,{collapsedSize:c=0,collapsible:d}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:g,onExpand:p,onResize:v}=s;v&&v(r,f),d&&(g||p)&&(p&&(f==null||f===c)&&r!==c&&p(),g&&(f==null||f!==c)&&r===c&&g())}})}function Jp(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 yQ({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:o=3}){const s=n[i];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let Uy=null,Ta=null;function QD(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 xQ(){Ta!==null&&(document.head.removeChild(Ta),Uy=null,Ta=null)}function qy(e){if(Uy===e)return;Uy=e;const t=QD(e);Ta===null&&(Ta=document.createElement("style"),document.head.appendChild(Ta)),Ta.innerHTML=`*{cursor: ${t}!important;}`}function wQ(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function ZD(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function JD(e){return`react-resizable-panels:${e}`}function eM(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function tM(e,t){try{const n=JD(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function _Q(e,t,n){var r,i;const o=(r=tM(e,n))!==null&&r!==void 0?r:{},s=eM(t);return(i=o[s])!==null&&i!==void 0?i:null}function SQ(e,t,n,r,i){var o;const s=JD(e),a=eM(t),l=(o=tM(e,i))!==null&&o!==void 0?o:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function nM({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!Lr(r,100))for(let o=0;o<t.length;o++){const s=n[o];ct(s!=null);const a=100/r*s;n[o]=a}let i=0;for(let o=0;o<t.length;o++){const s=n[o];ct(s!=null);const a=Kl({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!Lr(i,0))for(let o=0;o<t.length;o++){const s=n[o];ct(s!=null);const a=s+i,l=Kl({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,Lr(i,0)))break}return n}const CQ=100,hd={getItem:e=>(ZD(hd),hd.getItem(e)),setItem:(e,t)=>{ZD(hd),hd.setItem(e,t)}},rM={};function iM({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=hd,style:c,tagName:d="div",...f}){const g=Wy(o),[p,v]=Xp(null),[b,x]=Xp([]),w=ri({}),S=ri(new Map),C=ri(0),P=ri({autoSaveId:e,direction:r,dragState:p,id:g,keyboardResizeBy:a,onLayout:s,storage:l}),O=ri({layout:b,panelDataArray:[],panelDataArrayChanged:!1});ri({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),$D(i,()=>({getId:()=>P.current.id,getLayout:()=>{const{layout:A}=O.current;return A},setLayout:A=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:R}=O.current,ue=nM({layout:A,panelConstraints:R.map(xe=>xe.constraints)});qD(ne,ue)||(x(ue),O.current.layout=ue,H&&H(ue),Xl(R,ue,w.current))}}),[]),cd(()=>{P.current.autoSaveId=e,P.current.direction=r,P.current.dragState=p,P.current.id=g,P.current.onLayout=s,P.current.storage=l}),gQ({committedValuesRef:P,eagerValuesRef:O,groupId:g,layout:b,panelDataArray:O.current.panelDataArray,setLayout:x}),Ma(()=>{const{panelDataArray:A}=O.current;if(e){if(b.length===0||b.length!==A.length)return;let H=rM[e];H==null&&(H=wQ(SQ,CQ),rM[e]=H);const ne=[...A],R=new Map(S.current);H(e,ne,R,b,l)}},[e,b,l]),Ma(()=>{});const k=Rr(A=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:R}=O.current;if(A.constraints.collapsible){const ue=R.map(ee=>ee.constraints),{collapsedSize:xe=0,panelSize:ge,pivotIndices:pe}=Zl(R,A,ne);if(ct(ge!=null),ge!==xe){S.current.set(A.id,ge);const Q=Ql(R,A)===R.length-1?ge-xe:xe-ge,ie=dd({delta:Q,layout:ne,panelConstraints:ue,pivotIndices:pe,trigger:"imperative-api"});Jp(ne,ie)||(x(ie),O.current.layout=ie,H&&H(ie),Xl(R,ie,w.current))}}},[]),T=Rr(A=>{const{onLayout:H}=P.current,{layout:ne,panelDataArray:R}=O.current;if(A.constraints.collapsible){const ue=R.map(Q=>Q.constraints),{collapsedSize:xe=0,panelSize:ge,minSize:pe=0,pivotIndices:ee}=Zl(R,A,ne);if(ge===xe){const Q=S.current.get(A.id),ie=Q!=null&&Q>=pe?Q:pe,re=Ql(R,A)===R.length-1?ge-ie:ie-ge,Ie=dd({delta:re,layout:ne,panelConstraints:ue,pivotIndices:ee,trigger:"imperative-api"});Jp(ne,Ie)||(x(Ie),O.current.layout=Ie,H&&H(Ie),Xl(R,Ie,w.current))}}},[]),I=Rr(A=>{const{layout:H,panelDataArray:ne}=O.current,{panelSize:R}=Zl(ne,A,H);return ct(R!=null),R},[]),F=Rr((A,H)=>{const{panelDataArray:ne}=O.current,R=Ql(ne,A);return yQ({defaultSize:H,dragState:p,layout:b,panelData:ne,panelIndex:R})},[p,b]),j=Rr(A=>{const{layout:H,panelDataArray:ne}=O.current,{collapsedSize:R=0,collapsible:ue,panelSize:xe}=Zl(ne,A,H);return ue===!0&&xe===R},[]),B=Rr(A=>{const{layout:H,panelDataArray:ne}=O.current,{collapsedSize:R=0,collapsible:ue,panelSize:xe}=Zl(ne,A,H);return ct(xe!=null),!ue||xe>R},[]),V=Rr(A=>{const{panelDataArray:H}=O.current;H.push(A),H.sort((ne,R)=>{const ue=ne.order,xe=R.order;return ue==null&&xe==null?0:ue==null?-1:xe==null?1:ue-xe}),O.current.panelDataArrayChanged=!0},[]);cd(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:A,onLayout:H,storage:ne}=P.current,{layout:R,panelDataArray:ue}=O.current;let xe=null;if(A){const pe=_Q(A,ue,ne);pe&&(S.current=new Map(Object.entries(pe.expandToSizes)),xe=pe.layout)}xe==null&&(xe=bQ({panelDataArray:ue}));const ge=nM({layout:xe,panelConstraints:ue.map(pe=>pe.constraints)});qD(R,ge)||(x(ge),O.current.layout=ge,H&&H(ge),Xl(ue,ge,w.current))}});const q=Rr(A=>function(ne){ne.preventDefault();const{direction:R,dragState:ue,id:xe,keyboardResizeBy:ge,onLayout:pe}=P.current,{layout:ee,panelDataArray:Q}=O.current,{initialLayout:ie}=ue??{},we=WD(xe,A);let re=vQ(ne,A,R,ue,ge);if(re===0)return;const Ie=R==="horizontal";document.dir==="rtl"&&Ie&&(re=-re);const ae=Q.map(dt=>dt.constraints),Se=dd({delta:re,layout:ie??ee,panelConstraints:ae,pivotIndices:we,trigger:GD(ne)?"keyboard":"mouse-or-touch"}),We=!Jp(ee,Se);(YD(ne)||KD(ne))&&C.current!=re&&(C.current=re,qy(We?Ie?"horizontal":"vertical":Ie?re<0?"horizontal-min":"horizontal-max":re<0?"vertical-min":"vertical-max")),We&&(x(Se),O.current.layout=Se,pe&&pe(Se),Xl(Q,Se,w.current))},[]),J=Rr((A,H)=>{const{onLayout:ne}=P.current,{layout:R,panelDataArray:ue}=O.current,xe=ue.map(we=>we.constraints),{panelSize:ge,pivotIndices:pe}=Zl(ue,A,R);ct(ge!=null);const Q=Ql(ue,A)===ue.length-1?ge-H:H-ge,ie=dd({delta:Q,layout:R,panelConstraints:xe,pivotIndices:pe,trigger:"imperative-api"});Jp(R,ie)||(x(ie),O.current.layout=ie,ne&&ne(ie),Xl(ue,ie,w.current))},[]),$=Rr((A,H)=>{const{direction:ne}=P.current,{layout:R}=O.current,ue=Zp(A);ct(ue);const xe=XD(ne,H);v({dragHandleId:A,dragHandleRect:ue.getBoundingClientRect(),initialCursorPosition:xe,initialLayout:R})},[]),X=Rr(()=>{xQ(),v(null)},[]),W=Rr(A=>{const{panelDataArray:H}=O.current,ne=Ql(H,A);ne>=0&&(H.splice(ne,1),delete w.current[A.id],O.current.panelDataArrayChanged=!0)},[]),te=uQ(()=>({collapsePanel:k,direction:r,dragState:p,expandPanel:T,getPanelSize:I,getPanelStyle:F,groupId:g,isPanelCollapsed:j,isPanelExpanded:B,registerPanel:V,registerResizeHandle:q,resizePanel:J,startDragging:$,stopDragging:X,unregisterPanel:W}),[k,p,r,T,I,F,g,j,B,V,q,J,$,X,W]),le={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Yl(Qp.Provider,{value:te},Yl(d,{...f,children:t,className:n,style:{...le,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g}))}const oM=LD((e,t)=>Yl(iM,{...e,forwardedRef:t}));iM.displayName="PanelGroup",oM.displayName="forwardRef(PanelGroup)";function Ql(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Zl(e,t,n){const r=e.map(c=>c.constraints),i=Ql(e,t),o=r[i],a=i===e.length-1?[i-1,i]:[i,i+1],l=n[i];return{...o,panelSize:l,pivotIndices:a}}function EQ({disabled:e,handleId:t,resizeHandler:n}){Ma(()=>{if(e||n==null)return;const r=Zp(t);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const s=r.getAttribute("data-panel-group-id");ct(s);const a=fd(s),l=HD(s,t);ct(l!==null);const c=o.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[e,t,n])}function sM({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:i,style:o={},tabIndex:s=0,tagName:a="div",...l}){const c=ri(null),d=ri({onDragging:i});Ma(()=>{d.current.onDragging=i});const f=FD(Qp);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,dragState:p,groupId:v,registerResizeHandle:b,startDragging:x,stopDragging:w}=f,S=Wy(r),C=(p==null?void 0:p.dragHandleId)===S,[P,O]=Xp(!1),[k,T]=Xp(null),I=Rr(()=>{const j=c.current;ct(j),j.blur(),w();const{onDragging:B}=d.current;B&&B(!1)},[w]);Ma(()=>{if(n)T(null);else{const j=b(S);T(()=>j)}},[n,S,b]),Ma(()=>{if(n||k==null||!C)return;const j=J=>{k(J)},B=J=>{k(J)},V=c.current;ct(V);const q=V.ownerDocument;return q.body.addEventListener("contextmenu",I),q.body.addEventListener("mousemove",j),q.body.addEventListener("touchmove",j),q.body.addEventListener("mouseleave",B),window.addEventListener("mouseup",I),window.addEventListener("touchend",I),()=>{q.body.removeEventListener("contextmenu",I),q.body.removeEventListener("mousemove",j),q.body.removeEventListener("touchmove",j),q.body.removeEventListener("mouseleave",B),window.removeEventListener("mouseup",I),window.removeEventListener("touchend",I)}},[g,n,C,k,I]),EQ({disabled:n,handleId:S,resizeHandler:k});const F={cursor:QD(g),touchAction:"none",userSelect:"none"};return Yl(a,{...l,children:e,className:t,onBlur:()=>O(!1),onFocus:()=>O(!0),onMouseDown:j=>{x(S,j.nativeEvent);const B=d.current;ct(B);const{onDragging:V}=B;V&&V(!0)},onMouseUp:I,onTouchCancel:I,onTouchEnd:I,onTouchStart:j=>{x(S,j.nativeEvent);const B=d.current;ct(B);const{onDragging:V}=B;V&&V(!0)},ref:c,role:"separator",style:{...F,...o},tabIndex:s,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":C?"pointer":P?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":S})}sM.displayName="PanelResizeHandle";const aM=({className:e,...t})=>_.jsx(oM,{className:De("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),eg=BD,lM=({withHandle:e,className:t,...n})=>_.jsx(sM,{className:De("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&&_.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:_.jsx(XV,{className:"h-2.5 w-2.5"})})});function OQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cM(Object(n),!0).forEach(function(r){OQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PQ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function kQ(e,t){if(e==null)return{};var n=PQ(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DQ(e,t){return MQ(e)||TQ(e,t)||AQ(e,t)||IQ()}function MQ(e){if(Array.isArray(e))return e}function TQ(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=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){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function AQ(e,t){if(e){if(typeof e=="string")return dM(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 dM(e,t)}}function dM(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 IQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
419
419
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fM(Object(n),!0).forEach(function(r){NQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RQ(){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(i,o){return o(i)},r)}}function pd(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function tg(e){return{}.toString.call(e).includes("Object")}function LQ(e){return!Object.keys(e).length}function gd(e){return typeof e=="function"}function FQ(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $Q(e,t){return tg(t)||ms("changeType"),Object.keys(t).some(function(n){return!FQ(e,n)})&&ms("changeField"),t}function jQ(e){gd(e)||ms("selectorType")}function zQ(e){gd(e)||tg(e)||ms("handlerType"),tg(e)&&Object.values(e).some(function(t){return!gd(t)})&&ms("handlersType")}function BQ(e){e||ms("initialIsRequired"),tg(e)||ms("initialType"),LQ(e)&&ms("initialContent")}function VQ(e,t){throw new Error(e[t]||e.default)}var HQ={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"},ms=pd(VQ)(HQ),ng={changes:$Q,selector:jQ,handler:zQ,initial:BQ};function WQ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ng.initial(e),ng.handler(t);var n={current:e},r=pd(GQ)(n,t),i=pd(qQ)(n),o=pd(ng.changes)(e),s=pd(UQ)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return ng.selector(c),c(n.current)}function l(c){RQ(r,i,o,s)(c)}return[a,l]}function UQ(e,t){return gd(t)?t(e.current):t}function qQ(e,t){return e.current=hM(hM({},e.current),t),t}function GQ(e,t,n){return gd(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var YQ={create:WQ},KQ={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function XQ(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function QQ(e){return{}.toString.call(e).includes("Object")}function ZQ(e){return e||gM("configIsRequired"),QQ(e)||gM("configType"),e.urls?(JQ(),{paths:{vs:e.urls.monacoBase}}):e}function JQ(){console.warn(pM.deprecation)}function eZ(e,t){throw new Error(e[t]||e.default)}var pM={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!
420
420
  You are using deprecated way of configuration.
421
421
 
@@ -425,10 +425,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
425
425
  monaco.config({ paths: { vs: '...' } })
426
426
 
427
427
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
428
- `},gM=XQ(eZ)(pM),tZ={config:ZQ},nZ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function mM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],mM(e[n],t[n]))}),uM(uM({},e),t)}var rZ={type:"cancelation",msg:"operation is manually canceled"};function Gy(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(rZ):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var iZ=YQ.create({config:KQ,isInitialized:!1,resolve:null,reject:null,monaco:null}),vM=DQ(iZ,2),md=vM[0],rg=vM[1];function oZ(e){var t=tZ.config(e),n=t.monaco,r=kQ(t,["monaco"]);rg(function(i){return{config:mM(i.config,r),monaco:n}})}function sZ(){var e=md(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(rg({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Gy(Yy);if(window.monaco&&window.monaco.editor)return bM(window.monaco),e.resolve(window.monaco),Gy(Yy);nZ(aZ,cZ)(uZ)}return Gy(Yy)}function aZ(e){return document.body.appendChild(e)}function lZ(e){var t=document.createElement("script");return e&&(t.src=e),t}function cZ(e){var t=md(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=lZ("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function uZ(){var e=md(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){bM(n),e.resolve(n)},function(n){e.reject(n)})}function bM(e){md().monaco||rg({monaco:e})}function dZ(){return md(function(e){var t=e.monaco;return t})}var Yy=new Promise(function(e,t){return rg({resolve:e,reject:t})}),yM={config:oZ,init:sZ,__getMonacoInstance:dZ},fZ={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ky=fZ,hZ={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},pZ=hZ;function gZ({children:e}){return m.createElement("div",{style:pZ.container},e)}var mZ=gZ,vZ=mZ;function bZ({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return m.createElement("section",{style:{...Ky.wrapper,width:e,height:t},...s},!n&&m.createElement(vZ,null,r),m.createElement("div",{ref:i,style:{...Ky.fullWidth,...!n&&Ky.hide},className:o}))}var yZ=bZ,xM=m.memo(yZ);function xZ(e){m.useEffect(e,[])}var wM=xZ;function wZ(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Fr=wZ;function vd(){}function Jl(e,t,n,r){return _Z(e,r)||SZ(e,t,n,r)}function _Z(e,t){return e.editor.getModel(_M(e,t))}function SZ(e,t,n,r){return e.editor.createModel(t,n,r?_M(e,r):void 0)}function _M(e,t){return e.Uri.parse(t)}function CZ({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:f={},height:g="100%",width:p="100%",className:v,wrapperProps:b={},beforeMount:x=vd,onMount:w=vd}){let[S,C]=m.useState(!1),[P,O]=m.useState(!0),k=m.useRef(null),T=m.useRef(null),I=m.useRef(null),F=m.useRef(w),j=m.useRef(x),B=m.useRef(!1);wM(()=>{let $=yM.init();return $.then(X=>(T.current=X)&&O(!1)).catch(X=>(X==null?void 0:X.type)!=="cancelation"&&console.error("Monaco initialization: error:",X)),()=>k.current?J():$.cancel()}),Fr(()=>{if(k.current&&T.current){let $=k.current.getOriginalEditor(),X=Jl(T.current,e||"",r||n||"text",o||"");X!==$.getModel()&&$.setModel(X)}},[o],S),Fr(()=>{if(k.current&&T.current){let $=k.current.getModifiedEditor(),X=Jl(T.current,t||"",i||n||"text",s||"");X!==$.getModel()&&$.setModel(X)}},[s],S),Fr(()=>{let $=k.current.getModifiedEditor();$.getOption(T.current.editor.EditorOption.readOnly)?$.setValue(t||""):t!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[t],S),Fr(()=>{var $,X;(X=($=k.current)==null?void 0:$.getModel())==null||X.original.setValue(e||"")},[e],S),Fr(()=>{let{original:$,modified:X}=k.current.getModel();T.current.editor.setModelLanguage($,r||n||"text"),T.current.editor.setModelLanguage(X,i||n||"text")},[n,r,i],S),Fr(()=>{var $;($=T.current)==null||$.editor.setTheme(c)},[c],S),Fr(()=>{var $;($=k.current)==null||$.updateOptions(f)},[f],S);let V=m.useCallback(()=>{var W;if(!T.current)return;j.current(T.current);let $=Jl(T.current,e||"",r||n||"text",o||""),X=Jl(T.current,t||"",i||n||"text",s||"");(W=k.current)==null||W.setModel({original:$,modified:X})},[n,t,i,e,r,o,s]),q=m.useCallback(()=>{var $;!B.current&&I.current&&(k.current=T.current.editor.createDiffEditor(I.current,{automaticLayout:!0,...f}),V(),($=T.current)==null||$.editor.setTheme(c),C(!0),B.current=!0)},[f,c,V]);m.useEffect(()=>{S&&F.current(k.current,T.current)},[S]),m.useEffect(()=>{!P&&!S&&q()},[P,S,q]);function J(){var X,W,ne,le;let $=(X=k.current)==null?void 0:X.getModel();a||((W=$==null?void 0:$.original)==null||W.dispose()),l||((ne=$==null?void 0:$.modified)==null||ne.dispose()),(le=k.current)==null||le.dispose()}return m.createElement(xM,{width:p,height:g,isEditorReady:S,loading:d,_ref:I,className:v,wrapperProps:b})}var EZ=CZ;m.memo(EZ);function OZ(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var PZ=OZ,ig=new Map;function kZ({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:f=!0,keepCurrentModel:g=!1,width:p="100%",height:v="100%",className:b,wrapperProps:x={},beforeMount:w=vd,onMount:S=vd,onChange:C,onValidate:P=vd}){let[O,k]=m.useState(!1),[T,I]=m.useState(!0),F=m.useRef(null),j=m.useRef(null),B=m.useRef(null),V=m.useRef(S),q=m.useRef(w),J=m.useRef(),$=m.useRef(r),X=PZ(o),W=m.useRef(!1),ne=m.useRef(!1);wM(()=>{let H=yM.init();return H.then(re=>(F.current=re)&&I(!1)).catch(re=>(re==null?void 0:re.type)!=="cancelation"&&console.error("Monaco initialization: error:",re)),()=>j.current?A():H.cancel()}),Fr(()=>{var re,R,ue,xe;let H=Jl(F.current,e||r||"",t||i||"",o||n||"");H!==((re=j.current)==null?void 0:re.getModel())&&(f&&ig.set(X,(R=j.current)==null?void 0:R.saveViewState()),(ue=j.current)==null||ue.setModel(H),f&&((xe=j.current)==null||xe.restoreViewState(ig.get(o))))},[o],O),Fr(()=>{var H;(H=j.current)==null||H.updateOptions(c)},[c],O),Fr(()=>{!j.current||r===void 0||(j.current.getOption(F.current.editor.EditorOption.readOnly)?j.current.setValue(r):r!==j.current.getValue()&&(ne.current=!0,j.current.executeEdits("",[{range:j.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),j.current.pushUndoStop(),ne.current=!1))},[r],O),Fr(()=>{var re,R;let H=(re=j.current)==null?void 0:re.getModel();H&&i&&((R=F.current)==null||R.editor.setModelLanguage(H,i))},[i],O),Fr(()=>{var H;a!==void 0&&((H=j.current)==null||H.revealLine(a))},[a],O),Fr(()=>{var H;(H=F.current)==null||H.editor.setTheme(s)},[s],O);let le=m.useCallback(()=>{var H;if(!(!B.current||!F.current)&&!W.current){q.current(F.current);let re=o||n,R=Jl(F.current,r||e||"",t||i||"",re||"");j.current=(H=F.current)==null?void 0:H.editor.create(B.current,{model:R,automaticLayout:!0,...c},d),f&&j.current.restoreViewState(ig.get(re)),F.current.editor.setTheme(s),a!==void 0&&j.current.revealLine(a),k(!0),W.current=!0}},[e,t,n,r,i,o,c,d,f,s,a]);m.useEffect(()=>{O&&V.current(j.current,F.current)},[O]),m.useEffect(()=>{!T&&!O&&le()},[T,O,le]),$.current=r,m.useEffect(()=>{var H,re;O&&C&&((H=J.current)==null||H.dispose(),J.current=(re=j.current)==null?void 0:re.onDidChangeModelContent(R=>{ne.current||C(j.current.getValue(),R)}))},[O,C]),m.useEffect(()=>{if(O){let H=F.current.editor.onDidChangeMarkers(re=>{var ue;let R=(ue=j.current.getModel())==null?void 0:ue.uri;if(R&&re.find(xe=>xe.path===R.path)){let xe=F.current.editor.getModelMarkers({resource:R});P==null||P(xe)}});return()=>{H==null||H.dispose()}}return()=>{}},[O,P]);function A(){var H,re;(H=J.current)==null||H.dispose(),g?f&&ig.set(o,j.current.saveViewState()):(re=j.current.getModel())==null||re.dispose(),j.current.dispose()}return m.createElement(xM,{width:p,height:v,isEditorReady:O,loading:l,_ref:B,className:b,wrapperProps:x})}var DZ=kZ,SM=m.memo(DZ),Xy=SM;function MZ(e){const t=e.toUpperCase().indexOf("WHERE"),n=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),i=e.toUpperCase().indexOf("ORDER BY");let o=e.length;if(i!==-1&&(o=i),r!==-1&&r<o&&(o=r),t!==-1){const s=e.substring(0,t),a=e.substring(t);return`${s} {{ filters | where }} AND ${a.substring(6)}`}else if(n!==-1){const s=e.substring(0,n),a=e.substring(n);return`${s} {{ filters | where }} ${a}`}else{const s=e.substring(0,o),a=e.substring(o);return`${s} {{ filters | where }} ${a}`}}let Qy;const CM="HoverCard",[EM,Ife]=kn(CM,[Bi]),Zy=Bi(),[TZ,Jy]=EM(CM),AZ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:s=700,closeDelay:a=300}=e,l=Zy(t),c=m.useRef(0),d=m.useRef(0),f=m.useRef(!1),g=m.useRef(!1),[p=!1,v]=Qn({prop:r,defaultProp:i,onChange:o}),b=m.useCallback(()=>{clearTimeout(d.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),x=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!g.current&&(d.current=window.setTimeout(()=>v(!1),a))},[a,v]),w=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(d.current)},[]),m.createElement(TZ,{scope:t,open:p,onOpenChange:v,onOpen:b,onClose:x,onDismiss:w,hasSelectionRef:f,isPointerDownOnContentRef:g},m.createElement(Lu,l,n))},IZ="HoverCardTrigger",NZ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=Jy(IZ,n),o=Zy(n);return m.createElement(Fu,se({asChild:!0},o),m.createElement(He.a,se({"data-state":i.open?"open":"closed"},r,{ref:t,onPointerEnter:Pe(e.onPointerEnter,og(i.onOpen)),onPointerLeave:Pe(e.onPointerLeave,og(i.onClose)),onFocus:Pe(e.onFocus,i.onOpen),onBlur:Pe(e.onBlur,i.onClose),onTouchStart:Pe(e.onTouchStart,s=>s.preventDefault())})))}),RZ="HoverCardPortal",[Nfe,LZ]=EM(RZ,{forceMount:void 0}),ex="HoverCardContent",FZ=m.forwardRef((e,t)=>{const n=LZ(ex,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=Jy(ex,e.__scopeHoverCard);return m.createElement(yn,{present:r||o.open},m.createElement($Z,se({"data-state":o.open?"open":"closed"},i,{onPointerEnter:Pe(e.onPointerEnter,og(o.onOpen)),onPointerLeave:Pe(e.onPointerLeave,og(o.onClose)),ref:t})))}),$Z=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,...a}=e,l=Jy(ex,n),c=Zy(n),d=m.useRef(null),f=nt(t,d),[g,p]=m.useState(!1);return m.useEffect(()=>{if(g){const v=document.body;return Qy=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=Qy,v.style.webkitUserSelect=Qy}}},[g]),m.useEffect(()=>{if(d.current){const v=()=>{p(!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(()=>{d.current&&jZ(d.current).forEach(b=>b.setAttribute("tabindex","-1"))}),m.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:Pe(o,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement($u,se({},c,a,{onPointerDown:Pe(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"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 og(e){return t=>t.pointerType==="touch"?void 0:e()}function jZ(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 zZ=AZ,BZ=NZ,OM=FZ,PM=zZ,kM=BZ,tx=de.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>_.jsx(OM,{ref:i,align:t,sideOffset:n,className:De("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}));tx.displayName=OM.displayName;function VZ({error:e}){return _.jsxs(PM,{openDelay:0,children:[_.jsx(kM,{asChild:!0,children:_.jsx(it,{variant:"link",className:" p-0 h-5",children:_.jsx(iH,{className:"h-4 w-4 text-red-500"})})}),_.jsx(tx,{align:"start",className:"w-[600px]",children:_.jsx("div",{className:"flex justify-between space-x-4",children:_.jsx("div",{className:"space-y-1",children:_.jsx("p",{className:"text-sm",children:e})})})})]})}function HZ({text:e,onCheckedChange:t,checked:n}){return _.jsxs("div",{className:"flex items-center space-x-1 xbg-red-100 ml-7",children:[_.jsx(ad,{checked:n,onCheckedChange:t}),_.jsx("label",{className:"text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function WZ(){const e=fe(a=>a.authToken),t=m.useRef(null),n=ve(a=>a.applyFilters),[r,i]=m.useState(""),o=ve(a=>a.filterValues),s=ve(a=>a.card.sql);return _.jsxs(PM,{openDelay:0,onOpenChange:async a=>{if(!a)return;console.log("onOpenChange");const l=await ll("https://semaphor.cloud/api/v1/filter-sql",(e==null?void 0:e.accessToken)||"",{sql:s,active_filters:o});console.log(l),l.sql?(console.log(l.records),i(l.sql)):i("Error")},children:[_.jsx(kM,{asChild:!0,children:n&&_.jsx("p",{className:" p-0 hover:cursor-pointer text-xs",children:"|  Filter Query"})}),_.jsxs(tx,{align:"end",className:"w-[600px] ",children:[_.jsx("div",{className:" flex justify-between space-x-4",children:_.jsx("div",{className:"bg-muted p-2 rounded-sm",children:_.jsxs("code",{ref:t,className:"text-sm font-mono ",children:[r,_.jsx(y2,{onClick:()=>s3(t),className:" inline-block ml-3 h-4 w-4 opacity-70 hover:opacity-100 hover:cursor-pointer"})]})})}),_.jsxs("div",{className:"flex gap-2 items-center pt-2",children:[_.jsx(jb,{className:"h-4 w-4 opacity-70"}),_.jsx("span",{className:"text-xs text-muted-foreground",children:"A preview of the query with filters applied."})]})]})]})}const nx=de.forwardRef(({className:e,...t},n)=>_.jsx("textarea",{className:De("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}));nx.displayName="Textarea";function Rfe(){}function Lfe(){}function UZ(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const qZ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,GZ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,YZ={};function DM(e,t){return((t||YZ).jsx?GZ:qZ).test(e)}const KZ=/[ \t\n\f\r]/g;function XZ(e){return typeof e=="object"?e.type==="text"?MM(e.value):!1:MM(e)}function MM(e){return e.replace(KZ,"")===""}class bd{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}bd.prototype.property={},bd.prototype.normal={},bd.prototype.space=null;function TM(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new bd(n,r,t)}function rx(e){return e.toLowerCase()}class ii{constructor(t,n){this.property=t,this.attribute=n}}ii.prototype.space=null,ii.prototype.boolean=!1,ii.prototype.booleanish=!1,ii.prototype.overloadedBoolean=!1,ii.prototype.number=!1,ii.prototype.commaSeparated=!1,ii.prototype.spaceSeparated=!1,ii.prototype.commaOrSpaceSeparated=!1,ii.prototype.mustUseProperty=!1,ii.prototype.defined=!1;let QZ=0;const ut=Aa(),wn=Aa(),AM=Aa(),ke=Aa(),Ut=Aa(),ec=Aa(),$r=Aa();function Aa(){return 2**++QZ}const ix=Object.freeze(Object.defineProperty({__proto__:null,boolean:ut,booleanish:wn,commaOrSpaceSeparated:$r,commaSeparated:ec,number:ke,overloadedBoolean:AM,spaceSeparated:Ut},Symbol.toStringTag,{value:"Module"})),ox=Object.keys(ix);class sx extends ii{constructor(t,n,r,i){let o=-1;if(super(t,n),IM(this,"space",i),typeof r=="number")for(;++o<ox.length;){const s=ox[o];IM(this,ox[o],(r&ix[s])===ix[s])}}}sx.prototype.defined=!0;function IM(e,t,n){n&&(e[t]=n)}const ZZ={}.hasOwnProperty;function tc(e){const t={},n={};let r;for(r in e.properties)if(ZZ.call(e.properties,r)){const i=e.properties[r],o=new sx(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[rx(r)]=r,n[rx(o.attribute)]=r}return new bd(t,n,e.space)}const NM=tc({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}}),RM=tc({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function LM(e,t){return t in e?e[t]:t}function FM(e,t){return LM(e,t.toLowerCase())}const $M=tc({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:FM,properties:{xmlns:null,xmlnsXLink:null}}),jM=tc({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:wn,ariaAutoComplete:null,ariaBusy:wn,ariaChecked:wn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Ut,ariaCurrent:null,ariaDescribedBy:Ut,ariaDetails:null,ariaDisabled:wn,ariaDropEffect:Ut,ariaErrorMessage:null,ariaExpanded:wn,ariaFlowTo:Ut,ariaGrabbed:wn,ariaHasPopup:null,ariaHidden:wn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ut,ariaLevel:ke,ariaLive:null,ariaModal:wn,ariaMultiLine:wn,ariaMultiSelectable:wn,ariaOrientation:null,ariaOwns:Ut,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:wn,ariaReadOnly:wn,ariaRelevant:null,ariaRequired:wn,ariaRoleDescription:Ut,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:wn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null}}),JZ=tc({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:FM,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ec,acceptCharset:Ut,accessKey:Ut,action:null,allow:null,allowFullScreen:ut,allowPaymentRequest:ut,allowUserMedia:ut,alt:null,as:null,async:ut,autoCapitalize:null,autoComplete:Ut,autoFocus:ut,autoPlay:ut,blocking:Ut,capture:null,charSet:null,checked:ut,cite:null,className:Ut,cols:ke,colSpan:null,content:null,contentEditable:wn,controls:ut,controlsList:Ut,coords:ke|ec,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ut,defer:ut,dir:null,dirName:null,disabled:ut,download:AM,draggable:wn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ut,formTarget:null,headers:Ut,height:ke,hidden:ut,high:ke,href:null,hrefLang:null,htmlFor:Ut,httpEquiv:Ut,id:null,imageSizes:null,imageSrcSet:null,inert:ut,inputMode:null,integrity:null,is:null,isMap:ut,itemId:null,itemProp:Ut,itemRef:Ut,itemScope:ut,itemType:Ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ut,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:ut,muted:ut,name:null,nonce:null,noModule:ut,noValidate:ut,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:ut,optimum:ke,pattern:null,ping:Ut,placeholder:null,playsInline:ut,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ut,referrerPolicy:null,rel:Ut,required:ut,reversed:ut,rows:ke,rowSpan:ke,sandbox:Ut,scope:null,scoped:ut,seamless:ut,selected:ut,shadowRootDelegatesFocus:ut,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:wn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:ut,useMap:null,value:wn,width:ke,wrap:null,align:null,aLink:null,archive:Ut,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ut,declare:ut,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:ut,noHref:ut,noShade:ut,noWrap:ut,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:wn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ut,disableRemotePlayback:ut,prefix:null,property:null,results:ke,security:null,unselectable:null}}),eJ=tc({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:LM,properties:{about:$r,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Ut,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:ut,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ec,g2:ec,glyphName:ec,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:$r,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ke,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$r,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$r,rev:$r,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$r,requiredFeatures:$r,requiredFonts:$r,requiredFormats:$r,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:$r,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$r,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$r,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),tJ=/^data[-\w.:]+$/i,zM=/-[a-z]/g,nJ=/[A-Z]/g;function rJ(e,t){const n=rx(t);let r=t,i=ii;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&tJ.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(zM,oJ);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!zM.test(o)){let s=o.replace(nJ,iJ);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=sx}return new i(r,t)}function iJ(e){return"-"+e.toLowerCase()}function oJ(e){return e.charAt(1).toUpperCase()}const sJ={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"},aJ=TM([RM,NM,$M,jM,JZ],"html"),ax=TM([RM,NM,$M,jM,eJ],"svg");function lJ(e){return e.join(" ").trim()}var BM={},VM=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,cJ=/\n/g,uJ=/^\s*/,dJ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,fJ=/^:\s*/,hJ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,pJ=/^[;\s]*/,gJ=/^\s+|\s+$/g,mJ=`
429
- `,HM="/",WM="*",Ia="",vJ="comment",bJ="declaration",yJ=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 i(v){var b=v.match(cJ);b&&(n+=b.length);var x=v.lastIndexOf(mJ);r=~x?v.length-x:r+v.length}function o(){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 i(x),e=e.slice(x.length),b}}function c(){l(uJ)}function d(v){var b;for(v=v||[];b=f();)b!==!1&&v.push(b);return v}function f(){var v=o();if(!(HM!=e.charAt(0)||WM!=e.charAt(1))){for(var b=2;Ia!=e.charAt(b)&&(WM!=e.charAt(b)||HM!=e.charAt(b+1));)++b;if(b+=2,Ia===e.charAt(b-1))return a("End of comment missing");var x=e.slice(2,b-2);return r+=2,i(x),e=e.slice(b),r+=2,v({type:vJ,comment:x})}}function g(){var v=o(),b=l(dJ);if(b){if(f(),!l(fJ))return a("property missing ':'");var x=l(hJ),w=v({type:bJ,property:UM(b[0].replace(VM,Ia)),value:x?UM(x[0].replace(VM,Ia)):Ia});return l(pJ),w}}function p(){var v=[];d(v);for(var b;b=g();)b!==!1&&(v.push(b),d(v));return v}return c(),p()};function UM(e){return e?e.replace(gJ,Ia):Ia}var xJ=Ho&&Ho.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(BM,"__esModule",{value:!0});var wJ=xJ(yJ);function _J(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,wJ.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}var qM=BM.default=_J;const SJ=qM.default||qM,GM=YM("end"),lx=YM("start");function YM(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 CJ(e){const t=lx(e),n=GM(e);if(t&&n)return{start:t,end:n}}function yd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?KM(e.position):"start"in e||"end"in e?KM(e):"line"in e||"column"in e?cx(e):""}function cx(e){return XM(e&&e.line)+":"+XM(e&&e.column)}function KM(e){return cx(e&&e.start)+"-"+cx(e&&e.end)}function XM(e){return e&&typeof e=="number"?e:1}class Gn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=yd(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Gn.prototype.file="",Gn.prototype.name="",Gn.prototype.reason="",Gn.prototype.message="",Gn.prototype.stack="",Gn.prototype.column=void 0,Gn.prototype.line=void 0,Gn.prototype.ancestors=void 0,Gn.prototype.cause=void 0,Gn.prototype.fatal=void 0,Gn.prototype.place=void 0,Gn.prototype.ruleId=void 0,Gn.prototype.source=void 0;const ux={}.hasOwnProperty,EJ=new Map,OJ=/[A-Z]/g,PJ=/-([a-z])/g,kJ=new Set(["table","tbody","thead","tfoot","tr"]),DJ=new Set(["td","th"]),QM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function MJ(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=$J(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=FJ(n,t.jsx,t.jsxs)}const i={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"?ax:aJ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=ZM(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function ZM(e,t,n){if(t.type==="element")return TJ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return AJ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return NJ(e,t,n);if(t.type==="mdxjsEsm")return IJ(e,t);if(t.type==="root")return RJ(e,t,n);if(t.type==="text")return LJ(e,t)}function TJ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ax,e.schema=i),e.ancestors.push(t);const o=eT(e,t.tagName,!1),s=jJ(e,t);let a=fx(e,t);return kJ.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!XZ(l):!0})),JM(e,s,o,t),dx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function AJ(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)}xd(e,t.position)}function IJ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xd(e,t.position)}function NJ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ax,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:eT(e,t.name,!0),s=zJ(e,t),a=fx(e,t);return JM(e,s,o,t),dx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function RJ(e,t,n){const r={};return dx(r,fx(e,t)),e.create(t,e.Fragment,r,n)}function LJ(e,t){return t.value}function JM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function dx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function FJ(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function $J(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=lx(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function jJ(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ux.call(t.properties,i)){const o=BJ(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&DJ.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function zJ(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else xd(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(a.expression)}else xd(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function fx(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:EJ;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=ZM(e,o,s);a!==void 0&&n.push(a)}return n}function BJ(e,t,n){const r=rJ(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?UZ(n):lJ(n)),r.property==="style"){let i=typeof n=="object"?n:VJ(e,String(n));return e.stylePropertyNameCase==="css"&&(i=HJ(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?sJ[r.property]||r.property:r.attribute,n]}}function VJ(e,t){const n={};try{SJ(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new Gn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,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(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(PJ,UJ)),n[s]=o}}function eT(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=DM(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=DM(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ux.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);xd(e)}function xd(e,t){const n=new Gn("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 HJ(e){const t={};let n;for(n in e)ux.call(e,n)&&(t[WJ(n)]=e[n]);return t}function WJ(e){let t=e.replace(OJ,qJ);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function UJ(e,t){return t.toUpperCase()}function qJ(e){return"-"+e.toLowerCase()}const hx={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"]},GJ={};function YJ(e,t){const n=t||GJ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return tT(e,r,i)}function tT(e,t,n){if(KJ(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 nT(e.children,t,n)}return Array.isArray(e)?nT(e,t,n):""}function nT(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=tT(e[i],t,n);return r.join("")}function KJ(e){return!!(e&&typeof e=="object")}const rT=document.createElement("i");function px(e){const t="&"+e+";";rT.innerHTML=t;const n=rT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Yi(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i: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);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function oi(e,t){return e.length>0?(Yi(e,e.length,0,t),e):t}const iT={}.hasOwnProperty;function XJ(e){const t={};let n=-1;for(;++n<e.length;)QJ(t,e[n]);return t}function QJ(e,t){let n;for(n in t){const i=(iT.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){iT.call(i,s)||(i[s]=[]);const a=o[s];ZJ(i[s],Array.isArray(a)?a:a?[a]:[])}}}function ZJ(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Yi(e,0,0,r)}function oT(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 nc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const JJ=vs(new RegExp("\\p{P}","u")),Ki=vs(/[A-Za-z]/),jr=vs(/[\dA-Za-z]/),eee=vs(/[#-'*+\--9=?A-Z^-~]/);function gx(e){return e!==null&&(e<32||e===127)}const mx=vs(/\d/),tee=vs(/[\dA-Fa-f]/),sT=vs(/[!-/:-@[-`{-~]/);function Qe(e){return e!==null&&e<-2}function hr(e){return e!==null&&(e<0||e===32)}function Mt(e){return e===-2||e===-1||e===32}function nee(e){return sT(e)||JJ(e)}const ree=vs(/\s/);function vs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function rc(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&jr(e.charCodeAt(n+1))&&jr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function qt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Mt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Mt(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const iee={tokenize:oee};function oee(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),qt(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(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 Qe(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const see={tokenize:aee},aT={tokenize:lee};function aee(e){const t=this,n=[];let r=0,i,o,s;return a;function a(C){if(r<n.length){const P=n[r];return t.containerState=P[1],e.attempt(P[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const P=t.events.length;let O=P,k;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){k=t.events[O][1].end;break}w(r);let T=P;for(;T<t.events.length;)t.events[T][1].end=Object.assign({},k),T++;return Yi(t.events,O+1,0,t.events.slice(P)),t.events.length=T,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return g(C);if(i.currentConstruct&&i.currentConstruct.concrete)return v(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(aT,d,f)(C)}function d(C){return i&&S(),w(r),g(C)}function f(C){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,v(C)}function g(C){return t.containerState={},e.attempt(aT,p,v)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function v(C){if(C===null){i&&S(),w(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),b(C)}function b(C){if(C===null){x(e.exit("chunkFlow"),!0),w(0),e.consume(C);return}return Qe(C)?(e.consume(C),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),b)}function x(C,P){const O=t.sliceStream(C);if(P&&O.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(O),t.parser.lazy[C.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;const T=t.events.length;let I=T,F,j;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(F){j=t.events[I][1].end;break}F=!0}for(w(r),k=T;k<t.events.length;)t.events[k][1].end=Object.assign({},j),k++;Yi(t.events,I+1,0,t.events.slice(T)),t.events.length=k}}function w(C){let P=n.length;for(;P-- >C;){const O=n[P];t.containerState=O[1],O[0].exit.call(t,e)}n.length=C}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function lee(e,t,n){return qt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function lT(e){if(e===null||hr(e)||ree(e))return 1;if(nee(e))return 2}function vx(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const bx={name:"attention",tokenize:uee,resolveAll:cee};function cee(e,t){let n=-1,r,i,o,s,a,l,c,d;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),g=Object.assign({},e[n][1].start);cT(f,-l),cT(g,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:g},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={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=oi(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=oi(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=oi(c,vx(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=oi(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=oi(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Yi(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function uee(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=lT(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),d=lT(l),f=!d||d===2&&i||n.includes(l),g=!i||i===2&&d||n.includes(r);return c._open=!!(o===42?f:f&&(i||!g)),c._close=!!(o===42?g:g&&(d||!f)),t(l)}}function cT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const dee={name:"autolink",tokenize:fee};function fee(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Ki(p)?(e.consume(p),s):c(p)}function s(p){return p===43||p===45||p===46||jr(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||jr(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||gx(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),d):eee(p)?(e.consume(p),c):n(p)}function d(p){return jr(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):g(p)}function g(p){if((p===45||jr(p))&&r++<63){const v=p===45?g:f;return e.consume(p),v}return n(p)}}const sg={tokenize:hee,partial:!0};function hee(e,t,n){return r;function r(o){return Mt(o)?qt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Qe(o)?t(o):n(o)}}const uT={name:"blockQuote",tokenize:pee,continuation:{tokenize:gee},exit:mee};function pee(e,t,n){const r=this;return i;function i(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"),o}return n(s)}function o(s){return Mt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function gee(e,t,n){const r=this;return i;function i(s){return Mt(s)?qt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(uT,t,n)(s)}}function mee(e){e.exit("blockQuote")}const dT={name:"characterEscape",tokenize:vee};function vee(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return sT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const fT={name:"characterReference",tokenize:bee};function bee(e,t,n){const r=this;let i=0,o,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"),o=31,s=jr,d(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=tee,d):(e.enter("characterReferenceValue"),o=7,s=mx,d(f))}function d(f){if(f===59&&i){const g=e.exit("characterReferenceValue");return s===jr&&!px(r.sliceSerialize(g))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),d):n(f)}}const hT={tokenize:xee,partial:!0},pT={name:"codeFenced",tokenize:yee,concrete:!0};function yee(e,t,n){const r=this,i={tokenize:O,partial:!0};let o=0,s=0,a;return l;function l(k){return c(k)}function c(k){const T=r.events[r.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===a?(s++,e.consume(k),d):s<3?n(k):(e.exit("codeFencedFenceSequence"),Mt(k)?qt(e,f,"whitespace")(k):f(k))}function f(k){return k===null||Qe(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(hT,b,P)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||Qe(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):Mt(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qt(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),g)}function p(k){return k===null||Qe(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===null||Qe(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===a?n(k):(e.consume(k),v)}function b(k){return e.attempt(i,P,x)(k)}function x(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),w}function w(k){return o>0&&Mt(k)?qt(e,S,"linePrefix",o+1)(k):S(k)}function S(k){return k===null||Qe(k)?e.check(hT,b,P)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||Qe(k)?(e.exit("codeFlowValue"),S(k)):(e.consume(k),C)}function P(k){return e.exit("codeFenced"),t(k)}function O(k,T,I){let F=0;return j;function j($){return k.enter("lineEnding"),k.consume($),k.exit("lineEnding"),B}function B($){return k.enter("codeFencedFence"),Mt($)?qt(k,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):V($)}function V($){return $===a?(k.enter("codeFencedFenceSequence"),q($)):I($)}function q($){return $===a?(F++,k.consume($),q):F>=s?(k.exit("codeFencedFenceSequence"),Mt($)?qt(k,J,"whitespace")($):J($)):I($)}function J($){return $===null||Qe($)?(k.exit("codeFencedFence"),T($)):I($)}}}function xee(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const yx={name:"codeIndented",tokenize:_ee},wee={tokenize:See,partial:!0};function _ee(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),qt(e,o,"linePrefix",5)(c)}function o(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Qe(c)?e.attempt(wee,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Qe(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function See(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Qe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):qt(e,o,"linePrefix",5)(s)}function o(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):Qe(s)?i(s):n(s)}}const Cee={name:"codeText",tokenize:Pee,resolve:Eee,previous:Oee};function Eee(e){let t=e.length-4,n=3,r,i;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;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Oee(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Pee(e,t,n){let r=0,i,o;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?(o=e.enter("codeTextSequence"),i=0,d(f)):Qe(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||Qe(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(o.type="codeTextData",c(f))}}function gT(e){const t={};let n=-1,r,i,o,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,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,kee(e,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=e[o],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),Yi(e,i,n-i+1,a))}}return!c}function kee(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let d,f,g=-1,p=n,v=0,b=0;const x=[b];for(;p;){for(;e[++i][1]!==p;);o.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(b=g+1,x.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),g=x.length;g--;){const w=a.slice(x[g],x[g+1]),S=o.pop();l.unshift([S,S+w.length-1]),Yi(e,S,2,w)}for(g=-1;++g<l.length;)c[v+l[g][0]]=v+l[g][1],v+=l[g][1]-l[g][0]-1;return c}const Dee={tokenize:Aee,resolve:Tee},Mee={tokenize:Iee,partial:!0};function Tee(e){return gT(e),e}function Aee(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):Qe(a)?e.check(Mee,s,o)(a):(e.consume(a),i)}function o(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,i}}function Iee(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),qt(e,o,"linePrefix")}function o(s){if(s===null||Qe(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 mT(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),g):w===null||w===32||w===41||gx(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(w))}function g(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),g(w)):w===null||w===60||Qe(w)?n(w):(e.consume(w),w===92?v:p)}function v(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function b(w){return!d&&(w===null||w===41||hr(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):d<c&&w===40?(e.consume(w),d++,b):w===41?(e.consume(w),d--,b):w===null||w===32||w===40||gx(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 vT(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Qe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Qe(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!Mt(p)),p===92?g:f)}function g(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function bT(e,t,n,r,i,o){let s;return a;function a(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),s=g===40?41:g,l):n(g)}function l(g){return g===s?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(o),c(g))}function c(g){return g===s?(e.exit(o),l(s)):g===null?n(g):Qe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),qt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===s||g===null||Qe(g)?(e.exit("chunkString"),c(g)):(e.consume(g),g===92?f:d)}function f(g){return g===s||g===92?(e.consume(g),d):d(g)}}function wd(e,t){let n;return r;function r(i){return Qe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Mt(i)?qt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Nee={name:"definition",tokenize:Lee},Ree={tokenize:Fee,partial:!0};function Lee(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return vT.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=nc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return hr(p)?wd(e,c)(p):c(p)}function c(p){return mT(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Ree,f,f)(p)}function f(p){return Mt(p)?qt(e,g,"whitespace")(p):g(p)}function g(p){return p===null||Qe(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function Fee(e,t,n){return r;function r(a){return hr(a)?wd(e,i)(a):n(a)}function i(a){return bT(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Mt(a)?qt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Qe(a)?t(a):n(a)}}const $ee={name:"hardBreakEscape",tokenize:jee};function jee(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Qe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const zee={name:"headingAtx",tokenize:Vee,resolve:Bee};function Bee(e,t){let n=e.length-2,r=3,i,o;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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Yi(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Vee(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||hr(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Qe(d)?(e.exit("atxHeading"),t(d)):Mt(d)?qt(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||hr(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}const Hee=["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"],yT=["pre","script","style","textarea"],Wee={name:"htmlFlow",tokenize:Yee,resolveTo:Gee,concrete:!0},Uee={tokenize:Xee,partial:!0},qee={tokenize:Kee,partial:!0};function Gee(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 Yee(e,t,n){const r=this;let i,o,s,a,l;return c;function c(R){return d(R)}function d(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),f}function f(R){return R===33?(e.consume(R),g):R===47?(e.consume(R),o=!0,b):R===63?(e.consume(R),i=3,r.interrupt?t:A):Ki(R)?(e.consume(R),s=String.fromCharCode(R),x):n(R)}function g(R){return R===45?(e.consume(R),i=2,p):R===91?(e.consume(R),i=5,a=0,v):Ki(R)?(e.consume(R),i=4,r.interrupt?t:A):n(R)}function p(R){return R===45?(e.consume(R),r.interrupt?t:A):n(R)}function v(R){const ue="CDATA[";return R===ue.charCodeAt(a++)?(e.consume(R),a===ue.length?r.interrupt?t:V:v):n(R)}function b(R){return Ki(R)?(e.consume(R),s=String.fromCharCode(R),x):n(R)}function x(R){if(R===null||R===47||R===62||hr(R)){const ue=R===47,xe=s.toLowerCase();return!ue&&!o&&yT.includes(xe)?(i=1,r.interrupt?t(R):V(R)):Hee.includes(s.toLowerCase())?(i=6,ue?(e.consume(R),w):r.interrupt?t(R):V(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):o?S(R):C(R))}return R===45||jr(R)?(e.consume(R),s+=String.fromCharCode(R),x):n(R)}function w(R){return R===62?(e.consume(R),r.interrupt?t:V):n(R)}function S(R){return Mt(R)?(e.consume(R),S):j(R)}function C(R){return R===47?(e.consume(R),j):R===58||R===95||Ki(R)?(e.consume(R),P):Mt(R)?(e.consume(R),C):j(R)}function P(R){return R===45||R===46||R===58||R===95||jr(R)?(e.consume(R),P):O(R)}function O(R){return R===61?(e.consume(R),k):Mt(R)?(e.consume(R),O):C(R)}function k(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),l=R,T):Mt(R)?(e.consume(R),k):I(R)}function T(R){return R===l?(e.consume(R),l=null,F):R===null||Qe(R)?n(R):(e.consume(R),T)}function I(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||hr(R)?O(R):(e.consume(R),I)}function F(R){return R===47||R===62||Mt(R)?C(R):n(R)}function j(R){return R===62?(e.consume(R),B):n(R)}function B(R){return R===null||Qe(R)?V(R):Mt(R)?(e.consume(R),B):n(R)}function V(R){return R===45&&i===2?(e.consume(R),X):R===60&&i===1?(e.consume(R),W):R===62&&i===4?(e.consume(R),H):R===63&&i===3?(e.consume(R),A):R===93&&i===5?(e.consume(R),le):Qe(R)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Uee,re,q)(R)):R===null||Qe(R)?(e.exit("htmlFlowData"),q(R)):(e.consume(R),V)}function q(R){return e.check(qee,J,re)(R)}function J(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),$}function $(R){return R===null||Qe(R)?q(R):(e.enter("htmlFlowData"),V(R))}function X(R){return R===45?(e.consume(R),A):V(R)}function W(R){return R===47?(e.consume(R),s="",ne):V(R)}function ne(R){if(R===62){const ue=s.toLowerCase();return yT.includes(ue)?(e.consume(R),H):V(R)}return Ki(R)&&s.length<8?(e.consume(R),s+=String.fromCharCode(R),ne):V(R)}function le(R){return R===93?(e.consume(R),A):V(R)}function A(R){return R===62?(e.consume(R),H):R===45&&i===2?(e.consume(R),A):V(R)}function H(R){return R===null||Qe(R)?(e.exit("htmlFlowData"),re(R)):(e.consume(R),H)}function re(R){return e.exit("htmlFlow"),t(R)}}function Kee(e,t,n){const r=this;return i;function i(s){return Qe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Xee(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(sg,t,n)}}const Qee={name:"htmlText",tokenize:Zee};function Zee(e,t,n){const r=this;let i,o,s;return a;function a(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),l}function l(A){return A===33?(e.consume(A),c):A===47?(e.consume(A),O):A===63?(e.consume(A),C):Ki(A)?(e.consume(A),I):n(A)}function c(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),o=0,v):Ki(A)?(e.consume(A),S):n(A)}function d(A){return A===45?(e.consume(A),p):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),g):Qe(A)?(s=f,W(A)):(e.consume(A),f)}function g(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?X(A):A===45?g(A):f(A)}function v(A){const H="CDATA[";return A===H.charCodeAt(o++)?(e.consume(A),o===H.length?b:v):n(A)}function b(A){return A===null?n(A):A===93?(e.consume(A),x):Qe(A)?(s=b,W(A)):(e.consume(A),b)}function x(A){return A===93?(e.consume(A),w):b(A)}function w(A){return A===62?X(A):A===93?(e.consume(A),w):b(A)}function S(A){return A===null||A===62?X(A):Qe(A)?(s=S,W(A)):(e.consume(A),S)}function C(A){return A===null?n(A):A===63?(e.consume(A),P):Qe(A)?(s=C,W(A)):(e.consume(A),C)}function P(A){return A===62?X(A):C(A)}function O(A){return Ki(A)?(e.consume(A),k):n(A)}function k(A){return A===45||jr(A)?(e.consume(A),k):T(A)}function T(A){return Qe(A)?(s=T,W(A)):Mt(A)?(e.consume(A),T):X(A)}function I(A){return A===45||jr(A)?(e.consume(A),I):A===47||A===62||hr(A)?F(A):n(A)}function F(A){return A===47?(e.consume(A),X):A===58||A===95||Ki(A)?(e.consume(A),j):Qe(A)?(s=F,W(A)):Mt(A)?(e.consume(A),F):X(A)}function j(A){return A===45||A===46||A===58||A===95||jr(A)?(e.consume(A),j):B(A)}function B(A){return A===61?(e.consume(A),V):Qe(A)?(s=B,W(A)):Mt(A)?(e.consume(A),B):F(A)}function V(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,q):Qe(A)?(s=V,W(A)):Mt(A)?(e.consume(A),V):(e.consume(A),J)}function q(A){return A===i?(e.consume(A),i=void 0,$):A===null?n(A):Qe(A)?(s=q,W(A)):(e.consume(A),q)}function J(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||hr(A)?F(A):(e.consume(A),J)}function $(A){return A===47||A===62||hr(A)?F(A):n(A)}function X(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function W(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),ne}function ne(A){return Mt(A)?qt(e,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):le(A)}function le(A){return e.enter("htmlTextData"),s(A)}}const xx={name:"labelEnd",tokenize:ite,resolveTo:rte,resolveAll:nte},Jee={tokenize:ote},ete={tokenize:ste},tte={tokenize:ate};function nte(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 rte(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[s][1].end)},d={type:"labelText",start:Object.assign({},e[o+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=oi(a,e.slice(o+1,o+r+3)),a=oi(a,[["enter",d,t]]),a=oi(a,vx(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=oi(a,[["exit",d,t],e[s-2],e[s-1],["exit",c,t]]),a=oi(a,e.slice(s+1)),a=oi(a,[["exit",l,t]]),Yi(e,o,e.length,a),e}function ite(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(g){return o?o._inactive?f(g):(s=r.parser.defined.includes(nc(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),l):n(g)}function l(g){return g===40?e.attempt(Jee,d,s?d:f)(g):g===91?e.attempt(ete,d,s?c:f)(g):s?d(g):f(g)}function c(g){return e.attempt(tte,d,f)(g)}function d(g){return t(g)}function f(g){return o._balanced=!0,n(g)}}function ote(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return hr(f)?wd(e,o)(f):o(f)}function o(f){return f===41?d(f):mT(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return hr(f)?wd(e,l)(f):d(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?bT(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function c(f){return hr(f)?wd(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function ste(e,t,n){const r=this;return i;function i(a){return vT.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(nc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function ate(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const lte={name:"labelStartImage",tokenize:cte,resolveAll:xx.resolveAll};function cte(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(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 ute={name:"labelStartLink",tokenize:dte,resolveAll:xx.resolveAll};function dte(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const wx={name:"lineEnding",tokenize:fte};function fte(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qt(e,t,"linePrefix")}}const ag={name:"thematicBreak",tokenize:hte};function hte(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Qe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Mt(c)?qt(e,a,"whitespace")(c):a(c))}}const pr={name:"list",tokenize:mte,continuation:{tokenize:vte},exit:yte},pte={tokenize:xte,partial:!0},gte={tokenize:bte,partial:!0};function mte(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){const v=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:mx(p)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ag,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return mx(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(sg,r.interrupt?n:d,e.attempt(pte,g,f))}function d(p){return r.containerState.initialBlankLine=!0,o++,g(p)}function f(p){return Mt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),g):n(p)}function g(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function vte(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(sg,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,qt(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Mt(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(gte,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,qt(e,e.attempt(pr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function bte(e,t,n){const r=this;return qt(e,i,"listItemIndent",r.containerState.size+1);function i(o){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(o):n(o)}}function yte(e){e.exit(this.containerState.type)}function xte(e,t,n){const r=this;return qt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Mt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const xT={name:"setextUnderline",tokenize:_te,resolveTo:wte};function wte(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function _te(e,t,n){const r=this;let i;return o;function o(c){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Mt(c)?qt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Qe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Ste={tokenize:Cte};function Cte(e){const t=this,n=e.attempt(sg,r,e.attempt(this.parser.constructs.flowInitial,i,qt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Dee,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Ete={resolveAll:_T()},Ote=wT("string"),Pte=wT("text");function wT(e){return{tokenize:t,resolveAll:_T(e==="text"?kte:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(d){return c(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),o(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const f=i[d];let g=-1;if(f)for(;++g<f.length;){const p=f[g];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function _T(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function kte(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],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];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){o++;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+o,_bufferIndex:o?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 Dte(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let s=[],a=[];const l={consume:S,enter:C,exit:P,attempt:T(O),check:T(k),interrupt:T(k,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:g,now:v,defineSkip:b,write:f};let d=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function f(B){return s=oi(s,B),x(),s[s.length-1]!==null?[]:(I(t,0),c.events=vx(o,c.events,c),c.events)}function g(B,V){return Tte(p(B),V)}function p(B){return Mte(s,B)}function v(){const{line:B,column:V,offset:q,_index:J,_bufferIndex:$}=r;return{line:B,column:V,offset:q,_index:J,_bufferIndex:$}}function b(B){i[B.line]=B.column,j()}function x(){let B;for(;r._index<s.length;){const V=s[r._index];if(typeof V=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<V.length;)w(V.charCodeAt(r._bufferIndex));else w(V)}}function w(B){d=d(B)}function S(B){Qe(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,j()):B!==-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=B}function C(B,V){const q=V||{};return q.type=B,q.start=v(),c.events.push(["enter",q,c]),a.push(q),q}function P(B){const V=a.pop();return V.end=v(),c.events.push(["exit",V,c]),V}function O(B,V){I(B,V.from)}function k(B,V){V.restore()}function T(B,V){return q;function q(J,$,X){let W,ne,le,A;return Array.isArray(J)?re(J):"tokenize"in J?re([J]):H(J);function H(ge){return pe;function pe(ee){const Q=ee!==null&&ge[ee],ie=ee!==null&&ge.null,we=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return re(we)(ee)}}function re(ge){return W=ge,ne=0,ge.length===0?X:R(ge[ne])}function R(ge){return pe;function pe(ee){return A=F(),le=ge,ge.partial||(c.currentConstruct=ge),ge.name&&c.parser.constructs.disable.null.includes(ge.name)?xe():ge.tokenize.call(V?Object.assign(Object.create(c),V):c,l,ue,xe)(ee)}}function ue(ge){return B(le,A),$}function xe(ge){return A.restore(),++ne<W.length?R(W[ne]):X}}}function I(B,V){B.resolveAll&&!o.includes(B)&&o.push(B),B.resolve&&Yi(c.events,V,c.events.length-V,B.resolve(c.events.slice(V),c)),B.resolveTo&&(c.events=B.resolveTo(c.events,c))}function F(){const B=v(),V=c.previous,q=c.currentConstruct,J=c.events.length,$=Array.from(a);return{restore:X,from:J};function X(){r=B,c.previous=V,c.currentConstruct=q,c.events.length=J,a=$,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Mte(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Tte(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
428
+ `},gM=XQ(eZ)(pM),tZ={config:ZQ},nZ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function mM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],mM(e[n],t[n]))}),uM(uM({},e),t)}var rZ={type:"cancelation",msg:"operation is manually canceled"};function Gy(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(rZ):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var iZ=YQ.create({config:KQ,isInitialized:!1,resolve:null,reject:null,monaco:null}),vM=DQ(iZ,2),md=vM[0],rg=vM[1];function oZ(e){var t=tZ.config(e),n=t.monaco,r=kQ(t,["monaco"]);rg(function(i){return{config:mM(i.config,r),monaco:n}})}function sZ(){var e=md(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(rg({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Gy(Yy);if(window.monaco&&window.monaco.editor)return bM(window.monaco),e.resolve(window.monaco),Gy(Yy);nZ(aZ,cZ)(uZ)}return Gy(Yy)}function aZ(e){return document.body.appendChild(e)}function lZ(e){var t=document.createElement("script");return e&&(t.src=e),t}function cZ(e){var t=md(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=lZ("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function uZ(){var e=md(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){bM(n),e.resolve(n)},function(n){e.reject(n)})}function bM(e){md().monaco||rg({monaco:e})}function dZ(){return md(function(e){var t=e.monaco;return t})}var Yy=new Promise(function(e,t){return rg({resolve:e,reject:t})}),yM={config:oZ,init:sZ,__getMonacoInstance:dZ},fZ={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ky=fZ,hZ={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},pZ=hZ;function gZ({children:e}){return m.createElement("div",{style:pZ.container},e)}var mZ=gZ,vZ=mZ;function bZ({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return m.createElement("section",{style:{...Ky.wrapper,width:e,height:t},...s},!n&&m.createElement(vZ,null,r),m.createElement("div",{ref:i,style:{...Ky.fullWidth,...!n&&Ky.hide},className:o}))}var yZ=bZ,xM=m.memo(yZ);function xZ(e){m.useEffect(e,[])}var wM=xZ;function wZ(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Fr=wZ;function vd(){}function Jl(e,t,n,r){return _Z(e,r)||SZ(e,t,n,r)}function _Z(e,t){return e.editor.getModel(_M(e,t))}function SZ(e,t,n,r){return e.editor.createModel(t,n,r?_M(e,r):void 0)}function _M(e,t){return e.Uri.parse(t)}function CZ({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:f={},height:g="100%",width:p="100%",className:v,wrapperProps:b={},beforeMount:x=vd,onMount:w=vd}){let[S,C]=m.useState(!1),[P,O]=m.useState(!0),k=m.useRef(null),T=m.useRef(null),I=m.useRef(null),F=m.useRef(w),j=m.useRef(x),B=m.useRef(!1);wM(()=>{let $=yM.init();return $.then(X=>(T.current=X)&&O(!1)).catch(X=>(X==null?void 0:X.type)!=="cancelation"&&console.error("Monaco initialization: error:",X)),()=>k.current?J():$.cancel()}),Fr(()=>{if(k.current&&T.current){let $=k.current.getOriginalEditor(),X=Jl(T.current,e||"",r||n||"text",o||"");X!==$.getModel()&&$.setModel(X)}},[o],S),Fr(()=>{if(k.current&&T.current){let $=k.current.getModifiedEditor(),X=Jl(T.current,t||"",i||n||"text",s||"");X!==$.getModel()&&$.setModel(X)}},[s],S),Fr(()=>{let $=k.current.getModifiedEditor();$.getOption(T.current.editor.EditorOption.readOnly)?$.setValue(t||""):t!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[t],S),Fr(()=>{var $,X;(X=($=k.current)==null?void 0:$.getModel())==null||X.original.setValue(e||"")},[e],S),Fr(()=>{let{original:$,modified:X}=k.current.getModel();T.current.editor.setModelLanguage($,r||n||"text"),T.current.editor.setModelLanguage(X,i||n||"text")},[n,r,i],S),Fr(()=>{var $;($=T.current)==null||$.editor.setTheme(c)},[c],S),Fr(()=>{var $;($=k.current)==null||$.updateOptions(f)},[f],S);let V=m.useCallback(()=>{var W;if(!T.current)return;j.current(T.current);let $=Jl(T.current,e||"",r||n||"text",o||""),X=Jl(T.current,t||"",i||n||"text",s||"");(W=k.current)==null||W.setModel({original:$,modified:X})},[n,t,i,e,r,o,s]),q=m.useCallback(()=>{var $;!B.current&&I.current&&(k.current=T.current.editor.createDiffEditor(I.current,{automaticLayout:!0,...f}),V(),($=T.current)==null||$.editor.setTheme(c),C(!0),B.current=!0)},[f,c,V]);m.useEffect(()=>{S&&F.current(k.current,T.current)},[S]),m.useEffect(()=>{!P&&!S&&q()},[P,S,q]);function J(){var X,W,te,le;let $=(X=k.current)==null?void 0:X.getModel();a||((W=$==null?void 0:$.original)==null||W.dispose()),l||((te=$==null?void 0:$.modified)==null||te.dispose()),(le=k.current)==null||le.dispose()}return m.createElement(xM,{width:p,height:g,isEditorReady:S,loading:d,_ref:I,className:v,wrapperProps:b})}var EZ=CZ;m.memo(EZ);function OZ(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var PZ=OZ,ig=new Map;function kZ({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:f=!0,keepCurrentModel:g=!1,width:p="100%",height:v="100%",className:b,wrapperProps:x={},beforeMount:w=vd,onMount:S=vd,onChange:C,onValidate:P=vd}){let[O,k]=m.useState(!1),[T,I]=m.useState(!0),F=m.useRef(null),j=m.useRef(null),B=m.useRef(null),V=m.useRef(S),q=m.useRef(w),J=m.useRef(),$=m.useRef(r),X=PZ(o),W=m.useRef(!1),te=m.useRef(!1);wM(()=>{let H=yM.init();return H.then(ne=>(F.current=ne)&&I(!1)).catch(ne=>(ne==null?void 0:ne.type)!=="cancelation"&&console.error("Monaco initialization: error:",ne)),()=>j.current?A():H.cancel()}),Fr(()=>{var ne,R,ue,xe;let H=Jl(F.current,e||r||"",t||i||"",o||n||"");H!==((ne=j.current)==null?void 0:ne.getModel())&&(f&&ig.set(X,(R=j.current)==null?void 0:R.saveViewState()),(ue=j.current)==null||ue.setModel(H),f&&((xe=j.current)==null||xe.restoreViewState(ig.get(o))))},[o],O),Fr(()=>{var H;(H=j.current)==null||H.updateOptions(c)},[c],O),Fr(()=>{!j.current||r===void 0||(j.current.getOption(F.current.editor.EditorOption.readOnly)?j.current.setValue(r):r!==j.current.getValue()&&(te.current=!0,j.current.executeEdits("",[{range:j.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),j.current.pushUndoStop(),te.current=!1))},[r],O),Fr(()=>{var ne,R;let H=(ne=j.current)==null?void 0:ne.getModel();H&&i&&((R=F.current)==null||R.editor.setModelLanguage(H,i))},[i],O),Fr(()=>{var H;a!==void 0&&((H=j.current)==null||H.revealLine(a))},[a],O),Fr(()=>{var H;(H=F.current)==null||H.editor.setTheme(s)},[s],O);let le=m.useCallback(()=>{var H;if(!(!B.current||!F.current)&&!W.current){q.current(F.current);let ne=o||n,R=Jl(F.current,r||e||"",t||i||"",ne||"");j.current=(H=F.current)==null?void 0:H.editor.create(B.current,{model:R,automaticLayout:!0,...c},d),f&&j.current.restoreViewState(ig.get(ne)),F.current.editor.setTheme(s),a!==void 0&&j.current.revealLine(a),k(!0),W.current=!0}},[e,t,n,r,i,o,c,d,f,s,a]);m.useEffect(()=>{O&&V.current(j.current,F.current)},[O]),m.useEffect(()=>{!T&&!O&&le()},[T,O,le]),$.current=r,m.useEffect(()=>{var H,ne;O&&C&&((H=J.current)==null||H.dispose(),J.current=(ne=j.current)==null?void 0:ne.onDidChangeModelContent(R=>{te.current||C(j.current.getValue(),R)}))},[O,C]),m.useEffect(()=>{if(O){let H=F.current.editor.onDidChangeMarkers(ne=>{var ue;let R=(ue=j.current.getModel())==null?void 0:ue.uri;if(R&&ne.find(xe=>xe.path===R.path)){let xe=F.current.editor.getModelMarkers({resource:R});P==null||P(xe)}});return()=>{H==null||H.dispose()}}return()=>{}},[O,P]);function A(){var H,ne;(H=J.current)==null||H.dispose(),g?f&&ig.set(o,j.current.saveViewState()):(ne=j.current.getModel())==null||ne.dispose(),j.current.dispose()}return m.createElement(xM,{width:p,height:v,isEditorReady:O,loading:l,_ref:B,className:b,wrapperProps:x})}var DZ=kZ,SM=m.memo(DZ),Xy=SM;function MZ(e){const t=e.toUpperCase().indexOf("WHERE"),n=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),i=e.toUpperCase().indexOf("ORDER BY");let o=e.length;if(i!==-1&&(o=i),r!==-1&&r<o&&(o=r),t!==-1){const s=e.substring(0,t),a=e.substring(t);return`${s} {{ filters | where }} AND ${a.substring(6)}`}else if(n!==-1){const s=e.substring(0,n),a=e.substring(n);return`${s} {{ filters | where }} ${a}`}else{const s=e.substring(0,o),a=e.substring(o);return`${s} {{ filters | where }} ${a}`}}let Qy;const CM="HoverCard",[EM,Ife]=kn(CM,[Bi]),Zy=Bi(),[TZ,Jy]=EM(CM),AZ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:s=700,closeDelay:a=300}=e,l=Zy(t),c=m.useRef(0),d=m.useRef(0),f=m.useRef(!1),g=m.useRef(!1),[p=!1,v]=Qn({prop:r,defaultProp:i,onChange:o}),b=m.useCallback(()=>{clearTimeout(d.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),x=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!g.current&&(d.current=window.setTimeout(()=>v(!1),a))},[a,v]),w=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(d.current)},[]),m.createElement(TZ,{scope:t,open:p,onOpenChange:v,onOpen:b,onClose:x,onDismiss:w,hasSelectionRef:f,isPointerDownOnContentRef:g},m.createElement(Lu,l,n))},IZ="HoverCardTrigger",NZ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=Jy(IZ,n),o=Zy(n);return m.createElement(Fu,se({asChild:!0},o),m.createElement(He.a,se({"data-state":i.open?"open":"closed"},r,{ref:t,onPointerEnter:Pe(e.onPointerEnter,og(i.onOpen)),onPointerLeave:Pe(e.onPointerLeave,og(i.onClose)),onFocus:Pe(e.onFocus,i.onOpen),onBlur:Pe(e.onBlur,i.onClose),onTouchStart:Pe(e.onTouchStart,s=>s.preventDefault())})))}),RZ="HoverCardPortal",[Nfe,LZ]=EM(RZ,{forceMount:void 0}),ex="HoverCardContent",FZ=m.forwardRef((e,t)=>{const n=LZ(ex,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=Jy(ex,e.__scopeHoverCard);return m.createElement(yn,{present:r||o.open},m.createElement($Z,se({"data-state":o.open?"open":"closed"},i,{onPointerEnter:Pe(e.onPointerEnter,og(o.onOpen)),onPointerLeave:Pe(e.onPointerLeave,og(o.onClose)),ref:t})))}),$Z=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,...a}=e,l=Jy(ex,n),c=Zy(n),d=m.useRef(null),f=nt(t,d),[g,p]=m.useState(!1);return m.useEffect(()=>{if(g){const v=document.body;return Qy=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=Qy,v.style.webkitUserSelect=Qy}}},[g]),m.useEffect(()=>{if(d.current){const v=()=>{p(!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(()=>{d.current&&jZ(d.current).forEach(b=>b.setAttribute("tabindex","-1"))}),m.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:Pe(o,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement($u,se({},c,a,{onPointerDown:Pe(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"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 og(e){return t=>t.pointerType==="touch"?void 0:e()}function jZ(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 zZ=AZ,BZ=NZ,OM=FZ,PM=zZ,kM=BZ,tx=de.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>_.jsx(OM,{ref:i,align:t,sideOffset:n,className:De("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}));tx.displayName=OM.displayName;function VZ({error:e}){return _.jsxs(PM,{openDelay:0,children:[_.jsx(kM,{asChild:!0,children:_.jsx(it,{variant:"link",className:" p-0 h-5",children:_.jsx(iH,{className:"h-4 w-4 text-red-500"})})}),_.jsx(tx,{align:"start",className:"w-[600px]",children:_.jsx("div",{className:"flex justify-between space-x-4",children:_.jsx("div",{className:"space-y-1",children:_.jsx("p",{className:"text-sm",children:e})})})})]})}function HZ({text:e,onCheckedChange:t,checked:n}){return _.jsxs("div",{className:"flex items-center space-x-1 xbg-red-100 ml-7",children:[_.jsx(ad,{checked:n,onCheckedChange:t}),_.jsx("label",{className:"text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function WZ(){const e=fe(a=>a.authToken),t=m.useRef(null),n=ve(a=>a.applyFilters),[r,i]=m.useState(""),o=ve(a=>a.filterValues),s=ve(a=>a.card.sql);return _.jsxs(PM,{openDelay:0,onOpenChange:async a=>{if(!a)return;console.log("onOpenChange");const l=await ll("https://semaphor.cloud/api/v1/filter-sql",(e==null?void 0:e.accessToken)||"",{sql:s,active_filters:o});console.log(l),l.sql?(console.log(l.records),i(l.sql)):i("Error")},children:[_.jsx(kM,{asChild:!0,children:n&&_.jsx("p",{className:" p-0 hover:cursor-pointer text-xs",children:"|  Filter Query"})}),_.jsxs(tx,{align:"end",className:"w-[600px] ",children:[_.jsx("div",{className:" flex justify-between space-x-4",children:_.jsx("div",{className:"bg-muted p-2 rounded-sm",children:_.jsxs("code",{ref:t,className:"text-sm font-mono ",children:[r,_.jsx(y2,{onClick:()=>s3(t),className:" inline-block ml-3 h-4 w-4 opacity-70 hover:opacity-100 hover:cursor-pointer"})]})})}),_.jsxs("div",{className:"flex gap-2 items-center pt-2",children:[_.jsx(jb,{className:"h-4 w-4 opacity-70"}),_.jsx("span",{className:"text-xs text-muted-foreground",children:"A preview of the query with filters applied."})]})]})]})}const nx=de.forwardRef(({className:e,...t},n)=>_.jsx("textarea",{className:De("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}));nx.displayName="Textarea";function Rfe(){}function Lfe(){}function UZ(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const qZ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,GZ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,YZ={};function DM(e,t){return((t||YZ).jsx?GZ:qZ).test(e)}const KZ=/[ \t\n\f\r]/g;function XZ(e){return typeof e=="object"?e.type==="text"?MM(e.value):!1:MM(e)}function MM(e){return e.replace(KZ,"")===""}class bd{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}bd.prototype.property={},bd.prototype.normal={},bd.prototype.space=null;function TM(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new bd(n,r,t)}function rx(e){return e.toLowerCase()}class ii{constructor(t,n){this.property=t,this.attribute=n}}ii.prototype.space=null,ii.prototype.boolean=!1,ii.prototype.booleanish=!1,ii.prototype.overloadedBoolean=!1,ii.prototype.number=!1,ii.prototype.commaSeparated=!1,ii.prototype.spaceSeparated=!1,ii.prototype.commaOrSpaceSeparated=!1,ii.prototype.mustUseProperty=!1,ii.prototype.defined=!1;let QZ=0;const ut=Aa(),wn=Aa(),AM=Aa(),ke=Aa(),Ut=Aa(),ec=Aa(),$r=Aa();function Aa(){return 2**++QZ}const ix=Object.freeze(Object.defineProperty({__proto__:null,boolean:ut,booleanish:wn,commaOrSpaceSeparated:$r,commaSeparated:ec,number:ke,overloadedBoolean:AM,spaceSeparated:Ut},Symbol.toStringTag,{value:"Module"})),ox=Object.keys(ix);class sx extends ii{constructor(t,n,r,i){let o=-1;if(super(t,n),IM(this,"space",i),typeof r=="number")for(;++o<ox.length;){const s=ox[o];IM(this,ox[o],(r&ix[s])===ix[s])}}}sx.prototype.defined=!0;function IM(e,t,n){n&&(e[t]=n)}const ZZ={}.hasOwnProperty;function tc(e){const t={},n={};let r;for(r in e.properties)if(ZZ.call(e.properties,r)){const i=e.properties[r],o=new sx(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[rx(r)]=r,n[rx(o.attribute)]=r}return new bd(t,n,e.space)}const NM=tc({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}}),RM=tc({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function LM(e,t){return t in e?e[t]:t}function FM(e,t){return LM(e,t.toLowerCase())}const $M=tc({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:FM,properties:{xmlns:null,xmlnsXLink:null}}),jM=tc({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:wn,ariaAutoComplete:null,ariaBusy:wn,ariaChecked:wn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Ut,ariaCurrent:null,ariaDescribedBy:Ut,ariaDetails:null,ariaDisabled:wn,ariaDropEffect:Ut,ariaErrorMessage:null,ariaExpanded:wn,ariaFlowTo:Ut,ariaGrabbed:wn,ariaHasPopup:null,ariaHidden:wn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ut,ariaLevel:ke,ariaLive:null,ariaModal:wn,ariaMultiLine:wn,ariaMultiSelectable:wn,ariaOrientation:null,ariaOwns:Ut,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:wn,ariaReadOnly:wn,ariaRelevant:null,ariaRequired:wn,ariaRoleDescription:Ut,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:wn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null}}),JZ=tc({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:FM,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ec,acceptCharset:Ut,accessKey:Ut,action:null,allow:null,allowFullScreen:ut,allowPaymentRequest:ut,allowUserMedia:ut,alt:null,as:null,async:ut,autoCapitalize:null,autoComplete:Ut,autoFocus:ut,autoPlay:ut,blocking:Ut,capture:null,charSet:null,checked:ut,cite:null,className:Ut,cols:ke,colSpan:null,content:null,contentEditable:wn,controls:ut,controlsList:Ut,coords:ke|ec,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ut,defer:ut,dir:null,dirName:null,disabled:ut,download:AM,draggable:wn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ut,formTarget:null,headers:Ut,height:ke,hidden:ut,high:ke,href:null,hrefLang:null,htmlFor:Ut,httpEquiv:Ut,id:null,imageSizes:null,imageSrcSet:null,inert:ut,inputMode:null,integrity:null,is:null,isMap:ut,itemId:null,itemProp:Ut,itemRef:Ut,itemScope:ut,itemType:Ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ut,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:ut,muted:ut,name:null,nonce:null,noModule:ut,noValidate:ut,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:ut,optimum:ke,pattern:null,ping:Ut,placeholder:null,playsInline:ut,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ut,referrerPolicy:null,rel:Ut,required:ut,reversed:ut,rows:ke,rowSpan:ke,sandbox:Ut,scope:null,scoped:ut,seamless:ut,selected:ut,shadowRootDelegatesFocus:ut,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:wn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:ut,useMap:null,value:wn,width:ke,wrap:null,align:null,aLink:null,archive:Ut,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ut,declare:ut,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:ut,noHref:ut,noShade:ut,noWrap:ut,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:wn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ut,disableRemotePlayback:ut,prefix:null,property:null,results:ke,security:null,unselectable:null}}),eJ=tc({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:LM,properties:{about:$r,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Ut,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:ut,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ec,g2:ec,glyphName:ec,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:$r,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ke,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$r,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$r,rev:$r,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$r,requiredFeatures:$r,requiredFonts:$r,requiredFormats:$r,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:$r,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$r,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$r,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),tJ=/^data[-\w.:]+$/i,zM=/-[a-z]/g,nJ=/[A-Z]/g;function rJ(e,t){const n=rx(t);let r=t,i=ii;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&tJ.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(zM,oJ);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!zM.test(o)){let s=o.replace(nJ,iJ);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=sx}return new i(r,t)}function iJ(e){return"-"+e.toLowerCase()}function oJ(e){return e.charAt(1).toUpperCase()}const sJ={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"},aJ=TM([RM,NM,$M,jM,JZ],"html"),ax=TM([RM,NM,$M,jM,eJ],"svg");function lJ(e){return e.join(" ").trim()}var BM={},VM=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,cJ=/\n/g,uJ=/^\s*/,dJ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,fJ=/^:\s*/,hJ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,pJ=/^[;\s]*/,gJ=/^\s+|\s+$/g,mJ=`
429
+ `,HM="/",WM="*",Ia="",vJ="comment",bJ="declaration",yJ=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 i(v){var b=v.match(cJ);b&&(n+=b.length);var x=v.lastIndexOf(mJ);r=~x?v.length-x:r+v.length}function o(){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 i(x),e=e.slice(x.length),b}}function c(){l(uJ)}function d(v){var b;for(v=v||[];b=f();)b!==!1&&v.push(b);return v}function f(){var v=o();if(!(HM!=e.charAt(0)||WM!=e.charAt(1))){for(var b=2;Ia!=e.charAt(b)&&(WM!=e.charAt(b)||HM!=e.charAt(b+1));)++b;if(b+=2,Ia===e.charAt(b-1))return a("End of comment missing");var x=e.slice(2,b-2);return r+=2,i(x),e=e.slice(b),r+=2,v({type:vJ,comment:x})}}function g(){var v=o(),b=l(dJ);if(b){if(f(),!l(fJ))return a("property missing ':'");var x=l(hJ),w=v({type:bJ,property:UM(b[0].replace(VM,Ia)),value:x?UM(x[0].replace(VM,Ia)):Ia});return l(pJ),w}}function p(){var v=[];d(v);for(var b;b=g();)b!==!1&&(v.push(b),d(v));return v}return c(),p()};function UM(e){return e?e.replace(gJ,Ia):Ia}var xJ=Ho&&Ho.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(BM,"__esModule",{value:!0});var wJ=xJ(yJ);function _J(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,wJ.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}var qM=BM.default=_J;const SJ=qM.default||qM,GM=YM("end"),lx=YM("start");function YM(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 CJ(e){const t=lx(e),n=GM(e);if(t&&n)return{start:t,end:n}}function yd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?KM(e.position):"start"in e||"end"in e?KM(e):"line"in e||"column"in e?cx(e):""}function cx(e){return XM(e&&e.line)+":"+XM(e&&e.column)}function KM(e){return cx(e&&e.start)+"-"+cx(e&&e.end)}function XM(e){return e&&typeof e=="number"?e:1}class Gn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=yd(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Gn.prototype.file="",Gn.prototype.name="",Gn.prototype.reason="",Gn.prototype.message="",Gn.prototype.stack="",Gn.prototype.column=void 0,Gn.prototype.line=void 0,Gn.prototype.ancestors=void 0,Gn.prototype.cause=void 0,Gn.prototype.fatal=void 0,Gn.prototype.place=void 0,Gn.prototype.ruleId=void 0,Gn.prototype.source=void 0;const ux={}.hasOwnProperty,EJ=new Map,OJ=/[A-Z]/g,PJ=/-([a-z])/g,kJ=new Set(["table","tbody","thead","tfoot","tr"]),DJ=new Set(["td","th"]),QM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function MJ(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=$J(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=FJ(n,t.jsx,t.jsxs)}const i={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"?ax:aJ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=ZM(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function ZM(e,t,n){if(t.type==="element")return TJ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return AJ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return NJ(e,t,n);if(t.type==="mdxjsEsm")return IJ(e,t);if(t.type==="root")return RJ(e,t,n);if(t.type==="text")return LJ(e,t)}function TJ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ax,e.schema=i),e.ancestors.push(t);const o=eT(e,t.tagName,!1),s=jJ(e,t);let a=fx(e,t);return kJ.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!XZ(l):!0})),JM(e,s,o,t),dx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function AJ(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)}xd(e,t.position)}function IJ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xd(e,t.position)}function NJ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ax,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:eT(e,t.name,!0),s=zJ(e,t),a=fx(e,t);return JM(e,s,o,t),dx(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function RJ(e,t,n){const r={};return dx(r,fx(e,t)),e.create(t,e.Fragment,r,n)}function LJ(e,t){return t.value}function JM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function dx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function FJ(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function $J(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=lx(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function jJ(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ux.call(t.properties,i)){const o=BJ(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&DJ.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function zJ(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else xd(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(a.expression)}else xd(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function fx(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:EJ;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=ZM(e,o,s);a!==void 0&&n.push(a)}return n}function BJ(e,t,n){const r=rJ(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?UZ(n):lJ(n)),r.property==="style"){let i=typeof n=="object"?n:VJ(e,String(n));return e.stylePropertyNameCase==="css"&&(i=HJ(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?sJ[r.property]||r.property:r.attribute,n]}}function VJ(e,t){const n={};try{SJ(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new Gn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,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(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(PJ,UJ)),n[s]=o}}function eT(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=DM(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=DM(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ux.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);xd(e)}function xd(e,t){const n=new Gn("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 HJ(e){const t={};let n;for(n in e)ux.call(e,n)&&(t[WJ(n)]=e[n]);return t}function WJ(e){let t=e.replace(OJ,qJ);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function UJ(e,t){return t.toUpperCase()}function qJ(e){return"-"+e.toLowerCase()}const hx={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"]},GJ={};function YJ(e,t){const n=t||GJ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return tT(e,r,i)}function tT(e,t,n){if(KJ(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 nT(e.children,t,n)}return Array.isArray(e)?nT(e,t,n):""}function nT(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=tT(e[i],t,n);return r.join("")}function KJ(e){return!!(e&&typeof e=="object")}const rT=document.createElement("i");function px(e){const t="&"+e+";";rT.innerHTML=t;const n=rT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Yi(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i: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);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function oi(e,t){return e.length>0?(Yi(e,e.length,0,t),e):t}const iT={}.hasOwnProperty;function XJ(e){const t={};let n=-1;for(;++n<e.length;)QJ(t,e[n]);return t}function QJ(e,t){let n;for(n in t){const i=(iT.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){iT.call(i,s)||(i[s]=[]);const a=o[s];ZJ(i[s],Array.isArray(a)?a:a?[a]:[])}}}function ZJ(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Yi(e,0,0,r)}function oT(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 nc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const JJ=vs(new RegExp("\\p{P}","u")),Ki=vs(/[A-Za-z]/),jr=vs(/[\dA-Za-z]/),eee=vs(/[#-'*+\--9=?A-Z^-~]/);function gx(e){return e!==null&&(e<32||e===127)}const mx=vs(/\d/),tee=vs(/[\dA-Fa-f]/),sT=vs(/[!-/:-@[-`{-~]/);function Qe(e){return e!==null&&e<-2}function hr(e){return e!==null&&(e<0||e===32)}function Mt(e){return e===-2||e===-1||e===32}function nee(e){return sT(e)||JJ(e)}const ree=vs(/\s/);function vs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function rc(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&jr(e.charCodeAt(n+1))&&jr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function qt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Mt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Mt(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const iee={tokenize:oee};function oee(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),qt(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(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 Qe(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const see={tokenize:aee},aT={tokenize:lee};function aee(e){const t=this,n=[];let r=0,i,o,s;return a;function a(C){if(r<n.length){const P=n[r];return t.containerState=P[1],e.attempt(P[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const P=t.events.length;let O=P,k;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){k=t.events[O][1].end;break}w(r);let T=P;for(;T<t.events.length;)t.events[T][1].end=Object.assign({},k),T++;return Yi(t.events,O+1,0,t.events.slice(P)),t.events.length=T,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return g(C);if(i.currentConstruct&&i.currentConstruct.concrete)return v(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(aT,d,f)(C)}function d(C){return i&&S(),w(r),g(C)}function f(C){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,v(C)}function g(C){return t.containerState={},e.attempt(aT,p,v)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function v(C){if(C===null){i&&S(),w(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),b(C)}function b(C){if(C===null){x(e.exit("chunkFlow"),!0),w(0),e.consume(C);return}return Qe(C)?(e.consume(C),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),b)}function x(C,P){const O=t.sliceStream(C);if(P&&O.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(O),t.parser.lazy[C.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;const T=t.events.length;let I=T,F,j;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(F){j=t.events[I][1].end;break}F=!0}for(w(r),k=T;k<t.events.length;)t.events[k][1].end=Object.assign({},j),k++;Yi(t.events,I+1,0,t.events.slice(T)),t.events.length=k}}function w(C){let P=n.length;for(;P-- >C;){const O=n[P];t.containerState=O[1],O[0].exit.call(t,e)}n.length=C}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function lee(e,t,n){return qt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function lT(e){if(e===null||hr(e)||ree(e))return 1;if(nee(e))return 2}function vx(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const bx={name:"attention",tokenize:uee,resolveAll:cee};function cee(e,t){let n=-1,r,i,o,s,a,l,c,d;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),g=Object.assign({},e[n][1].start);cT(f,-l),cT(g,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:g},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={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=oi(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=oi(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=oi(c,vx(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=oi(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=oi(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Yi(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function uee(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=lT(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),d=lT(l),f=!d||d===2&&i||n.includes(l),g=!i||i===2&&d||n.includes(r);return c._open=!!(o===42?f:f&&(i||!g)),c._close=!!(o===42?g:g&&(d||!f)),t(l)}}function cT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const dee={name:"autolink",tokenize:fee};function fee(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Ki(p)?(e.consume(p),s):c(p)}function s(p){return p===43||p===45||p===46||jr(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||jr(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||gx(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),d):eee(p)?(e.consume(p),c):n(p)}function d(p){return jr(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):g(p)}function g(p){if((p===45||jr(p))&&r++<63){const v=p===45?g:f;return e.consume(p),v}return n(p)}}const sg={tokenize:hee,partial:!0};function hee(e,t,n){return r;function r(o){return Mt(o)?qt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Qe(o)?t(o):n(o)}}const uT={name:"blockQuote",tokenize:pee,continuation:{tokenize:gee},exit:mee};function pee(e,t,n){const r=this;return i;function i(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"),o}return n(s)}function o(s){return Mt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function gee(e,t,n){const r=this;return i;function i(s){return Mt(s)?qt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(uT,t,n)(s)}}function mee(e){e.exit("blockQuote")}const dT={name:"characterEscape",tokenize:vee};function vee(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return sT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const fT={name:"characterReference",tokenize:bee};function bee(e,t,n){const r=this;let i=0,o,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"),o=31,s=jr,d(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=tee,d):(e.enter("characterReferenceValue"),o=7,s=mx,d(f))}function d(f){if(f===59&&i){const g=e.exit("characterReferenceValue");return s===jr&&!px(r.sliceSerialize(g))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),d):n(f)}}const hT={tokenize:xee,partial:!0},pT={name:"codeFenced",tokenize:yee,concrete:!0};function yee(e,t,n){const r=this,i={tokenize:O,partial:!0};let o=0,s=0,a;return l;function l(k){return c(k)}function c(k){const T=r.events[r.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===a?(s++,e.consume(k),d):s<3?n(k):(e.exit("codeFencedFenceSequence"),Mt(k)?qt(e,f,"whitespace")(k):f(k))}function f(k){return k===null||Qe(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(hT,b,P)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||Qe(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):Mt(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qt(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),g)}function p(k){return k===null||Qe(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===null||Qe(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===a?n(k):(e.consume(k),v)}function b(k){return e.attempt(i,P,x)(k)}function x(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),w}function w(k){return o>0&&Mt(k)?qt(e,S,"linePrefix",o+1)(k):S(k)}function S(k){return k===null||Qe(k)?e.check(hT,b,P)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||Qe(k)?(e.exit("codeFlowValue"),S(k)):(e.consume(k),C)}function P(k){return e.exit("codeFenced"),t(k)}function O(k,T,I){let F=0;return j;function j($){return k.enter("lineEnding"),k.consume($),k.exit("lineEnding"),B}function B($){return k.enter("codeFencedFence"),Mt($)?qt(k,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):V($)}function V($){return $===a?(k.enter("codeFencedFenceSequence"),q($)):I($)}function q($){return $===a?(F++,k.consume($),q):F>=s?(k.exit("codeFencedFenceSequence"),Mt($)?qt(k,J,"whitespace")($):J($)):I($)}function J($){return $===null||Qe($)?(k.exit("codeFencedFence"),T($)):I($)}}}function xee(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const yx={name:"codeIndented",tokenize:_ee},wee={tokenize:See,partial:!0};function _ee(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),qt(e,o,"linePrefix",5)(c)}function o(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Qe(c)?e.attempt(wee,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Qe(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function See(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Qe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):qt(e,o,"linePrefix",5)(s)}function o(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):Qe(s)?i(s):n(s)}}const Cee={name:"codeText",tokenize:Pee,resolve:Eee,previous:Oee};function Eee(e){let t=e.length-4,n=3,r,i;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;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Oee(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Pee(e,t,n){let r=0,i,o;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?(o=e.enter("codeTextSequence"),i=0,d(f)):Qe(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||Qe(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(o.type="codeTextData",c(f))}}function gT(e){const t={};let n=-1,r,i,o,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,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,kee(e,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=e[o],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),Yi(e,i,n-i+1,a))}}return!c}function kee(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let d,f,g=-1,p=n,v=0,b=0;const x=[b];for(;p;){for(;e[++i][1]!==p;);o.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(b=g+1,x.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),g=x.length;g--;){const w=a.slice(x[g],x[g+1]),S=o.pop();l.unshift([S,S+w.length-1]),Yi(e,S,2,w)}for(g=-1;++g<l.length;)c[v+l[g][0]]=v+l[g][1],v+=l[g][1]-l[g][0]-1;return c}const Dee={tokenize:Aee,resolve:Tee},Mee={tokenize:Iee,partial:!0};function Tee(e){return gT(e),e}function Aee(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):Qe(a)?e.check(Mee,s,o)(a):(e.consume(a),i)}function o(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,i}}function Iee(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),qt(e,o,"linePrefix")}function o(s){if(s===null||Qe(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 mT(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),g):w===null||w===32||w===41||gx(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(w))}function g(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),g(w)):w===null||w===60||Qe(w)?n(w):(e.consume(w),w===92?v:p)}function v(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function b(w){return!d&&(w===null||w===41||hr(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):d<c&&w===40?(e.consume(w),d++,b):w===41?(e.consume(w),d--,b):w===null||w===32||w===40||gx(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 vT(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Qe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Qe(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!Mt(p)),p===92?g:f)}function g(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function bT(e,t,n,r,i,o){let s;return a;function a(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),s=g===40?41:g,l):n(g)}function l(g){return g===s?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(o),c(g))}function c(g){return g===s?(e.exit(o),l(s)):g===null?n(g):Qe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),qt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===s||g===null||Qe(g)?(e.exit("chunkString"),c(g)):(e.consume(g),g===92?f:d)}function f(g){return g===s||g===92?(e.consume(g),d):d(g)}}function wd(e,t){let n;return r;function r(i){return Qe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Mt(i)?qt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Nee={name:"definition",tokenize:Lee},Ree={tokenize:Fee,partial:!0};function Lee(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return vT.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=nc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return hr(p)?wd(e,c)(p):c(p)}function c(p){return mT(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Ree,f,f)(p)}function f(p){return Mt(p)?qt(e,g,"whitespace")(p):g(p)}function g(p){return p===null||Qe(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function Fee(e,t,n){return r;function r(a){return hr(a)?wd(e,i)(a):n(a)}function i(a){return bT(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Mt(a)?qt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Qe(a)?t(a):n(a)}}const $ee={name:"hardBreakEscape",tokenize:jee};function jee(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Qe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const zee={name:"headingAtx",tokenize:Vee,resolve:Bee};function Bee(e,t){let n=e.length-2,r=3,i,o;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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Yi(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Vee(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||hr(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Qe(d)?(e.exit("atxHeading"),t(d)):Mt(d)?qt(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||hr(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}const Hee=["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"],yT=["pre","script","style","textarea"],Wee={name:"htmlFlow",tokenize:Yee,resolveTo:Gee,concrete:!0},Uee={tokenize:Xee,partial:!0},qee={tokenize:Kee,partial:!0};function Gee(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 Yee(e,t,n){const r=this;let i,o,s,a,l;return c;function c(R){return d(R)}function d(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),f}function f(R){return R===33?(e.consume(R),g):R===47?(e.consume(R),o=!0,b):R===63?(e.consume(R),i=3,r.interrupt?t:A):Ki(R)?(e.consume(R),s=String.fromCharCode(R),x):n(R)}function g(R){return R===45?(e.consume(R),i=2,p):R===91?(e.consume(R),i=5,a=0,v):Ki(R)?(e.consume(R),i=4,r.interrupt?t:A):n(R)}function p(R){return R===45?(e.consume(R),r.interrupt?t:A):n(R)}function v(R){const ue="CDATA[";return R===ue.charCodeAt(a++)?(e.consume(R),a===ue.length?r.interrupt?t:V:v):n(R)}function b(R){return Ki(R)?(e.consume(R),s=String.fromCharCode(R),x):n(R)}function x(R){if(R===null||R===47||R===62||hr(R)){const ue=R===47,xe=s.toLowerCase();return!ue&&!o&&yT.includes(xe)?(i=1,r.interrupt?t(R):V(R)):Hee.includes(s.toLowerCase())?(i=6,ue?(e.consume(R),w):r.interrupt?t(R):V(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):o?S(R):C(R))}return R===45||jr(R)?(e.consume(R),s+=String.fromCharCode(R),x):n(R)}function w(R){return R===62?(e.consume(R),r.interrupt?t:V):n(R)}function S(R){return Mt(R)?(e.consume(R),S):j(R)}function C(R){return R===47?(e.consume(R),j):R===58||R===95||Ki(R)?(e.consume(R),P):Mt(R)?(e.consume(R),C):j(R)}function P(R){return R===45||R===46||R===58||R===95||jr(R)?(e.consume(R),P):O(R)}function O(R){return R===61?(e.consume(R),k):Mt(R)?(e.consume(R),O):C(R)}function k(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),l=R,T):Mt(R)?(e.consume(R),k):I(R)}function T(R){return R===l?(e.consume(R),l=null,F):R===null||Qe(R)?n(R):(e.consume(R),T)}function I(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||hr(R)?O(R):(e.consume(R),I)}function F(R){return R===47||R===62||Mt(R)?C(R):n(R)}function j(R){return R===62?(e.consume(R),B):n(R)}function B(R){return R===null||Qe(R)?V(R):Mt(R)?(e.consume(R),B):n(R)}function V(R){return R===45&&i===2?(e.consume(R),X):R===60&&i===1?(e.consume(R),W):R===62&&i===4?(e.consume(R),H):R===63&&i===3?(e.consume(R),A):R===93&&i===5?(e.consume(R),le):Qe(R)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Uee,ne,q)(R)):R===null||Qe(R)?(e.exit("htmlFlowData"),q(R)):(e.consume(R),V)}function q(R){return e.check(qee,J,ne)(R)}function J(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),$}function $(R){return R===null||Qe(R)?q(R):(e.enter("htmlFlowData"),V(R))}function X(R){return R===45?(e.consume(R),A):V(R)}function W(R){return R===47?(e.consume(R),s="",te):V(R)}function te(R){if(R===62){const ue=s.toLowerCase();return yT.includes(ue)?(e.consume(R),H):V(R)}return Ki(R)&&s.length<8?(e.consume(R),s+=String.fromCharCode(R),te):V(R)}function le(R){return R===93?(e.consume(R),A):V(R)}function A(R){return R===62?(e.consume(R),H):R===45&&i===2?(e.consume(R),A):V(R)}function H(R){return R===null||Qe(R)?(e.exit("htmlFlowData"),ne(R)):(e.consume(R),H)}function ne(R){return e.exit("htmlFlow"),t(R)}}function Kee(e,t,n){const r=this;return i;function i(s){return Qe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Xee(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(sg,t,n)}}const Qee={name:"htmlText",tokenize:Zee};function Zee(e,t,n){const r=this;let i,o,s;return a;function a(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),l}function l(A){return A===33?(e.consume(A),c):A===47?(e.consume(A),O):A===63?(e.consume(A),C):Ki(A)?(e.consume(A),I):n(A)}function c(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),o=0,v):Ki(A)?(e.consume(A),S):n(A)}function d(A){return A===45?(e.consume(A),p):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),g):Qe(A)?(s=f,W(A)):(e.consume(A),f)}function g(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?X(A):A===45?g(A):f(A)}function v(A){const H="CDATA[";return A===H.charCodeAt(o++)?(e.consume(A),o===H.length?b:v):n(A)}function b(A){return A===null?n(A):A===93?(e.consume(A),x):Qe(A)?(s=b,W(A)):(e.consume(A),b)}function x(A){return A===93?(e.consume(A),w):b(A)}function w(A){return A===62?X(A):A===93?(e.consume(A),w):b(A)}function S(A){return A===null||A===62?X(A):Qe(A)?(s=S,W(A)):(e.consume(A),S)}function C(A){return A===null?n(A):A===63?(e.consume(A),P):Qe(A)?(s=C,W(A)):(e.consume(A),C)}function P(A){return A===62?X(A):C(A)}function O(A){return Ki(A)?(e.consume(A),k):n(A)}function k(A){return A===45||jr(A)?(e.consume(A),k):T(A)}function T(A){return Qe(A)?(s=T,W(A)):Mt(A)?(e.consume(A),T):X(A)}function I(A){return A===45||jr(A)?(e.consume(A),I):A===47||A===62||hr(A)?F(A):n(A)}function F(A){return A===47?(e.consume(A),X):A===58||A===95||Ki(A)?(e.consume(A),j):Qe(A)?(s=F,W(A)):Mt(A)?(e.consume(A),F):X(A)}function j(A){return A===45||A===46||A===58||A===95||jr(A)?(e.consume(A),j):B(A)}function B(A){return A===61?(e.consume(A),V):Qe(A)?(s=B,W(A)):Mt(A)?(e.consume(A),B):F(A)}function V(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,q):Qe(A)?(s=V,W(A)):Mt(A)?(e.consume(A),V):(e.consume(A),J)}function q(A){return A===i?(e.consume(A),i=void 0,$):A===null?n(A):Qe(A)?(s=q,W(A)):(e.consume(A),q)}function J(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||hr(A)?F(A):(e.consume(A),J)}function $(A){return A===47||A===62||hr(A)?F(A):n(A)}function X(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function W(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),te}function te(A){return Mt(A)?qt(e,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):le(A)}function le(A){return e.enter("htmlTextData"),s(A)}}const xx={name:"labelEnd",tokenize:ite,resolveTo:rte,resolveAll:nte},Jee={tokenize:ote},ete={tokenize:ste},tte={tokenize:ate};function nte(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 rte(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[s][1].end)},d={type:"labelText",start:Object.assign({},e[o+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=oi(a,e.slice(o+1,o+r+3)),a=oi(a,[["enter",d,t]]),a=oi(a,vx(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=oi(a,[["exit",d,t],e[s-2],e[s-1],["exit",c,t]]),a=oi(a,e.slice(s+1)),a=oi(a,[["exit",l,t]]),Yi(e,o,e.length,a),e}function ite(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(g){return o?o._inactive?f(g):(s=r.parser.defined.includes(nc(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),l):n(g)}function l(g){return g===40?e.attempt(Jee,d,s?d:f)(g):g===91?e.attempt(ete,d,s?c:f)(g):s?d(g):f(g)}function c(g){return e.attempt(tte,d,f)(g)}function d(g){return t(g)}function f(g){return o._balanced=!0,n(g)}}function ote(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return hr(f)?wd(e,o)(f):o(f)}function o(f){return f===41?d(f):mT(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return hr(f)?wd(e,l)(f):d(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?bT(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function c(f){return hr(f)?wd(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function ste(e,t,n){const r=this;return i;function i(a){return vT.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(nc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function ate(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const lte={name:"labelStartImage",tokenize:cte,resolveAll:xx.resolveAll};function cte(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(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 ute={name:"labelStartLink",tokenize:dte,resolveAll:xx.resolveAll};function dte(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const wx={name:"lineEnding",tokenize:fte};function fte(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qt(e,t,"linePrefix")}}const ag={name:"thematicBreak",tokenize:hte};function hte(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Qe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Mt(c)?qt(e,a,"whitespace")(c):a(c))}}const pr={name:"list",tokenize:mte,continuation:{tokenize:vte},exit:yte},pte={tokenize:xte,partial:!0},gte={tokenize:bte,partial:!0};function mte(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){const v=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:mx(p)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ag,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return mx(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(sg,r.interrupt?n:d,e.attempt(pte,g,f))}function d(p){return r.containerState.initialBlankLine=!0,o++,g(p)}function f(p){return Mt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),g):n(p)}function g(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function vte(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(sg,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,qt(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Mt(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(gte,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,qt(e,e.attempt(pr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function bte(e,t,n){const r=this;return qt(e,i,"listItemIndent",r.containerState.size+1);function i(o){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(o):n(o)}}function yte(e){e.exit(this.containerState.type)}function xte(e,t,n){const r=this;return qt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Mt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const xT={name:"setextUnderline",tokenize:_te,resolveTo:wte};function wte(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function _te(e,t,n){const r=this;let i;return o;function o(c){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Mt(c)?qt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Qe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Ste={tokenize:Cte};function Cte(e){const t=this,n=e.attempt(sg,r,e.attempt(this.parser.constructs.flowInitial,i,qt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Dee,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Ete={resolveAll:_T()},Ote=wT("string"),Pte=wT("text");function wT(e){return{tokenize:t,resolveAll:_T(e==="text"?kte:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(d){return c(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),o(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const f=i[d];let g=-1;if(f)for(;++g<f.length;){const p=f[g];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function _T(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function kte(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],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];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){o++;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+o,_bufferIndex:o?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 Dte(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let s=[],a=[];const l={consume:S,enter:C,exit:P,attempt:T(O),check:T(k),interrupt:T(k,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:g,now:v,defineSkip:b,write:f};let d=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function f(B){return s=oi(s,B),x(),s[s.length-1]!==null?[]:(I(t,0),c.events=vx(o,c.events,c),c.events)}function g(B,V){return Tte(p(B),V)}function p(B){return Mte(s,B)}function v(){const{line:B,column:V,offset:q,_index:J,_bufferIndex:$}=r;return{line:B,column:V,offset:q,_index:J,_bufferIndex:$}}function b(B){i[B.line]=B.column,j()}function x(){let B;for(;r._index<s.length;){const V=s[r._index];if(typeof V=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<V.length;)w(V.charCodeAt(r._bufferIndex));else w(V)}}function w(B){d=d(B)}function S(B){Qe(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,j()):B!==-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=B}function C(B,V){const q=V||{};return q.type=B,q.start=v(),c.events.push(["enter",q,c]),a.push(q),q}function P(B){const V=a.pop();return V.end=v(),c.events.push(["exit",V,c]),V}function O(B,V){I(B,V.from)}function k(B,V){V.restore()}function T(B,V){return q;function q(J,$,X){let W,te,le,A;return Array.isArray(J)?ne(J):"tokenize"in J?ne([J]):H(J);function H(ge){return pe;function pe(ee){const Q=ee!==null&&ge[ee],ie=ee!==null&&ge.null,we=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return ne(we)(ee)}}function ne(ge){return W=ge,te=0,ge.length===0?X:R(ge[te])}function R(ge){return pe;function pe(ee){return A=F(),le=ge,ge.partial||(c.currentConstruct=ge),ge.name&&c.parser.constructs.disable.null.includes(ge.name)?xe():ge.tokenize.call(V?Object.assign(Object.create(c),V):c,l,ue,xe)(ee)}}function ue(ge){return B(le,A),$}function xe(ge){return A.restore(),++te<W.length?R(W[te]):X}}}function I(B,V){B.resolveAll&&!o.includes(B)&&o.push(B),B.resolve&&Yi(c.events,V,c.events.length-V,B.resolve(c.events.slice(V),c)),B.resolveTo&&(c.events=B.resolveTo(c.events,c))}function F(){const B=v(),V=c.previous,q=c.currentConstruct,J=c.events.length,$=Array.from(a);return{restore:X,from:J};function X(){r=B,c.previous=V,c.currentConstruct=q,c.events.length=J,a=$,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Mte(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Tte(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
430
430
  `;break}case-3:{s=`\r
431
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}const Ate=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Nee},disable:{null:[]},document:{42:pr,43:pr,45:pr,48:pr,49:pr,50:pr,51:pr,52:pr,53:pr,54:pr,55:pr,56:pr,57:pr,62:uT},flow:{35:zee,42:ag,45:[xT,ag],60:Wee,61:xT,95:ag,96:pT,126:pT},flowInitial:{[-2]:yx,[-1]:yx,32:yx},insideSpan:{null:[bx,Ete]},string:{38:fT,92:dT},text:{[-5]:wx,[-4]:wx,[-3]:wx,33:lte,38:fT,42:bx,60:[dee,Qee],91:ute,92:[$ee,dT],93:xx,95:bx,96:Cee}},Symbol.toStringTag,{value:"Module"}));function Ite(e){const n=XJ([Ate,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(iee),document:i(see),flow:i(Ste),string:i(Ote),text:i(Pte)};return r;function i(o){return s;function s(a){return Dte(r,o,a)}}}function Nte(e){for(;!gT(e););return e}const ST=/[\0\t\n\r]/g;function Rte(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let c,d,f,g,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,t="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(ST.lastIndex=f,c=ST.exec(o),g=c&&c.index!==void 0?c.index:o.length,p=o.charCodeAt(g),!c){t=o.slice(f);break}if(p===10&&f===g&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<g&&(l.push(o.slice(f,g)),e+=g-f),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=g+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Lte=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Fte(e){return e.replace(Lte,$te)}function $te(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return oT(n.slice(o?2:1),o?16:10)}return px(n)||e}const CT={}.hasOwnProperty;function jte(e,t,n){return typeof t!="string"&&(n=t,t=void 0),zte(n)(Nte(Ite(n).document().write(Rte()(e,t,!0))))}function zte(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(qe),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(ae),blockQuote:o(Q),characterEscape:F,characterReference:F,codeFenced:o(ie),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ie,s),codeText:o(we,s),codeTextData:F,data:F,codeFlowValue:F,definition:o(te),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ie),hardBreakEscape:o(Se),hardBreakTrailing:o(Se),htmlFlow:o(We,s),htmlFlowData:F,htmlText:o(We,s),htmlTextData:F,image:o(dt),label:s,link:o(qe),listItem:o(Gt),listItemValue:g,listOrdered:o(gt,f),listUnordered:o(gt),paragraph:o(Bt),reference:R,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ae),strong:o(gn),thematicBreak:o(mr)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:ee,autolinkProtocol:pe,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:xe,characterReferenceMarkerNumeric:xe,characterReferenceValue:ge,codeFenced:l(x),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:v,codeFlowValue:j,codeIndented:l(w),codeText:l($),codeTextData:j,data:j,definition:l(),definitionDestinationString:P,definitionLabelString:S,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(V),hardBreakTrailing:l(V),htmlFlow:l(q),htmlFlowData:j,htmlText:l(J),htmlTextData:j,image:l(W),label:le,labelText:ne,lineEnding:B,link:l(X),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ue,resourceDestinationString:A,resourceTitleString:H,resource:re,setextHeading:l(I),setextHeadingLineSequence:T,setextHeadingText:k,strong:l(),thematicBreak:l()}};ET(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(he){let Ee={type:"root",children:[]};const Ne={stack:[Ee],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:d,data:n},Ue=[];let at=-1;for(;++at<he.length;)if(he[at][1].type==="listOrdered"||he[at][1].type==="listUnordered")if(he[at][0]==="enter")Ue.push(at);else{const ln=Ue.pop();at=i(he,ln,at)}for(at=-1;++at<he.length;){const ln=t[he[at][0]];CT.call(ln,he[at][1].type)&&ln[he[at][1].type].call(Object.assign({sliceSerialize:he[at][2].sliceSerialize},Ne),he[at][1])}if(Ne.tokenStack.length>0){const ln=Ne.tokenStack[Ne.tokenStack.length-1];(ln[1]||OT).call(Ne,void 0,ln[0])}for(Ee.position={start:bs(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:bs(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)Ee=t.transforms[at](Ee)||Ee;return Ee}function i(he,Ee,Ne){let Ue=Ee-1,at=-1,ln=!1,cn,$n,Br,Vr;for(;++Ue<=Ne;){const mn=he[Ue];switch(mn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mn[0]==="enter"?at++:at--,Vr=void 0;break}case"lineEndingBlank":{mn[0]==="enter"&&(cn&&!Vr&&!at&&!Br&&(Br=Ue),Vr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vr=void 0}if(!at&&mn[0]==="enter"&&mn[1].type==="listItemPrefix"||at===-1&&mn[0]==="exit"&&(mn[1].type==="listUnordered"||mn[1].type==="listOrdered")){if(cn){let vr=Ue;for($n=void 0;vr--;){const jn=he[vr];if(jn[1].type==="lineEnding"||jn[1].type==="lineEndingBlank"){if(jn[0]==="exit")continue;$n&&(he[$n][1].type="lineEndingBlank",ln=!0),jn[1].type="lineEnding",$n=vr}else if(!(jn[1].type==="linePrefix"||jn[1].type==="blockQuotePrefix"||jn[1].type==="blockQuotePrefixWhitespace"||jn[1].type==="blockQuoteMarker"||jn[1].type==="listItemIndent"))break}Br&&(!$n||Br<$n)&&(cn._spread=!0),cn.end=Object.assign({},$n?he[$n][1].start:mn[1].end),he.splice($n||Ue,0,["exit",cn,mn[2]]),Ue++,Ne++}if(mn[1].type==="listItemPrefix"){const vr={type:"listItem",_spread:!1,start:Object.assign({},mn[1].start),end:void 0};cn=vr,he.splice(Ue,0,["enter",vr,mn[2]]),Ue++,Ne++,Br=void 0,Vr=!0}}}return he[Ee][1]._spread=ln,Ne}function o(he,Ee){return Ne;function Ne(Ue){a.call(this,he(Ue),Ue),Ee&&Ee.call(this,Ue)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(he,Ee,Ne){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Ee,Ne]),he.position={start:bs(Ee.start),end:void 0}}function l(he){return Ee;function Ee(Ne){he&&he.call(this,Ne),c.call(this,Ne)}}function c(he,Ee){const Ne=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==he.type&&(Ee?Ee.call(this,he,Ue[0]):(Ue[1]||OT).call(this,he,Ue[0]));else throw new Error("Cannot close `"+he.type+"` ("+yd({start:he.start,end:he.end})+"): it’s not open");Ne.position.end=bs(he.end)}function d(){return YJ(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(he){if(this.data.expectingFirstListItemValue){const Ee=this.stack[this.stack.length-2];Ee.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function p(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.lang=he}function v(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.meta=he}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=he.replace(/(\r?\n|\r)$/g,"")}function S(he){const Ee=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=Ee,Ne.identifier=nc(this.sliceSerialize(he)).toLowerCase()}function C(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=he}function P(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=he}function O(he){const Ee=this.stack[this.stack.length-1];if(!Ee.depth){const Ne=this.sliceSerialize(he).length;Ee.depth=Ne}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function T(he){const Ee=this.stack[this.stack.length-1];Ee.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function F(he){const Ne=this.stack[this.stack.length-1].children;let Ue=Ne[Ne.length-1];(!Ue||Ue.type!=="text")&&(Ue=Rt(),Ue.position={start:bs(he.start),end:void 0},Ne.push(Ue)),this.stack.push(Ue)}function j(he){const Ee=this.stack.pop();Ee.value+=this.sliceSerialize(he),Ee.position.end=bs(he.end)}function B(he){const Ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=Ee.children[Ee.children.length-1];Ne.position.end=bs(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ee.type)&&(F.call(this,he),j.call(this,he))}function V(){this.data.atHardBreak=!0}function q(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=he}function J(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=he}function $(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=he}function X(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ee,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function W(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ee,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function ne(he){const Ee=this.sliceSerialize(he),Ne=this.stack[this.stack.length-2];Ne.label=Fte(Ee),Ne.identifier=nc(Ee).toLowerCase()}function le(){const he=this.stack[this.stack.length-1],Ee=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const Ue=he.children;Ne.children=Ue}else Ne.alt=Ee}function A(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=he}function H(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=he}function re(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function ue(he){const Ee=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=Ee,Ne.identifier=nc(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function xe(he){this.data.characterReferenceType=he.type}function ge(he){const Ee=this.sliceSerialize(he),Ne=this.data.characterReferenceType;let Ue;Ne?(Ue=oT(Ee,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=px(Ee);const at=this.stack.pop();at.value+=Ue,at.position.end=bs(he.end)}function pe(he){j.call(this,he);const Ee=this.stack[this.stack.length-1];Ee.url=this.sliceSerialize(he)}function ee(he){j.call(this,he);const Ee=this.stack[this.stack.length-1];Ee.url="mailto:"+this.sliceSerialize(he)}function Q(){return{type:"blockquote",children:[]}}function ie(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function te(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function ae(){return{type:"heading",depth:0,children:[]}}function Se(){return{type:"break"}}function We(){return{type:"html",value:""}}function dt(){return{type:"image",title:null,url:"",alt:null}}function qe(){return{type:"link",title:null,url:"",children:[]}}function gt(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Gt(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Bt(){return{type:"paragraph",children:[]}}function gn(){return{type:"strong",children:[]}}function Rt(){return{type:"text",value:""}}function mr(){return{type:"thematicBreak"}}}function bs(e){return{line:e.line,column:e.column,offset:e.offset}}function ET(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ET(e,r):Bte(e,r)}}function Bte(e,t){let n;for(n in t)if(CT.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 OT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+yd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+yd({start:t.start,end:t.end})+") is still open")}function Vte(e){const t=this;t.parser=n;function n(r){return jte(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Hte(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 Wte(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
431
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}const Ate=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Nee},disable:{null:[]},document:{42:pr,43:pr,45:pr,48:pr,49:pr,50:pr,51:pr,52:pr,53:pr,54:pr,55:pr,56:pr,57:pr,62:uT},flow:{35:zee,42:ag,45:[xT,ag],60:Wee,61:xT,95:ag,96:pT,126:pT},flowInitial:{[-2]:yx,[-1]:yx,32:yx},insideSpan:{null:[bx,Ete]},string:{38:fT,92:dT},text:{[-5]:wx,[-4]:wx,[-3]:wx,33:lte,38:fT,42:bx,60:[dee,Qee],91:ute,92:[$ee,dT],93:xx,95:bx,96:Cee}},Symbol.toStringTag,{value:"Module"}));function Ite(e){const n=XJ([Ate,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(iee),document:i(see),flow:i(Ste),string:i(Ote),text:i(Pte)};return r;function i(o){return s;function s(a){return Dte(r,o,a)}}}function Nte(e){for(;!gT(e););return e}const ST=/[\0\t\n\r]/g;function Rte(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let c,d,f,g,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,t="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(ST.lastIndex=f,c=ST.exec(o),g=c&&c.index!==void 0?c.index:o.length,p=o.charCodeAt(g),!c){t=o.slice(f);break}if(p===10&&f===g&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<g&&(l.push(o.slice(f,g)),e+=g-f),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=g+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Lte=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Fte(e){return e.replace(Lte,$te)}function $te(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return oT(n.slice(o?2:1),o?16:10)}return px(n)||e}const CT={}.hasOwnProperty;function jte(e,t,n){return typeof t!="string"&&(n=t,t=void 0),zte(n)(Nte(Ite(n).document().write(Rte()(e,t,!0))))}function zte(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(qe),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(ae),blockQuote:o(Q),characterEscape:F,characterReference:F,codeFenced:o(ie),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ie,s),codeText:o(we,s),codeTextData:F,data:F,codeFlowValue:F,definition:o(re),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ie),hardBreakEscape:o(Se),hardBreakTrailing:o(Se),htmlFlow:o(We,s),htmlFlowData:F,htmlText:o(We,s),htmlTextData:F,image:o(dt),label:s,link:o(qe),listItem:o(Gt),listItemValue:g,listOrdered:o(gt,f),listUnordered:o(gt),paragraph:o(Bt),reference:R,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ae),strong:o(gn),thematicBreak:o(mr)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:ee,autolinkProtocol:pe,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:xe,characterReferenceMarkerNumeric:xe,characterReferenceValue:ge,codeFenced:l(x),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:v,codeFlowValue:j,codeIndented:l(w),codeText:l($),codeTextData:j,data:j,definition:l(),definitionDestinationString:P,definitionLabelString:S,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(V),hardBreakTrailing:l(V),htmlFlow:l(q),htmlFlowData:j,htmlText:l(J),htmlTextData:j,image:l(W),label:le,labelText:te,lineEnding:B,link:l(X),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ue,resourceDestinationString:A,resourceTitleString:H,resource:ne,setextHeading:l(I),setextHeadingLineSequence:T,setextHeadingText:k,strong:l(),thematicBreak:l()}};ET(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(he){let Ee={type:"root",children:[]};const Ne={stack:[Ee],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:d,data:n},Ue=[];let at=-1;for(;++at<he.length;)if(he[at][1].type==="listOrdered"||he[at][1].type==="listUnordered")if(he[at][0]==="enter")Ue.push(at);else{const ln=Ue.pop();at=i(he,ln,at)}for(at=-1;++at<he.length;){const ln=t[he[at][0]];CT.call(ln,he[at][1].type)&&ln[he[at][1].type].call(Object.assign({sliceSerialize:he[at][2].sliceSerialize},Ne),he[at][1])}if(Ne.tokenStack.length>0){const ln=Ne.tokenStack[Ne.tokenStack.length-1];(ln[1]||OT).call(Ne,void 0,ln[0])}for(Ee.position={start:bs(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:bs(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)Ee=t.transforms[at](Ee)||Ee;return Ee}function i(he,Ee,Ne){let Ue=Ee-1,at=-1,ln=!1,cn,$n,Br,Vr;for(;++Ue<=Ne;){const mn=he[Ue];switch(mn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mn[0]==="enter"?at++:at--,Vr=void 0;break}case"lineEndingBlank":{mn[0]==="enter"&&(cn&&!Vr&&!at&&!Br&&(Br=Ue),Vr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vr=void 0}if(!at&&mn[0]==="enter"&&mn[1].type==="listItemPrefix"||at===-1&&mn[0]==="exit"&&(mn[1].type==="listUnordered"||mn[1].type==="listOrdered")){if(cn){let vr=Ue;for($n=void 0;vr--;){const jn=he[vr];if(jn[1].type==="lineEnding"||jn[1].type==="lineEndingBlank"){if(jn[0]==="exit")continue;$n&&(he[$n][1].type="lineEndingBlank",ln=!0),jn[1].type="lineEnding",$n=vr}else if(!(jn[1].type==="linePrefix"||jn[1].type==="blockQuotePrefix"||jn[1].type==="blockQuotePrefixWhitespace"||jn[1].type==="blockQuoteMarker"||jn[1].type==="listItemIndent"))break}Br&&(!$n||Br<$n)&&(cn._spread=!0),cn.end=Object.assign({},$n?he[$n][1].start:mn[1].end),he.splice($n||Ue,0,["exit",cn,mn[2]]),Ue++,Ne++}if(mn[1].type==="listItemPrefix"){const vr={type:"listItem",_spread:!1,start:Object.assign({},mn[1].start),end:void 0};cn=vr,he.splice(Ue,0,["enter",vr,mn[2]]),Ue++,Ne++,Br=void 0,Vr=!0}}}return he[Ee][1]._spread=ln,Ne}function o(he,Ee){return Ne;function Ne(Ue){a.call(this,he(Ue),Ue),Ee&&Ee.call(this,Ue)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(he,Ee,Ne){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Ee,Ne]),he.position={start:bs(Ee.start),end:void 0}}function l(he){return Ee;function Ee(Ne){he&&he.call(this,Ne),c.call(this,Ne)}}function c(he,Ee){const Ne=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==he.type&&(Ee?Ee.call(this,he,Ue[0]):(Ue[1]||OT).call(this,he,Ue[0]));else throw new Error("Cannot close `"+he.type+"` ("+yd({start:he.start,end:he.end})+"): it’s not open");Ne.position.end=bs(he.end)}function d(){return YJ(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(he){if(this.data.expectingFirstListItemValue){const Ee=this.stack[this.stack.length-2];Ee.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function p(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.lang=he}function v(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.meta=he}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=he.replace(/(\r?\n|\r)$/g,"")}function S(he){const Ee=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=Ee,Ne.identifier=nc(this.sliceSerialize(he)).toLowerCase()}function C(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=he}function P(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=he}function O(he){const Ee=this.stack[this.stack.length-1];if(!Ee.depth){const Ne=this.sliceSerialize(he).length;Ee.depth=Ne}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function T(he){const Ee=this.stack[this.stack.length-1];Ee.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function F(he){const Ne=this.stack[this.stack.length-1].children;let Ue=Ne[Ne.length-1];(!Ue||Ue.type!=="text")&&(Ue=Rt(),Ue.position={start:bs(he.start),end:void 0},Ne.push(Ue)),this.stack.push(Ue)}function j(he){const Ee=this.stack.pop();Ee.value+=this.sliceSerialize(he),Ee.position.end=bs(he.end)}function B(he){const Ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=Ee.children[Ee.children.length-1];Ne.position.end=bs(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ee.type)&&(F.call(this,he),j.call(this,he))}function V(){this.data.atHardBreak=!0}function q(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=he}function J(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=he}function $(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=he}function X(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ee,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function W(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ee,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function te(he){const Ee=this.sliceSerialize(he),Ne=this.stack[this.stack.length-2];Ne.label=Fte(Ee),Ne.identifier=nc(Ee).toLowerCase()}function le(){const he=this.stack[this.stack.length-1],Ee=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const Ue=he.children;Ne.children=Ue}else Ne.alt=Ee}function A(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=he}function H(){const he=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=he}function ne(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function ue(he){const Ee=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=Ee,Ne.identifier=nc(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function xe(he){this.data.characterReferenceType=he.type}function ge(he){const Ee=this.sliceSerialize(he),Ne=this.data.characterReferenceType;let Ue;Ne?(Ue=oT(Ee,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=px(Ee);const at=this.stack.pop();at.value+=Ue,at.position.end=bs(he.end)}function pe(he){j.call(this,he);const Ee=this.stack[this.stack.length-1];Ee.url=this.sliceSerialize(he)}function ee(he){j.call(this,he);const Ee=this.stack[this.stack.length-1];Ee.url="mailto:"+this.sliceSerialize(he)}function Q(){return{type:"blockquote",children:[]}}function ie(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function ae(){return{type:"heading",depth:0,children:[]}}function Se(){return{type:"break"}}function We(){return{type:"html",value:""}}function dt(){return{type:"image",title:null,url:"",alt:null}}function qe(){return{type:"link",title:null,url:"",children:[]}}function gt(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Gt(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Bt(){return{type:"paragraph",children:[]}}function gn(){return{type:"strong",children:[]}}function Rt(){return{type:"text",value:""}}function mr(){return{type:"thematicBreak"}}}function bs(e){return{line:e.line,column:e.column,offset:e.offset}}function ET(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ET(e,r):Bte(e,r)}}function Bte(e,t){let n;for(n in t)if(CT.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 OT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+yd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+yd({start:t.start,end:t.end})+") is still open")}function Vte(e){const t=this;t.parser=n;function n(r){return jte(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Hte(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 Wte(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
432
432
  `}]}function Ute(e,t){const n=t.value?t.value+`
433
433
  `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function qte(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Gte(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yte(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=rc(r.toLowerCase()),o=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=o+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(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 Kte(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 Xte(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function PT(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 i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Qte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return PT(e,t);const i={src:rc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function Zte(e,t){const n={src:rc(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 Jte(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 ene(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return PT(e,t);const i={href:rc(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function tne(e,t){const n={href:rc(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 nne(e,t,n){const r=e.all(t),i=n?rne(n):kT(t),o={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(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:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const d=r[a];(i||a!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
434
434
  `}),d.type==="element"&&d.tagName==="p"&&!i?s.push(...d.children):s.push(d)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
@@ -484,12 +484,12 @@ SELECT label, measure FROM table
484
484
 
485
485
  - Label - Category
486
486
  - Measure - Number
487
- `;function ure({open:e,setOpen:t,userInput:n,setUserInput:r,triggerAIRun:i,setTriggerAIRun:o}){const s=fe(q=>q.authToken),[a,l]=m.useState(!1),c=ve(q=>q.actions.setCardSql),d=ve(q=>q.actions.setRunSql),f=ve(q=>q.actions.setCardType),g=ve(q=>q.currentColumns),p=ve(q=>q.card.sql),v=ve(q=>q.selectedTableName),b=`
487
+ `;function ure({open:e,setOpen:t,userInput:n,setUserInput:r,triggerAIRun:i,setTriggerAIRun:o}){const s=fe(q=>q.authToken),[a,l]=m.useState(!1),c=ve(q=>q.actions.setCardSql),d=ve(q=>q.actions.setRunSql),f=ve(q=>q.actions.setCardType),g=ve(q=>q.currentColumns),p=ve(q=>q.card.sql),v=ve(q=>q.selectedTableName);console.log(g);const b=`
488
488
  ${n}
489
489
 
490
- ${v==="api"?"Use alaSQL syntax to query the data":""}
491
- Table: ${v}
490
+ Database Query Dialect: ${v==="api"?"DuckDb":""}
491
+ Table Name: ${v}
492
492
  Table Columns: ${g==null?void 0:g.map(q=>`${q.column_name} | ${q.data_type}`).join(", ")}
493
493
  User SQL: ${p}
494
494
  `,x=` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
495
- Visual Query Syntax: ${cre}`,{data:w,isLoading:S,isFetching:C,isError:P,refetch:O}=Xr({queryKey:["ai-query"],queryFn:()=>al("https://semaphor.cloud/api/v1/ai",(s==null?void 0:s.accessToken)||"",{user_content:`userContent: ${b} ${a?x:""}`}),enabled:!1});function k(q){if(q.toLowerCase().includes("bar"))f("bar");else if(q.toLowerCase().includes("line"))f("line");else if(q.toLowerCase().includes("bubble"))f("bubble");else if(q.toLowerCase().includes("scatter"))f("scatter");else if(q.toLowerCase().includes("stacked"))f("stackedBar");else if(q.toLowerCase().includes("pie"))f("pie");else if(q.toLowerCase().includes("donut")||q.toLowerCase().includes("doughnut"))f("doughnut");else if(q.toLowerCase().includes("radar"))f("radar");else return f("bar"),!1;return!0}function T(){n&&(k(n)&&l(!0),O())}m.useEffect(()=>{i&&(T(),o(!1))},[i,o]);const I={fontFamily:"Arial, sans-serif",lineHeight:1.6,fontSize:15,padding:"5px",width:"100%"},F={fontFamily:"monospace",fontSize:14,lineHeight:1.6},j={fontFamily:"Arial, sans-serif",lineHeight:1.6,fontSize:15,padding:"2px 0",marginLeft:20,listStyleType:"disc"},B={p:({node:q,...J})=>_.jsx("p",{style:I,...J}),pre:({node:q,...J})=>_.jsxs("pre",{className:" bg-muted/50 space-y-2 p-3 rounded-sm",style:F,children:[_.jsx("code",{className:" whitespace-normal",children:J.children}),_.jsxs("div",{className:" flex justify-start gap-2",children:[_.jsx(it,{onClick:V,size:"sm",variant:"outline",children:_.jsx(y2,{})}),_.jsx(it,{onClick:$=>{const X=V($);X&&(t(!1),c(X),d(!0))},size:"sm",variant:"outline",children:_.jsx(Sz,{})})]})]}),li:({node:q,...J})=>_.jsx("li",{style:j,...J})};function V(q){const J=q.currentTarget.closest("pre");if(!J)return;const $=J.textContent||J.innerText;return navigator.clipboard.writeText($).then(()=>console.log("Text copied to clipboard")).catch(X=>console.error("Error in copying text: ",X)),$}return _.jsxs(Ly,{open:e,onOpenChange:t,children:[_.jsx(Fy,{asChild:!0,children:_.jsx(it,{size:"sm",className:"",variant:"outline",children:_.jsx(nH,{strokeWidth:1,size:16})})}),_.jsxs(zp,{className:" sm:max-w-[425px] md:min-w-[625px] md:max-h-[625px] flex flex-col justify-between overflow-auto",children:[_.jsxs(Bp,{children:[_.jsx(Vp,{children:"Ask"}),_.jsx(Hp,{children:"Need assistance? Feel free to ask me any question!"})]}),_.jsx(da,{className:"h-[625px] w-full border-t border-t-muted ",children:(!S||!C)&&_.jsx(are,{className:" pl-1 pr-3 py-1 w-full xbg-red-100 overflow-auto ",components:B,children:w==null?void 0:w.response})}),_.jsxs("div",{children:[_.jsx(Sf,{className:De(" invisible h-1 w-full animate-pulse",{visible:S||C})}),_.jsxs("div",{className:" border rounded-md flex items-center w-full",children:[_.jsx(nx,{onKeyDown:q=>{q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),r(""),T())},placeholder:"Type something...",onFocus:q=>{const J=q.target,$=J.value.length;J.setSelectionRange($,$)},className:" border-none resize-none min-h-7 max-h-10 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",value:n,onChange:q=>r(q.target.value)})," ",_.jsx(it,{className:"h-8",size:"sm",variant:"ghost",onClick:T,children:!S&&!C?_.jsx(wz,{}):_.jsx(Nl,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"})})]})]})]})]})}function dre(){const{theme:e}=Bm(),t=m.useRef(),n=m.useRef(),[r,i]=m.useState(!1),[o,s]=m.useState(!1),[a,l]=m.useState(""),[c,d]=m.useState(!1);m.useState("");const f=fe(ae=>ae.authToken);fe(ae=>ae.selectedSheetId);const g=ve(ae=>ae.card),p=fe(ae=>ae.theme),v=ve(ae=>ae.isShowingVisual),b=ve(ae=>ae.selectedConnectionId),x=ve(ae=>ae.selectedDatabaseName),w=ve(ae=>ae.selectedSchemaName);fe(ae=>ae.actions.updateFrameCard);const S=ve(ae=>ae.selectedTableName),C=ve(ae=>ae.actions.setCardSql),P=ve(ae=>ae.card.sql),O=ve(ae=>ae.selectedConnectionId),k=ve(ae=>ae.frame),T=ve(ae=>ae.filterValues),I=ve(ae=>ae.applyFilters),F=ve(ae=>ae.actions.setCardCustomCfg),j=ve(ae=>ae.actions.setFilterValues),B=ve(ae=>ae.onSave),V=ve(ae=>ae.actions.setApplyFilters),q=ve(ae=>ae.onClose),J=ve(ae=>ae.actions.setCardData),$=ve(ae=>ae.actions.setSqlGen),X=ve(ae=>ae.runSql),W=ve(ae=>ae.actions.setRunSql),ne=ve(ae=>ae.actions.setIsSqlRunning),{data:le,isLoading:A,isFetching:H,isSuccess:re,isError:R,error:ue,status:xe,refetch:ge}=Xr({queryKey:[P],queryFn:()=>ll("https://semaphor.cloud/api/v1/query",(f==null?void 0:f.accessToken)||"",{connection_id:O,sql:P,active_filters:I?T:[]}),enabled:!1,retry:!1});m.useEffect(()=>{le&&(console.log("queryData",le),J(le.records))},[le,J]),m.useEffect(()=>{X&&(ge(),W(!1))},[X,ge,W]),m.useEffect(()=>{(A||H)&&ne(!0),(R||re)&&ne(!1)},[A,H,R,re,ne]);function pe(){C(""),J([]),$({}),F("")}const ee=ae=>{n.current=ae};function Q(){let ae;if(P&&!P.includes("{{")){const We=MZ(P);C(We),ae={...g,sql:We}}else ae={...g,lastSelectedSchema:w,lastSelectedDatabase:x,lastSelectedTable:S,connectionId:b,type:v?g.type:"table",customCfg:v?g.customCfg:null};const Se=k.cards.map(We=>We.id===g.id?ae:We);B==null||B({...k,cards:Se})}function ie(){q==null||q()}function we(ae){const Se=getComputedStyle(document.documentElement).getPropertyValue(ae);return te(Se)}function te(ae){const[Se,We,dt]=ae.split(" "),qe=parseFloat(Se),gt=parseFloat(We),Gt=parseFloat(dt),Bt=gt/100,gn=Gt/100,Rt=(1-Math.abs(2*gn-1))*Bt,mr=Rt*(1-Math.abs(qe/60%2-1)),he=gn-Rt/2;let Ee=0,Ne=0,Ue=0;0<=qe&&qe<60?(Ee=Rt,Ne=mr,Ue=0):60<=qe&&qe<120?(Ee=mr,Ne=Rt,Ue=0):120<=qe&&qe<180?(Ee=0,Ne=Rt,Ue=mr):180<=qe&&qe<240?(Ee=0,Ne=mr,Ue=Rt):240<=qe&&qe<300?(Ee=mr,Ne=0,Ue=Rt):300<=qe&&qe<360&&(Ee=Rt,Ne=0,Ue=mr),Ee=Math.round((Ee+he)*255),Ne=Math.round((Ne+he)*255),Ue=Math.round((Ue+he)*255);const at=ln=>{const cn=ln.toString(16);return cn.length==1?"0"+cn:cn};return`#${at(Ee)}${at(Ne)}${at(Ue)}`}m.useEffect(()=>{const ae=t.current,Se=n.current;if(ae){const We=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",dt=p==="system"?We:p;ae.editor.defineTheme("default",{base:dt==="light"?"vs":"vs-dark",inherit:!0,rules:[],colors:{"editor.background":dt==="light"?"#ffffff":we("--background")}}),ae.editor.setTheme("default")}return Se&&ae&&Se.addCommand(ae.KeyMod.Shift|ae.KeyCode.Enter,function(){return console.log("Executing query..."),ge(),!1}),()=>{}},[e,p,t.current]);function Ie(ae){t.current=ae}return _.jsxs("section",{role:"editor-section",className:"grow flex flex-col justify-end pt-3 p-1 ",children:[_.jsxs("div",{className:" grow flex relative overflow-y-scroll justify-between ",children:[_.jsx("div",{role:"editor-container",className:`flex ${r?"w-2/3":"w-[95%]"} xbg-red-100 p-1`,children:_.jsx(Xy,{theme:"default",onChange:ae=>{C(ae),console.log(ae)},value:P,options:{minimap:{enabled:!1},wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:14,renderLineHighlight:"none"},defaultLanguage:"sql",defaultValue:"SELECT * FROM table",beforeMount:Ie,onMount:ee})}),r&&_.jsx("div",{className:" w-1/3 text-xs relative overflow-hidden xbg-yellow-100 p-1 ",children:_.jsxs("div",{className:"min-h-0 ",children:[_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx(HZ,{checked:I,onCheckedChange:()=>V(!I),text:"Apply Filters"}),_.jsx(WZ,{})]}),_.jsx(Xy,{theme:"default",onChange:ae=>{if(ae)try{JSON.parse(ae),j(JSON.parse(ae))}catch{}},defaultLanguage:"json",className:"min-h-[220px] mt-1",value:JSON.stringify(T,null,2),options:{readOnly:!0,minimap:{enabled:!1},lineNumbers:"off",glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})]})}),T&&r&&_.jsx(ca,{onClick:()=>i(!1),className:"absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer"}),T&&!r&&_.jsx(AO,{onClick:()=>i(!0),className:De("absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer",{"text-red-800 font-bold":I})})]}),_.jsxs("div",{className:" flex grow px-6 pt-3 pb-4 gap-2 justify-between item-center",children:[_.jsxs("div",{className:"flex grow gap-2 items-center",children:[_.jsxs(it,{disabled:A||H,onClick:()=>{ge()},className:" shrink-0",size:"sm",variant:"outline",children:[(A||H)&&_.jsx(Nl,{className:"w-4 h-4 mr-2 animate-spin text-foreground/50"}),"Run"]}),R&&_.jsx(VZ,{error:ue.message}),_.jsx(it,{onClick:pe,className:"",size:"sm",variant:"outline",children:"Clear"}),_.jsx(Oo,{value:a,placeholder:"Type something...",onChange:ae=>{l(ae.target.value)},onKeyDown:ae=>{ae.key==="Enter"&&(ae.preventDefault(),console.log("enter pressed"),d(!0),s(!0))},className:" bg-muted border-none h-9 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"}),_.jsx(ure,{open:o,setOpen:s,userInput:a,triggerAIRun:c,setTriggerAIRun:d,setUserInput:ae=>l(ae)})]}),_.jsxs("div",{className:"flex gap-2 items-end ",children:[_.jsx(it,{onClick:Q,size:"sm",variant:"outline",children:_.jsx(rp,{size:16,strokeWidth:2,className:"text-green-600 font-bold"})}),_.jsx(it,{onClick:ie,className:" w-full",size:"sm",variant:"outline",children:_.jsx(ca,{})})]})]})]})}const i5="Switch",[fre,Gfe]=kn(i5),[hre,pre]=fre(i5),gre=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,g]=m.useState(null),p=nt(t,S=>g(S)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[x=!1,w]=Qn({prop:i,defaultProp:o,onChange:c});return m.createElement(hre,{scope:n,checked:x,disabled:a},m.createElement(He.button,se({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":o5(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:p,onClick:Pe(e.onClick,S=>{w(C=>!C),b&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),b&&m.createElement(bre,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),mre="SwitchThumb",vre=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=pre(mre,n);return m.createElement(He.span,se({"data-state":o5(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),bre=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Wp(n),a=Hh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",se({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function o5(e){return e?"checked":"unchecked"}const s5=gre,yre=vre,a5=de.forwardRef(({className:e,...t},n)=>_.jsx(s5,{className:De("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:_.jsx(yre,{className:De("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")})}));a5.displayName=s5.displayName;function l5({className:e,...t}){const[n,r]=m.useState(0),i=fe(l=>l.themeStyle),o=ve(l=>l.card),s=ve(l=>l.actions.setCard);if(m.useEffect(()=>{r(n+1)},[o.data,o.type,o.cfg,o.customCfg,i]),!o.id)return null;let a;return o.data&&o.data.length>0&&(a=S0({data:o.data,cardType:o.type,cfg:o.cfg,customCfg:o.customCfg})),_.jsxs(Kf,{role:"editor-visual-card",className:De(" relative h-full flex flex-col rounded-none",e),...t,children:[_.jsxs(tu,{children:[_.jsx(ao,{text:o.title,onSave:l=>s({...o,title:l}),children:_.jsx(nu,{className:"text-base",children:o.title})}),_.jsx(ao,{text:o.description||"",onSave:l=>s({...o,description:l}),children:_.jsxs(Xf,{children:[" ",o.description]})})]}),_.jsxs(ru,{className:"flex flex-col pb-3 grow",children:[o.type!=="table"&&a&&_.jsx($b,{cfg:a},n),o.type==="table"&&o.data&&o.data.length>0&&_.jsx(bO,{children:_.jsx(Jh,{data:o==null?void 0:o.data})})]})]})}function xre(){const[e,t]=m.useState(!1),[n,r]=m.useState(""),[i,o]=m.useState(""),[s,a]=m.useState(""),l=ve(x=>x.card),c=ve(x=>x.card.customCfg),d=ve(x=>x.actions.setCardCustomCfg);function f(x){var C,P;const w={...x,data:{...x==null?void 0:x.data,datasets:(P=(C=x==null?void 0:x.data)==null?void 0:C.datasets)==null?void 0:P.map(O=>({...O,data:[]}))}};return JSON.stringify(w,null,1)}function g(){if(!l.data||l.data.length===0)return;const x=S0({data:l.data,cardType:l.type,cfg:l.cfg});x&&(r(JSON.stringify(x,null,1)),c&&o(JSON.stringify(c,null,1)))}function p(){if(i)try{const x=JSON.parse(i);return x?(d(x),a(""),o(""),x):void 0}catch(x){console.log(x),a("Invalid JSON")}}function v(){o(""),d(null)}function b(){let x;if(c){const w=Vs.cloneDeep(l.cfg),S=Vs.merge(w,c);return x=f(S),x}return n?(x=f(JSON.parse(n)),x):""}return _.jsxs(Ly,{open:e,onOpenChange:t,children:[_.jsx(Fy,{asChild:!0,children:_.jsx(it,{onClick:g,className:`h-7 ${c&&"border-foreground/50 dark:border-foreground/70"}`,size:"sm",variant:"outline",children:c?"Custom Config":"Customize"})}),_.jsxs(zp,{className:" min-h-[70vh] max-h-[70vh] overflow-auto min-w-[900px] ",children:[_.jsxs(Bp,{className:"",children:[_.jsx(Vp,{children:"Customize Chart"}),_.jsxs(Hp,{children:["See the configuration options and documentation",_.jsx("a",{target:"_blank",className:"ml-1 underline text-blue-500 ",href:"https://www.chartjs.org/docs/latest/samples/bar/vertical.html",children:"here."})]})]}),_.jsxs("div",{className:"flex grow gap-2 ",children:[_.jsx(l5,{className:" w-1/2 rounded shadow-none"}),_.jsxs(k_,{defaultValue:"custom-config",className:" w-1/2 flex flex-col ",children:[_.jsxs(D_,{className:" justify-start border rounded-sm rounded-b-none border-b-0 ",children:[_.jsxs(Km,{value:"custom-config",children:[c&&_.jsx(b2,{className:"w-5 h-5 mr-1 text-green-600"}),c?"Custom Config":"Default Config"]}),_.jsx(Km,{className:"",value:"output",children:"Output"})]}),_.jsx(Pf,{className:" grow mt-0 bg-red-x p-2 border border-t-0 rounded-b ",value:"output",children:_.jsx(nx,{disabled:!0,value:n,className:" border-none resize-none font-mono h-full focus-visible:ring-0 focus-visible:ring-offset-0"})}),_.jsx(Pf,{className:"grow mt-0 border border-t-0 rounded-b ",value:"custom-config",children:_.jsx(Xy,{className:"h-full w-full overflow-hidden",theme:"default",options:{minimap:{enabled:!1},wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:14,renderLineHighlight:"none"},defaultLanguage:"json",value:b(),onChange:x=>o(x)})})]})]}),_.jsxs($y,{className:"flex items-center",children:[_.jsx(ni,{className:"text-red-500 mr-2",children:s}),_.jsx(it,{disabled:!c,onClick:v,variant:"outline",children:"Reset"}),_.jsx(it,{onClick:p,variant:"outline",children:"Apply"}),_.jsx(it,{onClick:()=>t(!1),variant:"outline",children:"Close"})]})]})]})}var c5={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},u5=m.createContext&&m.createContext(c5),wre=["attr","size","title"];function _re(e,t){if(e==null)return{};var n=Sre(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sre(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function vg(){return vg=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},vg.apply(this,arguments)}function d5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d5(Object(n),!0).forEach(function(r){Cre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cre(e,t,n){return t=Ere(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ere(e){var t=Ore(e,"string");return typeof t=="symbol"?t:String(t)}function Ore(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 f5(e){return e&&e.map((t,n)=>m.createElement(t.tag,bg({key:n},t.attr),f5(t.child)))}function oc(e){return t=>m.createElement(Pre,vg({attr:bg({},e.attr)},t),f5(e.child))}function Pre(e){var t=n=>{var{attr:r,size:i,title:o}=e,s=_re(e,wre),a=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),m.createElement("svg",vg({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:bg(bg({color:e.color||n.color},n.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&m.createElement("title",null,o),e.children)};return u5!==void 0?m.createElement(u5.Consumer,null,n=>t(n)):t(c5)}function h5(e){return oc({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z"},child:[]}]})(e)}function p5(e){return oc({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z"},child:[]}]})(e)}function g5(e){return oc({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M137,28.05a11.94,11.94,0,0,0-9.12,3.08A12.09,12.09,0,0,0,124,40V80.67a11.88,11.88,0,0,0,9.9,11.81,36,36,0,1,1-41.85,37.4c-.47-9.14,1.47-16.8,5.75-22.79h0a11.89,11.89,0,0,0-1.3-15.35L68.87,63.51a12,12,0,0,0-17.74.83A99.6,99.6,0,0,0,57.79,199.2,99.24,99.24,0,0,0,128,228h1.43A100.29,100.29,0,0,0,228,129.42C228.72,77.21,188.76,32.68,137,28.05ZM57.28,69.46A4,4,0,0,1,60.2,68h.19a3.91,3.91,0,0,1,2.79,1.14L90.81,97.36a3.93,3.93,0,0,1,.48,5.08A40.47,40.47,0,0,0,84.08,124h-48A90.36,90.36,0,0,1,57.28,69.46ZM36.09,132H84.18A44,44,0,0,0,124,171.81V219.9A92,92,0,0,1,36.09,132ZM193,193a91.43,91.43,0,0,1-61,26.92V171.82a43.51,43.51,0,0,0,26-11.63,44,44,0,0,0-22.79-75.6A4,4,0,0,1,132,80.67V40a4,4,0,0,1,1.31-3,3.89,3.89,0,0,1,3-1c47.59,4.26,84.34,45.24,83.67,93.29A91.42,91.42,0,0,1,193,193Z"},child:[]}]})(e)}function m5(e){return oc({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"},child:[]},{tag:"path",attr:{d:"M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0"},child:[]}]})(e)}function v5(e){return oc({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z"},child:[]}]})(e)}function b5(e){return oc({tag:"svg",attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z"},child:[]}]})(e)}function kre(){const[e,t]=m.useState(!1),n=ve(s=>s.card.type),r=ve(s=>s.actions.setCardType),i=ve(s=>s.actions.setCardCustomCfg);function o(s){r(s),i(null),t(!1)}return _.jsxs(Ap,{open:e,onOpenChange:t,children:[_.jsx(Ip,{asChild:!0,children:_.jsx(it,{className:"h-7 px-2",variant:"outline",children:_.jsx(Dre,{className:"h-4 w-4",chartType:n})})}),_.jsx(nd,{className:"w-50",children:_.jsxs("div",{className:"grid grid-cols-3 place-items-center ",children:[_.jsx(it,{onClick:()=>o("bar"),className:"font-normal",variant:"ghost",children:_.jsx(DO,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("line"),variant:"ghost",children:_.jsx(IO,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("stackedBar"),variant:"ghost",children:_.jsx(v5,{className:"h-6 w-6 text-foreground/50 ",strokeWidth:0})}),_.jsx(it,{onClick:()=>o("scatter"),variant:"ghost",children:_.jsx(LO,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("bubble"),variant:"ghost",children:_.jsx(m5,{strokeWidth:2})}),_.jsx(it,{onClick:()=>o("pie"),variant:"ghost",children:_.jsx(NO,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("doughnut"),variant:"ghost",children:_.jsx(g5,{className:"h-7 w-7",strokeWidth:.5})}),_.jsx(it,{onClick:()=>o("radar"),variant:"ghost",children:_.jsx(h5,{className:"h-6 w-6 text-foreground/50 font-extralight",strokeWidth:.5})}),_.jsx(it,{onClick:()=>o("polarArea"),variant:"ghost",children:_.jsx(p5,{className:"h-6 w-6 text-foreground/50",strokeWidth:1})}),_.jsx(it,{onClick:()=>o("table"),variant:"ghost",children:_.jsx(y0,{className:"h-6 w-6 text-foreground/90",strokeWidth:1})}),_.jsx(it,{onClick:()=>o("kpi"),variant:"ghost",children:_.jsx(b5,{className:"h-6 w-6 text-foreground/70",strokeWidth:0})})]})})]})}function Dre({chartType:e,className:t}){switch(e){case"bar":return _.jsx(DO,{className:t});case"line":return _.jsx(IO,{className:t});case"pie":return _.jsx(NO,{className:t});case"radar":return _.jsx(h5,{className:t});case"scatter":return _.jsx(LO,{className:t});case"bubble":return _.jsx(m5,{className:t});case"doughnut":return _.jsx(g5,{className:t});case"stackedBar":return _.jsx(v5,{className:"h-5 w-5 text-foreground/50 ",strokeWidth:0});case"polarArea":return _.jsx(p5,{className:t});case"kpi":return _.jsx(b5,{className:t});default:return _.jsx(y0,{className:t})}}function Mre(){const e=ve(n=>n.card.refreshInterval),t=ve(n=>n.actions.setCardRefreshInterval);return _.jsxs(Ap,{children:[_.jsx(Ip,{asChild:!0,children:_.jsx(it,{className:"h-7",variant:"outline",children:"Realtime"})}),_.jsx(nd,{className:"w-[200px]",children:_.jsx("div",{className:"grid gap-4",children:_.jsx("div",{className:"grid gap-2",children:_.jsxs("div",{className:"grid grid-cols-5 items-center gap-1",children:[_.jsx(ni,{className:"col-span-3",htmlFor:"width",children:"Refresh Every"}),_.jsx(Oo,{value:e||"",onChange:n=>t(n.target.value),id:"width",placeholder:"30s",className:"col-span-2 h-7 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0"})]})})})})]})}function y5(){ve(r=>r.frame);const e=ve(r=>r.frame.cards.find(i=>i.id===r.frame.activeCardId)),t=ve(r=>r.isShowingVisual),n=ve(r=>r.isSqlRunning);return ve(r=>r.onSave),ve(r=>r.onClose),ve(r=>r.actions.setCardSql),ve(r=>r.actions.setCardType),ve(r=>r.actions.setSqlGen),e?_.jsxs("div",{className:" h-full relative flex flex-col",children:[n&&_.jsx(Nl,{className:" w-10 h-10 z-10 absolute m-auto left-0 right-0 top-0 bottom-0 animate-spin text-foreground/10 "}),_.jsxs("div",{className:" h-10 px-6 pt-6 bg-red-x100 mb-0 z-10 right-0 flex justify-end items-center gap-2",children:[t&&_.jsxs("div",{className:"bg-red-x00 flex grow gap-2",children:[_.jsx(kre,{}),_.jsx(xre,{}),_.jsx(Mre,{})]}),_.jsx(Tre,{})]}),t?e.type==="kpi"?_.jsx("div",{className:"grow flex items-center justify-center ",children:_.jsx("div",{className:" border rounded-md",children:_.jsx(x0,{card:e})})}):_.jsx(l5,{className:"grow border-none shadow-none "}):_.jsx("div",{className:"w-full mt-4 px-6 bg-red-x00 grow border-none shadow-none overflow-y-auto ",children:e.data&&e.data.length>0&&_.jsx(Jh,{data:e.data})})]}):_.jsx(_.Fragment,{children:"No Active Card"})}function Tre(){const e=ve(n=>n.isShowingVisual),t=ve(n=>n.actions.setIsShowingVisual);return _.jsxs("div",{className:" flex items-center space-x-2",children:[_.jsx(ni,{htmlFor:"visualize",children:"Chart"}),_.jsx(a5,{checked:e,onCheckedChange:()=>t(!e),id:"visualize",className:"data-[state=checked]:bg-foreground/50"})]})}const x5="Collapsible",[Are,w5]=kn(x5),[Ire,Fx]=Are(x5),Nre=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l=!1,c]=Qn({prop:r,defaultProp:i,onChange:s});return m.createElement(Ire,{scope:n,disabled:o,contentId:or(),open:l,onOpenToggle:m.useCallback(()=>c(d=>!d),[c])},m.createElement(He.div,se({"data-state":$x(l),"data-disabled":o?"":void 0},a,{ref:t})))}),Rre="CollapsibleTrigger",Lre=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Fx(Rre,n);return m.createElement(He.button,se({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":$x(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Pe(e.onClick,i.onOpenToggle)}))}),_5="CollapsibleContent",Fre=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Fx(_5,e.__scopeCollapsible);return m.createElement(yn,{present:n||i.open},({present:o})=>m.createElement($re,se({},r,{ref:t,present:o})))}),$re=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=Fx(_5,n),[a,l]=m.useState(r),c=m.useRef(null),d=nt(t,c),f=m.useRef(0),g=f.current,p=m.useRef(0),v=p.current,b=s.open||a,x=m.useRef(b),w=m.useRef();return m.useEffect(()=>{const S=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(S)},[]),Vn(()=>{const S=c.current;if(S){w.current=w.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const C=S.getBoundingClientRect();f.current=C.height,p.current=C.width,x.current||(S.style.transitionDuration=w.current.transitionDuration,S.style.animationName=w.current.animationName),l(r)}},[s.open,r]),m.createElement(He.div,se({"data-state":$x(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b},o,{ref:d,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),b&&i)});function $x(e){return e?"open":"closed"}const jre=Nre,zre=Lre,Bre=Fre,ys="Accordion",Vre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[jx,Hre,Wre]=Ef(ys),[yg,Yfe]=kn(ys,[Wre,w5]),zx=w5(),S5=m.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,o=r;return m.createElement(jx.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(Yre,se({},o,{ref:t})):m.createElement(Gre,se({},i,{ref:t})))});S5.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[C5,Ure]=yg(ys),[E5,qre]=yg(ys,{collapsible:!1}),Gre=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...s}=e,[a,l]=Qn({prop:n,defaultProp:r,onChange:i});return m.createElement(C5,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>o&&l(""),[o,l])},m.createElement(E5,{scope:e.__scopeAccordion,collapsible:o},m.createElement(O5,se({},s,{ref:t}))))}),Yre=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s=[],a]=Qn({prop:n,defaultProp:r,onChange:i}),l=m.useCallback(d=>a((f=[])=>[...f,d]),[a]),c=m.useCallback(d=>a((f=[])=>f.filter(g=>g!==d)),[a]);return m.createElement(C5,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(E5,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(O5,se({},o,{ref:t}))))}),[Kre,xg]=yg(ys),O5=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...s}=e,a=m.useRef(null),l=nt(a,t),c=Hre(n),f=Hs(i)==="ltr",g=Pe(e.onKeyDown,p=>{var v;if(!Vre.includes(p.key))return;const b=p.target,x=c().filter(F=>{var j;return!((j=F.ref.current)!==null&&j!==void 0&&j.disabled)}),w=x.findIndex(F=>F.ref.current===b),S=x.length;if(w===-1)return;p.preventDefault();let C=w;const P=0,O=S-1,k=()=>{C=w+1,C>O&&(C=P)},T=()=>{C=w-1,C<P&&(C=O)};switch(p.key){case"Home":C=P;break;case"End":C=O;break;case"ArrowRight":o==="horizontal"&&(f?k():T());break;case"ArrowDown":o==="vertical"&&k();break;case"ArrowLeft":o==="horizontal"&&(f?T():k());break;case"ArrowUp":o==="vertical"&&T();break}const I=C%S;(v=x[I].ref.current)===null||v===void 0||v.focus()});return m.createElement(Kre,{scope:n,disabled:r,direction:i,orientation:o},m.createElement(jx.Slot,{scope:n},m.createElement(He.div,se({},s,{"data-orientation":o,ref:l,onKeyDown:r?void 0:g}))))}),Bx="AccordionItem",[Xre,Vx]=yg(Bx),Qre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,o=xg(Bx,n),s=Ure(Bx,n),a=zx(n),l=or(),c=r&&s.value.includes(r)||!1,d=o.disabled||e.disabled;return m.createElement(Xre,{scope:n,open:c,disabled:d,triggerId:l},m.createElement(jre,se({"data-orientation":o.orientation,"data-state":k5(c)},a,i,{ref:t,disabled:d,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),Zre="AccordionHeader",Jre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=xg(ys,n),o=Vx(Zre,n);return m.createElement(He.h3,se({"data-orientation":i.orientation,"data-state":k5(o.open),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),P5="AccordionTrigger",eie=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=xg(ys,n),o=Vx(P5,n),s=qre(P5,n),a=zx(n);return m.createElement(jx.ItemSlot,{scope:n},m.createElement(zre,se({"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId},a,r,{ref:t})))}),tie="AccordionContent",nie=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=xg(ys,n),o=Vx(tie,n),s=zx(n);return m.createElement(Bre,se({role:"region","aria-labelledby":o.triggerId,"data-orientation":i.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 k5(e){return e?"open":"closed"}const rie=S5,iie=Qre,oie=Jre,D5=eie,M5=nie,Hx=rie,ko=de.forwardRef(({className:e,...t},n)=>_.jsx(iie,{ref:n,className:De("border-b",e),...t}));ko.displayName="AccordionItem";const Do=de.forwardRef(({className:e,children:t,...n},r)=>_.jsx(oie,{className:"flex",children:_.jsxs(D5,{ref:r,className:De("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,_.jsx(b0,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Do.displayName=D5.displayName;const Mo=de.forwardRef(({className:e,children:t,...n},r)=>_.jsx(M5,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:_.jsx("div",{className:De("pb-4 pt-0",e),children:t})}));Mo.displayName=M5.displayName;const T5="Radio",[sie,A5]=kn(T5),[aie,lie]=sie(T5),cie=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:s,value:a="on",onCheck:l,...c}=e,[d,f]=m.useState(null),g=nt(t,b=>f(b)),p=m.useRef(!1),v=d?!!d.closest("form"):!0;return m.createElement(aie,{scope:n,checked:i,disabled:s},m.createElement(He.button,se({type:"button",role:"radio","aria-checked":i,"data-state":I5(i),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:g,onClick:Pe(e.onClick,b=>{i||l==null||l(),v&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})),v&&m.createElement(fie,{control:d,bubbles:!p.current,name:r,value:a,checked:i,required:o,disabled:s,style:{transform:"translateX(-100%)"}}))}),uie="RadioIndicator",die=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=lie(uie,n);return m.createElement(yn,{present:r||o.checked},m.createElement(He.span,se({"data-state":I5(o.checked),"data-disabled":o.disabled?"":void 0},i,{ref:t})))}),fie=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Wp(n),a=Hh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",se({type:"radio","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function I5(e){return e?"checked":"unchecked"}const hie=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],N5="RadioGroup",[pie,Kfe]=kn(N5,[fl,A5]),R5=fl(),L5=A5(),[gie,mie]=pie(N5),vie=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:d=!0,onValueChange:f,...g}=e,p=R5(n),v=Hs(c),[b,x]=Qn({prop:o,defaultProp:i,onChange:f});return m.createElement(gie,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:x},m.createElement(qm,se({asChild:!0},p,{orientation:l,dir:v,loop:d}),m.createElement(He.div,se({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},g,{ref:t}))))}),bie="RadioGroupItem",yie=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=mie(bie,n),s=o.disabled||r,a=R5(n),l=L5(n),c=m.useRef(null),d=nt(t,c),f=o.value===i.value,g=m.useRef(!1);return m.useEffect(()=>{const p=b=>{hie.includes(b.key)&&(g.current=!0)},v=()=>g.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),m.createElement(Gm,se({asChild:!0},a,{focusable:!s,active:f}),m.createElement(cie,se({disabled:s,required:o.required,checked:f},l,i,{name:o.name,ref:d,onCheck:()=>o.onValueChange(i.value),onKeyDown:Pe(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Pe(i.onFocus,()=>{var p;g.current&&((p=c.current)===null||p===void 0||p.click())})})))}),xie=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=L5(n);return m.createElement(die,se({},i,r,{ref:t}))}),F5=vie,$5=yie,wie=xie,j5=de.forwardRef(({className:e,...t},n)=>_.jsx(F5,{className:De("grid gap-2",e),...t,ref:n}));j5.displayName=F5.displayName;const Wx=de.forwardRef(({className:e,...t},n)=>_.jsx($5,{ref:n,className:De("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:_.jsx(wie,{className:"flex items-center justify-center",children:_.jsx(TO,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Wx.displayName=$5.displayName;function z5(){var i;const e=ve(o=>o.card.cfg),t=ve(o=>o.actions.setCardCfg),n=(i=e==null?void 0:e.options)==null?void 0:i.indexAxis;function r(o){const s={...e,options:{...e==null?void 0:e.options,indexAxis:o}};t(s)}return _.jsxs("div",{children:[_.jsx("p",{className:"font-semibold",children:"Orientation"}),_.jsxs(j5,{value:n,onValueChange:r,className:"flex gap-3 mt-2 ",defaultValue:"x",children:[_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(Wx,{value:"x",id:"r1"}),_.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Vertical"})]}),_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(Wx,{value:"y",id:"r2"}),_.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Horizontal"})]})]})]})}function B5(){var r,i,o;const e=ve(s=>s.card.cfg),t=ve(s=>s.actions.setCardCfg);function n(s){var c;const a={datalabels:{display:s!=="none",align:s,anchor:s,clamp:!0}},l={...e,options:{...e==null?void 0:e.options,plugins:{...(c=e==null?void 0:e.options)==null?void 0:c.plugins,...a}}};t(l),console.log(s)}return _.jsxs(_.Fragment,{children:[_.jsx("label",{className:"font-medium",children:"Data Labels"}),_.jsxs(DD,{value:(o=(i=(r=e==null?void 0:e.options)==null?void 0:r.plugins)==null?void 0:i.datalabels)==null?void 0:o.anchor,onValueChange:n,defaultValue:"none",children:[_.jsx(Vy,{className:"w-[180px] mt-2 focus:ring-1 focus:ring-offset-0 h-7",children:_.jsx(TD,{placeholder:"Select position"})}),_.jsx(Hy,{children:_.jsxs(MD,{children:[_.jsx(Kp,{children:"Data Labels"}),_.jsx(Da,{value:"none",children:"None"}),_.jsx(Da,{value:"start",children:"Start"}),_.jsx(Da,{value:"center",children:"Center"}),_.jsx(Da,{value:"end",children:"End"})]})})]})]})}function V5(){const e=ve(i=>i.card.preferences),t=ve(i=>i.actions.setCardPreferences),n=ve(i=>{var o;return(o=i.card.preferences)==null?void 0:o.filterOnClickField}),r=ve(i=>i.actions.setFilterOnClickField);return _.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[_.jsx(ad,{checked:!!(e!=null&&e.filterOnClick),onCheckedChange:i=>{t({...e,filterOnClick:!!i})}}),_.jsx(ni,{children:"Filter on click"})]}),(e==null?void 0:e.filterOnClick)===!0&&_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx(Oo,{value:n||"",className:" h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"expression (optional)",onChange:i=>r(i.target.value)}),_.jsxs(zu,{children:[_.jsx(Gh,{children:_.jsx(jb,{className:"h-4 w-4 opacity-70"})}),_.jsx(Tl,{children:_.jsxs("div",{className:"max-w-[200px]",children:["The x-axis expression of your query. Example:",_.jsx("div",{className:" mt-1 text-xs font-mono",children:"TO_CHAR(order_date, 'YYYY-MM')"})]})})]})]})]})}const _ie={datasets:[{type:"line",label:"Sum_sales",data:[]},{type:"bar",label:"Sum_profit",data:[]}]},Sie={datasets:[{fill:"origin",type:"line",label:"Sum_sales",data:[]}]};function Cie(){const e=ve(t=>t.card.type);return _.jsxs("div",{className:"p-6 space-y-6",children:[_.jsx(Hx,{className:" ",type:"single",collapsible:!0,children:Eie(e)}),_.jsx("section",{className:"",children:["line","bar"].includes(e)&&_.jsx(z5,{})}),_.jsx("div",{children:!["kpi"].includes(e)&&_.jsx(B5,{})}),_.jsx("div",{children:!["kpi"].includes(e)&&_.jsx(V5,{})})]})}function Eie(e){if(["line","bar"].includes(e))return _.jsxs(_.Fragment,{children:[_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:_.jsx("p",{children:"Chart Query"})}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"X-axis - Category (ex. city)"}),_.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]}),_.jsxs(ko,{value:"item-2",children:[_.jsx(Do,{className:" font-normal",children:"Mixed Chart"}),_.jsxs(Mo,{className:" text-xs space-y-2",children:[_.jsxs("p",{children:["Click ",_.jsx("b",{children:"Customize"})," and change the `type` property in the dataset."]}),_.jsx("pre",{children:JSON.stringify(_ie,null,2)})]})]}),_.jsxs(ko,{value:"item-3",children:[_.jsx(Do,{className:" font-normal",children:"Area Chart"}),_.jsxs(Mo,{className:" text-xs space-y-2",children:[_.jsxs("p",{children:["Click ",_.jsx("b",{children:"Customize"})," and add `fill` property to the dataset. See",_.jsx("a",{className:"text-blue-500 hover:underline mx-1",href:"https://www.chartjs.org/docs/latest/samples/area/line-boundaries.html",target:"_blank",children:"docs"}),"for more options."]}),_.jsx("pre",{children:JSON.stringify(Sie,null,2)})]})]})]});if(e==="bubble")return _.jsx(_.Fragment,{children:_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:_.jsxs("p",{children:["How to create a ",_.jsx("span",{children:e})," chart query?"]})}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, x-axis, y-axis, radius FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Bubble Group (opt) - Category (ex. state)"}),_.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),_.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"}),_.jsx("li",{children:"Radius - Number (ex. population)"})]})]})]})});if(e==="scatter")return _.jsx(_.Fragment,{children:_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:_.jsxs("p",{children:["How to create a ",_.jsx("span",{children:e})," chart query?"]})}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, x-axis, y-axis FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Group (opt) - Category (ex. state)"}),_.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),_.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"})]})]})]})});if(["pie","doughnut","polarArea"].includes(e))return _.jsx(_.Fragment,{children:_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:_.jsxs("p",{children:[_.jsx("span",{children:e==="polarArea"?"Polar":e.charAt(0).toUpperCase()+e.slice(1)})," ","chart query"]})}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, measure FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Measure - Number (ex. population)"})]})]})]})})}function Oie(){var s,a,l;const e=ve(c=>c.card.preferences),t=ve(c=>c.actions.setCardPreferences),n=ve(c=>c.actions.setNumberFormat),r=ve(c=>{var d,f;return(f=(d=c.card.preferences)==null?void 0:d.formatNumber)==null?void 0:f.format}),i=ve(c=>{var d,f;return(f=(d=c.card.preferences)==null?void 0:d.formatNumber)==null?void 0:f.locale}),o=ve(c=>{var d,f;return(f=(d=c.card.preferences)==null?void 0:d.formatNumber)==null?void 0:f.currency});return ve(c=>c.actions.setFilterOnClickField),_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[_.jsx(ad,{checked:!!((s=e==null?void 0:e.formatNumber)!=null&&s.enabled),onCheckedChange:c=>{t({...e,formatNumber:{...e==null?void 0:e.formatNumber,enabled:c}})}}),_.jsx(ni,{children:"Format Number"})]}),((a=e==null?void 0:e.formatNumber)==null?void 0:a.enabled)===!0&&_.jsxs("div",{className:"flex flex-col gap-2 ",children:[_.jsxs("div",{children:[_.jsx(ni,{className:"text-xs",children:"Currency"}),_.jsxs("div",{className:"flex gap-1",children:[_.jsx(Oo,{value:o||"",className:" h-7 w-20 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"USD",onChange:c=>{var d,f,g;return n(((d=e==null?void 0:e.formatNumber)==null?void 0:d.format)||"",c.target.value,((f=e==null?void 0:e.formatNumber)==null?void 0:f.locale)||"",((g=e==null?void 0:e.formatNumber)==null?void 0:g.suffix)||"")}}),_.jsx(Oo,{value:i||"",className:" h-7 w-20 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"en-US",onChange:c=>{var d,f,g;return n(((d=e==null?void 0:e.formatNumber)==null?void 0:d.format)||"",((f=e==null?void 0:e.formatNumber)==null?void 0:f.currency)||"",c.target.value,((g=e==null?void 0:e.formatNumber)==null?void 0:g.suffix)||"")}})]})]}),_.jsxs("div",{children:[_.jsxs("div",{className:" flex gap-1",children:[_.jsx(ni,{className:"text-xs",children:"Format"}),_.jsxs(zu,{children:[_.jsx(Gh,{children:_.jsx(jb,{strokeWidth:1,className:"h-3 w-3 opacity-70"})}),_.jsx(Tl,{children:_.jsxs("div",{className:"max-w-[200px]",children:["Format number",_.jsx("div",{className:" mt-1 text-xs font-mono",children:"#.## for 123.43"})]})})]})]}),_.jsx("div",{children:_.jsx(Oo,{value:r||"",className:" h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"###,###.##",onChange:c=>{var d,f,g;return n(c.target.value,((d=e==null?void 0:e.formatNumber)==null?void 0:d.currency)||"",((f=e==null?void 0:e.formatNumber)==null?void 0:f.locale)||"",((g=e==null?void 0:e.formatNumber)==null?void 0:g.suffix)||"")}})})]}),_.jsxs("div",{children:[_.jsx(ni,{className:"text-xs",children:"Suffix"}),_.jsx(Oo,{value:((l=e==null?void 0:e.formatNumber)==null?void 0:l.suffix)||"",className:" h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"K, M, B",onChange:c=>{var d,f,g;return n(((d=e==null?void 0:e.formatNumber)==null?void 0:d.format)||"",((f=e==null?void 0:e.formatNumber)==null?void 0:f.currency)||"",((g=e==null?void 0:e.formatNumber)==null?void 0:g.locale)||"",c.target.value)}})]})]})]})}function Pie(){return _.jsxs("div",{className:"px-6 py-2 space-y-6",children:[_.jsx(Hx,{className:" ",type:"single",collapsible:!0,children:_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:"KPI query"}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT current, previous FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Current - Number (ex. Revenue)"}),_.jsx("li",{children:"Previous - Number (ex. Revenue)"})]})]})]})}),_.jsx("section",{className:"",children:_.jsx(Oie,{})}),_.jsx("div",{}),_.jsx("div",{})]})}function kie(){return _.jsxs("div",{className:"px-6 py-2 space-y-6",children:[_.jsx(Hx,{className:" ",type:"single",collapsible:!0,children:_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:"Stacked chart query?"}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT x-axis, stack-by, y-axis FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"X-axis - Category (ex. country)"}),_.jsx("li",{children:"Stack by - Category (ex. city)"}),_.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]})}),_.jsx("section",{className:"",children:_.jsx(z5,{})}),_.jsx("div",{children:_.jsx(B5,{})}),_.jsx("div",{children:_.jsx(V5,{})})]})}function Die(){const e=ve(n=>n.card.type);function t(n){switch(n){case"stackedBar":return _.jsx(kie,{});case"kpi":return _.jsx(Pie,{});default:return _.jsx(Cie,{})}}return _.jsx(da,{className:" text-sm h-full w-full ",children:t(e)})}function Mie(){const e=ve(t=>t.isShowingVisual);return _.jsxs(aM,{direction:"vertical",className:"min-w-full max-w-lg min-h-[250px]",children:[_.jsx(eg,{className:"flex",minSize:20,defaultSize:40,children:_.jsx(dre,{})}),_.jsx(lM,{className:"border-[1.5px] "}),_.jsx(eg,{minSize:20,defaultSize:60,children:e?_.jsxs(aM,{direction:"horizontal",children:[_.jsx(_.Fragment,{children:_.jsx(eg,{className:"flex min-w-[275px]",minSize:20,defaultSize:25,maxSize:30,children:_.jsx(Die,{})})}),_.jsx(lM,{className:"border-[1.5px] "}),_.jsx(eg,{minSize:40,defaultSize:75,maxSize:100,children:_.jsx(y5,{})})]}):_.jsx(y5,{})})]})}function Tie({authToken:e,onSave:t,onClose:n}){ve(s=>s.actions.setCard);const r=ve(s=>s.actions.setOnSave),i=ve(s=>s.actions.setOnClose),o=fe(s=>s.actions.setAuthToken);return m.useEffect(()=>{t&&r(t),n&&i(n)},[t,r,n,i]),m.useEffect(()=>{e&&e.accessToken&&o(e)},[e,o]),_.jsxs(lD,{className:"rounded-none",children:[_.jsx(cD,{className:" rounded-none border-r-[3px] ",children:_.jsx(RD,{})}),_.jsx(uD,{children:_.jsx(Mie,{})})]})}function Aie(){fe(s=>s.selectedCardId);const e=fe(s=>s.selectedSheetId),t=fe(s=>s.actions.setIsVisualEditing),n=fe(s=>s.isVisualEditing),r=fe(s=>s.actions.updateFrame);function i(s){e&&(r(e,s),t(!1))}function o(){t(!1)}return _.jsx("div",{role:"editor-container",className:De("grow flex",{block:n,hidden:!n}),children:_.jsx(Tie,{onSave:i,onClose:o})})}function Iie({columns:e,tableName:t}){const n=ve(f=>f.selectedConnectionId),r=ve(f=>f.selectedDatabaseName),i=ve(f=>f.selectedSchemaName),o=ve(f=>f.selectedTableName),s=fe(f=>f.dashboard.filters)||[],a=fe(f=>f.actions.addFilter),l=fe(f=>f.actions.removeFilter),c=fe(f=>f.actions.removeFilterValue);function d(f){const g=_i(f.column_name),p=_i(r||""),v=_i(i||""),b=_i(t),x=s==null?void 0:s.find(w=>w.column===g&&w.table===b&&w.database===p);if(x)c(x.id),l(x.id);else{const w=mp(v,b),S=`SELECT ${g}, COUNT(*) FROM ${w} GROUP BY ${g} ORDER BY ${g} ASC LIMIT 50`,C=`SELECT min(${g}) as min, max(${g}) as max FROM ${w}`;if(t==="api"&&n){a({id:qo(),column:`${w}.${g}`,title:f.column_name,dataType:f.data_type,table:"api",database:"NA",connectionId:n,sql:xa.includes(f.data_type)?C:S});return}if(!n||!r||!o)throw new Error("missing connectionId, database, or table");a({id:qo(),column:`${w}.${g}`,title:f.column_name,dataType:f.data_type,table:o,database:r,connectionId:n,sql:xa.includes(f.data_type)?C:S})}}return _.jsx(da,{className:" h-[70vh] mt-2 xbg-red-100 px-3",children:e==null?void 0:e.map(f=>{const g=s==null?void 0:s.find(p=>p.column===_i(f.column_name)&&p.table===o&&p.database===r);return _.jsx("div",{onClick:()=>d(f),className:De(" group flex text-sm items-center justify-between px-3 py-[6px] transition-colors hover:bg-muted/50 cursor-pointer border border-background border-dashed",{"bg-muted ":g}),children:_.jsxs("div",{className:"flex items-center gap-2 ",children:[_.jsx(ND,{column:f}),_.jsx("span",{children:f.column_name})]})},f.column_name)})})}function Nie(){fe(t=>t.showFilters);const e=fe(t=>t.actions.setShowFilters);return _.jsxs("section",{className:" relative space-y-4 py-0 px-4 ",children:[_.jsx(it,{onClick:()=>e(!1),className:" p-0 h-7 w-7 absolute top-0 right-4",variant:"outline",children:_.jsx(ca,{})}),_.jsx("p",{className:"text-md px-2",children:"Data Columns"}),_.jsx("div",{children:_.jsx(RD,{ColumnsComponent:(t,n,r)=>_.jsx(Iie,{schemaName:t,tableName:n,columns:r})})})]})}function Rie(){fe(n=>n.dashboard);const e=fe(n=>n.showFilters),t=fe(n=>n.isVisualEditing);return fe(n=>n.bookmarkKey),_.jsxs("div",{role:"dashboard-plus-main",className:De(" grow",{hidden:t,flex:!t}),children:[_.jsx(bk,{}),e&&_.jsx("div",{role:"filter-aside-container",children:_.jsx(Nie,{})})]})}function Lie(){const e=fe(r=>r.dashboard),t=fe(r=>r.actions.setDashboard),n=fe(r=>r.showDashboardJSON);return fe(r=>r.actions.setShowDashboardJSON),_.jsx("div",{className:De(" p-2",{hidden:!n}),children:_.jsx(SM,{onChange:r=>{if(r)try{JSON.parse(r),t(JSON.parse(r))}catch{}},defaultLanguage:"json",className:"h-[550px] overflow-y-auto ",value:JSON.stringify(e,null,2),options:{minimap:{enabled:!1},glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})})}function Fie({showControls:e=!1,showFooter:t=!0,...n}){return fe(r=>r.isVisualEditing),_.jsx(HO,{dashboardProps:n,children:_.jsxs(wy,{children:[_.jsx(Lie,{}),_.jsxs(m_,{...n,children:[e&&_.jsx(vX,{}),_.jsx(Aie,{}),_.jsx(Rie,{})]})]})})}function $ie({card:e,footer:t,className:n,...r}){const{customCards:i}=C0(),o=m.useRef(null),{isError:s,isLoading:a,isFetching:l,cfg:c,visualKey:d,handleDatapointClick:f}=E0(e),g=fe(I=>I.themeStyle),p=fe(I=>I.selectedSheetId),v=fe(I=>I.selectedCardId),b=fe(I=>I.isDashboardEditing),{setCardTitle:x,setCardDescription:w,setSelectedCardId:S}=Gc();function C(I){I.stopPropagation(),S(p,e.id)}function P(){if(i&&i.length>0){const I=i.find(F=>F.cardId===e.id);if(I&&I.replaceDefault){const F=I.content;if(F)return _.jsx(F,{card:e})}}return e.type==="kpi"?e.data&&e.data.length>0&&_.jsx(x0,{card:e}):T}function O(){if(s)return _.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(e.type==="table"&&e.data&&e.data.length>0)return _.jsxs(da,{children:[_.jsx(Jh,{data:e.data}),_.jsx(Il,{orientation:"horizontal"})]});if(i&&i.length>0){const I=i.find(F=>F.cardId===e.id);if(I&&I.content){const F=I.content;return _.jsx(F,{card:e})}}if(c)return _.jsx($b,{cfg:c,onDatapointClick:f},d)}function k(){if(i&&i.length>0){const I=i.find(F=>F.cardId===e.id);if(I&&I.footer){const F=I.footer;if(F)return _.jsx(F,{card:e})}}return t||null}if(!e.id)return null;const T=_.jsxs(_.Fragment,{children:[_.jsxs(tu,{className:" pb-4",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(ao,{text:e.title,onSave:I=>x(p,e.id,I),children:_.jsx(nu,{className:"text-base",children:e.title})}),e.refreshInterval&&_.jsxs(zu,{children:[_.jsx(Gh,{className:"pr-1",children:_.jsx("div",{className:De("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":a||l})})}),_.jsx(Tl,{side:"right",align:"center",children:_.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),!e.refreshInterval&&(a||l)&&_.jsx(Nl,{className:"w-4 h-4 animate-spin text-muted-foreground"})]}),_.jsx(ao,{text:(e==null?void 0:e.description)||"",onSave:I=>w(p,e.id,I),children:_.jsxs(Xf,{children:[" ",e.description]})})]}),_.jsx(ru,{className:" grow flex flex-col pb-0 relative overflow-auto ",children:O()}),_.jsx(Uv,{children:k()})]});return _.jsx(Kf,{tabIndex:-1,ref:o,role:"dashboard-card",onClick:C,className:De(" relative h-full flex flex-col rounded-sm",{"border-dashed border-foreground/50 ":v===e.id&&b},g==null?void 0:g.dashboardCard,n),...r,children:P()})}function jie(){const e=fe(t=>t.actions);return{getStyle:e.getStyle,getDashboard:e.getDashboard,setOnSaveFunction:e.setOnSaveFunction,setOnAddCard:e.setOnAddCard,setOnUpateCard:e.setOnUpdateCard,setOnRemoveCard:e.setOnRemoveCard}}je.BOOLEAN_DATA_TYPES=pp,je.DATE_DATA_TYPES=xa,je.Dashboard=xk,je.DashboardCard=$ie,je.DashboardPlus=Fie,je.DashboardProvider=wy,je.DashboardWC=gY,je.NUMBER_DATA_TYPES=ds,je.SelectComponent=ld,je.SemaphorQueryClient=yk,je.TEXT_DATA_TYPES=Uu,je.cleanCard=Yk,je.createSqlGenConfig=H0,je.fmt=_i,je.getBookmarkKey=gs,je.getColumnDataType=lW,je.getDashbaordStateWithoutData=Iy,je.getFilterValueType=gp,je.getQualifiedTableName=mp,je.getSql=V0,je.isColumnInSqlGen=dP,je.resolveDataType=xf,je.useActions=jie,je.useCard=PH,je.useDashboard=g_,je.useDashboardActions=Gc,je.useDashboardStore=fe,je.useEditorActions=mR,je.useEditorAside=d_,je.useEditorStore=ve,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
495
+ Visual Query Syntax: ${cre}`,{data:w,isLoading:S,isFetching:C,isError:P,refetch:O}=Xr({queryKey:["ai-query"],queryFn:()=>al("https://semaphor.cloud/api/v1/ai",(s==null?void 0:s.accessToken)||"",{user_content:`userContent: ${b} ${a?x:""}`}),enabled:!1});function k(q){if(q.toLowerCase().includes("bar"))f("bar");else if(q.toLowerCase().includes("line"))f("line");else if(q.toLowerCase().includes("bubble"))f("bubble");else if(q.toLowerCase().includes("scatter"))f("scatter");else if(q.toLowerCase().includes("stacked"))f("stackedBar");else if(q.toLowerCase().includes("pie"))f("pie");else if(q.toLowerCase().includes("donut")||q.toLowerCase().includes("doughnut"))f("doughnut");else if(q.toLowerCase().includes("radar"))f("radar");else return f("bar"),!1;return!0}function T(){n&&(k(n)&&l(!0),O())}m.useEffect(()=>{i&&(T(),o(!1))},[i,o]);const I={fontFamily:"Arial, sans-serif",lineHeight:1.6,fontSize:15,padding:"5px",width:"100%"},F={fontFamily:"monospace",fontSize:14,lineHeight:1.6},j={fontFamily:"Arial, sans-serif",lineHeight:1.6,fontSize:15,padding:"2px 0",marginLeft:20,listStyleType:"disc"},B={p:({node:q,...J})=>_.jsx("p",{style:I,...J}),pre:({node:q,...J})=>_.jsxs("pre",{className:" bg-muted/50 space-y-2 p-3 rounded-sm",style:F,children:[_.jsx("code",{className:" whitespace-normal",children:J.children}),_.jsxs("div",{className:" flex justify-start gap-2",children:[_.jsx(it,{onClick:V,size:"sm",variant:"outline",children:_.jsx(y2,{})}),_.jsx(it,{onClick:$=>{const X=V($);X&&(t(!1),c(X),d(!0))},size:"sm",variant:"outline",children:_.jsx(Sz,{})})]})]}),li:({node:q,...J})=>_.jsx("li",{style:j,...J})};function V(q){const J=q.currentTarget.closest("pre");if(!J)return;const $=J.textContent||J.innerText;return navigator.clipboard.writeText($).then(()=>console.log("Text copied to clipboard")).catch(X=>console.error("Error in copying text: ",X)),$}return _.jsxs(Ly,{open:e,onOpenChange:t,children:[_.jsx(Fy,{asChild:!0,children:_.jsx(it,{size:"sm",className:"",variant:"outline",children:_.jsx(nH,{strokeWidth:1,size:16})})}),_.jsxs(zp,{className:" sm:max-w-[425px] md:min-w-[625px] md:max-h-[625px] flex flex-col justify-between overflow-auto",children:[_.jsxs(Bp,{children:[_.jsx(Vp,{children:"Ask"}),_.jsx(Hp,{children:"Need assistance? Feel free to ask me any question!"})]}),_.jsx(da,{className:"h-[625px] w-full border-t border-t-muted ",children:(!S||!C)&&_.jsx(are,{className:" pl-1 pr-3 py-1 w-full xbg-red-100 overflow-auto ",components:B,children:w==null?void 0:w.response})}),_.jsxs("div",{children:[_.jsx(Sf,{className:De(" invisible h-1 w-full animate-pulse",{visible:S||C})}),_.jsxs("div",{className:" border rounded-md flex items-center w-full",children:[_.jsx(nx,{onKeyDown:q=>{q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),r(""),T())},placeholder:"Type something...",onFocus:q=>{const J=q.target,$=J.value.length;J.setSelectionRange($,$)},className:" border-none resize-none min-h-7 max-h-10 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",value:n,onChange:q=>r(q.target.value)})," ",_.jsx(it,{className:"h-8",size:"sm",variant:"ghost",onClick:T,children:!S&&!C?_.jsx(wz,{}):_.jsx(Nl,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"})})]})]})]})]})}function dre(){const{theme:e}=Bm(),t=m.useRef(),n=m.useRef(),[r,i]=m.useState(!1),[o,s]=m.useState(!1),[a,l]=m.useState(""),[c,d]=m.useState(!1);m.useState("");const f=fe(ae=>ae.authToken);fe(ae=>ae.selectedSheetId);const g=ve(ae=>ae.card),p=fe(ae=>ae.theme),v=ve(ae=>ae.isShowingVisual),b=ve(ae=>ae.selectedConnectionId),x=ve(ae=>ae.selectedDatabaseName),w=ve(ae=>ae.selectedSchemaName);fe(ae=>ae.actions.updateFrameCard);const S=ve(ae=>ae.selectedTableName),C=ve(ae=>ae.actions.setCardSql),P=ve(ae=>ae.card.sql),O=ve(ae=>ae.selectedConnectionId),k=ve(ae=>ae.frame),T=ve(ae=>ae.filterValues),I=ve(ae=>ae.applyFilters),F=ve(ae=>ae.actions.setCardCustomCfg),j=ve(ae=>ae.actions.setFilterValues),B=ve(ae=>ae.onSave),V=ve(ae=>ae.actions.setApplyFilters),q=ve(ae=>ae.onClose),J=ve(ae=>ae.actions.setCardData),$=ve(ae=>ae.actions.setSqlGen),X=ve(ae=>ae.runSql),W=ve(ae=>ae.actions.setRunSql),te=ve(ae=>ae.actions.setIsSqlRunning),{data:le,isLoading:A,isFetching:H,isSuccess:ne,isError:R,error:ue,status:xe,refetch:ge}=Xr({queryKey:[P],queryFn:()=>ll("https://semaphor.cloud/api/v1/query",(f==null?void 0:f.accessToken)||"",{connection_id:O,sql:P,active_filters:I?T:[]}),enabled:!1,retry:!1});m.useEffect(()=>{le&&(console.log("queryData",le),J(le.records))},[le,J]),m.useEffect(()=>{X&&(ge(),W(!1))},[X,ge,W]),m.useEffect(()=>{(A||H)&&te(!0),(R||ne)&&te(!1)},[A,H,R,ne,te]);function pe(){C(""),J([]),$({}),F("")}const ee=ae=>{n.current=ae};function Q(){let ae;if(P&&!P.includes("{{")){const We=MZ(P);C(We),ae={...g,sql:We}}else ae={...g,lastSelectedSchema:w,lastSelectedDatabase:x,lastSelectedTable:S,connectionId:b,type:v?g.type:"table",customCfg:v?g.customCfg:null};const Se=k.cards.map(We=>We.id===g.id?ae:We);B==null||B({...k,cards:Se})}function ie(){q==null||q()}function we(ae){const Se=getComputedStyle(document.documentElement).getPropertyValue(ae);return re(Se)}function re(ae){const[Se,We,dt]=ae.split(" "),qe=parseFloat(Se),gt=parseFloat(We),Gt=parseFloat(dt),Bt=gt/100,gn=Gt/100,Rt=(1-Math.abs(2*gn-1))*Bt,mr=Rt*(1-Math.abs(qe/60%2-1)),he=gn-Rt/2;let Ee=0,Ne=0,Ue=0;0<=qe&&qe<60?(Ee=Rt,Ne=mr,Ue=0):60<=qe&&qe<120?(Ee=mr,Ne=Rt,Ue=0):120<=qe&&qe<180?(Ee=0,Ne=Rt,Ue=mr):180<=qe&&qe<240?(Ee=0,Ne=mr,Ue=Rt):240<=qe&&qe<300?(Ee=mr,Ne=0,Ue=Rt):300<=qe&&qe<360&&(Ee=Rt,Ne=0,Ue=mr),Ee=Math.round((Ee+he)*255),Ne=Math.round((Ne+he)*255),Ue=Math.round((Ue+he)*255);const at=ln=>{const cn=ln.toString(16);return cn.length==1?"0"+cn:cn};return`#${at(Ee)}${at(Ne)}${at(Ue)}`}m.useEffect(()=>{const ae=t.current,Se=n.current;if(ae){const We=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",dt=p==="system"?We:p;ae.editor.defineTheme("default",{base:dt==="light"?"vs":"vs-dark",inherit:!0,rules:[],colors:{"editor.background":dt==="light"?"#ffffff":we("--background")}}),ae.editor.setTheme("default")}return Se&&ae&&Se.addCommand(ae.KeyMod.Shift|ae.KeyCode.Enter,function(){return console.log("Executing query..."),ge(),!1}),()=>{}},[e,p,t.current]);function Ie(ae){t.current=ae}return _.jsxs("section",{role:"editor-section",className:"grow flex flex-col justify-end pt-3 p-1 ",children:[_.jsxs("div",{className:" grow flex relative overflow-y-scroll justify-between ",children:[_.jsx("div",{role:"editor-container",className:`flex ${r?"w-2/3":"w-[95%]"} xbg-red-100 p-1`,children:_.jsx(Xy,{theme:"default",onChange:ae=>{C(ae),console.log(ae)},value:P,options:{minimap:{enabled:!1},wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:14,renderLineHighlight:"none"},defaultLanguage:"sql",defaultValue:"SELECT * FROM table",beforeMount:Ie,onMount:ee})}),r&&_.jsx("div",{className:" w-1/3 text-xs relative overflow-hidden xbg-yellow-100 p-1 ",children:_.jsxs("div",{className:"min-h-0 ",children:[_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx(HZ,{checked:I,onCheckedChange:()=>V(!I),text:"Apply Filters"}),_.jsx(WZ,{})]}),_.jsx(Xy,{theme:"default",onChange:ae=>{if(ae)try{JSON.parse(ae),j(JSON.parse(ae))}catch{}},defaultLanguage:"json",className:"min-h-[220px] mt-1",value:JSON.stringify(T,null,2),options:{readOnly:!0,minimap:{enabled:!1},lineNumbers:"off",glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})]})}),T&&r&&_.jsx(ca,{onClick:()=>i(!1),className:"absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer"}),T&&!r&&_.jsx(AO,{onClick:()=>i(!0),className:De("absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer",{"text-red-800 font-bold":I})})]}),_.jsxs("div",{className:" flex grow px-6 pt-3 pb-4 gap-2 justify-between item-center",children:[_.jsxs("div",{className:"flex grow gap-2 items-center",children:[_.jsxs(it,{disabled:A||H,onClick:()=>{ge()},className:" shrink-0",size:"sm",variant:"outline",children:[(A||H)&&_.jsx(Nl,{className:"w-4 h-4 mr-2 animate-spin text-foreground/50"}),"Run"]}),R&&_.jsx(VZ,{error:ue.message}),_.jsx(it,{onClick:pe,className:"",size:"sm",variant:"outline",children:"Clear"}),_.jsx(Oo,{value:a,placeholder:"Type something...",onChange:ae=>{l(ae.target.value)},onKeyDown:ae=>{ae.key==="Enter"&&(ae.preventDefault(),console.log("enter pressed"),d(!0),s(!0))},className:" bg-muted border-none h-9 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"}),_.jsx(ure,{open:o,setOpen:s,userInput:a,triggerAIRun:c,setTriggerAIRun:d,setUserInput:ae=>l(ae)})]}),_.jsxs("div",{className:"flex gap-2 items-end ",children:[_.jsx(it,{onClick:Q,size:"sm",variant:"outline",children:_.jsx(rp,{size:16,strokeWidth:2,className:"text-green-600 font-bold"})}),_.jsx(it,{onClick:ie,className:" w-full",size:"sm",variant:"outline",children:_.jsx(ca,{})})]})]})]})}const i5="Switch",[fre,Gfe]=kn(i5),[hre,pre]=fre(i5),gre=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,g]=m.useState(null),p=nt(t,S=>g(S)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[x=!1,w]=Qn({prop:i,defaultProp:o,onChange:c});return m.createElement(hre,{scope:n,checked:x,disabled:a},m.createElement(He.button,se({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":o5(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:p,onClick:Pe(e.onClick,S=>{w(C=>!C),b&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),b&&m.createElement(bre,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),mre="SwitchThumb",vre=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=pre(mre,n);return m.createElement(He.span,se({"data-state":o5(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),bre=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Wp(n),a=Hh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",se({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function o5(e){return e?"checked":"unchecked"}const s5=gre,yre=vre,a5=de.forwardRef(({className:e,...t},n)=>_.jsx(s5,{className:De("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:_.jsx(yre,{className:De("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")})}));a5.displayName=s5.displayName;function l5({className:e,...t}){const[n,r]=m.useState(0),i=fe(l=>l.themeStyle),o=ve(l=>l.card),s=ve(l=>l.actions.setCard);if(m.useEffect(()=>{r(n+1)},[o.data,o.type,o.cfg,o.customCfg,i]),!o.id)return null;let a;return o.data&&o.data.length>0&&(a=S0({data:o.data,cardType:o.type,cfg:o.cfg,customCfg:o.customCfg})),_.jsxs(Kf,{role:"editor-visual-card",className:De(" relative h-full flex flex-col rounded-none",e),...t,children:[_.jsxs(tu,{children:[_.jsx(ao,{text:o.title,onSave:l=>s({...o,title:l}),children:_.jsx(nu,{className:"text-base",children:o.title})}),_.jsx(ao,{text:o.description||"",onSave:l=>s({...o,description:l}),children:_.jsxs(Xf,{children:[" ",o.description]})})]}),_.jsxs(ru,{className:"flex flex-col pb-3 grow",children:[o.type!=="table"&&a&&_.jsx($b,{cfg:a},n),o.type==="table"&&o.data&&o.data.length>0&&_.jsx(bO,{children:_.jsx(Jh,{data:o==null?void 0:o.data})})]})]})}function xre(){const[e,t]=m.useState(!1),[n,r]=m.useState(""),[i,o]=m.useState(""),[s,a]=m.useState(""),l=ve(x=>x.card),c=ve(x=>x.card.customCfg),d=ve(x=>x.actions.setCardCustomCfg);function f(x){var C,P;const w={...x,data:{...x==null?void 0:x.data,datasets:(P=(C=x==null?void 0:x.data)==null?void 0:C.datasets)==null?void 0:P.map(O=>({...O,data:[]}))}};return JSON.stringify(w,null,1)}function g(){if(!l.data||l.data.length===0)return;const x=S0({data:l.data,cardType:l.type,cfg:l.cfg});x&&(r(JSON.stringify(x,null,1)),c&&o(JSON.stringify(c,null,1)))}function p(){if(i)try{const x=JSON.parse(i);return x?(d(x),a(""),o(""),x):void 0}catch(x){console.log(x),a("Invalid JSON")}}function v(){o(""),d(null)}function b(){let x;if(c){const w=Vs.cloneDeep(l.cfg),S=Vs.merge(w,c);return x=f(S),x}return n?(x=f(JSON.parse(n)),x):""}return _.jsxs(Ly,{open:e,onOpenChange:t,children:[_.jsx(Fy,{asChild:!0,children:_.jsx(it,{onClick:g,className:`h-7 ${c&&"border-foreground/50 dark:border-foreground/70"}`,size:"sm",variant:"outline",children:c?"Custom Config":"Customize"})}),_.jsxs(zp,{className:" min-h-[70vh] max-h-[70vh] overflow-auto min-w-[900px] ",children:[_.jsxs(Bp,{className:"",children:[_.jsx(Vp,{children:"Customize Chart"}),_.jsxs(Hp,{children:["See the configuration options and documentation",_.jsx("a",{target:"_blank",className:"ml-1 underline text-blue-500 ",href:"https://www.chartjs.org/docs/latest/samples/bar/vertical.html",children:"here."})]})]}),_.jsxs("div",{className:"flex grow gap-2 ",children:[_.jsx(l5,{className:" w-1/2 rounded shadow-none"}),_.jsxs(k_,{defaultValue:"custom-config",className:" w-1/2 flex flex-col ",children:[_.jsxs(D_,{className:" justify-start border rounded-sm rounded-b-none border-b-0 ",children:[_.jsxs(Km,{value:"custom-config",children:[c&&_.jsx(b2,{className:"w-5 h-5 mr-1 text-green-600"}),c?"Custom Config":"Default Config"]}),_.jsx(Km,{className:"",value:"output",children:"Output"})]}),_.jsx(Pf,{className:" grow mt-0 bg-red-x p-2 border border-t-0 rounded-b ",value:"output",children:_.jsx(nx,{disabled:!0,value:n,className:" border-none resize-none font-mono h-full focus-visible:ring-0 focus-visible:ring-offset-0"})}),_.jsx(Pf,{className:"grow mt-0 border border-t-0 rounded-b ",value:"custom-config",children:_.jsx(Xy,{className:"h-full w-full overflow-hidden",theme:"default",options:{minimap:{enabled:!1},wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:14,renderLineHighlight:"none"},defaultLanguage:"json",value:b(),onChange:x=>o(x)})})]})]}),_.jsxs($y,{className:"flex items-center",children:[_.jsx(ni,{className:"text-red-500 mr-2",children:s}),_.jsx(it,{disabled:!c,onClick:v,variant:"outline",children:"Reset"}),_.jsx(it,{onClick:p,variant:"outline",children:"Apply"}),_.jsx(it,{onClick:()=>t(!1),variant:"outline",children:"Close"})]})]})]})}var c5={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},u5=m.createContext&&m.createContext(c5),wre=["attr","size","title"];function _re(e,t){if(e==null)return{};var n=Sre(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sre(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function vg(){return vg=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},vg.apply(this,arguments)}function d5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d5(Object(n),!0).forEach(function(r){Cre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cre(e,t,n){return t=Ere(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ere(e){var t=Ore(e,"string");return typeof t=="symbol"?t:String(t)}function Ore(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 f5(e){return e&&e.map((t,n)=>m.createElement(t.tag,bg({key:n},t.attr),f5(t.child)))}function oc(e){return t=>m.createElement(Pre,vg({attr:bg({},e.attr)},t),f5(e.child))}function Pre(e){var t=n=>{var{attr:r,size:i,title:o}=e,s=_re(e,wre),a=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),m.createElement("svg",vg({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:bg(bg({color:e.color||n.color},n.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&m.createElement("title",null,o),e.children)};return u5!==void 0?m.createElement(u5.Consumer,null,n=>t(n)):t(c5)}function h5(e){return oc({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z"},child:[]}]})(e)}function p5(e){return oc({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z"},child:[]}]})(e)}function g5(e){return oc({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M137,28.05a11.94,11.94,0,0,0-9.12,3.08A12.09,12.09,0,0,0,124,40V80.67a11.88,11.88,0,0,0,9.9,11.81,36,36,0,1,1-41.85,37.4c-.47-9.14,1.47-16.8,5.75-22.79h0a11.89,11.89,0,0,0-1.3-15.35L68.87,63.51a12,12,0,0,0-17.74.83A99.6,99.6,0,0,0,57.79,199.2,99.24,99.24,0,0,0,128,228h1.43A100.29,100.29,0,0,0,228,129.42C228.72,77.21,188.76,32.68,137,28.05ZM57.28,69.46A4,4,0,0,1,60.2,68h.19a3.91,3.91,0,0,1,2.79,1.14L90.81,97.36a3.93,3.93,0,0,1,.48,5.08A40.47,40.47,0,0,0,84.08,124h-48A90.36,90.36,0,0,1,57.28,69.46ZM36.09,132H84.18A44,44,0,0,0,124,171.81V219.9A92,92,0,0,1,36.09,132ZM193,193a91.43,91.43,0,0,1-61,26.92V171.82a43.51,43.51,0,0,0,26-11.63,44,44,0,0,0-22.79-75.6A4,4,0,0,1,132,80.67V40a4,4,0,0,1,1.31-3,3.89,3.89,0,0,1,3-1c47.59,4.26,84.34,45.24,83.67,93.29A91.42,91.42,0,0,1,193,193Z"},child:[]}]})(e)}function m5(e){return oc({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"},child:[]},{tag:"path",attr:{d:"M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0"},child:[]}]})(e)}function v5(e){return oc({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z"},child:[]}]})(e)}function b5(e){return oc({tag:"svg",attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z"},child:[]}]})(e)}function kre(){const[e,t]=m.useState(!1),n=ve(s=>s.card.type),r=ve(s=>s.actions.setCardType),i=ve(s=>s.actions.setCardCustomCfg);function o(s){r(s),i(null),t(!1)}return _.jsxs(Ap,{open:e,onOpenChange:t,children:[_.jsx(Ip,{asChild:!0,children:_.jsx(it,{className:"h-7 px-2",variant:"outline",children:_.jsx(Dre,{className:"h-4 w-4",chartType:n})})}),_.jsx(nd,{className:"w-50",children:_.jsxs("div",{className:"grid grid-cols-3 place-items-center ",children:[_.jsx(it,{onClick:()=>o("bar"),className:"font-normal",variant:"ghost",children:_.jsx(DO,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("line"),variant:"ghost",children:_.jsx(IO,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("stackedBar"),variant:"ghost",children:_.jsx(v5,{className:"h-6 w-6 text-foreground/50 ",strokeWidth:0})}),_.jsx(it,{onClick:()=>o("scatter"),variant:"ghost",children:_.jsx(LO,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("bubble"),variant:"ghost",children:_.jsx(m5,{strokeWidth:2})}),_.jsx(it,{onClick:()=>o("pie"),variant:"ghost",children:_.jsx(NO,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("doughnut"),variant:"ghost",children:_.jsx(g5,{className:"h-7 w-7",strokeWidth:.5})}),_.jsx(it,{onClick:()=>o("radar"),variant:"ghost",children:_.jsx(h5,{className:"h-6 w-6 text-foreground/50 font-extralight",strokeWidth:.5})}),_.jsx(it,{onClick:()=>o("polarArea"),variant:"ghost",children:_.jsx(p5,{className:"h-6 w-6 text-foreground/50",strokeWidth:1})}),_.jsx(it,{onClick:()=>o("table"),variant:"ghost",children:_.jsx(y0,{className:"h-6 w-6 text-foreground/90",strokeWidth:1})}),_.jsx(it,{onClick:()=>o("kpi"),variant:"ghost",children:_.jsx(b5,{className:"h-6 w-6 text-foreground/70",strokeWidth:0})})]})})]})}function Dre({chartType:e,className:t}){switch(e){case"bar":return _.jsx(DO,{className:t});case"line":return _.jsx(IO,{className:t});case"pie":return _.jsx(NO,{className:t});case"radar":return _.jsx(h5,{className:t});case"scatter":return _.jsx(LO,{className:t});case"bubble":return _.jsx(m5,{className:t});case"doughnut":return _.jsx(g5,{className:t});case"stackedBar":return _.jsx(v5,{className:"h-5 w-5 text-foreground/50 ",strokeWidth:0});case"polarArea":return _.jsx(p5,{className:t});case"kpi":return _.jsx(b5,{className:t});default:return _.jsx(y0,{className:t})}}function Mre(){const e=ve(n=>n.card.refreshInterval),t=ve(n=>n.actions.setCardRefreshInterval);return _.jsxs(Ap,{children:[_.jsx(Ip,{asChild:!0,children:_.jsx(it,{className:"h-7",variant:"outline",children:"Realtime"})}),_.jsx(nd,{className:"w-[200px]",children:_.jsx("div",{className:"grid gap-4",children:_.jsx("div",{className:"grid gap-2",children:_.jsxs("div",{className:"grid grid-cols-5 items-center gap-1",children:[_.jsx(ni,{className:"col-span-3",htmlFor:"width",children:"Refresh Every"}),_.jsx(Oo,{value:e||"",onChange:n=>t(n.target.value),id:"width",placeholder:"30s",className:"col-span-2 h-7 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0"})]})})})})]})}function y5(){var r;ve(i=>i.frame);const e=ve(i=>i.card),t=ve(i=>i.isShowingVisual),n=ve(i=>i.isSqlRunning);return ve(i=>i.onSave),ve(i=>i.onClose),ve(i=>i.actions.setCardSql),ve(i=>i.actions.setCardType),ve(i=>i.actions.setSqlGen),e?(console.log("EditorVisualSection",e.type,(r=e.data)==null?void 0:r.length,e.data),_.jsxs("div",{className:" h-full relative flex flex-col",children:[n&&_.jsx(Nl,{className:" w-10 h-10 z-10 absolute m-auto left-0 right-0 top-0 bottom-0 animate-spin text-foreground/10 "}),_.jsxs("div",{className:" h-10 px-6 pt-6 bg-red-x100 mb-0 z-10 right-0 flex justify-end items-center gap-2",children:[t&&_.jsxs("div",{className:"bg-red-x00 flex grow gap-2",children:[_.jsx(kre,{}),_.jsx(xre,{}),_.jsx(Mre,{})]}),_.jsx(Tre,{})]}),t?e.type==="kpi"?_.jsx("div",{className:"grow flex items-center justify-center ",children:_.jsx("div",{className:" border rounded-md",children:_.jsx(x0,{card:e})})}):_.jsx(l5,{className:"grow border-none shadow-none "}):_.jsx("div",{className:"w-full mt-4 px-6 bg-red-x00 grow border-none shadow-none overflow-y-auto ",children:e.data&&e.data.length>0&&_.jsx(Jh,{data:e.data})})]})):_.jsx(_.Fragment,{children:"No Active Card"})}function Tre(){const e=ve(n=>n.isShowingVisual),t=ve(n=>n.actions.setIsShowingVisual);return _.jsxs("div",{className:" flex items-center space-x-2",children:[_.jsx(ni,{htmlFor:"visualize",children:"Chart"}),_.jsx(a5,{checked:e,onCheckedChange:()=>t(!e),id:"visualize",className:"data-[state=checked]:bg-foreground/50"})]})}const x5="Collapsible",[Are,w5]=kn(x5),[Ire,Fx]=Are(x5),Nre=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l=!1,c]=Qn({prop:r,defaultProp:i,onChange:s});return m.createElement(Ire,{scope:n,disabled:o,contentId:or(),open:l,onOpenToggle:m.useCallback(()=>c(d=>!d),[c])},m.createElement(He.div,se({"data-state":$x(l),"data-disabled":o?"":void 0},a,{ref:t})))}),Rre="CollapsibleTrigger",Lre=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Fx(Rre,n);return m.createElement(He.button,se({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":$x(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Pe(e.onClick,i.onOpenToggle)}))}),_5="CollapsibleContent",Fre=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Fx(_5,e.__scopeCollapsible);return m.createElement(yn,{present:n||i.open},({present:o})=>m.createElement($re,se({},r,{ref:t,present:o})))}),$re=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=Fx(_5,n),[a,l]=m.useState(r),c=m.useRef(null),d=nt(t,c),f=m.useRef(0),g=f.current,p=m.useRef(0),v=p.current,b=s.open||a,x=m.useRef(b),w=m.useRef();return m.useEffect(()=>{const S=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(S)},[]),Vn(()=>{const S=c.current;if(S){w.current=w.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const C=S.getBoundingClientRect();f.current=C.height,p.current=C.width,x.current||(S.style.transitionDuration=w.current.transitionDuration,S.style.animationName=w.current.animationName),l(r)}},[s.open,r]),m.createElement(He.div,se({"data-state":$x(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b},o,{ref:d,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),b&&i)});function $x(e){return e?"open":"closed"}const jre=Nre,zre=Lre,Bre=Fre,ys="Accordion",Vre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[jx,Hre,Wre]=Ef(ys),[yg,Yfe]=kn(ys,[Wre,w5]),zx=w5(),S5=m.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,o=r;return m.createElement(jx.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(Yre,se({},o,{ref:t})):m.createElement(Gre,se({},i,{ref:t})))});S5.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[C5,Ure]=yg(ys),[E5,qre]=yg(ys,{collapsible:!1}),Gre=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...s}=e,[a,l]=Qn({prop:n,defaultProp:r,onChange:i});return m.createElement(C5,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>o&&l(""),[o,l])},m.createElement(E5,{scope:e.__scopeAccordion,collapsible:o},m.createElement(O5,se({},s,{ref:t}))))}),Yre=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s=[],a]=Qn({prop:n,defaultProp:r,onChange:i}),l=m.useCallback(d=>a((f=[])=>[...f,d]),[a]),c=m.useCallback(d=>a((f=[])=>f.filter(g=>g!==d)),[a]);return m.createElement(C5,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(E5,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(O5,se({},o,{ref:t}))))}),[Kre,xg]=yg(ys),O5=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...s}=e,a=m.useRef(null),l=nt(a,t),c=Hre(n),f=Hs(i)==="ltr",g=Pe(e.onKeyDown,p=>{var v;if(!Vre.includes(p.key))return;const b=p.target,x=c().filter(F=>{var j;return!((j=F.ref.current)!==null&&j!==void 0&&j.disabled)}),w=x.findIndex(F=>F.ref.current===b),S=x.length;if(w===-1)return;p.preventDefault();let C=w;const P=0,O=S-1,k=()=>{C=w+1,C>O&&(C=P)},T=()=>{C=w-1,C<P&&(C=O)};switch(p.key){case"Home":C=P;break;case"End":C=O;break;case"ArrowRight":o==="horizontal"&&(f?k():T());break;case"ArrowDown":o==="vertical"&&k();break;case"ArrowLeft":o==="horizontal"&&(f?T():k());break;case"ArrowUp":o==="vertical"&&T();break}const I=C%S;(v=x[I].ref.current)===null||v===void 0||v.focus()});return m.createElement(Kre,{scope:n,disabled:r,direction:i,orientation:o},m.createElement(jx.Slot,{scope:n},m.createElement(He.div,se({},s,{"data-orientation":o,ref:l,onKeyDown:r?void 0:g}))))}),Bx="AccordionItem",[Xre,Vx]=yg(Bx),Qre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,o=xg(Bx,n),s=Ure(Bx,n),a=zx(n),l=or(),c=r&&s.value.includes(r)||!1,d=o.disabled||e.disabled;return m.createElement(Xre,{scope:n,open:c,disabled:d,triggerId:l},m.createElement(jre,se({"data-orientation":o.orientation,"data-state":k5(c)},a,i,{ref:t,disabled:d,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),Zre="AccordionHeader",Jre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=xg(ys,n),o=Vx(Zre,n);return m.createElement(He.h3,se({"data-orientation":i.orientation,"data-state":k5(o.open),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),P5="AccordionTrigger",eie=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=xg(ys,n),o=Vx(P5,n),s=qre(P5,n),a=zx(n);return m.createElement(jx.ItemSlot,{scope:n},m.createElement(zre,se({"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId},a,r,{ref:t})))}),tie="AccordionContent",nie=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=xg(ys,n),o=Vx(tie,n),s=zx(n);return m.createElement(Bre,se({role:"region","aria-labelledby":o.triggerId,"data-orientation":i.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 k5(e){return e?"open":"closed"}const rie=S5,iie=Qre,oie=Jre,D5=eie,M5=nie,Hx=rie,ko=de.forwardRef(({className:e,...t},n)=>_.jsx(iie,{ref:n,className:De("border-b",e),...t}));ko.displayName="AccordionItem";const Do=de.forwardRef(({className:e,children:t,...n},r)=>_.jsx(oie,{className:"flex",children:_.jsxs(D5,{ref:r,className:De("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,_.jsx(b0,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Do.displayName=D5.displayName;const Mo=de.forwardRef(({className:e,children:t,...n},r)=>_.jsx(M5,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:_.jsx("div",{className:De("pb-4 pt-0",e),children:t})}));Mo.displayName=M5.displayName;const T5="Radio",[sie,A5]=kn(T5),[aie,lie]=sie(T5),cie=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:s,value:a="on",onCheck:l,...c}=e,[d,f]=m.useState(null),g=nt(t,b=>f(b)),p=m.useRef(!1),v=d?!!d.closest("form"):!0;return m.createElement(aie,{scope:n,checked:i,disabled:s},m.createElement(He.button,se({type:"button",role:"radio","aria-checked":i,"data-state":I5(i),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:g,onClick:Pe(e.onClick,b=>{i||l==null||l(),v&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})),v&&m.createElement(fie,{control:d,bubbles:!p.current,name:r,value:a,checked:i,required:o,disabled:s,style:{transform:"translateX(-100%)"}}))}),uie="RadioIndicator",die=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=lie(uie,n);return m.createElement(yn,{present:r||o.checked},m.createElement(He.span,se({"data-state":I5(o.checked),"data-disabled":o.disabled?"":void 0},i,{ref:t})))}),fie=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Wp(n),a=Hh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",se({type:"radio","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function I5(e){return e?"checked":"unchecked"}const hie=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],N5="RadioGroup",[pie,Kfe]=kn(N5,[fl,A5]),R5=fl(),L5=A5(),[gie,mie]=pie(N5),vie=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:d=!0,onValueChange:f,...g}=e,p=R5(n),v=Hs(c),[b,x]=Qn({prop:o,defaultProp:i,onChange:f});return m.createElement(gie,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:x},m.createElement(qm,se({asChild:!0},p,{orientation:l,dir:v,loop:d}),m.createElement(He.div,se({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},g,{ref:t}))))}),bie="RadioGroupItem",yie=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=mie(bie,n),s=o.disabled||r,a=R5(n),l=L5(n),c=m.useRef(null),d=nt(t,c),f=o.value===i.value,g=m.useRef(!1);return m.useEffect(()=>{const p=b=>{hie.includes(b.key)&&(g.current=!0)},v=()=>g.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),m.createElement(Gm,se({asChild:!0},a,{focusable:!s,active:f}),m.createElement(cie,se({disabled:s,required:o.required,checked:f},l,i,{name:o.name,ref:d,onCheck:()=>o.onValueChange(i.value),onKeyDown:Pe(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Pe(i.onFocus,()=>{var p;g.current&&((p=c.current)===null||p===void 0||p.click())})})))}),xie=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=L5(n);return m.createElement(die,se({},i,r,{ref:t}))}),F5=vie,$5=yie,wie=xie,j5=de.forwardRef(({className:e,...t},n)=>_.jsx(F5,{className:De("grid gap-2",e),...t,ref:n}));j5.displayName=F5.displayName;const Wx=de.forwardRef(({className:e,...t},n)=>_.jsx($5,{ref:n,className:De("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:_.jsx(wie,{className:"flex items-center justify-center",children:_.jsx(TO,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Wx.displayName=$5.displayName;function z5(){var i;const e=ve(o=>o.card.cfg),t=ve(o=>o.actions.setCardCfg),n=(i=e==null?void 0:e.options)==null?void 0:i.indexAxis;function r(o){const s={...e,options:{...e==null?void 0:e.options,indexAxis:o}};t(s)}return _.jsxs("div",{children:[_.jsx("p",{className:"font-semibold",children:"Orientation"}),_.jsxs(j5,{value:n,onValueChange:r,className:"flex gap-3 mt-2 ",defaultValue:"x",children:[_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(Wx,{value:"x",id:"r1"}),_.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Vertical"})]}),_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(Wx,{value:"y",id:"r2"}),_.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Horizontal"})]})]})]})}function B5(){var r,i,o;const e=ve(s=>s.card.cfg),t=ve(s=>s.actions.setCardCfg);function n(s){var c;const a={datalabels:{display:s!=="none",align:s,anchor:s,clamp:!0}},l={...e,options:{...e==null?void 0:e.options,plugins:{...(c=e==null?void 0:e.options)==null?void 0:c.plugins,...a}}};t(l),console.log(s)}return _.jsxs(_.Fragment,{children:[_.jsx("label",{className:"font-medium",children:"Data Labels"}),_.jsxs(DD,{value:(o=(i=(r=e==null?void 0:e.options)==null?void 0:r.plugins)==null?void 0:i.datalabels)==null?void 0:o.anchor,onValueChange:n,defaultValue:"none",children:[_.jsx(Vy,{className:"w-[180px] mt-2 focus:ring-1 focus:ring-offset-0 h-7",children:_.jsx(TD,{placeholder:"Select position"})}),_.jsx(Hy,{children:_.jsxs(MD,{children:[_.jsx(Kp,{children:"Data Labels"}),_.jsx(Da,{value:"none",children:"None"}),_.jsx(Da,{value:"start",children:"Start"}),_.jsx(Da,{value:"center",children:"Center"}),_.jsx(Da,{value:"end",children:"End"})]})})]})]})}function V5(){const e=ve(i=>i.card.preferences),t=ve(i=>i.actions.setCardPreferences),n=ve(i=>{var o;return(o=i.card.preferences)==null?void 0:o.filterOnClickField}),r=ve(i=>i.actions.setFilterOnClickField);return _.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[_.jsx(ad,{checked:!!(e!=null&&e.filterOnClick),onCheckedChange:i=>{t({...e,filterOnClick:!!i})}}),_.jsx(ni,{children:"Filter on click"})]}),(e==null?void 0:e.filterOnClick)===!0&&_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx(Oo,{value:n||"",className:" h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"expression (optional)",onChange:i=>r(i.target.value)}),_.jsxs(zu,{children:[_.jsx(Gh,{children:_.jsx(jb,{className:"h-4 w-4 opacity-70"})}),_.jsx(Tl,{children:_.jsxs("div",{className:"max-w-[200px]",children:["The x-axis expression of your query. Example:",_.jsx("div",{className:" mt-1 text-xs font-mono",children:"TO_CHAR(order_date, 'YYYY-MM')"})]})})]})]})]})}const _ie={datasets:[{type:"line",label:"Sum_sales",data:[]},{type:"bar",label:"Sum_profit",data:[]}]},Sie={datasets:[{fill:"origin",type:"line",label:"Sum_sales",data:[]}]};function Cie(){const e=ve(t=>t.card.type);return _.jsxs("div",{className:"p-6 space-y-6",children:[_.jsx(Hx,{className:" ",type:"single",collapsible:!0,children:Eie(e)}),_.jsx("section",{className:"",children:["line","bar"].includes(e)&&_.jsx(z5,{})}),_.jsx("div",{children:!["kpi"].includes(e)&&_.jsx(B5,{})}),_.jsx("div",{children:!["kpi"].includes(e)&&_.jsx(V5,{})})]})}function Eie(e){if(["line","bar"].includes(e))return _.jsxs(_.Fragment,{children:[_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:_.jsx("p",{children:"Chart Query"})}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"X-axis - Category (ex. city)"}),_.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]}),_.jsxs(ko,{value:"item-2",children:[_.jsx(Do,{className:" font-normal",children:"Mixed Chart"}),_.jsxs(Mo,{className:" text-xs space-y-2",children:[_.jsxs("p",{children:["Click ",_.jsx("b",{children:"Customize"})," and change the `type` property in the dataset."]}),_.jsx("pre",{children:JSON.stringify(_ie,null,2)})]})]}),_.jsxs(ko,{value:"item-3",children:[_.jsx(Do,{className:" font-normal",children:"Area Chart"}),_.jsxs(Mo,{className:" text-xs space-y-2",children:[_.jsxs("p",{children:["Click ",_.jsx("b",{children:"Customize"})," and add `fill` property to the dataset. See",_.jsx("a",{className:"text-blue-500 hover:underline mx-1",href:"https://www.chartjs.org/docs/latest/samples/area/line-boundaries.html",target:"_blank",children:"docs"}),"for more options."]}),_.jsx("pre",{children:JSON.stringify(Sie,null,2)})]})]})]});if(e==="bubble")return _.jsx(_.Fragment,{children:_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:_.jsxs("p",{children:["How to create a ",_.jsx("span",{children:e})," chart query?"]})}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, x-axis, y-axis, radius FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Bubble Group (opt) - Category (ex. state)"}),_.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),_.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"}),_.jsx("li",{children:"Radius - Number (ex. population)"})]})]})]})});if(e==="scatter")return _.jsx(_.Fragment,{children:_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:_.jsxs("p",{children:["How to create a ",_.jsx("span",{children:e})," chart query?"]})}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, x-axis, y-axis FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Group (opt) - Category (ex. state)"}),_.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),_.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"})]})]})]})});if(["pie","doughnut","polarArea"].includes(e))return _.jsx(_.Fragment,{children:_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:_.jsxs("p",{children:[_.jsx("span",{children:e==="polarArea"?"Polar":e.charAt(0).toUpperCase()+e.slice(1)})," ","chart query"]})}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, measure FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Measure - Number (ex. population)"})]})]})]})})}function Oie(){var s,a,l;const e=ve(c=>c.card.preferences),t=ve(c=>c.actions.setCardPreferences),n=ve(c=>c.actions.setNumberFormat),r=ve(c=>{var d,f;return(f=(d=c.card.preferences)==null?void 0:d.formatNumber)==null?void 0:f.format}),i=ve(c=>{var d,f;return(f=(d=c.card.preferences)==null?void 0:d.formatNumber)==null?void 0:f.locale}),o=ve(c=>{var d,f;return(f=(d=c.card.preferences)==null?void 0:d.formatNumber)==null?void 0:f.currency});return ve(c=>c.actions.setFilterOnClickField),_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[_.jsx(ad,{checked:!!((s=e==null?void 0:e.formatNumber)!=null&&s.enabled),onCheckedChange:c=>{t({...e,formatNumber:{...e==null?void 0:e.formatNumber,enabled:c}})}}),_.jsx(ni,{children:"Format Number"})]}),((a=e==null?void 0:e.formatNumber)==null?void 0:a.enabled)===!0&&_.jsxs("div",{className:"flex flex-col gap-2 ",children:[_.jsxs("div",{children:[_.jsx(ni,{className:"text-xs",children:"Currency"}),_.jsxs("div",{className:"flex gap-1",children:[_.jsx(Oo,{value:o||"",className:" h-7 w-20 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"USD",onChange:c=>{var d,f,g;return n(((d=e==null?void 0:e.formatNumber)==null?void 0:d.format)||"",c.target.value,((f=e==null?void 0:e.formatNumber)==null?void 0:f.locale)||"",((g=e==null?void 0:e.formatNumber)==null?void 0:g.suffix)||"")}}),_.jsx(Oo,{value:i||"",className:" h-7 w-20 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"en-US",onChange:c=>{var d,f,g;return n(((d=e==null?void 0:e.formatNumber)==null?void 0:d.format)||"",((f=e==null?void 0:e.formatNumber)==null?void 0:f.currency)||"",c.target.value,((g=e==null?void 0:e.formatNumber)==null?void 0:g.suffix)||"")}})]})]}),_.jsxs("div",{children:[_.jsxs("div",{className:" flex gap-1",children:[_.jsx(ni,{className:"text-xs",children:"Format"}),_.jsxs(zu,{children:[_.jsx(Gh,{children:_.jsx(jb,{strokeWidth:1,className:"h-3 w-3 opacity-70"})}),_.jsx(Tl,{children:_.jsxs("div",{className:"max-w-[200px]",children:["Format number",_.jsx("div",{className:" mt-1 text-xs font-mono",children:"#.## for 123.43"})]})})]})]}),_.jsx("div",{children:_.jsx(Oo,{value:r||"",className:" h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"###,###.##",onChange:c=>{var d,f,g;return n(c.target.value,((d=e==null?void 0:e.formatNumber)==null?void 0:d.currency)||"",((f=e==null?void 0:e.formatNumber)==null?void 0:f.locale)||"",((g=e==null?void 0:e.formatNumber)==null?void 0:g.suffix)||"")}})})]}),_.jsxs("div",{children:[_.jsx(ni,{className:"text-xs",children:"Suffix"}),_.jsx(Oo,{value:((l=e==null?void 0:e.formatNumber)==null?void 0:l.suffix)||"",className:" h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"K, M, B",onChange:c=>{var d,f,g;return n(((d=e==null?void 0:e.formatNumber)==null?void 0:d.format)||"",((f=e==null?void 0:e.formatNumber)==null?void 0:f.currency)||"",((g=e==null?void 0:e.formatNumber)==null?void 0:g.locale)||"",c.target.value)}})]})]})]})}function Pie(){return _.jsxs("div",{className:"px-6 py-2 space-y-6",children:[_.jsx(Hx,{className:" ",type:"single",collapsible:!0,children:_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:"KPI query"}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT current, previous FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Current - Number (ex. Revenue)"}),_.jsx("li",{children:"Previous - Number (ex. Revenue)"})]})]})]})}),_.jsx("section",{className:"",children:_.jsx(Oie,{})}),_.jsx("div",{}),_.jsx("div",{})]})}function kie(){return _.jsxs("div",{className:"px-6 py-2 space-y-6",children:[_.jsx(Hx,{className:" ",type:"single",collapsible:!0,children:_.jsxs(ko,{value:"item-1",children:[_.jsx(Do,{className:" font-normal",children:"Stacked chart query?"}),_.jsxs(Mo,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT x-axis, stack-by, y-axis FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"X-axis - Category (ex. country)"}),_.jsx("li",{children:"Stack by - Category (ex. city)"}),_.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]})}),_.jsx("section",{className:"",children:_.jsx(z5,{})}),_.jsx("div",{children:_.jsx(B5,{})}),_.jsx("div",{children:_.jsx(V5,{})})]})}function Die(){const e=ve(n=>n.card.type);function t(n){switch(n){case"stackedBar":return _.jsx(kie,{});case"kpi":return _.jsx(Pie,{});default:return _.jsx(Cie,{})}}return _.jsx(da,{className:" text-sm h-full w-full ",children:t(e)})}function Mie(){const e=ve(t=>t.isShowingVisual);return _.jsxs(aM,{direction:"vertical",className:"min-w-full max-w-lg min-h-[250px]",children:[_.jsx(eg,{className:"flex",minSize:20,defaultSize:40,children:_.jsx(dre,{})}),_.jsx(lM,{className:"border-[1.5px] "}),_.jsx(eg,{minSize:20,defaultSize:60,children:e?_.jsxs(aM,{direction:"horizontal",children:[_.jsx(_.Fragment,{children:_.jsx(eg,{className:"flex min-w-[275px]",minSize:20,defaultSize:25,maxSize:30,children:_.jsx(Die,{})})}),_.jsx(lM,{className:"border-[1.5px] "}),_.jsx(eg,{minSize:40,defaultSize:75,maxSize:100,children:_.jsx(y5,{})})]}):_.jsx(y5,{})})]})}function Tie({authToken:e,onSave:t,onClose:n}){ve(s=>s.actions.setCard);const r=ve(s=>s.actions.setOnSave),i=ve(s=>s.actions.setOnClose),o=fe(s=>s.actions.setAuthToken);return m.useEffect(()=>{t&&r(t),n&&i(n)},[t,r,n,i]),m.useEffect(()=>{e&&e.accessToken&&o(e)},[e,o]),_.jsxs(lD,{className:"rounded-none",children:[_.jsx(cD,{className:" rounded-none border-r-[3px] ",children:_.jsx(RD,{})}),_.jsx(uD,{children:_.jsx(Mie,{})})]})}function Aie(){fe(s=>s.selectedCardId);const e=fe(s=>s.selectedSheetId),t=fe(s=>s.actions.setIsVisualEditing),n=fe(s=>s.isVisualEditing),r=fe(s=>s.actions.updateFrame);function i(s){e&&(r(e,s),t(!1))}function o(){t(!1)}return _.jsx("div",{role:"editor-container",className:De("grow flex",{block:n,hidden:!n}),children:_.jsx(Tie,{onSave:i,onClose:o})})}function Iie({columns:e,tableName:t}){const n=ve(f=>f.selectedConnectionId),r=ve(f=>f.selectedDatabaseName),i=ve(f=>f.selectedSchemaName),o=ve(f=>f.selectedTableName),s=fe(f=>f.dashboard.filters)||[],a=fe(f=>f.actions.addFilter),l=fe(f=>f.actions.removeFilter),c=fe(f=>f.actions.removeFilterValue);function d(f){const g=_i(f.column_name),p=_i(r||""),v=_i(i||""),b=_i(t),x=s==null?void 0:s.find(w=>w.column===g&&w.table===b&&w.database===p);if(x)c(x.id),l(x.id);else{const w=mp(v,b),S=`SELECT ${g}, COUNT(*) FROM ${w} GROUP BY ${g} ORDER BY ${g} ASC LIMIT 50`,C=`SELECT min(${g}) as min, max(${g}) as max FROM ${w}`;if(t==="api"&&n){a({id:qo(),column:`${w}.${g}`,title:f.column_name,dataType:f.data_type,table:"api",database:"NA",connectionId:n,sql:xa.includes(f.data_type)?C:S});return}if(!n||!r||!o)throw new Error("missing connectionId, database, or table");a({id:qo(),column:`${w}.${g}`,title:f.column_name,dataType:f.data_type,table:o,database:r,connectionId:n,sql:xa.includes(f.data_type)?C:S})}}return _.jsx(da,{className:" h-[70vh] mt-2 xbg-red-100 px-3",children:e==null?void 0:e.map(f=>{const g=s==null?void 0:s.find(p=>p.column===_i(f.column_name)&&p.table===o&&p.database===r);return _.jsx("div",{onClick:()=>d(f),className:De(" group flex text-sm items-center justify-between px-3 py-[6px] transition-colors hover:bg-muted/50 cursor-pointer border border-background border-dashed",{"bg-muted ":g}),children:_.jsxs("div",{className:"flex items-center gap-2 ",children:[_.jsx(ND,{column:f}),_.jsx("span",{children:f.column_name})]})},f.column_name)})})}function Nie(){fe(t=>t.showFilters);const e=fe(t=>t.actions.setShowFilters);return _.jsxs("section",{className:" relative space-y-4 py-0 px-4 ",children:[_.jsx(it,{onClick:()=>e(!1),className:" p-0 h-7 w-7 absolute top-0 right-4",variant:"outline",children:_.jsx(ca,{})}),_.jsx("p",{className:"text-md px-2",children:"Data Columns"}),_.jsx("div",{children:_.jsx(RD,{ColumnsComponent:(t,n,r)=>_.jsx(Iie,{schemaName:t,tableName:n,columns:r})})})]})}function Rie(){fe(n=>n.dashboard);const e=fe(n=>n.showFilters),t=fe(n=>n.isVisualEditing);return fe(n=>n.bookmarkKey),_.jsxs("div",{role:"dashboard-plus-main",className:De(" grow",{hidden:t,flex:!t}),children:[_.jsx(bk,{}),e&&_.jsx("div",{role:"filter-aside-container",children:_.jsx(Nie,{})})]})}function Lie(){const e=fe(r=>r.dashboard),t=fe(r=>r.actions.setDashboard),n=fe(r=>r.showDashboardJSON);return fe(r=>r.actions.setShowDashboardJSON),_.jsx("div",{className:De(" p-2",{hidden:!n}),children:_.jsx(SM,{onChange:r=>{if(r)try{JSON.parse(r),t(JSON.parse(r))}catch{}},defaultLanguage:"json",className:"h-[550px] overflow-y-auto ",value:JSON.stringify(e,null,2),options:{minimap:{enabled:!1},glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})})}function Fie({showControls:e=!1,showFooter:t=!0,...n}){return fe(r=>r.isVisualEditing),_.jsx(HO,{dashboardProps:n,children:_.jsxs(wy,{children:[_.jsx(Lie,{}),_.jsxs(m_,{...n,children:[e&&_.jsx(vX,{}),_.jsx(Aie,{}),_.jsx(Rie,{})]})]})})}function $ie({card:e,footer:t,className:n,...r}){const{customCards:i}=C0(),o=m.useRef(null),{isError:s,isLoading:a,isFetching:l,cfg:c,visualKey:d,handleDatapointClick:f}=E0(e),g=fe(I=>I.themeStyle),p=fe(I=>I.selectedSheetId),v=fe(I=>I.selectedCardId),b=fe(I=>I.isDashboardEditing),{setCardTitle:x,setCardDescription:w,setSelectedCardId:S}=Gc();function C(I){I.stopPropagation(),S(p,e.id)}function P(){if(i&&i.length>0){const I=i.find(F=>F.cardId===e.id);if(I&&I.replaceDefault){const F=I.content;if(F)return _.jsx(F,{card:e})}}return e.type==="kpi"?e.data&&e.data.length>0&&_.jsx(x0,{card:e}):T}function O(){if(s)return _.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(e.type==="table"&&e.data&&e.data.length>0)return _.jsxs(da,{children:[_.jsx(Jh,{data:e.data}),_.jsx(Il,{orientation:"horizontal"})]});if(i&&i.length>0){const I=i.find(F=>F.cardId===e.id);if(I&&I.content){const F=I.content;return _.jsx(F,{card:e})}}if(c)return _.jsx($b,{cfg:c,onDatapointClick:f},d)}function k(){if(i&&i.length>0){const I=i.find(F=>F.cardId===e.id);if(I&&I.footer){const F=I.footer;if(F)return _.jsx(F,{card:e})}}return t||null}if(!e.id)return null;const T=_.jsxs(_.Fragment,{children:[_.jsxs(tu,{className:" pb-4",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(ao,{text:e.title,onSave:I=>x(p,e.id,I),children:_.jsx(nu,{className:"text-base",children:e.title})}),e.refreshInterval&&_.jsxs(zu,{children:[_.jsx(Gh,{className:"pr-1",children:_.jsx("div",{className:De("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":a||l})})}),_.jsx(Tl,{side:"right",align:"center",children:_.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),!e.refreshInterval&&(a||l)&&_.jsx(Nl,{className:"w-4 h-4 animate-spin text-muted-foreground"})]}),_.jsx(ao,{text:(e==null?void 0:e.description)||"",onSave:I=>w(p,e.id,I),children:_.jsxs(Xf,{children:[" ",e.description]})})]}),_.jsx(ru,{className:" grow flex flex-col pb-0 relative overflow-auto ",children:O()}),_.jsx(Uv,{children:k()})]});return _.jsx(Kf,{tabIndex:-1,ref:o,role:"dashboard-card",onClick:C,className:De(" relative h-full flex flex-col rounded-sm",{"border-dashed border-foreground/50 ":v===e.id&&b},g==null?void 0:g.dashboardCard,n),...r,children:P()})}function jie(){const e=fe(t=>t.actions);return{getStyle:e.getStyle,getDashboard:e.getDashboard,setOnSaveFunction:e.setOnSaveFunction,setOnAddCard:e.setOnAddCard,setOnUpateCard:e.setOnUpdateCard,setOnRemoveCard:e.setOnRemoveCard}}je.BOOLEAN_DATA_TYPES=pp,je.DATE_DATA_TYPES=xa,je.Dashboard=xk,je.DashboardCard=$ie,je.DashboardPlus=Fie,je.DashboardProvider=wy,je.DashboardWC=gY,je.NUMBER_DATA_TYPES=ds,je.SelectComponent=ld,je.SemaphorQueryClient=yk,je.TEXT_DATA_TYPES=Uu,je.cleanCard=Yk,je.createSqlGenConfig=H0,je.fmt=_i,je.getBookmarkKey=gs,je.getColumnDataType=lW,je.getDashbaordStateWithoutData=Iy,je.getFilterValueType=gp,je.getQualifiedTableName=mp,je.getSql=V0,je.isColumnInSqlGen=dP,je.resolveDataType=xf,je.useActions=jie,je.useCard=PH,je.useDashboard=g_,je.useDashboardActions=Gc,je.useDashboardStore=fe,je.useEditorActions=mR,je.useEditorAside=d_,je.useEditorStore=ve,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});