semaphor 0.0.76 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,443 @@
1
+ "use strict";var IU=Object.defineProperty;var NU=(e,t,n)=>t in e?IU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ne=(e,t,n)=>(NU(e,typeof t!="symbol"?t+"":t,n),n),Yy=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var oe=(e,t,n)=>(Yy(e,t,"read from private field"),n?n.call(e):t.get(e)),Xe=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ue=(e,t,n,r)=>(Yy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Cg=(e,t,n,r)=>({set _(o){Ue(e,t,o,n)},get _(){return oe(e,t,r)}}),jt=(e,t,n)=>(Yy(e,t,"access private method"),n);const m=require("react"),Er=require("react-dom");function SM(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const j=SM(m),_S=SM(Er);var ys=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function SS(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Qx={exports:{}},qd={};/**
2
+ * @license React
3
+ * react-jsx-runtime.development.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var hP;function LU(){return hP||(hP=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function x(k){if(k===null||typeof k!="object")return null;var ne=v&&k[v]||k[b];return typeof ne=="function"?ne:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(k){{for(var ne=arguments.length,fe=new Array(ne>1?ne-1:0),$e=1;$e<ne;$e++)fe[$e-1]=arguments[$e];S("error",k,fe)}}function S(k,ne,fe){{var $e=y.ReactDebugCurrentFrame,Ve=$e.getStackAddendum();Ve!==""&&(ne+="%s",fe=fe.concat([Ve]));var qe=fe.map(function(ze){return String(ze)});qe.unshift("Warning: "+ne),Function.prototype.apply.call(console[k],console,qe)}}var C=!1,E=!1,$=!1,T=!1,D=!1,M;M=Symbol.for("react.module.reference");function L(k){return!!(typeof k=="string"||typeof k=="function"||k===r||k===i||D||k===o||k===c||k===u||T||k===p||C||E||$||typeof k=="object"&&k!==null&&(k.$$typeof===h||k.$$typeof===d||k.$$typeof===a||k.$$typeof===s||k.$$typeof===l||k.$$typeof===M||k.getModuleId!==void 0))}function F(k,ne,fe){var $e=k.displayName;if($e)return $e;var Ve=ne.displayName||ne.name||"";return Ve!==""?fe+"("+Ve+")":fe}function z(k){return k.displayName||"Context"}function X(k){if(k==null)return null;if(typeof k.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof k=="function")return k.displayName||k.name||null;if(typeof k=="string")return k;switch(k){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof k=="object")switch(k.$$typeof){case s:var ne=k;return z(ne)+".Consumer";case a:var fe=k;return z(fe._context)+".Provider";case l:return F(k,k.render,"ForwardRef");case d:var $e=k.displayName||null;return $e!==null?$e:X(k.type)||"Memo";case h:{var Ve=k,qe=Ve._payload,ze=Ve._init;try{return X(ze(qe))}catch{return null}}}return null}var G=Object.assign,A=0,U,V,K,q,O,H,Y;function I(){}I.__reactDisabledLog=!0;function te(){{if(A===0){U=console.log,V=console.info,K=console.warn,q=console.error,O=console.group,H=console.groupCollapsed,Y=console.groupEnd;var k={configurable:!0,enumerable:!0,value:I,writable:!0};Object.defineProperties(console,{info:k,log:k,warn:k,error:k,group:k,groupCollapsed:k,groupEnd:k})}A++}}function ce(){{if(A--,A===0){var k={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G({},k,{value:U}),info:G({},k,{value:V}),warn:G({},k,{value:K}),error:G({},k,{value:q}),group:G({},k,{value:O}),groupCollapsed:G({},k,{value:H}),groupEnd:G({},k,{value:Y})})}A<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=y.ReactCurrentDispatcher,he;function ie(k,ne,fe){{if(he===void 0)try{throw Error()}catch(Ve){var $e=Ve.stack.trim().match(/\n( *(at )?)/);he=$e&&$e[1]||""}return`
10
+ `+he+k}}var re=!1,le;{var xe=typeof WeakMap=="function"?WeakMap:Map;le=new xe}function Z(k,ne){if(!k||re)return"";{var fe=le.get(k);if(fe!==void 0)return fe}var $e;re=!0;var Ve=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var qe;qe=de.current,de.current=null,te();try{if(ne){var ze=function(){throw Error()};if(Object.defineProperty(ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ze,[])}catch(pt){$e=pt}Reflect.construct(k,[],ze)}else{try{ze.call()}catch(pt){$e=pt}k.call(ze.prototype)}}else{try{throw Error()}catch(pt){$e=pt}k()}}catch(pt){if(pt&&$e&&typeof pt.stack=="string"){for(var Fe=pt.stack.split(`
11
+ `),Ae=$e.stack.split(`
12
+ `),J=Fe.length-1,me=Ae.length-1;J>=1&&me>=0&&Fe[J]!==Ae[me];)me--;for(;J>=1&&me>=0;J--,me--)if(Fe[J]!==Ae[me]){if(J!==1||me!==1)do if(J--,me--,me<0||Fe[J]!==Ae[me]){var Me=`
13
+ `+Fe[J].replace(" at new "," at ");return k.displayName&&Me.includes("<anonymous>")&&(Me=Me.replace("<anonymous>",k.displayName)),typeof k=="function"&&le.set(k,Me),Me}while(J>=1&&me>=0);break}}}finally{re=!1,de.current=qe,ce(),Error.prepareStackTrace=Ve}var lt=k?k.displayName||k.name:"",Rn=lt?ie(lt):"";return typeof k=="function"&&le.set(k,Rn),Rn}function ve(k,ne,fe){return Z(k,!1)}function Ce(k){var ne=k.prototype;return!!(ne&&ne.isReactComponent)}function Oe(k,ne,fe){if(k==null)return"";if(typeof k=="function")return Z(k,Ce(k));if(typeof k=="string")return ie(k);switch(k){case c:return ie("Suspense");case u:return ie("SuspenseList")}if(typeof k=="object")switch(k.$$typeof){case l:return ve(k.render);case d:return Oe(k.type,ne,fe);case h:{var $e=k,Ve=$e._payload,qe=$e._init;try{return Oe(qe(Ve),ne,fe)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,We={},Be=y.ReactDebugCurrentFrame;function Ie(k){if(k){var ne=k._owner,fe=Oe(k.type,k._source,ne?ne.type:null);Be.setExtraStackFrame(fe)}else Be.setExtraStackFrame(null)}function Ke(k,ne,fe,$e,Ve){{var qe=Function.call.bind(Te);for(var ze in k)if(qe(k,ze)){var Fe=void 0;try{if(typeof k[ze]!="function"){var Ae=Error(($e||"React class")+": "+fe+" type `"+ze+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof k[ze]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ae.name="Invariant Violation",Ae}Fe=k[ze](ne,ze,$e,fe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(J){Fe=J}Fe&&!(Fe instanceof Error)&&(Ie(Ve),_("%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).",$e||"React class",fe,ze,typeof Fe),Ie(null)),Fe instanceof Error&&!(Fe.message in We)&&(We[Fe.message]=!0,Ie(Ve),_("Failed %s type: %s",fe,Fe.message),Ie(null))}}}var dt=Array.isArray;function Bt(k){return dt(k)}function It(k){{var ne=typeof Symbol=="function"&&Symbol.toStringTag,fe=ne&&k[Symbol.toStringTag]||k.constructor.name||"Object";return fe}}function Qt(k){try{return pe(k),!1}catch{return!0}}function pe(k){return""+k}function Re(k){if(Qt(k))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",It(k)),pe(k)}var Le=y.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},Ze,Jt,ln;ln={};function rn(k){if(Te.call(k,"ref")){var ne=Object.getOwnPropertyDescriptor(k,"ref").get;if(ne&&ne.isReactWarning)return!1}return k.ref!==void 0}function En(k){if(Te.call(k,"key")){var ne=Object.getOwnPropertyDescriptor(k,"key").get;if(ne&&ne.isReactWarning)return!1}return k.key!==void 0}function vn(k,ne){if(typeof k.ref=="string"&&Le.current&&ne&&Le.current.stateNode!==ne){var fe=X(Le.current.type);ln[fe]||(_('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',X(Le.current.type),k.ref),ln[fe]=!0)}}function Wt(k,ne){{var fe=function(){Ze||(Ze=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",ne))};fe.isReactWarning=!0,Object.defineProperty(k,"key",{get:fe,configurable:!0})}}function dn(k,ne){{var fe=function(){Jt||(Jt=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",ne))};fe.isReactWarning=!0,Object.defineProperty(k,"ref",{get:fe,configurable:!0})}}var $n=function(k,ne,fe,$e,Ve,qe,ze){var Fe={$$typeof:t,type:k,key:ne,ref:fe,props:ze,_owner:qe};return Fe._store={},Object.defineProperty(Fe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Fe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:$e}),Object.defineProperty(Fe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ve}),Object.freeze&&(Object.freeze(Fe.props),Object.freeze(Fe)),Fe};function rt(k,ne,fe,$e,Ve){{var qe,ze={},Fe=null,Ae=null;fe!==void 0&&(Re(fe),Fe=""+fe),En(ne)&&(Re(ne.key),Fe=""+ne.key),rn(ne)&&(Ae=ne.ref,vn(ne,Ve));for(qe in ne)Te.call(ne,qe)&&!Ge.hasOwnProperty(qe)&&(ze[qe]=ne[qe]);if(k&&k.defaultProps){var J=k.defaultProps;for(qe in J)ze[qe]===void 0&&(ze[qe]=J[qe])}if(Fe||Ae){var me=typeof k=="function"?k.displayName||k.name||"Unknown":k;Fe&&Wt(ze,me),Ae&&dn(ze,me)}return $n(k,Fe,Ae,Ve,$e,Le.current,ze)}}var mt=y.ReactCurrentOwner,Nt=y.ReactDebugCurrentFrame;function on(k){if(k){var ne=k._owner,fe=Oe(k.type,k._source,ne?ne.type:null);Nt.setExtraStackFrame(fe)}else Nt.setExtraStackFrame(null)}var _t;_t=!1;function zn(k){return typeof k=="object"&&k!==null&&k.$$typeof===t}function ni(){{if(mt.current){var k=X(mt.current.type);if(k)return`
14
+
15
+ Check the render method of \``+k+"`."}return""}}function Ya(k){{if(k!==void 0){var ne=k.fileName.replace(/^.*[\\\/]/,""),fe=k.lineNumber;return`
16
+
17
+ Check your code at `+ne+":"+fe+"."}return""}}var ri={};function aa(k){{var ne=ni();if(!ne){var fe=typeof k=="string"?k:k.displayName||k.name;fe&&(ne=`
18
+
19
+ Check the top-level render call using <`+fe+">.")}return ne}}function Ci(k,ne){{if(!k._store||k._store.validated||k.key!=null)return;k._store.validated=!0;var fe=aa(ne);if(ri[fe])return;ri[fe]=!0;var $e="";k&&k._owner&&k._owner!==mt.current&&($e=" It was passed a child from "+X(k._owner.type)+"."),on(k),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',fe,$e),on(null)}}function sa(k,ne){{if(typeof k!="object")return;if(Bt(k))for(var fe=0;fe<k.length;fe++){var $e=k[fe];zn($e)&&Ci($e,ne)}else if(zn(k))k._store&&(k._store.validated=!0);else if(k){var Ve=x(k);if(typeof Ve=="function"&&Ve!==k.entries)for(var qe=Ve.call(k),ze;!(ze=qe.next()).done;)zn(ze.value)&&Ci(ze.value,ne)}}}function Ka(k){{var ne=k.type;if(ne==null||typeof ne=="string")return;var fe;if(typeof ne=="function")fe=ne.propTypes;else if(typeof ne=="object"&&(ne.$$typeof===l||ne.$$typeof===d))fe=ne.propTypes;else return;if(fe){var $e=X(ne);Ke(fe,k.props,"prop",$e,k)}else if(ne.PropTypes!==void 0&&!_t){_t=!0;var Ve=X(ne);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ve||"Unknown")}typeof ne.getDefaultProps=="function"&&!ne.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ei(k){{for(var ne=Object.keys(k.props),fe=0;fe<ne.length;fe++){var $e=ne[fe];if($e!=="children"&&$e!=="key"){on(k),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$e),on(null);break}}k.ref!==null&&(on(k),_("Invalid attribute `ref` supplied to `React.Fragment`."),on(null))}}function la(k,ne,fe,$e,Ve,qe){{var ze=L(k);if(!ze){var Fe="";(k===void 0||typeof k=="object"&&k!==null&&Object.keys(k).length===0)&&(Fe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ae=Ya(Ve);Ae?Fe+=Ae:Fe+=ni();var J;k===null?J="null":Bt(k)?J="array":k!==void 0&&k.$$typeof===t?(J="<"+(X(k.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):J=typeof k,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",J,Fe)}var me=rt(k,ne,fe,Ve,qe);if(me==null)return me;if(ze){var Me=ne.children;if(Me!==void 0)if($e)if(Bt(Me)){for(var lt=0;lt<Me.length;lt++)sa(Me[lt],k);Object.freeze&&Object.freeze(Me)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else sa(Me,k)}return k===r?Ei(me):Ka(me),me}}function Jn(k,ne,fe){return la(k,ne,fe,!0)}function Ri(k,ne,fe){return la(k,ne,fe,!1)}var Xa=Ri,Qa=Jn;qd.Fragment=r,qd.jsx=Xa,qd.jsxs=Qa}()),qd}var Gd={};/**
20
+ * @license React
21
+ * react-jsx-runtime.production.min.js
22
+ *
23
+ * Copyright (c) Facebook, Inc. and its affiliates.
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE file in the root directory of this source tree.
27
+ */var pP;function FU(){if(pP)return Gd;pP=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(s,l,c){var u,d={},h=null,p=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(s&&s.defaultProps)for(u in l=s.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:s,key:h,ref:p,props:d,_owner:o.current}}return Gd.Fragment=n,Gd.jsx=a,Gd.jsxs=a,Gd}process.env.NODE_ENV==="production"?Qx.exports=FU():Qx.exports=LU();var R=Qx.exports;function CM(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=CM(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function a0(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=CM(e))&&(r&&(r+=" "),r+=t);return r}const jU=Object.freeze(Object.defineProperty({__proto__:null,clsx:a0,default:a0},Symbol.toStringTag,{value:"Module"})),CS="-";function zU(e){const t=VU(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(a){const s=a.split(CS);return s[0]===""&&s.length!==1&&s.shift(),EM(s,t)||BU(a)}function i(a,s){const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function EM(e,t){var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?EM(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(CS);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId}const gP=/^\[(.+)\]$/;function BU(e){if(gP.test(e)){const t=gP.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function VU(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return WU(Object.entries(e.classGroups),n).forEach(([i,a])=>{Jx(a,r,i,t)}),r}function Jx(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:mP(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(HU(o)){Jx(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{Jx(a,mP(t,i),n,r)})})}function mP(e,t){let n=e;return t.split(CS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function HU(e){return e.isThemeGetter}function WU(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return[n,o]}):e}function UU(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,a){n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}}const RM="!";function qU(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(a){const s=[];let l=0,c=0,u;for(let b=0;b<a.length;b++){let x=a[b];if(l===0){if(x===r&&(n||a.slice(b,b+o)===t)){s.push(a.slice(c,b)),c=b+o;continue}if(x==="/"){u=b;continue}}x==="["?l++:x==="]"&&l--}const d=s.length===0?a:a.substring(c),h=d.startsWith(RM),p=h?d.substring(1):d,v=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:v}}}function GU(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 YU(e){return{cache:UU(e.cacheSize),splitModifiers:qU(e),...zU(e)}}const KU=/\s+/;function XU(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(KU).map(a=>{const{modifiers:s,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(a);let d=r(u?c.substring(0,u):c),h=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:a};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:a};h=!1}const p=GU(s).join(":");return{isTailwindClass:!0,modifierId:l?p+RM:p,classGroupId:d,originalClassName:a,hasPostfixModifier:h}}).reverse().filter(a=>{if(!a.isTailwindClass)return!0;const{modifierId:s,classGroupId:l,hasPostfixModifier:c}=a,u=s+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(s+d)),!0)}).reverse().map(a=>a.originalClassName).join(" ")}function QU(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=PM(t))&&(r&&(r+=" "),r+=n);return r}function PM(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=PM(e[r]))&&(n&&(n+=" "),n+=t);return n}function JU(e,...t){let n,r,o,i=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=YU(c),r=n.cache.get,o=n.cache.set,i=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=XU(l,n);return o(l,u),u}return function(){return i(QU.apply(null,arguments))}}function xn(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const $M=/^\[(?:([a-z-]+):)?(.+)\]$/i,ZU=/^\d+\/\d+$/,eq=new Set(["px","full","screen"]),tq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nq=/\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$/,rq=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function li(e){return $l(e)||eq.has(e)||ZU.test(e)}function ss(e){return fd(e,"length",fq)}function $l(e){return!!e&&!Number.isNaN(Number(e))}function Eg(e){return fd(e,"number",$l)}function Yd(e){return!!e&&Number.isInteger(Number(e))}function iq(e){return e.endsWith("%")&&$l(e.slice(0,-1))}function Ct(e){return $M.test(e)}function ls(e){return tq.test(e)}const aq=new Set(["length","size","percentage"]);function sq(e){return fd(e,aq,OM)}function lq(e){return fd(e,"position",OM)}const cq=new Set(["image","url"]);function uq(e){return fd(e,cq,pq)}function dq(e){return fd(e,"",hq)}function Kd(){return!0}function fd(e,t,n){const r=$M.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function fq(e){return nq.test(e)}function OM(){return!1}function hq(e){return rq.test(e)}function pq(e){return oq.test(e)}function gq(){const e=xn("colors"),t=xn("spacing"),n=xn("blur"),r=xn("brightness"),o=xn("borderColor"),i=xn("borderRadius"),a=xn("borderSpacing"),s=xn("borderWidth"),l=xn("contrast"),c=xn("grayscale"),u=xn("hueRotate"),d=xn("invert"),h=xn("gap"),p=xn("gradientColorStops"),v=xn("gradientColorStopPositions"),b=xn("inset"),x=xn("margin"),y=xn("opacity"),_=xn("padding"),S=xn("saturate"),C=xn("scale"),E=xn("sepia"),$=xn("skew"),T=xn("space"),D=xn("translate"),M=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",Ct,t],z=()=>[Ct,t],X=()=>["",li,ss],G=()=>["auto",$l,Ct],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],K=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",Ct],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[$l,Eg],Y=()=>[$l,Ct];return{cacheSize:500,separator:":",theme:{colors:[Kd],spacing:[li,ss],blur:["none","",ls,Ct],brightness:H(),borderColor:[e],borderRadius:["none","","full",ls,Ct],borderSpacing:z(),borderWidth:X(),contrast:H(),grayscale:q(),hueRotate:Y(),invert:q(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[iq,ss],inset:F(),margin:F(),opacity:H(),padding:z(),saturate:H(),scale:H(),sepia:q(),skew:Y(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",Ct]}],container:["container"],columns:[{columns:[ls]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:[...A(),Ct]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],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",Yd,Ct]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ct]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",Yd,Ct]}],"grid-cols":[{"grid-cols":[Kd]}],"col-start-end":[{col:["auto",{span:["full",Yd,Ct]},Ct]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[Kd]}],"row-start-end":[{row:["auto",{span:[Yd,Ct]},Ct]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ct]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ct]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",Ct,t]}],"min-w":[{"min-w":["min","max","fit",Ct,li]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[ls]},ls,Ct]}],h:[{h:[Ct,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",li,Ct]}],"max-h":[{"max-h":[Ct,t,"min","max","fit"]}],"font-size":[{text:["base",ls,ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Eg]}],"font-family":[{font:[Kd]}],"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",Ct]}],"line-clamp":[{"line-clamp":["none",$l,Eg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",li,Ct]}],"list-image":[{"list-image":["none",Ct]}],"list-style-type":[{list:["none","disc","decimal",Ct]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",li,ss]}],"underline-offset":[{"underline-offset":["auto",li,Ct]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ct]}],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",Ct]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),lq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",sq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},uq]}],"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:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:U()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[li,Ct]}],"outline-w":[{outline:[li,ss]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[li,ss]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ls,dq]}],"shadow-color":[{shadow:[Kd]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":V()}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ls,Ct]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[S]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ct]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",Ct]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ct]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Yd,Ct]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ct]}],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",Ct]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ct]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[li,ss,Eg]}],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 mq=JU(gq);class yf extends Error{}yf.prototype.name="InvalidTokenError";function bq(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function vq(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return bq(t)}catch{return atob(t)}}function yq(e,t){if(typeof e!="string")throw new yf("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new yf(`Invalid token specified: missing part #${n+1}`);let o;try{o=vq(r)}catch(i){throw new yf(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(o)}catch(i){throw new yf(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}async function xq(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt"]),a=window.crypto.getRandomValues(new Uint8Array(12)),s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:a},i,r.encode(e)),l=new Uint8Array(a.length+s.byteLength);return l.set(a,0),l.set(new Uint8Array(s),a.length),{payload:btoa(String.fromCharCode(...l))}}async function wq(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),a=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["decrypt"]),s=Uint8Array.from(atob(e),h=>h.charCodeAt(0)),l=s.slice(0,12),c=s.slice(s.length-16),u=s.slice(12,s.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const h=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},a,d);return{decryptedData:o.decode(h)}}catch(h){throw new Error(`Decryption failed: ${h}`)}}function ye(...e){return mq(a0(e))}async function _q(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const s=await i.json();throw new Error((s==null?void 0:s.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function fb(e,t,n={}){try{const r=JSON.stringify(n),o=await xq(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(s=>{throw console.log(s.detail||"Unknown error occurred"),new Error((s==null?void 0:s.error)||`HTTP error! status: ${i.status}`)});const a=await i.json();if(a.payload){const s=await wq(a.payload,t);return JSON.parse(s.decryptedData)}return a}catch(r){throw console.error("Error during fetch:",r),r}}function Sq(e){if(!e)return{tenantId:"",endUserId:""};const t=yq(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function Cq(e){var t;if(navigator.clipboard&&e.current)navigator.clipboard.writeText(e.current.innerText).then(()=>console.log("Content copied to clipboard")).catch(n=>console.error("Failed to copy: ",n));else{const n=document.createElement("textarea");n.value=((t=e==null?void 0:e.current)==null?void 0:t.innerText)??"",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),console.log("Content copied to clipboard")}}function Eq(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>Rq(i,t))}function Rq(e,t){const n=t==null?void 0:t.find(r=>r.name===e);return n?`(${n.sql}) as ${n.name}`:(console.log(e),`'${e}_table'`)}function Pq(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Lf="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function $q(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([s,l])=>l!==void 0)),o=new URLSearchParams(r).toString();return o&&(n+=`?${o}`),await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json()}async function Oq(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}var Tq={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const bP=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const d=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(h=>h(t,d))}},o=()=>t,s={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(Tq?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,s),s},Dq=e=>e?bP(e):bP;var Zx={exports:{}},Ky={},Rg={exports:{}},Xy={};/**
28
+ * @license React
29
+ * use-sync-external-store-shim.development.js
30
+ *
31
+ * Copyright (c) Facebook, Inc. and its affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */var vP;function Aq(){return vP||(vP=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var C=arguments.length,E=new Array(C>1?C-1:0),$=1;$<C;$++)E[$-1]=arguments[$];r("error",S,E)}}function r(S,C,E){{var $=t.ReactDebugCurrentFrame,T=$.getStackAddendum();T!==""&&(C+="%s",E=E.concat([T]));var D=E.map(function(M){return String(M)});D.unshift("Warning: "+C),Function.prototype.apply.call(console[S],console,D)}}function o(S,C){return S===C&&(S!==0||1/S===1/C)||S!==S&&C!==C}var i=typeof Object.is=="function"?Object.is:o,a=e.useState,s=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,u=!1,d=!1;function h(S,C,E){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var $=C();if(!d){var T=C();i($,T)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var D=a({inst:{value:$,getSnapshot:C}}),M=D[0].inst,L=D[1];return l(function(){M.value=$,M.getSnapshot=C,p(M)&&L({inst:M})},[S,$,C]),s(function(){p(M)&&L({inst:M});var F=function(){p(M)&&L({inst:M})};return S(F)},[S]),c($),$}function p(S){var C=S.getSnapshot,E=S.value;try{var $=C();return!i(E,$)}catch{return!0}}function v(S,C,E){return C()}var b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!b,y=x?v:h,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y;Xy.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Xy}var Qy={};/**
36
+ * @license React
37
+ * use-sync-external-store-shim.production.min.js
38
+ *
39
+ * Copyright (c) Facebook, Inc. and its affiliates.
40
+ *
41
+ * This source code is licensed under the MIT license found in the
42
+ * LICENSE file in the root directory of this source tree.
43
+ */var yP;function Mq(){if(yP)return Qy;yP=1;var e=m;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function s(d,h){var p=h(),v=r({inst:{value:p,getSnapshot:h}}),b=v[0].inst,x=v[1];return i(function(){b.value=p,b.getSnapshot=h,l(b)&&x({inst:b})},[d,p,h]),o(function(){return l(b)&&x({inst:b}),d(function(){l(b)&&x({inst:b})})},[d]),a(p),p}function l(d){var h=d.getSnapshot;d=d.value;try{var p=h();return!n(d,p)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return Qy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Qy}var xP;function ES(){return xP||(xP=1,process.env.NODE_ENV==="production"?Rg.exports=Mq():Rg.exports=Aq()),Rg.exports}/**
44
+ * @license React
45
+ * use-sync-external-store-shim/with-selector.development.js
46
+ *
47
+ * Copyright (c) Facebook, Inc. and its affiliates.
48
+ *
49
+ * This source code is licensed under the MIT license found in the
50
+ * LICENSE file in the root directory of this source tree.
51
+ */var wP;function kq(){return wP||(wP=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=ES();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;function c(u,d,h,p,v){var b=i(null),x;b.current===null?(x={hasValue:!1,value:null},b.current=x):x=b.current;var y=s(function(){var E=!1,$,T,D=function(z){if(!E){E=!0,$=z;var X=p(z);if(v!==void 0&&x.hasValue){var G=x.value;if(v(G,X))return T=G,G}return T=X,X}var A=$,U=T;if(r(A,z))return U;var V=p(z);return v!==void 0&&v(U,V)?U:($=z,T=V,V)},M=h===void 0?null:h,L=function(){return D(d())},F=M===null?void 0:function(){return D(M())};return[L,F]},[d,h,p,v]),_=y[0],S=y[1],C=o(u,_,S);return a(function(){x.hasValue=!0,x.value=C},[C]),l(C),C}Ky.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ky}var Jy={};/**
52
+ * @license React
53
+ * use-sync-external-store-shim/with-selector.production.min.js
54
+ *
55
+ * Copyright (c) Facebook, Inc. and its affiliates.
56
+ *
57
+ * This source code is licensed under the MIT license found in the
58
+ * LICENSE file in the root directory of this source tree.
59
+ */var _P;function Iq(){if(_P)return Jy;_P=1;var e=m,t=ES();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return Jy.useSyncExternalStoreWithSelector=function(c,u,d,h,p){var v=i(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=s(function(){function y($){if(!_){if(_=!0,S=$,$=h($),p!==void 0&&b.hasValue){var T=b.value;if(p(T,$))return C=T}return C=$}if(T=C,r(S,$))return T;var D=h($);return p!==void 0&&p(T,D)?T:(S=$,C=D)}var _=!1,S,C,E=d===void 0?null:d;return[function(){return y(u())},E===null?void 0:function(){return y(E())}]},[u,d,h,p]);var x=o(c,v[0],v[1]);return a(function(){b.hasValue=!0,b.value=x},[x]),l(x),x},Jy}process.env.NODE_ENV==="production"?Zx.exports=Iq():Zx.exports=kq();var Nq=Zx.exports;const Lq=mc(Nq);var TM={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:Fq}=m,{useSyncExternalStoreWithSelector:jq}=Lq;let SP=!1;function zq(e,t=e.getState,n){(TM?"production":void 0)!=="production"&&n&&!SP&&(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"),SP=!0);const r=jq(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return Fq(r),r}const CP=e=>{(TM?"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"?Dq(e):e,n=(r,o)=>zq(t,r,o);return Object.assign(n,t),n},DM=e=>e?CP(e):CP;var AM=Symbol.for("immer-nothing"),EP=Symbol.for("immer-draftable"),Po=Symbol.for("immer-state"),Bq=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 Zr(e,...t){if(process.env.NODE_ENV!=="production"){const n=Bq[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 Wu=Object.getPrototypeOf;function Uu(e){return!!e&&!!e[Po]}function nc(e){var t;return e?MM(e)||Array.isArray(e)||!!e[EP]||!!((t=e.constructor)!=null&&t[EP])||pb(e)||gb(e):!1}var Vq=Object.prototype.constructor.toString();function MM(e){if(!e||typeof e!="object")return!1;const t=Wu(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)===Vq}function th(e,t){hb(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function hb(e){const t=e[Po];return t?t.type_:Array.isArray(e)?1:pb(e)?2:gb(e)?3:0}function ew(e,t){return hb(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function kM(e,t,n){const r=hb(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Hq(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function pb(e){return e instanceof Map}function gb(e){return e instanceof Set}function vl(e){return e.copy_||e.base_}function tw(e,t){if(pb(e))return new Map(e);if(gb(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&MM(e))return Wu(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[Po];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],a=n[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(n[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Wu(e),n)}function RS(e,t=!1){return mb(e)||Uu(e)||!nc(e)||(hb(e)>1&&(e.set=e.add=e.clear=e.delete=Wq),Object.freeze(e),t&&th(e,(n,r)=>RS(r,!0))),e}function Wq(){Zr(2)}function mb(e){return Object.isFrozen(e)}var Uq={};function rc(e){const t=Uq[e];return t||Zr(0,e),t}var nh;function IM(){return nh}function qq(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function RP(e,t){t&&(rc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function nw(e){rw(e),e.drafts_.forEach(Gq),e.drafts_=null}function rw(e){e===nh&&(nh=e.parent_)}function PP(e){return nh=qq(nh,e)}function Gq(e){const t=e[Po];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function $P(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Po].modified_&&(nw(t),Zr(4)),nc(e)&&(e=s0(t,e),t.parent_||l0(t,e)),t.patches_&&rc("Patches").generateReplacementPatches_(n[Po].base_,e,t.patches_,t.inversePatches_)):e=s0(t,n,[]),nw(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==AM?e:void 0}function s0(e,t,n){if(mb(t))return t;const r=t[Po];if(!r)return th(t,(o,i)=>OP(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return l0(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,a=!1;r.type_===3&&(i=new Set(o),o.clear(),a=!0),th(i,(s,l)=>OP(e,r,o,s,l,n,a)),l0(e,o,!1),n&&e.patches_&&rc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function OP(e,t,n,r,o,i,a){if(process.env.NODE_ENV!=="production"&&o===n&&Zr(5),Uu(o)){const s=i&&t&&t.type_!==3&&!ew(t.assigned_,r)?i.concat(r):void 0,l=s0(e,o,s);if(kM(n,r,l),Uu(l))e.canAutoFreeze_=!1;else return}else a&&n.add(o);if(nc(o)&&!mb(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;s0(e,o),(!t||!t.scope_.parent_)&&l0(e,o)}}function l0(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&RS(t,n)}function Yq(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:IM(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=PS;n&&(o=[r],i=rh);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=a,s}var PS={get(e,t){if(t===Po)return e;const n=vl(e);if(!ew(n,t))return Kq(e,n,t);const r=n[t];return e.finalized_||!nc(r)?r:r===Zy(e.base_,t)?(e1(e),e.copy_[t]=iw(r,e)):r},has(e,t){return t in vl(e)},ownKeys(e){return Reflect.ownKeys(vl(e))},set(e,t,n){const r=NM(vl(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Zy(vl(e),t),i=o==null?void 0:o[Po];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Hq(n,o)&&(n!==void 0||ew(e.base_,t)))return!0;e1(e),ow(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 Zy(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,e1(e),ow(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=vl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Zr(11)},getPrototypeOf(e){return Wu(e.base_)},setPrototypeOf(){Zr(12)}},rh={};th(PS,(e,t)=>{rh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});rh.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Zr(13),rh.set.call(this,e,t,void 0)};rh.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Zr(14),PS.set.call(this,e[0],t,n,e[0])};function Zy(e,t){const n=e[Po];return(n?vl(n):e)[t]}function Kq(e,t,n){var o;const r=NM(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function NM(e,t){if(!(t in e))return;let n=Wu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Wu(n)}}function ow(e){e.modified_||(e.modified_=!0,e.parent_&&ow(e.parent_))}function e1(e){e.copy_||(e.copy_=tw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Xq=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const a=this;return function(l=i,...c){return a.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Zr(6),r!==void 0&&typeof r!="function"&&Zr(7);let o;if(nc(t)){const i=PP(this),a=iw(t,void 0);let s=!0;try{o=n(a),s=!1}finally{s?nw(i):rw(i)}return RP(i,r),$P(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===AM&&(o=void 0),this.autoFreeze_&&RS(o,!0),r){const i=[],a=[];rc("Patches").generateReplacementPatches_(t,o,i,a),r(i,a)}return o}else Zr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(a,...s)=>this.produceWithPatches(a,l=>t(l,...s));let r,o;return[this.produce(t,n,(a,s)=>{r=a,o=s}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){nc(e)||Zr(8),Uu(e)&&(e=Qq(e));const t=PP(this),n=iw(e,void 0);return n[Po].isManual_=!0,rw(t),n}finishDraft(e,t){const n=e&&e[Po];(!n||!n.isManual_)&&Zr(9);const{scope_:r}=n;return RP(r,t),$P(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=rc("Patches").applyPatches_;return Uu(e)?r(e,t):this.produce(e,o=>r(o,t))}};function iw(e,t){const n=pb(e)?rc("MapSet").proxyMap_(e,t):gb(e)?rc("MapSet").proxySet_(e,t):Yq(e,t);return(t?t.scope_:IM()).drafts_.push(n),n}function Qq(e){return Uu(e)||Zr(10,e),LM(e)}function LM(e){if(!nc(e)||mb(e))return e;const t=e[Po];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=tw(e,t.scope_.immer_.useStrictShallowCopy_)}else n=tw(e,!0);return th(n,(r,o)=>{kM(n,r,LM(o))}),t&&(t.finalized_=!1),n}var $o=new Xq,Jq=$o.produce;$o.produceWithPatches.bind($o);$o.setAutoFreeze.bind($o);$o.setUseStrictShallowCopy.bind($o);$o.applyPatches.bind($o);$o.createDraft.bind($o);$o.finishDraft.bind($o);const Zq=e=>(t,n,r)=>(r.setState=(o,i,...a)=>{const s=typeof o=="function"?Jq(o):o;return t(s,i,...a)},e(r.setState,n,r)),FM=Zq;var aw,Pg=Er;if(process.env.NODE_ENV==="production")aw=Pg.createRoot,Pg.hydrateRoot;else{var TP=Pg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;aw=function(e,t){TP.usingClientEntryPoint=!0;try{return Pg.createRoot(e,t)}finally{TP.usingClientEntryPoint=!1}}}var jM={},zM={},$S={exports:{}},vt=String,BM=function(){return{isColorSupported:!1,reset:vt,bold:vt,dim:vt,italic:vt,underline:vt,inverse:vt,hidden:vt,strikethrough:vt,black:vt,red:vt,green:vt,yellow:vt,blue:vt,magenta:vt,cyan:vt,white:vt,gray:vt,bgBlack:vt,bgRed:vt,bgGreen:vt,bgYellow:vt,bgBlue:vt,bgMagenta:vt,bgCyan:vt,bgWhite:vt,blackBright:vt,redBright:vt,greenBright:vt,yellowBright:vt,blueBright:vt,magentaBright:vt,cyanBright:vt,whiteBright:vt,bgBlackBright:vt,bgRedBright:vt,bgGreenBright:vt,bgYellowBright:vt,bgBlueBright:vt,bgMagentaBright:vt,bgCyanBright:vt,bgWhiteBright:vt}};$S.exports=BM();$S.exports.createColors=BM;var eG=$S.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return a},default:function(){return s}});const n=r(eG);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(d=>console.warn(l,"-",d)))}function a(l){return n.default.dim(l)}const s={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(zM);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(zM);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:a,to:s}){t.default.warn(`${a}-color-renamed`,[`As of Tailwind CSS ${i}, \`${a}\` has been renamed to \`${s}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(jM);let t1=jM;var tG=(t1.__esModule?t1:{default:t1}).default;const Yt=mc(tG),VM=`import pandas as pd
60
+ df = pd.DataFrame(data) # 'data' contains the query result
61
+ result = df.to_dict('records') # must return 'result' as [dict] type
62
+ `,HM="dm",sw=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],nG=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],OS=["lg","md","sm","xs","xxs"],c0={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Yt.blue[500],Yt.teal[500],Yt.amber[500],Yt.red[500],Yt.indigo[500],Yt.green[500]],borderColor:[Yt.blue[500],Yt.teal[500],Yt.amber[500],Yt.red[500],Yt.indigo[500],Yt.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:lw},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[Yt.blue[500],Yt.teal[500],Yt.amber[500],Yt.red[500],Yt.indigo[500],Yt.green[500]],borderColor:[Yt.blue[500],Yt.teal[500],Yt.amber[500],Yt.red[500],Yt.indigo[500],Yt.green[500]],datalables:{color:lw}},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:Yt.slate[800]}},y:{grid:{display:!0,color:Yt.slate[800]}}}}}}};function lw(e){var r,o,i,a,s,l;const t=(s=(a=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:a.plugins)==null?void 0:s.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=oh()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=oh()),qu(n)}function oh(){return we.getState().theme==="dark"?"#000000":"#FFFFFF"}function qu(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return Yt.gray[500];const d=u.replace("#",""),h=parseInt(d.substring(0,2),16),p=parseInt(d.substring(2,4),16),v=parseInt(d.substring(4,6),16);t+=h,n+=p,r+=v,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const a=t/o,s=n/o,l=r/o;return(a*299+s*587+l*114)/1e3>=180?"black":"white"}const bb=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],op=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],hd=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],TS=["boolean"];function DS(e){return e.match(/[A-Z]/)?`"${e}"`:e}function rG(e,t,n,r){const{measures:o,dimensions:i}=e,a=o==null?void 0:o.map(u=>`${u.calc}(${u.name}) as ${u.calc}_${u.name.replace(/"/g,"")}`).join(", "),s=(i==null?void 0:i.join(", "))||"";let l="";const c=r?`${HM}.${r}`:WM(t,n);if(a&&s)return l=`SELECT ${s}, COUNT(*) as count, ${a} FROM ${c} GROUP BY ${s} ORDER BY ${s} DESC`,l;if(!a&&s)return l=`SELECT ${s}, COUNT(*) as count FROM ${c} GROUP BY ${s} ORDER BY ${s} DESC`,l;if(a&&!s)return l=`SELECT ${a} FROM ${c}`,l}function oG(e,t,n="AVG"){var i,a,s,l;let r={};const o=DS(e.column_name);return bb.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(a=t.dimensions)==null?void 0:a.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),op.includes(e.data_type)&&(((s=t.measures)==null?void 0:s.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function vu(e){return bb.includes(e.dataType)?"string":op.includes(e.dataType)?"number":hd.includes(e.dataType)?"date":TS.includes(e.dataType)?"boolean":"string"}function iG(e){let t;const n=e.data_type.toLowerCase();return bb.includes(n)?t="T":op.includes(n)?t="#":hd.includes(n)?t="D":TS.includes(n)?t="B":t="?",t}function aG(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(a=>a.name===e.column_name);return o||i}function WM(e,t){return t==="api"||e===DS("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const sG=e=>{const t=new Date(e);return!isNaN(t.getTime())},lG=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),vb=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?sG(e)?t="date":lG(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function cG({get:e,dataPoint:t,card:n}){var h;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue:i,replaceFilterValue:a,removeFilteringCard:s}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(h=n.preferences)==null?void 0:h.filterOnClickField,valueType:vb(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){s(n),i(p);return}else a(d)}o(n),r(d)}var u0={exports:{}};/**
63
+ * @license
64
+ * Lodash <https://lodash.com/>
65
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
66
+ * Released under MIT license <https://lodash.com/license>
67
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
68
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
69
+ */u0.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,h=2,p=4,v=1,b=2,x=1,y=2,_=4,S=8,C=16,E=32,$=64,T=128,D=256,M=512,L=30,F="...",z=800,X=16,G=1,A=2,U=3,V=1/0,K=9007199254740991,q=17976931348623157e292,O=NaN,H=4294967295,Y=H-1,I=H>>>1,te=[["ary",T],["bind",x],["bindKey",y],["curry",S],["curryRight",C],["flip",M],["partial",E],["partialRight",$],["rearg",D]],ce="[object Arguments]",de="[object Array]",he="[object AsyncFunction]",ie="[object Boolean]",re="[object Date]",le="[object DOMException]",xe="[object Error]",Z="[object Function]",ve="[object GeneratorFunction]",Ce="[object Map]",Oe="[object Number]",Te="[object Null]",We="[object Object]",Be="[object Promise]",Ie="[object Proxy]",Ke="[object RegExp]",dt="[object Set]",Bt="[object String]",It="[object Symbol]",Qt="[object Undefined]",pe="[object WeakMap]",Re="[object WeakSet]",Le="[object ArrayBuffer]",Ge="[object DataView]",Ze="[object Float32Array]",Jt="[object Float64Array]",ln="[object Int8Array]",rn="[object Int16Array]",En="[object Int32Array]",vn="[object Uint8Array]",Wt="[object Uint8ClampedArray]",dn="[object Uint16Array]",$n="[object Uint32Array]",rt=/\b__p \+= '';/g,mt=/\b(__p \+=) '' \+/g,Nt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,on=/&(?:amp|lt|gt|quot|#39);/g,_t=/[&<>"']/g,zn=RegExp(on.source),ni=RegExp(_t.source),Ya=/<%-([\s\S]+?)%>/g,ri=/<%([\s\S]+?)%>/g,aa=/<%=([\s\S]+?)%>/g,Ci=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sa=/^\w*$/,Ka=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ei=/[\\^$.*+?()[\]{}|]/g,la=RegExp(Ei.source),Jn=/^\s+/,Ri=/\s/,Xa=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Qa=/\{\n\/\* \[wrapped with (.+)\] \*/,k=/,? & /,ne=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,$e=/\\(\\)?/g,Ve=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qe=/\w*$/,ze=/^[-+]0x[0-9a-f]+$/i,Fe=/^0b[01]+$/i,Ae=/^\[object .+?Constructor\]$/,J=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,Me=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lt=/($^)/,Rn=/['\n\r\u2028\u2029\\]/g,pt="\\ud800-\\udfff",gr="\\u0300-\\u036f",ko="\\ufe20-\\ufe2f",el="\\u20d0-\\u20ff",Zn=gr+ko+el,Od="\\u2700-\\u27bf",Td="a-z\\xdf-\\xf6\\xf8-\\xff",DF="\\xac\\xb1\\xd7\\xf7",AF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",MF="\\u2000-\\u206f",kF=" \\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",U2="A-Z\\xc0-\\xd6\\xd8-\\xde",q2="\\ufe0e\\ufe0f",G2=DF+AF+MF+kF,Fv="['’]",IF="["+pt+"]",Y2="["+G2+"]",Fp="["+Zn+"]",K2="\\d+",NF="["+Od+"]",X2="["+Td+"]",Q2="[^"+pt+G2+K2+Od+Td+U2+"]",jv="\\ud83c[\\udffb-\\udfff]",LF="(?:"+Fp+"|"+jv+")",J2="[^"+pt+"]",zv="(?:\\ud83c[\\udde6-\\uddff]){2}",Bv="[\\ud800-\\udbff][\\udc00-\\udfff]",Dc="["+U2+"]",Z2="\\u200d",eR="(?:"+X2+"|"+Q2+")",FF="(?:"+Dc+"|"+Q2+")",tR="(?:"+Fv+"(?:d|ll|m|re|s|t|ve))?",nR="(?:"+Fv+"(?:D|LL|M|RE|S|T|VE))?",rR=LF+"?",oR="["+q2+"]?",jF="(?:"+Z2+"(?:"+[J2,zv,Bv].join("|")+")"+oR+rR+")*",zF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",BF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",iR=oR+rR+jF,VF="(?:"+[NF,zv,Bv].join("|")+")"+iR,HF="(?:"+[J2+Fp+"?",Fp,zv,Bv,IF].join("|")+")",WF=RegExp(Fv,"g"),UF=RegExp(Fp,"g"),Vv=RegExp(jv+"(?="+jv+")|"+HF+iR,"g"),qF=RegExp([Dc+"?"+X2+"+"+tR+"(?="+[Y2,Dc,"$"].join("|")+")",FF+"+"+nR+"(?="+[Y2,Dc+eR,"$"].join("|")+")",Dc+"?"+eR+"+"+tR,Dc+"+"+nR,BF,zF,K2,VF].join("|"),"g"),GF=RegExp("["+Z2+pt+Zn+q2+"]"),YF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,KF=["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"],XF=-1,yn={};yn[Ze]=yn[Jt]=yn[ln]=yn[rn]=yn[En]=yn[vn]=yn[Wt]=yn[dn]=yn[$n]=!0,yn[ce]=yn[de]=yn[Le]=yn[ie]=yn[Ge]=yn[re]=yn[xe]=yn[Z]=yn[Ce]=yn[Oe]=yn[We]=yn[Ke]=yn[dt]=yn[Bt]=yn[pe]=!1;var pn={};pn[ce]=pn[de]=pn[Le]=pn[Ge]=pn[ie]=pn[re]=pn[Ze]=pn[Jt]=pn[ln]=pn[rn]=pn[En]=pn[Ce]=pn[Oe]=pn[We]=pn[Ke]=pn[dt]=pn[Bt]=pn[It]=pn[vn]=pn[Wt]=pn[dn]=pn[$n]=!0,pn[xe]=pn[Z]=pn[pe]=!1;var QF={À:"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"},JF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ZF={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ej={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tj=parseFloat,nj=parseInt,aR=typeof ys=="object"&&ys&&ys.Object===Object&&ys,rj=typeof self=="object"&&self&&self.Object===Object&&self,ir=aR||rj||Function("return this")(),Hv=t&&!t.nodeType&&t,tl=Hv&&!0&&e&&!e.nodeType&&e,sR=tl&&tl.exports===Hv,Wv=sR&&aR.process,Io=function(){try{var ae=tl&&tl.require&&tl.require("util").types;return ae||Wv&&Wv.binding&&Wv.binding("util")}catch{}}(),lR=Io&&Io.isArrayBuffer,cR=Io&&Io.isDate,uR=Io&&Io.isMap,dR=Io&&Io.isRegExp,fR=Io&&Io.isSet,hR=Io&&Io.isTypedArray;function ao(ae,be,ge){switch(ge.length){case 0:return ae.call(be);case 1:return ae.call(be,ge[0]);case 2:return ae.call(be,ge[0],ge[1]);case 3:return ae.call(be,ge[0],ge[1],ge[2])}return ae.apply(be,ge)}function oj(ae,be,ge,He){for(var ft=-1,qt=ae==null?0:ae.length;++ft<qt;){var Gn=ae[ft];be(He,Gn,ge(Gn),ae)}return He}function No(ae,be){for(var ge=-1,He=ae==null?0:ae.length;++ge<He&&be(ae[ge],ge,ae)!==!1;);return ae}function ij(ae,be){for(var ge=ae==null?0:ae.length;ge--&&be(ae[ge],ge,ae)!==!1;);return ae}function pR(ae,be){for(var ge=-1,He=ae==null?0:ae.length;++ge<He;)if(!be(ae[ge],ge,ae))return!1;return!0}function Ja(ae,be){for(var ge=-1,He=ae==null?0:ae.length,ft=0,qt=[];++ge<He;){var Gn=ae[ge];be(Gn,ge,ae)&&(qt[ft++]=Gn)}return qt}function jp(ae,be){var ge=ae==null?0:ae.length;return!!ge&&Ac(ae,be,0)>-1}function Uv(ae,be,ge){for(var He=-1,ft=ae==null?0:ae.length;++He<ft;)if(ge(be,ae[He]))return!0;return!1}function Pn(ae,be){for(var ge=-1,He=ae==null?0:ae.length,ft=Array(He);++ge<He;)ft[ge]=be(ae[ge],ge,ae);return ft}function Za(ae,be){for(var ge=-1,He=be.length,ft=ae.length;++ge<He;)ae[ft+ge]=be[ge];return ae}function qv(ae,be,ge,He){var ft=-1,qt=ae==null?0:ae.length;for(He&&qt&&(ge=ae[++ft]);++ft<qt;)ge=be(ge,ae[ft],ft,ae);return ge}function aj(ae,be,ge,He){var ft=ae==null?0:ae.length;for(He&&ft&&(ge=ae[--ft]);ft--;)ge=be(ge,ae[ft],ft,ae);return ge}function Gv(ae,be){for(var ge=-1,He=ae==null?0:ae.length;++ge<He;)if(be(ae[ge],ge,ae))return!0;return!1}var sj=Yv("length");function lj(ae){return ae.split("")}function cj(ae){return ae.match(ne)||[]}function gR(ae,be,ge){var He;return ge(ae,function(ft,qt,Gn){if(be(ft,qt,Gn))return He=qt,!1}),He}function zp(ae,be,ge,He){for(var ft=ae.length,qt=ge+(He?1:-1);He?qt--:++qt<ft;)if(be(ae[qt],qt,ae))return qt;return-1}function Ac(ae,be,ge){return be===be?wj(ae,be,ge):zp(ae,mR,ge)}function uj(ae,be,ge,He){for(var ft=ge-1,qt=ae.length;++ft<qt;)if(He(ae[ft],be))return ft;return-1}function mR(ae){return ae!==ae}function bR(ae,be){var ge=ae==null?0:ae.length;return ge?Xv(ae,be)/ge:O}function Yv(ae){return function(be){return be==null?n:be[ae]}}function Kv(ae){return function(be){return ae==null?n:ae[be]}}function vR(ae,be,ge,He,ft){return ft(ae,function(qt,Gn,fn){ge=He?(He=!1,qt):be(ge,qt,Gn,fn)}),ge}function dj(ae,be){var ge=ae.length;for(ae.sort(be);ge--;)ae[ge]=ae[ge].value;return ae}function Xv(ae,be){for(var ge,He=-1,ft=ae.length;++He<ft;){var qt=be(ae[He]);qt!==n&&(ge=ge===n?qt:ge+qt)}return ge}function Qv(ae,be){for(var ge=-1,He=Array(ae);++ge<ae;)He[ge]=be(ge);return He}function fj(ae,be){return Pn(be,function(ge){return[ge,ae[ge]]})}function yR(ae){return ae&&ae.slice(0,SR(ae)+1).replace(Jn,"")}function so(ae){return function(be){return ae(be)}}function Jv(ae,be){return Pn(be,function(ge){return ae[ge]})}function Dd(ae,be){return ae.has(be)}function xR(ae,be){for(var ge=-1,He=ae.length;++ge<He&&Ac(be,ae[ge],0)>-1;);return ge}function wR(ae,be){for(var ge=ae.length;ge--&&Ac(be,ae[ge],0)>-1;);return ge}function hj(ae,be){for(var ge=ae.length,He=0;ge--;)ae[ge]===be&&++He;return He}var pj=Kv(QF),gj=Kv(JF);function mj(ae){return"\\"+ej[ae]}function bj(ae,be){return ae==null?n:ae[be]}function Mc(ae){return GF.test(ae)}function vj(ae){return YF.test(ae)}function yj(ae){for(var be,ge=[];!(be=ae.next()).done;)ge.push(be.value);return ge}function Zv(ae){var be=-1,ge=Array(ae.size);return ae.forEach(function(He,ft){ge[++be]=[ft,He]}),ge}function _R(ae,be){return function(ge){return ae(be(ge))}}function es(ae,be){for(var ge=-1,He=ae.length,ft=0,qt=[];++ge<He;){var Gn=ae[ge];(Gn===be||Gn===u)&&(ae[ge]=u,qt[ft++]=ge)}return qt}function Bp(ae){var be=-1,ge=Array(ae.size);return ae.forEach(function(He){ge[++be]=He}),ge}function xj(ae){var be=-1,ge=Array(ae.size);return ae.forEach(function(He){ge[++be]=[He,He]}),ge}function wj(ae,be,ge){for(var He=ge-1,ft=ae.length;++He<ft;)if(ae[He]===be)return He;return-1}function _j(ae,be,ge){for(var He=ge+1;He--;)if(ae[He]===be)return He;return He}function kc(ae){return Mc(ae)?Cj(ae):sj(ae)}function oi(ae){return Mc(ae)?Ej(ae):lj(ae)}function SR(ae){for(var be=ae.length;be--&&Ri.test(ae.charAt(be)););return be}var Sj=Kv(ZF);function Cj(ae){for(var be=Vv.lastIndex=0;Vv.test(ae);)++be;return be}function Ej(ae){return ae.match(Vv)||[]}function Rj(ae){return ae.match(qF)||[]}var Pj=function ae(be){be=be==null?ir:Ic.defaults(ir.Object(),be,Ic.pick(ir,KF));var ge=be.Array,He=be.Date,ft=be.Error,qt=be.Function,Gn=be.Math,fn=be.Object,ey=be.RegExp,$j=be.String,Lo=be.TypeError,Vp=ge.prototype,Oj=qt.prototype,Nc=fn.prototype,Hp=be["__core-js_shared__"],Wp=Oj.toString,an=Nc.hasOwnProperty,Tj=0,CR=function(){var f=/[^.]+$/.exec(Hp&&Hp.keys&&Hp.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),Up=Nc.toString,Dj=Wp.call(fn),Aj=ir._,Mj=ey("^"+Wp.call(an).replace(Ei,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qp=sR?be.Buffer:n,ts=be.Symbol,Gp=be.Uint8Array,ER=qp?qp.allocUnsafe:n,Yp=_R(fn.getPrototypeOf,fn),RR=fn.create,PR=Nc.propertyIsEnumerable,Kp=Vp.splice,$R=ts?ts.isConcatSpreadable:n,Ad=ts?ts.iterator:n,nl=ts?ts.toStringTag:n,Xp=function(){try{var f=sl(fn,"defineProperty");return f({},"",{}),f}catch{}}(),kj=be.clearTimeout!==ir.clearTimeout&&be.clearTimeout,Ij=He&&He.now!==ir.Date.now&&He.now,Nj=be.setTimeout!==ir.setTimeout&&be.setTimeout,Qp=Gn.ceil,Jp=Gn.floor,ty=fn.getOwnPropertySymbols,Lj=qp?qp.isBuffer:n,OR=be.isFinite,Fj=Vp.join,jj=_R(fn.keys,fn),Yn=Gn.max,mr=Gn.min,zj=He.now,Bj=be.parseInt,TR=Gn.random,Vj=Vp.reverse,ny=sl(be,"DataView"),Md=sl(be,"Map"),ry=sl(be,"Promise"),Lc=sl(be,"Set"),kd=sl(be,"WeakMap"),Id=sl(fn,"create"),Zp=kd&&new kd,Fc={},Hj=ll(ny),Wj=ll(Md),Uj=ll(ry),qj=ll(Lc),Gj=ll(kd),eg=ts?ts.prototype:n,Nd=eg?eg.valueOf:n,DR=eg?eg.toString:n;function B(f){if(Mn(f)&&!ht(f)&&!(f instanceof Lt)){if(f instanceof Fo)return f;if(an.call(f,"__wrapped__"))return A5(f)}return new Fo(f)}var jc=function(){function f(){}return function(g){if(!On(g))return{};if(RR)return RR(g);f.prototype=g;var w=new f;return f.prototype=n,w}}();function tg(){}function Fo(f,g){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}B.templateSettings={escape:Ya,evaluate:ri,interpolate:aa,variable:"",imports:{_:B}},B.prototype=tg.prototype,B.prototype.constructor=B,Fo.prototype=jc(tg.prototype),Fo.prototype.constructor=Fo;function Lt(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function Yj(){var f=new Lt(this.__wrapped__);return f.__actions__=Vr(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=Vr(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=Vr(this.__views__),f}function Kj(){if(this.__filtered__){var f=new Lt(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function Xj(){var f=this.__wrapped__.value(),g=this.__dir__,w=ht(f),P=g<0,N=w?f.length:0,W=lB(0,N,this.__views__),Q=W.start,ee=W.end,se=ee-Q,_e=P?ee:Q-1,Se=this.__iteratees__,Pe=Se.length,je=0,Ye=mr(se,this.__takeCount__);if(!w||!P&&N==se&&Ye==se)return t5(f,this.__actions__);var et=[];e:for(;se--&&je<Ye;){_e+=g;for(var St=-1,tt=f[_e];++St<Pe;){var At=Se[St],Ft=At.iteratee,uo=At.type,Or=Ft(tt);if(uo==A)tt=Or;else if(!Or){if(uo==G)continue e;break e}}et[je++]=tt}return et}Lt.prototype=jc(tg.prototype),Lt.prototype.constructor=Lt;function rl(f){var g=-1,w=f==null?0:f.length;for(this.clear();++g<w;){var P=f[g];this.set(P[0],P[1])}}function Qj(){this.__data__=Id?Id(null):{},this.size=0}function Jj(f){var g=this.has(f)&&delete this.__data__[f];return this.size-=g?1:0,g}function Zj(f){var g=this.__data__;if(Id){var w=g[f];return w===l?n:w}return an.call(g,f)?g[f]:n}function ez(f){var g=this.__data__;return Id?g[f]!==n:an.call(g,f)}function tz(f,g){var w=this.__data__;return this.size+=this.has(f)?0:1,w[f]=Id&&g===n?l:g,this}rl.prototype.clear=Qj,rl.prototype.delete=Jj,rl.prototype.get=Zj,rl.prototype.has=ez,rl.prototype.set=tz;function ca(f){var g=-1,w=f==null?0:f.length;for(this.clear();++g<w;){var P=f[g];this.set(P[0],P[1])}}function nz(){this.__data__=[],this.size=0}function rz(f){var g=this.__data__,w=ng(g,f);if(w<0)return!1;var P=g.length-1;return w==P?g.pop():Kp.call(g,w,1),--this.size,!0}function oz(f){var g=this.__data__,w=ng(g,f);return w<0?n:g[w][1]}function iz(f){return ng(this.__data__,f)>-1}function az(f,g){var w=this.__data__,P=ng(w,f);return P<0?(++this.size,w.push([f,g])):w[P][1]=g,this}ca.prototype.clear=nz,ca.prototype.delete=rz,ca.prototype.get=oz,ca.prototype.has=iz,ca.prototype.set=az;function ua(f){var g=-1,w=f==null?0:f.length;for(this.clear();++g<w;){var P=f[g];this.set(P[0],P[1])}}function sz(){this.size=0,this.__data__={hash:new rl,map:new(Md||ca),string:new rl}}function lz(f){var g=pg(this,f).delete(f);return this.size-=g?1:0,g}function cz(f){return pg(this,f).get(f)}function uz(f){return pg(this,f).has(f)}function dz(f,g){var w=pg(this,f),P=w.size;return w.set(f,g),this.size+=w.size==P?0:1,this}ua.prototype.clear=sz,ua.prototype.delete=lz,ua.prototype.get=cz,ua.prototype.has=uz,ua.prototype.set=dz;function ol(f){var g=-1,w=f==null?0:f.length;for(this.__data__=new ua;++g<w;)this.add(f[g])}function fz(f){return this.__data__.set(f,l),this}function hz(f){return this.__data__.has(f)}ol.prototype.add=ol.prototype.push=fz,ol.prototype.has=hz;function ii(f){var g=this.__data__=new ca(f);this.size=g.size}function pz(){this.__data__=new ca,this.size=0}function gz(f){var g=this.__data__,w=g.delete(f);return this.size=g.size,w}function mz(f){return this.__data__.get(f)}function bz(f){return this.__data__.has(f)}function vz(f,g){var w=this.__data__;if(w instanceof ca){var P=w.__data__;if(!Md||P.length<o-1)return P.push([f,g]),this.size=++w.size,this;w=this.__data__=new ua(P)}return w.set(f,g),this.size=w.size,this}ii.prototype.clear=pz,ii.prototype.delete=gz,ii.prototype.get=mz,ii.prototype.has=bz,ii.prototype.set=vz;function AR(f,g){var w=ht(f),P=!w&&cl(f),N=!w&&!P&&as(f),W=!w&&!P&&!N&&Hc(f),Q=w||P||N||W,ee=Q?Qv(f.length,$j):[],se=ee.length;for(var _e in f)(g||an.call(f,_e))&&!(Q&&(_e=="length"||N&&(_e=="offset"||_e=="parent")||W&&(_e=="buffer"||_e=="byteLength"||_e=="byteOffset")||pa(_e,se)))&&ee.push(_e);return ee}function MR(f){var g=f.length;return g?f[py(0,g-1)]:n}function yz(f,g){return gg(Vr(f),il(g,0,f.length))}function xz(f){return gg(Vr(f))}function oy(f,g,w){(w!==n&&!ai(f[g],w)||w===n&&!(g in f))&&da(f,g,w)}function Ld(f,g,w){var P=f[g];(!(an.call(f,g)&&ai(P,w))||w===n&&!(g in f))&&da(f,g,w)}function ng(f,g){for(var w=f.length;w--;)if(ai(f[w][0],g))return w;return-1}function wz(f,g,w,P){return ns(f,function(N,W,Q){g(P,N,w(N),Q)}),P}function kR(f,g){return f&&$i(g,er(g),f)}function _z(f,g){return f&&$i(g,Wr(g),f)}function da(f,g,w){g=="__proto__"&&Xp?Xp(f,g,{configurable:!0,enumerable:!0,value:w,writable:!0}):f[g]=w}function iy(f,g){for(var w=-1,P=g.length,N=ge(P),W=f==null;++w<P;)N[w]=W?n:jy(f,g[w]);return N}function il(f,g,w){return f===f&&(w!==n&&(f=f<=w?f:w),g!==n&&(f=f>=g?f:g)),f}function jo(f,g,w,P,N,W){var Q,ee=g&d,se=g&h,_e=g&p;if(w&&(Q=N?w(f,P,N,W):w(f)),Q!==n)return Q;if(!On(f))return f;var Se=ht(f);if(Se){if(Q=uB(f),!ee)return Vr(f,Q)}else{var Pe=br(f),je=Pe==Z||Pe==ve;if(as(f))return o5(f,ee);if(Pe==We||Pe==ce||je&&!N){if(Q=se||je?{}:S5(f),!ee)return se?Zz(f,_z(Q,f)):Jz(f,kR(Q,f))}else{if(!pn[Pe])return N?f:{};Q=dB(f,Pe,ee)}}W||(W=new ii);var Ye=W.get(f);if(Ye)return Ye;W.set(f,Q),J5(f)?f.forEach(function(tt){Q.add(jo(tt,g,w,tt,f,W))}):X5(f)&&f.forEach(function(tt,At){Q.set(At,jo(tt,g,w,At,f,W))});var et=_e?se?Ey:Cy:se?Wr:er,St=Se?n:et(f);return No(St||f,function(tt,At){St&&(At=tt,tt=f[At]),Ld(Q,At,jo(tt,g,w,At,f,W))}),Q}function Sz(f){var g=er(f);return function(w){return IR(w,f,g)}}function IR(f,g,w){var P=w.length;if(f==null)return!P;for(f=fn(f);P--;){var N=w[P],W=g[N],Q=f[N];if(Q===n&&!(N in f)||!W(Q))return!1}return!0}function NR(f,g,w){if(typeof f!="function")throw new Lo(a);return Wd(function(){f.apply(n,w)},g)}function Fd(f,g,w,P){var N=-1,W=jp,Q=!0,ee=f.length,se=[],_e=g.length;if(!ee)return se;w&&(g=Pn(g,so(w))),P?(W=Uv,Q=!1):g.length>=o&&(W=Dd,Q=!1,g=new ol(g));e:for(;++N<ee;){var Se=f[N],Pe=w==null?Se:w(Se);if(Se=P||Se!==0?Se:0,Q&&Pe===Pe){for(var je=_e;je--;)if(g[je]===Pe)continue e;se.push(Se)}else W(g,Pe,P)||se.push(Se)}return se}var ns=c5(Pi),LR=c5(sy,!0);function Cz(f,g){var w=!0;return ns(f,function(P,N,W){return w=!!g(P,N,W),w}),w}function rg(f,g,w){for(var P=-1,N=f.length;++P<N;){var W=f[P],Q=g(W);if(Q!=null&&(ee===n?Q===Q&&!co(Q):w(Q,ee)))var ee=Q,se=W}return se}function Ez(f,g,w,P){var N=f.length;for(w=bt(w),w<0&&(w=-w>N?0:N+w),P=P===n||P>N?N:bt(P),P<0&&(P+=N),P=w>P?0:eP(P);w<P;)f[w++]=g;return f}function FR(f,g){var w=[];return ns(f,function(P,N,W){g(P,N,W)&&w.push(P)}),w}function ar(f,g,w,P,N){var W=-1,Q=f.length;for(w||(w=hB),N||(N=[]);++W<Q;){var ee=f[W];g>0&&w(ee)?g>1?ar(ee,g-1,w,P,N):Za(N,ee):P||(N[N.length]=ee)}return N}var ay=u5(),jR=u5(!0);function Pi(f,g){return f&&ay(f,g,er)}function sy(f,g){return f&&jR(f,g,er)}function og(f,g){return Ja(g,function(w){return ga(f[w])})}function al(f,g){g=os(g,f);for(var w=0,P=g.length;f!=null&&w<P;)f=f[Oi(g[w++])];return w&&w==P?f:n}function zR(f,g,w){var P=g(f);return ht(f)?P:Za(P,w(f))}function Pr(f){return f==null?f===n?Qt:Te:nl&&nl in fn(f)?sB(f):xB(f)}function ly(f,g){return f>g}function Rz(f,g){return f!=null&&an.call(f,g)}function Pz(f,g){return f!=null&&g in fn(f)}function $z(f,g,w){return f>=mr(g,w)&&f<Yn(g,w)}function cy(f,g,w){for(var P=w?Uv:jp,N=f[0].length,W=f.length,Q=W,ee=ge(W),se=1/0,_e=[];Q--;){var Se=f[Q];Q&&g&&(Se=Pn(Se,so(g))),se=mr(Se.length,se),ee[Q]=!w&&(g||N>=120&&Se.length>=120)?new ol(Q&&Se):n}Se=f[0];var Pe=-1,je=ee[0];e:for(;++Pe<N&&_e.length<se;){var Ye=Se[Pe],et=g?g(Ye):Ye;if(Ye=w||Ye!==0?Ye:0,!(je?Dd(je,et):P(_e,et,w))){for(Q=W;--Q;){var St=ee[Q];if(!(St?Dd(St,et):P(f[Q],et,w)))continue e}je&&je.push(et),_e.push(Ye)}}return _e}function Oz(f,g,w,P){return Pi(f,function(N,W,Q){g(P,w(N),W,Q)}),P}function jd(f,g,w){g=os(g,f),f=P5(f,g);var P=f==null?f:f[Oi(Bo(g))];return P==null?n:ao(P,f,w)}function BR(f){return Mn(f)&&Pr(f)==ce}function Tz(f){return Mn(f)&&Pr(f)==Le}function Dz(f){return Mn(f)&&Pr(f)==re}function zd(f,g,w,P,N){return f===g?!0:f==null||g==null||!Mn(f)&&!Mn(g)?f!==f&&g!==g:Az(f,g,w,P,zd,N)}function Az(f,g,w,P,N,W){var Q=ht(f),ee=ht(g),se=Q?de:br(f),_e=ee?de:br(g);se=se==ce?We:se,_e=_e==ce?We:_e;var Se=se==We,Pe=_e==We,je=se==_e;if(je&&as(f)){if(!as(g))return!1;Q=!0,Se=!1}if(je&&!Se)return W||(W=new ii),Q||Hc(f)?x5(f,g,w,P,N,W):iB(f,g,se,w,P,N,W);if(!(w&v)){var Ye=Se&&an.call(f,"__wrapped__"),et=Pe&&an.call(g,"__wrapped__");if(Ye||et){var St=Ye?f.value():f,tt=et?g.value():g;return W||(W=new ii),N(St,tt,w,P,W)}}return je?(W||(W=new ii),aB(f,g,w,P,N,W)):!1}function Mz(f){return Mn(f)&&br(f)==Ce}function uy(f,g,w,P){var N=w.length,W=N,Q=!P;if(f==null)return!W;for(f=fn(f);N--;){var ee=w[N];if(Q&&ee[2]?ee[1]!==f[ee[0]]:!(ee[0]in f))return!1}for(;++N<W;){ee=w[N];var se=ee[0],_e=f[se],Se=ee[1];if(Q&&ee[2]){if(_e===n&&!(se in f))return!1}else{var Pe=new ii;if(P)var je=P(_e,Se,se,f,g,Pe);if(!(je===n?zd(Se,_e,v|b,P,Pe):je))return!1}}return!0}function VR(f){if(!On(f)||gB(f))return!1;var g=ga(f)?Mj:Ae;return g.test(ll(f))}function kz(f){return Mn(f)&&Pr(f)==Ke}function Iz(f){return Mn(f)&&br(f)==dt}function Nz(f){return Mn(f)&&wg(f.length)&&!!yn[Pr(f)]}function HR(f){return typeof f=="function"?f:f==null?Ur:typeof f=="object"?ht(f)?qR(f[0],f[1]):UR(f):dP(f)}function dy(f){if(!Hd(f))return jj(f);var g=[];for(var w in fn(f))an.call(f,w)&&w!="constructor"&&g.push(w);return g}function Lz(f){if(!On(f))return yB(f);var g=Hd(f),w=[];for(var P in f)P=="constructor"&&(g||!an.call(f,P))||w.push(P);return w}function fy(f,g){return f<g}function WR(f,g){var w=-1,P=Hr(f)?ge(f.length):[];return ns(f,function(N,W,Q){P[++w]=g(N,W,Q)}),P}function UR(f){var g=Py(f);return g.length==1&&g[0][2]?E5(g[0][0],g[0][1]):function(w){return w===f||uy(w,f,g)}}function qR(f,g){return Oy(f)&&C5(g)?E5(Oi(f),g):function(w){var P=jy(w,f);return P===n&&P===g?zy(w,f):zd(g,P,v|b)}}function ig(f,g,w,P,N){f!==g&&ay(g,function(W,Q){if(N||(N=new ii),On(W))Fz(f,g,Q,w,ig,P,N);else{var ee=P?P(Dy(f,Q),W,Q+"",f,g,N):n;ee===n&&(ee=W),oy(f,Q,ee)}},Wr)}function Fz(f,g,w,P,N,W,Q){var ee=Dy(f,w),se=Dy(g,w),_e=Q.get(se);if(_e){oy(f,w,_e);return}var Se=W?W(ee,se,w+"",f,g,Q):n,Pe=Se===n;if(Pe){var je=ht(se),Ye=!je&&as(se),et=!je&&!Ye&&Hc(se);Se=se,je||Ye||et?ht(ee)?Se=ee:Bn(ee)?Se=Vr(ee):Ye?(Pe=!1,Se=o5(se,!0)):et?(Pe=!1,Se=i5(se,!0)):Se=[]:Ud(se)||cl(se)?(Se=ee,cl(ee)?Se=tP(ee):(!On(ee)||ga(ee))&&(Se=S5(se))):Pe=!1}Pe&&(Q.set(se,Se),N(Se,se,P,W,Q),Q.delete(se)),oy(f,w,Se)}function GR(f,g){var w=f.length;if(w)return g+=g<0?w:0,pa(g,w)?f[g]:n}function YR(f,g,w){g.length?g=Pn(g,function(W){return ht(W)?function(Q){return al(Q,W.length===1?W[0]:W)}:W}):g=[Ur];var P=-1;g=Pn(g,so(Je()));var N=WR(f,function(W,Q,ee){var se=Pn(g,function(_e){return _e(W)});return{criteria:se,index:++P,value:W}});return dj(N,function(W,Q){return Qz(W,Q,w)})}function jz(f,g){return KR(f,g,function(w,P){return zy(f,P)})}function KR(f,g,w){for(var P=-1,N=g.length,W={};++P<N;){var Q=g[P],ee=al(f,Q);w(ee,Q)&&Bd(W,os(Q,f),ee)}return W}function zz(f){return function(g){return al(g,f)}}function hy(f,g,w,P){var N=P?uj:Ac,W=-1,Q=g.length,ee=f;for(f===g&&(g=Vr(g)),w&&(ee=Pn(f,so(w)));++W<Q;)for(var se=0,_e=g[W],Se=w?w(_e):_e;(se=N(ee,Se,se,P))>-1;)ee!==f&&Kp.call(ee,se,1),Kp.call(f,se,1);return f}function XR(f,g){for(var w=f?g.length:0,P=w-1;w--;){var N=g[w];if(w==P||N!==W){var W=N;pa(N)?Kp.call(f,N,1):by(f,N)}}return f}function py(f,g){return f+Jp(TR()*(g-f+1))}function Bz(f,g,w,P){for(var N=-1,W=Yn(Qp((g-f)/(w||1)),0),Q=ge(W);W--;)Q[P?W:++N]=f,f+=w;return Q}function gy(f,g){var w="";if(!f||g<1||g>K)return w;do g%2&&(w+=f),g=Jp(g/2),g&&(f+=f);while(g);return w}function Pt(f,g){return Ay(R5(f,g,Ur),f+"")}function Vz(f){return MR(Wc(f))}function Hz(f,g){var w=Wc(f);return gg(w,il(g,0,w.length))}function Bd(f,g,w,P){if(!On(f))return f;g=os(g,f);for(var N=-1,W=g.length,Q=W-1,ee=f;ee!=null&&++N<W;){var se=Oi(g[N]),_e=w;if(se==="__proto__"||se==="constructor"||se==="prototype")return f;if(N!=Q){var Se=ee[se];_e=P?P(Se,se,ee):n,_e===n&&(_e=On(Se)?Se:pa(g[N+1])?[]:{})}Ld(ee,se,_e),ee=ee[se]}return f}var QR=Zp?function(f,g){return Zp.set(f,g),f}:Ur,Wz=Xp?function(f,g){return Xp(f,"toString",{configurable:!0,enumerable:!1,value:Vy(g),writable:!0})}:Ur;function Uz(f){return gg(Wc(f))}function zo(f,g,w){var P=-1,N=f.length;g<0&&(g=-g>N?0:N+g),w=w>N?N:w,w<0&&(w+=N),N=g>w?0:w-g>>>0,g>>>=0;for(var W=ge(N);++P<N;)W[P]=f[P+g];return W}function qz(f,g){var w;return ns(f,function(P,N,W){return w=g(P,N,W),!w}),!!w}function ag(f,g,w){var P=0,N=f==null?P:f.length;if(typeof g=="number"&&g===g&&N<=I){for(;P<N;){var W=P+N>>>1,Q=f[W];Q!==null&&!co(Q)&&(w?Q<=g:Q<g)?P=W+1:N=W}return N}return my(f,g,Ur,w)}function my(f,g,w,P){var N=0,W=f==null?0:f.length;if(W===0)return 0;g=w(g);for(var Q=g!==g,ee=g===null,se=co(g),_e=g===n;N<W;){var Se=Jp((N+W)/2),Pe=w(f[Se]),je=Pe!==n,Ye=Pe===null,et=Pe===Pe,St=co(Pe);if(Q)var tt=P||et;else _e?tt=et&&(P||je):ee?tt=et&&je&&(P||!Ye):se?tt=et&&je&&!Ye&&(P||!St):Ye||St?tt=!1:tt=P?Pe<=g:Pe<g;tt?N=Se+1:W=Se}return mr(W,Y)}function JR(f,g){for(var w=-1,P=f.length,N=0,W=[];++w<P;){var Q=f[w],ee=g?g(Q):Q;if(!w||!ai(ee,se)){var se=ee;W[N++]=Q===0?0:Q}}return W}function ZR(f){return typeof f=="number"?f:co(f)?O:+f}function lo(f){if(typeof f=="string")return f;if(ht(f))return Pn(f,lo)+"";if(co(f))return DR?DR.call(f):"";var g=f+"";return g=="0"&&1/f==-V?"-0":g}function rs(f,g,w){var P=-1,N=jp,W=f.length,Q=!0,ee=[],se=ee;if(w)Q=!1,N=Uv;else if(W>=o){var _e=g?null:rB(f);if(_e)return Bp(_e);Q=!1,N=Dd,se=new ol}else se=g?[]:ee;e:for(;++P<W;){var Se=f[P],Pe=g?g(Se):Se;if(Se=w||Se!==0?Se:0,Q&&Pe===Pe){for(var je=se.length;je--;)if(se[je]===Pe)continue e;g&&se.push(Pe),ee.push(Se)}else N(se,Pe,w)||(se!==ee&&se.push(Pe),ee.push(Se))}return ee}function by(f,g){return g=os(g,f),f=P5(f,g),f==null||delete f[Oi(Bo(g))]}function e5(f,g,w,P){return Bd(f,g,w(al(f,g)),P)}function sg(f,g,w,P){for(var N=f.length,W=P?N:-1;(P?W--:++W<N)&&g(f[W],W,f););return w?zo(f,P?0:W,P?W+1:N):zo(f,P?W+1:0,P?N:W)}function t5(f,g){var w=f;return w instanceof Lt&&(w=w.value()),qv(g,function(P,N){return N.func.apply(N.thisArg,Za([P],N.args))},w)}function vy(f,g,w){var P=f.length;if(P<2)return P?rs(f[0]):[];for(var N=-1,W=ge(P);++N<P;)for(var Q=f[N],ee=-1;++ee<P;)ee!=N&&(W[N]=Fd(W[N]||Q,f[ee],g,w));return rs(ar(W,1),g,w)}function n5(f,g,w){for(var P=-1,N=f.length,W=g.length,Q={};++P<N;){var ee=P<W?g[P]:n;w(Q,f[P],ee)}return Q}function yy(f){return Bn(f)?f:[]}function xy(f){return typeof f=="function"?f:Ur}function os(f,g){return ht(f)?f:Oy(f,g)?[f]:D5(Zt(f))}var Gz=Pt;function is(f,g,w){var P=f.length;return w=w===n?P:w,!g&&w>=P?f:zo(f,g,w)}var r5=kj||function(f){return ir.clearTimeout(f)};function o5(f,g){if(g)return f.slice();var w=f.length,P=ER?ER(w):new f.constructor(w);return f.copy(P),P}function wy(f){var g=new f.constructor(f.byteLength);return new Gp(g).set(new Gp(f)),g}function Yz(f,g){var w=g?wy(f.buffer):f.buffer;return new f.constructor(w,f.byteOffset,f.byteLength)}function Kz(f){var g=new f.constructor(f.source,qe.exec(f));return g.lastIndex=f.lastIndex,g}function Xz(f){return Nd?fn(Nd.call(f)):{}}function i5(f,g){var w=g?wy(f.buffer):f.buffer;return new f.constructor(w,f.byteOffset,f.length)}function a5(f,g){if(f!==g){var w=f!==n,P=f===null,N=f===f,W=co(f),Q=g!==n,ee=g===null,se=g===g,_e=co(g);if(!ee&&!_e&&!W&&f>g||W&&Q&&se&&!ee&&!_e||P&&Q&&se||!w&&se||!N)return 1;if(!P&&!W&&!_e&&f<g||_e&&w&&N&&!P&&!W||ee&&w&&N||!Q&&N||!se)return-1}return 0}function Qz(f,g,w){for(var P=-1,N=f.criteria,W=g.criteria,Q=N.length,ee=w.length;++P<Q;){var se=a5(N[P],W[P]);if(se){if(P>=ee)return se;var _e=w[P];return se*(_e=="desc"?-1:1)}}return f.index-g.index}function s5(f,g,w,P){for(var N=-1,W=f.length,Q=w.length,ee=-1,se=g.length,_e=Yn(W-Q,0),Se=ge(se+_e),Pe=!P;++ee<se;)Se[ee]=g[ee];for(;++N<Q;)(Pe||N<W)&&(Se[w[N]]=f[N]);for(;_e--;)Se[ee++]=f[N++];return Se}function l5(f,g,w,P){for(var N=-1,W=f.length,Q=-1,ee=w.length,se=-1,_e=g.length,Se=Yn(W-ee,0),Pe=ge(Se+_e),je=!P;++N<Se;)Pe[N]=f[N];for(var Ye=N;++se<_e;)Pe[Ye+se]=g[se];for(;++Q<ee;)(je||N<W)&&(Pe[Ye+w[Q]]=f[N++]);return Pe}function Vr(f,g){var w=-1,P=f.length;for(g||(g=ge(P));++w<P;)g[w]=f[w];return g}function $i(f,g,w,P){var N=!w;w||(w={});for(var W=-1,Q=g.length;++W<Q;){var ee=g[W],se=P?P(w[ee],f[ee],ee,w,f):n;se===n&&(se=f[ee]),N?da(w,ee,se):Ld(w,ee,se)}return w}function Jz(f,g){return $i(f,$y(f),g)}function Zz(f,g){return $i(f,w5(f),g)}function lg(f,g){return function(w,P){var N=ht(w)?oj:wz,W=g?g():{};return N(w,f,Je(P,2),W)}}function zc(f){return Pt(function(g,w){var P=-1,N=w.length,W=N>1?w[N-1]:n,Q=N>2?w[2]:n;for(W=f.length>3&&typeof W=="function"?(N--,W):n,Q&&$r(w[0],w[1],Q)&&(W=N<3?n:W,N=1),g=fn(g);++P<N;){var ee=w[P];ee&&f(g,ee,P,W)}return g})}function c5(f,g){return function(w,P){if(w==null)return w;if(!Hr(w))return f(w,P);for(var N=w.length,W=g?N:-1,Q=fn(w);(g?W--:++W<N)&&P(Q[W],W,Q)!==!1;);return w}}function u5(f){return function(g,w,P){for(var N=-1,W=fn(g),Q=P(g),ee=Q.length;ee--;){var se=Q[f?ee:++N];if(w(W[se],se,W)===!1)break}return g}}function eB(f,g,w){var P=g&x,N=Vd(f);function W(){var Q=this&&this!==ir&&this instanceof W?N:f;return Q.apply(P?w:this,arguments)}return W}function d5(f){return function(g){g=Zt(g);var w=Mc(g)?oi(g):n,P=w?w[0]:g.charAt(0),N=w?is(w,1).join(""):g.slice(1);return P[f]()+N}}function Bc(f){return function(g){return qv(cP(lP(g).replace(WF,"")),f,"")}}function Vd(f){return function(){var g=arguments;switch(g.length){case 0:return new f;case 1:return new f(g[0]);case 2:return new f(g[0],g[1]);case 3:return new f(g[0],g[1],g[2]);case 4:return new f(g[0],g[1],g[2],g[3]);case 5:return new f(g[0],g[1],g[2],g[3],g[4]);case 6:return new f(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new f(g[0],g[1],g[2],g[3],g[4],g[5],g[6])}var w=jc(f.prototype),P=f.apply(w,g);return On(P)?P:w}}function tB(f,g,w){var P=Vd(f);function N(){for(var W=arguments.length,Q=ge(W),ee=W,se=Vc(N);ee--;)Q[ee]=arguments[ee];var _e=W<3&&Q[0]!==se&&Q[W-1]!==se?[]:es(Q,se);if(W-=_e.length,W<w)return m5(f,g,cg,N.placeholder,n,Q,_e,n,n,w-W);var Se=this&&this!==ir&&this instanceof N?P:f;return ao(Se,this,Q)}return N}function f5(f){return function(g,w,P){var N=fn(g);if(!Hr(g)){var W=Je(w,3);g=er(g),w=function(ee){return W(N[ee],ee,N)}}var Q=f(g,w,P);return Q>-1?N[W?g[Q]:Q]:n}}function h5(f){return ha(function(g){var w=g.length,P=w,N=Fo.prototype.thru;for(f&&g.reverse();P--;){var W=g[P];if(typeof W!="function")throw new Lo(a);if(N&&!Q&&hg(W)=="wrapper")var Q=new Fo([],!0)}for(P=Q?P:w;++P<w;){W=g[P];var ee=hg(W),se=ee=="wrapper"?Ry(W):n;se&&Ty(se[0])&&se[1]==(T|S|E|D)&&!se[4].length&&se[9]==1?Q=Q[hg(se[0])].apply(Q,se[3]):Q=W.length==1&&Ty(W)?Q[ee]():Q.thru(W)}return function(){var _e=arguments,Se=_e[0];if(Q&&_e.length==1&&ht(Se))return Q.plant(Se).value();for(var Pe=0,je=w?g[Pe].apply(this,_e):Se;++Pe<w;)je=g[Pe].call(this,je);return je}})}function cg(f,g,w,P,N,W,Q,ee,se,_e){var Se=g&T,Pe=g&x,je=g&y,Ye=g&(S|C),et=g&M,St=je?n:Vd(f);function tt(){for(var At=arguments.length,Ft=ge(At),uo=At;uo--;)Ft[uo]=arguments[uo];if(Ye)var Or=Vc(tt),fo=hj(Ft,Or);if(P&&(Ft=s5(Ft,P,N,Ye)),W&&(Ft=l5(Ft,W,Q,Ye)),At-=fo,Ye&&At<_e){var Vn=es(Ft,Or);return m5(f,g,cg,tt.placeholder,w,Ft,Vn,ee,se,_e-At)}var si=Pe?w:this,ba=je?si[f]:f;return At=Ft.length,ee?Ft=wB(Ft,ee):et&&At>1&&Ft.reverse(),Se&&se<At&&(Ft.length=se),this&&this!==ir&&this instanceof tt&&(ba=St||Vd(ba)),ba.apply(si,Ft)}return tt}function p5(f,g){return function(w,P){return Oz(w,f,g(P),{})}}function ug(f,g){return function(w,P){var N;if(w===n&&P===n)return g;if(w!==n&&(N=w),P!==n){if(N===n)return P;typeof w=="string"||typeof P=="string"?(w=lo(w),P=lo(P)):(w=ZR(w),P=ZR(P)),N=f(w,P)}return N}}function _y(f){return ha(function(g){return g=Pn(g,so(Je())),Pt(function(w){var P=this;return f(g,function(N){return ao(N,P,w)})})})}function dg(f,g){g=g===n?" ":lo(g);var w=g.length;if(w<2)return w?gy(g,f):g;var P=gy(g,Qp(f/kc(g)));return Mc(g)?is(oi(P),0,f).join(""):P.slice(0,f)}function nB(f,g,w,P){var N=g&x,W=Vd(f);function Q(){for(var ee=-1,se=arguments.length,_e=-1,Se=P.length,Pe=ge(Se+se),je=this&&this!==ir&&this instanceof Q?W:f;++_e<Se;)Pe[_e]=P[_e];for(;se--;)Pe[_e++]=arguments[++ee];return ao(je,N?w:this,Pe)}return Q}function g5(f){return function(g,w,P){return P&&typeof P!="number"&&$r(g,w,P)&&(w=P=n),g=ma(g),w===n?(w=g,g=0):w=ma(w),P=P===n?g<w?1:-1:ma(P),Bz(g,w,P,f)}}function fg(f){return function(g,w){return typeof g=="string"&&typeof w=="string"||(g=Vo(g),w=Vo(w)),f(g,w)}}function m5(f,g,w,P,N,W,Q,ee,se,_e){var Se=g&S,Pe=Se?Q:n,je=Se?n:Q,Ye=Se?W:n,et=Se?n:W;g|=Se?E:$,g&=~(Se?$:E),g&_||(g&=~(x|y));var St=[f,g,N,Ye,Pe,et,je,ee,se,_e],tt=w.apply(n,St);return Ty(f)&&$5(tt,St),tt.placeholder=P,O5(tt,f,g)}function Sy(f){var g=Gn[f];return function(w,P){if(w=Vo(w),P=P==null?0:mr(bt(P),292),P&&OR(w)){var N=(Zt(w)+"e").split("e"),W=g(N[0]+"e"+(+N[1]+P));return N=(Zt(W)+"e").split("e"),+(N[0]+"e"+(+N[1]-P))}return g(w)}}var rB=Lc&&1/Bp(new Lc([,-0]))[1]==V?function(f){return new Lc(f)}:Uy;function b5(f){return function(g){var w=br(g);return w==Ce?Zv(g):w==dt?xj(g):fj(g,f(g))}}function fa(f,g,w,P,N,W,Q,ee){var se=g&y;if(!se&&typeof f!="function")throw new Lo(a);var _e=P?P.length:0;if(_e||(g&=~(E|$),P=N=n),Q=Q===n?Q:Yn(bt(Q),0),ee=ee===n?ee:bt(ee),_e-=N?N.length:0,g&$){var Se=P,Pe=N;P=N=n}var je=se?n:Ry(f),Ye=[f,g,w,P,N,Se,Pe,W,Q,ee];if(je&&vB(Ye,je),f=Ye[0],g=Ye[1],w=Ye[2],P=Ye[3],N=Ye[4],ee=Ye[9]=Ye[9]===n?se?0:f.length:Yn(Ye[9]-_e,0),!ee&&g&(S|C)&&(g&=~(S|C)),!g||g==x)var et=eB(f,g,w);else g==S||g==C?et=tB(f,g,ee):(g==E||g==(x|E))&&!N.length?et=nB(f,g,w,P):et=cg.apply(n,Ye);var St=je?QR:$5;return O5(St(et,Ye),f,g)}function v5(f,g,w,P){return f===n||ai(f,Nc[w])&&!an.call(P,w)?g:f}function y5(f,g,w,P,N,W){return On(f)&&On(g)&&(W.set(g,f),ig(f,g,n,y5,W),W.delete(g)),f}function oB(f){return Ud(f)?n:f}function x5(f,g,w,P,N,W){var Q=w&v,ee=f.length,se=g.length;if(ee!=se&&!(Q&&se>ee))return!1;var _e=W.get(f),Se=W.get(g);if(_e&&Se)return _e==g&&Se==f;var Pe=-1,je=!0,Ye=w&b?new ol:n;for(W.set(f,g),W.set(g,f);++Pe<ee;){var et=f[Pe],St=g[Pe];if(P)var tt=Q?P(St,et,Pe,g,f,W):P(et,St,Pe,f,g,W);if(tt!==n){if(tt)continue;je=!1;break}if(Ye){if(!Gv(g,function(At,Ft){if(!Dd(Ye,Ft)&&(et===At||N(et,At,w,P,W)))return Ye.push(Ft)})){je=!1;break}}else if(!(et===St||N(et,St,w,P,W))){je=!1;break}}return W.delete(f),W.delete(g),je}function iB(f,g,w,P,N,W,Q){switch(w){case Ge:if(f.byteLength!=g.byteLength||f.byteOffset!=g.byteOffset)return!1;f=f.buffer,g=g.buffer;case Le:return!(f.byteLength!=g.byteLength||!W(new Gp(f),new Gp(g)));case ie:case re:case Oe:return ai(+f,+g);case xe:return f.name==g.name&&f.message==g.message;case Ke:case Bt:return f==g+"";case Ce:var ee=Zv;case dt:var se=P&v;if(ee||(ee=Bp),f.size!=g.size&&!se)return!1;var _e=Q.get(f);if(_e)return _e==g;P|=b,Q.set(f,g);var Se=x5(ee(f),ee(g),P,N,W,Q);return Q.delete(f),Se;case It:if(Nd)return Nd.call(f)==Nd.call(g)}return!1}function aB(f,g,w,P,N,W){var Q=w&v,ee=Cy(f),se=ee.length,_e=Cy(g),Se=_e.length;if(se!=Se&&!Q)return!1;for(var Pe=se;Pe--;){var je=ee[Pe];if(!(Q?je in g:an.call(g,je)))return!1}var Ye=W.get(f),et=W.get(g);if(Ye&&et)return Ye==g&&et==f;var St=!0;W.set(f,g),W.set(g,f);for(var tt=Q;++Pe<se;){je=ee[Pe];var At=f[je],Ft=g[je];if(P)var uo=Q?P(Ft,At,je,g,f,W):P(At,Ft,je,f,g,W);if(!(uo===n?At===Ft||N(At,Ft,w,P,W):uo)){St=!1;break}tt||(tt=je=="constructor")}if(St&&!tt){var Or=f.constructor,fo=g.constructor;Or!=fo&&"constructor"in f&&"constructor"in g&&!(typeof Or=="function"&&Or instanceof Or&&typeof fo=="function"&&fo instanceof fo)&&(St=!1)}return W.delete(f),W.delete(g),St}function ha(f){return Ay(R5(f,n,I5),f+"")}function Cy(f){return zR(f,er,$y)}function Ey(f){return zR(f,Wr,w5)}var Ry=Zp?function(f){return Zp.get(f)}:Uy;function hg(f){for(var g=f.name+"",w=Fc[g],P=an.call(Fc,g)?w.length:0;P--;){var N=w[P],W=N.func;if(W==null||W==f)return N.name}return g}function Vc(f){var g=an.call(B,"placeholder")?B:f;return g.placeholder}function Je(){var f=B.iteratee||Hy;return f=f===Hy?HR:f,arguments.length?f(arguments[0],arguments[1]):f}function pg(f,g){var w=f.__data__;return pB(g)?w[typeof g=="string"?"string":"hash"]:w.map}function Py(f){for(var g=er(f),w=g.length;w--;){var P=g[w],N=f[P];g[w]=[P,N,C5(N)]}return g}function sl(f,g){var w=bj(f,g);return VR(w)?w:n}function sB(f){var g=an.call(f,nl),w=f[nl];try{f[nl]=n;var P=!0}catch{}var N=Up.call(f);return P&&(g?f[nl]=w:delete f[nl]),N}var $y=ty?function(f){return f==null?[]:(f=fn(f),Ja(ty(f),function(g){return PR.call(f,g)}))}:qy,w5=ty?function(f){for(var g=[];f;)Za(g,$y(f)),f=Yp(f);return g}:qy,br=Pr;(ny&&br(new ny(new ArrayBuffer(1)))!=Ge||Md&&br(new Md)!=Ce||ry&&br(ry.resolve())!=Be||Lc&&br(new Lc)!=dt||kd&&br(new kd)!=pe)&&(br=function(f){var g=Pr(f),w=g==We?f.constructor:n,P=w?ll(w):"";if(P)switch(P){case Hj:return Ge;case Wj:return Ce;case Uj:return Be;case qj:return dt;case Gj:return pe}return g});function lB(f,g,w){for(var P=-1,N=w.length;++P<N;){var W=w[P],Q=W.size;switch(W.type){case"drop":f+=Q;break;case"dropRight":g-=Q;break;case"take":g=mr(g,f+Q);break;case"takeRight":f=Yn(f,g-Q);break}}return{start:f,end:g}}function cB(f){var g=f.match(Qa);return g?g[1].split(k):[]}function _5(f,g,w){g=os(g,f);for(var P=-1,N=g.length,W=!1;++P<N;){var Q=Oi(g[P]);if(!(W=f!=null&&w(f,Q)))break;f=f[Q]}return W||++P!=N?W:(N=f==null?0:f.length,!!N&&wg(N)&&pa(Q,N)&&(ht(f)||cl(f)))}function uB(f){var g=f.length,w=new f.constructor(g);return g&&typeof f[0]=="string"&&an.call(f,"index")&&(w.index=f.index,w.input=f.input),w}function S5(f){return typeof f.constructor=="function"&&!Hd(f)?jc(Yp(f)):{}}function dB(f,g,w){var P=f.constructor;switch(g){case Le:return wy(f);case ie:case re:return new P(+f);case Ge:return Yz(f,w);case Ze:case Jt:case ln:case rn:case En:case vn:case Wt:case dn:case $n:return i5(f,w);case Ce:return new P;case Oe:case Bt:return new P(f);case Ke:return Kz(f);case dt:return new P;case It:return Xz(f)}}function fB(f,g){var w=g.length;if(!w)return f;var P=w-1;return g[P]=(w>1?"& ":"")+g[P],g=g.join(w>2?", ":" "),f.replace(Xa,`{
70
+ /* [wrapped with `+g+`] */
71
+ `)}function hB(f){return ht(f)||cl(f)||!!($R&&f&&f[$R])}function pa(f,g){var w=typeof f;return g=g??K,!!g&&(w=="number"||w!="symbol"&&me.test(f))&&f>-1&&f%1==0&&f<g}function $r(f,g,w){if(!On(w))return!1;var P=typeof g;return(P=="number"?Hr(w)&&pa(g,w.length):P=="string"&&g in w)?ai(w[g],f):!1}function Oy(f,g){if(ht(f))return!1;var w=typeof f;return w=="number"||w=="symbol"||w=="boolean"||f==null||co(f)?!0:sa.test(f)||!Ci.test(f)||g!=null&&f in fn(g)}function pB(f){var g=typeof f;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?f!=="__proto__":f===null}function Ty(f){var g=hg(f),w=B[g];if(typeof w!="function"||!(g in Lt.prototype))return!1;if(f===w)return!0;var P=Ry(w);return!!P&&f===P[0]}function gB(f){return!!CR&&CR in f}var mB=Hp?ga:Gy;function Hd(f){var g=f&&f.constructor,w=typeof g=="function"&&g.prototype||Nc;return f===w}function C5(f){return f===f&&!On(f)}function E5(f,g){return function(w){return w==null?!1:w[f]===g&&(g!==n||f in fn(w))}}function bB(f){var g=yg(f,function(P){return w.size===c&&w.clear(),P}),w=g.cache;return g}function vB(f,g){var w=f[1],P=g[1],N=w|P,W=N<(x|y|T),Q=P==T&&w==S||P==T&&w==D&&f[7].length<=g[8]||P==(T|D)&&g[7].length<=g[8]&&w==S;if(!(W||Q))return f;P&x&&(f[2]=g[2],N|=w&x?0:_);var ee=g[3];if(ee){var se=f[3];f[3]=se?s5(se,ee,g[4]):ee,f[4]=se?es(f[3],u):g[4]}return ee=g[5],ee&&(se=f[5],f[5]=se?l5(se,ee,g[6]):ee,f[6]=se?es(f[5],u):g[6]),ee=g[7],ee&&(f[7]=ee),P&T&&(f[8]=f[8]==null?g[8]:mr(f[8],g[8])),f[9]==null&&(f[9]=g[9]),f[0]=g[0],f[1]=N,f}function yB(f){var g=[];if(f!=null)for(var w in fn(f))g.push(w);return g}function xB(f){return Up.call(f)}function R5(f,g,w){return g=Yn(g===n?f.length-1:g,0),function(){for(var P=arguments,N=-1,W=Yn(P.length-g,0),Q=ge(W);++N<W;)Q[N]=P[g+N];N=-1;for(var ee=ge(g+1);++N<g;)ee[N]=P[N];return ee[g]=w(Q),ao(f,this,ee)}}function P5(f,g){return g.length<2?f:al(f,zo(g,0,-1))}function wB(f,g){for(var w=f.length,P=mr(g.length,w),N=Vr(f);P--;){var W=g[P];f[P]=pa(W,w)?N[W]:n}return f}function Dy(f,g){if(!(g==="constructor"&&typeof f[g]=="function")&&g!="__proto__")return f[g]}var $5=T5(QR),Wd=Nj||function(f,g){return ir.setTimeout(f,g)},Ay=T5(Wz);function O5(f,g,w){var P=g+"";return Ay(f,fB(P,_B(cB(P),w)))}function T5(f){var g=0,w=0;return function(){var P=zj(),N=X-(P-w);if(w=P,N>0){if(++g>=z)return arguments[0]}else g=0;return f.apply(n,arguments)}}function gg(f,g){var w=-1,P=f.length,N=P-1;for(g=g===n?P:g;++w<g;){var W=py(w,N),Q=f[W];f[W]=f[w],f[w]=Q}return f.length=g,f}var D5=bB(function(f){var g=[];return f.charCodeAt(0)===46&&g.push(""),f.replace(Ka,function(w,P,N,W){g.push(N?W.replace($e,"$1"):P||w)}),g});function Oi(f){if(typeof f=="string"||co(f))return f;var g=f+"";return g=="0"&&1/f==-V?"-0":g}function ll(f){if(f!=null){try{return Wp.call(f)}catch{}try{return f+""}catch{}}return""}function _B(f,g){return No(te,function(w){var P="_."+w[0];g&w[1]&&!jp(f,P)&&f.push(P)}),f.sort()}function A5(f){if(f instanceof Lt)return f.clone();var g=new Fo(f.__wrapped__,f.__chain__);return g.__actions__=Vr(f.__actions__),g.__index__=f.__index__,g.__values__=f.__values__,g}function SB(f,g,w){(w?$r(f,g,w):g===n)?g=1:g=Yn(bt(g),0);var P=f==null?0:f.length;if(!P||g<1)return[];for(var N=0,W=0,Q=ge(Qp(P/g));N<P;)Q[W++]=zo(f,N,N+=g);return Q}function CB(f){for(var g=-1,w=f==null?0:f.length,P=0,N=[];++g<w;){var W=f[g];W&&(N[P++]=W)}return N}function EB(){var f=arguments.length;if(!f)return[];for(var g=ge(f-1),w=arguments[0],P=f;P--;)g[P-1]=arguments[P];return Za(ht(w)?Vr(w):[w],ar(g,1))}var RB=Pt(function(f,g){return Bn(f)?Fd(f,ar(g,1,Bn,!0)):[]}),PB=Pt(function(f,g){var w=Bo(g);return Bn(w)&&(w=n),Bn(f)?Fd(f,ar(g,1,Bn,!0),Je(w,2)):[]}),$B=Pt(function(f,g){var w=Bo(g);return Bn(w)&&(w=n),Bn(f)?Fd(f,ar(g,1,Bn,!0),n,w):[]});function OB(f,g,w){var P=f==null?0:f.length;return P?(g=w||g===n?1:bt(g),zo(f,g<0?0:g,P)):[]}function TB(f,g,w){var P=f==null?0:f.length;return P?(g=w||g===n?1:bt(g),g=P-g,zo(f,0,g<0?0:g)):[]}function DB(f,g){return f&&f.length?sg(f,Je(g,3),!0,!0):[]}function AB(f,g){return f&&f.length?sg(f,Je(g,3),!0):[]}function MB(f,g,w,P){var N=f==null?0:f.length;return N?(w&&typeof w!="number"&&$r(f,g,w)&&(w=0,P=N),Ez(f,g,w,P)):[]}function M5(f,g,w){var P=f==null?0:f.length;if(!P)return-1;var N=w==null?0:bt(w);return N<0&&(N=Yn(P+N,0)),zp(f,Je(g,3),N)}function k5(f,g,w){var P=f==null?0:f.length;if(!P)return-1;var N=P-1;return w!==n&&(N=bt(w),N=w<0?Yn(P+N,0):mr(N,P-1)),zp(f,Je(g,3),N,!0)}function I5(f){var g=f==null?0:f.length;return g?ar(f,1):[]}function kB(f){var g=f==null?0:f.length;return g?ar(f,V):[]}function IB(f,g){var w=f==null?0:f.length;return w?(g=g===n?1:bt(g),ar(f,g)):[]}function NB(f){for(var g=-1,w=f==null?0:f.length,P={};++g<w;){var N=f[g];P[N[0]]=N[1]}return P}function N5(f){return f&&f.length?f[0]:n}function LB(f,g,w){var P=f==null?0:f.length;if(!P)return-1;var N=w==null?0:bt(w);return N<0&&(N=Yn(P+N,0)),Ac(f,g,N)}function FB(f){var g=f==null?0:f.length;return g?zo(f,0,-1):[]}var jB=Pt(function(f){var g=Pn(f,yy);return g.length&&g[0]===f[0]?cy(g):[]}),zB=Pt(function(f){var g=Bo(f),w=Pn(f,yy);return g===Bo(w)?g=n:w.pop(),w.length&&w[0]===f[0]?cy(w,Je(g,2)):[]}),BB=Pt(function(f){var g=Bo(f),w=Pn(f,yy);return g=typeof g=="function"?g:n,g&&w.pop(),w.length&&w[0]===f[0]?cy(w,n,g):[]});function VB(f,g){return f==null?"":Fj.call(f,g)}function Bo(f){var g=f==null?0:f.length;return g?f[g-1]:n}function HB(f,g,w){var P=f==null?0:f.length;if(!P)return-1;var N=P;return w!==n&&(N=bt(w),N=N<0?Yn(P+N,0):mr(N,P-1)),g===g?_j(f,g,N):zp(f,mR,N,!0)}function WB(f,g){return f&&f.length?GR(f,bt(g)):n}var UB=Pt(L5);function L5(f,g){return f&&f.length&&g&&g.length?hy(f,g):f}function qB(f,g,w){return f&&f.length&&g&&g.length?hy(f,g,Je(w,2)):f}function GB(f,g,w){return f&&f.length&&g&&g.length?hy(f,g,n,w):f}var YB=ha(function(f,g){var w=f==null?0:f.length,P=iy(f,g);return XR(f,Pn(g,function(N){return pa(N,w)?+N:N}).sort(a5)),P});function KB(f,g){var w=[];if(!(f&&f.length))return w;var P=-1,N=[],W=f.length;for(g=Je(g,3);++P<W;){var Q=f[P];g(Q,P,f)&&(w.push(Q),N.push(P))}return XR(f,N),w}function My(f){return f==null?f:Vj.call(f)}function XB(f,g,w){var P=f==null?0:f.length;return P?(w&&typeof w!="number"&&$r(f,g,w)?(g=0,w=P):(g=g==null?0:bt(g),w=w===n?P:bt(w)),zo(f,g,w)):[]}function QB(f,g){return ag(f,g)}function JB(f,g,w){return my(f,g,Je(w,2))}function ZB(f,g){var w=f==null?0:f.length;if(w){var P=ag(f,g);if(P<w&&ai(f[P],g))return P}return-1}function eV(f,g){return ag(f,g,!0)}function tV(f,g,w){return my(f,g,Je(w,2),!0)}function nV(f,g){var w=f==null?0:f.length;if(w){var P=ag(f,g,!0)-1;if(ai(f[P],g))return P}return-1}function rV(f){return f&&f.length?JR(f):[]}function oV(f,g){return f&&f.length?JR(f,Je(g,2)):[]}function iV(f){var g=f==null?0:f.length;return g?zo(f,1,g):[]}function aV(f,g,w){return f&&f.length?(g=w||g===n?1:bt(g),zo(f,0,g<0?0:g)):[]}function sV(f,g,w){var P=f==null?0:f.length;return P?(g=w||g===n?1:bt(g),g=P-g,zo(f,g<0?0:g,P)):[]}function lV(f,g){return f&&f.length?sg(f,Je(g,3),!1,!0):[]}function cV(f,g){return f&&f.length?sg(f,Je(g,3)):[]}var uV=Pt(function(f){return rs(ar(f,1,Bn,!0))}),dV=Pt(function(f){var g=Bo(f);return Bn(g)&&(g=n),rs(ar(f,1,Bn,!0),Je(g,2))}),fV=Pt(function(f){var g=Bo(f);return g=typeof g=="function"?g:n,rs(ar(f,1,Bn,!0),n,g)});function hV(f){return f&&f.length?rs(f):[]}function pV(f,g){return f&&f.length?rs(f,Je(g,2)):[]}function gV(f,g){return g=typeof g=="function"?g:n,f&&f.length?rs(f,n,g):[]}function ky(f){if(!(f&&f.length))return[];var g=0;return f=Ja(f,function(w){if(Bn(w))return g=Yn(w.length,g),!0}),Qv(g,function(w){return Pn(f,Yv(w))})}function F5(f,g){if(!(f&&f.length))return[];var w=ky(f);return g==null?w:Pn(w,function(P){return ao(g,n,P)})}var mV=Pt(function(f,g){return Bn(f)?Fd(f,g):[]}),bV=Pt(function(f){return vy(Ja(f,Bn))}),vV=Pt(function(f){var g=Bo(f);return Bn(g)&&(g=n),vy(Ja(f,Bn),Je(g,2))}),yV=Pt(function(f){var g=Bo(f);return g=typeof g=="function"?g:n,vy(Ja(f,Bn),n,g)}),xV=Pt(ky);function wV(f,g){return n5(f||[],g||[],Ld)}function _V(f,g){return n5(f||[],g||[],Bd)}var SV=Pt(function(f){var g=f.length,w=g>1?f[g-1]:n;return w=typeof w=="function"?(f.pop(),w):n,F5(f,w)});function j5(f){var g=B(f);return g.__chain__=!0,g}function CV(f,g){return g(f),f}function mg(f,g){return g(f)}var EV=ha(function(f){var g=f.length,w=g?f[0]:0,P=this.__wrapped__,N=function(W){return iy(W,f)};return g>1||this.__actions__.length||!(P instanceof Lt)||!pa(w)?this.thru(N):(P=P.slice(w,+w+(g?1:0)),P.__actions__.push({func:mg,args:[N],thisArg:n}),new Fo(P,this.__chain__).thru(function(W){return g&&!W.length&&W.push(n),W}))});function RV(){return j5(this)}function PV(){return new Fo(this.value(),this.__chain__)}function $V(){this.__values__===n&&(this.__values__=Z5(this.value()));var f=this.__index__>=this.__values__.length,g=f?n:this.__values__[this.__index__++];return{done:f,value:g}}function OV(){return this}function TV(f){for(var g,w=this;w instanceof tg;){var P=A5(w);P.__index__=0,P.__values__=n,g?N.__wrapped__=P:g=P;var N=P;w=w.__wrapped__}return N.__wrapped__=f,g}function DV(){var f=this.__wrapped__;if(f instanceof Lt){var g=f;return this.__actions__.length&&(g=new Lt(this)),g=g.reverse(),g.__actions__.push({func:mg,args:[My],thisArg:n}),new Fo(g,this.__chain__)}return this.thru(My)}function AV(){return t5(this.__wrapped__,this.__actions__)}var MV=lg(function(f,g,w){an.call(f,w)?++f[w]:da(f,w,1)});function kV(f,g,w){var P=ht(f)?pR:Cz;return w&&$r(f,g,w)&&(g=n),P(f,Je(g,3))}function IV(f,g){var w=ht(f)?Ja:FR;return w(f,Je(g,3))}var NV=f5(M5),LV=f5(k5);function FV(f,g){return ar(bg(f,g),1)}function jV(f,g){return ar(bg(f,g),V)}function zV(f,g,w){return w=w===n?1:bt(w),ar(bg(f,g),w)}function z5(f,g){var w=ht(f)?No:ns;return w(f,Je(g,3))}function B5(f,g){var w=ht(f)?ij:LR;return w(f,Je(g,3))}var BV=lg(function(f,g,w){an.call(f,w)?f[w].push(g):da(f,w,[g])});function VV(f,g,w,P){f=Hr(f)?f:Wc(f),w=w&&!P?bt(w):0;var N=f.length;return w<0&&(w=Yn(N+w,0)),_g(f)?w<=N&&f.indexOf(g,w)>-1:!!N&&Ac(f,g,w)>-1}var HV=Pt(function(f,g,w){var P=-1,N=typeof g=="function",W=Hr(f)?ge(f.length):[];return ns(f,function(Q){W[++P]=N?ao(g,Q,w):jd(Q,g,w)}),W}),WV=lg(function(f,g,w){da(f,w,g)});function bg(f,g){var w=ht(f)?Pn:WR;return w(f,Je(g,3))}function UV(f,g,w,P){return f==null?[]:(ht(g)||(g=g==null?[]:[g]),w=P?n:w,ht(w)||(w=w==null?[]:[w]),YR(f,g,w))}var qV=lg(function(f,g,w){f[w?0:1].push(g)},function(){return[[],[]]});function GV(f,g,w){var P=ht(f)?qv:vR,N=arguments.length<3;return P(f,Je(g,4),w,N,ns)}function YV(f,g,w){var P=ht(f)?aj:vR,N=arguments.length<3;return P(f,Je(g,4),w,N,LR)}function KV(f,g){var w=ht(f)?Ja:FR;return w(f,xg(Je(g,3)))}function XV(f){var g=ht(f)?MR:Vz;return g(f)}function QV(f,g,w){(w?$r(f,g,w):g===n)?g=1:g=bt(g);var P=ht(f)?yz:Hz;return P(f,g)}function JV(f){var g=ht(f)?xz:Uz;return g(f)}function ZV(f){if(f==null)return 0;if(Hr(f))return _g(f)?kc(f):f.length;var g=br(f);return g==Ce||g==dt?f.size:dy(f).length}function eH(f,g,w){var P=ht(f)?Gv:qz;return w&&$r(f,g,w)&&(g=n),P(f,Je(g,3))}var tH=Pt(function(f,g){if(f==null)return[];var w=g.length;return w>1&&$r(f,g[0],g[1])?g=[]:w>2&&$r(g[0],g[1],g[2])&&(g=[g[0]]),YR(f,ar(g,1),[])}),vg=Ij||function(){return ir.Date.now()};function nH(f,g){if(typeof g!="function")throw new Lo(a);return f=bt(f),function(){if(--f<1)return g.apply(this,arguments)}}function V5(f,g,w){return g=w?n:g,g=f&&g==null?f.length:g,fa(f,T,n,n,n,n,g)}function H5(f,g){var w;if(typeof g!="function")throw new Lo(a);return f=bt(f),function(){return--f>0&&(w=g.apply(this,arguments)),f<=1&&(g=n),w}}var Iy=Pt(function(f,g,w){var P=x;if(w.length){var N=es(w,Vc(Iy));P|=E}return fa(f,P,g,w,N)}),W5=Pt(function(f,g,w){var P=x|y;if(w.length){var N=es(w,Vc(W5));P|=E}return fa(g,P,f,w,N)});function U5(f,g,w){g=w?n:g;var P=fa(f,S,n,n,n,n,n,g);return P.placeholder=U5.placeholder,P}function q5(f,g,w){g=w?n:g;var P=fa(f,C,n,n,n,n,n,g);return P.placeholder=q5.placeholder,P}function G5(f,g,w){var P,N,W,Q,ee,se,_e=0,Se=!1,Pe=!1,je=!0;if(typeof f!="function")throw new Lo(a);g=Vo(g)||0,On(w)&&(Se=!!w.leading,Pe="maxWait"in w,W=Pe?Yn(Vo(w.maxWait)||0,g):W,je="trailing"in w?!!w.trailing:je);function Ye(Vn){var si=P,ba=N;return P=N=n,_e=Vn,Q=f.apply(ba,si),Q}function et(Vn){return _e=Vn,ee=Wd(At,g),Se?Ye(Vn):Q}function St(Vn){var si=Vn-se,ba=Vn-_e,fP=g-si;return Pe?mr(fP,W-ba):fP}function tt(Vn){var si=Vn-se,ba=Vn-_e;return se===n||si>=g||si<0||Pe&&ba>=W}function At(){var Vn=vg();if(tt(Vn))return Ft(Vn);ee=Wd(At,St(Vn))}function Ft(Vn){return ee=n,je&&P?Ye(Vn):(P=N=n,Q)}function uo(){ee!==n&&r5(ee),_e=0,P=se=N=ee=n}function Or(){return ee===n?Q:Ft(vg())}function fo(){var Vn=vg(),si=tt(Vn);if(P=arguments,N=this,se=Vn,si){if(ee===n)return et(se);if(Pe)return r5(ee),ee=Wd(At,g),Ye(se)}return ee===n&&(ee=Wd(At,g)),Q}return fo.cancel=uo,fo.flush=Or,fo}var rH=Pt(function(f,g){return NR(f,1,g)}),oH=Pt(function(f,g,w){return NR(f,Vo(g)||0,w)});function iH(f){return fa(f,M)}function yg(f,g){if(typeof f!="function"||g!=null&&typeof g!="function")throw new Lo(a);var w=function(){var P=arguments,N=g?g.apply(this,P):P[0],W=w.cache;if(W.has(N))return W.get(N);var Q=f.apply(this,P);return w.cache=W.set(N,Q)||W,Q};return w.cache=new(yg.Cache||ua),w}yg.Cache=ua;function xg(f){if(typeof f!="function")throw new Lo(a);return function(){var g=arguments;switch(g.length){case 0:return!f.call(this);case 1:return!f.call(this,g[0]);case 2:return!f.call(this,g[0],g[1]);case 3:return!f.call(this,g[0],g[1],g[2])}return!f.apply(this,g)}}function aH(f){return H5(2,f)}var sH=Gz(function(f,g){g=g.length==1&&ht(g[0])?Pn(g[0],so(Je())):Pn(ar(g,1),so(Je()));var w=g.length;return Pt(function(P){for(var N=-1,W=mr(P.length,w);++N<W;)P[N]=g[N].call(this,P[N]);return ao(f,this,P)})}),Ny=Pt(function(f,g){var w=es(g,Vc(Ny));return fa(f,E,n,g,w)}),Y5=Pt(function(f,g){var w=es(g,Vc(Y5));return fa(f,$,n,g,w)}),lH=ha(function(f,g){return fa(f,D,n,n,n,g)});function cH(f,g){if(typeof f!="function")throw new Lo(a);return g=g===n?g:bt(g),Pt(f,g)}function uH(f,g){if(typeof f!="function")throw new Lo(a);return g=g==null?0:Yn(bt(g),0),Pt(function(w){var P=w[g],N=is(w,0,g);return P&&Za(N,P),ao(f,this,N)})}function dH(f,g,w){var P=!0,N=!0;if(typeof f!="function")throw new Lo(a);return On(w)&&(P="leading"in w?!!w.leading:P,N="trailing"in w?!!w.trailing:N),G5(f,g,{leading:P,maxWait:g,trailing:N})}function fH(f){return V5(f,1)}function hH(f,g){return Ny(xy(g),f)}function pH(){if(!arguments.length)return[];var f=arguments[0];return ht(f)?f:[f]}function gH(f){return jo(f,p)}function mH(f,g){return g=typeof g=="function"?g:n,jo(f,p,g)}function bH(f){return jo(f,d|p)}function vH(f,g){return g=typeof g=="function"?g:n,jo(f,d|p,g)}function yH(f,g){return g==null||IR(f,g,er(g))}function ai(f,g){return f===g||f!==f&&g!==g}var xH=fg(ly),wH=fg(function(f,g){return f>=g}),cl=BR(function(){return arguments}())?BR:function(f){return Mn(f)&&an.call(f,"callee")&&!PR.call(f,"callee")},ht=ge.isArray,_H=lR?so(lR):Tz;function Hr(f){return f!=null&&wg(f.length)&&!ga(f)}function Bn(f){return Mn(f)&&Hr(f)}function SH(f){return f===!0||f===!1||Mn(f)&&Pr(f)==ie}var as=Lj||Gy,CH=cR?so(cR):Dz;function EH(f){return Mn(f)&&f.nodeType===1&&!Ud(f)}function RH(f){if(f==null)return!0;if(Hr(f)&&(ht(f)||typeof f=="string"||typeof f.splice=="function"||as(f)||Hc(f)||cl(f)))return!f.length;var g=br(f);if(g==Ce||g==dt)return!f.size;if(Hd(f))return!dy(f).length;for(var w in f)if(an.call(f,w))return!1;return!0}function PH(f,g){return zd(f,g)}function $H(f,g,w){w=typeof w=="function"?w:n;var P=w?w(f,g):n;return P===n?zd(f,g,n,w):!!P}function Ly(f){if(!Mn(f))return!1;var g=Pr(f);return g==xe||g==le||typeof f.message=="string"&&typeof f.name=="string"&&!Ud(f)}function OH(f){return typeof f=="number"&&OR(f)}function ga(f){if(!On(f))return!1;var g=Pr(f);return g==Z||g==ve||g==he||g==Ie}function K5(f){return typeof f=="number"&&f==bt(f)}function wg(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=K}function On(f){var g=typeof f;return f!=null&&(g=="object"||g=="function")}function Mn(f){return f!=null&&typeof f=="object"}var X5=uR?so(uR):Mz;function TH(f,g){return f===g||uy(f,g,Py(g))}function DH(f,g,w){return w=typeof w=="function"?w:n,uy(f,g,Py(g),w)}function AH(f){return Q5(f)&&f!=+f}function MH(f){if(mB(f))throw new ft(i);return VR(f)}function kH(f){return f===null}function IH(f){return f==null}function Q5(f){return typeof f=="number"||Mn(f)&&Pr(f)==Oe}function Ud(f){if(!Mn(f)||Pr(f)!=We)return!1;var g=Yp(f);if(g===null)return!0;var w=an.call(g,"constructor")&&g.constructor;return typeof w=="function"&&w instanceof w&&Wp.call(w)==Dj}var Fy=dR?so(dR):kz;function NH(f){return K5(f)&&f>=-K&&f<=K}var J5=fR?so(fR):Iz;function _g(f){return typeof f=="string"||!ht(f)&&Mn(f)&&Pr(f)==Bt}function co(f){return typeof f=="symbol"||Mn(f)&&Pr(f)==It}var Hc=hR?so(hR):Nz;function LH(f){return f===n}function FH(f){return Mn(f)&&br(f)==pe}function jH(f){return Mn(f)&&Pr(f)==Re}var zH=fg(fy),BH=fg(function(f,g){return f<=g});function Z5(f){if(!f)return[];if(Hr(f))return _g(f)?oi(f):Vr(f);if(Ad&&f[Ad])return yj(f[Ad]());var g=br(f),w=g==Ce?Zv:g==dt?Bp:Wc;return w(f)}function ma(f){if(!f)return f===0?f:0;if(f=Vo(f),f===V||f===-V){var g=f<0?-1:1;return g*q}return f===f?f:0}function bt(f){var g=ma(f),w=g%1;return g===g?w?g-w:g:0}function eP(f){return f?il(bt(f),0,H):0}function Vo(f){if(typeof f=="number")return f;if(co(f))return O;if(On(f)){var g=typeof f.valueOf=="function"?f.valueOf():f;f=On(g)?g+"":g}if(typeof f!="string")return f===0?f:+f;f=yR(f);var w=Fe.test(f);return w||J.test(f)?nj(f.slice(2),w?2:8):ze.test(f)?O:+f}function tP(f){return $i(f,Wr(f))}function VH(f){return f?il(bt(f),-K,K):f===0?f:0}function Zt(f){return f==null?"":lo(f)}var HH=zc(function(f,g){if(Hd(g)||Hr(g)){$i(g,er(g),f);return}for(var w in g)an.call(g,w)&&Ld(f,w,g[w])}),nP=zc(function(f,g){$i(g,Wr(g),f)}),Sg=zc(function(f,g,w,P){$i(g,Wr(g),f,P)}),WH=zc(function(f,g,w,P){$i(g,er(g),f,P)}),UH=ha(iy);function qH(f,g){var w=jc(f);return g==null?w:kR(w,g)}var GH=Pt(function(f,g){f=fn(f);var w=-1,P=g.length,N=P>2?g[2]:n;for(N&&$r(g[0],g[1],N)&&(P=1);++w<P;)for(var W=g[w],Q=Wr(W),ee=-1,se=Q.length;++ee<se;){var _e=Q[ee],Se=f[_e];(Se===n||ai(Se,Nc[_e])&&!an.call(f,_e))&&(f[_e]=W[_e])}return f}),YH=Pt(function(f){return f.push(n,y5),ao(rP,n,f)});function KH(f,g){return gR(f,Je(g,3),Pi)}function XH(f,g){return gR(f,Je(g,3),sy)}function QH(f,g){return f==null?f:ay(f,Je(g,3),Wr)}function JH(f,g){return f==null?f:jR(f,Je(g,3),Wr)}function ZH(f,g){return f&&Pi(f,Je(g,3))}function eW(f,g){return f&&sy(f,Je(g,3))}function tW(f){return f==null?[]:og(f,er(f))}function nW(f){return f==null?[]:og(f,Wr(f))}function jy(f,g,w){var P=f==null?n:al(f,g);return P===n?w:P}function rW(f,g){return f!=null&&_5(f,g,Rz)}function zy(f,g){return f!=null&&_5(f,g,Pz)}var oW=p5(function(f,g,w){g!=null&&typeof g.toString!="function"&&(g=Up.call(g)),f[g]=w},Vy(Ur)),iW=p5(function(f,g,w){g!=null&&typeof g.toString!="function"&&(g=Up.call(g)),an.call(f,g)?f[g].push(w):f[g]=[w]},Je),aW=Pt(jd);function er(f){return Hr(f)?AR(f):dy(f)}function Wr(f){return Hr(f)?AR(f,!0):Lz(f)}function sW(f,g){var w={};return g=Je(g,3),Pi(f,function(P,N,W){da(w,g(P,N,W),P)}),w}function lW(f,g){var w={};return g=Je(g,3),Pi(f,function(P,N,W){da(w,N,g(P,N,W))}),w}var cW=zc(function(f,g,w){ig(f,g,w)}),rP=zc(function(f,g,w,P){ig(f,g,w,P)}),uW=ha(function(f,g){var w={};if(f==null)return w;var P=!1;g=Pn(g,function(W){return W=os(W,f),P||(P=W.length>1),W}),$i(f,Ey(f),w),P&&(w=jo(w,d|h|p,oB));for(var N=g.length;N--;)by(w,g[N]);return w});function dW(f,g){return oP(f,xg(Je(g)))}var fW=ha(function(f,g){return f==null?{}:jz(f,g)});function oP(f,g){if(f==null)return{};var w=Pn(Ey(f),function(P){return[P]});return g=Je(g),KR(f,w,function(P,N){return g(P,N[0])})}function hW(f,g,w){g=os(g,f);var P=-1,N=g.length;for(N||(N=1,f=n);++P<N;){var W=f==null?n:f[Oi(g[P])];W===n&&(P=N,W=w),f=ga(W)?W.call(f):W}return f}function pW(f,g,w){return f==null?f:Bd(f,g,w)}function gW(f,g,w,P){return P=typeof P=="function"?P:n,f==null?f:Bd(f,g,w,P)}var iP=b5(er),aP=b5(Wr);function mW(f,g,w){var P=ht(f),N=P||as(f)||Hc(f);if(g=Je(g,4),w==null){var W=f&&f.constructor;N?w=P?new W:[]:On(f)?w=ga(W)?jc(Yp(f)):{}:w={}}return(N?No:Pi)(f,function(Q,ee,se){return g(w,Q,ee,se)}),w}function bW(f,g){return f==null?!0:by(f,g)}function vW(f,g,w){return f==null?f:e5(f,g,xy(w))}function yW(f,g,w,P){return P=typeof P=="function"?P:n,f==null?f:e5(f,g,xy(w),P)}function Wc(f){return f==null?[]:Jv(f,er(f))}function xW(f){return f==null?[]:Jv(f,Wr(f))}function wW(f,g,w){return w===n&&(w=g,g=n),w!==n&&(w=Vo(w),w=w===w?w:0),g!==n&&(g=Vo(g),g=g===g?g:0),il(Vo(f),g,w)}function _W(f,g,w){return g=ma(g),w===n?(w=g,g=0):w=ma(w),f=Vo(f),$z(f,g,w)}function SW(f,g,w){if(w&&typeof w!="boolean"&&$r(f,g,w)&&(g=w=n),w===n&&(typeof g=="boolean"?(w=g,g=n):typeof f=="boolean"&&(w=f,f=n)),f===n&&g===n?(f=0,g=1):(f=ma(f),g===n?(g=f,f=0):g=ma(g)),f>g){var P=f;f=g,g=P}if(w||f%1||g%1){var N=TR();return mr(f+N*(g-f+tj("1e-"+((N+"").length-1))),g)}return py(f,g)}var CW=Bc(function(f,g,w){return g=g.toLowerCase(),f+(w?sP(g):g)});function sP(f){return By(Zt(f).toLowerCase())}function lP(f){return f=Zt(f),f&&f.replace(Me,pj).replace(UF,"")}function EW(f,g,w){f=Zt(f),g=lo(g);var P=f.length;w=w===n?P:il(bt(w),0,P);var N=w;return w-=g.length,w>=0&&f.slice(w,N)==g}function RW(f){return f=Zt(f),f&&ni.test(f)?f.replace(_t,gj):f}function PW(f){return f=Zt(f),f&&la.test(f)?f.replace(Ei,"\\$&"):f}var $W=Bc(function(f,g,w){return f+(w?"-":"")+g.toLowerCase()}),OW=Bc(function(f,g,w){return f+(w?" ":"")+g.toLowerCase()}),TW=d5("toLowerCase");function DW(f,g,w){f=Zt(f),g=bt(g);var P=g?kc(f):0;if(!g||P>=g)return f;var N=(g-P)/2;return dg(Jp(N),w)+f+dg(Qp(N),w)}function AW(f,g,w){f=Zt(f),g=bt(g);var P=g?kc(f):0;return g&&P<g?f+dg(g-P,w):f}function MW(f,g,w){f=Zt(f),g=bt(g);var P=g?kc(f):0;return g&&P<g?dg(g-P,w)+f:f}function kW(f,g,w){return w||g==null?g=0:g&&(g=+g),Bj(Zt(f).replace(Jn,""),g||0)}function IW(f,g,w){return(w?$r(f,g,w):g===n)?g=1:g=bt(g),gy(Zt(f),g)}function NW(){var f=arguments,g=Zt(f[0]);return f.length<3?g:g.replace(f[1],f[2])}var LW=Bc(function(f,g,w){return f+(w?"_":"")+g.toLowerCase()});function FW(f,g,w){return w&&typeof w!="number"&&$r(f,g,w)&&(g=w=n),w=w===n?H:w>>>0,w?(f=Zt(f),f&&(typeof g=="string"||g!=null&&!Fy(g))&&(g=lo(g),!g&&Mc(f))?is(oi(f),0,w):f.split(g,w)):[]}var jW=Bc(function(f,g,w){return f+(w?" ":"")+By(g)});function zW(f,g,w){return f=Zt(f),w=w==null?0:il(bt(w),0,f.length),g=lo(g),f.slice(w,w+g.length)==g}function BW(f,g,w){var P=B.templateSettings;w&&$r(f,g,w)&&(g=n),f=Zt(f),g=Sg({},g,P,v5);var N=Sg({},g.imports,P.imports,v5),W=er(N),Q=Jv(N,W),ee,se,_e=0,Se=g.interpolate||lt,Pe="__p += '",je=ey((g.escape||lt).source+"|"+Se.source+"|"+(Se===aa?Ve:lt).source+"|"+(g.evaluate||lt).source+"|$","g"),Ye="//# sourceURL="+(an.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++XF+"]")+`
72
+ `;f.replace(je,function(tt,At,Ft,uo,Or,fo){return Ft||(Ft=uo),Pe+=f.slice(_e,fo).replace(Rn,mj),At&&(ee=!0,Pe+=`' +
73
+ __e(`+At+`) +
74
+ '`),Or&&(se=!0,Pe+=`';
75
+ `+Or+`;
76
+ __p += '`),Ft&&(Pe+=`' +
77
+ ((__t = (`+Ft+`)) == null ? '' : __t) +
78
+ '`),_e=fo+tt.length,tt}),Pe+=`';
79
+ `;var et=an.call(g,"variable")&&g.variable;if(!et)Pe=`with (obj) {
80
+ `+Pe+`
81
+ }
82
+ `;else if(fe.test(et))throw new ft(s);Pe=(se?Pe.replace(rt,""):Pe).replace(mt,"$1").replace(Nt,"$1;"),Pe="function("+(et||"obj")+`) {
83
+ `+(et?"":`obj || (obj = {});
84
+ `)+"var __t, __p = ''"+(ee?", __e = _.escape":"")+(se?`, __j = Array.prototype.join;
85
+ function print() { __p += __j.call(arguments, '') }
86
+ `:`;
87
+ `)+Pe+`return __p
88
+ }`;var St=uP(function(){return qt(W,Ye+"return "+Pe).apply(n,Q)});if(St.source=Pe,Ly(St))throw St;return St}function VW(f){return Zt(f).toLowerCase()}function HW(f){return Zt(f).toUpperCase()}function WW(f,g,w){if(f=Zt(f),f&&(w||g===n))return yR(f);if(!f||!(g=lo(g)))return f;var P=oi(f),N=oi(g),W=xR(P,N),Q=wR(P,N)+1;return is(P,W,Q).join("")}function UW(f,g,w){if(f=Zt(f),f&&(w||g===n))return f.slice(0,SR(f)+1);if(!f||!(g=lo(g)))return f;var P=oi(f),N=wR(P,oi(g))+1;return is(P,0,N).join("")}function qW(f,g,w){if(f=Zt(f),f&&(w||g===n))return f.replace(Jn,"");if(!f||!(g=lo(g)))return f;var P=oi(f),N=xR(P,oi(g));return is(P,N).join("")}function GW(f,g){var w=L,P=F;if(On(g)){var N="separator"in g?g.separator:N;w="length"in g?bt(g.length):w,P="omission"in g?lo(g.omission):P}f=Zt(f);var W=f.length;if(Mc(f)){var Q=oi(f);W=Q.length}if(w>=W)return f;var ee=w-kc(P);if(ee<1)return P;var se=Q?is(Q,0,ee).join(""):f.slice(0,ee);if(N===n)return se+P;if(Q&&(ee+=se.length-ee),Fy(N)){if(f.slice(ee).search(N)){var _e,Se=se;for(N.global||(N=ey(N.source,Zt(qe.exec(N))+"g")),N.lastIndex=0;_e=N.exec(Se);)var Pe=_e.index;se=se.slice(0,Pe===n?ee:Pe)}}else if(f.indexOf(lo(N),ee)!=ee){var je=se.lastIndexOf(N);je>-1&&(se=se.slice(0,je))}return se+P}function YW(f){return f=Zt(f),f&&zn.test(f)?f.replace(on,Sj):f}var KW=Bc(function(f,g,w){return f+(w?" ":"")+g.toUpperCase()}),By=d5("toUpperCase");function cP(f,g,w){return f=Zt(f),g=w?n:g,g===n?vj(f)?Rj(f):cj(f):f.match(g)||[]}var uP=Pt(function(f,g){try{return ao(f,n,g)}catch(w){return Ly(w)?w:new ft(w)}}),XW=ha(function(f,g){return No(g,function(w){w=Oi(w),da(f,w,Iy(f[w],f))}),f});function QW(f){var g=f==null?0:f.length,w=Je();return f=g?Pn(f,function(P){if(typeof P[1]!="function")throw new Lo(a);return[w(P[0]),P[1]]}):[],Pt(function(P){for(var N=-1;++N<g;){var W=f[N];if(ao(W[0],this,P))return ao(W[1],this,P)}})}function JW(f){return Sz(jo(f,d))}function Vy(f){return function(){return f}}function ZW(f,g){return f==null||f!==f?g:f}var eU=h5(),tU=h5(!0);function Ur(f){return f}function Hy(f){return HR(typeof f=="function"?f:jo(f,d))}function nU(f){return UR(jo(f,d))}function rU(f,g){return qR(f,jo(g,d))}var oU=Pt(function(f,g){return function(w){return jd(w,f,g)}}),iU=Pt(function(f,g){return function(w){return jd(f,w,g)}});function Wy(f,g,w){var P=er(g),N=og(g,P);w==null&&!(On(g)&&(N.length||!P.length))&&(w=g,g=f,f=this,N=og(g,er(g)));var W=!(On(w)&&"chain"in w)||!!w.chain,Q=ga(f);return No(N,function(ee){var se=g[ee];f[ee]=se,Q&&(f.prototype[ee]=function(){var _e=this.__chain__;if(W||_e){var Se=f(this.__wrapped__),Pe=Se.__actions__=Vr(this.__actions__);return Pe.push({func:se,args:arguments,thisArg:f}),Se.__chain__=_e,Se}return se.apply(f,Za([this.value()],arguments))})}),f}function aU(){return ir._===this&&(ir._=Aj),this}function Uy(){}function sU(f){return f=bt(f),Pt(function(g){return GR(g,f)})}var lU=_y(Pn),cU=_y(pR),uU=_y(Gv);function dP(f){return Oy(f)?Yv(Oi(f)):zz(f)}function dU(f){return function(g){return f==null?n:al(f,g)}}var fU=g5(),hU=g5(!0);function qy(){return[]}function Gy(){return!1}function pU(){return{}}function gU(){return""}function mU(){return!0}function bU(f,g){if(f=bt(f),f<1||f>K)return[];var w=H,P=mr(f,H);g=Je(g),f-=H;for(var N=Qv(P,g);++w<f;)g(w);return N}function vU(f){return ht(f)?Pn(f,Oi):co(f)?[f]:Vr(D5(Zt(f)))}function yU(f){var g=++Tj;return Zt(f)+g}var xU=ug(function(f,g){return f+g},0),wU=Sy("ceil"),_U=ug(function(f,g){return f/g},1),SU=Sy("floor");function CU(f){return f&&f.length?rg(f,Ur,ly):n}function EU(f,g){return f&&f.length?rg(f,Je(g,2),ly):n}function RU(f){return bR(f,Ur)}function PU(f,g){return bR(f,Je(g,2))}function $U(f){return f&&f.length?rg(f,Ur,fy):n}function OU(f,g){return f&&f.length?rg(f,Je(g,2),fy):n}var TU=ug(function(f,g){return f*g},1),DU=Sy("round"),AU=ug(function(f,g){return f-g},0);function MU(f){return f&&f.length?Xv(f,Ur):0}function kU(f,g){return f&&f.length?Xv(f,Je(g,2)):0}return B.after=nH,B.ary=V5,B.assign=HH,B.assignIn=nP,B.assignInWith=Sg,B.assignWith=WH,B.at=UH,B.before=H5,B.bind=Iy,B.bindAll=XW,B.bindKey=W5,B.castArray=pH,B.chain=j5,B.chunk=SB,B.compact=CB,B.concat=EB,B.cond=QW,B.conforms=JW,B.constant=Vy,B.countBy=MV,B.create=qH,B.curry=U5,B.curryRight=q5,B.debounce=G5,B.defaults=GH,B.defaultsDeep=YH,B.defer=rH,B.delay=oH,B.difference=RB,B.differenceBy=PB,B.differenceWith=$B,B.drop=OB,B.dropRight=TB,B.dropRightWhile=DB,B.dropWhile=AB,B.fill=MB,B.filter=IV,B.flatMap=FV,B.flatMapDeep=jV,B.flatMapDepth=zV,B.flatten=I5,B.flattenDeep=kB,B.flattenDepth=IB,B.flip=iH,B.flow=eU,B.flowRight=tU,B.fromPairs=NB,B.functions=tW,B.functionsIn=nW,B.groupBy=BV,B.initial=FB,B.intersection=jB,B.intersectionBy=zB,B.intersectionWith=BB,B.invert=oW,B.invertBy=iW,B.invokeMap=HV,B.iteratee=Hy,B.keyBy=WV,B.keys=er,B.keysIn=Wr,B.map=bg,B.mapKeys=sW,B.mapValues=lW,B.matches=nU,B.matchesProperty=rU,B.memoize=yg,B.merge=cW,B.mergeWith=rP,B.method=oU,B.methodOf=iU,B.mixin=Wy,B.negate=xg,B.nthArg=sU,B.omit=uW,B.omitBy=dW,B.once=aH,B.orderBy=UV,B.over=lU,B.overArgs=sH,B.overEvery=cU,B.overSome=uU,B.partial=Ny,B.partialRight=Y5,B.partition=qV,B.pick=fW,B.pickBy=oP,B.property=dP,B.propertyOf=dU,B.pull=UB,B.pullAll=L5,B.pullAllBy=qB,B.pullAllWith=GB,B.pullAt=YB,B.range=fU,B.rangeRight=hU,B.rearg=lH,B.reject=KV,B.remove=KB,B.rest=cH,B.reverse=My,B.sampleSize=QV,B.set=pW,B.setWith=gW,B.shuffle=JV,B.slice=XB,B.sortBy=tH,B.sortedUniq=rV,B.sortedUniqBy=oV,B.split=FW,B.spread=uH,B.tail=iV,B.take=aV,B.takeRight=sV,B.takeRightWhile=lV,B.takeWhile=cV,B.tap=CV,B.throttle=dH,B.thru=mg,B.toArray=Z5,B.toPairs=iP,B.toPairsIn=aP,B.toPath=vU,B.toPlainObject=tP,B.transform=mW,B.unary=fH,B.union=uV,B.unionBy=dV,B.unionWith=fV,B.uniq=hV,B.uniqBy=pV,B.uniqWith=gV,B.unset=bW,B.unzip=ky,B.unzipWith=F5,B.update=vW,B.updateWith=yW,B.values=Wc,B.valuesIn=xW,B.without=mV,B.words=cP,B.wrap=hH,B.xor=bV,B.xorBy=vV,B.xorWith=yV,B.zip=xV,B.zipObject=wV,B.zipObjectDeep=_V,B.zipWith=SV,B.entries=iP,B.entriesIn=aP,B.extend=nP,B.extendWith=Sg,Wy(B,B),B.add=xU,B.attempt=uP,B.camelCase=CW,B.capitalize=sP,B.ceil=wU,B.clamp=wW,B.clone=gH,B.cloneDeep=bH,B.cloneDeepWith=vH,B.cloneWith=mH,B.conformsTo=yH,B.deburr=lP,B.defaultTo=ZW,B.divide=_U,B.endsWith=EW,B.eq=ai,B.escape=RW,B.escapeRegExp=PW,B.every=kV,B.find=NV,B.findIndex=M5,B.findKey=KH,B.findLast=LV,B.findLastIndex=k5,B.findLastKey=XH,B.floor=SU,B.forEach=z5,B.forEachRight=B5,B.forIn=QH,B.forInRight=JH,B.forOwn=ZH,B.forOwnRight=eW,B.get=jy,B.gt=xH,B.gte=wH,B.has=rW,B.hasIn=zy,B.head=N5,B.identity=Ur,B.includes=VV,B.indexOf=LB,B.inRange=_W,B.invoke=aW,B.isArguments=cl,B.isArray=ht,B.isArrayBuffer=_H,B.isArrayLike=Hr,B.isArrayLikeObject=Bn,B.isBoolean=SH,B.isBuffer=as,B.isDate=CH,B.isElement=EH,B.isEmpty=RH,B.isEqual=PH,B.isEqualWith=$H,B.isError=Ly,B.isFinite=OH,B.isFunction=ga,B.isInteger=K5,B.isLength=wg,B.isMap=X5,B.isMatch=TH,B.isMatchWith=DH,B.isNaN=AH,B.isNative=MH,B.isNil=IH,B.isNull=kH,B.isNumber=Q5,B.isObject=On,B.isObjectLike=Mn,B.isPlainObject=Ud,B.isRegExp=Fy,B.isSafeInteger=NH,B.isSet=J5,B.isString=_g,B.isSymbol=co,B.isTypedArray=Hc,B.isUndefined=LH,B.isWeakMap=FH,B.isWeakSet=jH,B.join=VB,B.kebabCase=$W,B.last=Bo,B.lastIndexOf=HB,B.lowerCase=OW,B.lowerFirst=TW,B.lt=zH,B.lte=BH,B.max=CU,B.maxBy=EU,B.mean=RU,B.meanBy=PU,B.min=$U,B.minBy=OU,B.stubArray=qy,B.stubFalse=Gy,B.stubObject=pU,B.stubString=gU,B.stubTrue=mU,B.multiply=TU,B.nth=WB,B.noConflict=aU,B.noop=Uy,B.now=vg,B.pad=DW,B.padEnd=AW,B.padStart=MW,B.parseInt=kW,B.random=SW,B.reduce=GV,B.reduceRight=YV,B.repeat=IW,B.replace=NW,B.result=hW,B.round=DU,B.runInContext=ae,B.sample=XV,B.size=ZV,B.snakeCase=LW,B.some=eH,B.sortedIndex=QB,B.sortedIndexBy=JB,B.sortedIndexOf=ZB,B.sortedLastIndex=eV,B.sortedLastIndexBy=tV,B.sortedLastIndexOf=nV,B.startCase=jW,B.startsWith=zW,B.subtract=AU,B.sum=MU,B.sumBy=kU,B.template=BW,B.times=bU,B.toFinite=ma,B.toInteger=bt,B.toLength=eP,B.toLower=VW,B.toNumber=Vo,B.toSafeInteger=VH,B.toString=Zt,B.toUpper=HW,B.trim=WW,B.trimEnd=UW,B.trimStart=qW,B.truncate=GW,B.unescape=YW,B.uniqueId=yU,B.upperCase=KW,B.upperFirst=By,B.each=z5,B.eachRight=B5,B.first=N5,Wy(B,function(){var f={};return Pi(B,function(g,w){an.call(B.prototype,w)||(f[w]=g)}),f}(),{chain:!1}),B.VERSION=r,No(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){B[f].placeholder=B}),No(["drop","take"],function(f,g){Lt.prototype[f]=function(w){w=w===n?1:Yn(bt(w),0);var P=this.__filtered__&&!g?new Lt(this):this.clone();return P.__filtered__?P.__takeCount__=mr(w,P.__takeCount__):P.__views__.push({size:mr(w,H),type:f+(P.__dir__<0?"Right":"")}),P},Lt.prototype[f+"Right"]=function(w){return this.reverse()[f](w).reverse()}}),No(["filter","map","takeWhile"],function(f,g){var w=g+1,P=w==G||w==U;Lt.prototype[f]=function(N){var W=this.clone();return W.__iteratees__.push({iteratee:Je(N,3),type:w}),W.__filtered__=W.__filtered__||P,W}}),No(["head","last"],function(f,g){var w="take"+(g?"Right":"");Lt.prototype[f]=function(){return this[w](1).value()[0]}}),No(["initial","tail"],function(f,g){var w="drop"+(g?"":"Right");Lt.prototype[f]=function(){return this.__filtered__?new Lt(this):this[w](1)}}),Lt.prototype.compact=function(){return this.filter(Ur)},Lt.prototype.find=function(f){return this.filter(f).head()},Lt.prototype.findLast=function(f){return this.reverse().find(f)},Lt.prototype.invokeMap=Pt(function(f,g){return typeof f=="function"?new Lt(this):this.map(function(w){return jd(w,f,g)})}),Lt.prototype.reject=function(f){return this.filter(xg(Je(f)))},Lt.prototype.slice=function(f,g){f=bt(f);var w=this;return w.__filtered__&&(f>0||g<0)?new Lt(w):(f<0?w=w.takeRight(-f):f&&(w=w.drop(f)),g!==n&&(g=bt(g),w=g<0?w.dropRight(-g):w.take(g-f)),w)},Lt.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},Lt.prototype.toArray=function(){return this.take(H)},Pi(Lt.prototype,function(f,g){var w=/^(?:filter|find|map|reject)|While$/.test(g),P=/^(?:head|last)$/.test(g),N=B[P?"take"+(g=="last"?"Right":""):g],W=P||/^find/.test(g);N&&(B.prototype[g]=function(){var Q=this.__wrapped__,ee=P?[1]:arguments,se=Q instanceof Lt,_e=ee[0],Se=se||ht(Q),Pe=function(At){var Ft=N.apply(B,Za([At],ee));return P&&je?Ft[0]:Ft};Se&&w&&typeof _e=="function"&&_e.length!=1&&(se=Se=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=W&&!je,St=se&&!Ye;if(!W&&Se){Q=St?Q:new Lt(this);var tt=f.apply(Q,ee);return tt.__actions__.push({func:mg,args:[Pe],thisArg:n}),new Fo(tt,je)}return et&&St?f.apply(this,ee):(tt=this.thru(Pe),et?P?tt.value()[0]:tt.value():tt)})}),No(["pop","push","shift","sort","splice","unshift"],function(f){var g=Vp[f],w=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",P=/^(?:pop|shift)$/.test(f);B.prototype[f]=function(){var N=arguments;if(P&&!this.__chain__){var W=this.value();return g.apply(ht(W)?W:[],N)}return this[w](function(Q){return g.apply(ht(Q)?Q:[],N)})}}),Pi(Lt.prototype,function(f,g){var w=B[g];if(w){var P=w.name+"";an.call(Fc,P)||(Fc[P]=[]),Fc[P].push({name:g,func:w})}}),Fc[cg(n,y).name]=[{name:"wrapper",func:n}],Lt.prototype.clone=Yj,Lt.prototype.reverse=Kj,Lt.prototype.value=Xj,B.prototype.at=EV,B.prototype.chain=RV,B.prototype.commit=PV,B.prototype.next=$V,B.prototype.plant=TV,B.prototype.reverse=DV,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=AV,B.prototype.first=B.prototype.head,Ad&&(B.prototype[Ad]=OV),B},Ic=Pj();tl?((tl.exports=Ic)._=Ic,Hv._=Ic):ir._=Ic}).call(ys)})(u0,u0.exports);var xf=u0.exports;const Vl=mc(xf);function DP({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:a}){const s={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:a||10},l=t?{...t}:{};return OS.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,h)=>Math.max(d,h.y+h.h),0);s.y=s.y===1/0?u:s.y,l[c].push({...s})}),l}function AP(e,t){if(!t)return;const n={...t};return OS.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function AS(e){return we.getState().dashboard.globalCacheConfig}const we=DM()(FM((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:c0},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:c0},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,a,s,l,c,u,d,h;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(p=>p.id===n);if(o!==void 0&&o>-1){(a=r.dashboard.sheets)==null||a.splice(o,1);const p=(s=r.dashboard.filters)==null?void 0:s.filter(b=>b.sheetId===n),v=(l=r.filterValues)==null?void 0:l.filter(b=>p==null?void 0:p.some(x=>x.id===b.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(b=>!(v!=null&&v.some(x=>x.filterId===b.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(b=>b.sheetId!==n),r.selectedSheetId=(h=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:h.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(s=>{OS.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:s.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const a={...n,layouts:i};r.dashboard.sheets.push(a)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===o.selectedSheetId);i&&xf.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,a;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(s=>s.id===n);o!=null&&o>-1&&((a=r.dashboard.baseQueries)==null||a.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,a;const o=(i=r.filteringCards)==null?void 0:i.findIndex(s=>s.id===n.id);o!==void 0&&o>-1&&((a=r.filteringCards)==null||a.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var s,l;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(c=>c.id===n);a&&xf.forEach(a.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===o.selectedSheetId);i&&xf.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var s,l;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(c=>c.id===n);a&&xf.forEach(a.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var s,l,c,u;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(d=>d.id===n);if(a){const d=(c=a.cards)==null?void 0:c.find(h=>h.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},setSheetLayout:(n,r)=>{e(o=>{var a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var a,s,l;const i=(a=r==null?void 0:r.filterValues)==null?void 0:a.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(s=r.filterValues)==null||s.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,a;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(a=r.dashboard.sheets)==null||a.find(s=>s.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(s=>{DP({id:n.id,layouts:s.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,a;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(s>-1){(i=r.dashboard.filters)==null||i.splice(s,1),(a=r.dashboard.sheets)==null||a.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=AP(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,h;const a=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!a)return;const s=(u=a==null?void 0:a.frames)==null?void 0:u.find(p=>p.id===r);if(s){const p=(d=s.cards)==null?void 0:d.findIndex(v=>v.id===o.id);p>-1&&((h=s.cards)==null||h.splice(p,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(s=>s.id===n.id);a>-1&&((i=r.dashboard.filters)==null||i.splice(a,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var s,l,c,u;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(d=>d.id===n);if(a){a.frames||(a.frames=[]),(c=a.frames)==null||c.push(r);let d=1/0;const h=0;o==="start"&&(d=0);const p=DP({id:r.id,layouts:a.layouts,minH:10,x:h,y:d});a.layouts=p,(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var a,s,l,c,u;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),AP(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var s,l,c,u,d;const i=(l=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(h=>h.id===n),a=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.frames)==null||u.splice(a,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var s,l,c,u,d;const i=(l=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(h=>h.id===n),a=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(a,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var s,l,c,u,d,h;const i=(l=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(p=>p.id===n),a=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(a,1),(d=i.layout)==null||d.splice(a,1),(h=o.onRemoveCard)==null||h.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var a,s,l;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,a;((a=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:a.find(s=>s.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,a;((a=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:a.find(s=>s.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let a=0;a<r.length;a++){const s=r[a].frames;if(s){for(let l=0;l<s.length;l++)if((i=s[l].cards)==null?void 0:i.find(u=>u.id===n))return s[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(a=>a.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(a=>a.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let a=0;a<r.length;a++){const s=r[a].frames;if(s)for(let l=0;l<s.length;l++){const c=(i=s[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let a=0;a<r.length;a++){const s=r[a].frames;if(s){for(let l=0;l<s.length;l++)if((i=s[l].cards)==null?void 0:i.find(u=>u.id===n))return r[a]}}},handleDataPointClickAction:(n,r)=>{cG({card:n,dataPoint:r,set:e,get:t})}}}))),dr=()=>we(e=>e.actions),uG={theme:"system",setTheme:()=>null},UM=m.createContext(uG);function dG({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const s=window.document.documentElement;if(s.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";s.classList.add(l);return}s.classList.add(o)},[o]);const a={theme:o,setTheme:s=>{localStorage.setItem(n,s),i(s)}};return R.jsx(UM.Provider,{...r,value:a,children:e})}const qM=()=>{const e=m.useContext(UM);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var ip=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(){}},oc=typeof window>"u"||"Deno"in globalThis;function Uo(){}function fG(e,t){return typeof e=="function"?e(t):e}function cw(e){return typeof e=="number"&&e>=0&&e!==1/0}function GM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function yu(e,t){return typeof e=="function"?e(t):e}function hi(e,t){return typeof e=="function"?e(t):e}function MP(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==MS(a,t.options))return!1}else if(!ah(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||o&&o!==t.state.fetchStatus||i&&!i(t))}function kP(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ih(t.options.mutationKey)!==ih(i))return!1}else if(!ah(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function MS(e,t){return((t==null?void 0:t.queryKeyHashFn)||ih)(e)}function ih(e){return JSON.stringify(e,(t,n)=>fw(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ah(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ah(e[n],t[n])):!1}function uw(e,t){if(e===t)return e;const n=IP(e)&&IP(t);if(n||fw(e)&&fw(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),a=i.length,s=n?[]:{};let l=0;for(let c=0;c<a;c++){const u=n?c:i[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(s[u]=void 0,l++):(s[u]=uw(e[u],t[u]),s[u]===e[u]&&e[u]!==void 0&&l++)}return o===a&&l===o?e:s}return t}function dw(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function IP(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fw(e){if(!NP(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!NP(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function NP(e){return Object.prototype.toString.call(e)==="[object Object]"}function hG(e){return new Promise(t=>{setTimeout(t,e)})}function hw(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return uw(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return uw(e,t)}return t}function pG(e){return e}function gG(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function mG(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var d0=Symbol();function YM(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===d0&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===d0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var kl,ws,Du,pM,bG=(pM=class extends ip{constructor(){super();Xe(this,kl,void 0);Xe(this,ws,void 0);Xe(this,Du,void 0);Ue(this,Du,t=>{if(!oc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){oe(this,ws)||this.setEventListener(oe(this,Du))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,ws))==null||t.call(this),Ue(this,ws,void 0))}setEventListener(t){var n;Ue(this,Du,t),(n=oe(this,ws))==null||n.call(this),Ue(this,ws,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){oe(this,kl)!==t&&(Ue(this,kl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof oe(this,kl)=="boolean"?oe(this,kl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},kl=new WeakMap,ws=new WeakMap,Du=new WeakMap,pM),kS=new bG,Au,_s,Mu,gM,vG=(gM=class extends ip{constructor(){super();Xe(this,Au,!0);Xe(this,_s,void 0);Xe(this,Mu,void 0);Ue(this,Mu,t=>{if(!oc&&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(){oe(this,_s)||this.setEventListener(oe(this,Mu))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,_s))==null||t.call(this),Ue(this,_s,void 0))}setEventListener(t){var n;Ue(this,Mu,t),(n=oe(this,_s))==null||n.call(this),Ue(this,_s,t(this.setOnline.bind(this)))}setOnline(t){oe(this,Au)!==t&&(Ue(this,Au,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return oe(this,Au)}},Au=new WeakMap,_s=new WeakMap,Mu=new WeakMap,gM),f0=new vG;function pw(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function yG(e){return Math.min(1e3*2**e,3e4)}function KM(e){return(e??"online")==="online"?f0.isOnline():!0}var XM=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function n1(e){return e instanceof XM}function QM(e){let t=!1,n=0,r=!1,o;const i=pw(),a=b=>{var x;r||(h(new XM(b)),(x=e.abort)==null||x.call(e))},s=()=>{t=!0},l=()=>{t=!1},c=()=>kS.isFocused()&&(e.networkMode==="always"||f0.isOnline())&&e.canRun(),u=()=>KM(e.networkMode)&&e.canRun(),d=b=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,b),o==null||o(),i.resolve(b))},h=b=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,b),o==null||o(),i.reject(b))},p=()=>new Promise(b=>{var x;o=y=>{(r||c())&&b(y)},(x=e.onPause)==null||x.call(e)}).then(()=>{var b;o=void 0,r||(b=e.onContinue)==null||b.call(e)}),v=()=>{if(r)return;let b;const x=n===0?e.initialPromise:void 0;try{b=x??e.fn()}catch(y){b=Promise.reject(y)}Promise.resolve(b).then(d).catch(y=>{var $;if(r)return;const _=e.retry??(oc?0:3),S=e.retryDelay??yG,C=typeof S=="function"?S(n,y):S,E=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(t||!E){h(y);return}n++,($=e.onFail)==null||$.call(e,n,y),hG(C).then(()=>c()?void 0:p()).then(()=>{t?h(y):v()})})};return{promise:i,cancel:a,continue:()=>(o==null||o(),i),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?v():p().then(v),i)}}function xG(){let e=[],t=0,n=s=>{s()},r=s=>{s()},o=s=>setTimeout(s,0);const i=s=>{t?e.push(s):o(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&o(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{i(()=>{s(...l)})},schedule:i,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{o=s}}}var cr=xG(),Il,mM,JM=(mM=class{constructor(){Xe(this,Il,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cw(this.gcTime)&&Ue(this,Il,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(oc?1/0:5*60*1e3))}clearGcTimeout(){oe(this,Il)&&(clearTimeout(oe(this,Il)),Ue(this,Il,void 0))}},Il=new WeakMap,mM),ku,Iu,Wo,xr,Gh,Nl,di,wa,bM,wG=(bM=class extends JM{constructor(t){super();Xe(this,di);Xe(this,ku,void 0);Xe(this,Iu,void 0);Xe(this,Wo,void 0);Xe(this,xr,void 0);Xe(this,Gh,void 0);Xe(this,Nl,void 0);Ue(this,Nl,!1),Ue(this,Gh,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ue(this,Wo,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ue(this,ku,_G(this.options)),this.state=t.state??oe(this,ku),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=oe(this,xr))==null?void 0:t.promise}setOptions(t){this.options={...oe(this,Gh),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&oe(this,Wo).remove(this)}setData(t,n){const r=hw(this.state.data,t,this.options);return jt(this,di,wa).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){jt(this,di,wa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=oe(this,xr))==null?void 0:r.promise;return(o=oe(this,xr))==null||o.cancel(t),n?n.then(Uo).catch(Uo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(oe(this,ku))}isActive(){return this.observers.some(t=>hi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===d0||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!GM(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,xr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,xr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),oe(this,Wo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(oe(this,xr)&&(oe(this,Nl)?oe(this,xr).cancel({revert:!0}):oe(this,xr).cancelRetry()),this.scheduleGc()),oe(this,Wo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||jt(this,di,wa).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(oe(this,xr))return oe(this,xr).continueRetry(),oe(this,xr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(Ue(this,Nl,!0),r.signal)})},i=()=>{const d=YM(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return o(h),Ue(this,Nl,!1),this.options.persister?this.options.persister(d,h,this):d(h)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};o(a),(l=this.options.behavior)==null||l.onFetch(a,this),Ue(this,Iu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&jt(this,di,wa).call(this,{type:"fetch",meta:(u=a.fetchOptions)==null?void 0:u.meta});const s=d=>{var h,p,v,b;n1(d)&&d.silent||jt(this,di,wa).call(this,{type:"error",error:d}),n1(d)||((p=(h=oe(this,Wo).config).onError)==null||p.call(h,d,this),(b=(v=oe(this,Wo).config).onSettled)==null||b.call(v,this.state.data,d,this)),this.scheduleGc()};return Ue(this,xr,QM({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,p,v,b;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),s(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(x){s(x);return}(p=(h=oe(this,Wo).config).onSuccess)==null||p.call(h,d,this),(b=(v=oe(this,Wo).config).onSettled)==null||b.call(v,d,this.state.error,this),this.scheduleGc()},onError:s,onFail:(d,h)=>{jt(this,di,wa).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{jt(this,di,wa).call(this,{type:"pause"})},onContinue:()=>{jt(this,di,wa).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),oe(this,xr).start()}},ku=new WeakMap,Iu=new WeakMap,Wo=new WeakMap,xr=new WeakMap,Gh=new WeakMap,Nl=new WeakMap,di=new WeakSet,wa=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,...ZM(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return n1(o)&&o.revert&&oe(this,Iu)?{...oe(this,Iu),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),cr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),oe(this,Wo).notify({query:this,type:"updated",action:t})})},bM);function ZM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:KM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _G(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ii,vM,ek=(vM=class extends ip{constructor(t={}){super();Xe(this,Ii,void 0);this.config=t,Ue(this,Ii,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??MS(o,n);let a=this.get(i);return a||(a=new wG({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){oe(this,Ii).has(t.queryHash)||(oe(this,Ii).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=oe(this,Ii).get(t.queryHash);n&&(t.destroy(),n===t&&oe(this,Ii).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){cr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return oe(this,Ii).get(t)}getAll(){return[...oe(this,Ii).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>MP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>MP(t,r)):n}notify(t){cr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){cr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){cr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ii=new WeakMap,vM),Ni,Ar,Ll,Li,gs,yM,SG=(yM=class extends JM{constructor(t){super();Xe(this,Li);Xe(this,Ni,void 0);Xe(this,Ar,void 0);Xe(this,Ll,void 0);this.mutationId=t.mutationId,Ue(this,Ar,t.mutationCache),Ue(this,Ni,[]),this.state=t.state||CG(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){oe(this,Ni).includes(t)||(oe(this,Ni).push(t),this.clearGcTimeout(),oe(this,Ar).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ue(this,Ni,oe(this,Ni).filter(n=>n!==t)),this.scheduleGc(),oe(this,Ar).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){oe(this,Ni).length||(this.state.status==="pending"?this.scheduleGc():oe(this,Ar).remove(this))}continue(){var t;return((t=oe(this,Ll))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,a,s,l,c,u,d,h,p,v,b,x,y,_,S,C,E,$,T;Ue(this,Ll,QM({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(D,M)=>{jt(this,Li,gs).call(this,{type:"failed",failureCount:D,error:M})},onPause:()=>{jt(this,Li,gs).call(this,{type:"pause"})},onContinue:()=>{jt(this,Li,gs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>oe(this,Ar).canRun(this)}));const n=this.state.status==="pending",r=!oe(this,Ll).canStart();try{if(!n){jt(this,Li,gs).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=oe(this,Ar).config).onMutate)==null?void 0:i.call(o,t,this));const M=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));M!==this.state.context&&jt(this,Li,gs).call(this,{type:"pending",context:M,variables:t,isPaused:r})}const D=await oe(this,Ll).start();return await((c=(l=oe(this,Ar).config).onSuccess)==null?void 0:c.call(l,D,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,D,t,this.state.context)),await((p=(h=oe(this,Ar).config).onSettled)==null?void 0:p.call(h,D,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,D,null,t,this.state.context)),jt(this,Li,gs).call(this,{type:"success",data:D}),D}catch(D){try{throw await((y=(x=oe(this,Ar).config).onError)==null?void 0:y.call(x,D,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,D,t,this.state.context)),await((E=(C=oe(this,Ar).config).onSettled)==null?void 0:E.call(C,void 0,D,this.state.variables,this.state.context,this)),await((T=($=this.options).onSettled)==null?void 0:T.call($,void 0,D,t,this.state.context)),D}finally{jt(this,Li,gs).call(this,{type:"error",error:D})}}finally{oe(this,Ar).runNext(this)}}},Ni=new WeakMap,Ar=new WeakMap,Ll=new WeakMap,Li=new WeakSet,gs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),cr.batch(()=>{oe(this,Ni).forEach(r=>{r.onMutationUpdate(t)}),oe(this,Ar).notify({mutation:this,type:"updated",action:t})})},yM);function CG(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $a,fi,Yh,xM,EG=(xM=class extends ip{constructor(t={}){super();Xe(this,$a,void 0);Xe(this,fi,void 0);Xe(this,Yh,void 0);this.config=t,Ue(this,$a,new Set),Ue(this,fi,new Map),Ue(this,Yh,0)}build(t,n,r){const o=new SG({mutationCache:this,mutationId:++Cg(this,Yh)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){oe(this,$a).add(t);const n=$g(t);if(typeof n=="string"){const r=oe(this,fi).get(n);r?r.push(t):oe(this,fi).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(oe(this,$a).delete(t)){const n=$g(t);if(typeof n=="string"){const r=oe(this,fi).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&oe(this,fi).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=$g(t);if(typeof n=="string"){const r=oe(this,fi).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=$g(t);if(typeof n=="string"){const o=(r=oe(this,fi).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){cr.batch(()=>{oe(this,$a).forEach(t=>{this.notify({type:"removed",mutation:t})}),oe(this,$a).clear(),oe(this,fi).clear()})}getAll(){return Array.from(oe(this,$a))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>kP(n,r))}findAll(t={}){return this.getAll().filter(n=>kP(t,n))}notify(t){cr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return cr.batch(()=>Promise.all(t.map(n=>n.continue().catch(Uo))))}},$a=new WeakMap,fi=new WeakMap,Yh=new WeakMap,xM);function $g(e){var t;return(t=e.options.scope)==null?void 0:t.id}function LP(e){return{onFetch:(t,n)=>{var u,d,h,p,v;const r=t.options,o=(h=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],a=((v=t.state.data)==null?void 0:v.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let b=!1;const x=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},y=YM(t.options,t.fetchOptions),_=async(S,C,E)=>{if(b)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const $={queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};x($);const T=await y($),{maxPages:D}=t.options,M=E?mG:gG;return{pages:M(S.pages,T,D),pageParams:M(S.pageParams,C,D)}};if(o&&i.length){const S=o==="backward",C=S?RG:FP,E={pages:i,pageParams:a},$=C(r,E);s=await _(E,$,S)}else{const S=e??i.length;do{const C=l===0?a[0]??r.initialPageParam:FP(r,s);if(l>0&&C==null)break;s=await _(s,C),l++}while(l<S)}return s};t.options.persister?t.fetchFn=()=>{var b,x;return(x=(b=t.options).persister)==null?void 0:x.call(b,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function FP(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function RG(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var kn,Ss,Cs,Nu,Lu,Es,Fu,ju,wM,PG=(wM=class{constructor(e={}){Xe(this,kn,void 0);Xe(this,Ss,void 0);Xe(this,Cs,void 0);Xe(this,Nu,void 0);Xe(this,Lu,void 0);Xe(this,Es,void 0);Xe(this,Fu,void 0);Xe(this,ju,void 0);Ue(this,kn,e.queryCache||new ek),Ue(this,Ss,e.mutationCache||new EG),Ue(this,Cs,e.defaultOptions||{}),Ue(this,Nu,new Map),Ue(this,Lu,new Map),Ue(this,Es,0)}mount(){Cg(this,Es)._++,oe(this,Es)===1&&(Ue(this,Fu,kS.subscribe(async e=>{e&&(await this.resumePausedMutations(),oe(this,kn).onFocus())})),Ue(this,ju,f0.subscribe(async e=>{e&&(await this.resumePausedMutations(),oe(this,kn).onOnline())})))}unmount(){var e,t;Cg(this,Es)._--,oe(this,Es)===0&&((e=oe(this,Fu))==null||e.call(this),Ue(this,Fu,void 0),(t=oe(this,ju))==null||t.call(this),Ue(this,ju,void 0))}isFetching(e){return oe(this,kn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return oe(this,Ss).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=oe(this,kn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=oe(this,kn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(yu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return oe(this,kn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=oe(this,kn).get(r.queryHash),i=o==null?void 0:o.state.data,a=fG(t,i);if(a!==void 0)return oe(this,kn).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return cr.batch(()=>oe(this,kn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=oe(this,kn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=oe(this,kn);cr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=oe(this,kn),r={type:"active",...e};return cr.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=cr.batch(()=>oe(this,kn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Uo).catch(Uo)}invalidateQueries(e,t={}){return cr.batch(()=>{if(oe(this,kn).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=cr.batch(()=>oe(this,kn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Uo)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Uo)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=oe(this,kn).build(this,t);return n.isStaleByTime(yu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Uo).catch(Uo)}fetchInfiniteQuery(e){return e.behavior=LP(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Uo).catch(Uo)}ensureInfiniteQueryData(e){return e.behavior=LP(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f0.isOnline()?oe(this,Ss).resumePausedMutations():Promise.resolve()}getQueryCache(){return oe(this,kn)}getMutationCache(){return oe(this,Ss)}getDefaultOptions(){return oe(this,Cs)}setDefaultOptions(e){Ue(this,Cs,e)}setQueryDefaults(e,t){oe(this,Nu).set(ih(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...oe(this,Nu).values()],n={};return t.forEach(r=>{ah(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){oe(this,Lu).set(ih(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...oe(this,Lu).values()];let n={};return t.forEach(r=>{ah(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...oe(this,Cs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=MS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===d0&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...oe(this,Cs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){oe(this,kn).clear(),oe(this,Ss).clear()}},kn=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,Nu=new WeakMap,Lu=new WeakMap,Es=new WeakMap,Fu=new WeakMap,ju=new WeakMap,wM),Qr,zt,Kh,Mr,Fl,zu,Rs,Fi,Xh,Bu,Vu,jl,zl,Ps,Hu,Bl,wf,Qh,gw,Jh,mw,Zh,bw,ep,vw,tp,yw,np,xw,rp,ww,db,tk,_M,$G=(_M=class extends ip{constructor(t,n){super();Xe(this,Bl);Xe(this,Qh);Xe(this,Jh);Xe(this,Zh);Xe(this,ep);Xe(this,tp);Xe(this,np);Xe(this,rp);Xe(this,db);Xe(this,Qr,void 0);Xe(this,zt,void 0);Xe(this,Kh,void 0);Xe(this,Mr,void 0);Xe(this,Fl,void 0);Xe(this,zu,void 0);Xe(this,Rs,void 0);Xe(this,Fi,void 0);Xe(this,Xh,void 0);Xe(this,Bu,void 0);Xe(this,Vu,void 0);Xe(this,jl,void 0);Xe(this,zl,void 0);Xe(this,Ps,void 0);Xe(this,Hu,new Set);this.options=n,Ue(this,Qr,t),Ue(this,Fi,null),Ue(this,Rs,pw()),this.options.experimental_prefetchInRender||oe(this,Rs).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(oe(this,zt).addObserver(this),jP(oe(this,zt),this.options)?jt(this,Bl,wf).call(this):this.updateResult(),jt(this,ep,vw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _w(oe(this,zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _w(oe(this,zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,jt(this,tp,yw).call(this),jt(this,np,xw).call(this),oe(this,zt).removeObserver(this)}setOptions(t,n){const r=this.options,o=oe(this,zt);if(this.options=oe(this,Qr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hi(this.options.enabled,oe(this,zt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");jt(this,rp,ww).call(this),oe(this,zt).setOptions(this.options),r._defaulted&&!dw(this.options,r)&&oe(this,Qr).getQueryCache().notify({type:"observerOptionsUpdated",query:oe(this,zt),observer:this});const i=this.hasListeners();i&&zP(oe(this,zt),o,this.options,r)&&jt(this,Bl,wf).call(this),this.updateResult(n),i&&(oe(this,zt)!==o||hi(this.options.enabled,oe(this,zt))!==hi(r.enabled,oe(this,zt))||yu(this.options.staleTime,oe(this,zt))!==yu(r.staleTime,oe(this,zt)))&&jt(this,Qh,gw).call(this);const a=jt(this,Jh,mw).call(this);i&&(oe(this,zt)!==o||hi(this.options.enabled,oe(this,zt))!==hi(r.enabled,oe(this,zt))||a!==oe(this,Ps))&&jt(this,Zh,bw).call(this,a)}getOptimisticResult(t){const n=oe(this,Qr).getQueryCache().build(oe(this,Qr),t),r=this.createResult(n,t);return TG(this,r)&&(Ue(this,Mr,r),Ue(this,zu,this.options),Ue(this,Fl,oe(this,zt).state)),r}getCurrentResult(){return oe(this,Mr)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){oe(this,Hu).add(t)}getCurrentQuery(){return oe(this,zt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=oe(this,Qr).defaultQueryOptions(t),r=oe(this,Qr).getQueryCache().build(oe(this,Qr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return jt(this,Bl,wf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),oe(this,Mr)))}createResult(t,n){var D;const r=oe(this,zt),o=this.options,i=oe(this,Mr),a=oe(this,Fl),s=oe(this,zu),c=t!==r?t.state:oe(this,Kh),{state:u}=t;let d={...u},h=!1,p;if(n._optimisticResults){const M=this.hasListeners(),L=!M&&jP(t,n),F=M&&zP(t,r,n,o);(L||F)&&(d={...d,...ZM(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:v,errorUpdatedAt:b,status:x}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(a==null?void 0:a.data)&&n.select===oe(this,Xh))p=oe(this,Bu);else try{Ue(this,Xh,n.select),p=n.select(d.data),p=hw(i==null?void 0:i.data,p,n),Ue(this,Bu,p),Ue(this,Fi,null)}catch(M){Ue(this,Fi,M)}else p=d.data;if(n.placeholderData!==void 0&&p===void 0&&x==="pending"){let M;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData))M=i.data;else if(M=typeof n.placeholderData=="function"?n.placeholderData((D=oe(this,Vu))==null?void 0:D.state.data,oe(this,Vu)):n.placeholderData,n.select&&M!==void 0)try{M=n.select(M),Ue(this,Fi,null)}catch(L){Ue(this,Fi,L)}M!==void 0&&(x="success",p=hw(i==null?void 0:i.data,M,n),h=!0)}oe(this,Fi)&&(v=oe(this,Fi),p=oe(this,Bu),b=Date.now(),x="error");const y=d.fetchStatus==="fetching",_=x==="pending",S=x==="error",C=_&&y,E=p!==void 0,T={status:x,fetchStatus:d.fetchStatus,isPending:_,isSuccess:x==="success",isError:S,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:d.dataUpdatedAt,error:v,errorUpdatedAt:b,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:S&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&E,isStale:IS(t,n),refetch:this.refetch,promise:oe(this,Rs)};if(this.options.experimental_prefetchInRender){const M=z=>{T.status==="error"?z.reject(T.error):T.data!==void 0&&z.resolve(T.data)},L=()=>{const z=Ue(this,Rs,T.promise=pw());M(z)},F=oe(this,Rs);switch(F.status){case"pending":t.queryHash===r.queryHash&&M(F);break;case"fulfilled":(T.status==="error"||T.data!==F.value)&&L();break;case"rejected":(T.status!=="error"||T.error!==F.reason)&&L();break}}return T}updateResult(t){const n=oe(this,Mr),r=this.createResult(oe(this,zt),this.options);if(Ue(this,Fl,oe(this,zt).state),Ue(this,zu,this.options),oe(this,Fl).data!==void 0&&Ue(this,Vu,oe(this,zt)),dw(r,n))return;Ue(this,Mr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!oe(this,Hu).size)return!0;const l=new Set(s??oe(this,Hu));return this.options.throwOnError&&l.add("error"),Object.keys(oe(this,Mr)).some(c=>{const u=c;return oe(this,Mr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),jt(this,db,tk).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&jt(this,ep,vw).call(this)}},Qr=new WeakMap,zt=new WeakMap,Kh=new WeakMap,Mr=new WeakMap,Fl=new WeakMap,zu=new WeakMap,Rs=new WeakMap,Fi=new WeakMap,Xh=new WeakMap,Bu=new WeakMap,Vu=new WeakMap,jl=new WeakMap,zl=new WeakMap,Ps=new WeakMap,Hu=new WeakMap,Bl=new WeakSet,wf=function(t){jt(this,rp,ww).call(this);let n=oe(this,zt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Uo)),n},Qh=new WeakSet,gw=function(){jt(this,tp,yw).call(this);const t=yu(this.options.staleTime,oe(this,zt));if(oc||oe(this,Mr).isStale||!cw(t))return;const r=GM(oe(this,Mr).dataUpdatedAt,t)+1;Ue(this,jl,setTimeout(()=>{oe(this,Mr).isStale||this.updateResult()},r))},Jh=new WeakSet,mw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(oe(this,zt)):this.options.refetchInterval)??!1},Zh=new WeakSet,bw=function(t){jt(this,np,xw).call(this),Ue(this,Ps,t),!(oc||hi(this.options.enabled,oe(this,zt))===!1||!cw(oe(this,Ps))||oe(this,Ps)===0)&&Ue(this,zl,setInterval(()=>{(this.options.refetchIntervalInBackground||kS.isFocused())&&jt(this,Bl,wf).call(this)},oe(this,Ps)))},ep=new WeakSet,vw=function(){jt(this,Qh,gw).call(this),jt(this,Zh,bw).call(this,jt(this,Jh,mw).call(this))},tp=new WeakSet,yw=function(){oe(this,jl)&&(clearTimeout(oe(this,jl)),Ue(this,jl,void 0))},np=new WeakSet,xw=function(){oe(this,zl)&&(clearInterval(oe(this,zl)),Ue(this,zl,void 0))},rp=new WeakSet,ww=function(){const t=oe(this,Qr).getQueryCache().build(oe(this,Qr),this.options);if(t===oe(this,zt))return;const n=oe(this,zt);Ue(this,zt,t),Ue(this,Kh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},db=new WeakSet,tk=function(t){cr.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(oe(this,Mr))}),oe(this,Qr).getQueryCache().notify({query:oe(this,zt),type:"observerResultsUpdated"})})},_M);function OG(e,t){return hi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function jP(e,t){return OG(e,t)||e.state.data!==void 0&&_w(e,t,t.refetchOnMount)}function _w(e,t,n){if(hi(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&IS(e,t)}return!1}function zP(e,t,n,r){return(e!==t||hi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&IS(e,n)}function IS(e,t){return hi(t.enabled,e)!==!1&&e.isStaleByTime(yu(t.staleTime,e))}function TG(e,t){return!dw(e.getCurrentResult(),t)}var nk=j.createContext(void 0),NS=e=>{const t=j.useContext(nk);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},DG=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),R.jsx(nk.Provider,{value:e,children:t})),rk=j.createContext(!1),AG=()=>j.useContext(rk);rk.Provider;function MG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kG=j.createContext(MG()),IG=()=>j.useContext(kG);function NG(e,t){return typeof e=="function"?e(...t):!!e}function BP(){}var LG=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},FG=e=>{j.useEffect(()=>{e.clearReset()},[e])},jG=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&NG(n,[e.error,r]),zG=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},BG=(e,t)=>e.isLoading&&e.isFetching&&!t,VG=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,VP=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function HG(e,t,n){var u,d,h,p,v;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=NS(n),o=AG(),i=IG(),a=r.defaultQueryOptions(e);(d=(u=r.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||d.call(u,a),a._optimisticResults=o?"isRestoring":"optimistic",zG(a),LG(a,i),FG(i);const s=!r.getQueryCache().get(a.queryHash),[l]=j.useState(()=>new t(r,a)),c=l.getOptimisticResult(a);if(j.useSyncExternalStore(j.useCallback(b=>{const x=o?BP:l.subscribe(cr.batchCalls(b));return l.updateResult(),x},[l,o]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),j.useEffect(()=>{l.setOptions(a,{listeners:!1})},[a,l]),VG(a,c))throw VP(a,l,i);if(jG({result:c,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw c.error;if((p=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||p.call(h,a,c),a.experimental_prefetchInRender&&!oc&&BG(c,o)){const b=s?VP(a,l,i):(v=r.getQueryCache().get(a.queryHash))==null?void 0:v.promise;b==null||b.catch(BP).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?c:l.trackResult(c)}function ap(e,t){return HG(e,$G,t)}function ok({children:e}){const{setIsSessionExpired:t}=dr(),n=new PG({queryCache:new ek({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{gcTime:1e3*60*10,staleTime:1e3*60*5,refetchOnWindowFocus:!1,retry:1}}});return R.jsx(DG,{client:n,children:e})}const bc=m.forwardRef(({children:e,className:t,...n},r)=>R.jsx("div",{className:ye("semaphor-scope",t),ref:r,...n,children:e})),WG={id:"",authToken:void 0},ik=m.createContext(WG),ak=({children:e,dashboardProps:t})=>R.jsx(ok,{children:R.jsx(ik.Provider,{value:t,children:R.jsx(bc,{style:{height:"100%"},children:e})})});function _i(){const e=m.useContext(ik);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function UG(){const{authToken:e,version:t}=_i(),n=we(s=>s.selectedLensId),{data:r,isLoading:o,isFetching:i,isError:a}=ap({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>$q(e==null?void 0:e.accessToken,{lensId:n,version:t})});return{data:r,isLoading:o,isFetching:i,isError:a}}function sk(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function HP(e,t){const n=sk(e);return n==="dark"?Vl.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function qG({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,onFilterValuesChange:i}){const{authToken:a}=_i(),s=we(A=>A.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:d}=UG(),[h,p]=m.useState(o||[]),{theme:v,setTheme:b}=qM(),x=we(A=>A.dashboard.globalStyle),{setDashboard:y,setDashboardWithFilterValues:_,setSelectedSheetId:S,setStyle:C,setOnSaveFunction:E,setLenses:$,setSelectedLensId:T,setInitStore:D}=we(A=>A.actions);we(A=>A.actions.setCustomCards);const M=we(A=>A.actions.setFilterValues),L=we(A=>A.filterValues),F=we(A=>A.actions.setThemeStyle),z=we(A=>A.actions.setDashboardTheme),X=we(A=>A.actions.setOnEvent);m.useEffect(()=>{a&&D()},[a,D]),m.useEffect(()=>{if(v){const A=sk(v);z(A)}},[v,z]),m.useEffect(()=>{t&&b(t)},[t,b]);const G=m.useCallback(()=>{const A=Vl.cloneDeep(c0),U=Vl.merge(A,x);if(e){const V=Vl.merge(U,e),K=HP(v,V);F(K),C(V)}else{const V=HP(v,U);F(V),C(c0)}},[v,e,x,F,C]);return m.useEffect(()=>{l&&l.dashboard&&G()},[v,e,x,G,l]),m.useEffect(()=>{var H,Y;function A(I,te){const ce=I.filters||[],de=[];for(const he of te){const ie=ce.find(re=>re.id===he.filterId);ie&&de.push({filterId:he.filterId,connectionType:ie.database==="NA"?"api":"database",name:ie.column,operation:ie.operation,valueType:vu(ie),values:he.values})}return de}if(!l||!l.dashboard)return;const{dashboard:U,filterValues:V,defaultLensId:K,lenses:q}=l,O=A(U,h||[]);_(U,V||O||[]),K&&T(K),q&&$(q),S(((Y=(H=U==null?void 0:U.sheets)==null?void 0:H[0])==null?void 0:Y.id)||null)},[l,y,S,M,s,$,_,T,h]),m.useEffect(()=>{i&&L&&i(L)},[L,i]),m.useEffect(()=>{n&&E(n),r&&X(r)},[n,E,r,X]),{isFetching:u,isLoading:c,isError:d}}function yb({className:e,...t}){return R.jsx("div",{className:ye("animate-pulse rounded-md bg-muted",e),...t})}const lk=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:ye("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));lk.displayName="Card";const xb=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:ye("flex flex-col space-y-1.5 p-6",e),...t}));xb.displayName="CardHeader";const pd=j.forwardRef(({className:e,...t},n)=>R.jsx("h3",{ref:n,className:ye("text-2xl font-semibold leading-none tracking-tight",e),...t}));pd.displayName="CardTitle";const LS=j.forwardRef(({className:e,...t},n)=>R.jsx("p",{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));LS.displayName="CardDescription";const wb=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:ye("px-6 pt-0",e),...t}));wb.displayName="CardContent";const ck=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:ye("flex items-center p-6 pt-0",e),...t}));ck.displayName="CardFooter";function uk({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:a,id:s,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:h,defaultFilterValues:p,onFilterValuesChange:v,...b}){we(E=>E.selectedSheetId);const x=we(E=>E.themeStyle),y=we(E=>E.isSessionExpired),{isLoading:_,isError:S,isFetching:C}=qG({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:p,onFilterValuesChange:v});return _||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?R.jsx(o,{message:"loading"}):R.jsx("div",{className:"flex items-center gap-3",children:R.jsx(yb,{className:"h-1 w-full dark:h-[2px]"})})):S?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),R.jsx(i,{})):R.jsx("div",{children:"Error"})):y?(r==null||r({type:"error",message:"Session Expired"}),R.jsx("div",{className:"flex h-full items-center justify-center",children:R.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[R.jsx(pd,{children:"Session Expired"}),R.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):R.jsx("div",{className:ye("flex h-full flex-col justify-between",x==null?void 0:x.dashboardPanel,e),style:{},role:"dashboard-panel",...b})}function ue(){return ue=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},ue.apply(this,arguments)}function ke(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function hr(e,t=[]){let n=[];function r(i,a){const s=m.createContext(a),l=n.length;n=[...n,a];function c(d){const{scope:h,children:p,...v}=d,b=(h==null?void 0:h[e][l])||s,x=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:x},p)}function u(d,h){const p=(h==null?void 0:h[e][l])||s,v=m.useContext(p);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(a=>m.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,GG(o,...t)]}function GG(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function YG(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Ba(...e){return t=>e.forEach(n=>YG(n,t))}function Rt(...e){return m.useCallback(Ba(...e),e)}const Sw=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(XG);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(Cw,ue({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(Cw,ue({},r,{ref:t}),n)});Sw.displayName="Slot";const Cw=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...QG(r,n.props),ref:t?Ba(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Cw.displayName="SlotClone";const KG=({children:e})=>m.createElement(m.Fragment,null,e);function XG(e){return m.isValidElement(e)&&e.type===KG}function QG(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function _b(e){const t=e+"CollectionProvider",[n,r]=hr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:v,children:b}=p,x=m.useRef(null),y=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:y,collectionRef:x},b)},s=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:b,children:x}=p,y=i(s,b),_=Rt(v,y.collectionRef);return m.createElement(Sw,{ref:_},x)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",d=m.forwardRef((p,v)=>{const{scope:b,children:x,...y}=p,_=m.useRef(null),S=Rt(v,_),C=i(c,b);return m.useEffect(()=>(C.itemMap.set(_,{ref:_,...y}),()=>void C.itemMap.delete(_))),m.createElement(Sw,{[u]:"",ref:S},x)});function h(p){const v=i(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((C,E)=>y.indexOf(C.ref.current)-y.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},h,r]}const Cr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},JG=j.useId||(()=>{});let ZG=0;function yi(e){const[t,n]=j.useState(JG());return Cr(()=>{e||n(r=>r??String(ZG++))},[e]),e||(t?`radix-${t}`:"")}const dk=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(tY);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(Ew,ue({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(Ew,ue({},r,{ref:t}),n)});dk.displayName="Slot";const Ew=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...nY(r,n.props),ref:t?Ba(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Ew.displayName="SlotClone";const eY=({children:e})=>m.createElement(m.Fragment,null,e);function tY(e){return m.isValidElement(e)&&e.type===eY}function nY(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const rY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=rY.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?dk:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(s,ue({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function fk(e,t){e&&Er.flushSync(()=>e.dispatchEvent(t))}function Xn(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 Fr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=oY({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=Xn(n),l=m.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function oY({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=Xn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const iY=m.createContext(void 0);function vc(e){const t=m.useContext(iY);return e||t||"ltr"}const r1="rovingFocusGroup.onEntryFocus",aY={bubbles:!1,cancelable:!0},FS="RovingFocusGroup",[Rw,hk,sY]=_b(FS),[lY,gd]=hr(FS,[sY]),[cY,uY]=lY(FS),dY=m.forwardRef((e,t)=>m.createElement(Rw.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Rw.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(fY,ue({},e,{ref:t}))))),fY=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,d=m.useRef(null),h=Rt(t,d),p=vc(i),[v=null,b]=Fr({prop:a,defaultProp:s,onChange:l}),[x,y]=m.useState(!1),_=Xn(c),S=hk(n),C=m.useRef(!1),[E,$]=m.useState(0);return m.useEffect(()=>{const T=d.current;if(T)return T.addEventListener(r1,_),()=>T.removeEventListener(r1,_)},[_]),m.createElement(cY,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(T=>b(T),[b]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>$(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>$(T=>T-1),[])},m.createElement(Qe.div,ue({tabIndex:x||E===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{C.current=!0}),onFocus:ke(e.onFocus,T=>{const D=!C.current;if(T.target===T.currentTarget&&D&&!x){const M=new CustomEvent(r1,aY);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const L=S().filter(A=>A.focusable),F=L.find(A=>A.active),z=L.find(A=>A.id===v),G=[F,z,...L].filter(Boolean).map(A=>A.ref.current);pk(G)}}C.current=!1}),onBlur:ke(e.onBlur,()=>y(!1))})))}),hY="RovingFocusGroupItem",pY=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=e,s=yi(),l=i||s,c=uY(hY,n),u=c.currentTabStopId===l,d=hk(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),m.createElement(Rw.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,ue({tabIndex:u?0:-1,"data-orientation":c.orientation},a,{ref:t,onMouseDown:ke(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:ke(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ke(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=bY(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let y=d().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const _=y.indexOf(v.currentTarget);y=c.loop?vY(y,_+1):y.slice(_+1)}setTimeout(()=>pk(y))}})})))}),gY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function bY(e,t,n){const r=mY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gY[r]}function pk(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function vY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const jS=dY,zS=pY;function yY(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const pr=e=>{const{present:t,children:n}=e,r=xY(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Rt(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};pr.displayName="Presence";function xY(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),a=e?"mounted":"unmounted",[s,l]=yY(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Og(r.current);i.current=s==="mounted"?c:"none"},[s]),Cr(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=Og(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Cr(()=>{if(t){const c=d=>{const p=Og(r.current).includes(d.animationName);d.target===t&&p&&Er.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Og(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Og(e){return(e==null?void 0:e.animationName)||"none"}const gk="Tabs",[wY,KRe]=hr(gk,[gd]),mk=gd(),[_Y,BS]=wY(gk),SY=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=vc(s),[d,h]=Fr({prop:r,onChange:o,defaultProp:i});return m.createElement(_Y,{scope:n,baseId:yi(),value:d,onValueChange:h,orientation:a,dir:u,activationMode:l},m.createElement(Qe.div,ue({dir:u,"data-orientation":a},c,{ref:t})))}),CY="TabsList",EY=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=BS(CY,n),a=mk(n);return m.createElement(jS,ue({asChild:!0},a,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,ue({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),RY="TabsTrigger",PY=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=BS(RY,n),s=mk(n),l=bk(a.baseId,r),c=vk(a.baseId,r),u=r===a.value;return m.createElement(zS,ue({asChild:!0},s,{focusable:!o,active:u}),m.createElement(Qe.button,ue({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:ke(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:ke(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:ke(e.onFocus,()=>{const d=a.activationMode!=="manual";!u&&!o&&d&&a.onValueChange(r)})})))}),$Y="TabsContent",OY=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=BS($Y,n),l=bk(s.baseId,r),c=vk(s.baseId,r),u=r===s.value,d=m.useRef(u);return m.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),m.createElement(pr,{present:o||u},({present:h})=>m.createElement(Qe.div,ue({"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0},a,{ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0}}),h&&i))});function bk(e,t){return`${e}-trigger-${t}`}function vk(e,t){return`${e}-content-${t}`}const TY=SY,yk=EY,xk=PY,wk=OY,VS=TY,Sb=j.forwardRef(({className:e,...t},n)=>R.jsx(yk,{ref:n,className:ye("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Sb.displayName=yk.displayName;const Cb=j.forwardRef(({className:e,...t},n)=>R.jsx(xk,{ref:n,className:ye("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}));Cb.displayName=xk.displayName;const HS=j.forwardRef(({className:e,...t},n)=>R.jsx(wk,{ref:n,className:ye("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));HS.displayName=wk.displayName;var _k={exports:{}},sp={},Pw={exports:{}};(function(e,t){(function(n,r){r(t)})(ys,function(n){function r(ie){return function(le,xe,Z,ve,Ce,Oe,Te){return ie(le,xe,Te)}}function o(ie){return function(le,xe,Z,ve){if(!le||!xe||typeof le!="object"||typeof xe!="object")return ie(le,xe,Z,ve);var Ce=ve.get(le),Oe=ve.get(xe);if(Ce&&Oe)return Ce===xe&&Oe===le;ve.set(le,xe),ve.set(xe,le);var Te=ie(le,xe,Z,ve);return ve.delete(le),ve.delete(xe),Te}}function i(ie,re){var le={};for(var xe in ie)le[xe]=ie[xe];for(var xe in re)le[xe]=re[xe];return le}function a(ie){return ie.constructor===Object||ie.constructor==null}function s(ie){return typeof ie.then=="function"}function l(ie,re){return ie===re||ie!==ie&&re!==re}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",p="[object Map]",v="[object Number]",b="[object Object]",x="[object Set]",y="[object String]",_=Object.prototype.toString;function S(ie){var re=ie.areArraysEqual,le=ie.areDatesEqual,xe=ie.areMapsEqual,Z=ie.areObjectsEqual,ve=ie.areRegExpsEqual,Ce=ie.areSetsEqual,Oe=ie.createIsNestedEqual,Te=Oe(We);function We(Be,Ie,Ke){if(Be===Ie)return!0;if(!Be||!Ie||typeof Be!="object"||typeof Ie!="object")return Be!==Be&&Ie!==Ie;if(a(Be)&&a(Ie))return Z(Be,Ie,Te,Ke);var dt=Array.isArray(Be),Bt=Array.isArray(Ie);if(dt||Bt)return dt===Bt&&re(Be,Ie,Te,Ke);var It=_.call(Be);return It!==_.call(Ie)?!1:It===d?le(Be,Ie,Te,Ke):It===h?ve(Be,Ie,Te,Ke):It===p?xe(Be,Ie,Te,Ke):It===x?Ce(Be,Ie,Te,Ke):It===b||It===c?s(Be)||s(Ie)?!1:Z(Be,Ie,Te,Ke):It===u||It===v||It===y?l(Be.valueOf(),Ie.valueOf()):!1}return We}function C(ie,re,le,xe){var Z=ie.length;if(re.length!==Z)return!1;for(;Z-- >0;)if(!le(ie[Z],re[Z],Z,Z,ie,re,xe))return!1;return!0}var E=o(C);function $(ie,re){return l(ie.valueOf(),re.valueOf())}function T(ie,re,le,xe){var Z=ie.size===re.size;if(!Z)return!1;if(!ie.size)return!0;var ve={},Ce=0;return ie.forEach(function(Oe,Te){if(Z){var We=!1,Be=0;re.forEach(function(Ie,Ke){!We&&!ve[Be]&&(We=le(Te,Ke,Ce,Be,ie,re,xe)&&le(Oe,Ie,Te,Ke,ie,re,xe))&&(ve[Be]=!0),Be++}),Ce++,Z=We}}),Z}var D=o(T),M="_owner",L=Object.prototype.hasOwnProperty;function F(ie,re,le,xe){var Z=Object.keys(ie),ve=Z.length;if(Object.keys(re).length!==ve)return!1;for(var Ce;ve-- >0;){if(Ce=Z[ve],Ce===M){var Oe=!!ie.$$typeof,Te=!!re.$$typeof;if((Oe||Te)&&Oe!==Te)return!1}if(!L.call(re,Ce)||!le(ie[Ce],re[Ce],Ce,Ce,ie,re,xe))return!1}return!0}var z=o(F);function X(ie,re){return ie.source===re.source&&ie.flags===re.flags}function G(ie,re,le,xe){var Z=ie.size===re.size;if(!Z)return!1;if(!ie.size)return!0;var ve={};return ie.forEach(function(Ce,Oe){if(Z){var Te=!1,We=0;re.forEach(function(Be,Ie){!Te&&!ve[We]&&(Te=le(Ce,Be,Oe,Ie,ie,re,xe))&&(ve[We]=!0),We++}),Z=Te}}),Z}var A=o(G),U=Object.freeze({areArraysEqual:C,areDatesEqual:$,areMapsEqual:T,areObjectsEqual:F,areRegExpsEqual:X,areSetsEqual:G,createIsNestedEqual:r}),V=Object.freeze({areArraysEqual:E,areDatesEqual:$,areMapsEqual:D,areObjectsEqual:z,areRegExpsEqual:X,areSetsEqual:A,createIsNestedEqual:r}),K=S(U);function q(ie,re){return K(ie,re,void 0)}var O=S(i(U,{createIsNestedEqual:function(){return l}}));function H(ie,re){return O(ie,re,void 0)}var Y=S(V);function I(ie,re){return Y(ie,re,new WeakMap)}var te=S(i(V,{createIsNestedEqual:function(){return l}}));function ce(ie,re){return te(ie,re,new WeakMap)}function de(ie){return S(i(U,ie(U)))}function he(ie){var re=S(i(V,ie(V)));return function(le,xe,Z){return Z===void 0&&(Z=new WeakMap),re(le,xe,Z)}}n.circularDeepEqual=I,n.circularShallowEqual=ce,n.createCustomCircularEqual=he,n.createCustomEqual=de,n.deepEqual=q,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Pw,Pw.exports);var WS=Pw.exports;const US=SS(jU);var Dt={},DY=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(Dt,"__esModule",{value:!0});Dt.bottom=qS;Dt.childrenEqual=IY;Dt.cloneLayout=Sk;Dt.cloneLayoutItem=Hl;Dt.collides=Eb;Dt.compact=Ek;Dt.compactItem=Rk;Dt.compactType=KY;Dt.correctBounds=Pk;Dt.fastPositionEqual=LY;Dt.fastRGLPropsEqual=void 0;Dt.getAllCollisions=$k;Dt.getFirstCollision=Ol;Dt.getLayoutItem=GS;Dt.getStatics=YS;Dt.modifyLayout=Ck;Dt.moveElement=Sf;Dt.moveElementAwayFromCollision=Ow;Dt.noop=void 0;Dt.perc=jY;Dt.resizeItemInDirection=UY;Dt.setTopLeft=GY;Dt.setTransform=qY;Dt.sortLayoutItems=eC;Dt.sortLayoutItemsByColRow=Mk;Dt.sortLayoutItemsByRowCol=Ak;Dt.synchronizeLayoutWithChildren=YY;Dt.validateLayout=kk;Dt.withLayoutItem=kY;var WP=WS,_f=AY(m);function AY(e){return e&&e.__esModule?e:{default:e}}const MY=process.env.NODE_ENV==="production";function qS(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function Sk(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Hl(e[n]);return t}function Ck(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function kY(e,t,n){let r=GS(e,t);return r?(r=n(Hl(r)),e=Ck(e,r),[e,r]):[e,null]}function Hl(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 IY(e,t){return(0,WP.deepEqual)(_f.default.Children.map(e,n=>n==null?void 0:n.key),_f.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,WP.deepEqual)(_f.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),_f.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const NY=DY;Dt.fastRGLPropsEqual=NY;function LY(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Eb(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 Ek(e,t,n,r){const o=YS(e),i=eC(e,t),a=Array(e.length);for(let s=0,l=i.length;s<l;s++){let c=Hl(i[s]);c.static||(c=Rk(o,c,t,n,i,r),o.push(c)),a[e.indexOf(i[s])]=c,c.moved=!1}return a}const FY={x:"w",y:"h"};function $w(e,t,n,r){const o=FY[r];t[r]+=1;const i=e.map(a=>a.i).indexOf(t.i);for(let a=i+1;a<e.length;a++){const s=e[a];if(!s.static){if(s.y>t.y+t.h)break;Eb(t,s)&&$w(e,s,n+t[o],r)}}t[r]=n}function Rk(e,t,n,r,o,i){const a=n==="vertical",s=n==="horizontal";if(a)for(t.y=Math.min(qS(e),t.y);t.y>0&&!Ol(e,t);)t.y--;else if(s)for(;t.x>0&&!Ol(e,t);)t.x--;let l;for(;(l=Ol(e,t))&&!(n===null&&i);)if(s?$w(o,t,l.x+l.w,"x"):$w(o,t,l.y+l.h,"y"),s&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ol(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function Pk(e,t){const n=YS(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Ol(n,i);)i.y++}return e}function GS(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ol(e,t){for(let n=0,r=e.length;n<r;n++)if(Eb(e[n],t))return e[n]}function $k(e,t){return e.filter(n=>Eb(n,t))}function YS(e){return e.filter(t=>t.static)}function Sf(e,t,n,r,o,i,a,s,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=eC(e,a);(a==="vertical"&&typeof r=="number"?u>=r:a==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const p=$k(d,t),v=p.length>0;if(v&&l)return Sk(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let b=0,x=p.length;b<x;b++){const y=p[b];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(y.i," at [").concat(y.x,",").concat(y.y,"]"),!y.moved&&(y.static?e=Ow(e,y,t,o,a):e=Ow(e,t,y,o,a))}return e}function Ow(e,t,n,r,o,i){const a=o==="horizontal",s=o==="vertical",l=t.static;if(r){r=!1;const d={x:a?Math.max(t.x-n.w,0):n.x,y:s?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=Ol(e,d),p=h&&h.y+h.h>t.y,v=h&&t.x+t.w>h.x;if(h){if(p&&s)return Sf(e,n,void 0,t.y+1,r,l,o);if(p&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&a)return Sf(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(d.x,",").concat(d.y,"]."),Sf(e,n,a?d.x:void 0,s?d.y:void 0,r,l,o)}const c=a?n.x+1:void 0,u=s?n.y+1:void 0;return c==null&&u==null?e:Sf(e,n,a?n.x+1:void 0,s?n.y+1:void 0,r,l,o)}function jY(e){return e*100+"%"}const Ok=(e,t,n,r)=>e+n>r?t:n,Tk=(e,t,n)=>e<0?t:n,Dk=e=>Math.max(0,e),KS=e=>Math.max(0,e),XS=(e,t,n)=>{let{left:r,height:o,width:i}=t;const a=e.top-(o-e.height);return{left:r,width:i,height:Tk(a,e.height,o),top:KS(a)}},QS=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{top:r,height:i,width:Ok(e.left,e.width,a,n),left:Dk(o)}},JS=(e,t,n)=>{let{top:r,height:o,width:i}=t;const a=e.left-(i-e.width);return{height:o,width:a<0?e.width:Ok(e.left,e.width,i,n),top:KS(r),left:Dk(a)}},ZS=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{width:a,left:o,height:Tk(r,e.height,i),top:KS(r)}},zY=function(){return XS(arguments.length<=0?void 0:arguments[0],QS(...arguments))},BY=function(){return XS(arguments.length<=0?void 0:arguments[0],JS(...arguments))},VY=function(){return ZS(arguments.length<=0?void 0:arguments[0],QS(...arguments))},HY=function(){return ZS(arguments.length<=0?void 0:arguments[0],JS(...arguments))},WY={n:XS,ne:zY,e:QS,se:VY,s:ZS,sw:HY,w:JS,nw:BY};function UY(e,t,n,r){const o=WY[e];return o?o(t,{...t,...n},r):n}function qY(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function GY(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function eC(e,t){return t==="horizontal"?Mk(e):t==="vertical"?Ak(e):e}function Ak(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 Mk(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 YY(e,t,n,r,o){e=e||[];const i=[];_f.default.Children.forEach(t,s=>{if((s==null?void 0:s.key)==null)return;const l=GS(e,String(s.key)),c=s.props["data-grid"];l&&c==null?i.push(Hl(l)):c?(MY||kk([c],"ReactGridLayout.children"),i.push(Hl({...c,i:s.key}))):i.push(Hl({w:1,h:1,x:0,y:qS(i),i:String(s.key)}))});const a=Pk(i,{cols:n});return o?a:Ek(a,r,n)}function kk(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let a=0;a<n.length;a++)if(typeof i[n[a]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[a]+" must be a number!")}}function KY(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const XY=()=>{};Dt.noop=XY;var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.calcGridColWidth=Rb;ea.calcGridItemPosition=QY;ea.calcGridItemWHPx=Tw;ea.calcWH=ZY;ea.calcXY=JY;ea.clamp=Tl;function Rb(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Tw(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function QY(e,t,n,r,o,i){const{margin:a,containerPadding:s,rowHeight:l}=e,c=Rb(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Tw(r,c,a[0]),u.height=Tw(o,l,a[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+a[1])*n+s[1]),u.left=Math.round((c+a[0])*t+s[0])),u}function JY(e,t,n,r,o){const{margin:i,cols:a,rowHeight:s,maxRows:l}=e,c=Rb(e);let u=Math.round((n-i[0])/(c+i[0])),d=Math.round((t-i[1])/(s+i[1]));return u=Tl(u,0,a-r),d=Tl(d,0,l-o),{x:u,y:d}}function ZY(e,t,n,r,o,i){const{margin:a,maxRows:s,cols:l,rowHeight:c}=e,u=Rb(e);let d=Math.round((t+a[0])/(u+a[0])),h=Math.round((n+a[1])/(c+a[1])),p=Tl(d,0,l-r),v=Tl(h,0,s-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Tl(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=Tl(h,0,s)),{w:p,h:v}}function Tl(e,t,n){return Math.max(Math.min(e,n),t)}var Pb={},Dw={exports:{}},o1,UP;function tC(){if(UP)return o1;UP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return o1=e,o1}var i1,qP;function eK(){if(qP)return i1;qP=1;var e=tC();function t(){}function n(){}return n.resetWarningCache=t,i1=function(){function r(a,s,l,c,u,d){if(d!==e){var h=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 h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},i1}var Tg={exports:{}},en={};/** @license React v16.13.1
89
+ * react-is.development.js
90
+ *
91
+ * Copyright (c) Facebook, Inc. and its affiliates.
92
+ *
93
+ * This source code is licensed under the MIT license found in the
94
+ * LICENSE file in the root directory of this source tree.
95
+ */var GP;function tK(){return GP||(GP=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=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,y=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(Z){return typeof Z=="string"||typeof Z=="function"||Z===r||Z===c||Z===i||Z===o||Z===d||Z===h||typeof Z=="object"&&Z!==null&&(Z.$$typeof===v||Z.$$typeof===p||Z.$$typeof===a||Z.$$typeof===s||Z.$$typeof===u||Z.$$typeof===x||Z.$$typeof===y||Z.$$typeof===_||Z.$$typeof===b)}function C(Z){if(typeof Z=="object"&&Z!==null){var ve=Z.$$typeof;switch(ve){case t:var Ce=Z.type;switch(Ce){case l:case c:case r:case i:case o:case d:return Ce;default:var Oe=Ce&&Ce.$$typeof;switch(Oe){case s:case u:case v:case p:case a:return Oe;default:return ve}}case n:return ve}}}var E=l,$=c,T=s,D=a,M=t,L=u,F=r,z=v,X=p,G=n,A=i,U=o,V=d,K=!1;function q(Z){return K||(K=!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.")),O(Z)||C(Z)===l}function O(Z){return C(Z)===c}function H(Z){return C(Z)===s}function Y(Z){return C(Z)===a}function I(Z){return typeof Z=="object"&&Z!==null&&Z.$$typeof===t}function te(Z){return C(Z)===u}function ce(Z){return C(Z)===r}function de(Z){return C(Z)===v}function he(Z){return C(Z)===p}function ie(Z){return C(Z)===n}function re(Z){return C(Z)===i}function le(Z){return C(Z)===o}function xe(Z){return C(Z)===d}en.AsyncMode=E,en.ConcurrentMode=$,en.ContextConsumer=T,en.ContextProvider=D,en.Element=M,en.ForwardRef=L,en.Fragment=F,en.Lazy=z,en.Memo=X,en.Portal=G,en.Profiler=A,en.StrictMode=U,en.Suspense=V,en.isAsyncMode=q,en.isConcurrentMode=O,en.isContextConsumer=H,en.isContextProvider=Y,en.isElement=I,en.isForwardRef=te,en.isFragment=ce,en.isLazy=de,en.isMemo=he,en.isPortal=ie,en.isProfiler=re,en.isStrictMode=le,en.isSuspense=xe,en.isValidElementType=S,en.typeOf=C}()),en}var tn={};/** @license React v16.13.1
96
+ * react-is.production.min.js
97
+ *
98
+ * Copyright (c) Facebook, Inc. and its affiliates.
99
+ *
100
+ * This source code is licensed under the MIT license found in the
101
+ * LICENSE file in the root directory of this source tree.
102
+ */var YP;function nK(){if(YP)return tn;YP=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=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,y=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(E){if(typeof E=="object"&&E!==null){var $=E.$$typeof;switch($){case t:switch(E=E.type,E){case l:case c:case r:case i:case o:case d:return E;default:switch(E=E&&E.$$typeof,E){case s:case u:case v:case p:case a:return E;default:return $}}case n:return $}}}function C(E){return S(E)===c}return tn.AsyncMode=l,tn.ConcurrentMode=c,tn.ContextConsumer=s,tn.ContextProvider=a,tn.Element=t,tn.ForwardRef=u,tn.Fragment=r,tn.Lazy=v,tn.Memo=p,tn.Portal=n,tn.Profiler=i,tn.StrictMode=o,tn.Suspense=d,tn.isAsyncMode=function(E){return C(E)||S(E)===l},tn.isConcurrentMode=C,tn.isContextConsumer=function(E){return S(E)===s},tn.isContextProvider=function(E){return S(E)===a},tn.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},tn.isForwardRef=function(E){return S(E)===u},tn.isFragment=function(E){return S(E)===r},tn.isLazy=function(E){return S(E)===v},tn.isMemo=function(E){return S(E)===p},tn.isPortal=function(E){return S(E)===n},tn.isProfiler=function(E){return S(E)===i},tn.isStrictMode=function(E){return S(E)===o},tn.isSuspense=function(E){return S(E)===d},tn.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===c||E===i||E===o||E===d||E===h||typeof E=="object"&&E!==null&&(E.$$typeof===v||E.$$typeof===p||E.$$typeof===a||E.$$typeof===s||E.$$typeof===u||E.$$typeof===x||E.$$typeof===y||E.$$typeof===_||E.$$typeof===b)},tn.typeOf=S,tn}var KP;function Ik(){return KP||(KP=1,process.env.NODE_ENV==="production"?Tg.exports=nK():Tg.exports=tK()),Tg.exports}/*
103
+ object-assign
104
+ (c) Sindre Sorhus
105
+ @license MIT
106
+ */var a1,XP;function rK(){if(XP)return a1;XP=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(a).map(function(u){return a[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return a1=o()?Object.assign:function(i,a){for(var s,l=r(i),c,u=1;u<arguments.length;u++){s=Object(arguments[u]);for(var d in s)t.call(s,d)&&(l[d]=s[d]);if(e){c=e(s);for(var h=0;h<c.length;h++)n.call(s,c[h])&&(l[c[h]]=s[c[h]])}}return l},a1}var s1,QP;function Nk(){return QP||(QP=1,s1=Function.call.bind(Object.prototype.hasOwnProperty)),s1}var l1,JP;function oK(){if(JP)return l1;JP=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=tC(),n={},r=Nk();e=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function o(i,a,s,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var d;try{if(typeof i[u]!="function"){var h=Error((l||"React class")+": "+s+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=i[u](a,u,l,s,null,t)}catch(v){d=v}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+s+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var p=c?c():"";e("Failed "+s+" type: "+d.message+(p??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},l1=o,l1}var c1,ZP;function iK(){if(ZP)return c1;ZP=1;var e=Ik(),t=rK(),n=tC(),r=Nk(),o=oK(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function a(){return null}return c1=function(s,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(O){var H=O&&(c&&O[c]||O[u]);if(typeof H=="function")return H}var h="<<anonymous>>",p={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:_(),arrayOf:S,element:C(),elementType:E(),instanceOf:$,node:L(),objectOf:D,oneOf:T,oneOfType:M,shape:z,exact:X};function v(O,H){return O===H?O!==0||1/O===1/H:O!==O&&H!==H}function b(O,H){this.message=O,this.data=H&&typeof H=="object"?H:{},this.stack=""}b.prototype=Error.prototype;function x(O){if(process.env.NODE_ENV!=="production")var H={},Y=0;function I(ce,de,he,ie,re,le,xe){if(ie=ie||h,le=le||he,xe!==n){if(l){var Z=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 Z.name="Invariant Violation",Z}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ve=ie+":"+he;!H[ve]&&Y<3&&(i("You are manually calling a React.PropTypes validation function for the `"+le+"` prop on `"+ie+"`. 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[ve]=!0,Y++)}}return de[he]==null?ce?de[he]===null?new b("The "+re+" `"+le+"` is marked as required "+("in `"+ie+"`, but its value is `null`.")):new b("The "+re+" `"+le+"` is marked as required in "+("`"+ie+"`, but its value is `undefined`.")):null:O(de,he,ie,re,le)}var te=I.bind(null,!1);return te.isRequired=I.bind(null,!0),te}function y(O){function H(Y,I,te,ce,de,he){var ie=Y[I],re=U(ie);if(re!==O){var le=V(ie);return new b("Invalid "+ce+" `"+de+"` of type "+("`"+le+"` supplied to `"+te+"`, expected ")+("`"+O+"`."),{expectedType:O})}return null}return x(H)}function _(){return x(a)}function S(O){function H(Y,I,te,ce,de){if(typeof O!="function")return new b("Property `"+de+"` of component `"+te+"` has invalid PropType notation inside arrayOf.");var he=Y[I];if(!Array.isArray(he)){var ie=U(he);return new b("Invalid "+ce+" `"+de+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected an array."))}for(var re=0;re<he.length;re++){var le=O(he,re,te,ce,de+"["+re+"]",n);if(le instanceof Error)return le}return null}return x(H)}function C(){function O(H,Y,I,te,ce){var de=H[Y];if(!s(de)){var he=U(de);return new b("Invalid "+te+" `"+ce+"` of type "+("`"+he+"` supplied to `"+I+"`, expected a single ReactElement."))}return null}return x(O)}function E(){function O(H,Y,I,te,ce){var de=H[Y];if(!e.isValidElementType(de)){var he=U(de);return new b("Invalid "+te+" `"+ce+"` of type "+("`"+he+"` supplied to `"+I+"`, expected a single ReactElement type."))}return null}return x(O)}function $(O){function H(Y,I,te,ce,de){if(!(Y[I]instanceof O)){var he=O.name||h,ie=q(Y[I]);return new b("Invalid "+ce+" `"+de+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected ")+("instance of `"+he+"`."))}return null}return x(H)}function T(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function H(Y,I,te,ce,de){for(var he=Y[I],ie=0;ie<O.length;ie++)if(v(he,O[ie]))return null;var re=JSON.stringify(O,function(xe,Z){var ve=V(Z);return ve==="symbol"?String(Z):Z});return new b("Invalid "+ce+" `"+de+"` of value `"+String(he)+"` "+("supplied to `"+te+"`, expected one of "+re+"."))}return x(H)}function D(O){function H(Y,I,te,ce,de){if(typeof O!="function")return new b("Property `"+de+"` of component `"+te+"` has invalid PropType notation inside objectOf.");var he=Y[I],ie=U(he);if(ie!=="object")return new b("Invalid "+ce+" `"+de+"` of type "+("`"+ie+"` supplied to `"+te+"`, expected an object."));for(var re in he)if(r(he,re)){var le=O(he,re,te,ce,de+"."+re,n);if(le instanceof Error)return le}return null}return x(H)}function M(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var H=0;H<O.length;H++){var Y=O[H];if(typeof Y!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+K(Y)+" at index "+H+"."),a}function I(te,ce,de,he,ie){for(var re=[],le=0;le<O.length;le++){var xe=O[le],Z=xe(te,ce,de,he,ie,n);if(Z==null)return null;Z.data&&r(Z.data,"expectedType")&&re.push(Z.data.expectedType)}var ve=re.length>0?", expected one of type ["+re.join(", ")+"]":"";return new b("Invalid "+he+" `"+ie+"` supplied to "+("`"+de+"`"+ve+"."))}return x(I)}function L(){function O(H,Y,I,te,ce){return G(H[Y])?null:new b("Invalid "+te+" `"+ce+"` supplied to "+("`"+I+"`, expected a ReactNode."))}return x(O)}function F(O,H,Y,I,te){return new b((O||"React class")+": "+H+" type `"+Y+"."+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+te+"`.")}function z(O){function H(Y,I,te,ce,de){var he=Y[I],ie=U(he);if(ie!=="object")return new b("Invalid "+ce+" `"+de+"` of type `"+ie+"` "+("supplied to `"+te+"`, expected `object`."));for(var re in O){var le=O[re];if(typeof le!="function")return F(te,ce,de,re,V(le));var xe=le(he,re,te,ce,de+"."+re,n);if(xe)return xe}return null}return x(H)}function X(O){function H(Y,I,te,ce,de){var he=Y[I],ie=U(he);if(ie!=="object")return new b("Invalid "+ce+" `"+de+"` of type `"+ie+"` "+("supplied to `"+te+"`, expected `object`."));var re=t({},Y[I],O);for(var le in re){var xe=O[le];if(r(O,le)&&typeof xe!="function")return F(te,ce,de,le,V(xe));if(!xe)return new b("Invalid "+ce+" `"+de+"` key `"+le+"` supplied to `"+te+"`.\nBad object: "+JSON.stringify(Y[I],null," ")+`
107
+ Valid keys: `+JSON.stringify(Object.keys(O),null," "));var Z=xe(he,le,te,ce,de+"."+le,n);if(Z)return Z}return null}return x(H)}function G(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(G);if(O===null||s(O))return!0;var H=d(O);if(H){var Y=H.call(O),I;if(H!==O.entries){for(;!(I=Y.next()).done;)if(!G(I.value))return!1}else for(;!(I=Y.next()).done;){var te=I.value;if(te&&!G(te[1]))return!1}}else return!1;return!0;default:return!1}}function A(O,H){return O==="symbol"?!0:H?H["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&H instanceof Symbol:!1}function U(O){var H=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":A(H,O)?"symbol":H}function V(O){if(typeof O>"u"||O===null)return""+O;var H=U(O);if(H==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return H}function K(O){var H=V(O);switch(H){case"array":case"object":return"an "+H;case"boolean":case"date":case"regexp":return"a "+H;default:return H}}function q(O){return!O.constructor||!O.constructor.name?h:O.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},c1}if(process.env.NODE_ENV!=="production"){var aK=Ik(),sK=!0;Dw.exports=iK()(aK.isElement,sK)}else Dw.exports=eK()();var Ks=Dw.exports,$b={exports:{}},Lk={};function Fk(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=Fk(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function e$(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Fk(e))&&(r&&(r+=" "),r+=t);return r}const lK=Object.freeze(Object.defineProperty({__proto__:null,clsx:e$,default:e$},Symbol.toStringTag,{value:"Module"})),cK=SS(lK);var Fn={},ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.dontSetMe=pK;ta.findInArray=uK;ta.int=hK;ta.isFunction=dK;ta.isNum=fK;function uK(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function dK(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function fK(e){return typeof e=="number"&&!isNaN(e)}function hK(e){return parseInt(e,10)}function pK(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 yc={};Object.defineProperty(yc,"__esModule",{value:!0});yc.browserPrefixToKey=zk;yc.browserPrefixToStyle=gK;yc.default=void 0;yc.getPrefix=jk;const u1=["Moz","Webkit","O","ms"];function jk(){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<u1.length;r++)if(zk(t,u1[r])in n)return u1[r];return""}function zk(e,t){return t?"".concat(t).concat(mK(e)):e}function gK(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function mK(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}yc.default=jk();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.addClassName=Hk;Fn.addEvent=yK;Fn.addUserSelectStyles=TK;Fn.createCSSTransform=RK;Fn.createSVGTransform=PK;Fn.getTouch=$K;Fn.getTouchIdentifier=OK;Fn.getTranslation=nC;Fn.innerHeight=SK;Fn.innerWidth=CK;Fn.matchesSelector=Vk;Fn.matchesSelectorAndParentsTo=vK;Fn.offsetXYFromParent=EK;Fn.outerHeight=wK;Fn.outerWidth=_K;Fn.removeClassName=Wk;Fn.removeEvent=xK;Fn.removeUserSelectStyles=DK;var Eo=ta,t$=bK(yc);function Bk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Bk=function(r){return r?n:t})(e)}function bK(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Bk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let Dg="";function Vk(e,t){return Dg||(Dg=(0,Eo.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Eo.isFunction)(e[n])})),(0,Eo.isFunction)(e[Dg])?e[Dg](t):!1}function vK(e,t,n){let r=e;do{if(Vk(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function yK(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function xK(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function wK(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Eo.int)(n.borderTopWidth),t+=(0,Eo.int)(n.borderBottomWidth),t}function _K(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Eo.int)(n.borderLeftWidth),t+=(0,Eo.int)(n.borderRightWidth),t}function SK(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Eo.int)(n.paddingTop),t-=(0,Eo.int)(n.paddingBottom),t}function CK(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Eo.int)(n.paddingLeft),t-=(0,Eo.int)(n.paddingRight),t}function EK(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,a=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:a}}function RK(e,t){const n=nC(e,t,"px");return{[(0,t$.browserPrefixToKey)("transform",t$.default)]:n}}function PK(e,t){return nC(e,t,"")}function nC(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const a="".concat(typeof t.x=="string"?t.x:t.x+n),s="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(a,", ").concat(s,")")+i}return i}function $K(e,t){return e.targetTouches&&(0,Eo.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Eo.findInArray)(e.changedTouches,n=>t===n.identifier)}function OK(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function TK(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
108
+ `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
109
+ `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&Hk(e.body,"react-draggable-transparent-selection")}function DK(e){if(e)try{if(e.body&&Wk(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 Hk(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function Wk(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var na={};Object.defineProperty(na,"__esModule",{value:!0});na.canDragX=kK;na.canDragY=IK;na.createCoreData=LK;na.createDraggableData=FK;na.getBoundPosition=AK;na.getControlPosition=NK;na.snapToGrid=MK;var ho=ta,du=Fn;function AK(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:jK(r);const o=rC(e);if(typeof r=="string"){const{ownerDocument:i}=o,a=i.defaultView;let s;if(r==="parent"?s=o.parentNode:s=i.querySelector(r),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=s,c=a.getComputedStyle(o),u=a.getComputedStyle(l);r={left:-o.offsetLeft+(0,ho.int)(u.paddingLeft)+(0,ho.int)(c.marginLeft),top:-o.offsetTop+(0,ho.int)(u.paddingTop)+(0,ho.int)(c.marginTop),right:(0,du.innerWidth)(l)-(0,du.outerWidth)(o)-o.offsetLeft+(0,ho.int)(u.paddingRight)-(0,ho.int)(c.marginRight),bottom:(0,du.innerHeight)(l)-(0,du.outerHeight)(o)-o.offsetTop+(0,ho.int)(u.paddingBottom)-(0,ho.int)(c.marginBottom)}}return(0,ho.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,ho.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,ho.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,ho.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function MK(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function kK(e){return e.props.axis==="both"||e.props.axis==="x"}function IK(e){return e.props.axis==="both"||e.props.axis==="y"}function NK(e,t,n){const r=typeof t=="number"?(0,du.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=rC(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,du.offsetXYFromParent)(r||e,i,n.props.scale)}function LK(e,t,n){const r=!(0,ho.isNum)(e.lastX),o=rC(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function FK(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 jK(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function rC(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Ob={},Tb={};Object.defineProperty(Tb,"__esModule",{value:!0});Tb.default=zK;function zK(){}Object.defineProperty(Ob,"__esModule",{value:!0});Ob.default=void 0;var d1=VK(m),qr=oC(Ks),BK=oC(Er),vr=Fn,cs=na,f1=ta,Xd=oC(Tb);function oC(e){return e&&e.__esModule?e:{default:e}}function Uk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Uk=function(r){return r?n:t})(e)}function VK(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Uk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Dr(e,t,n){return t=HK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HK(e){var t=WK(e,"string");return typeof t=="symbol"?t:String(t)}function WK(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 ci={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let us=ci.mouse,Db=class extends d1.Component{constructor(){super(...arguments),Dr(this,"dragging",!1),Dr(this,"lastX",NaN),Dr(this,"lastY",NaN),Dr(this,"touchIdentifier",null),Dr(this,"mounted",!1),Dr(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,vr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,vr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,vr.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,cs.getControlPosition)(t,o,this);if(i==null)return;const{x:a,y:s}=i,l=(0,cs.createCoreData)(this,a,s);(0,Xd.default)("DraggableCore: handleDragStart: %j",l),(0,Xd.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,vr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=s,(0,vr.addEvent)(r,us.move,this.handleDrag),(0,vr.addEvent)(r,us.stop,this.handleDragStop))}),Dr(this,"handleDrag",t=>{const n=(0,cs.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX,l=o-this.lastY;if([s,l]=(0,cs.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,o=this.lastY+l}const i=(0,cs.createCoreData)(this,r,o);if((0,Xd.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),Dr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,cs.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,cs.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,cs.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,vr.removeUserSelectStyles)(s.ownerDocument),(0,Xd.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,Xd.default)("DraggableCore: Removing handlers"),(0,vr.removeEvent)(s.ownerDocument,us.move,this.handleDrag),(0,vr.removeEvent)(s.ownerDocument,us.stop,this.handleDragStop))}),Dr(this,"onMouseDown",t=>(us=ci.mouse,this.handleDragStart(t))),Dr(this,"onMouseUp",t=>(us=ci.mouse,this.handleDragStop(t))),Dr(this,"onTouchStart",t=>(us=ci.touch,this.handleDragStart(t))),Dr(this,"onTouchEnd",t=>(us=ci.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,vr.addEvent)(t,ci.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,vr.removeEvent)(n,ci.mouse.move,this.handleDrag),(0,vr.removeEvent)(n,ci.touch.move,this.handleDrag),(0,vr.removeEvent)(n,ci.mouse.stop,this.handleDragStop),(0,vr.removeEvent)(n,ci.touch.stop,this.handleDragStop),(0,vr.removeEvent)(t,ci.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,vr.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:BK.default.findDOMNode(this)}render(){return d1.cloneElement(d1.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Ob.default=Db;Dr(Db,"displayName","DraggableCore");Dr(Db,"propTypes",{allowAnyClick:qr.default.bool,children:qr.default.node.isRequired,disabled:qr.default.bool,enableUserSelectHack:qr.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:qr.default.arrayOf(qr.default.number),handle:qr.default.string,cancel:qr.default.string,nodeRef:qr.default.object,onStart:qr.default.func,onDrag:qr.default.func,onStop:qr.default.func,onMouseDown:qr.default.func,scale:qr.default.number,className:f1.dontSetMe,style:f1.dontSetMe,transform:f1.dontSetMe});Dr(Db,"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=h(m),n=u(Ks),r=u(Er),o=u(cK),i=Fn,a=na,s=ta,l=u(Ob),c=u(Tb);function u(_){return _&&_.__esModule?_:{default:_}}function d(_){if(typeof WeakMap!="function")return null;var S=new WeakMap,C=new WeakMap;return(d=function(E){return E?C:S})(_)}function h(_,S){if(!S&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var C=d(S);if(C&&C.has(_))return C.get(_);var E={},$=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in _)if(T!=="default"&&Object.prototype.hasOwnProperty.call(_,T)){var D=$?Object.getOwnPropertyDescriptor(_,T):null;D&&(D.get||D.set)?Object.defineProperty(E,T,D):E[T]=_[T]}return E.default=_,C&&C.set(_,E),E}function p(){return p=Object.assign?Object.assign.bind():function(_){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(_[E]=C[E])}return _},p.apply(this,arguments)}function v(_,S,C){return S=b(S),S in _?Object.defineProperty(_,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[S]=C,_}function b(_){var S=x(_,"string");return typeof S=="symbol"?S:String(S)}function x(_,S){if(typeof _!="object"||_===null)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var E=C.call(_,S||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(_)}class y extends t.Component{static getDerivedStateFromProps(S,C){let{position:E}=S,{prevPropsPosition:$}=C;return E&&(!$||E.x!==$.x||E.y!==$.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:$}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(S){super(S),v(this,"onDragStart",(C,E)=>{if((0,c.default)("Draggable: onDragStart: %j",E),this.props.onStart(C,(0,a.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(C,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const $=(0,a.createDraggableData)(this,E),T={x:$.x,y:$.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:L}=T;T.x+=this.state.slackX,T.y+=this.state.slackY;const[F,z]=(0,a.getBoundPosition)(this,T.x,T.y);T.x=F,T.y=z,T.slackX=this.state.slackX+(M-T.x),T.slackY=this.state.slackY+(L-T.y),$.x=T.x,$.y=T.y,$.deltaX=T.x-this.state.x,$.deltaY=T.y-this.state.y}if(this.props.onDrag(C,$)===!1)return!1;this.setState(T)}),v(this,"onDragStop",(C,E)=>{if(!this.state.dragging||this.props.onStop(C,(0,a.createDraggableData)(this,E))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",E);const T={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:L}=this.props.position;T.x=M,T.y=L}this.setState(T)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var S,C;return(S=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:C,children:E,defaultPosition:$,defaultClassName:T,defaultClassNameDragging:D,defaultClassNameDragged:M,position:L,positionOffset:F,scale:z,...X}=this.props;let G={},A=null;const V=!!!L||this.state.dragging,K=L||$,q={x:(0,a.canDragX)(this)&&V?this.state.x:K.x,y:(0,a.canDragY)(this)&&V?this.state.y:K.y};this.state.isElementSVG?A=(0,i.createSVGTransform)(q,F):G=(0,i.createCSSTransform)(q,F);const O=(0,o.default)(E.props.className||"",T,{[D]:this.state.dragging,[M]:this.state.dragged});return t.createElement(l.default,p({},X,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:O,style:{...E.props.style,...G},transform:A}))}}e.default=y,v(y,"displayName","Draggable"),v(y,"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:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),v(y,"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})})(Lk);const{default:qk,DraggableCore:UK}=Lk;$b.exports=qk;$b.exports.default=qk;$b.exports.DraggableCore=UK;var Gk=$b.exports,Ab={exports:{}},lp={},iC={};iC.__esModule=!0;iC.cloneElement=QK;var qK=GK(m);function GK(e){return e&&e.__esModule?e:{default:e}}function n$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function r$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n$(Object(n),!0).forEach(function(r){YK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YK(e,t,n){return t=KK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KK(e){var t=XK(e,"string");return typeof t=="symbol"?t:String(t)}function XK(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 QK(e,t){return t.style&&e.props.style&&(t.style=r$(r$({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),qK.default.cloneElement(e,t)}var cp={};cp.__esModule=!0;cp.resizableProps=void 0;var yt=JK(Ks);function JK(e){return e&&e.__esModule?e:{default:e}}var ZK={axis:yt.default.oneOf(["both","x","y","none"]),className:yt.default.string,children:yt.default.element.isRequired,draggableOpts:yt.default.shape({allowAnyClick:yt.default.bool,cancel:yt.default.string,children:yt.default.node,disabled:yt.default.bool,enableUserSelectHack:yt.default.bool,offsetParent:yt.default.node,grid:yt.default.arrayOf(yt.default.number),handle:yt.default.string,nodeRef:yt.default.object,onStart:yt.default.func,onDrag:yt.default.func,onStop:yt.default.func,onMouseDown:yt.default.func,scale:yt.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=yt.default.number).isRequired.apply(i,n)}return yt.default.number.apply(yt.default,n)},handle:yt.default.oneOfType([yt.default.node,yt.default.func]),handleSize:yt.default.arrayOf(yt.default.number),lockAspectRatio:yt.default.bool,maxConstraints:yt.default.arrayOf(yt.default.number),minConstraints:yt.default.arrayOf(yt.default.number),onResizeStop:yt.default.func,onResizeStart:yt.default.func,onResize:yt.default.func,resizeHandles:yt.default.arrayOf(yt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:yt.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=yt.default.number).isRequired.apply(i,n)}return yt.default.number.apply(yt.default,n)}};cp.resizableProps=ZK;lp.__esModule=!0;lp.default=void 0;var Qd=oX(m),eX=Gk,tX=iC,nX=cp,rX=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Yk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Yk=function(o){return o?n:t})(e)}function oX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Yk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Aw(){return Aw=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},Aw.apply(this,arguments)}function iX(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function o$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function h1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o$(Object(n),!0).forEach(function(r){aX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aX(e,t,n){return t=sX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sX(e){var t=lX(e,"string");return typeof t=="symbol"?t:String(t)}function lX(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 cX(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Mw(e,t)}function Mw(e,t){return Mw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Mw(e,t)}var aC=function(e){cX(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var a=this.props,s=a.minConstraints,l=a.maxConstraints,c=a.lockAspectRatio;if(!s&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,h=i-this.props.height;Math.abs(d)>Math.abs(h*u)?i=o/u:o=i*u}var p=o,v=i,b=this.slack||[0,0],x=b[0],y=b[1];return o+=x,i+=y,s&&(o=Math.max(s[0],o),i=Math.max(s[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[x+(p-o),y+(v-i)],[o,i]},n.resizeHandler=function(o,i){var a=this;return function(s,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&a.resetData();var h=(a.props.axis==="both"||a.props.axis==="x")&&i!=="n"&&i!=="s",p=(a.props.axis==="both"||a.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!h&&!p)){var v=i[0],b=i[i.length-1],x=c.getBoundingClientRect();if(a.lastHandleRect!=null){if(b==="w"){var y=x.left-a.lastHandleRect.left;u+=y}if(v==="n"){var _=x.top-a.lastHandleRect.top;d+=_}}a.lastHandleRect=x,b==="w"&&(u=-u),v==="n"&&(d=-d);var S=a.props.width+(h?u/a.props.transformScale:0),C=a.props.height+(p?d/a.props.transformScale:0),E=a.runConstraints(S,C);S=E[0],C=E[1];var $=S!==a.props.width||C!==a.props.height,T=typeof a.props[o]=="function"?a.props[o]:null,D=o==="onResize"&&!$;T&&!D&&(s.persist==null||s.persist(),T(s,{node:c,size:{width:S,height:C},handle:i})),o==="onResizeStop"&&a.resetData()}}},n.renderResizeHandle=function(o,i){var a=this.props.handle;if(!a)return Qd.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof a=="function")return a(o,i);var s=typeof a.type=="string",l=h1({ref:i},s?{}:{handleAxis:o});return Qd.cloneElement(a,l)},n.render=function(){var o=this,i=this.props,a=i.children,s=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=iX(i,rX);return(0,tX.cloneElement)(a,h1(h1({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(a.props.children,c.map(function(d){var h,p=(h=o.handleRefs[d])!=null?h:o.handleRefs[d]=Qd.createRef();return Qd.createElement(eX.DraggableCore,Aw({},l,{nodeRef:p,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,p))}))}))},t}(Qd.Component);lp.default=aC;aC.propTypes=nX.resizableProps;aC.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Mb={};Mb.__esModule=!0;Mb.default=void 0;var p1=pX(m),uX=Kk(Ks),dX=Kk(lp),fX=cp,hX=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Kk(e){return e&&e.__esModule?e:{default:e}}function Xk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Xk=function(o){return o?n:t})(e)}function pX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Xk(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function kw(){return kw=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},kw.apply(this,arguments)}function i$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function h0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i$(Object(n),!0).forEach(function(r){gX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gX(e,t,n){return t=mX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mX(e){var t=bX(e,"string");return typeof t=="symbol"?t:String(t)}function bX(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 vX(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function yX(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Iw(e,t)}function Iw(e,t){return Iw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Iw(e,t)}var Qk=function(e){yX(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(s,l){var c=l.size;r.props.onResize?(s.persist==null||s.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(s,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,a=o.handleSize;o.onResize;var s=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,h=o.lockAspectRatio,p=o.axis;o.width,o.height;var v=o.resizeHandles,b=o.style,x=o.transformScale,y=vX(o,hX);return p1.createElement(dX.default,{axis:p,draggableOpts:c,handle:i,handleSize:a,height:this.state.height,lockAspectRatio:h,maxConstraints:d,minConstraints:u,onResizeStart:s,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},p1.createElement("div",kw({},y,{style:h0(h0({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(p1.Component);Mb.default=Qk;Qk.propTypes=h0(h0({},fX.resizableProps),{},{children:uX.default.element});Ab.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};Ab.exports.Resizable=lp.default;Ab.exports.ResizableBox=Mb.default;var xX=Ab.exports,Ia={};Object.defineProperty(Ia,"__esModule",{value:!0});Ia.resizeHandleType=Ia.resizeHandleAxesType=Ia.default=void 0;var Et=Jk(Ks),wX=Jk(m);function Jk(e){return e&&e.__esModule?e:{default:e}}const Zk=Et.default.arrayOf(Et.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));Ia.resizeHandleAxesType=Zk;const e6=Et.default.oneOfType([Et.default.node,Et.default.func]);Ia.resizeHandleType=e6;var _X={className:Et.default.string,style:Et.default.object,width:Et.default.number,autoSize:Et.default.bool,cols:Et.default.number,draggableCancel:Et.default.string,draggableHandle:Et.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:Et.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Dt.validateLayout(t,"layout")},margin:Et.default.arrayOf(Et.default.number),containerPadding:Et.default.arrayOf(Et.default.number),rowHeight:Et.default.number,maxRows:Et.default.number,isBounded:Et.default.bool,isDraggable:Et.default.bool,isResizable:Et.default.bool,allowOverlap:Et.default.bool,preventCollision:Et.default.bool,useCSSTransforms:Et.default.bool,transformScale:Et.default.number,isDroppable:Et.default.bool,resizeHandles:Zk,resizeHandle:e6,onLayoutChange:Et.default.func,onDragStart:Et.default.func,onDrag:Et.default.func,onDragStop:Et.default.func,onResizeStart:Et.default.func,onResize:Et.default.func,onResizeStop:Et.default.func,onDrop:Et.default.func,droppingItem:Et.default.shape({i:Et.default.string.isRequired,w:Et.default.number.isRequired,h:Et.default.number.isRequired}),children:function(e,t){const n=e[t],r={};wX.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:Et.default.any};Ia.default=_X;Object.defineProperty(Pb,"__esModule",{value:!0});Pb.default=void 0;var Uc=sC(m),Gt=sC(Ks),SX=Gk,CX=xX,qc=Dt,sr=ea,a$=Ia,EX=sC(US);function sC(e){return e&&e.__esModule?e:{default:e}}function Di(e,t,n){return t=RX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RX(e){var t=PX(e,"string");return typeof t=="symbol"?t:String(t)}function PX(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 lC extends Uc.default.Component{constructor(){super(...arguments),Di(this,"state",{resizing:null,dragging:null,className:""}),Di(this,"elementRef",Uc.default.createRef()),Di(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const a={top:0,left:0},{offsetParent:s}=r;if(!s)return;const l=s.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,d=l.left/i,h=c.top/i,p=l.top/i;a.left=u-d+s.scrollLeft,a.top=h-p+s.scrollTop,this.setState({dragging:a});const{x:v,y:b}=(0,sr.calcXY)(this.getPositionParams(),a.top,a.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,b,{e:t,node:r,newPosition:a})}),Di(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let s=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:d,h,containerWidth:p}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:S,rowHeight:C}=this.props,E=_.clientHeight-(0,sr.calcGridItemWHPx)(h,C,S[1]);s=(0,sr.clamp)(s,0,E);const $=(0,sr.calcGridColWidth)(v),T=p-(0,sr.calcGridItemWHPx)(d,$,S[0]);l=(0,sr.clamp)(l,0,T)}}const b={top:s,left:l};this.setState({dragging:b});const{x,y}=(0,sr.calcXY)(v,s,l,d,h);return a.call(this,u,x,y,{e:t,node:r,newPosition:b})}),Di(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:a,i:s}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:h}=(0,sr.calcXY)(this.getPositionParams(),c,l,i,a);return o.call(this,s,d,h,{e:t,node:r,newPosition:u})}),Di(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Di(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Di(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,sr.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,sr.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,qc.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,a=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(a){const s=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:s,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,qc.setTransform)(t):(i=(0,qc.setTopLeft)(t),n&&(i.left=(0,qc.perc)(t.left/r),i.width=(0,qc.perc)(t.width/r))),i}mixinDraggable(t,n){return Uc.default.createElement(SX.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:a,maxW:s,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,h=this.getPositionParams(),p=(0,sr.calcGridItemPosition)(h,0,0,o,0).width,v=(0,sr.calcGridItemPosition)(h,0,0,i,a),b=(0,sr.calcGridItemPosition)(h,0,0,s,l),x=[v.width,v.height],y=[Math.min(b.width,p),Math.min(b.height,1/0)];return Uc.default.createElement(CX.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:y,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,n,r,o){let{node:i,size:a,handle:s}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:d,maxH:h,minH:p,containerWidth:v}=this.props,{minW:b,maxW:x}=this.props;let y=a;i&&(y=(0,qc.resizeItemInDirection)(s,r,a,v),this.setState({resizing:o==="onResizeStop"?null:y}));let{w:_,h:S}=(0,sr.calcWH)(this.getPositionParams(),y.width,y.height,c,u,s);_=(0,sr.clamp)(_,Math.max(b,1),x),S=(0,sr.clamp)(S,p,h),l.call(this,d,_,S,{e:t,node:i,size:y,handle:s})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:a,droppingPosition:s,useCSSTransforms:l}=this.props,c=(0,sr.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Uc.default.Children.only(this.props.children);let d=Uc.default.cloneElement(u,{ref:this.elementRef,className:(0,EX.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!s,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,a),d=this.mixinDraggable(d,i),d}}Pb.default=lC;Di(lC,"propTypes",{children:Gt.default.element,cols:Gt.default.number.isRequired,containerWidth:Gt.default.number.isRequired,rowHeight:Gt.default.number.isRequired,margin:Gt.default.array.isRequired,maxRows:Gt.default.number.isRequired,containerPadding:Gt.default.array.isRequired,x:Gt.default.number.isRequired,y:Gt.default.number.isRequired,w:Gt.default.number.isRequired,h:Gt.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:Gt.default.string.isRequired,resizeHandles:a$.resizeHandleAxesType,resizeHandle:a$.resizeHandleType,onDragStop:Gt.default.func,onDragStart:Gt.default.func,onDrag:Gt.default.func,onResizeStop:Gt.default.func,onResizeStart:Gt.default.func,onResize:Gt.default.func,isDraggable:Gt.default.bool.isRequired,isResizable:Gt.default.bool.isRequired,isBounded:Gt.default.bool.isRequired,static:Gt.default.bool,useCSSTransforms:Gt.default.bool.isRequired,transformScale:Gt.default.number,className:Gt.default.string,handle:Gt.default.string,cancel:Gt.default.string,droppingPosition:Gt.default.shape({e:Gt.default.object.isRequired,left:Gt.default.number.isRequired,top:Gt.default.number.isRequired})});Di(lC,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(sp,"__esModule",{value:!0});sp.default=void 0;var ul=DX(m),g1=WS,$X=cC(US),at=Dt,OX=ea,s$=cC(Pb),TX=cC(Ia);function cC(e){return e&&e.__esModule?e:{default:e}}function t6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(t6=function(r){return r?n:t})(e)}function DX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=t6(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function yr(e,t,n){return t=AX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AX(e){var t=MX(e,"string");return typeof t=="symbol"?t:String(t)}function MX(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 l$="react-grid-layout";let n6=!1;try{n6=/firefox/i.test(navigator.userAgent)}catch{}class kb extends ul.Component{constructor(){super(...arguments),yr(this,"state",{activeDrag:null,layout:(0,at.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,at.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),yr(this,"dragEnterCounter",0),yr(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,at.getLayoutItem)(s,t);if(l)return this.setState({oldDragItem:(0,at.cloneLayoutItem)(l),oldLayout:s}),this.props.onDragStart(s,l,l,null,i,a)}),yr(this,"onDrag",(t,n,r,o)=>{let{e:i,node:a}=o;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,h=(0,at.getLayoutItem)(l,t);if(!h)return;const p={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t},v=!0;l=(0,at.moveElement)(l,h,n,r,v,d,(0,at.compactType)(this.props),c,u),this.props.onDrag(l,s,h,p,i,a),this.setState({layout:u?l:(0,at.compact)(l,(0,at.compactType)(this.props),c),activeDrag:p})}),yr(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:a}=o;if(!this.state.activeDrag)return;const{oldDragItem:s}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,h=(0,at.getLayoutItem)(l,t);if(!h)return;const p=!0;l=(0,at.moveElement)(l,h,n,r,p,u,(0,at.compactType)(this.props),c,d);const v=d?l:(0,at.compact)(l,(0,at.compactType)(this.props),c);this.props.onDragStop(v,s,h,null,i,a);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),yr(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s}=this.state,l=(0,at.getLayoutItem)(s,t);l&&(this.setState({oldResizeItem:(0,at.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(s,l,l,null,i,a))}),yr(this,"onResize",(t,n,r,o)=>{let{e:i,node:a,size:s,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:d,preventCollision:h,allowOverlap:p}=this.props;let v=!1,b,x,y;const[_,S]=(0,at.withLayoutItem)(u,t,E=>{let $;return x=E.x,y=E.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=E.x+(E.w-n),n=E.x!==x&&x<0?E.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(y=E.y+(E.h-r),r=E.y!==y&&y<0?E.h:r,y=y<0?0:y),v=!0),h&&!p&&($=(0,at.getAllCollisions)(u,{...E,w:n,h:r,x,y}).filter(D=>D.i!==E.i).length>0,$&&(y=E.y,r=E.h,x=E.x,n=E.w,v=!1)),E.w=n,E.h=r,E});if(!S)return;b=_,v&&(b=(0,at.moveElement)(_,S,x,y,!0,this.props.preventCollision,(0,at.compactType)(this.props),d,p));const C={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(b,c,S,C,i,a),this.setState({layout:p?b:(0,at.compact)(b,(0,at.compactType)(this.props),d),activeDrag:C})}),yr(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:s,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,at.getLayoutItem)(s,t),h=u?s:(0,at.compact)(s,(0,at.compactType)(this.props),c);this.props.onResizeStop(h,l,d,null,i,a);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,p)}),yr(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),n6&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(l$)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:a,rowHeight:s,maxRows:l,width:c,containerPadding:u,transformScale:d}=this.props,h=o==null?void 0:o(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...h},{layout:v}=this.state,{layerX:b,layerY:x}=t.nativeEvent,y={left:b/d,top:x/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=b||S!=x)&&this.setState({droppingPosition:y})}}else{const _={cols:a,margin:i,maxRows:l,rowHeight:s,containerWidth:c,containerPadding:u||i},S=(0,OX.calcXY)(_,x,b,p.w,p.h);this.setState({droppingDOMNode:ul.createElement("div",{key:p.i}),droppingPosition:y,layout:[...v,{...p,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),yr(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,at.compact)(r.filter(i=>i.i!==t.i),(0,at.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),yr(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),yr(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),yr(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,g1.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,at.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,at.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,at.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,at.fastRGLPropsEqual)(this.props,t,g1.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,at.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,g1.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:a,maxRows:s,useCSSTransforms:l,transformScale:c}=this.props;return ul.createElement(s$.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:s,rowHeight:a,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},ul.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,at.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:a,containerPadding:s,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:h,useCSSTransforms:p,transformScale:v,draggableCancel:b,draggableHandle:x,resizeHandles:y,resizeHandle:_}=this.props,{mounted:S,droppingPosition:C}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,$=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,T=r.resizeHandles||y,D=E&&h&&r.isBounded!==!1;return ul.createElement(s$.default,{containerWidth:o,cols:i,margin:a,containerPadding:s||a,maxRows:c,rowHeight:l,cancel:b,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:$,isBounded:D,useCSSTransforms:p&&S,usePercentages:!S,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?C:void 0,resizeHandles:T,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,$X.default)(l$,t),a={height:this.containerHeight(),...n};return ul.createElement("div",{ref:o,className:i,style:a,onDrop:r?this.onDrop:at.noop,onDragLeave:r?this.onDragLeave:at.noop,onDragEnter:r?this.onDragEnter:at.noop,onDragOver:r?this.onDragOver:at.noop},ul.Children.map(this.props.children,s=>this.processGridItem(s)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}sp.default=kb;yr(kb,"displayName","ReactGridLayout");yr(kb,"propTypes",TX.default);yr(kb,"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:at.noop,onDragStart:at.noop,onDrag:at.noop,onDragStop:at.noop,onResizeStart:at.noop,onResize:at.noop,onResizeStop:at.noop,onDrop:at.noop,onDropDragOver:at.noop});var Ib={},xc={};Object.defineProperty(xc,"__esModule",{value:!0});xc.findOrGenerateResponsiveLayout=NX;xc.getBreakpointFromWidth=kX;xc.getColsFromBreakpoint=IX;xc.sortBreakpoints=uC;var Ag=Dt;function kX(e,t){const n=uC(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const a=n[o];t>e[a]&&(r=a)}return r}function IX(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function NX(e,t,n,r,o,i){if(e[n])return(0,Ag.cloneLayout)(e[n]);let a=e[r];const s=uC(t),l=s.slice(s.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){a=e[d];break}}return a=(0,Ag.cloneLayout)(a||[]),(0,Ag.compact)((0,Ag.correctBounds)(a,{cols:o}),i,o)}function uC(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Ib,"__esModule",{value:!0});Ib.default=void 0;var c$=FX(m),Gr=r6(Ks),m1=WS,xu=Dt,dl=xc,LX=r6(sp);function r6(e){return e&&e.__esModule?e:{default:e}}function o6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(o6=function(r){return r?n:t})(e)}function FX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=o6(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Nw(){return Nw=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},Nw.apply(this,arguments)}function p0(e,t,n){return t=jX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jX(e){var t=zX(e,"string");return typeof t=="symbol"?t:String(t)}function zX(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 u$=e=>Object.prototype.toString.call(e);function Mg(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class dC extends c$.Component{constructor(){super(...arguments),p0(this,"state",this.generateInitialState()),p0(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,dl.getBreakpointFromWidth)(n,t),a=(0,dl.getColsFromBreakpoint)(i,o),s=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,dl.findOrGenerateResponsiveLayout)(r,n,i,i,a,s),breakpoint:i,cols:a}}static getDerivedStateFromProps(t,n){if(!(0,m1.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,dl.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,m1.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,m1.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,a=this.props.breakpoint||(0,dl.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),s=this.state.breakpoint,l=(0,dl.getColsFromBreakpoint)(a,r),c={...o};if(s!==a||t.breakpoints!==n||t.cols!==r){s in c||(c[s]=(0,xu.cloneLayout)(this.state.layout));let h=(0,dl.findOrGenerateResponsiveLayout)(c,n,a,s,l,i);h=(0,xu.synchronizeLayoutWithChildren)(h,this.props.children,l,i,this.props.allowOverlap),c[a]=h,this.props.onLayoutChange(h,c),this.props.onBreakpointChange(a,l),this.setState({breakpoint:a,layout:h,cols:l})}const u=Mg(this.props.margin,a),d=Mg(this.props.containerPadding,a);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:a,onBreakpointChange:s,onLayoutChange:l,onWidthChange:c,...u}=this.props;return c$.createElement(LX.default,Nw({},u,{margin:Mg(i,this.state.breakpoint),containerPadding:Mg(a,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Ib.default=dC;p0(dC,"propTypes",{breakpoint:Gr.default.string,breakpoints:Gr.default.object,allowOverlap:Gr.default.bool,cols:Gr.default.object,margin:Gr.default.oneOfType([Gr.default.array,Gr.default.object]),containerPadding:Gr.default.oneOfType([Gr.default.array,Gr.default.object]),layouts(e,t){if(u$(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+u$(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,xu.validateLayout)(e.layouts[n],"layouts."+n)})},width:Gr.default.number.isRequired,onBreakpointChange:Gr.default.func,onLayoutChange:Gr.default.func,onWidthChange:Gr.default.func});p0(dC,"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:xu.noop,onLayoutChange:xu.noop,onWidthChange:xu.noop});var fC={},i6=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var a=i[o];n.call(r,a[1],a[0])}},t}()}(),Lw=typeof window<"u"&&typeof document<"u"&&window.document===document,g0=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")()}(),BX=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(g0):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),VX=2;function HX(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){BX(i)}function s(){var l=Date.now();if(n){if(l-o<VX)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=l}return s}var WX=20,UX=["top","right","bottom","left","width","height","size","weight"],qX=typeof MutationObserver<"u",GX=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=HX(this.refresh.bind(this),WX)}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(){!Lw||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),qX?(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(){!Lw||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=UX.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),a6=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Gu=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||g0},s6=Nb(0,0,0,0);function m0(e){return parseFloat(e)||0}function d$(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+m0(i)},0)}function YX(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],a=e["padding-"+i];n[i]=m0(a)}return n}function KX(e){var t=e.getBBox();return Nb(0,0,t.width,t.height)}function XX(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return s6;var r=Gu(e).getComputedStyle(e),o=YX(r),i=o.left+o.right,a=o.top+o.bottom,s=m0(r.width),l=m0(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+i)!==t&&(s-=d$(r,"left","right")+i),Math.round(l+a)!==n&&(l-=d$(r,"top","bottom")+a)),!JX(e)){var c=Math.round(s+i)-t,u=Math.round(l+a)-n;Math.abs(c)!==1&&(s-=c),Math.abs(u)!==1&&(l-=u)}return Nb(o.left,o.top,s,l)}var QX=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Gu(e).SVGGraphicsElement}:function(e){return e instanceof Gu(e).SVGElement&&typeof e.getBBox=="function"}}();function JX(e){return e===Gu(e).document.documentElement}function ZX(e){return Lw?QX(e)?KX(e):XX(e):s6}function eQ(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(i.prototype);return a6(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function Nb(e,t,n,r){return{x:e,y:t,width:n,height:r}}var tQ=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Nb(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=ZX(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}(),nQ=function(){function e(t,n){var r=eQ(n);a6(this,{target:t,contentRect:r})}return e}(),rQ=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new i6,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 Gu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new tQ(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 Gu(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 nQ(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}(),l6=typeof WeakMap<"u"?new WeakMap:new i6,c6=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=GX.getInstance(),r=new rQ(t,n,this);l6.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){c6.prototype[e]=function(){var t;return(t=l6.get(this))[e].apply(t,arguments)}});var oQ=function(){return typeof g0.ResizeObserver<"u"?g0.ResizeObserver:c6}();const iQ=Object.freeze(Object.defineProperty({__proto__:null,default:oQ},Symbol.toStringTag,{value:"Module"})),aQ=SS(iQ);Object.defineProperty(fC,"__esModule",{value:!0});fC.default=pQ;var kg=uQ(m),sQ=hC(Ks),lQ=hC(aQ),cQ=hC(US);function hC(e){return e&&e.__esModule?e:{default:e}}function u6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(u6=function(r){return r?n:t})(e)}function uQ(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=u6(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Fw(){return Fw=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},Fw.apply(this,arguments)}function Gc(e,t,n){return t=dQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dQ(e){var t=fQ(e,"string");return typeof t=="symbol"?t:String(t)}function fQ(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 hQ="react-grid-layout";function pQ(e){var t;return t=class extends kg.Component{constructor(){super(...arguments),Gc(this,"state",{width:1280}),Gc(this,"elementRef",kg.createRef()),Gc(this,"mounted",!1),Gc(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new lQ.default(o=>{if(this.elementRef.current instanceof HTMLElement){const a=o[0].contentRect.width;this.setState({width:a})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?kg.createElement("div",{className:(0,cQ.default)(this.props.className,hQ),style:this.props.style,ref:this.elementRef}):kg.createElement(e,Fw({innerRef:this.elementRef},o,this.state))}},Gc(t,"defaultProps",{measureBeforeMount:!1}),Gc(t,"propTypes",{measureBeforeMount:sQ.default.bool}),t}(function(e){e.exports=sp.default,e.exports.utils=Dt,e.exports.calculateUtils=ea,e.exports.Responsive=Ib.default,e.exports.Responsive.utils=xc,e.exports.WidthProvider=fC.default})(_k);var f$=_k.exports;function Br(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var gQ=["color"],mQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,gQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),bQ=["color"],d6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,bQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),vQ=["color"],yQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,vQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),xQ=["color"],wQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,xQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),_Q=["color"],f6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,_Q);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),SQ=["color"],CQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,SQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),EQ=["color"],RQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,EQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),PQ=["color"],$Q=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,PQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),OQ=["color"],TQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,OQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),DQ=["color"],h6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,DQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),AQ=["color"],MQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,AQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),kQ=["color"],IQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,kQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),NQ=["color"],LQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,NQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),FQ=["color"],p6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,FQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),jQ=["color"],g6=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,jQ);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Ig;const zQ=new Uint8Array(16);function BQ(){if(!Ig&&(Ig=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ig))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ig(zQ)}const lr=[];for(let e=0;e<256;++e)lr.push((e+256).toString(16).slice(1));function VQ(e,t=0){return lr[e[t+0]]+lr[e[t+1]]+lr[e[t+2]]+lr[e[t+3]]+"-"+lr[e[t+4]]+lr[e[t+5]]+"-"+lr[e[t+6]]+lr[e[t+7]]+"-"+lr[e[t+8]]+lr[e[t+9]]+"-"+lr[e[t+10]]+lr[e[t+11]]+lr[e[t+12]]+lr[e[t+13]]+lr[e[t+14]]+lr[e[t+15]]}const HQ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),h$={randomUUID:HQ};function Fs(e,t,n){if(h$.randomUUID&&!t&&!e)return h$.randomUUID();e=e||{};const r=e.random||(e.rng||BQ)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return VQ(r)}const Ir=DM()(FM((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:Fs(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Fs(),cards:[],activeCardId:""},actions:{setCustomCardPreferences:n=>{e(r=>{r.card.customCardPreferences=n})},setChartOrientation:n=>{e(r=>{var a,s,l,c,u,d;const o=r.card.preferences;let i={};((a=o==null?void 0:o.chartOptions)==null?void 0:a.indexAxis)!==n&&(i={x:(l=(s=o==null?void 0:o.chartOptions)==null?void 0:s.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(d=o==null?void 0:o.chartOptions)==null?void 0:d.scales,...i},indexAxis:n}}})},setSortChart:n=>{e(r=>{r.card.preferences={...r.card.preferences,sortChart:n}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,o,i)=>{e(a=>{var s,l,c;a.card.preferences={...(s=a.card)==null?void 0:s.preferences,formatNumber:{...(c=(l=a.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},updateCardInFrame:n=>{e(r=>{r.frame.cards=r.frame.cards.map(o=>o.id===n.id?n:o)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,indexAxis:"y"}})})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setSelectedDatamodelId:n=>{var r,o;e(i=>{i.selectedDatamodelId=n,i.card.datamodelId=n}),(o=(r=t()).onDatamodelChange)==null||o.call(r,n)},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),Lb=()=>Ir(e=>e.actions);function WQ(e,t,n){var l,c,u,d;const r=n==null?void 0:n.datasetOptions,o=we.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,a=(d=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:d.borderColor;return e.map((h,p)=>{var S;const v=r==null?void 0:r.find(C=>C.idx===p),b=i==null?void 0:i[p%i.length],x=a==null?void 0:a[p%a.length],y=a==null?void 0:a[p%a.length];return{label:h.charAt(0).toUpperCase()+h.slice(1),data:t.map(C=>C[h]),...v,datalabels:{...v==null?void 0:v.datalabels,color:UQ((S=v==null?void 0:v.datalabels)==null?void 0:S.align,b)},backgroundColor:b,pointBackgroundColor:x,borderColor:y}})}function UQ(e,t){return qu(e==="end"||e==="start"?oh():t)}function qQ(e){var s,l,c,u;const{metricKeys:t,dimensionKeys:n}=tr(e);let r=[];const o=we.getState().themeStyle,i=(l=(s=o==null?void 0:o.chart)==null?void 0:s.dataset)==null?void 0:l.backgroundColor,a=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const d=e.map(h=>({x:h[t[0]],y:h[t[1]],r:h[t[2]],label:h[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:d}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(h=>h[n==null?void 0:n[1]]))].map((h,p)=>{const v=e.filter(b=>b[n==null?void 0:n[1]]===h);return{label:h,data:v.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[p%i.length],borderColor:a==null?void 0:a[p%a.length]}})),r}function GQ(e){var c,u,d,h;const{dimensionKeys:t,metricKeys:n}=tr(e),r=we.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(h=(d=r==null?void 0:r.chart)==null?void 0:d.dataset)==null?void 0:h.borderColor,a=t==null?void 0:t[1];return[...new Set(e.map(p=>p==null?void 0:p[a]))].map((p,v)=>({label:p,data:e.filter(b=>(b==null?void 0:b[a])===p).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:o==null?void 0:o[v%o.length],borderColor:i==null?void 0:i[v%i.length],borderSkipped:!1}))}function YQ(e,t){var a,s,l,c;const n=we.getState().themeStyle,r=(s=(a=n==null?void 0:n.chart)==null?void 0:a.dataset)==null?void 0:s.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(d=>d[u]),backgroundColor:t.map((d,h)=>(d==null?void 0:d._color)||(r==null?void 0:r[h%r.length])),borderColor:t.map((d,h)=>(d==null?void 0:d._color)||(o==null?void 0:o[h%o.length]))}))}function KQ(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function tr(e){if(!e||e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=KQ(e),n=Object.keys(e[t]),r=n.filter(i=>{var a,s,l,c,u,d,h,p;return!!(typeof((a=e==null?void 0:e[t])==null?void 0:a[i])&&typeof((s=e==null?void 0:e[t])==null?void 0:s[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((d=e==null?void 0:e[1])==null?void 0:d[i])=="string"||typeof((h=e==null?void 0:e[2])==null?void 0:h[i])&&typeof((p=e==null?void 0:e[2])==null?void 0:p[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var a,s;return((a=e==null?void 0:e[t])==null?void 0:a[i])===+((s=e==null?void 0:e[t])==null?void 0:s[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function Cf(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,a)=>({...i,...n[a],data:i.data,label:i.label})):e}function XQ(e,t="asc"){function n(r){return Object.entries(r).slice(1).reduce((a,[s,l])=>{const c=typeof l=="number"?l:parseFloat(l);return a+(isNaN(c)?0:c)},0)}return e.sort((r,o)=>{const i=n(r),a=n(o);return t==="asc"?i-a:a-i})}function b0({dataArray:e,groupKey:t,pivotKey:n,valueKey:r,sortChart:o}){const i=e.reduce((s,l)=>{const c=l[t],u=l[n],d=l[r];return s[c]||(s[c]={[t]:c}),s[c][u]=d,s},{});let a=Object.values(i);return o!=="none"&&o!==void 0&&(a=XQ(a,o)),a}function qo(e,t){var a;const n=we.getState().themeStyle,r=(a=n==null?void 0:n.chart)==null?void 0:a.options,o=Vl.cloneDeep(r);return Vl.merge(o,e,t)}function jw(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
110
+ * @license lucide-react v0.453.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const QQ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m6=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
115
+ * @license lucide-react v0.453.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */var JQ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
120
+ * @license lucide-react v0.453.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const b6=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>m.createElement("svg",{ref:l,...JQ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:m6("lucide",o),...s},[...a.map(([c,u])=>m.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
125
+ * @license lucide-react v0.453.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const jn=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(b6,{ref:i,iconNode:t,className:m6(`lucide-${QQ(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
130
+ * @license lucide-react v0.453.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const zw=jn("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
135
+ * @license lucide-react v0.453.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const v6=jn("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
140
+ * @license lucide-react v0.453.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const up=jn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
145
+ * @license lucide-react v0.453.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const Fb=jn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
150
+ * @license lucide-react v0.453.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const pC=jn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
155
+ * @license lucide-react v0.453.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const jb=jn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
160
+ * @license lucide-react v0.453.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const y6=jn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
165
+ * @license lucide-react v0.453.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const gC=jn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
170
+ * @license lucide-react v0.453.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const x6=jn("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
175
+ * @license lucide-react v0.453.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const mC=jn("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
180
+ * @license lucide-react v0.453.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const w6=jn("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
185
+ * @license lucide-react v0.453.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const _6=jn("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
190
+ * @license lucide-react v0.453.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const S6=jn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
195
+ * @license lucide-react v0.453.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const C6=jn("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
200
+ * @license lucide-react v0.453.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const bC=jn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
205
+ * @license lucide-react v0.453.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const E6=jn("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
210
+ * @license lucide-react v0.453.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const R6=jn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
215
+ * @license lucide-react v0.453.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const vC=jn("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
220
+ * @license lucide-react v0.453.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const P6=jn("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
225
+ * @license lucide-react v0.453.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const $6=jn("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
230
+ * @license lucide-react v0.453.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const md=jn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ZQ=({data:e,filename:t="output.csv"})=>{const n=()=>{if(e.length===0)return;const r=[],o=Object.keys(e[0]);r.push(o.join(","));for(const c of e){const u=o.map(d=>`"${(""+c[d]).replace(/"/g,'""')}"`);r.push(u.join(","))}const i=r.join(`
235
+ `),a=new Blob([i],{type:"text/csv"}),s=window.URL.createObjectURL(a),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",s),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return R.jsx(x6,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function O6({frame:e}){var S;const t=we(C=>C.isDashboardEditing),n=we(C=>C.filterValues),r=we(C=>C.isVisualEditing),o=we(C=>C.selectedSheetId);we(C=>C.currentBreakpoint);const{removeFrame:i}=we(C=>C.actions),a=we(C=>C.actions.setIsVisualEditing),s=Ir(C=>C.actions.setFilterValues),l=Ir(C=>C.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:d}=Ir(C=>C.actions),h=Ir(C=>C.actions.setSelectedConnectionId),p=Ir(C=>C.actions.setSelectedDatamodelId),v=Ir(C=>C.actions.setSelectedDatabaseName),b=Ir(C=>C.actions.setSelectedSchemaName),x=Ir(C=>C.actions.setSelectedTableName),y=e.cards.find(C=>C.id===e.activeCardId);function _(){a(!r),c(y);const{dimensionKeys:C}=tr((y==null?void 0:y.data)||[]);d(C),u(e),y!=null&&y.connectionId&&h(y==null?void 0:y.connectionId),y!=null&&y.datamodelId&&y.datamodelId!=="none"&&(p(y==null?void 0:y.datamodelId),v("")),y!=null&&y.lastSelectedDatabase&&y.lastSelectedDatabase!=="none"&&(v(y==null?void 0:y.lastSelectedDatabase),p("")),y!=null&&y.lastSelectedSchema&&b(y==null?void 0:y.lastSelectedSchema),y!=null&&y.lastSelectedTable&&x(y==null?void 0:y.lastSelectedTable),n&&(s(n),l(!0))}return R.jsx("section",{className:"absolute right-2 top-2 z-10",children:R.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?R.jsx(RQ,{onClick:()=>{a(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):R.jsx($Q,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&R.jsx(f6,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((S=y.preferences)==null?void 0:S.allowDownload)===!0&&R.jsx(ZQ,{data:(y==null?void 0:y.data)||[],filename:y.title})]})})}function eJ(e,t){we(a=>a.selectedSheetId);const n=we(a=>a.selectedFrameId),r=we(a=>a.isDashboardEditing),o=we(a=>a.isVisualEditing);we(a=>a.actions),m.useEffect(()=>{n===e.id&&r&&!o&&i()},[n,e.id,r,o]);function i(){const a=t==null?void 0:t.current;a==null||a.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}const tJ=m.createContext(null),b1={didCatch:!1,error:null};class zb extends m.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=b1}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(b1)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&nJ(t.resetKeys,o)){var i,a;(i=(a=this.props).onReset)===null||i===void 0||i.call(a,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(b1)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:a}=this.state;let s=t;if(i){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")s=n(l);else if(r)s=m.createElement(r,l);else if(o!==void 0)s=o;else throw a}return m.createElement(tJ.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function nJ(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function yC({error:e}){return R.jsx("div",{className:"flex flex-col items-center justify-center",role:"alert",style:{height:"100%"},children:R.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md bg-muted p-10",children:[R.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),R.jsx("p",{className:"text-sm",children:"Something went wrong:"}),R.jsx("pre",{className:"text-xs",children:e.message})]})})}function rJ({error:e,frame:t}){return R.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[R.jsx(O6,{frame:t}),R.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),R.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[R.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),R.jsx("p",{className:"text-sm",children:"Something went wrong:"}),R.jsx("pre",{className:"text-xs",children:e.message})]})]})}function oJ({error:e}){return R.jsxs("div",{className:"flex h-full flex-col items-center justify-center",role:"alert",children:[R.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),R.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[R.jsx("p",{className:"text-lg font-semibold",children:"Oops! Something went wrong!"}),R.jsx("p",{className:"text-sm",children:"Something went wrong:"}),R.jsx("pre",{className:"text-xs",children:e.message})]})]})}var Yu=1e3,Ku=Yu*60,Xu=Ku*60,ic=Xu*24,iJ=ic*7,aJ=ic*365.25,sJ=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return lJ(e);if(n==="number"&&isFinite(e))return t.long?uJ(e):cJ(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function lJ(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*aJ;case"weeks":case"week":case"w":return n*iJ;case"days":case"day":case"d":return n*ic;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Xu;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ku;case"seconds":case"second":case"secs":case"sec":case"s":return n*Yu;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function cJ(e){var t=Math.abs(e);return t>=ic?Math.round(e/ic)+"d":t>=Xu?Math.round(e/Xu)+"h":t>=Ku?Math.round(e/Ku)+"m":t>=Yu?Math.round(e/Yu)+"s":e+"ms"}function uJ(e){var t=Math.abs(e);return t>=ic?Ng(e,t,ic,"day"):t>=Xu?Ng(e,t,Xu,"hour"):t>=Ku?Ng(e,t,Ku,"minute"):t>=Yu?Ng(e,t,Yu,"second"):e+" ms"}function Ng(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const dJ=mc(sJ);function fJ(e){const t=we(u=>u.selectedSheetId),n=we(u=>u.selectedLensId),r=we(u=>u.dashboard.baseQueries),o=we(u=>u.dashboard.filters),i=we(u=>u.filterValues),a=o==null?void 0:o.filter(u=>u.sheetId===t||!u.sheetId),s=i==null?void 0:i.filter(u=>(a==null?void 0:a.some(d=>d.id===u.filterId))||u.filterId.endsWith(t)),l=Eq(e.sql,r);return{queryKey:["query",e.id,l,n||"",JSON.stringify(s)],sql:l,sheetFilterValues:s}}function Bb(e,t){const{authToken:n}=_i(),r=we(d=>d.isVisualEditing),o=we(d=>d.authToken),i=dJ((e==null?void 0:e.refreshInterval)||"0"),{queryKey:a,sql:s,sheetFilterValues:l}=fJ(e);return{...ap({queryKey:a,queryFn:()=>fb("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(o==null?void 0:o.accessToken)||"",{connection_id:e.connectionId,sql:s,python:e.python===VM?"":e.python,active_filters:l,cache_config:AS()}),refetchInterval:i,placeholderData:pG,enabled:!!e.connectionId&&!!e.sql&&!t&&!r}),queryKey:a}}function Na({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let a=1,s=r,l=i;const c=t;n&&!r&&(e>=1e9?(a=1e9,s="B"):e>=1e7&&i==="en-IN"?(a=1e7,s="Cr"):e>=1e5&&i==="en-IN"?(a=1e5,s="L"):e>=1e6?(a=1e6,s="M"):e>=1e3&&(a=1e3,s="K"));const u=e/a,d={maximumFractionDigits:c,minimumFractionDigits:c};if(o){d.style="currency",d.currency=o;try{new Intl.NumberFormat(i,d).format(0)}catch{}}try{new Intl.NumberFormat(i,d).format(0)}catch{l="en-US"}let p=new Intl.NumberFormat(l,d).format(u);return n&&(p+=s),p}function xC(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function T6(e){try{const n=new Function("getDatalabelColor",e)(lw);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}catch(t){return console.error("Error processing custom visual code",t),{options:{},plugins:[]}}}function D6(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return hJ(t)}function hJ(e){const[t,n,r]=e.split(" "),o=parseFloat(t),i=parseFloat(n),a=parseFloat(r),s=i/100,l=a/100,c=(1-Math.abs(2*l-1))*s,u=c*(1-Math.abs(o/60%2-1)),d=l-c/2;let h=0,p=0,v=0;0<=o&&o<60?(h=c,p=u,v=0):60<=o&&o<120?(h=u,p=c,v=0):120<=o&&o<180?(h=0,p=c,v=u):180<=o&&o<240?(h=0,p=u,v=c):240<=o&&o<300?(h=u,p=0,v=c):300<=o&&o<360&&(h=c,p=0,v=u),h=Math.round((h+d)*255),p=Math.round((p+d)*255),v=Math.round((v+d)*255);const b=x=>{const y=x.toString(16);return y.length==1?"0"+y:y};return`#${b(h)}${b(p)}${b(v)}`}function fl({data:e,cfg:t,customCfg:n,preferences:r}){we.getState().themeStyle;const{dimensionKeys:o,metricKeys:i}=tr(e),a=WQ(i,e,r),s=Cf(a,n),l=o[0],c=jw(e,l);wC(r,t),A6(r);const{options:u,plugins:d}=k6({cfg:t,preferences:r,customCfg:n});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:s},options:u,plugins:d}}function wC(e,t){var o,i,a;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((a=e==null?void 0:e.chartOptions)==null?void 0:a.indexAxis)==="x"?"y":"x":n}function A6(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"x":"y":"x"}function M6(e,t){var i,a,s,l,c,u,d,h,p,v,b,x;const n=wC(t,e),r=A6(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.scales,[n]:{...(s=(a=e==null?void 0:e.options)==null?void 0:a.scales)==null?void 0:s[n],ticks:{...(u=(c=(l=e==null?void 0:e.options)==null?void 0:l.scales)==null?void 0:c[n])==null?void 0:u.ticks,callback:y=>{var _,S,C,E;return Na({number:Number(y),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}},[r]:{...(p=(h=(d=e==null?void 0:e.options)==null?void 0:d.scales)==null?void 0:h[r])==null?void 0:p.ticks,callback:null}},plugins:{...(v=e==null?void 0:e.options)==null?void 0:v.plugins,datalabels:{...(x=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:x.datalabels,formatter:function(y){var _,S,C,E;return Na({number:Number(y),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}}}}function k6({cfg:e,preferences:t,customCfg:n}){var h,p,v,b,x,y,_,S,C,E,$,T,D,M,L,F,z,X,G,A,U,V,K,q,O,H,Y,I,te;const r=we.getState().themeStyle,o=M6(e,t),i=qo((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),a=qo(o,i),s=qo(a,(n==null?void 0:n.options)||{}),l={...s,scales:{...s==null?void 0:s.scales,x:{...(h=s==null?void 0:s.scales)==null?void 0:h.x,grid:{...(v=(p=s==null?void 0:s.scales)==null?void 0:p.x)==null?void 0:v.grid,color:(S=(_=(y=(x=(b=r==null?void 0:r.chart)==null?void 0:b.options)==null?void 0:x.scales)==null?void 0:y.x)==null?void 0:_.grid)==null?void 0:S.color}},y:{...(C=s==null?void 0:s.scales)==null?void 0:C.y,grid:{...($=(E=s==null?void 0:s.scales)==null?void 0:E.y)==null?void 0:$.grid,color:(F=(L=(M=(D=(T=r==null?void 0:r.chart)==null?void 0:T.options)==null?void 0:D.scales)==null?void 0:M.y)==null?void 0:L.grid)==null?void 0:F.color}}},plugins:{...s==null?void 0:s.plugins,tooltip:{...(z=s==null?void 0:s.plugins)==null?void 0:z.tooltip,backgroundColor:(U=(A=(G=(X=r==null?void 0:r.chart)==null?void 0:X.options)==null?void 0:G.plugins)==null?void 0:A.tooltip)==null?void 0:U.backgroundColor,bodyColor:(O=(q=(K=(V=r==null?void 0:r.chart)==null?void 0:V.options)==null?void 0:K.plugins)==null?void 0:q.tooltip)==null?void 0:O.bodyColor,titleColor:(te=(I=(Y=(H=r==null?void 0:r.chart)==null?void 0:H.options)==null?void 0:Y.plugins)==null?void 0:I.tooltip)==null?void 0:te.titleColor}}},{plugins:c,options:u}=T6((t==null?void 0:t.customVisualCode)||"");return{options:qo(l,u),plugins:c}}/*!
236
+ * @kurkle/color v0.3.2
237
+ * https://github.com/kurkle/color#readme
238
+ * (c) 2023 Jukka Kurkela
239
+ * Released under the MIT License
240
+ */function dp(e){return e+.5|0}const $s=(e,t,n)=>Math.max(Math.min(e,n),t);function Ef(e){return $s(dp(e*2.55),0,255)}function Is(e){return $s(dp(e*255),0,255)}function Pa(e){return $s(dp(e/2.55)/100,0,1)}function p$(e){return $s(dp(e*100),0,100)}const Ho={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Bw=[..."0123456789ABCDEF"],pJ=e=>Bw[e&15],gJ=e=>Bw[(e&240)>>4]+Bw[e&15],Lg=e=>(e&240)>>4===(e&15),mJ=e=>Lg(e.r)&&Lg(e.g)&&Lg(e.b)&&Lg(e.a);function bJ(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Ho[e[1]]*17,g:255&Ho[e[2]]*17,b:255&Ho[e[3]]*17,a:t===5?Ho[e[4]]*17:255}:(t===7||t===9)&&(n={r:Ho[e[1]]<<4|Ho[e[2]],g:Ho[e[3]]<<4|Ho[e[4]],b:Ho[e[5]]<<4|Ho[e[6]],a:t===9?Ho[e[7]]<<4|Ho[e[8]]:255})),n}const vJ=(e,t)=>e<255?t(e):"";function yJ(e){var t=mJ(e)?pJ:gJ;return e?"#"+t(e.r)+t(e.g)+t(e.b)+vJ(e.a,t):void 0}const xJ=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function I6(e,t,n){const r=t*Math.min(n,1-n),o=(i,a=(i+e/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[o(0),o(8),o(4)]}function wJ(e,t,n){const r=(o,i=(o+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function _J(e,t,n){const r=I6(e,1,.5);let o;for(t+n>1&&(o=1/(t+n),t*=o,n*=o),o=0;o<3;o++)r[o]*=1-t-n,r[o]+=t;return r}function SJ(e,t,n,r,o){return e===o?(t-n)/r+(t<n?6:0):t===o?(n-e)/r+2:(e-t)/r+4}function _C(e){const n=e.r/255,r=e.g/255,o=e.b/255,i=Math.max(n,r,o),a=Math.min(n,r,o),s=(i+a)/2;let l,c,u;return i!==a&&(u=i-a,c=s>.5?u/(2-i-a):u/(i+a),l=SJ(n,r,o,u,i),l=l*60+.5),[l|0,c||0,s]}function SC(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Is)}function CC(e,t,n){return SC(I6,e,t,n)}function CJ(e,t,n){return SC(_J,e,t,n)}function EJ(e,t,n){return SC(wJ,e,t,n)}function N6(e){return(e%360+360)%360}function RJ(e){const t=xJ.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Ef(+t[5]):Is(+t[5]));const o=N6(+t[2]),i=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?r=CJ(o,i,a):t[1]==="hsv"?r=EJ(o,i,a):r=CC(o,i,a),{r:r[0],g:r[1],b:r[2],a:n}}function PJ(e,t){var n=_C(e);n[0]=N6(n[0]+t),n=CC(n),e.r=n[0],e.g=n[1],e.b=n[2]}function $J(e){if(!e)return;const t=_C(e),n=t[0],r=p$(t[1]),o=p$(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Pa(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const g$={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},m$={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function OJ(){const e={},t=Object.keys(m$),n=Object.keys(g$);let r,o,i,a,s;for(r=0;r<t.length;r++){for(a=s=t[r],o=0;o<n.length;o++)i=n[o],s=s.replace(i,g$[i]);i=parseInt(m$[a],16),e[s]=[i>>16&255,i>>8&255,i&255]}return e}let Fg;function TJ(e){Fg||(Fg=OJ(),Fg.transparent=[0,0,0,0]);const t=Fg[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const DJ=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function AJ(e){const t=DJ.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const a=+t[7];n=t[8]?Ef(a):$s(a*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?Ef(r):$s(r,0,255)),o=255&(t[4]?Ef(o):$s(o,0,255)),i=255&(t[6]?Ef(i):$s(i,0,255)),{r,g:o,b:i,a:n}}}function MJ(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Pa(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const v1=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Yc=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function kJ(e,t,n){const r=Yc(Pa(e.r)),o=Yc(Pa(e.g)),i=Yc(Pa(e.b));return{r:Is(v1(r+n*(Yc(Pa(t.r))-r))),g:Is(v1(o+n*(Yc(Pa(t.g))-o))),b:Is(v1(i+n*(Yc(Pa(t.b))-i))),a:e.a+n*(t.a-e.a)}}function jg(e,t,n){if(e){let r=_C(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=CC(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function L6(e,t){return e&&Object.assign(t||{},e)}function b$(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Is(e[3]))):(t=L6(e,{r:0,g:0,b:0,a:1}),t.a=Is(t.a)),t}function IJ(e){return e.charAt(0)==="r"?AJ(e):RJ(e)}let F6=class Vw{constructor(t){if(t instanceof Vw)return t;const n=typeof t;let r;n==="object"?r=b$(t):n==="string"&&(r=bJ(t)||TJ(t)||IJ(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=L6(this._rgb);return t&&(t.a=Pa(t.a)),t}set rgb(t){this._rgb=b$(t)}rgbString(){return this._valid?MJ(this._rgb):void 0}hexString(){return this._valid?yJ(this._rgb):void 0}hslString(){return this._valid?$J(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,o=t.rgb;let i;const a=n===i?.5:n,s=2*a-1,l=r.a-o.a,c=((s*l===-1?s:(s+l)/(1+s*l))+1)/2;i=1-c,r.r=255&c*r.r+i*o.r+.5,r.g=255&c*r.g+i*o.g+.5,r.b=255&c*r.b+i*o.b+.5,r.a=a*r.a+(1-a)*o.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=kJ(this._rgb,t._rgb,n)),this}clone(){return new Vw(this.rgb)}alpha(t){return this._rgb.a=Is(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=dp(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return jg(this._rgb,2,t),this}darken(t){return jg(this._rgb,2,-t),this}saturate(t){return jg(this._rgb,1,t),this}desaturate(t){return jg(this._rgb,1,-t),this}rotate(t){return PJ(this._rgb,t),this}};/*!
241
+ * Chart.js v4.4.1
242
+ * https://www.chartjs.org
243
+ * (c) 2023 Chart.js Contributors
244
+ * Released under the MIT License
245
+ */function va(){}const NJ=(()=>{let e=0;return()=>e++})();function Tt(e){return e===null||typeof e>"u"}function _n(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function kt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Ln(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function mo(e,t){return Ln(e)?e:t}function st(e,t){return typeof e>"u"?t:e}const LJ=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,j6=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function cn(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function nn(e,t,n,r){let o,i,a;if(_n(e))if(i=e.length,r)for(o=i-1;o>=0;o--)t.call(n,e[o],o);else for(o=0;o<i;o++)t.call(n,e[o],o);else if(kt(e))for(a=Object.keys(e),i=a.length,o=0;o<i;o++)t.call(n,e[a[o]],a[o])}function v0(e,t){let n,r,o,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(o=e[n],i=t[n],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0}function y0(e){if(_n(e))return e.map(y0);if(kt(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=y0(e[n[o]]);return t}return e}function z6(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function FJ(e,t,n,r){if(!z6(e))return;const o=t[e],i=n[e];kt(o)&&kt(i)?or(o,i,r):t[e]=y0(i)}function or(e,t,n){const r=_n(t)?t:[t],o=r.length;if(!kt(e))return e;n=n||{};const i=n.merger||FJ;let a;for(let s=0;s<o;++s){if(a=r[s],!kt(a))continue;const l=Object.keys(a);for(let c=0,u=l.length;c<u;++c)i(l[c],e,a,n)}return e}function Ff(e,t){return or(e,t,{merger:jJ})}function jJ(e,t,n){if(!z6(e))return;const r=t[e],o=n[e];kt(r)&&kt(o)?Ff(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=y0(o))}const v$={"":e=>e,x:e=>e.x,y:e=>e.y};function zJ(e){const t=e.split("."),n=[];let r="";for(const o of t)r+=o,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function BJ(e){const t=zJ(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function js(e,t){return(v$[t]||(v$[t]=BJ(t)))(e)}function EC(e){return e.charAt(0).toUpperCase()+e.slice(1)}const sh=e=>typeof e<"u",zs=e=>typeof e=="function",y$=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function VJ(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Cn=Math.PI,Sn=2*Cn,HJ=Sn+Cn,x0=Number.POSITIVE_INFINITY,WJ=Cn/180,Wn=Cn/2,hl=Cn/4,x$=Cn*2/3,Os=Math.log10,Wi=Math.sign;function jf(e,t,n){return Math.abs(e-t)<n}function w$(e){const t=Math.round(e);e=jf(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Os(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function UJ(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((o,i)=>o-i).pop(),t}function Qu(e){return!isNaN(parseFloat(e))&&isFinite(e)}function qJ(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function B6(e,t,n){let r,o,i;for(r=0,o=e.length;r<o;r++)i=e[r][n],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function mi(e){return e*(Cn/180)}function RC(e){return e*(180/Cn)}function _$(e){if(!Ln(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function V6(e,t){const n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*Cn&&(i+=Sn),{angle:i,distance:o}}function Hw(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function GJ(e,t){return(e-t+HJ)%Sn-Cn}function xo(e){return(e%Sn+Sn)%Sn}function lh(e,t,n,r){const o=xo(e),i=xo(t),a=xo(n),s=xo(i-o),l=xo(a-o),c=xo(o-i),u=xo(o-a);return o===i||o===a||r&&i===a||s>l&&c<u}function rr(e,t,n){return Math.max(t,Math.min(n,e))}function YJ(e){return rr(e,-32768,32767)}function Da(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function PC(e,t,n){n=n||(a=>e[a]<t);let r=e.length-1,o=0,i;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const Aa=(e,t,n,r)=>PC(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),KJ=(e,t,n)=>PC(e,n,r=>e[r][t]>=n);function XJ(e,t,n){let r=0,o=e.length;for(;r<o&&e[r]<t;)r++;for(;o>r&&e[o-1]>n;)o--;return r>0||o<e.length?e.slice(r,o):e}const H6=["push","pop","shift","splice","unshift"];function QJ(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),H6.forEach(n=>{const r="_onData"+EC(n),o=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...i){const a=o.apply(this,i);return e._chartjs.listeners.forEach(s=>{typeof s[r]=="function"&&s[r](...i)}),a}})})}function S$(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(t);o!==-1&&r.splice(o,1),!(r.length>0)&&(H6.forEach(i=>{delete e[i]}),delete e._chartjs)}function W6(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const U6=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function q6(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,U6.call(window,()=>{r=!1,e.apply(t,n)}))}}function JJ(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const $C=e=>e==="start"?"left":e==="end"?"right":"center",wr=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ZJ=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function G6(e,t,n){const r=t.length;let o=0,i=r;if(e._sorted){const{iScale:a,_parsed:s}=e,l=a.axis,{min:c,max:u,minDefined:d,maxDefined:h}=a.getUserBounds();d&&(o=rr(Math.min(Aa(s,l,c).lo,n?r:Aa(t,l,a.getPixelForValue(c)).lo),0,r-1)),h?i=rr(Math.max(Aa(s,a.axis,u,!0).hi+1,n?0:Aa(t,l,a.getPixelForValue(u),!0).hi+1),o,r)-o:i=r-o}return{start:o,count:i}}function Y6(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,o={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=o,!0;const i=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,o),i}const zg=e=>e===0||e===1,C$=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Sn/n)),E$=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Sn/n)+1,zf={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Wn)+1,easeOutSine:e=>Math.sin(e*Wn),easeInOutSine:e=>-.5*(Math.cos(Cn*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>zg(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>zg(e)?e:C$(e,.075,.3),easeOutElastic:e=>zg(e)?e:E$(e,.075,.3),easeInOutElastic(e){return zg(e)?e:e<.5?.5*C$(e*2,.1125,.45):.5+.5*E$(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-zf.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?zf.easeInBounce(e*2)*.5:zf.easeOutBounce(e*2-1)*.5+.5};function OC(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function R$(e){return OC(e)?e:new F6(e)}function y1(e){return OC(e)?e:new F6(e).saturate(.5).darken(.1).hexString()}const eZ=["x","y","borderWidth","radius","tension"],tZ=["color","borderColor","backgroundColor"];function nZ(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:tZ},numbers:{type:"number",properties:eZ}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function rZ(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const P$=new Map;function oZ(e,t){t=t||{};const n=e+JSON.stringify(t);let r=P$.get(n);return r||(r=new Intl.NumberFormat(e,t),P$.set(n,r)),r}function fp(e,t,n){return oZ(t,n).format(e)}const K6={values(e){return _n(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let o,i=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(o="scientific"),i=iZ(e,n)}const a=Os(Math.abs(i)),s=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:o,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),fp(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Os(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?K6.numeric.call(this,e,t,n):""}};function iZ(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Vb={formatters:K6};function aZ(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Vb.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ac=Object.create(null),Ww=Object.create(null);function Bf(e,t){if(!t)return e;const n=t.split(".");for(let r=0,o=n.length;r<o;++r){const i=n[r];e=e[i]||(e[i]=Object.create(null))}return e}function x1(e,t,n){return typeof t=="string"?or(Bf(e,t),n):or(Bf(e,""),t)}class sZ{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,o)=>y1(o.backgroundColor),this.hoverBorderColor=(r,o)=>y1(o.borderColor),this.hoverColor=(r,o)=>y1(o.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return x1(this,t,n)}get(t){return Bf(this,t)}describe(t,n){return x1(Ww,t,n)}override(t,n){return x1(ac,t,n)}route(t,n,r,o){const i=Bf(this,t),a=Bf(this,r),s="_"+n;Object.defineProperties(i,{[s]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[s],c=a[o];return kt(l)?Object.assign({},c,l):st(l,c)},set(l){this[s]=l}}})}apply(t){t.forEach(n=>n(this))}}var An=new sZ({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[nZ,rZ,aZ]);function lZ(e){return!e||Tt(e.size)||Tt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function w0(e,t,n,r,o){let i=t[o];return i||(i=t[o]=e.measureText(o).width,n.push(o)),i>r&&(r=i),r}function cZ(e,t,n,r){r=r||{};let o=r.data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(o=r.data={},i=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let a=0;const s=n.length;let l,c,u,d,h;for(l=0;l<s;l++)if(d=n[l],d!=null&&!_n(d))a=w0(e,o,i,a,d);else if(_n(d))for(c=0,u=d.length;c<u;c++)h=d[c],h!=null&&!_n(h)&&(a=w0(e,o,i,a,h));e.restore();const p=i.length/2;if(p>n.length){for(l=0;l<p;l++)delete o[i[l]];i.splice(0,p)}return a}function pl(e,t,n){const r=e.currentDevicePixelRatio,o=n!==0?Math.max(n/2,.5):0;return Math.round((t-o)*r)/r+o}function $$(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function _0(e,t,n,r){X6(e,t,n,r,null)}function X6(e,t,n,r,o){let i,a,s,l,c,u,d,h;const p=t.pointStyle,v=t.rotation,b=t.radius;let x=(v||0)*WJ;if(p&&typeof p=="object"&&(i=p.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(x),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(b)||b<=0)){switch(e.beginPath(),p){default:o?e.ellipse(n,r,o/2,b,0,0,Sn):e.arc(n,r,b,0,Sn),e.closePath();break;case"triangle":u=o?o/2:b,e.moveTo(n+Math.sin(x)*u,r-Math.cos(x)*b),x+=x$,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*b),x+=x$,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*b),e.closePath();break;case"rectRounded":c=b*.516,l=b-c,a=Math.cos(x+hl)*l,d=Math.cos(x+hl)*(o?o/2-c:l),s=Math.sin(x+hl)*l,h=Math.sin(x+hl)*(o?o/2-c:l),e.arc(n-d,r-s,c,x-Cn,x-Wn),e.arc(n+h,r-a,c,x-Wn,x),e.arc(n+d,r+s,c,x,x+Wn),e.arc(n-h,r+a,c,x+Wn,x+Cn),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*b,u=o?o/2:l,e.rect(n-u,r-l,2*u,2*l);break}x+=hl;case"rectRot":d=Math.cos(x)*(o?o/2:b),a=Math.cos(x)*b,s=Math.sin(x)*b,h=Math.sin(x)*(o?o/2:b),e.moveTo(n-d,r-s),e.lineTo(n+h,r-a),e.lineTo(n+d,r+s),e.lineTo(n-h,r+a),e.closePath();break;case"crossRot":x+=hl;case"cross":d=Math.cos(x)*(o?o/2:b),a=Math.cos(x)*b,s=Math.sin(x)*b,h=Math.sin(x)*(o?o/2:b),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+h,r-a),e.lineTo(n-h,r+a);break;case"star":d=Math.cos(x)*(o?o/2:b),a=Math.cos(x)*b,s=Math.sin(x)*b,h=Math.sin(x)*(o?o/2:b),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+h,r-a),e.lineTo(n-h,r+a),x+=hl,d=Math.cos(x)*(o?o/2:b),a=Math.cos(x)*b,s=Math.sin(x)*b,h=Math.sin(x)*(o?o/2:b),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+h,r-a),e.lineTo(n-h,r+a);break;case"line":a=o?o/2:Math.cos(x)*b,s=Math.sin(x)*b,e.moveTo(n-a,r-s),e.lineTo(n+a,r+s);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(x)*(o?o/2:b),r+Math.sin(x)*b);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Ma(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Wl(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Ul(e){e.restore()}function uZ(e,t,n,r,o){if(!t)return e.lineTo(n.x,n.y);if(o==="middle"){const i=(t.x+n.x)/2;e.lineTo(i,t.y),e.lineTo(i,n.y)}else o==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function dZ(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function fZ(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Tt(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function hZ(e,t,n,r,o){if(o.strikethrough||o.underline){const i=e.measureText(r),a=t-i.actualBoundingBoxLeft,s=t+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=o.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(a,u),e.lineTo(s,u),e.stroke()}}function pZ(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function sc(e,t,n,r,o,i={}){const a=_n(t)?t:[t],s=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(e.save(),e.font=o.string,fZ(e,i),l=0;l<a.length;++l)c=a[l],i.backdrop&&pZ(e,i.backdrop),s&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),Tt(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),hZ(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function ch(e,t){const{x:n,y:r,w:o,h:i,radius:a}=t;e.arc(n+a.topLeft,r+a.topLeft,a.topLeft,1.5*Cn,Cn,!0),e.lineTo(n,r+i-a.bottomLeft),e.arc(n+a.bottomLeft,r+i-a.bottomLeft,a.bottomLeft,Cn,Wn,!0),e.lineTo(n+o-a.bottomRight,r+i),e.arc(n+o-a.bottomRight,r+i-a.bottomRight,a.bottomRight,Wn,0,!0),e.lineTo(n+o,r+a.topRight),e.arc(n+o-a.topRight,r+a.topRight,a.topRight,0,-Wn,!0),e.lineTo(n+a.topLeft,r)}const gZ=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,mZ=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function bZ(e,t){const n=(""+e).match(gZ);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const vZ=e=>+e||0;function TC(e,t){const n={},r=kt(t),o=r?Object.keys(t):t,i=kt(e)?r?a=>st(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of o)n[a]=vZ(i(a));return n}function Q6(e){return TC(e,{top:"y",right:"x",bottom:"y",left:"x"})}function ql(e){return TC(e,["topLeft","topRight","bottomLeft","bottomRight"])}function fr(e){const t=Q6(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function qn(e,t){e=e||{},t=t||An.font;let n=st(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=st(e.style,t.style);r&&!(""+r).match(mZ)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:st(e.family,t.family),lineHeight:bZ(st(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:st(e.weight,t.weight),string:""};return o.string=lZ(o),o}function wn(e,t,n,r){let o=!0,i,a,s;for(i=0,a=e.length;i<a;++i)if(s=e[i],s!==void 0&&(t!==void 0&&typeof s=="function"&&(s=s(t),o=!1),n!==void 0&&_n(s)&&(s=s[n%s.length],o=!1),s!==void 0))return r&&!o&&(r.cacheable=!1),s}function yZ(e,t,n){const{min:r,max:o}=e,i=j6(t,(o-r)/2),a=(s,l)=>n&&s===0?0:s+l;return{min:a(r,-Math.abs(i)),max:a(o,i)}}function Xs(e,t){return Object.assign(Object.create(e),t)}function DC(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=t3("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:s=>DC([s,...e],t,i,r)};return new Proxy(a,{deleteProperty(s,l){return delete s[l],delete s._keys,delete e[0][l],!0},get(s,l){return Z6(s,l,()=>PZ(l,t,e,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(s,l){return T$(s).includes(l)},ownKeys(s){return T$(s)},set(s,l,c){const u=s._storage||(s._storage=o());return s[l]=u[l]=c,delete s._keys,!0}})}function Ju(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:J6(e,r),setContext:i=>Ju(e,i,n,r),override:i=>Ju(e.override(i),t,n,r)};return new Proxy(o,{deleteProperty(i,a){return delete i[a],delete e[a],!0},get(i,a,s){return Z6(i,a,()=>wZ(i,a,s))},getOwnPropertyDescriptor(i,a){return i._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(i,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(i,a,s){return e[a]=s,delete i[a],!0}})}function J6(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:o=t.allKeys}=e;return{allKeys:o,scriptable:n,indexable:r,isScriptable:zs(n)?n:()=>n,isIndexable:zs(r)?r:()=>r}}const xZ=(e,t)=>e?e+EC(t):t,AC=(e,t)=>kt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Z6(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function wZ(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:a}=e;let s=r[t];return zs(s)&&a.isScriptable(t)&&(s=_Z(t,s,e,n)),_n(s)&&s.length&&(s=SZ(t,s,e,a.isIndexable)),AC(t,s)&&(s=Ju(s,o,i&&i[t],a)),s}function _Z(e,t,n,r){const{_proxy:o,_context:i,_subProxy:a,_stack:s}=n;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);s.add(e);let l=t(i,a||r);return s.delete(e),AC(e,l)&&(l=MC(o._scopes,o,e,l)),l}function SZ(e,t,n,r){const{_proxy:o,_context:i,_subProxy:a,_descriptors:s}=n;if(typeof i.index<"u"&&r(e))return t[i.index%t.length];if(kt(t[0])){const l=t,c=o._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=MC(c,o,e,u);t.push(Ju(d,i,a&&a[e],s))}}return t}function e3(e,t,n){return zs(e)?e(t,n):e}const CZ=(e,t)=>e===!0?t:typeof e=="string"?js(t,e):void 0;function EZ(e,t,n,r,o){for(const i of t){const a=CZ(n,i);if(a){e.add(a);const s=e3(a._fallback,n,o);if(typeof s<"u"&&s!==n&&s!==r)return s}else if(a===!1&&typeof r<"u"&&n!==r)return null}return!1}function MC(e,t,n,r){const o=t._rootScopes,i=e3(t._fallback,n,r),a=[...e,...o],s=new Set;s.add(r);let l=O$(s,a,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=O$(s,a,i,l,r),l===null)?!1:DC(Array.from(s),[""],o,i,()=>RZ(t,n,r))}function O$(e,t,n,r,o){for(;n;)n=EZ(e,t,n,r,o);return n}function RZ(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return _n(o)&&kt(n)?n:o||{}}function PZ(e,t,n,r){let o;for(const i of t)if(o=t3(xZ(i,e),n),typeof o<"u")return AC(e,o)?MC(n,r,e,o):o}function t3(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function T$(e){let t=e._keys;return t||(t=e._keys=$Z(e._scopes)),t}function $Z(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(o=>!o.startsWith("_")))t.add(r);return Array.from(t)}function n3(e,t,n,r){const{iScale:o}=e,{key:i="r"}=this._parsing,a=new Array(r);let s,l,c,u;for(s=0,l=r;s<l;++s)c=s+n,u=t[c],a[s]={r:o.parse(js(u,i),c)};return a}const OZ=Number.EPSILON||1e-14,Zu=(e,t)=>t<e.length&&!e[t].skip&&e[t],r3=e=>e==="x"?"y":"x";function TZ(e,t,n,r){const o=e.skip?t:e,i=t,a=n.skip?t:n,s=Hw(i,o),l=Hw(a,i);let c=s/(s+l),u=l/(s+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,h=r*u;return{previous:{x:i.x-d*(a.x-o.x),y:i.y-d*(a.y-o.y)},next:{x:i.x+h*(a.x-o.x),y:i.y+h*(a.y-o.y)}}}function DZ(e,t,n){const r=e.length;let o,i,a,s,l,c=Zu(e,0);for(let u=0;u<r-1;++u)if(l=c,c=Zu(e,u+1),!(!l||!c)){if(jf(t[u],0,OZ)){n[u]=n[u+1]=0;continue}o=n[u]/t[u],i=n[u+1]/t[u],s=Math.pow(o,2)+Math.pow(i,2),!(s<=9)&&(a=3/Math.sqrt(s),n[u]=o*a*t[u],n[u+1]=i*a*t[u])}}function AZ(e,t,n="x"){const r=r3(n),o=e.length;let i,a,s,l=Zu(e,0);for(let c=0;c<o;++c){if(a=s,s=l,l=Zu(e,c+1),!s)continue;const u=s[n],d=s[r];a&&(i=(u-a[n])/3,s[`cp1${n}`]=u-i,s[`cp1${r}`]=d-i*t[c]),l&&(i=(l[n]-u)/3,s[`cp2${n}`]=u+i,s[`cp2${r}`]=d+i*t[c])}}function MZ(e,t="x"){const n=r3(t),r=e.length,o=Array(r).fill(0),i=Array(r);let a,s,l,c=Zu(e,0);for(a=0;a<r;++a)if(s=l,l=c,c=Zu(e,a+1),!!l){if(c){const u=c[t]-l[t];o[a]=u!==0?(c[n]-l[n])/u:0}i[a]=s?c?Wi(o[a-1])!==Wi(o[a])?0:(o[a-1]+o[a])/2:o[a-1]:o[a]}DZ(e,o,i),AZ(e,i,t)}function Bg(e,t,n){return Math.max(Math.min(e,n),t)}function kZ(e,t){let n,r,o,i,a,s=Ma(e[0],t);for(n=0,r=e.length;n<r;++n)a=i,i=s,s=n<r-1&&Ma(e[n+1],t),i&&(o=e[n],a&&(o.cp1x=Bg(o.cp1x,t.left,t.right),o.cp1y=Bg(o.cp1y,t.top,t.bottom)),s&&(o.cp2x=Bg(o.cp2x,t.left,t.right),o.cp2y=Bg(o.cp2y,t.top,t.bottom)))}function IZ(e,t,n,r,o){let i,a,s,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")MZ(e,o);else{let c=r?e[e.length-1]:e[0];for(i=0,a=e.length;i<a;++i)s=e[i],l=TZ(c,s,e[Math.min(i+1,a-(r?0:1))%a],t.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,c=s}t.capBezierPoints&&kZ(e,n)}function kC(){return typeof window<"u"&&typeof document<"u"}function IC(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function S0(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Hb=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function NZ(e,t){return Hb(e).getPropertyValue(t)}const LZ=["top","right","bottom","left"];function Gl(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=LZ[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const FZ=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function jZ(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let a=!1,s,l;if(FZ(o,i,e.target))s=o,l=i;else{const c=t.getBoundingClientRect();s=r.clientX-c.left,l=r.clientY-c.top,a=!0}return{x:s,y:l,box:a}}function yl(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=Hb(n),i=o.boxSizing==="border-box",a=Gl(o,"padding"),s=Gl(o,"border","width"),{x:l,y:c,box:u}=jZ(e,n),d=a.left+(u&&s.left),h=a.top+(u&&s.top);let{width:p,height:v}=t;return i&&(p-=a.width+s.width,v-=a.height+s.height),{x:Math.round((l-d)/p*n.width/r),y:Math.round((c-h)/v*n.height/r)}}function zZ(e,t,n){let r,o;if(t===void 0||n===void 0){const i=IC(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const a=i.getBoundingClientRect(),s=Hb(i),l=Gl(s,"border","width"),c=Gl(s,"padding");t=a.width-c.width-l.width,n=a.height-c.height-l.height,r=S0(s.maxWidth,i,"clientWidth"),o=S0(s.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||x0,maxHeight:o||x0}}const Vg=e=>Math.round(e*10)/10;function BZ(e,t,n,r){const o=Hb(e),i=Gl(o,"margin"),a=S0(o.maxWidth,e,"clientWidth")||x0,s=S0(o.maxHeight,e,"clientHeight")||x0,l=zZ(e,t,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const h=Gl(o,"border","width"),p=Gl(o,"padding");c-=p.width+h.width,u-=p.height+h.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=Vg(Math.min(c,a,l.maxWidth)),u=Vg(Math.min(u,s,l.maxHeight)),c&&!u&&(u=Vg(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Vg(Math.floor(u*r))),{width:c,height:u}}function D$(e,t,n){const r=t||1,o=Math.floor(e.height*r),i=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||a.height!==o||a.width!==i?(e.currentDevicePixelRatio=r,a.height=o,a.width=i,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const VZ=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};kC()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function A$(e,t){const n=NZ(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function xl(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function HZ(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function WZ(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},a=xl(e,o,n),s=xl(o,i,n),l=xl(i,t,n),c=xl(a,s,n),u=xl(s,l,n);return xl(c,u,n)}const UZ=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},qZ=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function wu(e,t,n){return e?UZ(t,n):qZ()}function o3(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function i3(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function a3(e){return e==="angle"?{between:lh,compare:GJ,normalize:xo}:{between:Da,compare:(t,n)=>t-n,normalize:t=>t}}function M$({start:e,end:t,count:n,loop:r,style:o}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:o}}function GZ(e,t,n){const{property:r,start:o,end:i}=n,{between:a,normalize:s}=a3(r),l=t.length;let{start:c,end:u,loop:d}=e,h,p;if(d){for(c+=l,u+=l,h=0,p=l;h<p&&a(s(t[c%l][r]),o,i);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function s3(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,a=t.length,{compare:s,between:l,normalize:c}=a3(r),{start:u,end:d,loop:h,style:p}=GZ(e,t,n),v=[];let b=!1,x=null,y,_,S;const C=()=>l(o,S,y)&&s(o,S)!==0,E=()=>s(i,y)===0||l(i,S,y),$=()=>b||C(),T=()=>!b||E();for(let D=u,M=u;D<=d;++D)_=t[D%a],!_.skip&&(y=c(_[r]),y!==S&&(b=l(y,o,i),x===null&&$()&&(x=s(y,o)===0?D:M),x!==null&&T()&&(v.push(M$({start:x,end:D,loop:h,count:a,style:p})),x=null),M=D,S=y));return x!==null&&v.push(M$({start:x,end:d,loop:h,count:a,style:p})),v}function l3(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=s3(r[o],e.points,t);i.length&&n.push(...i)}return n}function YZ(e,t,n,r){let o=0,i=t-1;if(n&&!r)for(;o<t&&!e[o].skip;)o++;for(;o<t&&e[o].skip;)o++;for(o%=t,n&&(i+=o);i>o&&e[i%t].skip;)i--;return i%=t,{start:o,end:i}}function KZ(e,t,n,r){const o=e.length,i=[];let a=t,s=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%o];c.skip||c.stop?s.skip||(r=!1,i.push({start:t%o,end:(l-1)%o,loop:r}),t=a=c.stop?l:null):(a=l,s.skip&&(t=l)),s=c}return a!==null&&i.push({start:t%o,end:a%o,loop:r}),i}function XZ(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:a,end:s}=YZ(n,o,i,r);if(r===!0)return k$(e,[{start:a,end:s,loop:i}],n,t);const l=s<a?s+o:s,c=!!e._fullLoop&&a===0&&s===o-1;return k$(e,KZ(n,a,l,c),n,t)}function k$(e,t,n,r){return!r||!r.setContext||!n?t:QZ(e,t,n,r)}function QZ(e,t,n,r){const o=e._chart.getContext(),i=I$(e.options),{_datasetIndex:a,options:{spanGaps:s}}=e,l=n.length,c=[];let u=i,d=t[0].start,h=d;function p(v,b,x,y){const _=s?-1:1;if(v!==b){for(v+=l;n[v%l].skip;)v-=_;for(;n[b%l].skip;)b+=_;v%l!==b%l&&(c.push({start:v%l,end:b%l,loop:x,style:y}),u=y,d=b%l)}}for(const v of t){d=s?d:v.start;let b=n[d%l],x;for(h=d+1;h<=v.end;h++){const y=n[h%l];x=I$(r.setContext(Xs(o,{type:"segment",p0:b,p1:y,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:a}))),JZ(x,u)&&p(d,h-1,v.loop,u),b=y,u=x}d<h-1&&p(d,h-1,v.loop,u)}return c}function I$(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function JZ(e,t){if(!t)return!1;const n=[],r=function(o,i){return OC(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
246
+ * Chart.js v4.4.1
247
+ * https://www.chartjs.org
248
+ * (c) 2023 Chart.js Contributors
249
+ * Released under the MIT License
250
+ */class ZZ{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,o){const i=n.listeners[o],a=n.duration;i.forEach(s=>s({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(r-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=U6.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,o)=>{if(!r.running||!r.items.length)return;const i=r.items;let a=i.length-1,s=!1,l;for(;a>=0;--a)l=i[a],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),s=!0):(i[a]=i[i.length-1],i.pop());s&&(o.draw(),this._notify(o,r,t,"progress")),i.length||(r.running=!1,this._notify(o,r,t,"complete"),r.initial=!1),n+=i.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,o)=>Math.max(r,o._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let o=r.length-1;for(;o>=0;--o)r[o].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var _a=new ZZ;const N$="transparent",eee={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=R$(e||N$),o=r.valid&&R$(t||N$);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class tee{constructor(t,n,r,o){const i=n[r];o=wn([t.to,o,i,t.from]);const a=wn([t.from,i,o]);this._active=!0,this._fn=t.fn||eee[t.type||typeof a],this._easing=zf[t.easing]||zf.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=a,this._to=o,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const o=this._target[this._prop],i=r-this._start,a=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=wn([t.to,n,o,t.from]),this._from=wn([t.from,o,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,o=this._prop,i=this._from,a=this._loop,s=this._to;let l;if(this._active=i!==s&&(a||n<r),!this._active){this._target[o]=s,this._notify(!0);return}if(n<0){this._target[o]=i;return}l=n/r%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[o]=this._fn(i,s,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let o=0;o<r.length;o++)r[o][n]()}}class c3{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!kt(t))return;const n=Object.keys(An.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!kt(i))return;const a={};for(const s of n)a[s]=i[s];(_n(i.properties)&&i.properties||[o]).forEach(s=>{(s===o||!r.has(s))&&r.set(s,a)})})}_animateOptions(t,n){const r=n.options,o=ree(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&nee(t.options.$animations,r).then(()=>{t.options=r},()=>{}),i}_createAnimations(t,n){const r=this._properties,o=[],i=t.$animations||(t.$animations={}),a=Object.keys(n),s=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){o.push(...this._animateOptions(t,n));continue}const u=n[c];let d=i[c];const h=r.get(c);if(d)if(h&&d.active()){d.update(h,u,s);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}i[c]=d=new tee(h,t,c,u),o.push(d)}return o}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return _a.add(this._chart,r),!0}}function nee(e,t){const n=[],r=Object.keys(t);for(let o=0;o<r.length;o++){const i=e[r[o]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function ree(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 L$(e,t){const n=e&&e.options||{},r=n.reverse,o=n.min===void 0?t:0,i=n.max===void 0?t:0;return{start:r?i:o,end:r?o:i}}function oee(e,t,n){if(n===!1)return!1;const r=L$(e,n),o=L$(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function iee(e){let t,n,r,o;return kt(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:e===!1}}function u3(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function F$(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let a,s,l,c;if(t!==null){for(a=0,s=o.length;a<s;++a){if(l=+o[a],l===n){if(r.all)continue;break}c=e.values[l],Ln(c)&&(i||t===0||Wi(t)===Wi(c))&&(t+=c)}return t}}function aee(e){const t=Object.keys(e),n=new Array(t.length);let r,o,i;for(r=0,o=t.length;r<o;++r)i=t[r],n[r]={x:i,y:e[i]};return n}function j$(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function see(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function lee(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}function cee(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function z$(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const i=e[o.index];if(n&&i>0||!n&&i<0)return o.index}return null}function B$(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:a,index:s}=r,l=i.axis,c=a.axis,u=see(i,a,r),d=t.length;let h;for(let p=0;p<d;++p){const v=t[p],{[l]:b,[c]:x}=v,y=v._stacks||(v._stacks={});h=y[c]=cee(o,u,b),h[s]=x,h._top=z$(h,a,!0,r.type),h._bottom=z$(h,a,!1,r.type);const _=h._visualValues||(h._visualValues={});_[s]=x}}function w1(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function uee(e,t){return Xs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function dee(e,t,n){return Xs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Jd(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const o of t){const i=o._stacks;if(!i||i[r]===void 0||i[r][n]===void 0)return;delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n]}}}const _1=e=>e==="reset"||e==="none",V$=(e,t)=>t?e:Object.assign({},e),fee=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:u3(n,!0),values:null};class Xo{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=j$(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&&Jd(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(d,h,p,v)=>d==="x"?h:d==="r"?v:p,i=n.xAxisID=st(r.xAxisID,w1(t,"x")),a=n.yAxisID=st(r.yAxisID,w1(t,"y")),s=n.rAxisID=st(r.rAxisID,w1(t,"r")),l=n.indexAxis,c=n.iAxisID=o(l,i,a,s),u=n.vAxisID=o(l,a,i,s);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(s),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&S$(this._data,this),t._stacked&&Jd(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(kt(n))this._data=aee(n);else if(r!==n){if(r){S$(r,this);const o=this._cachedMeta;Jd(o),o._parsed=[]}n&&Object.isExtensible(n)&&QJ(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let o=!1;this._dataCheck();const i=n._stacked;n._stacked=j$(n.vScale,n),n.stack!==r.stack&&(o=!0,Jd(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&B$(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:o}=this,{iScale:i,_stacked:a}=r,s=i.axis;let l=t===0&&n===o.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,h;if(this._parsing===!1)r._parsed=o,r._sorted=!0,h=o;else{_n(o[t])?h=this.parseArrayData(r,o,t,n):kt(o[t])?h=this.parseObjectData(r,o,t,n):h=this.parsePrimitiveData(r,o,t,n);const p=()=>d[s]===null||c&&d[s]<c[s];for(u=0;u<n;++u)r._parsed[u+t]=d=h[u],l&&(p()&&(l=!1),c=d);r._sorted=l}a&&B$(this,h)}parsePrimitiveData(t,n,r,o){const{iScale:i,vScale:a}=t,s=i.axis,l=a.axis,c=i.getLabels(),u=i===a,d=new Array(o);let h,p,v;for(h=0,p=o;h<p;++h)v=h+r,d[h]={[s]:u||i.parse(c[v],v),[l]:a.parse(n[v],v)};return d}parseArrayData(t,n,r,o){const{xScale:i,yScale:a}=t,s=new Array(o);let l,c,u,d;for(l=0,c=o;l<c;++l)u=l+r,d=n[u],s[l]={x:i.parse(d[0],u),y:a.parse(d[1],u)};return s}parseObjectData(t,n,r,o){const{xScale:i,yScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=new Array(o);let u,d,h,p;for(u=0,d=o;u<d;++u)h=u+r,p=n[h],c[u]={x:i.parse(js(p,s),h),y:a.parse(js(p,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const o=this.chart,i=this._cachedMeta,a=n[t.axis],s={keys:u3(o,!0),values:n._stacks[t.axis]._visualValues};return F$(s,a,i.index,{mode:r})}updateRangeFromParsed(t,n,r,o){const i=r[n.axis];let a=i===null?NaN:i;const s=o&&r._stacks[n.axis];o&&s&&(o.values=s,a=F$(o,i,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const r=this._cachedMeta,o=r._parsed,i=r._sorted&&t===r.iScale,a=o.length,s=this._getOtherScale(t),l=fee(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=lee(s);let h,p;function v(){p=o[h];const b=p[s.axis];return!Ln(p[t.axis])||u>b||d<b}for(h=0;h<a&&!(!v()&&(this.updateRangeFromParsed(c,t,p,l),i));++h);if(i){for(h=a-1;h>=0;--h)if(!v()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let o,i,a;for(o=0,i=n.length;o<i;++o)a=n[o][t.axis],Ln(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,o=n.vScale,i=this.getParsed(t);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:o?""+o.getLabelForValue(i[o.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=iee(st(this.options.clip,oee(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,o=r.data||[],i=n.chartArea,a=[],s=this._drawStart||0,l=this._drawCount||o.length-s,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,i,s,l),u=s;u<s+l;++u){const d=o[u];d.hidden||(d.active&&c?a.push(d):d.draw(t,i))}for(u=0;u<a.length;++u)a[u].draw(t,i)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const o=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];i=a.$context||(a.$context=dee(this.getContext(),t,a)),i.parsed=this.getParsed(t),i.raw=o.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=uee(this.chart.getContext(),this.index)),i.dataset=o,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const o=n==="active",i=this._cachedDataOpts,a=t+"-"+n,s=i[a],l=this.enableOptionSharing&&sh(r);if(s)return V$(s,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=o?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),p=Object.keys(An.elements[t]),v=()=>this.getContext(r,o,n),b=c.resolveNamedOptions(h,p,v,d);return b.$shared&&(b.$shared=l,i[a]=Object.freeze(V$(b,l))),b}_resolveAnimations(t,n,r){const o=this.chart,i=this._cachedDataOpts,a=`animation-${n}`,s=i[a];if(s)return s;let l;if(o.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,r,n))}const c=new c3(o,l&&l.animations);return l&&l._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||_1(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),o=this._sharedOptions,i=this.getSharedOptions(r),a=this.includeOptions(n,i)||i!==o;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:a}}updateElement(t,n,r,o){_1(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!_1(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,o){t.active=o;const i=this.getStyle(n,o);this._resolveAnimations(n,r,o).update(t,{options:!o&&this.getSharedOptions(i)||i})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[s,l,c]of this._syncList)this[s](l,c);this._syncList=[];const o=r.length,i=n.length,a=Math.min(i,o);a&&this.parse(0,a),i>o?this._insertElements(o,i-o,t):i<o&&this._removeElements(i,o-i)}_insertElements(t,n,r=!0){const o=this._cachedMeta,i=o.data,a=t+n;let s;const l=c=>{for(c.length+=n,s=c.length-1;s>=a;s--)c[s]=c[s-n]};for(l(i),s=t;s<a;++s)i[s]=new this.dataElementType;this._parsing&&l(o._parsed),this.parse(t,n),r&&this.updateElements(i,t,n,"reset")}updateElements(t,n,r,o){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const o=r._parsed.splice(t,n);r._stacked&&Jd(r,o)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,o]=t;this[n](r,o)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Ne(Xo,"defaults",{}),Ne(Xo,"datasetElementType",null),Ne(Xo,"dataElementType",null);function hee(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let o=0,i=n.length;o<i;o++)r=r.concat(n[o].controller.getAllParsedValues(e));e._cache.$bar=W6(r.sort((o,i)=>o-i))}return e._cache.$bar}function pee(e){const t=e.iScale,n=hee(t,e.type);let r=t._length,o,i,a,s;const l=()=>{a===32767||a===-32768||(sh(s)&&(r=Math.min(r,Math.abs(a-s)||r)),s=a)};for(o=0,i=n.length;o<i;++o)a=t.getPixelForValue(n[o]),l();for(s=void 0,o=0,i=t.ticks.length;o<i;++o)a=t.getPixelForTick(o),l();return r}function gee(e,t,n,r){const o=n.barThickness;let i,a;return Tt(o)?(i=t.min*n.categoryPercentage,a=n.barPercentage):(i=o*r,a=1),{chunk:i/r,ratio:a,start:t.pixels[e]-i/2}}function mee(e,t,n,r){const o=t.pixels,i=o[e];let a=e>0?o[e-1]:null,s=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;a===null&&(a=i-(s===null?t.end-t.start:s-i)),s===null&&(s=i+i-a);const c=i-(i-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}function bee(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),a=Math.min(o,i),s=Math.max(o,i);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:i,min:a,max:s}}function d3(e,t,n,r){return _n(e)?bee(e,t,n,r):t[n.axis]=n.parse(e,r),t}function H$(e,t,n,r){const o=e.iScale,i=e.vScale,a=o.getLabels(),s=o===i,l=[];let c,u,d,h;for(c=n,u=n+r;c<u;++c)h=t[c],d={},d[o.axis]=s||o.parse(a[c],c),l.push(d3(h,d,i,c));return l}function S1(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function vee(e,t,n){return e!==0?Wi(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function yee(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:t,top:o,bottom:i}}function xee(e,t,n,r){let o=t.borderSkipped;const i={};if(!o){e.borderSkipped=i;return}if(o===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:s,reverse:l,top:c,bottom:u}=yee(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[W$(u,a,s,l)]=!0,o=c)),i[W$(o,a,s,l)]=!0,e.borderSkipped=i}function W$(e,t,n,r){return r?(e=wee(e,t,n),e=U$(e,n,t)):e=U$(e,t,n),e}function wee(e,t,n){return e===t?n:e===n?t:e}function U$(e,t,n){return e==="start"?t:e==="end"?n:e}function _ee(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Um extends Xo{parsePrimitiveData(t,n,r,o){return H$(t,n,r,o)}parseArrayData(t,n,r,o){return H$(t,n,r,o)}parseObjectData(t,n,r,o){const{iScale:i,vScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?s:l,u=a.axis==="x"?s:l,d=[];let h,p,v,b;for(h=r,p=r+o;h<p;++h)b=n[h],v={},v[i.axis]=i.parse(js(b,c),h),d.push(d3(js(b,u),v,a,h));return d}updateRangeFromParsed(t,n,r,o){super.updateRangeFromParsed(t,n,r,o);const i=r._custom;i&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:o}=n,i=this.getParsed(t),a=i._custom,s=S1(a)?"["+a.start+", "+a.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,o){const i=o==="reset",{index:a,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),c=s.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,o);for(let p=n;p<n+r;p++){const v=this.getParsed(p),b=i||Tt(v[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),x=this._calculateBarIndexPixels(p,u),y=(v._stacks||{})[s.axis],_={horizontal:c,base:b.base,enableBorderRadius:!y||S1(v._custom)||a===y._top||a===y._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};h&&(_.options=d||this.resolveDataElementOptions(p,t[p].active?"active":o));const S=_.options||t[p].options;xee(_,S,y,a),_ee(_,S,u.ratio),this.updateElement(t[p],p,_,o)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),i=r.options.stacked,a=[],s=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(Tt(u)||isNaN(u))return!0};for(const l of o)if(!(n!==void 0&&s(l))&&((i===!1||a.indexOf(l.stack)===-1||i===void 0&&l.stack===void 0)&&a.push(l.stack),l.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const o=this._getStacks(t,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,a;for(i=0,a=n.data.length;i<a;++i)o.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const s=t.barThickness;return{min:s||pee(n),pixels:o,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:o},options:{base:i,minBarLength:a}}=this,s=i||0,l=this.getParsed(t),c=l._custom,u=S1(c);let d=l[n.axis],h=0,p=r?this.applyStack(n,l,r):d,v,b;p!==d&&(h=p-d,p=d),u&&(d=c.barStart,p=c.barEnd-c.barStart,d!==0&&Wi(d)!==Wi(c.barEnd)&&(h=0),h+=d);const x=!Tt(i)&&!u?i:h;let y=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(h+p):v=y,b=v-y,Math.abs(b)<a){b=vee(b,n,s)*a,d===s&&(y-=b/2);const _=n.getPixelForDecimal(0),S=n.getPixelForDecimal(1),C=Math.min(_,S),E=Math.max(_,S);y=Math.max(Math.min(y,E),C),v=y+b,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(v)-n.getValueForPixel(y))}if(y===n.getPixelForValue(s)){const _=Wi(b)*n.getLineWidthForValue(s)/2;y+=_,b-=_}return{size:b,base:y,head:v,center:v+b/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,a=st(o.maxBarThickness,1/0);let s,l;if(n.grouped){const c=i?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?mee(t,n,o,c):gee(t,n,o,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);s=u.start+u.chunk*d+u.chunk/2,l=Math.min(a,u.chunk*u.ratio)}else s=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(a,n.min*n.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,o=r.length;let i=0;for(;i<o;++i)this.getParsed(i)[n.axis]!==null&&r[i].draw(this._ctx)}}Ne(Um,"id","bar"),Ne(Um,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ne(Um,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class qm extends Xo{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,o){const i=super.parsePrimitiveData(t,n,r,o);for(let a=0;a<i.length;a++)i[a]._custom=this.resolveDataElementOptions(a+r).radius;return i}parseArrayData(t,n,r,o){const i=super.parseArrayData(t,n,r,o);for(let a=0;a<i.length;a++){const s=n[r+a];i[a]._custom=st(s[2],this.resolveDataElementOptions(a+r).radius)}return i}parseObjectData(t,n,r,o){const i=super.parseObjectData(t,n,r,o);for(let a=0;a<i.length;a++){const s=n[r+a];i[a]._custom=st(s&&s.r&&+s.r,this.resolveDataElementOptions(a+r).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,a=this.getParsed(t),s=o.getLabelForValue(a.x),l=i.getLabelForValue(a.y),c=a._custom;return{label:r[t]||"",value:"("+s+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:a,vScale:s}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,o),u=a.axis,d=s.axis;for(let h=n;h<n+r;h++){const p=t[h],v=!i&&this.getParsed(h),b={},x=b[u]=i?a.getPixelForDecimal(.5):a.getPixelForValue(v[u]),y=b[d]=i?s.getBasePixel():s.getPixelForValue(v[d]);b.skip=isNaN(x)||isNaN(y),c&&(b.options=l||this.resolveDataElementOptions(h,p.active?"active":o),i&&(b.options.radius=0)),this.updateElement(p,h,b,o)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return n!=="active"&&(o.radius=0),o.radius+=st(r&&r._custom,i),o}}Ne(qm,"id","bubble"),Ne(qm,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Ne(qm,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function See(e,t,n){let r=1,o=1,i=0,a=0;if(t<Sn){const s=e,l=s+t,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),h=Math.sin(l),p=(S,C,E)=>lh(S,s,l,!0)?1:Math.max(C,C*n,E,E*n),v=(S,C,E)=>lh(S,s,l,!0)?-1:Math.min(C,C*n,E,E*n),b=p(0,c,d),x=p(Wn,u,h),y=v(Cn,c,d),_=v(Cn+Wn,u,h);r=(b-y)/2,o=(x-_)/2,i=-(b+y)/2,a=-(x+_)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:a}}class Dl extends Xo{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=r;else{let i=l=>+r[l];if(kt(r[t])){const{key:l="value"}=this._parsing;i=c=>+js(r[c],l)}let a,s;for(a=t,s=t+n;a<s;++a)o._parsed[a]=i(a)}}_getRotation(){return mi(this.options.rotation-90)}_getCircumference(){return mi(this.options.circumference)}_getRotationExtents(){let t=Sn,n=-Sn;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const o=this.chart.getDatasetMeta(r).controller,i=o._getRotation(),a=o._getCircumference();t=Math.min(t,i),n=Math.max(n,i+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,o=this._cachedMeta,i=o.data,a=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,s=Math.max((Math.min(r.width,r.height)-a)/2,0),l=Math.min(LJ(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:p,offsetX:v,offsetY:b}=See(d,u,l),x=(r.width-a)/h,y=(r.height-a)/p,_=Math.max(Math.min(x,y)/2,0),S=j6(this.options.radius,_),C=Math.max(S*l,0),E=(S-C)/this._getVisibleDatasetWeightTotal();this.offsetX=v*S,this.offsetY=b*S,o.total=this.calculateTotal(),this.outerRadius=S-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*c,0),this.updateElements(i,0,i.length,t)}_circumference(t,n){const r=this.options,o=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*i/Sn)}updateElements(t,n,r,o){const i=o==="reset",a=this.chart,s=a.chartArea,c=a.options.animation,u=(s.left+s.right)/2,d=(s.top+s.bottom)/2,h=i&&c.animateScale,p=h?0:this.innerRadius,v=h?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(n,o);let y=this._getRotation(),_;for(_=0;_<n;++_)y+=this._circumference(_,i);for(_=n;_<n+r;++_){const S=this._circumference(_,i),C=t[_],E={x:u+this.offsetX,y:d+this.offsetY,startAngle:y,endAngle:y+S,circumference:S,outerRadius:v,innerRadius:p};x&&(E.options=b||this.resolveDataElementOptions(_,C.active?"active":o)),y+=S,this.updateElement(C,_,E,o)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,o;for(o=0;o<n.length;o++){const i=t._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Sn*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=fp(n._parsed[t],r.options.locale);return{label:o[t]||"",value:i}}getMaxBorderWidth(t){let n=0;const r=this.chart;let o,i,a,s,l;if(!t){for(o=0,i=r.data.datasets.length;o<i;++o)if(r.isDatasetVisible(o)){a=r.getDatasetMeta(o),t=a.data,s=a.controller;break}}if(!t)return 0;for(o=0,i=t.length;o<i;++o)l=s.resolveDataElementOptions(o),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,o=t.length;r<o;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(st(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ne(Dl,"id","doughnut"),Ne(Dl,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Ne(Dl,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Ne(Dl,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class Gm extends Xo{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:o=[],_dataset:i}=n,a=this.chart._animationsDisabled;let{start:s,count:l}=G6(n,o,a);this._drawStart=s,this._drawCount=l,Y6(n)&&(s=0,l=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=o;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:c},t),this.updateElements(o,s,l,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,o),h=a.axis,p=s.axis,{spanGaps:v,segment:b}=this.options,x=Qu(v)?v:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||i||o==="none",_=n+r,S=t.length;let C=n>0&&this.getParsed(n-1);for(let E=0;E<S;++E){const $=t[E],T=y?$:{};if(E<n||E>=_){T.skip=!0;continue}const D=this.getParsed(E),M=Tt(D[p]),L=T[h]=a.getPixelForValue(D[h],E),F=T[p]=i||M?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,D,l):D[p],E);T.skip=isNaN(L)||isNaN(F)||M,T.stop=E>0&&Math.abs(D[h]-C[h])>x,b&&(T.parsed=D,T.raw=c.data[E]),d&&(T.options=u||this.resolveDataElementOptions(E,$.active?"active":o)),y||this.updateElement($,E,T,o),C=D}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return r;const i=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(r,i,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ne(Gm,"id","line"),Ne(Gm,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ne(Gm,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Vf extends Xo{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=fp(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return n3.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<n.min&&(n.min=i),i>n.max&&(n.max=i))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(o/2,0),a=Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0),s=(i-a)/t.getVisibleDatasetCount();this.outerRadius=i-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,n,r,o){const i=o==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Cn;let p=h,v;const b=360/this.countVisibleElements();for(v=0;v<n;++v)p+=this._computeAngle(v,o,b);for(v=n;v<n+r;v++){const x=t[v];let y=p,_=p+this._computeAngle(v,o,b),S=a.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;p=_,i&&(l.animateScale&&(S=0),l.animateRotate&&(y=_=h));const C={x:u,y:d,innerRadius:0,outerRadius:S,startAngle:y,endAngle:_,options:this.resolveDataElementOptions(v,x.active?"active":o)};this.updateElement(x,v,C,o)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?mi(this.resolveDataElementOptions(t,n).angle||r):0}}Ne(Vf,"id","polarArea"),Ne(Vf,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Ne(Vf,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(a),index:a}})}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 Uw extends Dl{}Ne(Uw,"id","pie"),Ne(Uw,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Ym extends Xo{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,o){return n3.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta,r=n.dataset,o=n.data||[],i=n.iScale.getLabels();if(r.points=o,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const s={_loop:!0,_fullLoop:i.length===o.length,options:a};this.updateElement(r,void 0,s,t)}this.updateElements(o,0,o.length,t)}updateElements(t,n,r,o){const i=this._cachedMeta.rScale,a=o==="reset";for(let s=n;s<n+r;s++){const l=t[s],c=this.resolveDataElementOptions(s,l.active?"active":o),u=i.getPointPositionForValue(s,this.getParsed(s).r),d=a?i.xCenter:u.x,h=a?i.yCenter:u.y,p={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,s,p,o)}}}Ne(Ym,"id","radar"),Ne(Ym,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Ne(Ym,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Km extends Xo{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,a=this.getParsed(t),s=o.getLabelForValue(a.x),l=i.getLabelForValue(a.y);return{label:r[t]||"",value:"("+s+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,o=this.chart._animationsDisabled;let{start:i,count:a}=G6(n,r,o);if(this._drawStart=i,this._drawCount=a,Y6(n)&&(i=0,a=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:s,_dataset:l}=n;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!l._decimated,s.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!o,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,i,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,o){const i=o==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,o),d=this.getSharedOptions(u),h=this.includeOptions(o,d),p=a.axis,v=s.axis,{spanGaps:b,segment:x}=this.options,y=Qu(b)?b:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||i||o==="none";let S=n>0&&this.getParsed(n-1);for(let C=n;C<n+r;++C){const E=t[C],$=this.getParsed(C),T=_?E:{},D=Tt($[v]),M=T[p]=a.getPixelForValue($[p],C),L=T[v]=i||D?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,$,l):$[v],C);T.skip=isNaN(M)||isNaN(L)||D,T.stop=C>0&&Math.abs($[p]-S[p])>y,x&&(T.parsed=$,T.raw=c.data[C]),h&&(T.options=d||this.resolveDataElementOptions(C,E.active?"active":o)),_||this.updateElement(E,C,T,o),S=$}this.updateSharedOptions(d,o,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let s=0;for(let l=n.length-1;l>=0;--l)s=Math.max(s,n[l].size(this.resolveDataElementOptions(l))/2);return s>0&&s}const r=t.dataset,o=r.options&&r.options.borderWidth||0;if(!n.length)return o;const i=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,i,a)/2}}Ne(Km,"id","scatter"),Ne(Km,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Ne(Km,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Cee=Object.freeze({__proto__:null,BarController:Um,BubbleController:qm,DoughnutController:Dl,LineController:Gm,PieController:Uw,PolarAreaController:Vf,RadarController:Ym,ScatterController:Km});function gl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class NC{constructor(t){Ne(this,"options");this.options=t||{}}static override(t){Object.assign(NC.prototype,t)}init(){}formats(){return gl()}parse(){return gl()}format(){return gl()}add(){return gl()}diff(){return gl()}startOf(){return gl()}endOf(){return gl()}}var Eee={_date:NC};function Ree(e,t,n,r){const{controller:o,data:i,_sorted:a}=e,s=o._cachedMeta.iScale;if(s&&t===s.axis&&t!=="r"&&a&&i.length){const l=s._reversePixels?KJ:Aa;if(r){if(o._sharedOptions){const c=i[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(i,t,n-u),h=l(i,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(i,t,n)}return{lo:0,hi:i.length-1}}function hp(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),a=n[t];for(let s=0,l=i.length;s<l;++s){const{index:c,data:u}=i[s],{lo:d,hi:h}=Ree(i[s],t,a,o);for(let p=d;p<=h;++p){const v=u[p];v.skip||r(v,c,p)}}}function Pee(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,o){const i=t?Math.abs(r.x-o.x):0,a=n?Math.abs(r.y-o.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(a,2))}}function C1(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||hp(e,n,t,function(s,l,c){!o&&!Ma(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&i.push({element:s,datasetIndex:l,index:c})},!0),i}function $ee(e,t,n,r){let o=[];function i(a,s,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],r),{angle:d}=V6(a,{x:t.x,y:t.y});lh(d,c,u)&&o.push({element:a,datasetIndex:s,index:l})}return hp(e,n,t,i),o}function Oee(e,t,n,r,o,i){let a=[];const s=Pee(n);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const p=u.inRange(t.x,t.y,o);if(r&&!p)return;const v=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(v))&&!p)return;const x=s(t,v);x<l?(a=[{element:u,datasetIndex:d,index:h}],l=x):x===l&&a.push({element:u,datasetIndex:d,index:h})}return hp(e,n,t,c),a}function E1(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?$ee(e,t,n,o):Oee(e,t,n,r,o,i)}function q$(e,t,n,r,o){const i=[],a=n==="x"?"inXRange":"inYRange";let s=!1;return hp(e,n,t,(l,c,u)=>{l[a](t[n],o)&&(i.push({element:l,datasetIndex:c,index:u}),s=s||l.inRange(t.x,t.y,o))}),r&&!s?[]:i}var Tee={evaluateInteractionItems:hp,modes:{index(e,t,n,r){const o=yl(t,e),i=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?C1(e,o,i,r,a):E1(e,o,i,!1,r,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=s[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const o=yl(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?C1(e,o,i,r,a):E1(e,o,i,!1,r,a);if(s.length>0){const l=s[0].datasetIndex,c=e.getDatasetMeta(l).data;s=[];for(let u=0;u<c.length;++u)s.push({element:c[u],datasetIndex:l,index:u})}return s},point(e,t,n,r){const o=yl(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;return C1(e,o,i,r,a)},nearest(e,t,n,r){const o=yl(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;return E1(e,o,i,n.intersect,r,a)},x(e,t,n,r){const o=yl(t,e);return q$(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=yl(t,e);return q$(e,o,"y",n.intersect,r)}}};const f3=["left","top","right","bottom"];function Zd(e,t){return e.filter(n=>n.pos===t)}function G$(e,t){return e.filter(n=>f3.indexOf(n.pos)===-1&&n.box.axis===t)}function ef(e,t){return e.sort((n,r)=>{const o=t?r:n,i=t?n:r;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function Dee(e){const t=[];let n,r,o,i,a,s;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],{position:i,options:{stack:a,stackWeight:s=1}}=o,t.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&i+a,stackWeight:s});return t}function Aee(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!f3.includes(o))continue;const a=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function Mee(e,t){const n=Aee(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,a,s;for(i=0,a=e.length;i<a;++i){s=e[i];const{fullSize:l}=s.box,c=n[s.stack],u=c&&s.stackWeight/c.weight;s.horizontal?(s.width=u?u*r:l&&t.availableWidth,s.height=o):(s.width=r,s.height=u?u*o:l&&t.availableHeight)}return n}function kee(e){const t=Dee(e),n=ef(t.filter(c=>c.box.fullSize),!0),r=ef(Zd(t,"left"),!0),o=ef(Zd(t,"right")),i=ef(Zd(t,"top"),!0),a=ef(Zd(t,"bottom")),s=G$(t,"x"),l=G$(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(a).concat(s),chartArea:Zd(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(a).concat(s)}}function Y$(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function h3(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 Iee(e,t,n,r){const{pos:o,box:i}=n,a=e.maxPadding;if(!kt(o)){n.size&&(e[o]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?i.height:i.width),n.size=d.size/d.count,e[o]+=n.size}i.getPadding&&h3(a,i.getPadding());const s=Math.max(0,t.outerWidth-Y$(a,e,"left","right")),l=Math.max(0,t.outerHeight-Y$(a,e,"top","bottom")),c=s!==e.w,u=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Nee(e){const t=e.maxPadding;function n(r){const o=Math.max(t[r]-e[r],0);return e[r]+=o,o}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Lee(e,t){const n=t.maxPadding;function r(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(a=>{i[a]=Math.max(t[a],n[a])}),i}return r(e?["left","right"]:["top","bottom"])}function Rf(e,t,n,r){const o=[];let i,a,s,l,c,u;for(i=0,a=e.length,c=0;i<a;++i){s=e[i],l=s.box,l.update(s.width||t.w,s.height||t.h,Lee(s.horizontal,t));const{same:d,other:h}=Iee(t,n,s,r);c|=d&&o.length,u=u||h,l.fullSize||o.push(s)}return c&&Rf(o,t,n,r)||u}function Hg(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function K$(e,t,n,r){const o=n.padding;let{x:i,y:a}=t;for(const s of e){const l=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},u=s.stackWeight/c.weight||1;if(s.horizontal){const d=t.w*u,h=c.size||l.height;sh(c.start)&&(a=c.start),l.fullSize?Hg(l,o.left,a,n.outerWidth-o.right-o.left,h):Hg(l,t.left+c.placed,a,d,h),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*u,h=c.size||l.width;sh(c.start)&&(i=c.start),l.fullSize?Hg(l,i,o.top,h,n.outerHeight-o.bottom-o.top):Hg(l,i,t.top+c.placed,h,d),c.start=i,c.placed+=d,i=l.right}}t.x=i,t.y=a}var _r={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const o=fr(e.options.layout.padding),i=Math.max(t-o.width,0),a=Math.max(n-o.height,0),s=kee(e.boxes),l=s.vertical,c=s.horizontal;nn(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,x)=>x.box.options&&x.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:a,vBoxMaxWidth:i/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},o);h3(h,fr(r));const p=Object.assign({maxPadding:h,w:i,h:a,x:o.left,y:o.top},o),v=Mee(l.concat(c),d);Rf(s.fullSize,p,d,v),Rf(l,p,d,v),Rf(c,p,d,v)&&Rf(l,p,d,v),Nee(p),K$(s.leftAndTop,p,d,v),p.x+=p.w,p.y+=p.h,K$(s.rightAndBottom,p,d,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},nn(s.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 p3{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,o){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,o?Math.floor(n/o):r)}}isAttached(t){return!0}updateConfig(t){}}class Fee extends p3{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Xm="$chartjs",jee={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},X$=e=>e===null||e==="";function zee(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Xm]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",X$(o)){const i=A$(e,"width");i!==void 0&&(e.width=i)}if(X$(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=A$(e,"height");i!==void 0&&(e.height=i)}return e}const g3=VZ?{passive:!0}:!1;function Bee(e,t,n){e.addEventListener(t,n,g3)}function Vee(e,t,n){e.canvas.removeEventListener(t,n,g3)}function Hee(e,t){const n=jee[e.type]||e.type,{x:r,y:o}=yl(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function C0(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Wee(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let a=!1;for(const s of i)a=a||C0(s.addedNodes,r),a=a&&!C0(s.removedNodes,r);a&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function Uee(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let a=!1;for(const s of i)a=a||C0(s.removedNodes,r),a=a&&!C0(s.addedNodes,r);a&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const uh=new Map;let Q$=0;function m3(){const e=window.devicePixelRatio;e!==Q$&&(Q$=e,uh.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function qee(e,t){uh.size||window.addEventListener("resize",m3),uh.set(e,t)}function Gee(e){uh.delete(e),uh.size||window.removeEventListener("resize",m3)}function Yee(e,t,n){const r=e.canvas,o=r&&IC(r);if(!o)return;const i=q6((s,l)=>{const c=o.clientWidth;n(s,l),c<o.clientWidth&&n()},window),a=new ResizeObserver(s=>{const l=s[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||i(c,u)});return a.observe(o),qee(e,i),a}function R1(e,t,n){n&&n.disconnect(),t==="resize"&&Gee(e)}function Kee(e,t,n){const r=e.canvas,o=q6(i=>{e.ctx!==null&&n(Hee(i,e))},e);return Bee(r,t,o),o}class Xee extends p3{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(zee(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Xm])return!1;const r=n[Xm].initial;["height","width"].forEach(i=>{const a=r[i];Tt(a)?n.removeAttribute(i):n.setAttribute(i,a)});const o=r.style||{};return Object.keys(o).forEach(i=>{n.style[i]=o[i]}),n.width=n.width,delete n[Xm],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),a={attach:Wee,detach:Uee,resize:Yee}[n]||Kee;o[n]=a(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:R1,detach:R1,resize:R1}[n]||Vee)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return BZ(t,n,r,o)}isAttached(t){const n=IC(t);return!!(n&&n.isConnected)}}function Qee(e){return!kC()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Fee:Xee}var Wm;let ra=(Wm=class{constructor(){Ne(this,"x");Ne(this,"y");Ne(this,"active",!1);Ne(this,"options");Ne(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Qu(this.x)&&Qu(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const o={};return t.forEach(i=>{o[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),o}},Ne(Wm,"defaults",{}),Ne(Wm,"defaultRoutes"),Wm);function Jee(e,t){const n=e.options.ticks,r=Zee(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?tte(t):[],a=i.length,s=i[0],l=i[a-1],c=[];if(a>o)return nte(t,c,i,a/o),c;const u=ete(i,t,o);if(a>0){let d,h;const p=a>1?Math.round((l-s)/(a-1)):null;for(Wg(t,c,u,Tt(p)?0:s-p,s),d=0,h=a-1;d<h;d++)Wg(t,c,u,i[d],i[d+1]);return Wg(t,c,u,l,Tt(p)?t.length:l+p),c}return Wg(t,c,u),c}function Zee(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}function ete(e,t,n){const r=rte(e),o=t.length/n;if(!r)return Math.max(o,1);const i=UJ(r);for(let a=0,s=i.length-1;a<s;a++){const l=i[a];if(l>o)return l}return Math.max(o,1)}function tte(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function nte(e,t,n,r){let o=0,i=n[0],a;for(r=Math.ceil(r),a=0;a<e.length;a++)a===i&&(t.push(e[a]),o++,i=n[o*r])}function Wg(e,t,n,r,o){const i=st(r,0),a=Math.min(st(o,e.length),e.length);let s=0,l,c,u;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),u=i;u<0;)s++,u=Math.round(i+s*n);for(c=Math.max(i,0);c<a;c++)c===u&&(t.push(e[c]),s++,u=Math.round(i+s*n))}function rte(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 ote=e=>e==="left"?"right":e==="right"?"left":e,J$=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Z$=(e,t)=>Math.min(t||e,e);function eO(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;i<o;i+=r)n.push(e[Math.floor(i)]);return n}function ite(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,a=e._endPixel,s=1e-6;let l=e.getPixelForTick(o),c;if(!(n&&(r===1?c=Math.max(l-i,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(o-1))/2,l+=o<t?c:-c,l<i-s||l>a+s)))return l}function ate(e,t){nn(e,n=>{const r=n.gc,o=r.length/2;let i;if(o>t){for(i=0;i<o;++i)delete n.data[r[i]];r.splice(0,o)}})}function tf(e){return e.drawTicks?e.tickLength:0}function tO(e,t){if(!e.display)return 0;const n=qn(e.font,t),r=fr(e.padding);return(_n(e.text)?e.text.length:1)*n.lineHeight+r.height}function ste(e,t){return Xs(e,{scale:t,type:"scale"})}function lte(e,t,n){return Xs(e,{tick:n,index:t,type:"tick"})}function cte(e,t,n){let r=$C(e);return(n&&t!=="right"||!n&&t==="right")&&(r=ote(r)),r}function ute(e,t,n,r){const{top:o,left:i,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,h,p,v;const b=a-o,x=s-i;if(e.isHorizontal()){if(p=wr(r,i,s),kt(n)){const y=Object.keys(n)[0],_=n[y];v=u[y].getPixelForValue(_)+b-t}else n==="center"?v=(c.bottom+c.top)/2+b-t:v=J$(e,n,t);h=s-i}else{if(kt(n)){const y=Object.keys(n)[0],_=n[y];p=u[y].getPixelForValue(_)-x+t}else n==="center"?p=(c.left+c.right)/2-x+t:p=J$(e,n,t);v=wr(r,a,o),d=n==="left"?-Wn:Wn}return{titleX:p,titleY:v,maxWidth:h,rotation:d}}class Qs extends ra{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:o}=this;return t=mo(t,Number.POSITIVE_INFINITY),n=mo(n,Number.NEGATIVE_INFINITY),r=mo(r,Number.POSITIVE_INFINITY),o=mo(o,Number.NEGATIVE_INFINITY),{min:mo(t,r),max:mo(n,o),minDefined:Ln(t),maxDefined:Ln(n)}}getMinMax(t){let{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds(),a;if(o&&i)return{min:n,max:r};const s=this.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)a=s[l].controller.getMinMax(this,t),o||(n=Math.min(n,a.min)),i||(r=Math.max(r,a.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:mo(n,mo(r,n)),max:mo(r,mo(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(){cn(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:o,grace:i,ticks:a}=this.options,s=a.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=yZ(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?eO(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Jee(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(){cn(this.options.afterUpdate,[this])}beforeSetDimensions(){cn(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(){cn(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),cn(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){cn(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,o,i;for(r=0,o=t.length;r<o;r++)i=t[r],i.label=cn(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){cn(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){cn(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Z$(this.ticks.length,t.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let a=o,s,l,c;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,p=rr(this.chart.width-d,0,this.maxWidth);s=t.offset?this.maxWidth/r:p/(r-1),d+6>s&&(s=p/(r-(t.offset?.5:1)),l=this.maxHeight-tf(t.grid)-n.padding-tO(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),a=RC(Math.min(Math.asin(rr((u.highest.height+6)/s,-1,1)),Math.asin(rr(l/c,-1,1))-Math.asin(rr(h/c,-1,1)))),a=Math.max(o,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){cn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){cn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:o,grid:i}}=this,a=this._isVisible(),s=this.isHorizontal();if(a){const l=tO(o,n.options.font);if(s?(t.width=this.maxWidth,t.height=tf(i)+l):(t.height=this.maxHeight,t.width=tf(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),p=r.padding*2,v=mi(this.labelRotation),b=Math.cos(v),x=Math.sin(v);if(s){const y=r.mirror?0:x*d.width+b*h.height;t.height=Math.min(this.maxHeight,t.height+y+p)}else{const y=r.mirror?0:b*d.width+x*h.height;t.width=Math.min(this.maxWidth,t.width+y+p)}this._calculatePadding(c,u,x,b)}}this._handleMargins(),s?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,o){const{ticks:{align:i,padding:a},position:s}=this.options,l=this.labelRotation!==0,c=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,p=0;l?c?(h=o*t.width,p=r*n.height):(h=r*t.height,p=o*n.width):i==="start"?p=n.width:i==="end"?h=t.width:i!=="inner"&&(h=t.width/2,p=n.width/2),this.paddingLeft=Math.max((h-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+a)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;i==="start"?(u=0,d=t.height):i==="end"&&(u=n.height,d=0),this.paddingTop=u+a,this.paddingBottom=d+a}}_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(){cn(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++)Tt(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=eO(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:o,_longestTextCache:i}=this,a=[],s=[],l=Math.floor(n/Z$(n,r));let c=0,u=0,d,h,p,v,b,x,y,_,S,C,E;for(d=0;d<n;d+=l){if(v=t[d].label,b=this._resolveTickFontOptions(d),o.font=x=b.string,y=i[x]=i[x]||{data:{},gc:[]},_=b.lineHeight,S=C=0,!Tt(v)&&!_n(v))S=w0(o,y.data,y.gc,S,v),C=_;else if(_n(v))for(h=0,p=v.length;h<p;++h)E=v[h],!Tt(E)&&!_n(E)&&(S=w0(o,y.data,y.gc,S,E),C+=_);a.push(S),s.push(C),c=Math.max(S,c),u=Math.max(C,u)}ate(i,n);const $=a.indexOf(c),T=s.indexOf(u),D=M=>({width:a[M]||0,height:s[M]||0});return{first:D(0),last:D(n-1),widest:D($),highest:D(T),widths:a,heights:s}}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 YJ(this._alignToPixels?pl(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=lte(this.getContext(),t,r))}return this.$context||(this.$context=ste(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=mi(this.labelRotation),r=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),i=this._getLabelSizes(),a=t.autoSkipPadding||0,s=i?i.widest.width+a:0,l=i?i.highest.height+a:0;return this.isHorizontal()?l*r>s*o?s/r:l/o:l*o<s*r?l/r:s/o}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,o=this.options,{grid:i,position:a,border:s}=o,l=i.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=tf(i),p=[],v=s.setContext(this.getContext()),b=v.display?v.width:0,x=b/2,y=function(U){return pl(r,U,b)};let _,S,C,E,$,T,D,M,L,F,z,X;if(a==="top")_=y(this.bottom),T=this.bottom-h,M=_-x,F=y(t.top)+x,X=t.bottom;else if(a==="bottom")_=y(this.top),F=t.top,X=y(t.bottom)-x,T=_+x,M=this.top+h;else if(a==="left")_=y(this.right),$=this.right-h,D=_-x,L=y(t.left)+x,z=t.right;else if(a==="right")_=y(this.left),L=t.left,z=y(t.right)-x,$=_+x,D=this.left+h;else if(n==="x"){if(a==="center")_=y((t.top+t.bottom)/2+.5);else if(kt(a)){const U=Object.keys(a)[0],V=a[U];_=y(this.chart.scales[U].getPixelForValue(V))}F=t.top,X=t.bottom,T=_+x,M=T+h}else if(n==="y"){if(a==="center")_=y((t.left+t.right)/2);else if(kt(a)){const U=Object.keys(a)[0],V=a[U];_=y(this.chart.scales[U].getPixelForValue(V))}$=_-x,D=$-h,L=t.left,z=t.right}const G=st(o.ticks.maxTicksLimit,d),A=Math.max(1,Math.ceil(d/G));for(S=0;S<d;S+=A){const U=this.getContext(S),V=i.setContext(U),K=s.setContext(U),q=V.lineWidth,O=V.color,H=K.dash||[],Y=K.dashOffset,I=V.tickWidth,te=V.tickColor,ce=V.tickBorderDash||[],de=V.tickBorderDashOffset;C=ite(this,S,l),C!==void 0&&(E=pl(r,C,q),c?$=D=L=z=E:T=M=F=X=E,p.push({tx1:$,ty1:T,tx2:D,ty2:M,x1:L,y1:F,x2:z,y2:X,width:q,color:O,borderDash:H,borderDashOffset:Y,tickWidth:I,tickColor:te,tickBorderDash:ce,tickBorderDashOffset:de}))}return this._ticksLength=d,this._borderValue=_,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:o,ticks:i}=r,a=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=i,h=tf(r.grid),p=h+u,v=d?-u:p,b=-mi(this.labelRotation),x=[];let y,_,S,C,E,$,T,D,M,L,F,z,X="middle";if(o==="top")$=this.bottom-v,T=this._getXAxisLabelAlignment();else if(o==="bottom")$=this.top+v,T=this._getXAxisLabelAlignment();else if(o==="left"){const A=this._getYAxisLabelAlignment(h);T=A.textAlign,E=A.x}else if(o==="right"){const A=this._getYAxisLabelAlignment(h);T=A.textAlign,E=A.x}else if(n==="x"){if(o==="center")$=(t.top+t.bottom)/2+p;else if(kt(o)){const A=Object.keys(o)[0],U=o[A];$=this.chart.scales[A].getPixelForValue(U)+p}T=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(t.left+t.right)/2-p;else if(kt(o)){const A=Object.keys(o)[0],U=o[A];E=this.chart.scales[A].getPixelForValue(U)}T=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));const G=this._getLabelSizes();for(y=0,_=s.length;y<_;++y){S=s[y],C=S.label;const A=i.setContext(this.getContext(y));D=this.getPixelForTick(y)+i.labelOffset,M=this._resolveTickFontOptions(y),L=M.lineHeight,F=_n(C)?C.length:1;const U=F/2,V=A.color,K=A.textStrokeColor,q=A.textStrokeWidth;let O=T;a?(E=D,T==="inner"&&(y===_-1?O=this.options.reverse?"left":"right":y===0?O=this.options.reverse?"right":"left":O="center"),o==="top"?c==="near"||b!==0?z=-F*L+L/2:c==="center"?z=-G.highest.height/2-U*L+L:z=-G.highest.height+L/2:c==="near"||b!==0?z=L/2:c==="center"?z=G.highest.height/2-U*L:z=G.highest.height-F*L,d&&(z*=-1),b!==0&&!A.showLabelBackdrop&&(E+=L/2*Math.sin(b))):($=D,z=(1-F)*L/2);let H;if(A.showLabelBackdrop){const Y=fr(A.backdropPadding),I=G.heights[y],te=G.widths[y];let ce=z-Y.top,de=0-Y.left;switch(X){case"middle":ce-=I/2;break;case"bottom":ce-=I;break}switch(T){case"center":de-=te/2;break;case"right":de-=te;break;case"inner":y===_-1?de-=te:y>0&&(de-=te/2);break}H={left:de,top:ce,width:te+Y.width,height:I+Y.height,color:A.backdropColor}}x.push({label:C,font:M,textOffset:z,options:{rotation:b,color:V,strokeColor:K,strokeWidth:q,textAlign:O,textBaseline:X,translation:[E,$],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-mi(this.labelRotation))return t==="top"?"left":"right";let o="center";return n.align==="start"?o="left":n.align==="end"?o="right":n.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:o,padding:i}}=this.options,a=this._getLabelSizes(),s=t+i,l=a.widest.width;let c,u;return n==="left"?o?(u=this.right+i,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?o?(u=this.left+i,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:o,width:i,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,o,i,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const o=this.ticks.findIndex(i=>i.value===t);return o>=0?n.setContext(this.getContext(o)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,a;const s=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(i=0,a=o.length;i<a;++i){const l=o[i];n.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:o}}=this,i=r.setContext(this.getContext()),a=r.display?i.width:0;if(!a)return;const s=o.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=pl(t,this.left,a)-a/2,u=pl(t,this.right,s)+s/2,d=h=l):(d=pl(t,this.top,a)-a/2,h=pl(t,this.bottom,s)+s/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&Wl(r,o);const i=this.getLabelItems(t);for(const a of i){const s=a.options,l=a.font,c=a.label,u=a.textOffset;sc(r,c,0,u,l,s)}o&&Ul(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=qn(r.font),a=fr(r.padding),s=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||kt(n)?(l+=a.bottom,_n(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=ute(this,l,n,s);sc(t,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:h,textAlign:cte(s,n,o),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=st(t.grid&&t.grid.z,-1),o=st(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Qs.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",o=[];let i,a;for(i=0,a=n.length;i<a;++i){const s=n[i];s[r]===this.id&&(!t||s.type===t)&&o.push(s)}return o}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return qn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ug{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;hte(n)&&(r=this.register(n));const o=this.items,i=t.id,a=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in o||(o[i]=t,dte(t,a,r),this.override&&An.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,o=this.scope;r in n&&delete n[r],o&&r in An[o]&&(delete An[o][r],this.override&&delete ac[r])}}function dte(e,t,n){const r=or(Object.create(null),[n?An.get(n):{},An.get(t),e.defaults]);An.set(t,r),e.defaultRoutes&&fte(t,e.defaultRoutes),e.descriptors&&An.describe(t,e.descriptors)}function fte(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),a=t[n].split("."),s=a.pop(),l=a.join(".");An.route(i,o,l,s)})}function hte(e){return"id"in e&&"defaults"in e}class pte{constructor(){this.controllers=new Ug(Xo,"datasets",!0),this.elements=new Ug(ra,"elements"),this.plugins=new Ug(Object,"plugins"),this.scales=new Ug(Qs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(o=>{const i=r||this._getRegistryForType(o);r||i.isForType(o)||i===this.plugins&&o.id?this._exec(t,i,o):nn(o,a=>{const s=r||this._getRegistryForType(a);this._exec(t,s,a)})})}_exec(t,n,r){const o=EC(t);cn(r["before"+o],[],r),n[t](r),cn(r["after"+o],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const o=n.get(t);if(o===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return o}}var Nr=new pte;class gte{constructor(){this._init=[]}notify(t,n,r,o){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const i=o?this._descriptors(t).filter(o):this._descriptors(t),a=this._notify(i,t,n,r);return n==="afterDestroy"&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,n,r,o){o=o||{};for(const i of t){const a=i.plugin,s=a[r],l=[n,o,i.options];if(cn(s,l,a)===!1&&o.cancelable)return!1}return!0}invalidate(){Tt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,o=st(r.options&&r.options.plugins,{}),i=mte(r);return o===!1&&!n?[]:vte(t,i,o,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,o=(i,a)=>i.filter(s=>!a.some(l=>s.plugin.id===l.plugin.id));this._notify(o(n,r),t,"stop"),this._notify(o(r,n),t,"start")}}function mte(e){const t={},n=[],r=Object.keys(Nr.plugins.items);for(let i=0;i<r.length;i++)n.push(Nr.getPlugin(r[i]));const o=e.plugins||[];for(let i=0;i<o.length;i++){const a=o[i];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function bte(e,t){return!t&&e===!1?null:e===!0?{}:e}function vte(e,{plugins:t,localIds:n},r,o){const i=[],a=e.getContext();for(const s of t){const l=s.id,c=bte(r[l],o);c!==null&&i.push({plugin:s,options:yte(e.config,{plugin:s,local:n[l]},c,a)})}return i}function yte(e,{plugin:t,local:n},r,o){const i=e.pluginScopeKeys(t),a=e.getOptionScopes(r,i);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function qw(e,t){const n=An.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function xte(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function wte(e,t){return e===t?"_index_":"_value_"}function nO(e){if(e==="x"||e==="y"||e==="r")return e}function _te(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Gw(e,...t){if(nO(e))return e;for(const n of t){const r=n.axis||_te(n.position)||e.length>1&&nO(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function rO(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Ste(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 rO(e,"x",n[0])||rO(e,"y",n[0])}return{}}function Cte(e,t){const n=ac[e.type]||{scales:{}},r=t.scales||{},o=qw(e.type,t),i=Object.create(null);return Object.keys(r).forEach(a=>{const s=r[a];if(!kt(s))return console.error(`Invalid scale configuration for scale: ${a}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=Gw(a,s,Ste(a,e),An.scales[s.type]),c=wte(l,o),u=n.scales||{};i[a]=Ff(Object.create(null),[{axis:l},s,u[l],u[c]])}),e.data.datasets.forEach(a=>{const s=a.type||e.type,l=a.indexAxis||qw(s,t),u=(ac[s]||{}).scales||{};Object.keys(u).forEach(d=>{const h=xte(d,l),p=a[h+"AxisID"]||h;i[p]=i[p]||Object.create(null),Ff(i[p],[{axis:h},r[p],u[d]])})}),Object.keys(i).forEach(a=>{const s=i[a];Ff(s,[An.scales[s.type],An.scale])}),i}function b3(e){const t=e.options||(e.options={});t.plugins=st(t.plugins,{}),t.scales=Cte(e,t)}function v3(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Ete(e){return e=e||{},e.data=v3(e.data),b3(e),e}const oO=new Map,y3=new Set;function qg(e,t){let n=oO.get(e);return n||(n=t(),oO.set(e,n),y3.add(n)),n}const nf=(e,t,n)=>{const r=js(t,n);r!==void 0&&e.add(r)};class Rte{constructor(t){this._config=Ete(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=v3(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(),b3(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return qg(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return qg(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return qg(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return qg(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let o=r.get(t);return(!o||n)&&(o=new Map,r.set(t,o)),o}getOptionScopes(t,n,r){const{options:o,type:i}=this,a=this._cachedScopes(t,r),s=a.get(n);if(s)return s;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>nf(l,t,d))),u.forEach(d=>nf(l,o,d)),u.forEach(d=>nf(l,ac[i]||{},d)),u.forEach(d=>nf(l,An,d)),u.forEach(d=>nf(l,Ww,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),y3.has(n)&&a.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,ac[n]||{},An.datasets[n]||{},{type:n},An,Ww]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:a,subPrefixes:s}=iO(this._resolverCache,t,o);let l=a;if($te(a,n)){i.$shared=!1,r=zs(r)?r():r;const c=this.createResolver(t,r,s);l=Ju(a,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=iO(this._resolverCache,t,r);return kt(n)?Ju(i,n,void 0,o):i}}function iO(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);return i||(i={resolver:DC(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(o,i)),i}const Pte=e=>kt(e)&&Object.getOwnPropertyNames(e).some(t=>zs(e[t]));function $te(e,t){const{isScriptable:n,isIndexable:r}=J6(e);for(const o of t){const i=n(o),a=r(o),s=(a||i)&&e[o];if(i&&(zs(s)||Pte(s))||a&&_n(s))return!0}return!1}var Ote="4.4.1";const Tte=["top","bottom","left","right","chartArea"];function aO(e,t){return e==="top"||e==="bottom"||Tte.indexOf(e)===-1&&t==="x"}function sO(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function lO(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),cn(n&&n.onComplete,[e],t)}function Dte(e){const t=e.chart,n=t.options.animation;cn(n&&n.onProgress,[e],t)}function x3(e){return kC()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Qm={},cO=e=>{const t=x3(e);return Object.values(Qm).filter(n=>n.canvas===t).pop()};function Ate(e,t,n){const r=Object.keys(e);for(const o of r){const i=+o;if(i>=t){const a=e[o];delete e[o],(n>0||i>t)&&(e[i+n]=a)}}}function Mte(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Gg(e,t,n){return e.options.clip?e[n]:t[n]}function kte(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Gg(n,t,"left"),right:Gg(n,t,"right"),top:Gg(r,t,"top"),bottom:Gg(r,t,"bottom")}:t}class Dn{static register(...t){Nr.add(...t),uO()}static unregister(...t){Nr.remove(...t),uO()}constructor(t,n){const r=this.config=new Rte(n),o=x3(t),i=cO(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const a=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||Qee(o)),this.platform.updateConfig(r);const s=this.platform.acquireContext(o,a.aspectRatio),l=s&&s.canvas,c=l&&l.height,u=l&&l.width;if(this.id=NJ(),this.ctx=s,this.canvas=l,this.width=u,this.height=c,this._options=a,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 gte,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=JJ(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],Qm[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}_a.listen(this,"complete",lO),_a.listen(this,"progress",Dte),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return Tt(t)?n&&i?i:o?r/o:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Nr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():D$(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return $$(this.canvas,this.ctx),this}stop(){return _a.stop(this),this}resize(t,n){_a.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,o=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(o,t,n,i),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,D$(this,s,!0)&&(this.notifyPlugins("resize",{size:a}),cn(r.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};nn(n,(r,o)=>{r.id=o})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,o=Object.keys(r).reduce((a,s)=>(a[s]=!1,a),{});let i=[];n&&(i=i.concat(Object.keys(n).map(a=>{const s=n[a],l=Gw(a,s),c=l==="r",u=l==="x";return{options:s,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),nn(i,a=>{const s=a.options,l=s.id,c=Gw(l,s),u=st(s.type,a.dtype);(s.position===void 0||aO(s.position,c)!==aO(a.dposition))&&(s.position=a.dposition),o[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const h=Nr.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,t)}),nn(o,(a,s)=>{a||delete r[s]}),nn(r,a=>{_r.configure(this,a,a.options),_r.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((o,i)=>o.index-i.index),r>n){for(let o=n;o<r;++o)this._destroyDatasetMeta(o);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(sO("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,o)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,o;for(this._removeUnreferencedMetasets(),r=0,o=n.length;r<o;r++){const i=n[r];let a=this.getDatasetMeta(r);const s=i.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=s,a.indexAxis=i.indexAxis||qw(s,this.options),a.order=i.order||0,a.index=r,a.label=""+i.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{const l=Nr.getController(s),{datasetElementType:c,dataElementType:u}=An.datasets[s];Object.assign(l,{dataElementType:Nr.getElement(u),datasetElementType:c&&Nr.getElement(c)}),a.controller=new l(this,r),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){nn(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!o&&i.indexOf(d)===-1;d.buildOrUpdateElements(h),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),o||nn(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sO("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){nn(this.scales,t=>{_r.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!y$(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:o,count:i}of n){const a=r==="_removeElements"?-i:i;Ate(t,o,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(t.filter(a=>a[0]===i).map((a,s)=>s+","+a.splice(1).join(","))),o=r(0);for(let i=1;i<n;i++)if(!y$(o,r(i)))return;return Array.from(o).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;_r.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],nn(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,zs(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),o={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(r.controller._update(n),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(_a.has(this)?this.attached&&!_a.running(this)&&_a.start(this):(this.draw(),lO({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:o}=this._resizeBeforeDraw;this._resize(r,o),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let o,i;for(o=0,i=n.length;o<i;++o){const a=n[o];(!t||a.visible)&&r.push(a)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,o=!r.disabled,i=kte(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(o&&Wl(n,{left:r.left===!1?0:i.left-r.left,right:r.right===!1?this.width:i.right+r.right,top:r.top===!1?0:i.top-r.top,bottom:r.bottom===!1?this.height:i.bottom+r.bottom}),t.controller.draw(),o&&Ul(n),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Ma(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=Tee.modes[n];return typeof i=="function"?i(this,t,r,o):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let o=r.filter(i=>i&&i._dataset===n).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(o)),o}getContext(){return this.$context||(this.$context=Xs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const o=r?"show":"hide",i=this.getDatasetMeta(t),a=i.controller._resolveAnimations(void 0,o);sh(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),a.update(i,{visible:r}),this.update(s=>s.datasetIndex===t?o:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),_a.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(),$$(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Qm[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(i,a)=>{n.addEventListener(this,i,a),t[i]=a},o=(i,a,s)=>{i.offsetX=a,i.offsetY=s,this._eventHandler(i)};nn(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},o=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const s=()=>{o("attach",s),this.attached=!0,this.resize(),r("resize",i),r("detach",a)};a=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():a()}unbindEvents(){nn(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},nn(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const o=r?"set":"remove";let i,a,s,l;for(n==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){a=t[s];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[o+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:i,index:a})=>{const s=this.getDatasetMeta(i);if(!s)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:s.data[a],index:a}});!v0(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const o=this.options.hover,i=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),a=i(n,t),s=r?t:i(t,n);a.length&&this.updateHoverStyle(a,o.mode,!1),s.length&&o.mode&&this.updateHoverStyle(s,o.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},o=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;const i=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(i||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:o=[],options:i}=this,a=n,s=this._getActiveElements(t,o,r,a),l=VJ(t),c=Mte(t,this._lastEvent,r,l);r&&(this._lastEvent=null,cn(i.onHover,[t,s,this],this),l&&cn(i.onClick,[t,s,this],this));const u=!v0(s,o);return(u||n)&&(this._active=s,this._updateHoverStyles(s,o,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,o){if(t.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,o)}}Ne(Dn,"defaults",An),Ne(Dn,"instances",Qm),Ne(Dn,"overrides",ac),Ne(Dn,"registry",Nr),Ne(Dn,"version",Ote),Ne(Dn,"getChart",cO);function uO(){return nn(Dn.instances,e=>e._plugins.invalidate())}function Ite(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:a,outerRadius:s,innerRadius:l}=t;let c=o/s;e.beginPath(),e.arc(i,a,s,r-c,n+c),l>o?(c=o/l,e.arc(i,a,l,n+c,r-c,!0)):e.arc(i,a,o,n+Wn,r-Wn),e.closePath(),e.clip()}function Nte(e){return TC(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Lte(e,t,n,r){const o=Nte(e.options.borderRadius),i=(n-t)/2,a=Math.min(i,r*t/2),s=l=>{const c=(n-Math.min(i,l))*r/2;return rr(l,0,Math.min(i,c))};return{outerStart:s(o.outerStart),outerEnd:s(o.outerEnd),innerStart:rr(o.innerStart,0,a),innerEnd:rr(o.innerEnd,0,a)}}function Kc(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function E0(e,t,n,r,o,i){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),h=u>0?u+r+n+c:0;let p=0;const v=o-l;if(r){const A=u>0?u-r:0,U=d>0?d-r:0,V=(A+U)/2,K=V!==0?v*V/(V+r):v;p=(v-K)/2}const b=Math.max(.001,v*d-n/Cn)/d,x=(v-b)/2,y=l+x+p,_=o-x-p,{outerStart:S,outerEnd:C,innerStart:E,innerEnd:$}=Lte(t,h,d,_-y),T=d-S,D=d-C,M=y+S/T,L=_-C/D,F=h+E,z=h+$,X=y+E/F,G=_-$/z;if(e.beginPath(),i){const A=(M+L)/2;if(e.arc(a,s,d,M,A),e.arc(a,s,d,A,L),C>0){const q=Kc(D,L,a,s);e.arc(q.x,q.y,C,L,_+Wn)}const U=Kc(z,_,a,s);if(e.lineTo(U.x,U.y),$>0){const q=Kc(z,G,a,s);e.arc(q.x,q.y,$,_+Wn,G+Math.PI)}const V=(_-$/h+(y+E/h))/2;if(e.arc(a,s,h,_-$/h,V,!0),e.arc(a,s,h,V,y+E/h,!0),E>0){const q=Kc(F,X,a,s);e.arc(q.x,q.y,E,X+Math.PI,y-Wn)}const K=Kc(T,y,a,s);if(e.lineTo(K.x,K.y),S>0){const q=Kc(T,M,a,s);e.arc(q.x,q.y,S,y-Wn,M)}}else{e.moveTo(a,s);const A=Math.cos(M)*d+a,U=Math.sin(M)*d+s;e.lineTo(A,U);const V=Math.cos(L)*d+a,K=Math.sin(L)*d+s;e.lineTo(V,K)}e.closePath()}function Fte(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s}=t;let l=t.endAngle;if(i){E0(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(s)||(l=a+(s%Sn||Sn))}return E0(e,t,n,r,l,o),e.fill(),l}function jte(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=h,p?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let v=t.endAngle;if(i){E0(e,t,n,r,v,o);for(let b=0;b<i;++b)e.stroke();isNaN(s)||(v=a+(s%Sn||Sn))}p&&Ite(e,t,v),i||(E0(e,t,n,r,v,o),e.stroke())}class fu extends ra{constructor(n){super();Ne(this,"circumference");Ne(this,"endAngle");Ne(this,"fullCircles");Ne(this,"innerRadius");Ne(this,"outerRadius");Ne(this,"pixelMargin");Ne(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.getProps(["x","y"],o),{angle:a,distance:s}=V6(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),p=(this.options.spacing+this.options.borderWidth)/2,b=st(h,c-l)>=Sn||lh(a,l,c),x=Da(s,u+p,d+p);return b&&x}getCenterPoint(n){const{x:r,y:o,startAngle:i,endAngle:a,innerRadius:s,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(i+a)/2,h=(s+l+u+c)/2;return{x:r+Math.cos(d)*h,y:o+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:o}=this,i=(r.offset||0)/4,a=(r.spacing||0)/2,s=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=o>Sn?Math.floor(o/Sn):0,o===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const c=1-Math.sin(Math.min(Cn,o||0)),u=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Fte(n,this,u,a,s),jte(n,this,u,a,s),n.restore()}}Ne(fu,"id","arc"),Ne(fu,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Ne(fu,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ne(fu,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function w3(e,t,n=t){e.lineCap=st(n.borderCapStyle,t.borderCapStyle),e.setLineDash(st(n.borderDash,t.borderDash)),e.lineDashOffset=st(n.borderDashOffset,t.borderDashOffset),e.lineJoin=st(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=st(n.borderWidth,t.borderWidth),e.strokeStyle=st(n.borderColor,t.borderColor)}function zte(e,t,n){e.lineTo(n.x,n.y)}function Bte(e){return e.stepped?uZ:e.tension||e.cubicInterpolationMode==="monotone"?dZ:zte}function _3(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:a,end:s}=t,l=Math.max(o,a),c=Math.min(i,s),u=o<a&&i<a||o>s&&i>s;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function Vte(e,t,n,r){const{points:o,options:i}=t,{count:a,start:s,loop:l,ilen:c}=_3(o,n,r),u=Bte(i);let{move:d=!0,reverse:h}=r||{},p,v,b;for(p=0;p<=c;++p)v=o[(s+(h?c-p:p))%a],!v.skip&&(d?(e.moveTo(v.x,v.y),d=!1):u(e,b,v,h,i.stepped),b=v);return l&&(v=o[(s+(h?c:0))%a],u(e,b,v,h,i.stepped)),!!l}function Hte(e,t,n,r){const o=t.points,{count:i,start:a,ilen:s}=_3(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,h,p,v,b,x,y;const _=C=>(a+(c?s-C:C))%i,S=()=>{b!==x&&(e.lineTo(u,x),e.lineTo(u,b),e.lineTo(u,y))};for(l&&(p=o[_(0)],e.moveTo(p.x,p.y)),h=0;h<=s;++h){if(p=o[_(h)],p.skip)continue;const C=p.x,E=p.y,$=C|0;$===v?(E<b?b=E:E>x&&(x=E),u=(d*u+C)/++d):(S(),e.lineTo(C,E),v=$,d=0,b=x=E),y=E}S()}function Yw(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Hte:Vte}function Wte(e){return e.stepped?HZ:e.tension||e.cubicInterpolationMode==="monotone"?WZ:xl}function Ute(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),w3(e,t.options),e.stroke(o)}function qte(e,t,n,r){const{segments:o,options:i}=t,a=Yw(t);for(const s of o)w3(e,i,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Gte=typeof Path2D=="function";function Yte(e,t,n,r){Gte&&!t.options.segment?Ute(e,t,n,r):qte(e,t,n,r)}class Ts extends ra{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const o=r.spanGaps?this._loop:this._fullLoop;IZ(this._points,r,t,o,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=XZ(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,o=t[n],i=this.points,a=l3(this,{property:n,start:o,end:o});if(!a.length)return;const s=[],l=Wte(r);let c,u;for(c=0,u=a.length;c<u;++c){const{start:d,end:h}=a[c],p=i[d],v=i[h];if(p===v){s.push(p);continue}const b=Math.abs((o-p[n])/(v[n]-p[n])),x=l(p,v,b,r.stepped);x[n]=t[n],s.push(x)}return s.length===1?s[0]:s}pathSegment(t,n,r){return Yw(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=Yw(this);let a=this._loop;n=n||0,r=r||this.points.length-n;for(const s of o)a&=i(t,this,s,{start:n,end:n+r-1});return!!a}draw(t,n,r,o){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(t.save(),Yte(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ne(Ts,"id","line"),Ne(Ts,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ne(Ts,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ne(Ts,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function dO(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class Yl extends ra{constructor(n){super();Ne(this,"parsed");Ne(this,"skip");Ne(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.options,{x:a,y:s}=this.getProps(["x","y"],o);return Math.pow(n-a,2)+Math.pow(r-s,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(n,r){return dO(this,n,"x",r)}inYRange(n,r){return dO(this,n,"y",r)}getCenterPoint(n){const{x:r,y:o}=this.getProps(["x","y"],n);return{x:r,y:o}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const o=r&&n.borderWidth||0;return(r+o)*2}draw(n,r){const o=this.options;this.skip||o.radius<.1||!Ma(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,_0(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ne(Yl,"id","point"),Ne(Yl,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ne(Yl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function S3(e,t){const{x:n,y:r,base:o,width:i,height:a}=e.getProps(["x","y","base","width","height"],t);let s,l,c,u,d;return e.horizontal?(d=a/2,s=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,s=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:s,top:c,right:l,bottom:u}}function Ds(e,t,n,r){return e?0:rr(t,n,r)}function Kte(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=Q6(r);return{t:Ds(o.top,i.top,0,n),r:Ds(o.right,i.right,0,t),b:Ds(o.bottom,i.bottom,0,n),l:Ds(o.left,i.left,0,t)}}function Xte(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=ql(o),a=Math.min(t,n),s=e.borderSkipped,l=r||kt(o);return{topLeft:Ds(!l||s.top||s.left,i.topLeft,0,a),topRight:Ds(!l||s.top||s.right,i.topRight,0,a),bottomLeft:Ds(!l||s.bottom||s.left,i.bottomLeft,0,a),bottomRight:Ds(!l||s.bottom||s.right,i.bottomRight,0,a)}}function Qte(e){const t=S3(e),n=t.right-t.left,r=t.bottom-t.top,o=Kte(e,n/2,r/2),i=Xte(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function P1(e,t,n,r){const o=t===null,i=n===null,s=e&&!(o&&i)&&S3(e,r);return s&&(o||Da(t,s.left,s.right))&&(i||Da(n,s.top,s.bottom))}function Jte(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Zte(e,t){e.rect(t.x,t.y,t.w,t.h)}function $1(e,t,n={}){const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,a=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+i,h:e.h+a,radius:e.radius}}class Kl extends ra{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:o}}=this,{inner:i,outer:a}=Qte(this),s=Jte(a.radius)?ch:Zte;t.save(),(a.w!==i.w||a.h!==i.h)&&(t.beginPath(),s(t,$1(a,n,i)),t.clip(),s(t,$1(i,-n,a)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),s(t,$1(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return P1(this,t,n,r)}inXRange(t,n){return P1(this,t,null,n)}inYRange(t,n){return P1(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:o,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(n+o)/2:n,y:i?r:(r+o)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Ne(Kl,"id","bar"),Ne(Kl,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ne(Kl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var ene=Object.freeze({__proto__:null,ArcElement:fu,BarElement:Kl,LineElement:Ts,PointElement:Yl});const Kw=["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)"],fO=Kw.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function C3(e){return Kw[e%Kw.length]}function E3(e){return fO[e%fO.length]}function tne(e,t){return e.borderColor=C3(t),e.backgroundColor=E3(t),++t}function nne(e,t){return e.backgroundColor=e.data.map(()=>C3(t++)),t}function rne(e,t){return e.backgroundColor=e.data.map(()=>E3(t++)),t}function one(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof Dl?t=nne(n,t):o instanceof Vf?t=rne(n,t):o&&(t=tne(n,t))}}function hO(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function ine(e){return e&&(e.borderColor||e.backgroundColor)}var ane={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=e.config,{elements:i}=o;if(!n.forceOverride&&(hO(r)||ine(o)||i&&hO(i)))return;const a=one(e);r.forEach(a)}};function sne(e,t,n,r,o){const i=o.samples||r;if(i>=n)return e.slice(t,t+n);const a=[],s=(n-2)/(i-2);let l=0;const c=t+n-1;let u=t,d,h,p,v,b;for(a[l++]=e[u],d=0;d<i-2;d++){let x=0,y=0,_;const S=Math.floor((d+1)*s)+1+t,C=Math.min(Math.floor((d+2)*s)+1,n)+t,E=C-S;for(_=S;_<C;_++)x+=e[_].x,y+=e[_].y;x/=E,y/=E;const $=Math.floor(d*s)+1+t,T=Math.min(Math.floor((d+1)*s)+1,n)+t,{x:D,y:M}=e[u];for(p=v=-1,_=$;_<T;_++)v=.5*Math.abs((D-x)*(e[_].y-M)-(D-e[_].x)*(y-M)),v>p&&(p=v,h=e[_],b=_);a[l++]=h,u=b}return a[l++]=e[c],a}function lne(e,t,n,r){let o=0,i=0,a,s,l,c,u,d,h,p,v,b;const x=[],y=t+n-1,_=e[t].x,C=e[y].x-_;for(a=t;a<t+n;++a){s=e[a],l=(s.x-_)/C*r,c=s.y;const E=l|0;if(E===u)c<v?(v=c,d=a):c>b&&(b=c,h=a),o=(i*o+s.x)/++i;else{const $=a-1;if(!Tt(d)&&!Tt(h)){const T=Math.min(d,h),D=Math.max(d,h);T!==p&&T!==$&&x.push({...e[T],x:o}),D!==p&&D!==$&&x.push({...e[D],x:o})}a>0&&$!==p&&x.push(e[$]),x.push(s),u=E,i=0,v=b=c,d=h=p=a}}return x}function R3(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 pO(e){e.data.datasets.forEach(t=>{R3(t)})}function cne(e,t){const n=t.length;let r=0,o;const{iScale:i}=e,{min:a,max:s,minDefined:l,maxDefined:c}=i.getUserBounds();return l&&(r=rr(Aa(t,i.axis,a).lo,0,n-1)),c?o=rr(Aa(t,i.axis,s).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var une={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){pO(e);return}const r=e.width;e.data.datasets.forEach((o,i)=>{const{_data:a,indexAxis:s}=o,l=e.getDatasetMeta(i),c=a||o.data;if(wn([s,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=cne(l,c);const p=n.threshold||4*r;if(h<=p){R3(o);return}Tt(a)&&(o._data=c,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let v;switch(n.algorithm){case"lttb":v=sne(c,d,h,r,n);break;case"min-max":v=lne(c,d,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=v})},destroy(e){pO(e)}};function dne(e,t,n){const r=e.segments,o=e.points,i=t.points,a=[];for(const s of r){let{start:l,end:c}=s;c=LC(l,c,o);const u=Xw(n,o[l],o[c],s.loop);if(!t.segments){a.push({source:s,target:u,start:o[l],end:o[c]});continue}const d=l3(t,u);for(const h of d){const p=Xw(n,i[h.start],i[h.end],h.loop),v=s3(s,o,p);for(const b of v)a.push({source:b,target:h,start:{[n]:gO(u,p,"start",Math.max)},end:{[n]:gO(u,p,"end",Math.min)}})}}return a}function Xw(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=xo(o),i=xo(i)),{property:e,start:o,end:i}}function fne(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:a,end:s})=>{s=LC(a,s,o);const l=o[a],c=o[s];r!==null?(i.push({x:l.x,y:r}),i.push({x:c.x,y:r})):n!==null&&(i.push({x:n,y:l.y}),i.push({x:n,y:c.y}))}),i}function LC(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function gO(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function P3(e,t){let n=[],r=!1;return _n(e)?(r=!0,n=e):n=fne(e,t),n.length?new Ts({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function mO(e){return e&&e.fill!==!1}function hne(e,t,n){let o=e[t].fill;const i=[t];let a;if(!n)return o;for(;o!==!1&&i.indexOf(o)===-1;){if(!Ln(o))return o;if(a=e[o],!a)return!1;if(a.visible)return o;i.push(o),o=a.fill}return!1}function pne(e,t,n){const r=vne(e);if(kt(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Ln(o)&&Math.floor(o)===o?gne(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function gne(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function mne(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:kt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function bne(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:kt(e)?r=e.value:r=t.getBaseValue(),r}function vne(e){const t=e.options,n=t.fill;let r=st(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function yne(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,a=r.points,s=xne(t,n);s.push(P3({x:null,y:t.bottom},r));for(let l=0;l<i.length;l++){const c=i[l];for(let u=c.start;u<=c.end;u++)wne(o,a[u],s)}return new Ts({points:o,options:{}})}function xne(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let o=0;o<r.length;o++){const i=r[o];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function wne(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:a,last:s,point:l}=_ne(i,t,"x");if(!(!l||a&&s)){if(a)r.unshift(l);else if(e.push(l),!s)break}}e.push(...r)}function _ne(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const o=r[n],i=e.segments,a=e.points;let s=!1,l=!1;for(let c=0;c<i.length;c++){const u=i[c],d=a[u.start][n],h=a[u.end][n];if(Da(o,d,h)){s=o===d,l=o===h;break}}return{first:s,last:l,point:r}}class $3{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:o,y:i,radius:a}=this;return n=n||{start:0,end:Sn},t.arc(o,i,a,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:o}=this,i=t.angle;return{x:n+Math.cos(i)*o,y:r+Math.sin(i)*o,angle:i}}}function Sne(e){const{chart:t,fill:n,line:r}=e;if(Ln(n))return Cne(t,n);if(n==="stack")return yne(e);if(n==="shape")return!0;const o=Ene(e);return o instanceof $3?o:P3(o,r)}function Cne(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Ene(e){return(e.scale||{}).getPointPositionForValue?Pne(e):Rne(e)}function Rne(e){const{scale:t={},fill:n}=e,r=mne(n,t);if(Ln(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function Pne(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,a=bne(n,t,i),s=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new $3({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<o;++l)s.push(t.getPointPositionForValue(l,a));return s}function O1(e,t,n){const r=Sne(t),{line:o,scale:i,axis:a}=t,s=o.options,l=s.fill,c=s.backgroundColor,{above:u=c,below:d=c}=l||{};r&&o.points.length&&(Wl(e,n),$ne(e,{line:o,target:r,above:u,below:d,area:n,scale:i,axis:a}),Ul(e))}function $ne(e,t){const{line:n,target:r,above:o,below:i,area:a,scale:s}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&i!==o&&(bO(e,r,a.top),vO(e,{line:n,target:r,color:o,scale:s,property:l}),e.restore(),e.save(),bO(e,r,a.bottom)),vO(e,{line:n,target:r,color:i,scale:s,property:l}),e.restore()}function bO(e,t,n){const{segments:r,points:o}=t;let i=!0,a=!1;e.beginPath();for(const s of r){const{start:l,end:c}=s,u=o[l],d=o[LC(l,c,o)];i?(e.moveTo(u.x,u.y),i=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),a=!!t.pathSegment(e,s,{move:a}),a?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function vO(e,t){const{line:n,target:r,property:o,color:i,scale:a}=t,s=dne(n,r,o);for(const{source:l,target:c,start:u,end:d}of s){const{style:{backgroundColor:h=i}={}}=l,p=r!==!0;e.save(),e.fillStyle=h,One(e,a,p&&Xw(o,u,d)),e.beginPath();const v=!!n.pathSegment(e,l);let b;if(p){v?e.closePath():yO(e,r,d,o);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});b=v&&x,b||yO(e,r,u,o)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function One(e,t,n){const{top:r,bottom:o}=t.chart.chartArea,{property:i,start:a,end:s}=n||{};i==="x"&&(e.beginPath(),e.rect(a,r,s-a,o-r),e.clip())}function yO(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var Tne={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,o=[];let i,a,s,l;for(a=0;a<r;++a)i=e.getDatasetMeta(a),s=i.dataset,l=null,s&&s.options&&s instanceof Ts&&(l={visible:e.isDatasetVisible(a),index:a,fill:pne(s,a,r),chart:e,axis:i.controller.options.indexAxis,scale:i.vScale,line:s}),i.$filler=l,o.push(l);for(a=0;a<r;++a)l=o[a],!(!l||l.fill===!1)&&(l.fill=hne(o,a,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",o=e.getSortedVisibleDatasetMetas(),i=e.chartArea;for(let a=o.length-1;a>=0;--a){const s=o[a].$filler;s&&(s.line.updateControlPoints(i,s.axis),r&&s.fill&&O1(e.ctx,s,i))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let o=r.length-1;o>=0;--o){const i=r[o].$filler;mO(i)&&O1(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!mO(r)||n.drawTime!=="beforeDatasetDraw"||O1(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const xO=(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)}},Dne=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class wO extends ra{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=cn(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,o)=>t.sort(r,o,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,o=qn(r.font),i=o.size,a=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=xO(r,i);let c,u;n.font=o.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,i,s,l)+10):(u=this.maxHeight,c=this._fitCols(a,o,s,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,o){const{ctx:i,maxWidth:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=o+s;let d=t;i.textAlign="left",i.textBaseline="middle";let h=-1,p=-u;return this.legendItems.forEach((v,b)=>{const x=r+n/2+i.measureText(v.text).width;(b===0||c[c.length-1]+x+2*s>a)&&(d+=u,c[c.length-(b>0?0:1)]=0,p+=u,h++),l[b]={left:0,top:p,row:h,width:x,height:o},c[c.length-1]+=x+s}),d}_fitCols(t,n,r,o){const{ctx:i,maxHeight:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let d=s,h=0,p=0,v=0,b=0;return this.legendItems.forEach((x,y)=>{const{itemWidth:_,itemHeight:S}=Ane(r,n,i,x,o);y>0&&p+S+2*s>u&&(d+=h+s,c.push({width:h,height:p}),v+=h+s,b++,h=p=0),l[y]={left:v,top:p,col:b,width:_,height:S},h=Math.max(h,_),p+=S+s}),d+=h,c.push({width:h,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,a=wu(i,this.left,this.width);if(this.isHorizontal()){let s=0,l=wr(r,this.left+o,this.right-this.lineWidths[s]);for(const c of n)s!==c.row&&(s=c.row,l=wr(r,this.left+o,this.right-this.lineWidths[s])),c.top+=this.top+t+o,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+o}else{let s=0,l=wr(r,this.top+t+o,this.bottom-this.columnSizes[s].height);for(const c of n)c.col!==s&&(s=c.col,l=wr(r,this.top+t+o,this.bottom-this.columnSizes[s].height)),c.top=l,c.left+=this.left+o,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Wl(t,this),this._draw(),Ul(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:a}=t,s=An.color,l=wu(t.rtl,this.left,this.width),c=qn(a.font),{padding:u}=a,d=c.size,h=d/2;let p;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:v,boxHeight:b,itemHeight:x}=xO(a,d),y=function($,T,D){if(isNaN(v)||v<=0||isNaN(b)||b<0)return;o.save();const M=st(D.lineWidth,1);if(o.fillStyle=st(D.fillStyle,s),o.lineCap=st(D.lineCap,"butt"),o.lineDashOffset=st(D.lineDashOffset,0),o.lineJoin=st(D.lineJoin,"miter"),o.lineWidth=M,o.strokeStyle=st(D.strokeStyle,s),o.setLineDash(st(D.lineDash,[])),a.usePointStyle){const L={radius:b*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:M},F=l.xPlus($,v/2),z=T+h;X6(o,L,F,z,a.pointStyleWidth&&v)}else{const L=T+Math.max((d-b)/2,0),F=l.leftForLtr($,v),z=ql(D.borderRadius);o.beginPath(),Object.values(z).some(X=>X!==0)?ch(o,{x:F,y:L,w:v,h:b,radius:z}):o.rect(F,L,v,b),o.fill(),M!==0&&o.stroke()}o.restore()},_=function($,T,D){sc(o,D.text,$,T+x/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},S=this.isHorizontal(),C=this._computeTitleHeight();S?p={x:wr(i,this.left+u,this.right-r[0]),y:this.top+u+C,line:0}:p={x:this.left+u,y:wr(i,this.top+C+u,this.bottom-n[0].height),line:0},o3(this.ctx,t.textDirection);const E=x+u;this.legendItems.forEach(($,T)=>{o.strokeStyle=$.fontColor,o.fillStyle=$.fontColor;const D=o.measureText($.text).width,M=l.textAlign($.textAlign||($.textAlign=a.textAlign)),L=v+h+D;let F=p.x,z=p.y;l.setWidth(this.width),S?T>0&&F+L+u>this.right&&(z=p.y+=E,p.line++,F=p.x=wr(i,this.left+u,this.right-r[p.line])):T>0&&z+E>this.bottom&&(F=p.x=F+n[p.line].width+u,p.line++,z=p.y=wr(i,this.top+C+u,this.bottom-n[p.line].height));const X=l.x(F);if(y(X,z,$),F=ZJ(M,F+v+h,S?F+L:this.right,t.rtl),_(l.x(F),z,$),S)p.x+=L+u;else if(typeof $.text!="string"){const G=c.lineHeight;p.y+=O3($,G)+u}else p.y+=E}),i3(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=qn(n.font),o=fr(n.padding);if(!n.display)return;const i=wu(t.rtl,this.left,this.width),a=this.ctx,s=n.position,l=r.size/2,c=o.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=wr(t.align,d,this.right-h);else{const v=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);u=c+wr(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const p=wr(s,d,d+h);a.textAlign=i.textAlign($C(s)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=r.string,sc(a,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=qn(t.font),r=fr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(Da(t,this.left,this.right)&&Da(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Da(t,o.left,o.left+o.width)&&Da(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!Ine(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=Dne(o,r);o&&!i&&cn(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&cn(n.onHover,[t,r,this],this)}else r&&cn(n.onClick,[t,r,this],this)}}function Ane(e,t,n,r,o){const i=Mne(r,e,t,n),a=kne(o,r,t.lineHeight);return{itemWidth:i,itemHeight:a}}function Mne(e,t,n,r){let o=e.text;return o&&typeof o!="string"&&(o=o.reduce((i,a)=>i.length>a.length?i:a)),t+n.size/2+r.measureText(o).width}function kne(e,t,n){let r=e;return typeof t.text!="string"&&(r=O3(t,n)),r}function O3(e,t){const n=e.text?e.text.length:0;return t*n}function Ine(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Nne={id:"legend",_element:wO,start(e,t,n){const r=e.legend=new wO({ctx:e.ctx,options:n,chart:e});_r.configure(e,r,n),_r.addBox(e,r)},stop(e){_r.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;_r.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:i,useBorderRadius:a,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=fr(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:o||c.textAlign,borderRadius:a&&(s||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let FC=class extends ra{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const o=_n(r.text)?r.text.length:1;this._padding=fr(r.padding);const i=o*qn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:o,right:i,options:a}=this,s=a.align;let l=0,c,u,d;return this.isHorizontal()?(u=wr(s,r,i),d=n+t,c=i-r):(a.position==="left"?(u=r+t,d=wr(s,o,n),l=Cn*-.5):(u=i-t,d=wr(s,n,o),l=Cn*.5),c=o-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=qn(n.font),i=r.lineHeight/2+this._padding.top,{titleX:a,titleY:s,maxWidth:l,rotation:c}=this._drawArgs(i);sc(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:$C(n.align),textBaseline:"middle",translation:[a,s]})}};function Lne(e,t){const n=new FC({ctx:e.ctx,options:t,chart:e});_r.configure(e,n,t),_r.addBox(e,n),e.titleBlock=n}var Fne={id:"title",_element:FC,start(e,t,n){Lne(e,n)},stop(e){const t=e.titleBlock;_r.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;_r.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 Yg=new WeakMap;var jne={id:"subtitle",start(e,t,n){const r=new FC({ctx:e.ctx,options:n,chart:e});_r.configure(e,r,n),_r.addBox(e,r),Yg.set(e,r)},stop(e){_r.removeBox(e,Yg.get(e)),Yg.delete(e)},beforeUpdate(e,t,n){const r=Yg.get(e);_r.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 Pf={average(e){if(!e.length)return!1;let t,n,r=0,o=0,i=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const s=a.tooltipPosition();r+=s.x,o+=s.y,++i}}return{x:r/i,y:o/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,o=Number.POSITIVE_INFINITY,i,a,s;for(i=0,a=e.length;i<a;++i){const l=e[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Hw(t,c);u<o&&(o=u,s=l)}}if(s){const l=s.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Ti(e,t){return t&&(_n(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Sa(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
251
+ `)>-1?e.split(`
252
+ `):e}function zne(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:a,value:s}=i.getLabelAndValue(o);return{chart:e,label:a,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:s,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function _O(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:a,boxHeight:s}=t,l=qn(t.bodyFont),c=qn(t.titleFont),u=qn(t.footerFont),d=i.length,h=o.length,p=r.length,v=fr(t.padding);let b=v.height,x=0,y=r.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const C=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;b+=p*C+(y-p)*l.lineHeight+(y-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let _=0;const S=function(C){x=Math.max(x,n.measureText(C).width+_)};return n.save(),n.font=c.string,nn(e.title,S),n.font=l.string,nn(e.beforeBody.concat(e.afterBody),S),_=t.displayColors?a+2+t.boxPadding:0,nn(r,C=>{nn(C.before,S),nn(C.lines,S),nn(C.after,S)}),_=0,n.font=u.string,nn(e.footer,S),n.restore(),x+=v.width,{width:x,height:b}}function Bne(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Vne(e,t,n,r){const{x:o,width:i}=r,a=n.caretSize+n.caretPadding;if(e==="left"&&o+i+a>t.width||e==="right"&&o-i-a<0)return!0}function Hne(e,t,n,r){const{x:o,width:i}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return r==="center"?c=o<=(s+l)/2?"left":"right":o<=i/2?c="left":o>=a-i/2&&(c="right"),Vne(c,e,t,n)&&(c="center"),c}function SO(e,t,n){const r=n.yAlign||t.yAlign||Bne(e,n);return{xAlign:n.xAlign||t.xAlign||Hne(e,t,n,r),yAlign:r}}function Wne(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Une(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function CO(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=ql(a);let v=Wne(t,s);const b=Une(t,l,c);return l==="center"?s==="left"?v+=c:s==="right"&&(v-=c):s==="left"?v-=Math.max(u,h)+o:s==="right"&&(v+=Math.max(d,p)+o),{x:rr(v,0,r.width-t.width),y:rr(b,0,r.height-t.height)}}function Kg(e,t,n){const r=fr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function EO(e){return Ti([],Sa(e))}function qne(e,t,n){return Xs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function RO(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const T3={beforeTitle:va,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:va,beforeBody:va,beforeLabel:va,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 Tt(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:va,afterBody:va,beforeFooter:va,footer:va,afterFooter:va};function Yr(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?T3[t].call(n,r):o}var Xx;let PO=(Xx=class extends ra{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),o=r.enabled&&n.options.animation&&r.animations,i=new c3(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=qne(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=Yr(r,"beforeTitle",this,t),i=Yr(r,"title",this,t),a=Yr(r,"afterTitle",this,t);let s=[];return s=Ti(s,Sa(o)),s=Ti(s,Sa(i)),s=Ti(s,Sa(a)),s}getBeforeBody(t,n){return EO(Yr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return nn(t,i=>{const a={before:[],lines:[],after:[]},s=RO(r,i);Ti(a.before,Sa(Yr(s,"beforeLabel",this,i))),Ti(a.lines,Yr(s,"label",this,i)),Ti(a.after,Sa(Yr(s,"afterLabel",this,i))),o.push(a)}),o}getAfterBody(t,n){return EO(Yr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=Yr(r,"beforeFooter",this,t),i=Yr(r,"footer",this,t),a=Yr(r,"afterFooter",this,t);let s=[];return s=Ti(s,Sa(o)),s=Ti(s,Sa(i)),s=Ti(s,Sa(a)),s}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],a=[];let s=[],l,c;for(l=0,c=n.length;l<c;++l)s.push(zne(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,h)=>t.filter(u,d,h,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),nn(s,u=>{const d=RO(t.callbacks,u);o.push(Yr(d,"labelColor",this,u)),i.push(Yr(d,"labelPointStyle",this,u)),a.push(Yr(d,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,a=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const s=Pf[r.position].call(this,o,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=_O(this,r),c=Object.assign({},s,l),u=SO(this.chart,r,c),d=CO(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,o){const i=this.getCaretPosition(t,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=ql(s),{x:h,y:p}=t,{width:v,height:b}=n;let x,y,_,S,C,E;return i==="center"?(C=p+b/2,o==="left"?(x=h,y=x-a,S=C+a,E=C-a):(x=h+v,y=x+a,S=C-a,E=C+a),_=x):(o==="left"?y=h+Math.max(l,u)+a:o==="right"?y=h+v-Math.max(c,d)-a:y=this.caretX,i==="top"?(S=p,C=S-a,x=y-a,_=y+a):(S=p+b,C=S+a,x=y+a,_=y-a),E=S),{x1:x,x2:y,x3:_,y1:S,y2:C,y3:E}}drawTitle(t,n,r){const o=this.title,i=o.length;let a,s,l;if(i){const c=wu(r.rtl,this.x,this.width);for(t.x=Kg(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=qn(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<i;++l)n.fillText(o[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===i&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,o,i){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,u=qn(i.bodyFont),d=Kg(this,"left",i),h=o.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,v=n.y+p;if(i.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},x=o.leftForLtr(h,c)+c/2,y=v+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,_0(t,b,x,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,_0(t,b,x,y)}else{t.lineWidth=kt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const b=o.leftForLtr(h,c),x=o.leftForLtr(o.xPlus(h,1),c-2),y=ql(a.borderRadius);Object.values(y).some(_=>_!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,ch(t,{x:b,y:v,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ch(t,{x,y:v+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(b,v,c,l),t.strokeRect(b,v,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=qn(r.bodyFont);let h=d.lineHeight,p=0;const v=wu(r.rtl,this.x,this.width),b=function(D){n.fillText(D,v.x(t.x+p),t.y+h/2),t.y+=h+i},x=v.textAlign(a);let y,_,S,C,E,$,T;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Kg(this,x,r),n.fillStyle=r.bodyColor,nn(this.beforeBody,b),p=s&&x!=="right"?a==="center"?c/2+u:c+2+u:0,C=0,$=o.length;C<$;++C){for(y=o[C],_=this.labelTextColors[C],n.fillStyle=_,nn(y.before,b),S=y.lines,s&&S.length&&(this._drawColorBox(n,t,C,v,r),h=Math.max(d.lineHeight,l)),E=0,T=S.length;E<T;++E)b(S[E]),h=d.lineHeight;nn(y.after,b)}p=0,h=d.lineHeight,nn(this.afterBody,b),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let a,s;if(i){const l=wu(r.rtl,this.x,this.width);for(t.x=Kg(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=qn(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<i;++s)n.fillText(o[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,o){const{xAlign:i,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:h,bottomLeft:p,bottomRight:v}=ql(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(s+d,l),a==="top"&&this.drawCaret(t,n,r,o),n.lineTo(s+c-h,l),n.quadraticCurveTo(s+c,l,s+c,l+h),a==="center"&&i==="right"&&this.drawCaret(t,n,r,o),n.lineTo(s+c,l+u-v),n.quadraticCurveTo(s+c,l+u,s+c-v,l+u),a==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(s+p,l+u),n.quadraticCurveTo(s,l+u,s,l+u-p),a==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const a=Pf[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=_O(this,t),l=Object.assign({},a,this._size),c=SO(n,t,l),u=CO(t,l,c,n);(o._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=fr(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(i,t,o,n),o3(t,n.textDirection),i.y+=a.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),i3(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=t.map(({datasetIndex:s,index:l})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[l],index:l}}),i=!v0(r,o),a=this._positionChanged(o,n);(i||a)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],a=this._getActiveElements(t,i,n,r),s=this._positionChanged(a,t),l=n||!v0(a,i)||s;return l&&(this._active=a,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,o){const i=this.options;if(t.type==="mouseout")return[];if(!o)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,i.mode,i,r);return i.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:r,caretY:o,options:i}=this,a=Pf[i.position].call(this,t,n);return a!==!1&&(r!==a.x||o!==a.y)}},Ne(Xx,"positioners",Pf),Xx);var D3={id:"tooltip",_element:PO,positioners:Pf,afterInit(e,t,n){n&&(e.tooltip=new PO({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:T3},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"]},Gne=Object.freeze({__proto__:null,Colors:ane,Decimation:une,Filler:Tne,Legend:Nne,SubTitle:jne,Title:Fne,Tooltip:D3});const Yne=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Kne(e,t,n,r){const o=e.indexOf(t);if(o===-1)return Yne(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const Xne=(e,t)=>e===null?null:rr(Math.round(e),0,t);function $O(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class R0 extends Qs{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:o,label:i}of n)r[o]===i&&r.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Tt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Kne(r,t,st(n,t),this._addedLabels),Xne(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(o=this.getLabels().length-1)),this.min=r,this.max=o}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,o=[];let i=this.getLabels();i=t===0&&n===i.length-1?i:i.slice(t,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)o.push({value:a});return o}getLabelForValue(t){return $O.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Ne(R0,"id","category"),Ne(R0,"defaults",{ticks:{callback:$O}});function Qne(e,t){const n=[],{bounds:o,step:i,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,p=i||1,v=u-1,{min:b,max:x}=t,y=!Tt(a),_=!Tt(s),S=!Tt(c),C=(x-b)/(d+1);let E=w$((x-b)/v/p)*p,$,T,D,M;if(E<1e-14&&!y&&!_)return[{value:b},{value:x}];M=Math.ceil(x/E)-Math.floor(b/E),M>v&&(E=w$(M*E/v/p)*p),Tt(l)||($=Math.pow(10,l),E=Math.ceil(E*$)/$),o==="ticks"?(T=Math.floor(b/E)*E,D=Math.ceil(x/E)*E):(T=b,D=x),y&&_&&i&&qJ((s-a)/i,E/1e3)?(M=Math.round(Math.min((s-a)/E,u)),E=(s-a)/M,T=a,D=s):S?(T=y?a:T,D=_?s:D,M=c-1,E=(D-T)/M):(M=(D-T)/E,jf(M,Math.round(M),E/1e3)?M=Math.round(M):M=Math.ceil(M));const L=Math.max(_$(E),_$(T));$=Math.pow(10,Tt(l)?L:l),T=Math.round(T*$)/$,D=Math.round(D*$)/$;let F=0;for(y&&(h&&T!==a?(n.push({value:a}),T<a&&F++,jf(Math.round((T+F*E)*$)/$,a,OO(a,C,e))&&F++):T<a&&F++);F<M;++F){const z=Math.round((T+F*E)*$)/$;if(_&&z>s)break;n.push({value:z})}return _&&h&&D!==s?n.length&&jf(n[n.length-1].value,s,OO(s,C,e))?n[n.length-1].value=s:n.push({value:s}):(!_||D===s)&&n.push({value:D}),n}function OO(e,t,{horizontal:n,minRotation:r}){const o=mi(r),i=(n?Math.sin(o):Math.cos(o))||.001,a=.75*t*(""+e).length;return Math.min(t/i,a)}class P0 extends Qs{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 Tt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:o,max:i}=this;const a=l=>o=n?o:l,s=l=>i=r?i:l;if(t){const l=Wi(o),c=Wi(i);l<0&&c<0?s(0):l>0&&c>0&&a(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);s(i+l),t||a(o-l)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,a=Qne(o,i);return t.bounds==="ticks"&&B6(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const o=(r-n)/Math.max(t.length-1,1)/2;n-=o,r+=o}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return fp(t,this.chart.options.locale,this.options.ticks.format)}}class ed extends P0{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ln(t)?t:0,this.max=Ln(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=mi(this.options.ticks.minRotation),o=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Ne(ed,"id","linear"),Ne(ed,"defaults",{ticks:{callback:Vb.formatters.numeric}});const dh=e=>Math.floor(Os(e)),ml=(e,t)=>Math.pow(10,dh(e)+t);function TO(e){return e/Math.pow(10,dh(e))===1}function DO(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function Jne(e,t){const n=t-e;let r=dh(n);for(;DO(e,t,r)>10;)r++;for(;DO(e,t,r)<10;)r--;return Math.min(r,dh(e))}function Zne(e,{min:t,max:n}){t=mo(e.min,t);const r=[],o=dh(t);let i=Jne(t,n),a=i<0?Math.pow(10,Math.abs(i)):1;const s=Math.pow(10,i),l=o>i?Math.pow(10,o):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/s/10)*s*10;let d=Math.floor((c-u)/Math.pow(10,i)),h=mo(e.min,Math.round((l+u+d*Math.pow(10,i))*a)/a);for(;h<n;)r.push({value:h,major:TO(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,a=i>=0?1:a),h=Math.round((l+u+d*Math.pow(10,i))*a)/a;const p=mo(e.max,h);return r.push({value:p,major:TO(p),significand:d}),r}class td extends Qs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=P0.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Ln(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ln(t)?Math.max(0,t):null,this.max=Ln(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Ln(this._userMin)&&(this.min=t===ml(this.min,0)?ml(this.min,-1):ml(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,o=this.max;const i=s=>r=t?r:s,a=s=>o=n?o:s;r===o&&(r<=0?(i(1),a(10)):(i(ml(r,-1)),a(ml(o,1)))),r<=0&&i(ml(o,-1)),o<=0&&a(ml(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=Zne(n,this);return t.bounds==="ticks"&&B6(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":fp(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Os(t),this._valueRange=Os(this.max)-Os(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Os(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Ne(td,"id","logarithmic"),Ne(td,"defaults",{ticks:{callback:Vb.formatters.logarithmic,major:{enabled:!0}}});function Qw(e){const t=e.ticks;if(t.display&&e.display){const n=fr(t.backdropPadding);return st(t.font&&t.font.size,An.font.size)+n.height}return 0}function ere(e,t,n){return n=_n(n)?n:[n],{w:cZ(e,t.string,n),h:n.length*t.lineHeight}}function AO(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:e<r||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function tre(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],o=[],i=e._pointLabels.length,a=e.options.pointLabels,s=a.centerPointLabels?Cn/i:0;for(let l=0;l<i;l++){const c=a.setContext(e.getPointLabelContext(l));o[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+o[l],s),d=qn(c.font),h=ere(e.ctx,d,e._pointLabels[l]);r[l]=h;const p=xo(e.getIndexAngle(l)+s),v=Math.round(RC(p)),b=AO(v,u.x,h.w,0,180),x=AO(v,u.y,h.h,90,270);nre(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=ire(e,r,o)}function nre(e,t,n,r,o){const i=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let s=0,l=0;r.start<t.l?(s=(t.l-r.start)/i,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+s)),o.start<t.t?(l=(t.t-o.start)/a,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/a,e.b=Math.max(e.b,t.b+l))}function rre(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:a,size:s}=n,l=e.getPointPosition(t,r+o+a,i),c=Math.round(RC(xo(l.angle+Wn))),u=lre(l.y,s.h,c),d=are(c),h=sre(l.x,s.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+s.w,bottom:u+s.h}}function ore(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(Ma({x:n,y:r},t)||Ma({x:n,y:i},t)||Ma({x:o,y:r},t)||Ma({x:o,y:i},t))}function ire(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:a,display:s}=i.pointLabels,l={extra:Qw(i)/2,additionalAngle:a?Cn/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const d=rre(e,u,l);r.push(d),s==="auto"&&(d.visible=ore(d,c),d.visible&&(c=d))}return r}function are(e){return e===0||e===180?"center":e<180?"left":"right"}function sre(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function lre(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function cre(e,t,n){const{left:r,top:o,right:i,bottom:a}=n,{backdropColor:s}=t;if(!Tt(s)){const l=ql(t.borderRadius),c=fr(t.backdropPadding);e.fillStyle=s;const u=r-c.left,d=o-c.top,h=i-r+c.width,p=a-o+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),ch(e,{x:u,y:d,w:h,h:p,radius:l}),e.fill()):e.fillRect(u,d,h,p)}}function ure(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const i=e._pointLabelItems[o];if(!i.visible)continue;const a=r.setContext(e.getPointLabelContext(o));cre(n,a,i);const s=qn(a.font),{x:l,y:c,textAlign:u}=i;sc(n,e._pointLabels[o],l,c+s.lineHeight/2,s,{color:a.color,textAlign:u,textBaseline:"middle"})}}function A3(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,Sn);else{let i=e.getPointPosition(0,t);o.moveTo(i.x,i.y);for(let a=1;a<r;a++)i=e.getPointPosition(a,t),o.lineTo(i.x,i.y)}}function dre(e,t,n,r,o){const i=e.ctx,a=t.circular,{color:s,lineWidth:l}=t;!a&&!r||!s||!l||n<0||(i.save(),i.strokeStyle=s,i.lineWidth=l,i.setLineDash(o.dash),i.lineDashOffset=o.dashOffset,i.beginPath(),A3(e,n,a,r),i.closePath(),i.stroke(),i.restore())}function fre(e,t,n){return Xs(e,{label:n,index:t,type:"pointLabel"})}class $f extends P0{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=fr(Qw(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=Ln(t)&&!isNaN(t)?t:0,this.max=Ln(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Qw(this.options))}generateTickLabels(t){P0.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=cn(this.options.pointLabels.callback,[n,r],this);return o||o===0?o:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?tre(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,o){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,o))}getIndexAngle(t){const n=Sn/(this._pointLabels.length||1),r=this.options.startAngle||0;return xo(t*n+mi(r))}getDistanceFromCenterForValue(t){if(Tt(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(Tt(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 fre(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-Wn+r;return{x:Math.cos(o)*n+this.xCenter,y:Math.sin(o)*n+this.yCenter,angle:o}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:o,bottom:i}=this._pointLabelItems[t];return{left:n,top:r,right:o,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),A3(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:o,border:i}=n,a=this._pointLabels.length;let s,l,c;if(n.pointLabels.display&&ure(this,a),o.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),p=o.setContext(h),v=i.setContext(h);dre(this,p,l,a,v)}}),r.display){for(t.save(),s=a-1;s>=0;s--){const u=r.setContext(this.getPointLabelContext(s)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(s,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const o=this.getIndexAngle(0);let i,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=qn(c.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(s.label).width,t.fillStyle=c.backdropColor;const d=fr(c.backdropPadding);t.fillRect(-a/2-d.left,-i-u.size/2-d.top,a+d.width,u.size+d.height)}sc(t,s.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Ne($f,"id","radialLinear"),Ne($f,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Vb.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ne($f,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ne($f,"descriptors",{angleLines:{_fallback:"grid"}});const Wb={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}},eo=Object.keys(Wb);function MO(e,t){return e-t}function kO(e,t){if(Tt(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let a=t;return typeof r=="function"&&(a=r(a)),Ln(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(o&&(a=o==="week"&&(Qu(i)||i===!0)?n.startOf(a,"isoWeek",i):n.startOf(a,o)),+a)}function IO(e,t,n,r){const o=eo.length;for(let i=eo.indexOf(e);i<o-1;++i){const a=Wb[eo[i]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return eo[i]}return eo[o-1]}function hre(e,t,n,r,o){for(let i=eo.length-1;i>=eo.indexOf(n);i--){const a=eo[i];if(Wb[a].common&&e._adapter.diff(o,r,a)>=t-1)return a}return eo[n?eo.indexOf(n):0]}function pre(e){for(let t=eo.indexOf(e)+1,n=eo.length;t<n;++t)if(Wb[eo[t]].common)return eo[t]}function NO(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=PC(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function gre(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=i;s<=a;s=+o.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function LO(e,t,n){const r=[],o={},i=t.length;let a,s;for(a=0;a<i;++a)s=t[a],o[s]=a,r.push({value:s,major:!1});return i===0||!n?r:gre(e,r,o,n)}class fh extends Qs{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),o=this._adapter=new Eee._date(t.adapters.date);o.init(n),Ff(r.displayFormats,o.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:kO(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:o,max:i,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!s&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=Ln(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=Ln(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,o=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const i=this.min,a=this.max,s=XJ(o,i,a);return this._unit=n.unit||(r.autoSkip?IO(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):hre(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:pre(this._unit),this.initOffsets(o),t.reverse&&s.reverse(),LO(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=rr(n,0,a),r=rr(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,o=this.options,i=o.time,a=i.unit||IO(i.minUnit,n,r,this._getLabelCapacity(n)),s=st(o.ticks.stepSize,1),l=a==="week"?i.isoWeekday:!1,c=Qu(l)||l===!0,u={};let d=n,h,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const v=o.ticks.source==="data"&&this.getDataTimestamps();for(h=d,p=0;h<r;h=+t.add(h,s,a),p++)NO(u,h,v);return(h===r||o.bounds==="ticks"||p===1)&&NO(u,h,v),Object.keys(u).sort(MO).map(b=>+b)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const o=this.options.time.displayFormats,i=this._unit,a=n||o[i];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,o){const i=this.options,a=i.ticks.callback;if(a)return cn(a,[t,n,r],this);const s=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],h=r[n],p=c&&d&&h&&h.major;return this._adapter.format(t,o||(p?d:u))}generateTickLabels(t){let n,r,o;for(n=0,r=t.length;n<r;++n)o=t[n],o.label=this._tickFormatFunction(o.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,o=mi(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(o),a=Math.sin(o),s=this._resolveTickFontOptions(0).size;return{w:r*i+s*a,h:r*a+s*i}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,o=r[n.unit]||r.millisecond,i=this._tickFormatFunction(t,0,LO(this,[t],this._majorUnit),o),a=this._getLabelSize(i),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,r=o.length;n<r;++n)t=t.concat(o[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const o=this.getLabels();for(n=0,r=o.length;n<r;++n)t.push(kO(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return W6(t.sort(MO))}}Ne(fh,"id","time"),Ne(fh,"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 Xg(e,t,n){let r=0,o=e.length-1,i,a,s,l;n?(t>=e[r].pos&&t<=e[o].pos&&({lo:r,hi:o}=Aa(e,"pos",t)),{pos:i,time:s}=e[r],{pos:a,time:l}=e[o]):(t>=e[r].time&&t<=e[o].time&&({lo:r,hi:o}=Aa(e,"time",t)),{time:i,pos:s}=e[r],{time:a,pos:l}=e[o]);const c=a-i;return c?s+(l-s)*(t-i)/c:s}class Jw extends fh{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=Xg(n,this.min),this._tableRange=Xg(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let a,s,l,c,u;for(a=0,s=t.length;a<s;++a)c=t[a],c>=n&&c<=r&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=o.length;a<s;++a)u=o[a+1],l=o[a-1],c=o[a],Math.round((u+l)/2)!==c&&i.push({time:c,pos:a/(s-1)});return i}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((o,i)=>o-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Xg(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Xg(this._table,r*this._tableRange+this._minPos,!0)}}Ne(Jw,"id","timeseries"),Ne(Jw,"defaults",fh.defaults);var mre=Object.freeze({__proto__:null,CategoryScale:R0,LinearScale:ed,LogarithmicScale:td,RadialLinearScale:$f,TimeScale:fh,TimeSeriesScale:Jw});const bre=[Cee,ene,Gne,mre];class Bs{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let o=0;o<this._n&&o<32;o++){const i=n[o],a=t+i,s=Math.abs(t)<Math.abs(i)?t-(a-i):i-(a-t);s&&(n[r++]=s),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,o,i,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,o=t[--n],a=r+o,i=o-(a-r),!i););n>0&&(i<0&&t[n-1]<0||i>0&&t[n-1]>0)&&(o=i*2,r=a+o,o==r-a&&(a=r))}return a}}function*vre(e){for(const t of e)yield*t}function M3(e){return Array.from(vre(e))}function hu(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r<o;)i[r]=e+r*n;return i}var nt=1e-6,jC=1e-12,Ot=Math.PI,In=Ot/2,FO=Ot/4,Oo=Ot*2,kr=180/Ot,un=Ot/180,Vt=Math.abs,bd=Math.atan,Ki=Math.atan2,gt=Math.cos,Qg=Math.ceil,k3=Math.exp,$0=Math.log,T1=Math.pow,ut=Math.sin,Ko=Math.sign||function(e){return e>0?1:e<0?-1:0},jr=Math.sqrt,zC=Math.tan;function I3(e){return e>1?0:e<-1?Ot:Math.acos(e)}function Qo(e){return e>1?In:e<-1?-In:Math.asin(e)}function nr(){}function O0(e,t){e&&zO.hasOwnProperty(e.type)&&zO[e.type](e,t)}var jO={Feature:function(e,t){O0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)O0(n[r].geometry,t)}},zO={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Zw(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)Zw(n[r],t,0)},Polygon:function(e,t){BO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)BO(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)O0(n[r],t)}};function Zw(e,t,n){var r=-1,o=e.length-n,i;for(t.lineStart();++r<o;)i=e[r],t.point(i[0],i[1],i[2]);t.lineEnd()}function BO(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Zw(e[n],t,1);t.polygonEnd()}function Cl(e,t){e&&jO.hasOwnProperty(e.type)?jO[e.type](e,t):O0(e,t)}function e_(e){return[Ki(e[1],e[0]),Qo(e[2])]}function nd(e){var t=e[0],n=e[1],r=gt(n);return[r*gt(t),r*ut(t),ut(n)]}function Jg(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function T0(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function D1(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Zg(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function t_(e){var t=jr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function n_(e,t){function n(r,o){return r=e(r,o),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,o){return r=t.invert(r,o),r&&e.invert(r[0],r[1])}),n}function r_(e,t){return Vt(e)>Ot&&(e-=Math.round(e/Oo)*Oo),[e,t]}r_.invert=r_;function N3(e,t,n){return(e%=Oo)?t||n?n_(HO(e),WO(t,n)):HO(e):t||n?WO(t,n):r_}function VO(e){return function(t,n){return t+=e,Vt(t)>Ot&&(t-=Math.round(t/Oo)*Oo),[t,n]}}function HO(e){var t=VO(e);return t.invert=VO(-e),t}function WO(e,t){var n=gt(e),r=ut(e),o=gt(t),i=ut(t);function a(s,l){var c=gt(l),u=gt(s)*c,d=ut(s)*c,h=ut(l),p=h*n+u*r;return[Ki(d*o-p*i,u*n-h*r),Qo(p*o+d*i)]}return a.invert=function(s,l){var c=gt(l),u=gt(s)*c,d=ut(s)*c,h=ut(l),p=h*o-d*i;return[Ki(d*o+h*i,u*n+p*r),Qo(p*n-u*r)]},a}function yre(e){e=N3(e[0]*un,e[1]*un,e.length>2?e[2]*un:0);function t(n){return n=e(n[0]*un,n[1]*un),n[0]*=kr,n[1]*=kr,n}return t.invert=function(n){return n=e.invert(n[0]*un,n[1]*un),n[0]*=kr,n[1]*=kr,n},t}function xre(e,t,n,r,o,i){if(n){var a=gt(t),s=ut(t),l=r*n;o==null?(o=t+r*Oo,i=t-l/2):(o=UO(a,o),i=UO(a,i),(r>0?o<i:o>i)&&(o+=r*Oo));for(var c,u=o;r>0?u>i:u<i;u-=l)c=e_([a,-s*gt(u),-s*ut(u)]),e.point(c[0],c[1])}}function UO(e,t){t=nd(t),t[0]-=e,t_(t);var n=I3(-t[1]);return((-t[2]<0?-n:n)+Oo-nt)%Oo}function L3(){var e=[],t;return{point:function(n,r,o){t.push([n,r,o])},lineStart:function(){e.push(t=[])},lineEnd:nr,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Jm(e,t){return Vt(e[0]-t[0])<nt&&Vt(e[1]-t[1])<nt}function em(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function F3(e,t,n,r,o){var i=[],a=[],s,l;if(e.forEach(function(v){if(!((b=v.length-1)<=0)){var b,x=v[0],y=v[b],_;if(Jm(x,y)){if(!x[2]&&!y[2]){for(o.lineStart(),s=0;s<b;++s)o.point((x=v[s])[0],x[1]);o.lineEnd();return}y[0]+=2*nt}i.push(_=new em(x,v,null,!0)),a.push(_.o=new em(x,null,_,!1)),i.push(_=new em(y,v,null,!1)),a.push(_.o=new em(y,null,_,!0))}}),!!i.length){for(a.sort(t),qO(i),qO(a),s=0,l=a.length;s<l;++s)a[s].e=n=!n;for(var c=i[0],u,d;;){for(var h=c,p=!0;h.v;)if((h=h.n)===c)return;u=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(s=0,l=u.length;s<l;++s)o.point((d=u[s])[0],d[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(p)for(u=h.p.z,s=u.length-1;s>=0;--s)o.point((d=u[s])[0],d[1]);else r(h.x,h.p.x,-1,o);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);o.lineEnd()}}}function qO(e){if(t=e.length){for(var t,n=0,r=e[0],o;++n<t;)r.n=o=e[n],o.p=r,r=o;r.n=o=e[0],o.p=r}}function A1(e){return Vt(e[0])<=Ot?e[0]:Ko(e[0])*((Vt(e[0])+Ot)%Oo-Ot)}function j3(e,t){var n=A1(t),r=t[1],o=ut(r),i=[ut(n),-gt(n),0],a=0,s=0,l=new Bs;o===1?r=In+nt:o===-1&&(r=-In-nt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,p=d[h-1],v=A1(p),b=p[1]/2+FO,x=ut(b),y=gt(b),_=0;_<h;++_,v=C,x=$,y=T,p=S){var S=d[_],C=A1(S),E=S[1]/2+FO,$=ut(E),T=gt(E),D=C-v,M=D>=0?1:-1,L=M*D,F=L>Ot,z=x*$;if(l.add(Ki(z*M*ut(L),y*T+z*gt(L))),a+=F?D+M*Oo:D,F^v>=n^C>=n){var X=T0(nd(p),nd(S));t_(X);var G=T0(i,X);t_(G);var A=(F^D>=0?-1:1)*Qo(G[2]);(r>A||r===A&&(X[0]||X[1]))&&(s+=F^D>=0?1:-1)}}return(a<-nt||a<nt&&l<-jC)^s&1}function z3(e,t,n,r){return function(o){var i=t(o),a=L3(),s=t(a),l=!1,c,u,d,h={point:p,lineStart:b,lineEnd:x,polygonStart:function(){h.point=y,h.lineStart=_,h.lineEnd=S,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=b,h.lineEnd=x,u=M3(u);var C=j3(c,r);u.length?(l||(o.polygonStart(),l=!0),F3(u,_re,C,n,o)):C&&(l||(o.polygonStart(),l=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),l&&(o.polygonEnd(),l=!1),u=c=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function p(C,E){e(C,E)&&o.point(C,E)}function v(C,E){i.point(C,E)}function b(){h.point=v,i.lineStart()}function x(){h.point=p,i.lineEnd()}function y(C,E){d.push([C,E]),s.point(C,E)}function _(){s.lineStart(),d=[]}function S(){y(d[0][0],d[0][1]),s.lineEnd();var C=s.clean(),E=a.result(),$,T=E.length,D,M,L;if(d.pop(),c.push(d),d=null,!!T){if(C&1){if(M=E[0],(D=M.length-1)>0){for(l||(o.polygonStart(),l=!0),o.lineStart(),$=0;$<D;++$)o.point((L=M[$])[0],L[1]);o.lineEnd()}return}T>1&&C&2&&E.push(E.pop().concat(E.shift())),u.push(E.filter(wre))}}return h}}function wre(e){return e.length>1}function _re(e,t){return((e=e.x)[0]<0?e[1]-In-nt:In-e[1])-((t=t.x)[0]<0?t[1]-In-nt:In-t[1])}const GO=z3(function(){return!0},Sre,Ere,[-Ot,-In]);function Sre(e){var t=NaN,n=NaN,r=NaN,o;return{lineStart:function(){e.lineStart(),o=1},point:function(i,a){var s=i>0?Ot:-Ot,l=Vt(i-t);Vt(l-Ot)<nt?(e.point(t,n=(n+a)/2>0?In:-In),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(i,n),o=0):r!==s&&l>=Ot&&(Vt(t-r)<nt&&(t-=r*nt),Vt(i-s)<nt&&(i-=s*nt),n=Cre(t,n,i,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),o=0),e.point(t=i,n=a),r=s},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-o}}}function Cre(e,t,n,r){var o,i,a=ut(e-n);return Vt(a)>nt?bd((ut(t)*(i=gt(r))*ut(n)-ut(r)*(o=gt(t))*ut(e))/(o*i*a)):(t+r)/2}function Ere(e,t,n,r){var o;if(e==null)o=n*In,r.point(-Ot,o),r.point(0,o),r.point(Ot,o),r.point(Ot,0),r.point(Ot,-o),r.point(0,-o),r.point(-Ot,-o),r.point(-Ot,0),r.point(-Ot,o);else if(Vt(e[0]-t[0])>nt){var i=e[0]<t[0]?Ot:-Ot;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(t[0],t[1])}function Rre(e){var t=gt(e),n=2*un,r=t>0,o=Vt(t)>nt;function i(u,d,h,p){xre(p,e,n,h,u,d)}function a(u,d){return gt(u)*gt(d)>t}function s(u){var d,h,p,v,b;return{lineStart:function(){v=p=!1,b=1},point:function(x,y){var _=[x,y],S,C=a(x,y),E=r?C?0:c(x,y):C?c(x+(x<0?Ot:-Ot),y):0;if(!d&&(v=p=C)&&u.lineStart(),C!==p&&(S=l(d,_),(!S||Jm(d,S)||Jm(_,S))&&(_[2]=1)),C!==p)b=0,C?(u.lineStart(),S=l(_,d),u.point(S[0],S[1])):(S=l(d,_),u.point(S[0],S[1],2),u.lineEnd()),d=S;else if(o&&d&&r^C){var $;!(E&h)&&($=l(_,d,!0))&&(b=0,r?(u.lineStart(),u.point($[0][0],$[0][1]),u.point($[1][0],$[1][1]),u.lineEnd()):(u.point($[1][0],$[1][1]),u.lineEnd(),u.lineStart(),u.point($[0][0],$[0][1],3)))}C&&(!d||!Jm(d,_))&&u.point(_[0],_[1]),d=_,p=C,h=E},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return b|(v&&p)<<1}}}function l(u,d,h){var p=nd(u),v=nd(d),b=[1,0,0],x=T0(p,v),y=Jg(x,x),_=x[0],S=y-_*_;if(!S)return!h&&u;var C=t*y/S,E=-t*_/S,$=T0(b,x),T=Zg(b,C),D=Zg(x,E);D1(T,D);var M=$,L=Jg(T,M),F=Jg(M,M),z=L*L-F*(Jg(T,T)-1);if(!(z<0)){var X=jr(z),G=Zg(M,(-L-X)/F);if(D1(G,T),G=e_(G),!h)return G;var A=u[0],U=d[0],V=u[1],K=d[1],q;U<A&&(q=A,A=U,U=q);var O=U-A,H=Vt(O-Ot)<nt,Y=H||O<nt;if(!H&&K<V&&(q=V,V=K,K=q),Y?H?V+K>0^G[1]<(Vt(G[0]-A)<nt?V:K):V<=G[1]&&G[1]<=K:O>Ot^(A<=G[0]&&G[0]<=U)){var I=Zg(M,(-L+X)/F);return D1(I,T),[G,e_(I)]}}}function c(u,d){var h=r?e:Ot-e,p=0;return u<-h?p|=1:u>h&&(p|=2),d<-h?p|=4:d>h&&(p|=8),p}return z3(a,s,i,r?[0,-e]:[-Ot,e-Ot])}function Pre(e,t,n,r,o,i){var a=e[0],s=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,p=c-s,v;if(v=n-a,!(!h&&v>0)){if(v/=h,h<0){if(v<u)return;v<d&&(d=v)}else if(h>0){if(v>d)return;v>u&&(u=v)}if(v=o-a,!(!h&&v<0)){if(v/=h,h<0){if(v>d)return;v>u&&(u=v)}else if(h>0){if(v<u)return;v<d&&(d=v)}if(v=r-s,!(!p&&v>0)){if(v/=p,p<0){if(v<u)return;v<d&&(d=v)}else if(p>0){if(v>d)return;v>u&&(u=v)}if(v=i-s,!(!p&&v<0)){if(v/=p,p<0){if(v>d)return;v>u&&(u=v)}else if(p>0){if(v<u)return;v<d&&(d=v)}return u>0&&(e[0]=a+u*h,e[1]=s+u*p),d<1&&(t[0]=a+d*h,t[1]=s+d*p),!0}}}}}var Of=1e9,tm=-Of;function $re(e,t,n,r){function o(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function i(c,u,d,h){var p=0,v=0;if(c==null||(p=a(c,d))!==(v=a(u,d))||l(c,u)<0^d>0)do h.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+d+4)%4)!==v);else h.point(u[0],u[1])}function a(c,u){return Vt(c[0]-e)<nt?u>0?0:3:Vt(c[0]-n)<nt?u>0?2:1:Vt(c[1]-t)<nt?u>0?1:0:u>0?3:2}function s(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=L3(),h,p,v,b,x,y,_,S,C,E,$,T={point:D,lineStart:z,lineEnd:X,polygonStart:L,polygonEnd:F};function D(A,U){o(A,U)&&u.point(A,U)}function M(){for(var A=0,U=0,V=p.length;U<V;++U)for(var K=p[U],q=1,O=K.length,H=K[0],Y,I,te=H[0],ce=H[1];q<O;++q)Y=te,I=ce,H=K[q],te=H[0],ce=H[1],I<=r?ce>r&&(te-Y)*(r-I)>(ce-I)*(e-Y)&&++A:ce<=r&&(te-Y)*(r-I)<(ce-I)*(e-Y)&&--A;return A}function L(){u=d,h=[],p=[],$=!0}function F(){var A=M(),U=$&&A,V=(h=M3(h)).length;(U||V)&&(c.polygonStart(),U&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),V&&F3(h,s,A,i,c),c.polygonEnd()),u=c,h=p=v=null}function z(){T.point=G,p&&p.push(v=[]),E=!0,C=!1,_=S=NaN}function X(){h&&(G(b,x),y&&C&&d.rejoin(),h.push(d.result())),T.point=D,C&&u.lineEnd()}function G(A,U){var V=o(A,U);if(p&&v.push([A,U]),E)b=A,x=U,y=V,E=!1,V&&(u.lineStart(),u.point(A,U));else if(V&&C)u.point(A,U);else{var K=[_=Math.max(tm,Math.min(Of,_)),S=Math.max(tm,Math.min(Of,S))],q=[A=Math.max(tm,Math.min(Of,A)),U=Math.max(tm,Math.min(Of,U))];Pre(K,q,e,t,n,r)?(C||(u.lineStart(),u.point(K[0],K[1])),u.point(q[0],q[1]),V||u.lineEnd(),$=!1):V&&(u.lineStart(),u.point(A,U),$=!1)}_=A,S=U,C=V}return T}}var o_,i_,Zm,e0,rd={sphere:nr,point:nr,lineStart:Ore,lineEnd:nr,polygonStart:nr,polygonEnd:nr};function Ore(){rd.point=Dre,rd.lineEnd=Tre}function Tre(){rd.point=rd.lineEnd=nr}function Dre(e,t){e*=un,t*=un,i_=e,Zm=ut(t),e0=gt(t),rd.point=Are}function Are(e,t){e*=un,t*=un;var n=ut(t),r=gt(t),o=Vt(e-i_),i=gt(o),a=ut(o),s=r*a,l=e0*n-Zm*r*i,c=Zm*n+e0*r*i;o_.add(Ki(jr(s*s+l*l),c)),i_=e,Zm=n,e0=r}function Mre(e){return o_=new Bs,Cl(e,rd),+o_}var a_=[null,null],kre={type:"LineString",coordinates:a_};function s_(e,t){return a_[0]=e,a_[1]=t,Mre(kre)}var YO={Feature:function(e,t){return D0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)if(D0(n[r].geometry,t))return!0;return!1}},KO={Sphere:function(){return!0},Point:function(e,t){return XO(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(XO(n[r],t))return!0;return!1},LineString:function(e,t){return QO(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(QO(n[r],t))return!0;return!1},Polygon:function(e,t){return JO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(JO(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)if(D0(n[r],t))return!0;return!1}};function D0(e,t){return e&&KO.hasOwnProperty(e.type)?KO[e.type](e,t):!1}function XO(e,t){return s_(e,t)===0}function QO(e,t){for(var n,r,o,i=0,a=e.length;i<a;i++){if(r=s_(e[i],t),r===0||i>0&&(o=s_(e[i],e[i-1]),o>0&&n<=o&&r<=o&&(n+r-o)*(1-Math.pow((n-r)/o,2))<jC*o))return!0;n=r}return!1}function JO(e,t){return!!j3(e.map(Ire),B3(t))}function Ire(e){return e=e.map(B3),e.pop(),e}function B3(e){return[e[0]*un,e[1]*un]}function Nre(e,t){return(e&&YO.hasOwnProperty(e.type)?YO[e.type]:D0)(e,t)}function ZO(e,t,n){var r=hu(e,t-nt,n).concat(t);return function(o){return r.map(function(i){return[o,i]})}}function eT(e,t,n){var r=hu(e,t-nt,n).concat(t);return function(o){return r.map(function(i){return[i,o]})}}function V3(){var e,t,n,r,o,i,a,s,l=10,c=l,u=90,d=360,h,p,v,b,x=2.5;function y(){return{type:"MultiLineString",coordinates:_()}}function _(){return hu(Qg(r/u)*u,n,u).map(v).concat(hu(Qg(s/d)*d,a,d).map(b)).concat(hu(Qg(t/l)*l,e,l).filter(function(S){return Vt(S%u)>nt}).map(h)).concat(hu(Qg(i/c)*c,o,c).filter(function(S){return Vt(S%d)>nt}).map(p))}return y.lines=function(){return _().map(function(S){return{type:"LineString",coordinates:S}})},y.outline=function(){return{type:"Polygon",coordinates:[v(r).concat(b(a).slice(1),v(n).reverse().slice(1),b(s).reverse().slice(1))]}},y.extent=function(S){return arguments.length?y.extentMajor(S).extentMinor(S):y.extentMinor()},y.extentMajor=function(S){return arguments.length?(r=+S[0][0],n=+S[1][0],s=+S[0][1],a=+S[1][1],r>n&&(S=r,r=n,n=S),s>a&&(S=s,s=a,a=S),y.precision(x)):[[r,s],[n,a]]},y.extentMinor=function(S){return arguments.length?(t=+S[0][0],e=+S[1][0],i=+S[0][1],o=+S[1][1],t>e&&(S=t,t=e,e=S),i>o&&(S=i,i=o,o=S),y.precision(x)):[[t,i],[e,o]]},y.step=function(S){return arguments.length?y.stepMajor(S).stepMinor(S):y.stepMinor()},y.stepMajor=function(S){return arguments.length?(u=+S[0],d=+S[1],y):[u,d]},y.stepMinor=function(S){return arguments.length?(l=+S[0],c=+S[1],y):[l,c]},y.precision=function(S){return arguments.length?(x=+S,h=ZO(i,o,90),p=eT(t,e,x),v=ZO(s,a,90),b=eT(r,n,x),y):x},y.extentMajor([[-180,-90+nt],[180,90-nt]]).extentMinor([[-180,-80-nt],[180,80+nt]])}function Lre(){return V3()()}const l_=e=>e;var M1=new Bs,c_=new Bs,H3,W3,u_,d_,xs={point:nr,lineStart:nr,lineEnd:nr,polygonStart:function(){xs.lineStart=Fre,xs.lineEnd=zre},polygonEnd:function(){xs.lineStart=xs.lineEnd=xs.point=nr,M1.add(Vt(c_)),c_=new Bs},result:function(){var e=M1/2;return M1=new Bs,e}};function Fre(){xs.point=jre}function jre(e,t){xs.point=U3,H3=u_=e,W3=d_=t}function U3(e,t){c_.add(d_*e-u_*t),u_=e,d_=t}function zre(){U3(H3,W3)}const tT=xs;var od=1/0,A0=od,hh=-od,M0=hh,Bre={point:Vre,lineStart:nr,lineEnd:nr,polygonStart:nr,polygonEnd:nr,result:function(){var e=[[od,A0],[hh,M0]];return hh=M0=-(A0=od=1/0),e}};function Vre(e,t){e<od&&(od=e),e>hh&&(hh=e),t<A0&&(A0=t),t>M0&&(M0=t)}const k0=Bre;var f_=0,h_=0,Tf=0,I0=0,N0=0,pu=0,p_=0,g_=0,Df=0,q3,G3,ji,zi,pi={point:lc,lineStart:nT,lineEnd:rT,polygonStart:function(){pi.lineStart=Ure,pi.lineEnd=qre},polygonEnd:function(){pi.point=lc,pi.lineStart=nT,pi.lineEnd=rT},result:function(){var e=Df?[p_/Df,g_/Df]:pu?[I0/pu,N0/pu]:Tf?[f_/Tf,h_/Tf]:[NaN,NaN];return f_=h_=Tf=I0=N0=pu=p_=g_=Df=0,e}};function lc(e,t){f_+=e,h_+=t,++Tf}function nT(){pi.point=Hre}function Hre(e,t){pi.point=Wre,lc(ji=e,zi=t)}function Wre(e,t){var n=e-ji,r=t-zi,o=jr(n*n+r*r);I0+=o*(ji+e)/2,N0+=o*(zi+t)/2,pu+=o,lc(ji=e,zi=t)}function rT(){pi.point=lc}function Ure(){pi.point=Gre}function qre(){Y3(q3,G3)}function Gre(e,t){pi.point=Y3,lc(q3=ji=e,G3=zi=t)}function Y3(e,t){var n=e-ji,r=t-zi,o=jr(n*n+r*r);I0+=o*(ji+e)/2,N0+=o*(zi+t)/2,pu+=o,o=zi*e-ji*t,p_+=o*(ji+e),g_+=o*(zi+t),Df+=o*3,lc(ji=e,zi=t)}const oT=pi;function K3(e){this._context=e}K3.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Oo);break}}},result:nr};var m_=new Bs,k1,X3,Q3,Af,Mf,L0={point:nr,lineStart:function(){L0.point=Yre},lineEnd:function(){k1&&J3(X3,Q3),L0.point=nr},polygonStart:function(){k1=!0},polygonEnd:function(){k1=null},result:function(){var e=+m_;return m_=new Bs,e}};function Yre(e,t){L0.point=J3,X3=Af=e,Q3=Mf=t}function J3(e,t){Af-=e,Mf-=t,m_.add(jr(Af*Af+Mf*Mf)),Af=e,Mf=t}const iT=L0;let aT,F0,sT,lT;class cT{constructor(t){this._append=t==null?Z3:Kre(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==sT||this._append!==F0){const r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,sT=r,F0=this._append,lT=this._,this._=o}this._+=lT;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Z3(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Kre(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Z3;if(t!==aT){const n=10**t;aT=t,F0=function(o){let i=1;this._+=o[0];for(const a=o.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return F0}function uT(e,t){let n=3,r=4.5,o,i;function a(s){return s&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),Cl(s,o(i))),i.result()}return a.area=function(s){return Cl(s,o(tT)),tT.result()},a.measure=function(s){return Cl(s,o(iT)),iT.result()},a.bounds=function(s){return Cl(s,o(k0)),k0.result()},a.centroid=function(s){return Cl(s,o(oT)),oT.result()},a.projection=function(s){return arguments.length?(o=s==null?(e=null,l_):(e=s).stream,a):e},a.context=function(s){return arguments.length?(i=s==null?(t=null,new cT(n)):new K3(t=s),typeof r!="function"&&i.pointRadius(r),a):t},a.pointRadius=function(s){return arguments.length?(r=typeof s=="function"?s:(i.pointRadius(+s),+s),a):r},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{const l=Math.floor(s);if(!(l>=0))throw new RangeError(`invalid digits: ${s}`);n=l}return t===null&&(i=new cT(n)),a},a.projection(e).digits(n).context(t)}function BC(e){return function(t){var n=new b_;for(var r in e)n[r]=e[r];return n.stream=t,n}}function b_(){}b_.prototype={constructor:b_,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function VC(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Cl(n,e.stream(k0)),t(k0.result()),r!=null&&e.clipExtent(r),e}function HC(e,t,n){return VC(e,function(r){var o=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),s=+t[0][0]+(o-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(i-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([s,l])},n)}function e7(e,t,n){return HC(e,[[0,0],t],n)}function t7(e,t,n){return VC(e,function(r){var o=+t,i=o/(r[1][0]-r[0][0]),a=(o-i*(r[1][0]+r[0][0]))/2,s=-i*r[0][1];e.scale(150*i).translate([a,s])},n)}function n7(e,t,n){return VC(e,function(r){var o=+t,i=o/(r[1][1]-r[0][1]),a=-i*r[0][0],s=(o-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([a,s])},n)}var dT=16,Xre=gt(30*un);function fT(e,t){return+t?Jre(e,t):Qre(e)}function Qre(e){return BC({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Jre(e,t){function n(r,o,i,a,s,l,c,u,d,h,p,v,b,x){var y=c-r,_=u-o,S=y*y+_*_;if(S>4*t&&b--){var C=a+h,E=s+p,$=l+v,T=jr(C*C+E*E+$*$),D=Qo($/=T),M=Vt(Vt($)-1)<nt||Vt(i-d)<nt?(i+d)/2:Ki(E,C),L=e(M,D),F=L[0],z=L[1],X=F-r,G=z-o,A=_*X-y*G;(A*A/S>t||Vt((y*X+_*G)/S-.5)>.3||a*h+s*p+l*v<Xre)&&(n(r,o,i,a,s,l,F,z,M,C/=T,E/=T,$,b,x),x.point(F,z),n(F,z,M,C,E,$,c,u,d,h,p,v,b,x))}}return function(r){var o,i,a,s,l,c,u,d,h,p,v,b,x={point:y,lineStart:_,lineEnd:C,polygonStart:function(){r.polygonStart(),x.lineStart=E},polygonEnd:function(){r.polygonEnd(),x.lineStart=_}};function y(D,M){D=e(D,M),r.point(D[0],D[1])}function _(){d=NaN,x.point=S,r.lineStart()}function S(D,M){var L=nd([D,M]),F=e(D,M);n(d,h,u,p,v,b,d=F[0],h=F[1],u=D,p=L[0],v=L[1],b=L[2],dT,r),r.point(d,h)}function C(){x.point=y,r.lineEnd()}function E(){_(),x.point=$,x.lineEnd=T}function $(D,M){S(o=D,M),i=d,a=h,s=p,l=v,c=b,x.point=S}function T(){n(d,h,u,p,v,b,i,a,o,s,l,c,dT,r),x.lineEnd=C,C()}return x}}var Zre=BC({point:function(e,t){this.stream.point(e*un,t*un)}});function eoe(e){return BC({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function toe(e,t,n,r,o){function i(a,s){return a*=r,s*=o,[t+e*a,n-e*s]}return i.invert=function(a,s){return[(a-t)/e*r,(n-s)/e*o]},i}function hT(e,t,n,r,o,i){if(!i)return toe(e,t,n,r,o);var a=gt(i),s=ut(i),l=a*e,c=s*e,u=a/e,d=s/e,h=(s*n-a*t)/e,p=(s*t+a*n)/e;function v(b,x){return b*=r,x*=o,[l*b-c*x+t,n-c*b-l*x]}return v.invert=function(b,x){return[r*(u*b-d*x+h),o*(p-d*b-u*x)]},v}function Va(e){return r7(function(){return e})()}function r7(e){var t,n=150,r=480,o=250,i=0,a=0,s=0,l=0,c=0,u,d=0,h=1,p=1,v=null,b=GO,x=null,y,_,S,C=l_,E=.5,$,T,D,M,L;function F(A){return D(A[0]*un,A[1]*un)}function z(A){return A=D.invert(A[0],A[1]),A&&[A[0]*kr,A[1]*kr]}F.stream=function(A){return M&&L===A?M:M=Zre(eoe(u)(b($(C(L=A)))))},F.preclip=function(A){return arguments.length?(b=A,v=void 0,G()):b},F.postclip=function(A){return arguments.length?(C=A,x=y=_=S=null,G()):C},F.clipAngle=function(A){return arguments.length?(b=+A?Rre(v=A*un):(v=null,GO),G()):v*kr},F.clipExtent=function(A){return arguments.length?(C=A==null?(x=y=_=S=null,l_):$re(x=+A[0][0],y=+A[0][1],_=+A[1][0],S=+A[1][1]),G()):x==null?null:[[x,y],[_,S]]},F.scale=function(A){return arguments.length?(n=+A,X()):n},F.translate=function(A){return arguments.length?(r=+A[0],o=+A[1],X()):[r,o]},F.center=function(A){return arguments.length?(i=A[0]%360*un,a=A[1]%360*un,X()):[i*kr,a*kr]},F.rotate=function(A){return arguments.length?(s=A[0]%360*un,l=A[1]%360*un,c=A.length>2?A[2]%360*un:0,X()):[s*kr,l*kr,c*kr]},F.angle=function(A){return arguments.length?(d=A%360*un,X()):d*kr},F.reflectX=function(A){return arguments.length?(h=A?-1:1,X()):h<0},F.reflectY=function(A){return arguments.length?(p=A?-1:1,X()):p<0},F.precision=function(A){return arguments.length?($=fT(T,E=A*A),G()):jr(E)},F.fitExtent=function(A,U){return HC(F,A,U)},F.fitSize=function(A,U){return e7(F,A,U)},F.fitWidth=function(A,U){return t7(F,A,U)},F.fitHeight=function(A,U){return n7(F,A,U)};function X(){var A=hT(n,0,0,h,p,d).apply(null,t(i,a)),U=hT(n,r-A[0],o-A[1],h,p,d);return u=N3(s,l,c),T=n_(t,U),D=n_(u,T),$=fT(T,E),G()}function G(){return M=L=null,F}return function(){return t=e.apply(this,arguments),F.invert=t.invert&&z,X()}}function WC(e){var t=0,n=Ot/3,r=r7(e),o=r(t,n);return o.parallels=function(i){return arguments.length?r(t=i[0]*un,n=i[1]*un):[t*kr,n*kr]},o}function noe(e){var t=gt(e);function n(r,o){return[r*t,ut(o)/t]}return n.invert=function(r,o){return[r/t,Qo(o*t)]},n}function roe(e,t){var n=ut(e),r=(n+ut(t))/2;if(Vt(r)<nt)return noe(e);var o=1+n*(2*r-n),i=jr(o)/r;function a(s,l){var c=jr(o-2*r*ut(l))/r;return[c*ut(s*=r),i-c*gt(s)]}return a.invert=function(s,l){var c=i-l,u=Ki(s,Vt(c))*Ko(c);return c*r<0&&(u-=Ot*Ko(s)*Ko(c)),[u/r,Qo((o-(s*s+c*c)*r*r)/(2*r))]},a}function j0(){return WC(roe).scale(155.424).center([0,33.6442])}function o7(){return j0().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ooe(e){var t=e.length;return{point:function(n,r){for(var o=-1;++o<t;)e[o].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function ioe(){var e,t,n=o7(),r,o=j0().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,a=j0().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,l,c={point:function(h,p){l=[h,p]}};function u(h){var p=h[0],v=h[1];return l=null,r.point(p,v),l||(i.point(p,v),l)||(s.point(p,v),l)}u.invert=function(h){var p=n.scale(),v=n.translate(),b=(h[0]-v[0])/p,x=(h[1]-v[1])/p;return(x>=.12&&x<.234&&b>=-.425&&b<-.214?o:x>=.166&&x<.234&&b>=-.214&&b<-.115?a:n).invert(h)},u.stream=function(h){return e&&t===h?e:e=ooe([n.stream(t=h),o.stream(h),a.stream(h)])},u.precision=function(h){return arguments.length?(n.precision(h),o.precision(h),a.precision(h),d()):n.precision()},u.scale=function(h){return arguments.length?(n.scale(h),o.scale(h*.35),a.scale(h),u.translate(n.translate())):n.scale()},u.translate=function(h){if(!arguments.length)return n.translate();var p=n.scale(),v=+h[0],b=+h[1];return r=n.translate(h).clipExtent([[v-.455*p,b-.238*p],[v+.455*p,b+.238*p]]).stream(c),i=o.translate([v-.307*p,b+.201*p]).clipExtent([[v-.425*p+nt,b+.12*p+nt],[v-.214*p-nt,b+.234*p-nt]]).stream(c),s=a.translate([v-.205*p,b+.212*p]).clipExtent([[v-.214*p+nt,b+.166*p+nt],[v-.115*p-nt,b+.234*p-nt]]).stream(c),d()},u.fitExtent=function(h,p){return HC(u,h,p)},u.fitSize=function(h,p){return e7(u,h,p)},u.fitWidth=function(h,p){return t7(u,h,p)},u.fitHeight=function(h,p){return n7(u,h,p)};function d(){return e=t=null,u}return u.scale(1070)}function i7(e){return function(t,n){var r=gt(t),o=gt(n),i=e(r*o);return i===1/0?[2,0]:[i*o*ut(t),i*ut(n)]}}function pp(e){return function(t,n){var r=jr(t*t+n*n),o=e(r),i=ut(o),a=gt(o);return[Ki(t*i,r*a),Qo(r&&n*i/r)]}}var a7=i7(function(e){return jr(2/(1+e))});a7.invert=pp(function(e){return 2*Qo(e/2)});function aoe(){return Va(a7).scale(124.75).clipAngle(180-.001)}var s7=i7(function(e){return(e=I3(e))&&e/ut(e)});s7.invert=pp(function(e){return e});function soe(){return Va(s7).scale(79.4188).clipAngle(180-.001)}function Ub(e,t){return[e,$0(zC((In+t)/2))]}Ub.invert=function(e,t){return[e,2*bd(k3(t))-In]};function loe(){return l7(Ub).scale(961/Oo)}function l7(e){var t=Va(e),n=t.center,r=t.scale,o=t.translate,i=t.clipExtent,a=null,s,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(o(d),u()):o()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=s=l=c=null:(a=+d[0][0],s=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,s],[l,c]]};function u(){var d=Ot*r(),h=t(yre(t.rotate()).invert([0,0]));return i(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Ub?[[Math.max(h[0]-d,a),s],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,s)],[l,Math.min(h[1]+d,c)]])}return u()}function nm(e){return zC((In+e)/2)}function coe(e,t){var n=gt(e),r=e===t?ut(e):$0(n/gt(t))/$0(nm(t)/nm(e)),o=n*T1(nm(e),r)/r;if(!r)return Ub;function i(a,s){o>0?s<-In+nt&&(s=-In+nt):s>In-nt&&(s=In-nt);var l=o/T1(nm(s),r);return[l*ut(r*a),o-l*gt(r*a)]}return i.invert=function(a,s){var l=o-s,c=Ko(r)*jr(a*a+l*l),u=Ki(a,Vt(l))*Ko(l);return l*r<0&&(u-=Ot*Ko(a)*Ko(l)),[u/r,2*bd(T1(o/c,1/r))-In]},i}function uoe(){return WC(coe).scale(109.5).parallels([30,30])}function z0(e,t){return[e,t]}z0.invert=z0;function doe(){return Va(z0).scale(152.63)}function foe(e,t){var n=gt(e),r=e===t?ut(e):(n-gt(t))/(t-e),o=n/r+e;if(Vt(r)<nt)return z0;function i(a,s){var l=o-s,c=r*a;return[l*ut(c),o-l*gt(c)]}return i.invert=function(a,s){var l=o-s,c=Ki(a,Vt(l))*Ko(l);return l*r<0&&(c-=Ot*Ko(a)*Ko(l)),[c/r,o-Ko(r)*jr(a*a+l*l)]},i}function hoe(){return WC(foe).scale(131.154).center([0,13.9389])}var Hf=1.340264,Wf=-.081106,Uf=893e-6,qf=.003796,B0=jr(3)/2,poe=12;function c7(e,t){var n=Qo(B0*ut(t)),r=n*n,o=r*r*r;return[e*gt(n)/(B0*(Hf+3*Wf*r+o*(7*Uf+9*qf*r))),n*(Hf+Wf*r+o*(Uf+qf*r))]}c7.invert=function(e,t){for(var n=t,r=n*n,o=r*r*r,i=0,a,s,l;i<poe&&(s=n*(Hf+Wf*r+o*(Uf+qf*r))-t,l=Hf+3*Wf*r+o*(7*Uf+9*qf*r),n-=a=s/l,r=n*n,o=r*r*r,!(Vt(a)<jC));++i);return[B0*e*(Hf+3*Wf*r+o*(7*Uf+9*qf*r))/gt(n),Qo(ut(n)/B0)]};function goe(){return Va(c7).scale(177.158)}function u7(e,t){var n=gt(t),r=gt(e)*n;return[n*ut(e)/r,ut(t)/r]}u7.invert=pp(bd);function moe(){return Va(u7).scale(144.049).clipAngle(60)}function d7(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}d7.invert=function(e,t){var n=t,r=25,o;do{var i=n*n,a=i*i;n-=o=(n*(1.007226+i*(.015085+a*(-.044475+.028874*i-.005916*a)))-t)/(1.007226+i*(.015085*3+a*(-.044475*7+.028874*9*i-.005916*11*a)))}while(Vt(o)>nt&&--r>0);return[e/(.8707+(i=n*n)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),n]};function boe(){return Va(d7).scale(175.295)}function f7(e,t){return[gt(t)*ut(e),ut(t)]}f7.invert=pp(Qo);function voe(){return Va(f7).scale(249.5).clipAngle(90+nt)}function h7(e,t){var n=gt(t),r=1+gt(e)*n;return[n*ut(e)/r,ut(t)/r]}h7.invert=pp(function(e){return 2*bd(e)});function yoe(){return Va(h7).scale(250).clipAngle(142)}function p7(e,t){return[$0(zC((In+t)/2)),-e]}p7.invert=function(e,t){return[-t,2*bd(k3(e))-In]};function xoe(){var e=l7(p7),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function Xt(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function qb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function UC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function vd(){}var cc=.7,id=1/cc,_u="\\s*([+-]?\\d+)\\s*",ph="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",woe=/^#([0-9a-f]{3,8})$/,_oe=new RegExp(`^rgb\\(${_u},${_u},${_u}\\)$`),Soe=new RegExp(`^rgb\\(${Ui},${Ui},${Ui}\\)$`),Coe=new RegExp(`^rgba\\(${_u},${_u},${_u},${ph}\\)$`),Eoe=new RegExp(`^rgba\\(${Ui},${Ui},${Ui},${ph}\\)$`),Roe=new RegExp(`^hsl\\(${ph},${Ui},${Ui}\\)$`),Poe=new RegExp(`^hsla\\(${ph},${Ui},${Ui},${ph}\\)$`),pT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};qb(vd,qC,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gT,formatHex:gT,formatHex8:$oe,formatHsl:Ooe,formatRgb:mT,toString:mT});function gT(){return this.rgb().formatHex()}function $oe(){return this.rgb().formatHex8()}function Ooe(){return m7(this).formatHsl()}function mT(){return this.rgb().formatRgb()}function qC(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=woe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?bT(t):n===3?new Sr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rm(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_oe.exec(e))?new Sr(t[1],t[2],t[3],1):(t=Soe.exec(e))?new Sr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Coe.exec(e))?rm(t[1],t[2],t[3],t[4]):(t=Eoe.exec(e))?rm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Roe.exec(e))?xT(t[1],t[2]/100,t[3]/100,1):(t=Poe.exec(e))?xT(t[1],t[2]/100,t[3]/100,t[4]):pT.hasOwnProperty(e)?bT(pT[e]):e==="transparent"?new Sr(NaN,NaN,NaN,0):null}function bT(e){return new Sr(e>>16&255,e>>8&255,e&255,1)}function rm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Sr(e,t,n,r)}function g7(e){return e instanceof vd||(e=qC(e)),e?(e=e.rgb(),new Sr(e.r,e.g,e.b,e.opacity)):new Sr}function gh(e,t,n,r){return arguments.length===1?g7(e):new Sr(e,t,n,r??1)}function Sr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}qb(Sr,gh,UC(vd,{brighter(e){return e=e==null?id:Math.pow(id,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Sr(Xl(this.r),Xl(this.g),Xl(this.b),V0(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vT,formatHex:vT,formatHex8:Toe,formatRgb:yT,toString:yT}));function vT(){return`#${Al(this.r)}${Al(this.g)}${Al(this.b)}`}function Toe(){return`#${Al(this.r)}${Al(this.g)}${Al(this.b)}${Al((isNaN(this.opacity)?1:this.opacity)*255)}`}function yT(){const e=V0(this.opacity);return`${e===1?"rgb(":"rgba("}${Xl(this.r)}, ${Xl(this.g)}, ${Xl(this.b)}${e===1?")":`, ${e})`}`}function V0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Al(e){return e=Xl(e),(e<16?"0":"")+e.toString(16)}function xT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new gi(e,t,n,r)}function m7(e){if(e instanceof gi)return new gi(e.h,e.s,e.l,e.opacity);if(e instanceof vd||(e=qC(e)),!e)return new gi;if(e instanceof gi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(t===i?a=(n-r)/s+(n<r)*6:n===i?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new gi(a,s,l,e.opacity)}function Doe(e,t,n,r){return arguments.length===1?m7(e):new gi(e,t,n,r??1)}function gi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}qb(gi,Doe,UC(vd,{brighter(e){return e=e==null?id:Math.pow(id,e),new gi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new gi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Sr(I1(e>=240?e-240:e+120,o,r),I1(e,o,r),I1(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new gi(wT(this.h),om(this.s),om(this.l),V0(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=V0(this.opacity);return`${e===1?"hsl(":"hsla("}${wT(this.h)}, ${om(this.s)*100}%, ${om(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wT(e){return e=(e||0)%360,e<0?e+360:e}function om(e){return Math.max(0,Math.min(1,e||0))}function I1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Aoe=Math.PI/180,Moe=180/Math.PI;var b7=-.14861,GC=1.78277,YC=-.29227,Gb=-.90649,mh=1.97294,_T=mh*Gb,ST=mh*GC,CT=GC*YC-Gb*b7;function koe(e){if(e instanceof Ql)return new Ql(e.h,e.s,e.l,e.opacity);e instanceof Sr||(e=g7(e));var t=e.r/255,n=e.g/255,r=e.b/255,o=(CT*r+_T*t-ST*n)/(CT+_T-ST),i=r-o,a=(mh*(n-o)-YC*i)/Gb,s=Math.sqrt(a*a+i*i)/(mh*o*(1-o)),l=s?Math.atan2(a,i)*Moe-120:NaN;return new Ql(l<0?l+360:l,s,o,e.opacity)}function Xi(e,t,n,r){return arguments.length===1?koe(e):new Ql(e,t,n,r??1)}function Ql(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}qb(Ql,Xi,UC(vd,{brighter(e){return e=e==null?id:Math.pow(id,e),new Ql(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new Ql(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Aoe,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),o=Math.sin(e);return new Sr(255*(t+n*(b7*r+GC*o)),255*(t+n*(YC*r+Gb*o)),255*(t+n*(mh*r)),this.opacity)}}));function Ioe(e,t,n,r,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*n+(1+3*e+3*i-3*a)*r+a*o)/6}function Noe(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],a=r>0?e[r-1]:2*o-i,s=r<t-1?e[r+2]:2*i-o;return Ioe((n-r/t)*t,a,o,i,s)}}const KC=e=>()=>e;function v7(e,t){return function(n){return e+n*t}}function Loe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Foe(e,t){var n=t-e;return n?v7(e,n>180||n<-180?n-360*Math.round(n/360):n):KC(isNaN(e)?t:e)}function joe(e){return(e=+e)==1?Su:function(t,n){return n-t?Loe(t,n,e):KC(isNaN(t)?n:t)}}function Su(e,t){var n=t-e;return n?v7(e,n):KC(isNaN(e)?t:e)}(function e(t){var n=joe(t);function r(o,i){var a=n((o=gh(o)).r,(i=gh(i)).r),s=n(o.g,i.g),l=n(o.b,i.b),c=Su(o.opacity,i.opacity);return function(u){return o.r=a(u),o.g=s(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=e,r})(1);function zoe(e){return function(t){var n=t.length,r=new Array(n),o=new Array(n),i=new Array(n),a,s;for(a=0;a<n;++a)s=gh(t[a]),r[a]=s.r||0,o[a]=s.g||0,i[a]=s.b||0;return r=e(r),o=e(o),i=e(i),s.opacity=1,function(l){return s.r=r(l),s.g=o(l),s.b=i(l),s+""}}}var Boe=zoe(Noe);function y7(e){return function t(n){n=+n;function r(o,i){var a=e((o=Xi(o)).h,(i=Xi(i)).h),s=Su(o.s,i.s),l=Su(o.l,i.l),c=Su(o.opacity,i.opacity);return function(u){return o.h=a(u),o.s=s(u),o.l=l(Math.pow(u,n)),o.opacity=c(u),o+""}}return r.gamma=t,r}(1)}y7(Foe);var XC=y7(Su);const hn=e=>Boe(e[e.length-1]);var Voe=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Xt);const Hoe=hn(Voe);var Woe=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Xt);const Uoe=hn(Woe);var qoe=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Xt);const Goe=hn(qoe);var Yoe=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Xt);const Koe=hn(Yoe);var Xoe=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Xt);const Qoe=hn(Xoe);var Joe=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Xt);const Zoe=hn(Joe);var eie=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Xt);const tie=hn(eie);var nie=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Xt);const rie=hn(nie);var oie=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Xt);const iie=hn(oie);var aie=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Xt);const sie=hn(aie);var lie=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Xt);const cie=hn(lie);var uie=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Xt);const die=hn(uie);var fie=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Xt);const hie=hn(fie);var pie=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Xt);const gie=hn(pie);var mie=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Xt);const bie=hn(mie);var vie=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Xt);const yie=hn(vie);var xie=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Xt);const wie=hn(xie);var _ie=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Xt);const Sie=hn(_ie);var Cie=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Xt);const Eie=hn(Cie);var Rie=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Xt);const Pie=hn(Rie);var $ie=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Xt);const Oie=hn($ie);var Tie=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Xt);const Die=hn(Tie);var Aie=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Xt);const Mie=hn(Aie);var kie=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Xt);const Iie=hn(kie);var Nie=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Xt);const Lie=hn(Nie);var Fie=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Xt);const jie=hn(Fie);var zie=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Xt);const Bie=hn(zie);function Vie(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const Hie=XC(Xi(300,.5,0),Xi(-240,.5,1));var Wie=XC(Xi(-100,.75,.35),Xi(80,1.5,.8)),Uie=XC(Xi(260,.75,.35),Xi(80,1.5,.8)),im=Xi();function qie(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return im.h=360*e-100,im.s=1.5-1.5*t,im.l=.8-.9*t,im+""}var am=gh(),Gie=Math.PI/3,Yie=Math.PI*2/3;function Kie(e){var t;return e=(.5-e)*Math.PI,am.r=255*(t=Math.sin(e))*t,am.g=255*(t=Math.sin(e+Gie))*t,am.b=255*(t=Math.sin(e+Yie))*t,am+""}function Xie(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function Yb(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const Qie=Yb(Xt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Jie=Yb(Xt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Zie=Yb(Xt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),eae=Yb(Xt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function tae(e){return e}function nae(e){if(e==null)return tae;var t,n,r=e.scale[0],o=e.scale[1],i=e.translate[0],a=e.translate[1];return function(s,l){l||(t=n=0);var c=2,u=s.length,d=new Array(u);for(d[0]=(t+=s[0])*r+i,d[1]=(n+=s[1])*o+a;c<u;)d[c]=s[c],++c;return d}}function rae(e,t){for(var n,r=e.length,o=r-t;o<--r;)n=e[o],e[o++]=e[r],e[r]=n}function oae(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return ET(e,n)})}:ET(e,t)}function ET(e,t){var n=t.id,r=t.bbox,o=t.properties==null?{}:t.properties,i=iae(e,t);return n==null&&r==null?{type:"Feature",properties:o,geometry:i}:r==null?{type:"Feature",id:n,properties:o,geometry:i}:{type:"Feature",id:n,bbox:r,properties:o,geometry:i}}function iae(e,t){var n=nae(e.transform),r=e.arcs;function o(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],p=0,v=h.length;p<v;++p)d.push(n(h[p],p));u<0&&rae(d,v)}function i(u){return n(u)}function a(u){for(var d=[],h=0,p=u.length;h<p;++h)o(u[h],d);return d.length<2&&d.push(d[0]),d}function s(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(s)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=i(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(i);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}const Gf={geoAzimuthalEqualArea:aoe,geoAzimuthalEquidistant:soe,geoGnomonic:moe,geoOrthographic:voe,geoStereographic:yoe,geoEqualEarth:goe,geoAlbers:o7,geoAlbersUsa:ioe,geoConicConformal:uoe,geoConicEqualArea:j0,geoConicEquidistant:hoe,geoEquirectangular:doe,geoMercator:loe,geoTransverseMercator:xoe,geoNaturalEarth1:boe};Object.keys(Gf).forEach(e=>{Gf[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=Gf[e]});class wc extends Qs{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=uT()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(Gf[t.projection]||Gf.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=uT(this.projection.fitWidth(1e3,t)).bounds(t),r=Math.ceil(n[1][1]-n[0][1]),o=Math.ceil(n[1][0]-n[0][0]),i=this.projection.translate();this.outlineBounds={width:o,height:r,aspectRatio:o/r,refScale:this.projection.scale(),refX:i[0],refY:i[1]}}updateBounds(){const t=this.chart.chartArea,n=this.outlineBounds;if(!n)return!1;const r=this.options.padding,o=typeof r=="number"?r:r.top,i=typeof r=="number"?r:r.left,a=typeof r=="number"?r:r.bottom,s=typeof r=="number"?r:r.right,l=t.right-t.left-i-s,c=t.bottom-t.top-o-a,u=this.oldChartBounds;this.oldChartBounds={chartWidth:l,chartHeight:c};const d=Math.min(l/n.width,c/n.height),h=n.width*d,p=n.height*d,v=(l-h)*.5+t.left+i,b=(c-p)*.5+t.top+o,x=this.options;return this.projection.scale(n.refScale*d*x.projectionScale).translate([d*n.refX+v+x.projectionOffset[0],d*n.refY+b+x.projectionOffset[1]]),!u||u.chartWidth!==this.oldChartBounds.chartWidth||u.chartHeight!==this.oldChartBounds.chartHeight}}wc.id="projection";wc.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};wc.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const Kb={position:"chartArea",property:"value",grid:{z:1,drawOnChartArea:!1},ticks:{z:1},legend:{align:"right",position:"bottom-right",length:100,width:50,margin:8,indicatorWidth:10}};function aae(e){const{indicatorWidth:t,align:n,margin:r}=e,o=(typeof r=="number"?r:r.left)+(n==="right"?t:0),i=(typeof r=="number"?r:r.top)+(n==="bottom"?t:0),a=(typeof r=="number"?r:r.right)+(n==="left"?t:0),s=(typeof r=="number"?r:r.bottom)+(n==="top"?t:0);return{left:o,top:i,right:a,bottom:s}}function sae(e,t,n,r,o){const{indicatorWidth:i,align:a,position:s}=t,l=a==="top"||a==="bottom",c=(a==="left"?o.w:n)+(l?i:0),u=(a==="top"?o.h:r)+(l?0:i),d=aae(t);if(typeof s=="string")switch(s){case"top-left":return[d.left,d.top];case"top":return[(e.right-c)/2,d.top];case"left":return[d.left,(e.bottom-u)/2];case"top-right":return[e.right-c-d.right,d.top];case"bottom-right":return[e.right-c-d.right,e.bottom-u-d.bottom];case"bottom":return[(e.right-c)/2,e.bottom-u-d.bottom];case"bottom-left":return[d.left,e.bottom-u-d.bottom];default:return[e.right-c-d.right,(e.bottom-u)/2]}return[s.x,s.y]}class gu extends ed{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){t.position="chartArea",super.init(t),this.axis="r"}parse(t,n){return t&&typeof t[this.options.property]=="number"?t[this.options.property]:super.parse(t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(t-this._startValue)/this._valueRange}update(t,n,r){const o=Math.min(n,this.bottom==null?Number.POSITIVE_INFINITY:this.bottom),i=Math.min(t,this.right==null?Number.POSITIVE_INFINITY:this.right),a=this.options.legend,s=this.isHorizontal(),l=(p,v)=>p<1?v*p:p,c=Math.min(i,l(s?a.length:a.width,i))-(s?0:a.indicatorWidth),u=Math.min(o,l(s?a.width:a.length,o))-(s?a.indicatorWidth:0);this.legendSize={w:c,h:u},this.bottom=u,this.height=u,this.right=c,this.width=c;const d=this.options.position;this.options.position=this.options.legend.align;const h=super.update(c,u,r);return this.options.position=d,this.height=Math.min(u,this.height),this.width=Math.min(c,this.width),h}_computeLabelArea(){}draw(t){if(!this._isVisible())return;const n=sae(t,this.options.legend,this.width,this.height,this.legendSize),{ctx:r}=this;r.save(),r.translate(n[0],n[1]);const o=this.options.position;this.options.position=this.options.legend.align,super.draw({...t,bottom:this.height+10,right:this.width}),this.options.position=o;const{indicatorWidth:i}=this.options.legend;switch(this.options.legend.align){case"left":r.translate(this.legendSize.w,0);break;case"top":r.translate(0,this.legendSize.h);break;case"bottom":r.translate(0,-i);break;default:r.translate(-i,0);break}this._drawIndicator(),r.restore()}_drawIndicator(){}}class x7 extends td{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){gu.prototype.init.call(this,t)}parse(t,n){return gu.prototype.parse.call(this,t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(Math.log10(t)-this._startValue)/this._valueRange}update(t,n,r){return gu.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return gu.prototype.draw.call(this,t)}_drawIndicator(){}}const Oa={interpolateBlues:Die,interpolateBrBG:Hoe,interpolateBuGn:sie,interpolateBuPu:cie,interpolateCividis:Vie,interpolateCool:Uie,interpolateCubehelixDefault:Hie,interpolateGnBu:die,interpolateGreens:Mie,interpolateGreys:Iie,interpolateInferno:Zie,interpolateMagma:Jie,interpolateOrRd:hie,interpolateOranges:Bie,interpolatePRGn:Uoe,interpolatePiYG:Goe,interpolatePlasma:eae,interpolatePuBu:bie,interpolatePuBuGn:gie,interpolatePuOr:Koe,interpolatePuRd:yie,interpolatePurples:Lie,interpolateRainbow:qie,interpolateRdBu:Qoe,interpolateRdGy:Zoe,interpolateRdPu:wie,interpolateRdYlBu:tie,interpolateRdYlGn:rie,interpolateReds:jie,interpolateSinebow:Kie,interpolateSpectral:iie,interpolateTurbo:Xie,interpolateViridis:Qie,interpolateWarm:Wie,interpolateYlGn:Eie,interpolateYlGnBu:Sie,interpolateYlOrBr:Pie,interpolateYlOrRd:Oie};Object.keys(Oa).forEach(e=>{Oa[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=Oa[e],Oa[e.slice(11)]=Oa[e]});function w7(e,t){const n=1/t;if(e<=n)return 0;if(e>=1-n)return 1;for(let r=0;r<1;r+=n)if(e<r)return r-n/2;return e}const _7={interpolate:"blues",missing:"transparent",quantize:0};class Vs extends gu{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:Oa[t.interpolate]||Oa.blues:n=>`rgb(${n},${n},${n})`}getColorForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getColor(n)}getColor(t){let n=t;return this.options.quantize>0&&(n=w7(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){const{indicatorWidth:t}=this.options.legend,n=this._reversePixels;if(this.isHorizontal()){const r=this.width;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?a=>r-o-a:a=>a;for(let a=0;a<r;a+=o){const s=(a+o/2)/r;this.ctx.fillStyle=this.getColor(s),this.ctx.fillRect(i(a),0,o,t)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(o(i),0,1,t)}}else{const r=this.height;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?a=>r-o-a:a=>a;for(let a=0;a<r;a+=o){const s=(a+o/2)/r;this.ctx.fillStyle=this.getColor(s),this.ctx.fillRect(0,i(a),t,o)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(0,o(i),t,1)}}}}Vs.id="color";Vs.defaults=or({},[ed.defaults,Kb,_7]);Vs.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class QC extends x7{constructor(){super(...arguments),this.interpolate=t=>`rgb(${t},${t},${t})`}init(t){super.init(t),typeof t.interpolate=="function"?this.interpolate=t.interpolate:this.interpolate=Oa[t.interpolate]||Oa.blues}getColorForValue(t){return Vs.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=w7(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return Vs.prototype._drawIndicator.call(this)}}QC.id="colorLogarithmic";QC.defaults=or({},[td.defaults,Kb,_7]);QC.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const S7={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class Hs extends gu{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){const[n,r]=this.options.range;if(this.options.mode==="area"){const i=r*r*Math.PI,a=n*n*Math.PI,s=i-a,l=t*s+a;return Math.sqrt(l/Math.PI)}const o=r-n;return t*o+n}_drawIndicator(){const{ctx:t}=this,n=this.options.legend.indicatorWidth/2,r=this.isHorizontal(),o=this.ticks,i=this.getLabelItems(),a=i?i.map(s=>({[r?"x":"y"]:s.options.translation[r?0:1]})):o.map((s,l)=>({[r?"x":"y"]:this.getPixelForTick(l)}));if((this._gridLineItems||[]).forEach(s=>{if(t.save(),t.strokeStyle=s.color,t.lineWidth=s.width,t.setLineDash&&(t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset),t.beginPath(),this.options.grid.drawTicks)switch(this.options.legend.align){case"left":t.moveTo(0,s.ty1),t.lineTo(n,s.ty2);break;case"top":t.moveTo(s.tx1,0),t.lineTo(s.tx2,n);break;case"bottom":t.moveTo(s.tx1,n),t.lineTo(s.tx2,n*2);break;default:t.moveTo(n,s.ty1),t.lineTo(n*2,s.ty2);break}t.stroke(),t.restore()}),this._model){const s=this._model;t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth||0,t.fillStyle=s.backgroundColor}else t.fillStyle="blue";o.forEach((s,l)=>{const c=a[l],u=this.getSizeForValue(s.value),d=r?c.x:n,h=r?n:c.y,p={pointStyle:"circle",borderWidth:0,...this._model||{},radius:u};_0(t,p,d,h)})}}Hs.id="size";Hs.defaults=or({},[ed.defaults,Kb,S7]);Hs.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class C7 extends x7{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){return Hs.prototype.getSizeImpl.call(this,t)}_drawIndicator(){Hs.prototype._drawIndicator.call(this)}}C7.id="sizeLogarithmic";C7.defaults=or({},[td.defaults,Kb,S7]);function lae(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class La extends ra{constructor(){super(...arguments),this.cache=void 0}inRange(t,n){const r=this.getBounds(),o=(Number.isNaN(t)||t>=r.x&&t<=r.x2)&&(Number.isNaN(n)||n>=r.y&&n<=r.y2),i=this.projectionScale.geoPath.projection();if(o&&!Number.isNaN(t)&&!Number.isNaN(n)&&typeof i.invert=="function"){const a=i.invert([t,n]);return a!=null&&Nre(this.feature,a)}return o}inXRange(t){return this.inRange(t,Number.NaN)}inYRange(t){return this.inRange(Number.NaN,t)}getCenterPoint(){if(this.cache&&this.cache.center)return this.cache.center;let t;if(this.center){const n=this.projectionScale.projection([this.center.longitude,this.center.latitude]);t={x:n[0],y:n[1]}}else{const n=this.projectionScale.geoPath.centroid(this.feature);t={x:n[0],y:n[1]}}return this.cache={...this.cache||{},center:t},t}getBounds(){if(this.cache&&this.cache.bounds)return this.cache.bounds;const t=lae(this.projectionScale.geoPath.bounds(this.feature),this.options.borderWidth/2),n={x:t[0][0],x2:t[1][0],y:t[0][1],y2:t[1][1],width:t[1][0]-t[0][0],height:t[1][1]-t[0][1]};return this.cache={...this.cache||{},bounds:n},n}_drawInCache(t){const n=this.getBounds();if(!Number.isFinite(n.x))return;const r=this.cache&&this.cache.canvas?this.cache.canvas:t.createElement("canvas"),o=Math.floor(n.x),i=Math.floor(n.y),a=Math.ceil(n.x+n.width),s=Math.ceil(n.y+n.height),l=this.pixelRatio||1,c=Math.ceil(Math.max(a-o,1)*l),u=Math.ceil(Math.max(s-i,1)*l);if(c<=0||u<=0)return;r.width=c,r.height=u;const d=r.getContext("2d");d&&(d.clearRect(0,0,r.width,r.height),d.save(),d.scale(l,l),d.translate(-o,-i),this._drawImpl(d),d.restore(),this.cache={...this.cache||{},canvas:r,canvasKey:this._optionsToKey()})}_optionsToKey(){const{options:t}=this;return`${t.backgroundColor};${t.borderColor};${t.borderWidth};${this.pixelRatio}`}_drawImpl(t){const{feature:n}=this,{options:r}=this;t.beginPath(),this.projectionScale.geoPath.context(t)(n),r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fill()),r.borderColor&&(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.stroke())}draw(t){const{feature:n}=this;if(!n)return;(!this.cache||this.cache.canvasKey!==this._optionsToKey())&&t.canvas.ownerDocument!=null&&this._drawInCache(t.canvas.ownerDocument);const r=this.getBounds();if(this.cache&&this.cache.canvas&&this.cache.canvas.width>0&&this.cache.canvas.height>0){const o=Math.floor(r.x),i=Math.floor(r.y),a=Math.ceil(r.x+r.width),s=Math.ceil(r.y+r.height),l=a-o,c=s-i;l>0&&c>0&&t.drawImage(this.cache.canvas,o,i,a-o,s-i)}else Number.isFinite(r.x)&&(t.save(),this._drawImpl(t),t.restore())}}La.id="geoFeature";La.defaults={...Kl.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};La.defaultRoutes={outlineBorderColor:"borderColor",...Kl.defaultRoutes||{}};const E7={showOutline:!1,showGraticule:!1,clipMap:!0},R7={scales:{projection:{axis:"x",type:wc.id,position:"chartArea",display:!1}}};function RT(e){const t={...e};return Object.keys(e).forEach(n=>{let r=n;if(n.startsWith("outline")){const o=n.slice(7);r=o[0].toLowerCase()+o.slice(1)}else if(n.startsWith("hoverOutline"))r=`hover${n.slice(12)}`;else return;delete t[n],t[r]=e[n]}),t}class P7 extends Xo{getGeoDataset(){return super.getDataset()}getGeoOptions(){return this.chart.options}getProjectionScale(){return this.getScaleForId("projection")}linkScales(){const t=this.getGeoDataset(),n=this.getMeta();n.xAxisID="projection",t.xAxisID="projection",n.yAxisID="projection",t.yAxisID="projection",n.xScale=this.getScaleForId("projection"),n.yScale=this.getScaleForId("projection"),this.getProjectionScale().computeBounds(this.resolveOutline())}showOutline(){return st(this.getGeoDataset().showOutline,this.getGeoOptions().showOutline)}clipMap(){return st(this.getGeoDataset().clipMap,this.getGeoOptions().clipMap)}getGraticule(){return st(this.getGeoDataset().showGraticule,this.getGeoOptions().showGraticule)}update(t){super.update(t);const n=this.getMeta(),r=this.getProjectionScale(),o=r.updateBounds();if(this.showOutline()){const i=n.dataset;if(o&&delete i.cache,i.projectionScale=r,i.pixelRatio=this.chart.currentDevicePixelRatio,t!=="resize"){const a=RT(this.resolveDatasetElementOptions(t)),s={feature:this.resolveOutline(),options:a};this.updateElement(i,void 0,s,t),this.getGraticule()&&(n.graticule=a)}}else this.getGraticule()&&t!=="resize"&&(n.graticule=RT(this.resolveDatasetElementOptions(t)));this.updateElements(n.data,0,n.data.length,t),o&&n.data.forEach(i=>delete i.cache)}resolveOutline(){const n=this.getGeoDataset().outline||{type:"Sphere"};return Array.isArray(n)?{type:"FeatureCollection",features:n}:n}showGraticule(){const t=this.getGraticule(),n=this.getMeta().graticule;if(!t||!n)return;const{ctx:r}=this.chart,i=this.getProjectionScale().geoPath.context(r);if(r.save(),r.beginPath(),typeof t=="boolean")t&&i(Lre());else{const a=V3();t.stepMajor&&a.stepMajor(t.stepMajor),t.stepMinor&&a.stepMinor(t.stepMinor),i(a())}r.strokeStyle=n.graticuleBorderColor,r.lineWidth=n.graticuleBorderWidth,r.stroke(),r.restore()}draw(){const{chart:t}=this,n=this.clipMap();let r=!1;(n===!0||n==="outline"||n==="outline+graticule")&&(r=!0,Wl(t.ctx,t.chartArea)),this.showOutline()&&this.getMeta().dataset&&this.getMeta().dataset.draw.call(this.getMeta().dataset,t.ctx,t.chartArea),n===!0||n==="graticule"||n==="outline+graticule"?r||Wl(t.ctx,t.chartArea):r&&(r=!1,Ul(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||Wl(t.ctx,t.chartArea):r&&(r=!1,Ul(t.ctx)),this.getMeta().data.forEach(o=>o.draw.call(o,t.ctx,t.chartArea)),r&&(r=!1,Ul(t.ctx))}}function $7(e,t,n,r=[],o=[]){Nr.addControllers(n),Array.isArray(r)?Nr.addElements(...r):Nr.addElements(r),Array.isArray(o)?Nr.addScales(...o):Nr.addScales(o);const i=t;return i.type=e,i}class yd extends P7{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="color",n.rAxisID="color",t.vAxisID="color",t.rAxisID="color",n.rScale=this.getScaleForId("color"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,{data:o}=this.getDataset(),i=this._cachedMeta;for(let a=t;a<t+n;a+=1)i._parsed[a]={[r.axis]:r.parse(o[a],a)}}updateElements(t,n,r,o){const i=this.resolveDataElementOptions(n,o),a=this.getSharedOptions(i),s=this.includeOptions(o,a),l=this.getProjectionScale();this.updateSharedOptions(a,o,i);for(let c=n;c<n+r;c+=1){const u=t[c];u.projectionScale=l,u.feature=this._data[c].feature,u.center=this._data[c].center,u.pixelRatio=this.chart.currentDevicePixelRatio;const d=u.getCenterPoint(),h={x:d.x,y:d.y};s&&(h.options=a||this.resolveDataElementOptions(c,o)),this.updateElement(u,c,h,o)}}indexToColor(t){const n=this.getMeta().rScale;return n.getColorForValue(this.getParsed(t)[n.axis])}}yd.id="choropleth";yd.defaults=or({},[E7,{datasetElementType:La.id,dataElementType:La.id}]);yd.overrides=or({},[R7,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}},colors:{enabled:!1}},scales:{color:{type:Vs.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class cae extends Dn{constructor(t,n){super(t,$7("choropleth",n,yd,La,[Vs,wc]))}}cae.id=yd.id;class xd extends P7{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="size",n.rAxisID="size",t.vAxisID="size",t.rAxisID="size",n.rScale=this.getScaleForId("size"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,o=this.getDataset().data,i=this._cachedMeta;for(let a=t;a<t+n;a+=1){const s=o[a];i._parsed[a]={x:s.longitude==null?s.x:s.longitude,y:s.latitude==null?s.y:s.latitude,[r.axis]:r.parse(s,a)}}}updateElements(t,n,r,o){const i=o==="reset",a=this.resolveDataElementOptions(n,o),s=this.getSharedOptions(a),l=this.includeOptions(o,s),c=this.getProjectionScale();this.getMeta().rScale._model=a,this.updateSharedOptions(s,o,a);for(let u=n;u<n+r;u+=1){const d=t[u],h=this.getParsed(u),p=c.projection([h.x,h.y]),v={x:p?p[0]:0,y:p?p[1]:0,skip:Number.isNaN(h.x)||Number.isNaN(h.y)};l&&(v.options=s||this.resolveDataElementOptions(u,o),i&&(v.options.radius=0)),this.updateElement(d,u,v,o)}}indexToRadius(t){const n=this.getMeta().rScale;return n.getSizeForValue(this.getParsed(t)[n.axis])}}xd.id="bubbleMap";xd.defaults=or({},[E7,{dataElementType:Yl.id,datasetElementType:La.id,showOutline:!0,clipMap:"outline+graticule"}]);xd.overrides=or({},[R7,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}}},scales:{size:{axis:"x",type:Hs.id}},elements:{point:{radius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)},hoverRadius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)+1}}}}]);class uae extends Dn{constructor(t,n){super(t,$7("bubbleMap",n,xd,La,[Hs,wc]))}}uae.id=xd.id;function dae(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function fae(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function hae(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function pae(e,t=!1){var r;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}}}function gae(e,t){var r,o,i,a,s;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(o=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:o.x,display:!0,stacked:!0},y:{...(a=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:a.y,display:!0,stacked:t==="stackedBar"}},plugins:{...(s=e==null?void 0:e.options)==null?void 0:s.plugins,legend:{position:"bottom",align:"center"}}}}}function mae(e){var n;return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function bae(e,t){var r;return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(r=t==null?void 0:t.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function vae(e){var n;return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function JC({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:a,topoJson:s}){var l,c,u,d,h,p,v,b,x,y;if(t==="map"){if(!s)return null;const _=(l=a==null?void 0:a.mapVisualOptions)==null?void 0:l.objectKey;if(!_)return null;const S=oae(s,(c=s==null?void 0:s.objects)==null?void 0:c[_]).features;if(!S)return null;const C={plugins:{datalabels:{display:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1}},projection:{axis:"x",projection:((u=a==null?void 0:a.mapVisualOptions)==null?void 0:u.projection)||"mercator",projectionScale:((d=a==null?void 0:a.mapVisualOptions)==null?void 0:d.projectionScale)||1,projectionOffset:((h=a==null?void 0:a.mapVisualOptions)==null?void 0:h.projectionOffset)||[0,0]},color:{axis:"x",interpolate:((p=a==null?void 0:a.mapVisualOptions)==null?void 0:p.colorScale)||"blues",quantize:5,legend:{position:"bottom-right",align:"right"}}}},{keys:E}=tr(e),$=S.map(z=>{var U;const X=E==null?void 0:E[0],G=E==null?void 0:E[1],A=(U=e.find(V=>(V==null?void 0:V[X])===z.properties.NAME||(V==null?void 0:V[X])===z.properties.name))==null?void 0:U[G];return{feature:z,value:A}}),D=Cf([{label:_,data:$,borderColor:"lightgray"}],r),M={type:"choropleth",data:{labels:S.map(z=>z.properties.NAME||z.properties.name),datasets:D},options:C},{options:L}=k6({cfg:M,preferences:a,customCfg:r});return{...M,options:L}}if(t==="bar"){const _=hae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="horizontalBar"){const _=dae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="pyramid"){const _=fae(n),{dimensionKeys:S,metricKeys:C}=tr(e),E=b0({dataArray:e,groupKey:S[0],pivotKey:S[1],valueKey:C[0]}),$=fl({data:E,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a}),T="x2";return{...$,data:{...$.data,datasets:$.data.datasets.map((M,L)=>L===1?{...M,xAxisID:T}:M)},options:{...$.options,scales:{...(v=$==null?void 0:$.options)==null?void 0:v.scales,[T]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const _=gae(n,t),{dimensionKeys:S,metricKeys:C}=tr(e),E=b0({dataArray:e,groupKey:S[0],pivotKey:S[1],valueKey:C[0],sortChart:a==null?void 0:a.sortChart});return fl({data:E,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="line"){const _=mae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="range"){const _=pae(n),S=GQ(e),C=Cf(S,r),{plugins:E,options:$}=T6((a==null?void 0:a.customVisualCode)||""),T=qo((_==null?void 0:_.options)||{},(n==null?void 0:n.options)||{}),D=qo(T,(a==null?void 0:a.chartOptions)||{}),M=qo(D,(r==null?void 0:r.options)||{}),L=qo(M,$),F=M6(n,a),z=qo(L,F),X={...z,plugins:{...z==null?void 0:z.plugins,datalabels:{...(b=z==null?void 0:z.plugins)==null?void 0:b.datalabels,formatter:(K,q)=>K.map(H=>{var Y,I,te,ce;return Na({number:Number(H),decimalPlaces:((Y=a==null?void 0:a.numberAxisFormat)==null?void 0:Y.decimalPlaces)||0,useSuffix:!!((I=a==null?void 0:a.numberAxisFormat)!=null&&I.suffix),customSuffix:"",locale:((te=a==null?void 0:a.numberAxisFormat)==null?void 0:te.locale)||"",currency:((ce=a==null?void 0:a.numberAxisFormat)==null?void 0:ce.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:G}=tr(e),A=G[0];return{type:"bar",data:{labels:[...new Set(jw(e,A))],datasets:C},options:X,plugins:[...E]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const _=bae(t,n),{dimensionKeys:S,metricKeys:C}=tr(e),E=YQ(C,e),$=Cf(E,r),T=S[0],D=jw(e,T),M=qo((_==null?void 0:_.options)||{},(r==null?void 0:r.options)||{}),L=qo(M,(a==null?void 0:a.chartOptions)||{}),F={...L,plugins:{...L.plugins,datalabels:{...(x=L.plugins)==null?void 0:x.datalabels,formatter:(G,A)=>{var U,V,K,q;return Na({number:Number(G),decimalPlaces:((U=a==null?void 0:a.numberAxisFormat)==null?void 0:U.decimalPlaces)||0,useSuffix:!!((V=a==null?void 0:a.numberAxisFormat)!=null&&V.suffix),customSuffix:"",locale:((K=a==null?void 0:a.numberAxisFormat)==null?void 0:K.locale)||"",currency:((q=a==null?void 0:a.numberAxisFormat)==null?void 0:q.currency)||""})}},tooltip:{...(y=L.plugins)==null?void 0:y.tooltip,callbacks:{label:function(G){let A=G.dataset.label||"";A&&(A+=": ");const V=G.dataset.data.reduce((O,H)=>O+H,0),q=(G.parsed/V*100).toFixed(2);return A+=q+"%",A+` (${G.formattedValue})`}}}}};return{type:t,data:{labels:D,datasets:$},options:F,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(G,A,U){var ce,de,he,ie;const{ctx:V,data:K}=G;V.save();const q=G.getDatasetMeta(0).data[0].x,O=G.getDatasetMeta(0).data[0].y,H=qu(oh()),Y=window.getComputedStyle(V.canvas).fontFamily;V.font=`1em ${Y}`,V.fontWeight="bolder",V.fillStyle=H,V.textAlign="center",V.textBaseline="middle";const I=K.datasets[0].data.reduce((re,le)=>re+le,0),te=Na({number:Number(I),decimalPlaces:((ce=a==null?void 0:a.numberAxisFormat)==null?void 0:ce.decimalPlaces)||0,useSuffix:!!((de=a==null?void 0:a.numberAxisFormat)!=null&&de.suffix),customSuffix:"",locale:((he=a==null?void 0:a.numberAxisFormat)==null?void 0:he.locale)||"",currency:((ie=a==null?void 0:a.numberAxisFormat)==null?void 0:ie.currency)||""});V.fillText(te,q,O)}}:""]}}if(t==="radar"){const _=vae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="bubble"||t==="scatter"){const{metricKeys:_}=tr(e);if(_.length<3){console.log("Bubble charts require 3 numeric columns");return}const S=qQ(e),C=Cf(S,r),E={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:_[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:_[1]},beginAtZero:!0,ticks:{precision:0}}}},$=qo(E,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:C},options:$}}return fl({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}function yae({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const a=we.getState().theme;if(!o)return;const s=a==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&wae(e,t,o,i,s),["pie","doughnut","polarArea"].includes(r)&&_ae(e,t,o,i,s),["stackedBar","pyramid"].includes(r)&&xae({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:s})}function xae(e){var s,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:a}=e;i?(l=(s=t==null?void 0:t.data)==null?void 0:s.datasets)==null||l.forEach((d,h)=>{var p,v;typeof d.backgroundColor=="string"&&(d.backgroundColor=new Array(d.data.length).fill(d.backgroundColor),d.borderColor=new Array(d.data.length).fill(d.borderColor)),d.backgroundColor=(p=d==null?void 0:d.backgroundColor)==null?void 0:p.map((b,x)=>x===n&&h===r?b:a),d.borderColor=(v=d==null?void 0:d.borderColor)==null?void 0:v.map((b,x)=>x===n&&h===r?b:a)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((d,h)=>{var p,v,b,x,y,_;d.backgroundColor=new Array(d.data.length).fill((b=(v=(p=o==null?void 0:o.data)==null?void 0:p.datasets)==null?void 0:v[h])==null?void 0:b.backgroundColor),d.borderColor=new Array(d.data.length).fill((_=(y=(x=o==null?void 0:o.data)==null?void 0:x.datasets)==null?void 0:y[h])==null?void 0:_.borderColor)}),t==null||t.update()}function wae(e,t,n,r,o){var i,a,s,l;r?(a=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||a.forEach(c=>{var u,d;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,p)=>p===t?h:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((h,p)=>p===t?h:o)}):(l=(s=e==null?void 0:e.data)==null?void 0:s.datasets)==null||l.forEach((c,u)=>{var d,h,p,v,b,x;c.backgroundColor=new Array(c.data.length).fill((p=(h=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:h[u])==null?void 0:p.backgroundColor),c.borderColor=new Array(c.data.length).fill((x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor)}),e==null||e.update()}function _ae(e,t,n,r,o){var i,a,s,l;r?(a=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||a.forEach(c=>{var u,d;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,p)=>p===t?h:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((h,p)=>p===t?h:o)}):(l=(s=e==null?void 0:e.data)==null?void 0:s.datasets)==null||l.forEach((c,u)=>{var d,h,p,v,b,x,y,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(p=(h=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:h[u])==null?void 0:p.backgroundColor,c.borderColor=(x=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:x.borderColor),c.backgroundColor=(y=c==null?void 0:c.backgroundColor)==null?void 0:y.map((S,C)=>{var E;return(E=n.data.datasets[u].backgroundColor)==null?void 0:E[C]}),c.borderColor=(_=c==null?void 0:c.borderColor)==null?void 0:_.map((S,C)=>{var E;return(E=n.data.datasets[u].borderColor)==null?void 0:E[C]})}),e==null||e.update()}function Sae({card:e,data:t,datasetIndex:n,clickIndex:r,value:o}){var i,a,s,l,c,u;try{if(!t)return;const{keys:d,dimensionKeys:h,metricKeys:p}=tr(t);if(e.type==="map"){const v=d[0],b=((a=(i=o==null?void 0:o.feature)==null?void 0:i.properties)==null?void 0:a.name)||((l=(s=o==null?void 0:o.feature)==null?void 0:s.properties)==null?void 0:l.NAME);return[{columnName:v,columnValue:b}]}if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const v=h[0],b=(c=t[r])==null?void 0:c[v];return[{columnName:v,columnValue:b,metric:p[n],value:o}]}if(["stackedBar","pyramid"].includes(e.type)){const v=b0({dataArray:t,groupKey:h[0],pivotKey:h[1],valueKey:p[0]}),b=h[0],x=(u=v[r])==null?void 0:u[b],y=h[1],{metricKeys:_}=tr(v),S=_[n];return[{columnName:b,columnValue:x,metric:p[0],value:o},{columnName:y,columnValue:S,metric:p[0],value:o}]}if(e.type==="bubble"||e.type==="scatter"){const v=h[0],b=o.label;return[{columnName:v,columnValue:b,metric1:p[0],value1:o.x,metric2:p[1],value2:o.y,metric3:p==null?void 0:p[2],value3:o==null?void 0:o.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function O7(e){var s,l,c,u,d,h;const t=(((l=(s=e.preferences)==null?void 0:s.mapVisualOptions)==null?void 0:l.topoJsonUrl)==="custom"?(u=(c=e.preferences)==null?void 0:c.mapVisualOptions)==null?void 0:u.customTopoJsonUrl:(h=(d=e.preferences)==null?void 0:d.mapVisualOptions)==null?void 0:h.topoJsonUrl)||"",n=!!t&&e.type==="map",{data:r,isLoading:o,isFetching:i,isError:a}=ap({queryKey:["topojson",t],queryFn:()=>fetch(t).then(p=>p.json()),enabled:n,staleTime:1/0});return{data:r,isLoading:o,isFetching:i,isError:a}}function Cae(e){var a,s;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=dr(),r=n(e),o=ZC(r||t),i={...r,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[]};return{...o,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[],card:i}}function ZC(e){var X,G,A,U;const{onChartElementClicked:t}=_i(),[n,r]=m.useState(0);((X=e==null?void 0:e.preferences)==null?void 0:X.filterOnClickColumnIndex)===void 0||(G=e.preferences)==null||G.filterOnClickColumnIndex;const o=we(V=>V.isVisualEditing),i=we(V=>V.filteringCards),a=we(V=>V.selectedSheetId),s=we(V=>V.selectedLensId);we(V=>V.selectedCardId),we(V=>V.dashboard),we(V=>V.isDashboardEditing),we(V=>V.themeStyle);const l=we(V=>V.filterValues),c=m.useRef(l),u=(A=e==null?void 0:e.preferences)==null?void 0:A.onClickFilter,{addFilteringCard:d,getCardFrame:h,addOrUpdateFilterValues:p,removeFilterValue:v,removeFilteringCard:b}=dr(),{data:x,isLoading:y,isFetching:_,isError:S,queryKey:C}=Bb(e),{data:E}=O7(e),$=i==null?void 0:i.find(V=>V.id===e.id),T=h(e.id),D=(T==null?void 0:T.cards)||[],M=(D==null?void 0:D.length)==1;let L;x&&x.records&&((U=x.records)==null?void 0:U.length)>0&&e.type!=="custom"&&(L=JC({data:x==null?void 0:x.records,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences,topoJson:E}));const F=m.useRef({filteringCards:i});m.useEffect(()=>{!(x!=null&&x.records)||y||_||$&&M||o||r(V=>V+1)},[x==null?void 0:x.records,y,_,$,M,o]),m.useEffect(()=>{e.connectionId&&!$&&(c.current=l)},[l,s,e.connectionId,$]),m.useEffect(()=>{var K;$&&(F.current.filteringCards=[...i||[]]),!$&&((K=F.current.filteringCards)==null?void 0:K.find(q=>q.id===e.id))&&M&&r(q=>q+1)},[$,M,e.id,i]);function z(V,K,q,O){var I;let H=!1;if(!(x!=null&&x.records))return;const Y=Sae({card:e,data:x==null?void 0:x.records,datasetIndex:K,clickIndex:q,value:O});if(console.log("fieldValues",Y),t==null||t(e,Y),!!(((I=e==null?void 0:e.preferences)==null?void 0:I.onClickFilter)??[]).length){if($){const te=e.id;v(te),b(e)}else{if(H=!0,!Y)return;const te=[];Y.forEach((ce,de)=>{const he=u==null?void 0:u.find(re=>re.columnIndex===de);if(!he)return;const ie={filterId:e.id+"-"+ce.columnName+"-"+a,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:ce.columnName,expression:he.expression,valueType:vb(Y[he.columnIndex].columnValue),operation:"=",values:[Y[he.columnIndex].columnValue]};te.push(ie)}),p(te),d(e)}yae({chart:V,elementIndex:q,datasetIndex:K,cardType:e.type,cfg:L,apply:H})}}return{isError:S,isLoading:y,isFetching:_,data:x,visualKey:n,handleDatapointClick:z,cfg:L}}function qi({children:e,containerClassName:t,className:n,text:r,onSave:o,type:i="input"}){const[a,s]=m.useState(!1),[l,c]=m.useState(r),u=we(p=>p.isDashboardEditing),d=p=>{p.stopPropagation(),u&&s(!0)};function h(){return i==="textarea"?R.jsx("textarea",{className:ye("grow rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:p=>c(p.target.value),value:l,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{p.stopPropagation(),!(p.key==="Enter"&&p.shiftKey)&&(p.key==="Enter"||p.key==="Tab")&&(s(!1),o(l))}}):R.jsx("input",{onMouseDown:p=>p.stopPropagation(),type:"text",className:ye("rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:p=>c(p.target.value),value:l,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{p.stopPropagation(),(p.key==="Enter"||p.key==="Tab")&&(s(!1),o(l))}})}return R.jsx("div",{className:ye("flex",t),role:"editable",onDoubleClick:d,children:a?h():e})}function T7({card:e,data:t}){var x,y,_,S,C,E,$,T,D,M,L,F,z,X,G,A,U,V,K,q,O,H,Y,I;const n=we(te=>te.actions.setCardTitle),r=we(te=>te.actions.setCardDescription),o=we(te=>te.isVisualEditing),i=Ir(te=>te.card),a=Ir(te=>te.actions.setCard);Ir(te=>te.actions.setNumberFormat);const s=we(te=>te.selectedSheetId),l=(y=(x=e.preferences)==null?void 0:x.formatNumber)==null?void 0:y.colorRanges,{metricKeys:c}=tr(t),u=(_=t==null?void 0:t[0])==null?void 0:_[c==null?void 0:c[0]],d=(S=t==null?void 0:t[0])==null?void 0:S[c==null?void 0:c[1]],h=t&&t.length>0;function p(te){o?a({...i,title:te}):n(s,e.id,te)}function v(te){o?a({...i,description:te}):r(s,e.id,te)}const b=d&&d-u!==0?(u-d)/d:null;return R.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[R.jsxs(xb,{className:"grow pb-3",children:[R.jsx(qi,{text:o?i.title:e.title,onSave:p,children:R.jsx("div",{className:"flex items-center gap-2",children:R.jsx(pd,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),h&&R.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[R.jsx("p",{style:{color:xC(u,l)},className:"text-3xl font-semibold",children:Na({number:u,decimalPlaces:((E=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:E.decimalPlaces)||0,useSuffix:!!((T=($=e.preferences)==null?void 0:$.formatNumber)!=null&&T.suffix),customSuffix:((M=(D=e.preferences)==null?void 0:D.formatNumber)==null?void 0:M.suffix)||"",locale:((F=(L=e.preferences)==null?void 0:L.formatNumber)==null?void 0:F.locale)||"",currency:((X=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:X.currency)||""})}),d&&R.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",Na({number:d,decimalPlaces:((A=(G=e.preferences)==null?void 0:G.formatNumber)==null?void 0:A.decimalPlaces)||0,useSuffix:!!((V=(U=e.preferences)==null?void 0:U.formatNumber)!=null&&V.suffix),customSuffix:((q=(K=e.preferences)==null?void 0:K.formatNumber)==null?void 0:q.suffix)||"",locale:((H=(O=e.preferences)==null?void 0:O.formatNumber)==null?void 0:H.locale)||"",currency:((I=(Y=e.preferences)==null?void 0:Y.formatNumber)==null?void 0:I.currency)||""})]})]})]}),b&&R.jsxs(wb,{className:"grow items-start gap-1 pb-4 text-sm",children:[R.jsx(D7,{children:b}),R.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[b>0?"up ":"down ",R.jsx(qi,{text:e.description||"",onSave:v,children:e.description})]})]})]})}function D7({children:e,className:t}){var i,a;const n=we(s=>s.themeStyle),r=e>0?R.jsx("span",{children:"+"}):R.jsx("span",{children:"-"}),o=`${Math.abs(e*100).toFixed(0)}%`;return R.jsxs("div",{style:{borderRadius:(a=(i=n==null?void 0:n.chart)==null?void 0:i.options)==null?void 0:a.borderRadius},className:ye("flex items-center px-1 text-sm font-semibold",{"bg-green-600/10 text-green-600":e>0,"bg-destructive/10 text-destructive":e<0},t),children:[r,R.jsx("span",{className:"ml-[1px]",children:o})]})}const Eae=["top","right","bottom","left"],Ws=Math.min,_o=Math.max,H0=Math.round,sm=Math.floor,Us=e=>({x:e,y:e}),Rae={left:"right",right:"left",bottom:"top",top:"bottom"},Pae={start:"end",end:"start"};function v_(e,t,n){return _o(e,Ws(t,n))}function Fa(e,t){return typeof e=="function"?e(t):e}function ja(e){return e.split("-")[0]}function wd(e){return e.split("-")[1]}function eE(e){return e==="x"?"y":"x"}function tE(e){return e==="y"?"height":"width"}function _d(e){return["top","bottom"].includes(ja(e))?"y":"x"}function nE(e){return eE(_d(e))}function $ae(e,t,n){n===void 0&&(n=!1);const r=wd(e),o=nE(e),i=tE(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=W0(a)),[a,W0(a)]}function Oae(e){const t=W0(e);return[y_(e),t,y_(t)]}function y_(e){return e.replace(/start|end/g,t=>Pae[t])}function Tae(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function Dae(e,t,n,r){const o=wd(e);let i=Tae(ja(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(y_)))),i}function W0(e){return e.replace(/left|right|bottom|top/g,t=>Rae[t])}function Aae(e){return{top:0,right:0,bottom:0,left:0,...e}}function A7(e){return typeof e!="number"?Aae(e):{top:e,right:e,bottom:e,left:e}}function U0(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function PT(e,t,n){let{reference:r,floating:o}=e;const i=_d(t),a=nE(t),s=tE(a),l=ja(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(wd(t)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1);break}return p}const Mae=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=PT(c,r,l),h=r,p={},v=0;for(let b=0;b<s.length;b++){const{name:x,fn:y}=s[b],{x:_,y:S,data:C,reset:E}=await y({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});if(u=_??u,d=S??d,p={...p,[x]:{...p[x],...C}},E&&v<=50){v++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:d}=PT(c,h,l)),b=-1;continue}}return{x:u,y:d,placement:h,strategy:o,middlewareData:p}};async function bh(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=Fa(t,e),v=A7(p),x=s[h?d==="floating"?"reference":"floating":d],y=U0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{...a.floating,x:r,y:o}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),C=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=U0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(y.top-E.top+v.top)/C.y,bottom:(E.bottom-y.bottom+v.bottom)/C.y,left:(y.left-E.left+v.left)/C.x,right:(E.right-y.right+v.right)/C.x}}const $T=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Fa(e,t)||{};if(c==null)return{};const d=A7(u),h={x:n,y:r},p=nE(o),v=tE(p),b=await a.getDimensions(c),x=p==="y",y=x?"top":"left",_=x?"bottom":"right",S=x?"clientHeight":"clientWidth",C=i.reference[v]+i.reference[p]-h[p]-i.floating[v],E=h[p]-i.reference[p],$=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let T=$?$[S]:0;(!T||!await(a.isElement==null?void 0:a.isElement($)))&&(T=s.floating[S]||i.floating[v]);const D=C/2-E/2,M=T/2-b[v]/2-1,L=Ws(d[y],M),F=Ws(d[_],M),z=L,X=T-b[v]-F,G=T/2-b[v]/2+D,A=v_(z,G,X),U=!l.arrow&&wd(o)!=null&&G!=A&&i.reference[v]/2-(G<z?L:F)-b[v]/2<0,V=U?G<z?G-z:G-X:0;return{[p]:h[p]+V,data:{[p]:A,centerOffset:G-A-V,...U&&{alignmentOffset:V}},reset:U}}}),kae=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...x}=Fa(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=ja(o),_=ja(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=h||(_||!b?[W0(s)]:Oae(s));!h&&v!=="none"&&C.push(...Dae(s,b,v,S));const E=[s,...C],$=await bh(t,x),T=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&T.push($[y]),d){const z=$ae(o,a,S);T.push($[z[0]],$[z[1]])}if(D=[...D,{placement:o,overflows:T}],!T.every(z=>z<=0)){var M,L;const z=(((M=i.flip)==null?void 0:M.index)||0)+1,X=E[z];if(X)return{data:{index:z,overflows:D},reset:{placement:X}};let G=(L=D.filter(A=>A.overflows[0]<=0).sort((A,U)=>A.overflows[1]-U.overflows[1])[0])==null?void 0:L.placement;if(!G)switch(p){case"bestFit":{var F;const A=(F=D.map(U=>[U.placement,U.overflows.filter(V=>V>0).reduce((V,K)=>V+K,0)]).sort((U,V)=>U[1]-V[1])[0])==null?void 0:F[0];A&&(G=A);break}case"initialPlacement":G=s;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function OT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function TT(e){return Eae.some(t=>e[t]>=0)}const Iae=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Fa(e,t);switch(r){case"referenceHidden":{const i=await bh(t,{...o,elementContext:"reference"}),a=OT(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:TT(a)}}}case"escaped":{const i=await bh(t,{...o,altBoundary:!0}),a=OT(i,n.floating);return{data:{escapedOffsets:a,escaped:TT(a)}}}default:return{}}}}};async function Nae(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=ja(n),s=wd(n),l=_d(n)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=Fa(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof v=="number"&&(p=s==="end"?v*-1:v),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}const Lae=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await Nae(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Fae=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:x=>{let{x:y,y:_}=x;return{x:y,y:_}}},...l}=Fa(e,t),c={x:n,y:r},u=await bh(t,l),d=_d(ja(o)),h=eE(d);let p=c[h],v=c[d];if(i){const x=h==="y"?"top":"left",y=h==="y"?"bottom":"right",_=p+u[x],S=p-u[y];p=v_(_,p,S)}if(a){const x=d==="y"?"top":"left",y=d==="y"?"bottom":"right",_=v+u[x],S=v-u[y];v=v_(_,v,S)}const b=s.fn({...t,[h]:p,[d]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},jae=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Fa(e,t),u={x:n,y:r},d=_d(o),h=eE(d);let p=u[h],v=u[d];const b=Fa(s,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const S=h==="y"?"height":"width",C=i.reference[h]-i.floating[S]+x.mainAxis,E=i.reference[h]+i.reference[S]-x.mainAxis;p<C?p=C:p>E&&(p=E)}if(c){var y,_;const S=h==="y"?"width":"height",C=["top","left"].includes(ja(o)),E=i.reference[d]-i.floating[S]+(C&&((y=a.offset)==null?void 0:y[d])||0)+(C?0:x.crossAxis),$=i.reference[d]+i.reference[S]+(C?0:((_=a.offset)==null?void 0:_[d])||0)-(C?x.crossAxis:0);v<E?v=E:v>$&&(v=$)}return{[h]:p,[d]:v}}}},zae=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:a=()=>{},...s}=Fa(e,t),l=await bh(t,s),c=ja(n),u=wd(n),d=_d(n)==="y",{width:h,height:p}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(b=c,v=u==="end"?"top":"bottom");const x=p-l[v],y=h-l[b],_=!t.middlewareData.shift;let S=x,C=y;if(d){const $=h-l.left-l.right;C=u||_?Ws(y,$):$}else{const $=p-l.top-l.bottom;S=u||_?Ws(x,$):$}if(_&&!u){const $=_o(l.left,0),T=_o(l.right,0),D=_o(l.top,0),M=_o(l.bottom,0);d?C=h-2*($!==0||T!==0?$+T:_o(l.left,l.right)):S=p-2*(D!==0||M!==0?D+M:_o(l.top,l.bottom))}await a({...t,availableWidth:C,availableHeight:S});const E=await o.getDimensions(i.floating);return h!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function qs(e){return M7(e)?(e.nodeName||"").toLowerCase():"#document"}function Ro(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ha(e){var t;return(t=(M7(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function M7(e){return e instanceof Node||e instanceof Ro(e).Node}function za(e){return e instanceof Element||e instanceof Ro(e).Element}function Qi(e){return e instanceof HTMLElement||e instanceof Ro(e).HTMLElement}function DT(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ro(e).ShadowRoot}function gp(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Jo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Bae(e){return["table","td","th"].includes(qs(e))}function rE(e){const t=oE(),n=Jo(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 Vae(e){let t=ad(e);for(;Qi(t)&&!Xb(t);){if(rE(t))return t;t=ad(t)}return null}function oE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Xb(e){return["html","body","#document"].includes(qs(e))}function Jo(e){return Ro(e).getComputedStyle(e)}function Qb(e){return za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ad(e){if(qs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||DT(e)&&e.host||Ha(e);return DT(t)?t.host:t}function k7(e){const t=ad(e);return Xb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qi(t)&&gp(t)?t:k7(t)}function vh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=k7(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Ro(o);return i?t.concat(a,a.visualViewport||[],gp(o)?o:[],a.frameElement&&n?vh(a.frameElement):[]):t.concat(o,vh(o,[],n))}function I7(e){const t=Jo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Qi(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=H0(n)!==i||H0(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function iE(e){return za(e)?e:e.contextElement}function Cu(e){const t=iE(e);if(!Qi(t))return Us(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=I7(t);let a=(i?H0(n.width):n.width)/r,s=(i?H0(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Hae=Us(0);function N7(e){const t=Ro(e);return!oE()||!t.visualViewport?Hae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wae(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ro(e)?!1:t}function uc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=iE(e);let a=Us(1);t&&(r?za(r)&&(a=Cu(r)):a=Cu(e));const s=Wae(i,n,r)?N7(i):Us(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const h=Ro(i),p=r&&za(r)?Ro(r):r;let v=h.frameElement;for(;v&&r&&p!==h;){const b=Cu(v),x=v.getBoundingClientRect(),y=Jo(v),_=x.left+(v.clientLeft+parseFloat(y.paddingLeft))*b.x,S=x.top+(v.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=_,c+=S,v=Ro(v).frameElement}}return U0({width:u,height:d,x:l,y:c})}function Uae(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Qi(n),i=Ha(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},s=Us(1);const l=Us(0);if((o||!o&&r!=="fixed")&&((qs(n)!=="body"||gp(i))&&(a=Qb(n)),Qi(n))){const c=uc(n);s=Cu(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}}function qae(e){return Array.from(e.getClientRects())}function L7(e){return uc(Ha(e)).left+Qb(e).scrollLeft}function Gae(e){const t=Ha(e),n=Qb(e),r=e.ownerDocument.body,o=_o(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=_o(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+L7(e);const s=-n.scrollTop;return Jo(r).direction==="rtl"&&(a+=_o(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function Yae(e,t){const n=Ro(e),r=Ha(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const c=oE();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function Kae(e,t){const n=uc(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Qi(e)?Cu(e):Us(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:a,height:s,x:l,y:c}}function AT(e,t,n){let r;if(t==="viewport")r=Yae(e,n);else if(t==="document")r=Gae(Ha(e));else if(za(t))r=Kae(t,n);else{const o=N7(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return U0(r)}function F7(e,t){const n=ad(e);return n===t||!za(n)||Xb(n)?!1:Jo(n).position==="fixed"||F7(n,t)}function Xae(e,t){const n=t.get(e);if(n)return n;let r=vh(e,[],!1).filter(s=>za(s)&&qs(s)!=="body"),o=null;const i=Jo(e).position==="fixed";let a=i?ad(e):e;for(;za(a)&&!Xb(a);){const s=Jo(a),l=rE(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||gp(a)&&!l&&F7(e,a))?r=r.filter(u=>u!==a):o=s,a=ad(a)}return t.set(e,r),r}function Qae(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Xae(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=AT(t,u,o);return c.top=_o(d.top,c.top),c.right=Ws(d.right,c.right),c.bottom=Ws(d.bottom,c.bottom),c.left=_o(d.left,c.left),c},AT(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Jae(e){return I7(e)}function Zae(e,t,n){const r=Qi(t),o=Ha(t),i=n==="fixed",a=uc(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Us(0);if(r||!r&&!i)if((qs(t)!=="body"||gp(o))&&(s=Qb(t)),r){const c=uc(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=L7(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function MT(e,t){return!Qi(e)||Jo(e).position==="fixed"?null:t?t(e):e.offsetParent}function j7(e,t){const n=Ro(e);if(!Qi(e))return n;let r=MT(e,t);for(;r&&Bae(r)&&Jo(r).position==="static";)r=MT(r,t);return r&&(qs(r)==="html"||qs(r)==="body"&&Jo(r).position==="static"&&!rE(r))?n:r||Vae(e)||n}const ese=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||j7,i=this.getDimensions;return{reference:Zae(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function tse(e){return Jo(e).direction==="rtl"}const nse={convertOffsetParentRelativeRectToViewportRelativeRect:Uae,getDocumentElement:Ha,getClippingRect:Qae,getOffsetParent:j7,getElementRects:ese,getClientRects:qae,getDimensions:Jae,getScale:Cu,isElement:za,isRTL:tse};function rse(e,t){let n=null,r;const o=Ha(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(s||t(),!d||!h)return;const p=sm(u),v=sm(o.clientWidth-(c+d)),b=sm(o.clientHeight-(u+h)),x=sm(c),_={rootMargin:-p+"px "+-v+"px "+-b+"px "+-x+"px",threshold:_o(0,Ws(1,l))||1};let S=!0;function C(E){const $=E[0].intersectionRatio;if($!==l){if(!S)return a();$?a(!1,$):r=setTimeout(()=>{a(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(C,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return a(!0),i}function ose(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=iE(e),u=o||i?[...c?vh(c):[],...vh(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=c&&s?rse(c,n):null;let h=-1,p=null;a&&(p=new ResizeObserver(y=>{let[_]=y;_&&_.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let v,b=l?uc(e):null;l&&x();function x(){const y=uc(e);b&&(y.x!==b.x||y.y!==b.y||y.width!==b.width||y.height!==b.height)&&n(),b=y,v=requestAnimationFrame(x)}return n(),()=>{u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d&&d(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const ise=(e,t,n)=>{const r=new Map,o={platform:nse,...n},i={...o.platform,_c:r};return Mae(e,t,{...o,platform:i})},ase=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?$T({element:r.current,padding:o}).fn(n):{}:r?$T({element:r,padding:o}).fn(n):{}}}};var t0=typeof document<"u"?m.useLayoutEffect:m.useEffect;function q0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!q0(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!q0(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function z7(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kT(e,t){const n=z7(e);return Math.round(t*n)/n}function IT(e){const t=j.useRef(e);return t0(()=>{t.current=e}),t}function sse(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=j.useState(r);q0(h,r)||p(r);const[v,b]=j.useState(null),[x,y]=j.useState(null),_=j.useCallback(U=>{U!=$.current&&($.current=U,b(U))},[b]),S=j.useCallback(U=>{U!==T.current&&(T.current=U,y(U))},[y]),C=i||v,E=a||x,$=j.useRef(null),T=j.useRef(null),D=j.useRef(u),M=IT(l),L=IT(o),F=j.useCallback(()=>{if(!$.current||!T.current)return;const U={placement:t,strategy:n,middleware:h};L.current&&(U.platform=L.current),ise($.current,T.current,U).then(V=>{const K={...V,isPositioned:!0};z.current&&!q0(D.current,K)&&(D.current=K,_S.flushSync(()=>{d(K)}))})},[h,t,n,L]);t0(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(U=>({...U,isPositioned:!1})))},[c]);const z=j.useRef(!1);t0(()=>(z.current=!0,()=>{z.current=!1}),[]),t0(()=>{if(C&&($.current=C),E&&(T.current=E),C&&E){if(M.current)return M.current(C,E,F);F()}},[C,E,F,M]);const X=j.useMemo(()=>({reference:$,floating:T,setReference:_,setFloating:S}),[_,S]),G=j.useMemo(()=>({reference:C,floating:E}),[C,E]),A=j.useMemo(()=>{const U={position:n,left:0,top:0};if(!G.floating)return U;const V=kT(G.floating,u.x),K=kT(G.floating,u.y);return s?{...U,transform:"translate("+V+"px, "+K+"px)",...z7(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:K}},[n,s,G.floating,u.x,u.y]);return j.useMemo(()=>({...u,update:F,refs:X,elements:G,floatingStyles:A}),[u,F,X,G,A])}function Jb(e){const[t,n]=m.useState(void 0);return Cr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const B7="Popper",[V7,oa]=hr(B7),[lse,H7]=V7(B7),cse=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(lse,{scope:t,anchor:r,onAnchorChange:o},n)},use="PopperAnchor",dse=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=H7(use,n),a=m.useRef(null),s=Rt(t,a);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:m.createElement(Qe.div,ue({},o,{ref:s}))}),W7="PopperContent",[fse,t5e]=V7(W7),hse=m.forwardRef((e,t)=>{var n,r,o,i,a,s,l,c;const{__scopePopper:u,side:d="bottom",sideOffset:h=0,align:p="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:x=!0,collisionBoundary:y=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:$,...T}=e,D=H7(W7,u),[M,L]=m.useState(null),F=Rt(t,Oe=>L(Oe)),[z,X]=m.useState(null),G=Jb(z),A=(n=G==null?void 0:G.width)!==null&&n!==void 0?n:0,U=(r=G==null?void 0:G.height)!==null&&r!==void 0?r:0,V=d+(p!=="center"?"-"+p:""),K=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},q=Array.isArray(y)?y:[y],O=q.length>0,H={padding:K,boundary:q.filter(pse),altBoundary:O},{refs:Y,floatingStyles:I,placement:te,isPositioned:ce,middlewareData:de}=sse({strategy:"fixed",placement:V,whileElementsMounted:(...Oe)=>ose(...Oe,{animationFrame:E==="always"}),elements:{reference:D.anchor},middleware:[Lae({mainAxis:h+U,alignmentAxis:v}),x&&Fae({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?jae():void 0,...H}),x&&kae({...H}),zae({...H,apply:({elements:Oe,rects:Te,availableWidth:We,availableHeight:Be})=>{const{width:Ie,height:Ke}=Te.reference,dt=Oe.floating.style;dt.setProperty("--radix-popper-available-width",`${We}px`),dt.setProperty("--radix-popper-available-height",`${Be}px`),dt.setProperty("--radix-popper-anchor-width",`${Ie}px`),dt.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),z&&ase({element:z,padding:b}),gse({arrowWidth:A,arrowHeight:U}),C&&Iae({strategy:"referenceHidden",...H})]}),[he,ie]=U7(te),re=Xn($);Cr(()=>{ce&&(re==null||re())},[ce,re]);const le=(o=de.arrow)===null||o===void 0?void 0:o.x,xe=(i=de.arrow)===null||i===void 0?void 0:i.y,Z=((a=de.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[ve,Ce]=m.useState();return Cr(()=>{M&&Ce(window.getComputedStyle(M).zIndex)},[M]),m.createElement("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:ce?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(s=de.transformOrigin)===null||s===void 0?void 0:s.x,(l=de.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(fse,{scope:u,placedSide:he,onArrowChange:X,arrowX:le,arrowY:xe,shouldHideArrow:Z},m.createElement(Qe.div,ue({"data-side":he,"data-align":ie},T,{ref:F,style:{...T.style,animation:ce?void 0:"none",opacity:(c=de.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function pse(e){return e!==null}const gse=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,d=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,h=d?0:e.arrowWidth,p=d?0:e.arrowHeight,[v,b]=U7(s),x={start:"0%",center:"50%",end:"100%"}[b],y=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+h/2,_=((i=(a=c.arrow)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0)+p/2;let S="",C="";return v==="bottom"?(S=d?x:`${y}px`,C=`${-p}px`):v==="top"?(S=d?x:`${y}px`,C=`${l.floating.height+p}px`):v==="right"?(S=`${-p}px`,C=d?x:`${_}px`):v==="left"&&(S=`${l.floating.width+p}px`,C=d?x:`${_}px`),{data:{x:S,y:C}}}});function U7(e){const[t,n="center"]=e.split("-");return[t,n]}const mp=cse,bp=dse,vp=hse,aE=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?Er.createPortal(m.createElement(Qe.div,ue({},o,{ref:t})),r):null});function mse(e,t=globalThis==null?void 0:globalThis.document){const n=Xn(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const x_="dismissableLayer.update",bse="dismissableLayer.pointerDownOutside",vse="dismissableLayer.focusOutside";let NT;const yse=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yp=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,u=m.useContext(yse),[d,h]=m.useState(null),p=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),b=Rt(t,D=>h(D)),x=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=x.indexOf(y),S=d?x.indexOf(d):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,$=xse(D=>{const M=D.target,L=[...u.branches].some(F=>F.contains(M));!E||L||(i==null||i(D),s==null||s(D),D.defaultPrevented||l==null||l())},p),T=wse(D=>{const M=D.target;[...u.branches].some(F=>F.contains(M))||(a==null||a(D),s==null||s(D),D.defaultPrevented||l==null||l())},p);return mse(D=>{S===u.layers.size-1&&(o==null||o(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},p),m.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(NT=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),LT(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=NT)}},[d,p,r,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),LT())},[d,u]),m.useEffect(()=>{const D=()=>v({});return document.addEventListener(x_,D),()=>document.removeEventListener(x_,D)},[]),m.createElement(Qe.div,ue({},c,{ref:b,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,$.onPointerDownCapture)}))});function xse(e,t=globalThis==null?void 0:globalThis.document){const n=Xn(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let c=function(){q7(bse,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function wse(e,t=globalThis==null?void 0:globalThis.document){const n=Xn(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&q7(vse,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function LT(){const e=new CustomEvent(x_);document.dispatchEvent(e)}function q7(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?fk(o,i):o.dispatchEvent(i)}let N1;const G7="HoverCard",[Y7,n5e]=hr(G7,[oa]),sE=oa(),[_se,lE]=Y7(G7),Sse=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:a=700,closeDelay:s=300}=e,l=sE(t),c=m.useRef(0),u=m.useRef(0),d=m.useRef(!1),h=m.useRef(!1),[p=!1,v]=Fr({prop:r,defaultProp:o,onChange:i}),b=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>v(!0),a)},[a,v]),x=m.useCallback(()=>{clearTimeout(c.current),!d.current&&!h.current&&(u.current=window.setTimeout(()=>v(!1),s))},[s,v]),y=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(_se,{scope:t,open:p,onOpenChange:v,onOpen:b,onClose:x,onDismiss:y,hasSelectionRef:d,isPointerDownOnContentRef:h},m.createElement(mp,l,n))},Cse="HoverCardTrigger",Ese=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=lE(Cse,n),i=sE(n);return m.createElement(bp,ue({asChild:!0},i),m.createElement(Qe.a,ue({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:ke(e.onPointerEnter,G0(o.onOpen)),onPointerLeave:ke(e.onPointerLeave,G0(o.onClose)),onFocus:ke(e.onFocus,o.onOpen),onBlur:ke(e.onBlur,o.onClose),onTouchStart:ke(e.onTouchStart,a=>a.preventDefault())})))}),Rse="HoverCardPortal",[r5e,Pse]=Y7(Rse,{forceMount:void 0}),w_="HoverCardContent",$se=m.forwardRef((e,t)=>{const n=Pse(w_,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=lE(w_,e.__scopeHoverCard);return m.createElement(pr,{present:r||i.open},m.createElement(Ose,ue({"data-state":i.open?"open":"closed"},o,{onPointerEnter:ke(e.onPointerEnter,G0(i.onOpen)),onPointerLeave:ke(e.onPointerLeave,G0(i.onClose)),ref:t})))}),Ose=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,...s}=e,l=lE(w_,n),c=sE(n),u=m.useRef(null),d=Rt(t,u),[h,p]=m.useState(!1);return m.useEffect(()=>{if(h){const v=document.body;return N1=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=N1,v.style.webkitUserSelect=N1}}},[h]),m.useEffect(()=>{if(u.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(()=>{u.current&&Tse(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),m.createElement(yp,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:ke(i,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(vp,ue({},c,s,{onPointerDown:ke(s.onPointerDown,v=>{v.currentTarget.contains(v.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"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 G0(e){return t=>t.pointerType==="touch"?void 0:e()}function Tse(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 Dse=Sse,Ase=Ese,K7=$se,Zb=Dse,ev=Ase,xp=j.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>R.jsx(K7,{ref:o,align:t,sideOffset:n,className:ye("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}));xp.displayName=K7.displayName;function X7({card:e}){const{setCardInfo:t}=dr();return R.jsxs(Zb,{openDelay:0,children:[R.jsx(ev,{children:R.jsx(S6,{className:"size-4 text-muted-foreground/40"})}),R.jsx(xp,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:R.jsx(qi,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:R.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}function Mse({card:e,renderFilterInfo:t}){var h,p,v,b,x,y,_,S,C,E,$,T,D,M,L,F,z,X,G,A,U,V,K,q;we(O=>O.themeStyle);const{data:n,isLoading:r}=Bb(e),o=(n==null?void 0:n.records)||[],i=we(O=>O.isDashboardEditing),a=(p=(h=e.preferences)==null?void 0:h.formatNumber)==null?void 0:p.colorRanges,{metricKeys:s}=tr(o||[]),l=(v=o==null?void 0:o[0])==null?void 0:v[s==null?void 0:s[0]],c=(b=o==null?void 0:o[0])==null?void 0:b[s==null?void 0:s[1]],u=(o==null?void 0:o.length)>0,d=c&&c-l!==0?(l-c)/c:null;return R.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:R.jsxs("div",{className:"grow",children:[u?R.jsx("div",{className:"",children:R.jsxs("div",{className:ye("flex items-end gap-1.5",{"animate-pulse":r}),children:[R.jsx("p",{style:{color:xC(l,a)},className:"text-3xl font-semibold",children:Na({number:l,decimalPlaces:((y=(x=e.preferences)==null?void 0:x.formatNumber)==null?void 0:y.decimalPlaces)||0,useSuffix:!!((S=(_=e.preferences)==null?void 0:_.formatNumber)!=null&&S.suffix),customSuffix:((E=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:E.suffix)||"",locale:((T=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:T.locale)||"",currency:((M=(D=e.preferences)==null?void 0:D.formatNumber)==null?void 0:M.currency)||""})}),d&&R.jsxs("div",{className:"flex items-end gap-1",children:[R.jsx(D7,{className:"",children:d}),c&&R.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${Na({number:c,decimalPlaces:((F=(L=e.preferences)==null?void 0:L.formatNumber)==null?void 0:F.decimalPlaces)||0,useSuffix:!!((X=(z=e.preferences)==null?void 0:z.formatNumber)!=null&&X.suffix),customSuffix:((A=(G=e.preferences)==null?void 0:G.formatNumber)==null?void 0:A.suffix)||"",locale:((V=(U=e.preferences)==null?void 0:U.formatNumber)==null?void 0:V.locale)||"",currency:((q=(K=e.preferences)==null?void 0:K.formatNumber)==null?void 0:q.currency)||""})}`})]})]})}):R.jsx("div",{className:"flex h-9 items-center justify-center"}),R.jsxs("div",{className:"flex items-center gap-3",children:[R.jsxs(pd,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(i||e.info)&&R.jsx(X7,{card:e})]}),t==null?void 0:t()]})]})})}const kse=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Ise);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(__,ue({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(__,ue({},r,{ref:t}),n)});kse.displayName="Slot";const __=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Nse(r,n.props),ref:t?Ba(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});__.displayName="SlotClone";const Q7=({children:e})=>m.createElement(m.Fragment,null,e);function Ise(e){return m.isValidElement(e)&&e.type===Q7}function Nse(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const J7=m.forwardRef((e,t)=>m.createElement(Qe.span,ue({},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}}))),Lse=J7,[tv,o5e]=hr("Tooltip",[oa]),cE=oa(),Fse="TooltipProvider",jse=700,S_="tooltip.open",[zse,uE]=tv(Fse),Bse=e=>{const{__scopeTooltip:t,delayDuration:n=jse,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[a,s]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(zse,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),s(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:o},i)},dE="Tooltip",[Vse,nv]=tv(dE),Hse=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=uE(dE,e.__scopeTooltip),c=cE(t),[u,d]=m.useState(null),h=yi(),p=m.useRef(0),v=a??l.disableHoverableContent,b=s??l.delayDuration,x=m.useRef(!1),[y=!1,_]=Fr({prop:r,defaultProp:o,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(S_))):l.onClose(),i==null||i(T)}}),S=m.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),C=m.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,_(!0)},[_]),E=m.useCallback(()=>{window.clearTimeout(p.current),_(!1)},[_]),$=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,_(!0)},b)},[b,_]);return m.useEffect(()=>()=>window.clearTimeout(p.current),[]),m.createElement(mp,c,m.createElement(Vse,{scope:t,contentId:h,open:y,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?$():C()},[l.isOpenDelayed,$,C]),onTriggerLeave:m.useCallback(()=>{v?E():window.clearTimeout(p.current)},[E,v]),onOpen:C,onClose:E,disableHoverableContent:v},n))},FT="TooltipTrigger",Z7=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=nv(FT,n),i=uE(FT,n),a=cE(n),s=m.useRef(null),l=Rt(t,s,o.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),d=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),m.createElement(bp,ue({asChild:!0},a),m.createElement(Qe.button,ue({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:ke(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ke(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ke(e.onBlur,o.onClose),onClick:ke(e.onClick,o.onClose)})))}),Wse="TooltipPortal",[i5e,Use]=tv(Wse,{forceMount:void 0}),yh="TooltipContent",qse=m.forwardRef((e,t)=>{const n=Use(yh,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=nv(yh,e.__scopeTooltip);return m.createElement(pr,{present:r||a.open},a.disableHoverableContent?m.createElement(eI,ue({side:o},i,{ref:t})):m.createElement(Gse,ue({side:o},i,{ref:t})))}),Gse=m.forwardRef((e,t)=>{const n=nv(yh,e.__scopeTooltip),r=uE(yh,e.__scopeTooltip),o=m.useRef(null),i=Rt(t,o),[a,s]=m.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,h=m.useCallback(()=>{s(null),d(!1)},[d]),p=m.useCallback((v,b)=>{const x=v.currentTarget,y={x:v.clientX,y:v.clientY},_=Kse(y,x.getBoundingClientRect()),S=Xse(y,_),C=Qse(b.getBoundingClientRect()),E=Zse([...S,...C]);s(E),d(!0)},[d]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(l&&u){const v=x=>p(x,u),b=x=>p(x,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",b)}}},[l,u,p,h]),m.useEffect(()=>{if(a){const v=b=>{const x=b.target,y={x:b.clientX,y:b.clientY},_=(l==null?void 0:l.contains(x))||(u==null?void 0:u.contains(x)),S=!Jse(y,a);_?h():S&&(h(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,a,c,h]),m.createElement(eI,ue({},e,{ref:i}))}),[Yse,a5e]=tv(dE,{isInside:!1}),eI=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=nv(yh,n),c=cE(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(S_,u),()=>document.removeEventListener(S_,u)),[u]),m.useEffect(()=>{if(l.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),m.createElement(yp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u},m.createElement(vp,ue({"data-state":l.stateAttribute},c,s,{ref:t,style:{...s.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(Q7,null,r),m.createElement(Yse,{scope:n,isInside:!0},m.createElement(Lse,{id:l.contentId,role:"tooltip"},o||r))))});function Kse(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Xse(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 Qse(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Jse(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i].x,l=t[i].y,c=t[a].x,u=t[a].y;l>r!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function Zse(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),ele(t)}function ele(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const tle=Bse,nle=Hse,rle=Z7,tI=qse,ole=tle,nI=nle,rI=rle,fE=j.forwardRef(({className:e,sideOffset:t=4,...n},r)=>R.jsx(tI,{ref:r,sideOffset:t,className:ye("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}));fE.displayName=tI.displayName;/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:oI,setPrototypeOf:jT,isFrozen:ile,getPrototypeOf:ale,getOwnPropertyDescriptor:sle}=Object;let{freeze:zr,seal:Zo,create:iI}=Object,{apply:C_,construct:E_}=typeof Reflect<"u"&&Reflect;zr||(zr=function(t){return t});Zo||(Zo=function(t){return t});C_||(C_=function(t,n,r){return t.apply(n,r)});E_||(E_=function(t,n){return new t(...n)});const lm=To(Array.prototype.forEach),zT=To(Array.prototype.pop),rf=To(Array.prototype.push),n0=To(String.prototype.toLowerCase),L1=To(String.prototype.toString),BT=To(String.prototype.match),of=To(String.prototype.replace),lle=To(String.prototype.indexOf),cle=To(String.prototype.trim),ui=To(Object.prototype.hasOwnProperty),Tr=To(RegExp.prototype.test),af=ule(TypeError);function To(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return C_(e,t,r)}}function ule(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return E_(e,n)}}function Mt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n0;jT&&jT(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(ile(t)||(t[r]=i),o=i)}e[o]=!0}return e}function dle(e){for(let t=0;t<e.length;t++)ui(e,t)||(e[t]=null);return e}function wl(e){const t=iI(null);for(const[n,r]of oI(e))ui(e,n)&&(Array.isArray(r)?t[n]=dle(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=wl(r):t[n]=r);return t}function sf(e,t){for(;e!==null;){const r=sle(e,t);if(r){if(r.get)return To(r.get);if(typeof r.value=="function")return To(r.value)}e=ale(e)}function n(){return null}return n}const VT=zr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),F1=zr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),j1=zr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fle=zr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),z1=zr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),hle=zr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),HT=zr(["#text"]),WT=zr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),B1=zr(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),UT=zr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),cm=zr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ple=Zo(/\{\{[\w\W]*|[\w\W]*\}\}/gm),gle=Zo(/<%[\w\W]*|[\w\W]*%>/gm),mle=Zo(/\${[\w\W]*}/gm),ble=Zo(/^data-[\-\w.\u00B7-\uFFFF]/),vle=Zo(/^aria-[\-\w]+$/),aI=Zo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yle=Zo(/^(?:\w+script|data):/i),xle=Zo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sI=Zo(/^html$/i),wle=Zo(/^[a-z][.\w]*(-[.\w]+)+$/i);var qT=Object.freeze({__proto__:null,MUSTACHE_EXPR:ple,ERB_EXPR:gle,TMPLIT_EXPR:mle,DATA_ATTR:ble,ARIA_ATTR:vle,IS_ALLOWED_URI:aI,IS_SCRIPT_OR_DATA:yle,ATTR_WHITESPACE:xle,DOCTYPE_NAME:sI,CUSTOM_ELEMENT:wle});const lf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},_le=function(){return typeof window>"u"?null:window},Sle=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function lI(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_le();const t=Ae=>lI(Ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==lf.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,v=l.prototype,b=sf(v,"cloneNode"),x=sf(v,"remove"),y=sf(v,"nextSibling"),_=sf(v,"childNodes"),S=sf(v,"parentNode");if(typeof a=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let C,E="";const{implementation:$,createNodeIterator:T,createDocumentFragment:D,getElementsByTagName:M}=n,{importNode:L}=r;let F={};t.isSupported=typeof oI=="function"&&typeof S=="function"&&$&&$.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:X,TMPLIT_EXPR:G,DATA_ATTR:A,ARIA_ATTR:U,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:q}=qT;let{IS_ALLOWED_URI:O}=qT,H=null;const Y=Mt({},[...VT,...F1,...j1,...z1,...HT]);let I=null;const te=Mt({},[...WT,...B1,...UT,...cm]);let ce=Object.seal(iI(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),de=null,he=null,ie=!0,re=!0,le=!1,xe=!0,Z=!1,ve=!0,Ce=!1,Oe=!1,Te=!1,We=!1,Be=!1,Ie=!1,Ke=!0,dt=!1;const Bt="user-content-";let It=!0,Qt=!1,pe={},Re=null;const Le=Mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Ze=Mt({},["audio","video","img","source","image","track"]);let Jt=null;const ln=Mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rn="http://www.w3.org/1998/Math/MathML",En="http://www.w3.org/2000/svg",vn="http://www.w3.org/1999/xhtml";let Wt=vn,dn=!1,$n=null;const rt=Mt({},[rn,En,vn],L1);let mt=null;const Nt=["application/xhtml+xml","text/html"],on="text/html";let _t=null,zn=null;const ni=n.createElement("form"),Ya=function(J){return J instanceof RegExp||J instanceof Function},ri=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(zn&&zn===J)){if((!J||typeof J!="object")&&(J={}),J=wl(J),mt=Nt.indexOf(J.PARSER_MEDIA_TYPE)===-1?on:J.PARSER_MEDIA_TYPE,_t=mt==="application/xhtml+xml"?L1:n0,H=ui(J,"ALLOWED_TAGS")?Mt({},J.ALLOWED_TAGS,_t):Y,I=ui(J,"ALLOWED_ATTR")?Mt({},J.ALLOWED_ATTR,_t):te,$n=ui(J,"ALLOWED_NAMESPACES")?Mt({},J.ALLOWED_NAMESPACES,L1):rt,Jt=ui(J,"ADD_URI_SAFE_ATTR")?Mt(wl(ln),J.ADD_URI_SAFE_ATTR,_t):ln,Ge=ui(J,"ADD_DATA_URI_TAGS")?Mt(wl(Ze),J.ADD_DATA_URI_TAGS,_t):Ze,Re=ui(J,"FORBID_CONTENTS")?Mt({},J.FORBID_CONTENTS,_t):Le,de=ui(J,"FORBID_TAGS")?Mt({},J.FORBID_TAGS,_t):{},he=ui(J,"FORBID_ATTR")?Mt({},J.FORBID_ATTR,_t):{},pe=ui(J,"USE_PROFILES")?J.USE_PROFILES:!1,ie=J.ALLOW_ARIA_ATTR!==!1,re=J.ALLOW_DATA_ATTR!==!1,le=J.ALLOW_UNKNOWN_PROTOCOLS||!1,xe=J.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=J.SAFE_FOR_TEMPLATES||!1,ve=J.SAFE_FOR_XML!==!1,Ce=J.WHOLE_DOCUMENT||!1,We=J.RETURN_DOM||!1,Be=J.RETURN_DOM_FRAGMENT||!1,Ie=J.RETURN_TRUSTED_TYPE||!1,Te=J.FORCE_BODY||!1,Ke=J.SANITIZE_DOM!==!1,dt=J.SANITIZE_NAMED_PROPS||!1,It=J.KEEP_CONTENT!==!1,Qt=J.IN_PLACE||!1,O=J.ALLOWED_URI_REGEXP||aI,Wt=J.NAMESPACE||vn,ce=J.CUSTOM_ELEMENT_HANDLING||{},J.CUSTOM_ELEMENT_HANDLING&&Ya(J.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ce.tagNameCheck=J.CUSTOM_ELEMENT_HANDLING.tagNameCheck),J.CUSTOM_ELEMENT_HANDLING&&Ya(J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ce.attributeNameCheck=J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),J.CUSTOM_ELEMENT_HANDLING&&typeof J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&(re=!1),Be&&(We=!0),pe&&(H=Mt({},HT),I=[],pe.html===!0&&(Mt(H,VT),Mt(I,WT)),pe.svg===!0&&(Mt(H,F1),Mt(I,B1),Mt(I,cm)),pe.svgFilters===!0&&(Mt(H,j1),Mt(I,B1),Mt(I,cm)),pe.mathMl===!0&&(Mt(H,z1),Mt(I,UT),Mt(I,cm))),J.ADD_TAGS&&(H===Y&&(H=wl(H)),Mt(H,J.ADD_TAGS,_t)),J.ADD_ATTR&&(I===te&&(I=wl(I)),Mt(I,J.ADD_ATTR,_t)),J.ADD_URI_SAFE_ATTR&&Mt(Jt,J.ADD_URI_SAFE_ATTR,_t),J.FORBID_CONTENTS&&(Re===Le&&(Re=wl(Re)),Mt(Re,J.FORBID_CONTENTS,_t)),It&&(H["#text"]=!0),Ce&&Mt(H,["html","head","body"]),H.table&&(Mt(H,["tbody"]),delete de.tbody),J.TRUSTED_TYPES_POLICY){if(typeof J.TRUSTED_TYPES_POLICY.createHTML!="function")throw af('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof J.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw af('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=J.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=Sle(p,o)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));zr&&zr(J),zn=J}},aa=Mt({},["mi","mo","mn","ms","mtext"]),Ci=Mt({},["foreignobject","annotation-xml"]),sa=Mt({},["title","style","font","a","script"]),Ka=Mt({},[...F1,...j1,...fle]),Ei=Mt({},[...z1,...hle]),la=function(J){let me=S(J);(!me||!me.tagName)&&(me={namespaceURI:Wt,tagName:"template"});const Me=n0(J.tagName),lt=n0(me.tagName);return $n[J.namespaceURI]?J.namespaceURI===En?me.namespaceURI===vn?Me==="svg":me.namespaceURI===rn?Me==="svg"&&(lt==="annotation-xml"||aa[lt]):!!Ka[Me]:J.namespaceURI===rn?me.namespaceURI===vn?Me==="math":me.namespaceURI===En?Me==="math"&&Ci[lt]:!!Ei[Me]:J.namespaceURI===vn?me.namespaceURI===En&&!Ci[lt]||me.namespaceURI===rn&&!aa[lt]?!1:!Ei[Me]&&(sa[Me]||!Ka[Me]):!!(mt==="application/xhtml+xml"&&$n[J.namespaceURI]):!1},Jn=function(J){rf(t.removed,{element:J});try{S(J).removeChild(J)}catch{x(J)}},Ri=function(J,me){try{rf(t.removed,{attribute:me.getAttributeNode(J),from:me})}catch{rf(t.removed,{attribute:null,from:me})}if(me.removeAttribute(J),J==="is"&&!I[J])if(We||Be)try{Jn(me)}catch{}else try{me.setAttribute(J,"")}catch{}},Xa=function(J){let me=null,Me=null;if(Te)J="<remove></remove>"+J;else{const pt=BT(J,/^[\r\n\t ]+/);Me=pt&&pt[0]}mt==="application/xhtml+xml"&&Wt===vn&&(J='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+J+"</body></html>");const lt=C?C.createHTML(J):J;if(Wt===vn)try{me=new h().parseFromString(lt,mt)}catch{}if(!me||!me.documentElement){me=$.createDocument(Wt,"template",null);try{me.documentElement.innerHTML=dn?E:lt}catch{}}const Rn=me.body||me.documentElement;return J&&Me&&Rn.insertBefore(n.createTextNode(Me),Rn.childNodes[0]||null),Wt===vn?M.call(me,Ce?"html":"body")[0]:Ce?me.documentElement:Rn},Qa=function(J){return T.call(J.ownerDocument||J,J,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},k=function(J){return J instanceof d&&(typeof J.nodeName!="string"||typeof J.textContent!="string"||typeof J.removeChild!="function"||!(J.attributes instanceof u)||typeof J.removeAttribute!="function"||typeof J.setAttribute!="function"||typeof J.namespaceURI!="string"||typeof J.insertBefore!="function"||typeof J.hasChildNodes!="function")},ne=function(J){return typeof s=="function"&&J instanceof s},fe=function(J,me,Me){F[J]&&lm(F[J],lt=>{lt.call(t,me,Me,zn)})},$e=function(J){let me=null;if(fe("beforeSanitizeElements",J,null),k(J))return Jn(J),!0;const Me=_t(J.nodeName);if(fe("uponSanitizeElement",J,{tagName:Me,allowedTags:H}),J.hasChildNodes()&&!ne(J.firstElementChild)&&Tr(/<[/\w]/g,J.innerHTML)&&Tr(/<[/\w]/g,J.textContent)||J.nodeType===lf.progressingInstruction||ve&&J.nodeType===lf.comment&&Tr(/<[/\w]/g,J.data))return Jn(J),!0;if(!H[Me]||de[Me]){if(!de[Me]&&qe(Me)&&(ce.tagNameCheck instanceof RegExp&&Tr(ce.tagNameCheck,Me)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(Me)))return!1;if(It&&!Re[Me]){const lt=S(J)||J.parentNode,Rn=_(J)||J.childNodes;if(Rn&&lt){const pt=Rn.length;for(let gr=pt-1;gr>=0;--gr){const ko=b(Rn[gr],!0);ko.__removalCount=(J.__removalCount||0)+1,lt.insertBefore(ko,y(J))}}}return Jn(J),!0}return J instanceof l&&!la(J)||(Me==="noscript"||Me==="noembed"||Me==="noframes")&&Tr(/<\/no(script|embed|frames)/i,J.innerHTML)?(Jn(J),!0):(Z&&J.nodeType===lf.text&&(me=J.textContent,lm([z,X,G],lt=>{me=of(me,lt," ")}),J.textContent!==me&&(rf(t.removed,{element:J.cloneNode()}),J.textContent=me)),fe("afterSanitizeElements",J,null),!1)},Ve=function(J,me,Me){if(Ke&&(me==="id"||me==="name")&&(Me in n||Me in ni))return!1;if(!(re&&!he[me]&&Tr(A,me))){if(!(ie&&Tr(U,me))){if(!I[me]||he[me]){if(!(qe(J)&&(ce.tagNameCheck instanceof RegExp&&Tr(ce.tagNameCheck,J)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(J))&&(ce.attributeNameCheck instanceof RegExp&&Tr(ce.attributeNameCheck,me)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(me))||me==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&Tr(ce.tagNameCheck,Me)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(Me))))return!1}else if(!Jt[me]){if(!Tr(O,of(Me,K,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&J!=="script"&&lle(Me,"data:")===0&&Ge[J])){if(!(le&&!Tr(V,of(Me,K,"")))){if(Me)return!1}}}}}}return!0},qe=function(J){return J!=="annotation-xml"&&BT(J,q)},ze=function(J){fe("beforeSanitizeAttributes",J,null);const{attributes:me}=J;if(!me)return;const Me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I};let lt=me.length;for(;lt--;){const Rn=me[lt],{name:pt,namespaceURI:gr,value:ko}=Rn,el=_t(pt);let Zn=pt==="value"?ko:cle(ko);if(Me.attrName=el,Me.attrValue=Zn,Me.keepAttr=!0,Me.forceKeepAttr=void 0,fe("uponSanitizeAttribute",J,Me),Zn=Me.attrValue,ve&&Tr(/((--!?|])>)|<\/(style|title)/i,Zn)){Ri(pt,J);continue}if(Me.forceKeepAttr||(Ri(pt,J),!Me.keepAttr))continue;if(!xe&&Tr(/\/>/i,Zn)){Ri(pt,J);continue}Z&&lm([z,X,G],Td=>{Zn=of(Zn,Td," ")});const Od=_t(J.nodeName);if(Ve(Od,el,Zn)){if(dt&&(el==="id"||el==="name")&&(Ri(pt,J),Zn=Bt+Zn),C&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!gr)switch(p.getAttributeType(Od,el)){case"TrustedHTML":{Zn=C.createHTML(Zn);break}case"TrustedScriptURL":{Zn=C.createScriptURL(Zn);break}}try{gr?J.setAttributeNS(gr,pt,Zn):J.setAttribute(pt,Zn),k(J)?Jn(J):zT(t.removed)}catch{}}}fe("afterSanitizeAttributes",J,null)},Fe=function Ae(J){let me=null;const Me=Qa(J);for(fe("beforeSanitizeShadowDOM",J,null);me=Me.nextNode();)fe("uponSanitizeShadowNode",me,null),!$e(me)&&(me.content instanceof i&&Ae(me.content),ze(me));fe("afterSanitizeShadowDOM",J,null)};return t.sanitize=function(Ae){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,Me=null,lt=null,Rn=null;if(dn=!Ae,dn&&(Ae="<!-->"),typeof Ae!="string"&&!ne(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw af("dirty is not a string, aborting")}else throw af("toString is not a function");if(!t.isSupported)return Ae;if(Oe||ri(J),t.removed=[],typeof Ae=="string"&&(Qt=!1),Qt){if(Ae.nodeName){const ko=_t(Ae.nodeName);if(!H[ko]||de[ko])throw af("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof s)me=Xa("<!---->"),Me=me.ownerDocument.importNode(Ae,!0),Me.nodeType===lf.element&&Me.nodeName==="BODY"||Me.nodeName==="HTML"?me=Me:me.appendChild(Me);else{if(!We&&!Z&&!Ce&&Ae.indexOf("<")===-1)return C&&Ie?C.createHTML(Ae):Ae;if(me=Xa(Ae),!me)return We?null:Ie?E:""}me&&Te&&Jn(me.firstChild);const pt=Qa(Qt?Ae:me);for(;lt=pt.nextNode();)$e(lt)||(lt.content instanceof i&&Fe(lt.content),ze(lt));if(Qt)return Ae;if(We){if(Be)for(Rn=D.call(me.ownerDocument);me.firstChild;)Rn.appendChild(me.firstChild);else Rn=me;return(I.shadowroot||I.shadowrootmode)&&(Rn=L.call(r,Rn,!0)),Rn}let gr=Ce?me.outerHTML:me.innerHTML;return Ce&&H["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&Tr(sI,me.ownerDocument.doctype.name)&&(gr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
253
+ `+gr),Z&&lm([z,X,G],ko=>{gr=of(gr,ko," ")}),C&&Ie?C.createHTML(gr):gr},t.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ri(Ae),Oe=!0},t.clearConfig=function(){zn=null,Oe=!1},t.isValidAttribute=function(Ae,J,me){zn||ri({});const Me=_t(Ae),lt=_t(J);return Ve(Me,lt,me)},t.addHook=function(Ae,J){typeof J=="function"&&(F[Ae]=F[Ae]||[],rf(F[Ae],J))},t.removeHook=function(Ae){if(F[Ae])return zT(F[Ae])},t.removeHooks=function(Ae){F[Ae]&&(F[Ae]=[])},t.removeAllHooks=function(){F={}},t}var GT=lI();function R_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Cle(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const cI="ScrollArea",[uI,s5e]=hr(cI),[Ele,ei]=uI(cI),dI=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...a}=e,[s,l]=m.useState(null),[c,u]=m.useState(null),[d,h]=m.useState(null),[p,v]=m.useState(null),[b,x]=m.useState(null),[y,_]=m.useState(0),[S,C]=m.useState(0),[E,$]=m.useState(!1),[T,D]=m.useState(!1),M=Rt(t,F=>l(F)),L=vc(o);return m.createElement(Ele,{scope:n,type:r,dir:L,scrollHideDelay:i,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:h,scrollbarX:p,onScrollbarXChange:v,scrollbarXEnabled:E,onScrollbarXEnabledChange:$,scrollbarY:b,onScrollbarYChange:x,scrollbarYEnabled:T,onScrollbarYEnabledChange:D,onCornerWidthChange:_,onCornerHeightChange:C},m.createElement(Qe.div,ue({dir:L},a,{ref:M,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})))}),Rle="ScrollAreaViewport",Ple=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=ei(Rle,n),a=m.useRef(null),s=Rt(t,a,i.onViewportChange);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(Qe.div,ue({"data-radix-scroll-area-viewport":""},o,{ref:s,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),m.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Wa="ScrollAreaScrollbar",fI=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ei(Wa,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,s=e.orientation==="horizontal";return m.useEffect(()=>(s?i(!0):a(!0),()=>{s?i(!1):a(!1)}),[s,i,a]),o.type==="hover"?m.createElement($le,ue({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(Ole,ue({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(hI,ue({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(hE,ue({},r,{ref:t})):null}),$le=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ei(Wa,e.__scopeScrollArea),[i,a]=m.useState(!1);return m.useEffect(()=>{const s=o.scrollArea;let l=0;if(s){const c=()=>{window.clearTimeout(l),a(!0)},u=()=>{l=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return s.addEventListener("pointerenter",c),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",c),s.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),m.createElement(pr,{present:n||i},m.createElement(hI,ue({"data-state":i?"visible":"hidden"},r,{ref:t})))}),Ole=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ei(Wa,e.__scopeScrollArea),i=e.orientation==="horizontal",a=ov(()=>l("SCROLL_END"),100),[s,l]=Cle("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(s==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,o.scrollHideDelay,l]),m.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const h=()=>{const p=c[u];d!==p&&(l("SCROLL"),a()),d=p};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[o.viewport,i,l,a]),m.createElement(pr,{present:n||s!=="hidden"},m.createElement(hE,ue({"data-state":s==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:ke(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),hI=m.forwardRef((e,t)=>{const n=ei(Wa,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,a]=m.useState(!1),s=e.orientation==="horizontal",l=ov(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?c:u)}},10);return sd(n.viewport,l),sd(n.content,l),m.createElement(pr,{present:r||i},m.createElement(hE,ue({"data-state":i?"visible":"hidden"},o,{ref:t})))}),hE=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ei(Wa,e.__scopeScrollArea),i=m.useRef(null),a=m.useRef(0),[s,l]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=bI(s.viewport,s.content),u={...r,sizes:s,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function d(h,p){return Lle(h,a.current,s,p)}return n==="horizontal"?m.createElement(Tle,ue({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollLeft,p=YT(h,s,o.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=d(h,o.dir))}})):n==="vertical"?m.createElement(Dle,ue({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollTop,p=YT(h,s);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=d(h))}})):null}),Tle=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ei(Wa,e.__scopeScrollArea),[a,s]=m.useState(),l=m.useRef(null),c=Rt(t,l,i.onScrollbarXChange);return m.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),m.createElement(gI,ue({"data-orientation":"horizontal"},o,{ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":rv(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const h=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(h),yI(h,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Y0(a.paddingLeft),paddingEnd:Y0(a.paddingRight)}})}}))}),Dle=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ei(Wa,e.__scopeScrollArea),[a,s]=m.useState(),l=m.useRef(null),c=Rt(t,l,i.onScrollbarYChange);return m.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),m.createElement(gI,ue({"data-orientation":"vertical"},o,{ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":rv(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const h=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(h),yI(h,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Y0(a.paddingTop),paddingEnd:Y0(a.paddingBottom)}})}}))}),[Ale,pI]=uI(Wa),gI=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...h}=e,p=ei(Wa,n),[v,b]=m.useState(null),x=Rt(t,M=>b(M)),y=m.useRef(null),_=m.useRef(""),S=p.viewport,C=r.content-r.viewport,E=Xn(u),$=Xn(l),T=ov(d,10);function D(M){if(y.current){const L=M.clientX-y.current.left,F=M.clientY-y.current.top;c({x:L,y:F})}}return m.useEffect(()=>{const M=L=>{const F=L.target;(v==null?void 0:v.contains(F))&&E(L,C)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[S,v,C,E]),m.useEffect($,[r,$]),sd(v,T),sd(p.content,T),m.createElement(Ale,{scope:n,scrollbar:v,hasThumb:o,onThumbChange:Xn(i),onThumbPointerUp:Xn(a),onThumbPositionChange:$,onThumbPointerDown:Xn(s)},m.createElement(Qe.div,ue({},h,{ref:x,style:{position:"absolute",...h.style},onPointerDown:ke(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),y.current=v.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),D(M))}),onPointerMove:ke(e.onPointerMove,D),onPointerUp:ke(e.onPointerUp,M=>{const L=M.target;L.hasPointerCapture(M.pointerId)&&L.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=_.current,p.viewport&&(p.viewport.style.scrollBehavior=""),y.current=null})})))}),P_="ScrollAreaThumb",Mle=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=pI(P_,e.__scopeScrollArea);return m.createElement(pr,{present:n||o.hasThumb},m.createElement(kle,ue({ref:t},r)))}),kle=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ei(P_,n),a=pI(P_,n),{onThumbPositionChange:s}=a,l=Rt(t,d=>a.onThumbChange(d)),c=m.useRef(),u=ov(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const d=i.viewport;if(d){const h=()=>{if(u(),!c.current){const p=Fle(d,s);c.current=p,s()}};return s(),d.addEventListener("scroll",h),()=>d.removeEventListener("scroll",h)}},[i.viewport,u,s]),m.createElement(Qe.div,ue({"data-state":a.hasThumb?"visible":"hidden"},o,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ke(e.onPointerDownCapture,d=>{const p=d.target.getBoundingClientRect(),v=d.clientX-p.left,b=d.clientY-p.top;a.onThumbPointerDown({x:v,y:b})}),onPointerUp:ke(e.onPointerUp,a.onThumbPointerUp)}))}),mI="ScrollAreaCorner",Ile=m.forwardRef((e,t)=>{const n=ei(mI,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(Nle,ue({},e,{ref:t})):null}),Nle=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ei(mI,n),[i,a]=m.useState(0),[s,l]=m.useState(0),c=!!(i&&s);return sd(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),sd(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),a(d)}),c?m.createElement(Qe.div,ue({},r,{ref:t,style:{width:i,height:s,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Y0(e){return e?parseInt(e,10):0}function bI(e,t){const n=e/t;return isNaN(n)?0:n}function rv(e){const t=bI(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Lle(e,t,n,r="ltr"){const o=rv(n),i=o/2,a=t||i,s=o-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return vI([l,c],d)(e)}function YT(e,t,n="ltr"){const r=rv(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,s=i-r,l=n==="ltr"?[0,a]:[a*-1,0],c=R_(e,l);return vI([0,a],[0,s])(c)}function vI(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function yI(e,t){return e>0&&e<t}const Fle=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,s=n.top!==i.top;(a||s)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function ov(e,t){const n=Xn(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function sd(e,t){const n=Xn(t);Cr(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const xI=dI,jle=Ple,zle=Ile,iv=j.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(xI,{ref:r,className:ye("relative overflow-hidden",e),...n,children:[R.jsx(jle,{className:"h-full w-full rounded-[inherit]",children:t}),R.jsx(av,{}),R.jsx(zle,{})]}));iv.displayName=xI.displayName;const av=j.forwardRef(({className:e,orientation:t="vertical",...n},r)=>R.jsx(fI,{ref:r,orientation:t,className:ye("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:R.jsx(Mle,{className:"relative flex-1 rounded-full bg-border"})}));av.displayName=fI.displayName;function wI({card:e,isLoading:t,data:n}){var h,p;const r=n||[],{keys:o}=tr(r),i=we(v=>v.selectedSheetId),a=we(v=>v.isVisualEditing),s=(p=(h=e==null?void 0:e.preferences)==null?void 0:h.textVisualOptions)==null?void 0:p.isDynamicText,{setCardDescription:l}=dr(),{setCard:c}=Lb();function u(){var y;if(t)return R.jsx(yb,{className:"h-7 animate-pulse bg-muted"});const v=(y=r==null?void 0:r[0])==null?void 0:y[o[0]],b=GT.sanitize(v),x=R.jsx("div",{dangerouslySetInnerHTML:{__html:b}});return R.jsx("div",{className:"hover:cursor-text",onMouseDown:_=>_.stopPropagation(),children:x})}function d(){return R.jsx("div",{onMouseDown:v=>v.stopPropagation(),children:R.jsx(qi,{type:"textarea",className:"w-full",text:(e==null?void 0:e.description)||"Double click to add description",onSave:v=>{a===!1&&l(i,e.id,v),a===!0&&c({...e,description:v})},children:R.jsx("div",{dangerouslySetInnerHTML:{__html:GT.sanitize((e==null?void 0:e.description)||"")}})})})}return R.jsxs(iv,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:[!s&&d(),s===!0&&u()]})}function Ble(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Vle(...e){return t=>e.forEach(n=>Ble(n,t))}var sv=j.forwardRef((e,t)=>{const{children:n,...r}=e,o=j.Children.toArray(n),i=o.find(Hle);if(i){const a=i.props.children,s=o.map(l=>l===i?j.Children.count(a)>1?j.Children.only(null):j.isValidElement(a)?a.props.children:null:l);return R.jsx($_,{...r,ref:t,children:j.isValidElement(a)?j.cloneElement(a,void 0,s):null})}return R.jsx($_,{...r,ref:t,children:n})});sv.displayName="Slot";var $_=j.forwardRef((e,t)=>{const{children:n,...r}=e;if(j.isValidElement(n)){const o=Ule(n);return j.cloneElement(n,{...Wle(r,n.props),ref:t?Vle(t,o):o})}return j.Children.count(n)>1?j.Children.only(null):null});$_.displayName="SlotClone";var _I=({children:e})=>R.jsx(R.Fragment,{children:e});function Hle(e){return j.isValidElement(e)&&e.type===_I}function Wle(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ule(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const KT=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,XT=a0,pE=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return XT(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const h=KT(u)||KT(d);return o[c][h]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...p}=u;return Object.entries(p).every(v=>{let[b,x]=v;return Array.isArray(x)?x.includes({...i,...s}[b]):{...i,...s}[b]===x})?[...c,d,h]:c},[]);return XT(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},xh=pE("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"}}),no=j.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const a=r?sv:"button";return R.jsx(a,{className:ye(xh({variant:t,size:n,className:e})),ref:i,...o})});no.displayName="Button";const O_="horizontal",qle=["horizontal","vertical"],SI=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=O_,...o}=e,i=CI(r)?r:O_,s=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.createElement(Qe.div,ue({"data-orientation":i},s,o,{ref:t}))});SI.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!CI(r)?new Error(Gle(o,n)):null}};function Gle(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
254
+ - horizontal
255
+ - vertical
256
+
257
+ Defaulting to \`${O_}\`.`}function CI(e){return qle.includes(e)}const EI=SI,wp=j.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>R.jsx(EI,{ref:o,decorative:n,orientation:t,className:ye("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));wp.displayName=EI.displayName;function Yle(){var b,x;const e=we(y=>y.themeStyle),t=we(y=>y.filterValues),n=we(y=>y.dashboard.filters),r=we(y=>y.filteringCards),o=we(y=>y.selectedSheetId),{removeFilterValue:i,removeFilteringCard:a,setFilterValues:s,setFilteringCards:l}=dr(),c=n==null?void 0:n.filter(y=>y.sheetId===o||!y.sheetId),u=t==null?void 0:t.filter(y=>(c==null?void 0:c.some(_=>_.id===y.filterId))||y.filterId.endsWith(o));if(!u||u.length===0)return null;const d=u.map(y=>{const _=n==null?void 0:n.find(S=>S.id===y.filterId);return{filterId:y.filterId,name:(_==null?void 0:_.title)||y.name,values:y.values}});function h(y){return y instanceof Date?y.toLocaleDateString():y}function p(y){const _=r==null?void 0:r.find(S=>y.filterId.startsWith(S.id));_&&a(_),i(y.filterId)}function v(y){var _,S;return R.jsxs("div",{className:"space-y-2",children:[R.jsxs("div",{style:{borderRadius:(S=(_=e==null?void 0:e.chart)==null?void 0:_.options)==null?void 0:S.borderRadius},className:"flex w-fit items-center gap-2 bg-muted-foreground px-2 py-1 font-semibold text-muted",children:[R.jsx("span",{className:"break-words",children:y.name}),R.jsx(md,{onClick:()=>p(y),className:"size-3 text-muted hover:cursor-pointer hover:text-background"})]}),R.jsx("div",{className:"flex flex-wrap gap-1",children:y.values.map(C=>{var E,$;return R.jsx("span",{style:{borderRadius:($=(E=e==null?void 0:e.chart)==null?void 0:E.options)==null?void 0:$.borderRadius},className:"inline-block",children:h(C)},C.toString())})})]})}return R.jsxs(Zb,{openDelay:100,children:[R.jsx(ev,{children:R.jsx(w6,{className:"z-100 size-3.5 text-muted-foreground/40"})}),R.jsxs(xp,{style:{borderRadius:(x=(b=e==null?void 0:e.chart)==null?void 0:b.options)==null?void 0:x.borderRadius},className:"relative flex min-h-fit w-[300px] flex-col px-0 text-xs",align:"start",children:[R.jsx(mC,{onClick:()=>{l([]),s([])},className:"absolute right-4 size-3.5 text-muted-foreground/40 hover:cursor-pointer"}),R.jsx("div",{className:"h-fit max-h-[150px] min-h-0 grow overflow-auto",children:d==null?void 0:d.map(y=>R.jsxs("div",{className:"px-5",children:[v(y),R.jsx(wp,{className:"my-2"})]},y.name))})]})]})}const gE=j.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>R.jsx("div",{style:n,className:ye("relative w-full overflow-auto",t),children:R.jsx("table",{ref:o,className:ye("w-full caption-bottom text-sm",e),...r})}));gE.displayName="Table";const mE=j.forwardRef(({className:e,...t},n)=>R.jsx("thead",{ref:n,className:ye("[&_tr]:border-b",e),...t}));mE.displayName="TableHeader";const bE=j.forwardRef(({className:e,...t},n)=>R.jsx("tbody",{ref:n,className:ye("[&_tr:last-child]:border-0",e),...t}));bE.displayName="TableBody";const Kle=j.forwardRef(({className:e,...t},n)=>R.jsx("tfoot",{ref:n,className:ye("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Kle.displayName="TableFooter";const Yf=j.forwardRef(({className:e,...t},n)=>R.jsx("tr",{ref:n,className:ye("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Yf.displayName="TableRow";const vE=j.forwardRef(({className:e,...t},n)=>R.jsx("th",{ref:n,className:ye("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));vE.displayName="TableHead";const yE=j.forwardRef(({className:e,...t},n)=>R.jsx("td",{ref:n,className:ye("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));yE.displayName="TableCell";const Xle=j.forwardRef(({className:e,...t},n)=>R.jsx("caption",{ref:n,className:ye("mt-4 text-sm text-muted-foreground",e),...t}));Xle.displayName="TableCaption";/**
258
+ * table-core
259
+ *
260
+ * Copyright (c) TanStack
261
+ *
262
+ * This source code is licensed under the MIT license found in the
263
+ * LICENSE.md file in the root directory of this source tree.
264
+ *
265
+ * @license MIT
266
+ */function As(e,t){return typeof e=="function"?e(t):e}function Do(e,t){return n=>{t.setState(r=>({...r,[e]:As(n,r[e])}))}}function K0(e){return e instanceof Function}function Qle(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Jle(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const a=t(i);a!=null&&a.length&&r(a)})};return r(e),n}function ct(e,t,n){let r=[],o;return()=>{let i;n.key&&n.debug&&(i=Date.now());const a=e();if(!(a.length!==r.length||a.some((c,u)=>r[u]!==c)))return o;r=a;let l;if(n.key&&n.debug&&(l=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-i)*100)/100,u=Math.round((Date.now()-l)*100)/100,d=u/16,h=(p,v)=>{for(p=String(p);p.length<v;)p=" "+p;return p};console.info(`%c⏱ ${h(u,5)} /${h(c,5)} ms`,`
267
+ font-size: .6rem;
268
+ font-weight: bold;
269
+ color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Zle(e,t,n,r){var o,i;const s={...e._getDefaultColumnDef(),...t},l=s.accessorKey;let c=(o=(i=s.id)!=null?i:l?l.replace(".","_"):void 0)!=null?o:typeof s.header=="string"?s.header:void 0,u;if(s.accessorFn?u=s.accessorFn:l&&(l.includes(".")?u=h=>{let p=h;for(const b of l.split(".")){var v;p=(v=p)==null?void 0:v[b],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${b}" in deeply nested key "${l}" returned undefined.`)}return p}:u=h=>h[s.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(s.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:s,columns:[],getFlatColumns:ct(()=>[!0],()=>{var h;return[d,...(h=d.columns)==null?void 0:h.flatMap(p=>p.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var h;return(h=e.options.debugAll)!=null?h:e.options.debugColumns}}),getLeafColumns:ct(()=>[e._getOrderColumnsFn()],h=>{var p;if((p=d.columns)!=null&&p.length){let v=d.columns.flatMap(b=>b.getLeafColumns());return h(v)}return[d]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var h;return(h=e.options.debugAll)!=null?h:e.options.debugColumns}})};for(const h of e._features)h.createColumn==null||h.createColumn(d,e);return d}function QT(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],s=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(s),a.push(l)};return s(i),a},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(i,e)}),i}const ece={createTable:e=>{e.getHeaderGroups=ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,a;const s=(i=r==null?void 0:r.map(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?i:[],l=(a=o==null?void 0:o.map(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?a:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return um(t,[...s,...c,...l],e)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),um(t,n,e,"center")),{key:process.env.NODE_ENV==="development"&&"getCenterHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftHeaderGroups=ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?o:[];return um(t,i,e,"left")},{key:process.env.NODE_ENV==="development"&&"getLeftHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightHeaderGroups=ct(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?o:[];return um(t,i,e,"right")},{key:process.env.NODE_ENV==="development"&&"getRightHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFooterGroups=ct(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFooterGroups=ct(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getLeftFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFooterGroups=ct(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getCenterFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFooterGroups=ct(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getRightFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFlatHeaders=ct(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFlatHeaders=ct(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getLeftFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFlatHeaders=ct(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getCenterFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFlatHeaders=ct(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getRightFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterLeafHeaders=ct(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getCenterLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftLeafHeaders=ct(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getLeftLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightLeafHeaders=ct(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getRightLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeafHeaders=ct(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,a,s,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(a=(s=n[0])==null?void 0:s.headers)!=null?a:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})}};function um(e,t,n,r){var o,i;let a=0;const s=function(h,p){p===void 0&&(p=1),a=Math.max(a,p),h.filter(v=>v.getIsVisible()).forEach(v=>{var b;(b=v.columns)!=null&&b.length&&s(v.columns,p+1)},0)};s(e);let l=[];const c=(h,p)=>{const v={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},b=[];h.forEach(x=>{const y=[...b].reverse()[0],_=x.column.depth===v.depth;let S,C=!1;if(_&&x.column.parent?S=x.column.parent:(S=x.column,C=!0),y&&(y==null?void 0:y.column)===S)y.subHeaders.push(x);else{const E=QT(n,S,{id:[r,p,S.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${b.filter($=>$.column===S).length}`:void 0,depth:p,index:b.length});E.subHeaders.push(x),b.push(E)}v.headers.push(x),x.headerGroup=v}),l.push(v),p>0&&c(b,p-1)},u=t.map((h,p)=>QT(n,h,{depth:a,index:p}));c(u,a-1),l.reverse();const d=h=>h.filter(v=>v.column.getIsVisible()).map(v=>{let b=0,x=0,y=[0];v.subHeaders&&v.subHeaders.length?(y=[],d(v.subHeaders).forEach(S=>{let{colSpan:C,rowSpan:E}=S;b+=C,y.push(E)})):b=1;const _=Math.min(...y);return x=x+_,v.colSpan=b,v.rowSpan=x,{colSpan:b,rowSpan:x}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const dm={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},V1=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),tce={getDefaultColumnDef:()=>dm,getInitialState:e=>({columnSizing:{},columnSizingInfo:V1(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Do("columnSizing",e),onColumnSizingInfoChange:Do("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:dm.minSize,(r=i??e.columnDef.size)!=null?r:dm.size),(o=e.columnDef.maxSize)!=null?o:dm.maxSize)},e.getStart=n=>{const r=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),o=r.findIndex(i=>i.id===e.id);if(o>0){const i=r[o-1];return i.getStart(n)+i.getSize()}return 0},e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),H1(i)&&i.touches&&i.touches.length>1))return;const a=e.getSize(),s=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[r.id,r.getSize()]],l=H1(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(y,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(S=>{var C,E;const $=t.options.columnResizeDirection==="rtl"?-1:1,T=(_-((C=S==null?void 0:S.startOffset)!=null?C:0))*$,D=Math.max(T/((E=S==null?void 0:S.startSize)!=null?E:0),-.999999);return S.columnSizingStart.forEach(M=>{let[L,F]=M;c[L]=Math.round(Math.max(F+F*D,0)*100)/100}),{...S,deltaOffset:T,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||y==="end")&&t.setColumnSizing(S=>({...S,...c})))},d=y=>u("move",y),h=y=>{u("end",y),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,v={moveHandler:y=>d(y.clientX),upHandler:y=>{p==null||p.removeEventListener("mousemove",v.moveHandler),p==null||p.removeEventListener("mouseup",v.upHandler),h(y.clientX)}},b={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),d(y.touches[0].clientX),!1),upHandler:y=>{var _;p==null||p.removeEventListener("touchmove",b.moveHandler),p==null||p.removeEventListener("touchend",b.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),h((_=y.touches[0])==null?void 0:_.clientX)}},x=nce()?{passive:!1}:!1;H1(i)?(p==null||p.addEventListener("touchmove",b.moveHandler,x),p==null||p.addEventListener("touchend",b.upHandler,x)):(p==null||p.addEventListener("mousemove",v.moveHandler,x),p==null||p.addEventListener("mouseup",v.upHandler,x)),t.setColumnSizingInfo(y=>({...y,startOffset:l,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?V1():(n=e.initialState.columnSizingInfo)!=null?n:V1())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let fm=null;function nce(){if(typeof fm=="boolean")return fm;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return fm=e,fm}function H1(e){return e.type==="touchstart"}const rce={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Do("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const a=i.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(s=>{a[s]=!0}):a=r,n=(o=n)!=null?o:!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){const{[e.id]:s,...l}=a;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},RI=(e,t,n)=>{var r;const o=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(o))};RI.autoRemove=e=>bi(e);const PI=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};PI.autoRemove=e=>bi(e);const $I=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};$I.autoRemove=e=>bi(e);const OI=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};OI.autoRemove=e=>bi(e)||!(e!=null&&e.length);const TI=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});TI.autoRemove=e=>bi(e)||!(e!=null&&e.length);const DI=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});DI.autoRemove=e=>bi(e)||!(e!=null&&e.length);const AI=(e,t,n)=>e.getValue(t)===n;AI.autoRemove=e=>bi(e);const MI=(e,t,n)=>e.getValue(t)==n;MI.autoRemove=e=>bi(e);const xE=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};xE.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(o)?1/0:o;if(i>a){const s=i;i=a,a=s}return[i,a]};xE.autoRemove=e=>bi(e)||bi(e[0])&&bi(e[1]);const ya={includesString:RI,includesStringSensitive:PI,equalsString:$I,arrIncludes:OI,arrIncludesAll:TI,arrIncludesSome:DI,equals:AI,weakEquals:MI,inNumberRange:xE};function bi(e){return e==null||e===""}const oce={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Do("columnFilters",e),onGlobalFilterChange:Do("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?ya.includesString:typeof r=="number"?ya.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ya.equals:Array.isArray(r)?ya.arrIncludes:ya.weakEquals},e.getFilterFn=()=>{var n,r;return K0(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ya[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===e.id),a=As(n,i?i.value:void 0);if(JT(o,a,e)){var s;return(s=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?s:[]}const l={id:e.id,value:a};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ya.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return K0(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ya[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=As(t,o))==null?void 0:i.filter(a=>{const s=n.find(l=>l.id===a.id);if(s){const l=s.getFilterFn();if(JT(l,a.value,s))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function JT(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const ice=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),ace=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},sce=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},lce=(e,t,n)=>{let r,o;return n.forEach(i=>{const a=i.getValue(e);a!=null&&(r===void 0?a>=a&&(r=o=a):(r>a&&(r=a),o<a&&(o=a)))}),[r,o]},cce=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},uce=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Qle(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,a)=>i-a);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},dce=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),fce=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,hce=(e,t)=>t.length,W1={sum:ice,min:ace,max:sce,extent:lce,mean:cce,median:uce,unique:dce,uniqueCount:fce,count:hce},pce={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Do("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r,o,i;return(n=(r=(o=(i=e.columnDef.enableGrouping)!=null?i:!0)!=null?o:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return W1.sum;if(Object.prototype.toString.call(r)==="[object Date]")return W1.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return K0(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:W1[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function gce(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(a=>a.id===i)).filter(Boolean),...r]}const mce={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Do("columnOrder",e)}),createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ct(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const a=[...t],s=[...o];for(;s.length&&a.length;){const l=a.shift(),c=s.findIndex(u=>u.id===l);c>-1&&i.push(s.splice(c,1)[0])}i=[...i,...s]}return gce(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},T_=0,D_=10,U1=()=>({pageIndex:T_,pageSize:D_}),bce={getInitialState:e=>({...e,pagination:{...U1(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Do("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>As(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?U1():(o=e.initialState.pagination)!=null?o:U1())},e.setPageIndex=r=>{e.setPagination(o=>{let i=As(r,o.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,a)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?T_:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:T_)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?D_:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:D_)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,As(r,o.pageSize)),a=o.pageSize*o.pageIndex,s=Math.floor(a/i);return{...o,pageIndex:s,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let a=As(r,(i=e.options.pageCount)!=null?i:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...o,pageCount:a}}),e.getPageOptions=ct(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,a)=>a)),o},{key:process.env.NODE_ENV==="development"&&"getPageOptions",debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugTable}}),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},q1=()=>({left:[],right:[]}),G1=()=>({top:[],bottom:[]}),vce={getInitialState:e=>({columnPinning:q1(),rowPinning:G1(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Do("columnPinning",e),onRowPinningChange:Do("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,a;if(n==="right"){var s,l;return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((a=o==null?void 0:o.right)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,a;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(s=>s.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(s=>r==null?void 0:r.includes(s)),a=n.some(s=>o==null?void 0:o.includes(s));return i?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],a=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],s=new Set([...a,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,h;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(b=>!(s!=null&&s.has(b))),bottom:[...((h=l==null?void 0:l.bottom)!=null?h:[]).filter(b=>!(s!=null&&s.has(b))),...Array.from(s)]}}if(n==="top"){var p,v;return{top:[...((p=l==null?void 0:l.top)!=null?p:[]).filter(b=>!(s!=null&&s.has(b))),...Array.from(s)],bottom:((v=l==null?void 0:l.bottom)!=null?v:[]).filter(b=>!(s!=null&&s.has(b)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(b=>!(s!=null&&s.has(b))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(b=>!(s!=null&&s.has(b)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(s=>r==null?void 0:r.includes(s)),a=n.some(s=>o==null?void 0:o.includes(s));return i?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=t._getPinnedRows(o))==null?void 0:n.map(a=>{let{id:s}=a;return s});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(a=>!i.includes(a.column.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getLeftVisibleCells=ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,r)=>(r??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),{key:process.env.NODE_ENV==="development"&&"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getRightVisibleCells=ct(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),{key:process.env.NODE_ENV==="development"&&"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?q1():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:q1())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getLeftLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getRightLeafColumns=ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getRightLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getCenterLeafColumns=ct(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},{key:process.env.NODE_ENV==="development"&&"getCenterLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?G1():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:G1())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=t=>ct(()=>[e.getRowModel().rows,e.getState().rowPinning[t]],(n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(r??[]).map(a=>{const s=e.getRow(a,!0);return s.getIsAllParentsExpanded()?s:null}):(r??[]).map(a=>n.find(s=>s.id===a))).filter(Boolean).map(a=>({...a,position:t}))},{key:process.env.NODE_ENV==="development"&&`row.get${t==="top"?"Top":"Bottom"}Rows`,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})(),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=ct(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterRows",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugRows}})}},yce={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Do("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{A_(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ct(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Y1(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="development"&&"getSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getFilteredSelectedRowModel=ct(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Y1(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getGroupedSelectedRowModel=ct(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Y1(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var a;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const s={...i};return A_(s,e.id,n,(a=r==null?void 0:r.selectChildren)!=null?a:!0,t),s})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return wE(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return M_(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return M_(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},A_=(e,t,n,r,o)=>{var i;const a=o.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=a.subRows)!=null&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach(s=>A_(e,s.id,n,r,o))};function Y1(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(a,s){return a.map(l=>{var c;const u=wE(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function wE(e,t){var n;return(n=t[e.id])!=null?n:!1}function M_(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(a=>{if(!(i&&!o)&&(a.getCanSelect()&&(wE(a,t)?i=!0:o=!1),a.subRows&&a.subRows.length)){const s=M_(a,t);s==="all"?i=!0:(s==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const k_=/([0-9]+)/gm,xce=(e,t,n)=>kI(Gs(e.getValue(n)).toLowerCase(),Gs(t.getValue(n)).toLowerCase()),wce=(e,t,n)=>kI(Gs(e.getValue(n)),Gs(t.getValue(n))),_ce=(e,t,n)=>_E(Gs(e.getValue(n)).toLowerCase(),Gs(t.getValue(n)).toLowerCase()),Sce=(e,t,n)=>_E(Gs(e.getValue(n)),Gs(t.getValue(n))),Cce=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Ece=(e,t,n)=>_E(e.getValue(n),t.getValue(n));function _E(e,t){return e===t?0:e>t?1:-1}function Gs(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function kI(e,t){const n=e.split(k_).filter(Boolean),r=t.split(k_).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),a=parseInt(o,10),s=parseInt(i,10),l=[a,s].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(a)?-1:1;if(a>s)return 1;if(s>a)return-1}return n.length-r.length}const cf={alphanumeric:xce,alphanumericCaseSensitive:wce,text:_ce,textCaseSensitive:Sce,datetime:Cce,basic:Ece},Rce={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Do("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return cf.datetime;if(typeof i=="string"&&(r=!0,i.split(k_).length>1))return cf.alphanumeric}return r?cf.text:cf.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return K0(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:cf[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(a=>{const s=a==null?void 0:a.find(p=>p.id===e.id),l=a==null?void 0:a.findIndex(p=>p.id===e.id);let c=[],u,d=i?n:o==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?s?u="toggle":u="add":a!=null&&a.length&&l!==a.length-1?u="replace":s?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var h;c=[...a,{id:e.id,desc:d}],c.splice(0,c.length-((h=t.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=a.map(p=>p.id===e.id?{...p,desc:d}:p):u==="remove"?c=a.filter(p=>p.id!==e.id):c=[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:a==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Pce={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Do("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;return(n=(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ct(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),{key:process.env.NODE_ENV==="production"&&"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getVisibleCells=ct(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],{key:process.env.NODE_ENV==="development"&&"row.getVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{const t=(n,r)=>ct(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),{key:n,debug:()=>{var o;return(o=e.options.debugAll)!=null?o:e.options.debugColumns}});e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}},ZT=[ece,Pce,mce,vce,oce,Rce,pce,rce,bce,yce,tce];function $ce(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:ZT};const r=n._features.reduce((u,d)=>Object.assign(u,d.getDefaultOptions==null?void 0:d.getDefaultOptions(n)),{}),o=u=>n.options.mergeOptions?n.options.mergeOptions(r,u):{...r,...u};let a={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(u=>{var d;a=(d=u.getInitialState==null?void 0:u.getInitialState(a))!=null?d:a});const s=[];let l=!1;const c={_features:ZT,options:{...r,...e},initialState:a,_queue:u=>{s.push(u),l||(l=!0,Promise.resolve().then(()=>{for(;s.length;)s.shift()();l=!1}).catch(d=>setTimeout(()=>{throw d})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const d=As(u,n.options);n.options=o(d)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,d,h)=>{var p;return(p=n.options.getRowId==null?void 0:n.options.getRowId(u,d,h))!=null?p:`${h?[h.id,d].join("."):d}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(u,d)=>{let h=(d?n.getPrePaginationRowModel():n.getRowModel()).rowsById[u];if(!h&&(h=n.getCoreRowModel().rowsById[u],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${u}`):new Error;return h},_getDefaultColumnDef:ct(()=>[n.options.defaultColumn],u=>{var d;return u=(d=u)!=null?d:{},{header:h=>{const p=h.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:h=>{var p,v;return(p=(v=h.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...n._features.reduce((h,p)=>Object.assign(h,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...u}},{debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:ct(()=>[n._getColumnDefs()],u=>{const d=function(h,p,v){return v===void 0&&(v=0),h.map(b=>{const x=Zle(n,b,v,p),y=b;return x.columns=y.columns?d(y.columns,x,v+1):[],x})};return d(u)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:ct(()=>[n.getAllColumns()],u=>u.flatMap(d=>d.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:ct(()=>[n.getAllFlatColumns()],u=>u.reduce((d,h)=>(d[h.id]=h,d),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:ct(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,d)=>{let h=u.flatMap(p=>p.getLeafColumns());return d(h)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>{const d=n._getAllFlatColumnsById()[u];return process.env.NODE_ENV!=="production"&&!d&&console.error(`[Table] Column with id '${u}' does not exist.`),d}};Object.assign(n,c);for(let u=0;u<n._features.length;u++){const d=n._features[u];d==null||d.createTable==null||d.createTable(n)}return n}function Oce(e,t,n,r){const o=()=>{var a;return(a=i.getValue())!=null?a:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:ct(()=>[e,n,t,i],(a,s,l,c)=>({table:a,column:s,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),{key:process.env.NODE_ENV==="development"&&"cell.getContext",debug:()=>e.options.debugAll})};return e._features.forEach(a=>{a.createCell==null||a.createCell(i,n,t,e)},{}),i}const Tce=(e,t,n,r,o,i,a)=>{let s={id:t,index:r,original:n,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(s._valuesCache.hasOwnProperty(l))return s._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return s._valuesCache[l]=c.accessorFn(s.original,r),s._valuesCache[l]},getUniqueValues:l=>{if(s._uniqueValuesCache.hasOwnProperty(l))return s._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(s._uniqueValuesCache[l]=c.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[l]):(s._uniqueValuesCache[l]=[s.getValue(l)],s._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=s.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>Jle(s.subRows,l=>l.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let l=[],c=s;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:ct(()=>[e.getAllLeafColumns()],l=>l.map(c=>Oce(e,s,c,c.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:ct(()=>[s.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),{key:process.env.NODE_ENV==="production"&&"row.getAllCellsByColumnId",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}})};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(s,e)}return s};function II(){return e=>ct(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,a){i===void 0&&(i=0);const s=[];for(let c=0;c<o.length;c++){const u=Tce(e,e._getRowId(o[c],c,a),o[c],c,i,void 0,a==null?void 0:a.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,s.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return s};return n.rows=r(t),n},{key:process.env.NODE_ENV==="development"&&"getRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function NI(){return e=>ct(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),a={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(a[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const s=l=>{const c=l.map(u=>({...u}));return c.sort((u,d)=>{for(let p=0;p<i.length;p+=1){var h;const v=i[p],b=a[v.id],x=(h=v==null?void 0:v.desc)!=null?h:!1;let y=0;if(b.sortUndefined){const _=u.getValue(v.id),S=d.getValue(v.id),C=_===void 0,E=S===void 0;(C||E)&&(y=C&&E?0:C?b.sortUndefined:-b.sortUndefined)}if(y===0&&(y=b.sortingFn(u,d,v.id)),y!==0)return x&&(y*=-1),b.invertSorting&&(y*=-1),y}return u.index-d.index}),c.forEach(u=>{var d;o.push(u),(d=u.subRows)!=null&&d.length&&(u.subRows=s(u.subRows))}),c};return{rows:s(n.rows),flatRows:o,rowsById:n.rowsById}},{key:process.env.NODE_ENV==="development"&&"getSortedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Dce(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function LI(e){return t=>ct(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:a,flatRows:s,rowsById:l}=r;const c=o*i,u=c+o;a=a.slice(c,u);let d;t.options.paginateExpandedRows?d={rows:a,flatRows:s,rowsById:l}:d=Dce({rows:a,flatRows:s,rowsById:l}),d.flatRows=[];const h=p=>{d.flatRows.push(p),p.subRows.length&&p.subRows.forEach(h)};return d.rows.forEach(h),d},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
270
+ * react-table
271
+ *
272
+ * Copyright (c) TanStack
273
+ *
274
+ * This source code is licensed under the MIT license found in the
275
+ * LICENSE.md file in the root directory of this source tree.
276
+ *
277
+ * @license MIT
278
+ */function I_(e,t){return e?Ace(e)?j.createElement(e,t):e:null}function Ace(e){return Mce(e)||typeof e=="function"||kce(e)}function Mce(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function kce(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function FI(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=j.useState(()=>({current:$ce(t)})),[r,o]=j.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:a=>{o(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}let K1=0;function SE(){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:eD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:eD()),K1++,()=>{K1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),K1--}},[])}function eD(){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 X1="focusScope.autoFocusOnMount",Q1="focusScope.autoFocusOnUnmount",tD={bubbles:!1,cancelable:!0},CE=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=m.useState(null),c=Xn(o),u=Xn(i),d=m.useRef(null),h=Rt(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(S){if(p.paused||!s)return;const C=S.target;s.contains(C)?d.current=C:ms(d.current,{select:!0})},x=function(S){if(p.paused||!s)return;const C=S.relatedTarget;C!==null&&(s.contains(C)||ms(d.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&ms(s)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const _=new MutationObserver(y);return s&&_.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),_.disconnect()}}},[r,s,p.paused]),m.useEffect(()=>{if(s){rD.add(p);const b=document.activeElement;if(!s.contains(b)){const y=new CustomEvent(X1,tD);s.addEventListener(X1,c),s.dispatchEvent(y),y.defaultPrevented||(Ice(zce(jI(s)),{select:!0}),document.activeElement===b&&ms(s))}return()=>{s.removeEventListener(X1,c),setTimeout(()=>{const y=new CustomEvent(Q1,tD);s.addEventListener(Q1,u),s.dispatchEvent(y),y.defaultPrevented||ms(b??document.body,{select:!0}),s.removeEventListener(Q1,u),rD.remove(p)},0)}}},[s,c,u,p]);const v=m.useCallback(b=>{if(!n&&!r||p.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,y=document.activeElement;if(x&&y){const _=b.currentTarget,[S,C]=Nce(_);S&&C?!b.shiftKey&&y===C?(b.preventDefault(),n&&ms(S,{select:!0})):b.shiftKey&&y===S&&(b.preventDefault(),n&&ms(C,{select:!0})):y===_&&b.preventDefault()}},[n,r,p.paused]);return m.createElement(Qe.div,ue({tabIndex:-1},a,{ref:h,onKeyDown:v}))});function Ice(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ms(r,{select:t}),document.activeElement!==n)return}function Nce(e){const t=jI(e),n=nD(t,e),r=nD(t.reverse(),e);return[n,r]}function jI(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nD(e,t){for(const n of e)if(!Lce(n,{upTo:t}))return n}function Lce(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 Fce(e){return e instanceof HTMLInputElement&&"select"in e}function ms(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Fce(e)&&t&&e.select()}}const rD=jce();function jce(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=oD(e,t),e.unshift(t)},remove(t){var n;e=oD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function oD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zce(e){return e.filter(t=>t.tagName!=="A")}const zI=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Vce);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(N_,ue({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(N_,ue({},r,{ref:t}),n)});zI.displayName="Slot";const N_=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Hce(r,n.props),ref:t?Ba(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});N_.displayName="SlotClone";const Bce=({children:e})=>m.createElement(m.Fragment,null,e);function Vce(e){return m.isValidElement(e)&&e.type===Bce}function Hce(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function lv(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Wce=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xc=new WeakMap,hm=new WeakMap,pm={},J1=0,BI=function(e){return e&&(e.host||BI(e.parentNode))},Uce=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=BI(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})},qce=function(e,t,n,r){var o=Uce(t,Array.isArray(e)?e:[e]);pm[n]||(pm[n]=new WeakMap);var i=pm[n],a=[],s=new Set,l=new Set(o),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(s.has(h))u(h);else{var p=h.getAttribute(r),v=p!==null&&p!=="false",b=(Xc.get(h)||0)+1,x=(i.get(h)||0)+1;Xc.set(h,b),i.set(h,x),a.push(h),b===1&&v&&hm.set(h,!0),x===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}})};return u(t),s.clear(),J1++,function(){a.forEach(function(d){var h=Xc.get(d)-1,p=i.get(d)-1;Xc.set(d,h),i.set(d,p),h||(hm.has(d)||d.removeAttribute(r),hm.delete(d)),p||d.removeAttribute(n)}),J1--,J1||(Xc=new WeakMap,Xc=new WeakMap,hm=new WeakMap,pm={})}},_p=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Wce(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),qce(r,o,n,"aria-hidden")):function(){return null}},Nn=function(){return Nn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Nn.apply(this,arguments)};function cv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function EE(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Eu="right-scroll-bar-position",Ru="width-before-scroll-bar",Gce="with-scroll-bars-hidden",Yce="--removed-body-scroll-bar-size";function Kce(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Xce(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function RE(e,t){return Xce(t||null,function(n){return e.forEach(function(r){return Kce(r,n)})})}function Qce(e){return e}function Jce(e,t){t===void 0&&(t=Qce);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var l=function(){var u=a;a=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),n}}}};return o}function PE(e){e===void 0&&(e={});var t=Jce(null);return t.options=Nn({async:!0,ssr:!1},e),t}var VI=function(e){var t=e.sideCar,n=cv(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 j.createElement(r,Nn({},n))};VI.isSideCarExport=!0;function $E(e,t){return e.useMedium(t),VI}var HI=PE(),Z1=function(){},uv=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:Z1,onWheelCapture:Z1,onTouchMoveCapture:Z1}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,p=e.noIsolation,v=e.inert,b=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,_=cv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=h,C=RE([n,t]),E=Nn(Nn({},_),o);return j.createElement(j.Fragment,null,u&&j.createElement(S,{sideCar:HI,removeScrollBar:c,shards:d,noIsolation:p,inert:v,setCallbacks:i,allowPinchZoom:!!b,lockRef:n}),a?j.cloneElement(j.Children.only(s),Nn(Nn({},E),{ref:C})):j.createElement(y,Nn({},E,{className:l,ref:C}),s))});uv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};uv.classNames={fullWidth:Ru,zeroRight:Eu};var iD,Zce=function(){if(iD)return iD;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function eue(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Zce();return t&&e.setAttribute("nonce",t),e}function tue(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function nue(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var rue=function(){var e=0,t=null;return{add:function(n){e==0&&(t=eue())&&(tue(t,n),nue(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oue=function(){var e=rue();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dv=function(){var e=oue(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},iue={left:0,top:0,right:0,gap:0},ex=function(e){return parseInt(e||"",10)||0},aue=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ex(n),ex(r),ex(o)]},sue=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return iue;var t=aue(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])}},lue=dv(),cue=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
279
+ .`.concat(Gce,` {
280
+ overflow: hidden `).concat(r,`;
281
+ padding-right: `).concat(s,"px ").concat(r,`;
282
+ }
283
+ body {
284
+ overflow: hidden `).concat(r,`;
285
+ overscroll-behavior: contain;
286
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
287
+ padding-left: `.concat(o,`px;
288
+ padding-top: `).concat(i,`px;
289
+ padding-right: `).concat(a,`px;
290
+ margin-left:0;
291
+ margin-top:0;
292
+ margin-right: `).concat(s,"px ").concat(r,`;
293
+ `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
294
+ }
295
+
296
+ .`).concat(Eu,` {
297
+ right: `).concat(s,"px ").concat(r,`;
298
+ }
299
+
300
+ .`).concat(Ru,` {
301
+ margin-right: `).concat(s,"px ").concat(r,`;
302
+ }
303
+
304
+ .`).concat(Eu," .").concat(Eu,` {
305
+ right: 0 `).concat(r,`;
306
+ }
307
+
308
+ .`).concat(Ru," .").concat(Ru,` {
309
+ margin-right: 0 `).concat(r,`;
310
+ }
311
+
312
+ body {
313
+ `).concat(Yce,": ").concat(s,`px;
314
+ }
315
+ `)},OE=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=j.useMemo(function(){return sue(o)},[o]);return j.createElement(lue,{styles:cue(i,!t,o,n?"":"!important")})},L_=!1;if(typeof window<"u")try{var gm=Object.defineProperty({},"passive",{get:function(){return L_=!0,!0}});window.addEventListener("test",gm,gm),window.removeEventListener("test",gm,gm)}catch{L_=!1}var Qc=L_?{passive:!1}:!1,uue=function(e){return e.tagName==="TEXTAREA"},WI=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uue(e)&&n[t]==="visible")},due=function(e){return WI(e,"overflowY")},fue=function(e){return WI(e,"overflowX")},aD=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=UI(e,n);if(r){var o=qI(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},hue=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},pue=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},UI=function(e,t){return e==="v"?due(t):fue(t)},qI=function(e,t){return e==="v"?hue(t):pue(t)},gue=function(e,t){return e==="h"&&t==="rtl"?-1:1},mue=function(e,t,n,r,o){var i=gue(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,h=0;do{var p=qI(e,s),v=p[0],b=p[1],x=p[2],y=b-x-i*v;(v||y)&&UI(e,s)&&(d+=y,h+=v),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(o&&d===0||!o&&a>d)||!u&&(o&&h===0||!o&&-a>h))&&(c=!0),c},mm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sD=function(e){return[e.deltaX,e.deltaY]},lD=function(e){return e&&"current"in e?e.current:e},bue=function(e,t){return e[0]===t[0]&&e[1]===t[1]},vue=function(e){return`
316
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
317
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
318
+ `)},yue=0,Jc=[];function xue(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),o=j.useState(yue++)[0],i=j.useState(function(){return dv()})[0],a=j.useRef(e);j.useEffect(function(){a.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=EE([e.lockRef.current],(e.shards||[]).map(lD),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=j.useCallback(function(b,x){if("touches"in b&&b.touches.length===2)return!a.current.allowPinchZoom;var y=mm(b),_=n.current,S="deltaX"in b?b.deltaX:_[0]-y[0],C="deltaY"in b?b.deltaY:_[1]-y[1],E,$=b.target,T=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in b&&T==="h"&&$.type==="range")return!1;var D=aD(T,$);if(!D)return!0;if(D?E=T:(E=T==="v"?"h":"v",D=aD(T,$)),!D)return!1;if(!r.current&&"changedTouches"in b&&(S||C)&&(r.current=E),!E)return!0;var M=r.current||E;return mue(M,x,b,M==="h"?S:C,!0)},[]),l=j.useCallback(function(b){var x=b;if(!(!Jc.length||Jc[Jc.length-1]!==i)){var y="deltaY"in x?sD(x):mm(x),_=t.current.filter(function(E){return E.name===x.type&&E.target===x.target&&bue(E.delta,y)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var S=(a.current.shards||[]).map(lD).filter(Boolean).filter(function(E){return E.contains(x.target)}),C=S.length>0?s(x,S[0]):!a.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),c=j.useCallback(function(b,x,y,_){var S={name:b,delta:x,target:y,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=j.useCallback(function(b){n.current=mm(b),r.current=void 0},[]),d=j.useCallback(function(b){c(b.type,sD(b),b.target,s(b,e.lockRef.current))},[]),h=j.useCallback(function(b){c(b.type,mm(b),b.target,s(b,e.lockRef.current))},[]);j.useEffect(function(){return Jc.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Qc),document.addEventListener("touchmove",l,Qc),document.addEventListener("touchstart",u,Qc),function(){Jc=Jc.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,Qc),document.removeEventListener("touchmove",l,Qc),document.removeEventListener("touchstart",u,Qc)}},[]);var p=e.removeScrollBar,v=e.inert;return j.createElement(j.Fragment,null,v?j.createElement(i,{styles:vue(o)}):null,p?j.createElement(OE,{gapMode:"margin"}):null)}const wue=$E(HI,xue);var GI=j.forwardRef(function(e,t){return j.createElement(uv,Nn({},e,{ref:t,sideCar:wue}))});GI.classNames=uv.classNames;const TE=GI,_ue=[" ","Enter","ArrowUp","ArrowDown"],Sue=[" ","Enter"],fv="Select",[hv,pv,Cue]=_b(fv),[Sd,l5e]=hr(fv,[Cue,oa]),DE=oa(),[Eue,_c]=Sd(fv),[Rue,Pue]=Sd(fv),$ue=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:h,required:p}=e,v=DE(t),[b,x]=m.useState(null),[y,_]=m.useState(null),[S,C]=m.useState(!1),E=vc(c),[$=!1,T]=Fr({prop:r,defaultProp:o,onChange:i}),[D,M]=Fr({prop:a,defaultProp:s,onChange:l}),L=m.useRef(null),F=b?!!b.closest("form"):!0,[z,X]=m.useState(new Set),G=Array.from(z).map(A=>A.props.value).join(";");return m.createElement(mp,v,m.createElement(Eue,{required:p,scope:t,trigger:b,onTriggerChange:x,valueNode:y,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:yi(),value:D,onValueChange:M,open:$,onOpenChange:T,dir:E,triggerPointerDownPosRef:L,disabled:h},m.createElement(hv.Provider,{scope:t},m.createElement(Rue,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(A=>{X(U=>new Set(U).add(A))},[]),onNativeOptionRemove:m.useCallback(A=>{X(U=>{const V=new Set(U);return V.delete(A),V})},[])},n)),F?m.createElement(JI,{key:G,"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:D,onChange:A=>M(A.target.value),disabled:h},D===void 0?m.createElement("option",{value:""}):null,Array.from(z)):null))},Oue="SelectTrigger",Tue=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=DE(n),a=_c(Oue,n),s=a.disabled||r,l=Rt(t,a.onTriggerChange),c=pv(n),[u,d,h]=ZI(v=>{const b=c().filter(_=>!_.disabled),x=b.find(_=>_.value===a.value),y=e8(b,v,x);y!==void 0&&a.onValueChange(y.value)}),p=()=>{s||(a.onOpenChange(!0),h())};return m.createElement(bp,ue({asChild:!0},i),m.createElement(Qe.button,ue({type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":QI(a.value)?"":void 0},o,{ref:l,onClick:ke(o.onClick,v=>{v.currentTarget.focus()}),onPointerDown:ke(o.onPointerDown,v=>{const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(p(),a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:ke(o.onKeyDown,v=>{const b=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&d(v.key),!(b&&v.key===" ")&&_ue.includes(v.key)&&(p(),v.preventDefault())})})))}),Due="SelectValue",Aue=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=_c(Due,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=Rt(t,l.onValueNodeChange);return Cr(()=>{c(u)},[c,u]),m.createElement(Qe.span,ue({},s,{ref:d,style:{pointerEvents:"none"}}),QI(l.value)?m.createElement(m.Fragment,null,a):i)}),Mue=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Qe.span,ue({"aria-hidden":!0},o,{ref:t}),r||"▼")}),kue=e=>m.createElement(aE,ue({asChild:!0},e)),ld="SelectContent",Iue=m.forwardRef((e,t)=>{const n=_c(ld,e.__scopeSelect),[r,o]=m.useState();if(Cr(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Er.createPortal(m.createElement(YI,{scope:e.__scopeSelect},m.createElement(hv.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(Nue,ue({},e,{ref:t}))}),Ca=10,[YI,Sc]=Sd(ld),Nue=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:v,hideWhenDetached:b,avoidCollisions:x,...y}=e,_=_c(ld,n),[S,C]=m.useState(null),[E,$]=m.useState(null),T=Rt(t,he=>C(he)),[D,M]=m.useState(null),[L,F]=m.useState(null),z=pv(n),[X,G]=m.useState(!1),A=m.useRef(!1);m.useEffect(()=>{if(S)return _p(S)},[S]),SE();const U=m.useCallback(he=>{const[ie,...re]=z().map(Z=>Z.ref.current),[le]=re.slice(-1),xe=document.activeElement;for(const Z of he)if(Z===xe||(Z==null||Z.scrollIntoView({block:"nearest"}),Z===ie&&E&&(E.scrollTop=0),Z===le&&E&&(E.scrollTop=E.scrollHeight),Z==null||Z.focus(),document.activeElement!==xe))return},[z,E]),V=m.useCallback(()=>U([D,S]),[U,D,S]);m.useEffect(()=>{X&&V()},[X,V]);const{onOpenChange:K,triggerPointerDownPosRef:q}=_;m.useEffect(()=>{if(S){let he={x:0,y:0};const ie=le=>{var xe,Z,ve,Ce;he={x:Math.abs(Math.round(le.pageX)-((xe=(Z=q.current)===null||Z===void 0?void 0:Z.x)!==null&&xe!==void 0?xe:0)),y:Math.abs(Math.round(le.pageY)-((ve=(Ce=q.current)===null||Ce===void 0?void 0:Ce.y)!==null&&ve!==void 0?ve:0))}},re=le=>{he.x<=10&&he.y<=10?le.preventDefault():S.contains(le.target)||K(!1),document.removeEventListener("pointermove",ie),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",re,{capture:!0})}}},[S,K,q]),m.useEffect(()=>{const he=()=>K(!1);return window.addEventListener("blur",he),window.addEventListener("resize",he),()=>{window.removeEventListener("blur",he),window.removeEventListener("resize",he)}},[K]);const[O,H]=ZI(he=>{const ie=z().filter(xe=>!xe.disabled),re=ie.find(xe=>xe.ref.current===document.activeElement),le=e8(ie,he,re);le&&setTimeout(()=>le.ref.current.focus())}),Y=m.useCallback((he,ie,re)=>{const le=!A.current&&!re;(_.value!==void 0&&_.value===ie||le)&&(M(he),le&&(A.current=!0))},[_.value]),I=m.useCallback(()=>S==null?void 0:S.focus(),[S]),te=m.useCallback((he,ie,re)=>{const le=!A.current&&!re;(_.value!==void 0&&_.value===ie||le)&&F(he)},[_.value]),ce=r==="popper"?cD:Lue,de=ce===cD?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:v,hideWhenDetached:b,avoidCollisions:x}:{};return m.createElement(YI,{scope:n,content:S,viewport:E,onViewportChange:$,itemRefCallback:Y,selectedItem:D,onItemLeave:I,itemTextRefCallback:te,focusSelectedItem:V,selectedItemText:L,position:r,isPositioned:X,searchRef:O},m.createElement(TE,{as:zI,allowPinchZoom:!0},m.createElement(CE,{asChild:!0,trapped:_.open,onMountAutoFocus:he=>{he.preventDefault()},onUnmountAutoFocus:ke(o,he=>{var ie;(ie=_.trigger)===null||ie===void 0||ie.focus({preventScroll:!0}),he.preventDefault()})},m.createElement(yp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:he=>he.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(ce,ue({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:he=>he.preventDefault()},y,de,{onPlaced:()=>G(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ke(y.onKeyDown,he=>{const ie=he.ctrlKey||he.altKey||he.metaKey;if(he.key==="Tab"&&he.preventDefault(),!ie&&he.key.length===1&&H(he.key),["ArrowUp","ArrowDown","Home","End"].includes(he.key)){let le=z().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(he.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(he.key)){const xe=he.target,Z=le.indexOf(xe);le=le.slice(Z+1)}setTimeout(()=>U(le)),he.preventDefault()}})}))))))}),Lue=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=_c(ld,n),a=Sc(ld,n),[s,l]=m.useState(null),[c,u]=m.useState(null),d=Rt(t,T=>u(T)),h=pv(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:y,focusSelectedItem:_}=a,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&c&&b&&x&&y){const T=i.trigger.getBoundingClientRect(),D=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),L=y.getBoundingClientRect();if(i.dir!=="rtl"){const xe=L.left-D.left,Z=M.left-xe,ve=T.left-Z,Ce=T.width+ve,Oe=Math.max(Ce,D.width),Te=window.innerWidth-Ca,We=R_(Z,[Ca,Te-Oe]);s.style.minWidth=Ce+"px",s.style.left=We+"px"}else{const xe=D.right-L.right,Z=window.innerWidth-M.right-xe,ve=window.innerWidth-T.right-Z,Ce=T.width+ve,Oe=Math.max(Ce,D.width),Te=window.innerWidth-Ca,We=R_(Z,[Ca,Te-Oe]);s.style.minWidth=Ce+"px",s.style.right=We+"px"}const F=h(),z=window.innerHeight-Ca*2,X=b.scrollHeight,G=window.getComputedStyle(c),A=parseInt(G.borderTopWidth,10),U=parseInt(G.paddingTop,10),V=parseInt(G.borderBottomWidth,10),K=parseInt(G.paddingBottom,10),q=A+U+X+K+V,O=Math.min(x.offsetHeight*5,q),H=window.getComputedStyle(b),Y=parseInt(H.paddingTop,10),I=parseInt(H.paddingBottom,10),te=T.top+T.height/2-Ca,ce=z-te,de=x.offsetHeight/2,he=x.offsetTop+de,ie=A+U+he,re=q-ie;if(ie<=te){const xe=x===F[F.length-1].ref.current;s.style.bottom="0px";const Z=c.clientHeight-b.offsetTop-b.offsetHeight,ve=Math.max(ce,de+(xe?I:0)+Z+V),Ce=ie+ve;s.style.height=Ce+"px"}else{const xe=x===F[0].ref.current;s.style.top="0px";const ve=Math.max(te,A+b.offsetTop+(xe?Y:0)+de)+re;s.style.height=ve+"px",b.scrollTop=ie-te+b.offsetTop}s.style.margin=`${Ca}px 0`,s.style.minHeight=O+"px",s.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,s,c,b,x,y,i.dir,r]);Cr(()=>S(),[S]);const[C,E]=m.useState();Cr(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const $=m.useCallback(T=>{T&&v.current===!0&&(S(),_==null||_(),v.current=!1)},[S,_]);return m.createElement(Fue,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:$},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C}},m.createElement(Qe.div,ue({},o,{ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),cD=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ca,...i}=e,a=DE(n);return m.createElement(vp,ue({},a,i,{ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[Fue,AE]=Sd(ld,{}),uD="SelectViewport",jue=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Sc(uD,n),i=AE(uD,n),a=Rt(t,o.onViewportChange),s=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(hv.Slot,{scope:n},m.createElement(Qe.div,ue({"data-radix-select-viewport":"",role:"presentation"},r,{ref:a,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:ke(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:d}=i;if(d!=null&&d.current&&u){const h=Math.abs(s.current-c.scrollTop);if(h>0){const p=window.innerHeight-Ca*2,v=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),x=Math.max(v,b);if(x<p){const y=x+h,_=Math.min(p,y),S=y-_;u.style.height=_+"px",u.style.bottom==="0px"&&(c.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}s.current=c.scrollTop})}))))}),zue="SelectGroup",[Bue,Vue]=Sd(zue),Hue=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=yi();return m.createElement(Bue,{scope:n,id:o},m.createElement(Qe.div,ue({role:"group","aria-labelledby":o},r,{ref:t})))}),Wue="SelectLabel",Uue=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Vue(Wue,n);return m.createElement(Qe.div,ue({id:o.id},r,{ref:t}))}),F_="SelectItem",[que,KI]=Sd(F_),Gue=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,s=_c(F_,n),l=Sc(F_,n),c=s.value===r,[u,d]=m.useState(i??""),[h,p]=m.useState(!1),v=Rt(t,y=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,y,r,o)}),b=yi(),x=()=>{o||(s.onValueChange(r),s.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(que,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:m.useCallback(y=>{d(_=>{var S;return _||((S=y==null?void 0:y.textContent)!==null&&S!==void 0?S:"").trim()})},[])},m.createElement(hv.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(Qe.div,ue({role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},a,{ref:v,onFocus:ke(a.onFocus,()=>p(!0)),onBlur:ke(a.onBlur,()=>p(!1)),onPointerUp:ke(a.onPointerUp,x),onPointerMove:ke(a.onPointerMove,y=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(a.onPointerLeave,y=>{if(y.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:ke(a.onKeyDown,y=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&y.key===" "||(Sue.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})}))))}),bm="SelectItemText",Yue=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=_c(bm,n),s=Sc(bm,n),l=KI(bm,n),c=Pue(bm,n),[u,d]=m.useState(null),h=Rt(t,y=>d(y),l.onItemTextChange,y=>{var _;return(_=s.itemTextRefCallback)===null||_===void 0?void 0:_.call(s,y,l.value,l.disabled)}),p=u==null?void 0:u.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 Cr(()=>(b(v),()=>x(v)),[b,x,v]),m.createElement(m.Fragment,null,m.createElement(Qe.span,ue({id:l.textId},i,{ref:h})),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Er.createPortal(i.children,a.valueNode):null)}),Kue="SelectItemIndicator",Xue=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return KI(Kue,n).isSelected?m.createElement(Qe.span,ue({"aria-hidden":!0},r,{ref:t})):null}),dD="SelectScrollUpButton",Que=m.forwardRef((e,t)=>{const n=Sc(dD,e.__scopeSelect),r=AE(dD,e.__scopeSelect),[o,i]=m.useState(!1),a=Rt(t,r.onScrollButtonChange);return Cr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=s.scrollTop>0;i(c)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(XI,ue({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}})):null}),fD="SelectScrollDownButton",Jue=m.forwardRef((e,t)=>{const n=Sc(fD,e.__scopeSelect),r=AE(fD,e.__scopeSelect),[o,i]=m.useState(!1),a=Rt(t,r.onScrollButtonChange);return Cr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=s.scrollHeight-s.clientHeight,u=Math.ceil(s.scrollTop)<c;i(u)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(XI,ue({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}})):null}),XI=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Sc("SelectScrollButton",n),a=m.useRef(null),s=pv(n),l=m.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),Cr(()=>{var c;const u=s().find(d=>d.ref.current===document.activeElement);u==null||(c=u.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[s]),m.createElement(Qe.div,ue({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:ke(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:ke(o.onPointerMove,()=>{var c;(c=i.onItemLeave)===null||c===void 0||c.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:ke(o.onPointerLeave,()=>{l()})}))}),Zue=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Qe.div,ue({"aria-hidden":!0},r,{ref:t}))});function QI(e){return e===""||e===void 0}const JI=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=Rt(t,o),a=lv(n);return m.useEffect(()=>{const s=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&u){const d=new Event("change",{bubbles:!0});u.call(s,n),s.dispatchEvent(d)}},[a,n]),m.createElement(J7,{asChild:!0},m.createElement("select",ue({},r,{ref:i,defaultValue:n})))});JI.displayName="BubbleSelect";function ZI(e){const t=Xn(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(a=>{const s=n.current+a;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function e8(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=ede(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function ede(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const tde=$ue,t8=Tue,nde=Aue,rde=Mue,ode=kue,n8=Iue,ide=jue,ade=Hue,r8=Uue,o8=Gue,sde=Yue,lde=Xue,i8=Que,a8=Jue,s8=Zue,Ea=tde,lu=ade,Ra=nde,Mi=j.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(t8,{ref:r,className:ye("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,R.jsx(rde,{asChild:!0,children:R.jsx(Fb,{className:"h-4 w-4 opacity-50"})})]}));Mi.displayName=t8.displayName;const l8=j.forwardRef(({className:e,...t},n)=>R.jsx(i8,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:R.jsx(y6,{className:"h-4 w-4"})}));l8.displayName=i8.displayName;const c8=j.forwardRef(({className:e,...t},n)=>R.jsx(a8,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:R.jsx(Fb,{className:"h-4 w-4"})}));c8.displayName=a8.displayName;const ki=j.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>R.jsx(ode,{children:R.jsx(bc,{children:R.jsxs(n8,{ref:o,className:ye("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:[R.jsx(l8,{}),R.jsx(ide,{className:ye("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),R.jsx(c8,{})]})})}));ki.displayName=n8.displayName;const El=j.forwardRef(({className:e,...t},n)=>R.jsx(r8,{ref:n,className:ye("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));El.displayName=r8.displayName;const Hn=j.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(o8,{ref:r,className:ye("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:[R.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:R.jsx(lde,{children:R.jsx(up,{className:"h-4 w-4"})})}),R.jsx(sde,{children:t})]}));Hn.displayName=o8.displayName;const Kf=j.forwardRef(({className:e,...t},n)=>R.jsx(s8,{ref:n,className:ye("-mx-1 my-1 h-px bg-muted",e),...t}));Kf.displayName=s8.displayName;const Jl=j.forwardRef(({className:e,type:t,...n},r)=>R.jsx("input",{type:t,className:ye("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}));Jl.displayName="Input";const cde=m.forwardRef((e,t)=>m.createElement(Qe.label,ue({},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()}}))),u8=cde,ude=pE("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Tn=j.forwardRef(({className:e,...t},n)=>R.jsx(u8,{ref:n,className:ye(ude(),e),...t}));Tn.displayName=u8.displayName;const d8=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(fde);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(j_,ue({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(j_,ue({},r,{ref:t}),n)});d8.displayName="Slot";const j_=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...hde(r,n.props),ref:t?Ba(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});j_.displayName="SlotClone";const dde=({children:e})=>m.createElement(m.Fragment,null,e);function fde(e){return m.isValidElement(e)&&e.type===dde}function hde(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const f8="Popover",[h8,c5e]=hr(f8,[oa]),ME=oa(),[pde,Cd]=h8(f8),gde=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=ME(t),l=m.useRef(null),[c,u]=m.useState(!1),[d=!1,h]=Fr({prop:r,defaultProp:o,onChange:i});return m.createElement(mp,s,m.createElement(pde,{scope:t,contentId:yi(),triggerRef:l,open:d,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:a},n))},mde="PopoverTrigger",bde=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Cd(mde,n),i=ME(n),a=Rt(t,o.triggerRef),s=m.createElement(Qe.button,ue({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":m8(o.open)},r,{ref:a,onClick:ke(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?s:m.createElement(bp,ue({asChild:!0},i),s)}),p8="PopoverPortal",[vde,yde]=h8(p8,{forceMount:void 0}),xde=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Cd(p8,t);return m.createElement(vde,{scope:t,forceMount:n},m.createElement(pr,{present:n||i.open},m.createElement(aE,{asChild:!0,container:o},r)))},wh="PopoverContent",wde=m.forwardRef((e,t)=>{const n=yde(wh,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Cd(wh,e.__scopePopover);return m.createElement(pr,{present:r||i.open},i.modal?m.createElement(_de,ue({},o,{ref:t})):m.createElement(Sde,ue({},o,{ref:t})))}),_de=m.forwardRef((e,t)=>{const n=Cd(wh,e.__scopePopover),r=m.useRef(null),o=Rt(t,r),i=m.useRef(!1);return m.useEffect(()=>{const a=r.current;if(a)return _p(a)},[]),m.createElement(TE,{as:d8,allowPinchZoom:!0},m.createElement(g8,ue({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),i.current||(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ke(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})))}),Sde=m.forwardRef((e,t)=>{const n=Cd(wh,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(g8,ue({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a;if((a=e.onCloseAutoFocus)===null||a===void 0||a.call(e,i),!i.defaultPrevented){var s;r.current||(s=n.triggerRef.current)===null||s===void 0||s.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var a,s;(a=e.onInteractOutside)===null||a===void 0||a.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((s=n.triggerRef.current)===null||s===void 0?void 0:s.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),g8=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,h=Cd(wh,n),p=ME(n);return SE(),m.createElement(CE,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(yp,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1)},m.createElement(vp,ue({"data-state":m8(h.open),role:"dialog",id:h.contentId},p,d,{ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function m8(e){return e?"open":"closed"}const Cde=gde,Ede=bde,Rde=xde,b8=wde,gv=Cde,mv=Ede,Sp=j.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>R.jsx(Rde,{children:R.jsx(bc,{children:R.jsx(b8,{ref:o,align:t,sideOffset:n,className:ye("z-49 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})}));Sp.displayName=b8.displayName;function Pde(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}function v8({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(a,s,l){const c=[...e];c[a]={...c[a],[s]:l},t(c)}function o(a){const s=[...e];s.splice(a,1),t(s)}function i(){t([...e,n])}return R.jsxs("div",{className:"space-y-3",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx(Tn,{children:"Color Range"}),R.jsx(no,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:R.jsx(bC,{className:"size-3"})})]}),e.map((a,s)=>R.jsxs("div",{className:"flex items-center gap-2 px-2",children:[R.jsx(Jl,{onChange:l=>r(s,"start",l.target.value),value:a.start,className:ye(`h-7 ${Lf}`)}),R.jsx("span",{children:"-"}),R.jsx(Jl,{value:a.end,onChange:l=>r(s,"end",l.target.value),className:ye(`h-7 ${Lf}`)}),R.jsx(Jl,{onChange:l=>r(s,"color",l.target.value),value:a.color,className:ye(`h-7 min-w-14 p-0 ${Lf}`),type:"color",list:"presetColors"}),R.jsxs("datalist",{id:"presetColors",children:[R.jsx("option",{children:Yt.green[600]}),R.jsx("option",{children:Yt.red[500]}),R.jsx("option",{children:Yt.yellow[400]}),R.jsx("option",{children:Yt.orange[500]})]}),R.jsx(no,{onClick:()=>o(s),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:R.jsx(md,{className:"size-3"})})]},s))]})}const $de=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[a=!1,s]=Fr({prop:n,onChange:o,defaultProp:r});return m.createElement(Qe.button,ue({type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:ke(e.onClick,()=>{e.disabled||s(!a)})}))}),y8=$de,Ode=pE("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),kE=j.forwardRef(({className:e,variant:t,size:n,...r},o)=>R.jsx(y8,{ref:o,className:ye(Ode({variant:t,size:n,className:e})),...r}));kE.displayName=y8.displayName;function Tde(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function Dde(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function Ade(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function Mde(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function kde(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(a=>a.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function Ide(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function Nde(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(a=>a.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function Lde(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.textAlign}function Fde(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.width}function jde({columnIndex:e,columnName:t}){const[n,r]=m.useState(!1),o=Ir(G=>{var A;return(A=G.card)==null?void 0:A.preferences}),[i,a]=m.useState(Tde(o,e)),[s,l]=m.useState(Lde(o,e)),[c,u]=m.useState(Fde(o,e)),[d,h]=m.useState(Ide(o,e)),[p,v]=m.useState(Dde(o,e)),[b,x]=m.useState(Ade(o,e)),[y,_]=m.useState(Mde(o,e)),[S,C]=m.useState(kde(o,e).toString()),[E,$]=m.useState(Nde(o,e));m.useState("");const T=Ir(G=>G.actions.setCardPreferences);function D(){return R.jsxs(R.Fragment,{children:[R.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[R.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),R.jsxs(Ea,{value:s||"left",onValueChange:G=>l(G),children:[R.jsx(Mi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Ra,{})}),R.jsxs(ki,{children:[R.jsx(Hn,{value:"left",children:"Left"}),R.jsx(Hn,{value:"center",children:"Center"}),R.jsx(Hn,{value:"right",children:"Right"})]})]})]}),R.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[R.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),R.jsx(Jl,{placeholder:"Auto",value:c?c.toString():"",className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",onChange:G=>{G.target.value===""?u(void 0):u(Number(G.target.value))}})]})]})}function M(){const G=[...new Set(sw.map(A=>A.currency))];return R.jsx(R.Fragment,{children:R.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[R.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),R.jsxs(Ea,{value:p,onValueChange:A=>v(A),children:[R.jsx(Mi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Ra,{})}),R.jsx(ki,{children:R.jsxs(lu,{children:[R.jsx(El,{children:"Locale"}),sw.map(A=>R.jsx(Hn,{value:A.locale,children:A.locale},A.locale))]})})]}),R.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),R.jsxs(Ea,{value:y||"none",onValueChange:A=>_(A==="none"?void 0:A),children:[R.jsx(Mi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Ra,{})}),R.jsx(ki,{children:R.jsxs(lu,{children:[R.jsx(El,{children:"Currency"}),R.jsx(Hn,{value:"none",children:"None"}),G.map(A=>R.jsx(Hn,{value:A,children:A},A))]})})]}),R.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),R.jsxs(Ea,{value:S,onValueChange:A=>C(A),children:[R.jsx(Mi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Ra,{})}),R.jsx(ki,{children:["0","1","2","3","4"].map(A=>R.jsx(Hn,{value:A,children:A},A))})]}),!y&&R.jsx(kE,{onPressedChange:A=>$(A),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:R.jsx(C6,{className:"size-3"})})]})})}function L(){return R.jsx(R.Fragment,{children:R.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[R.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),R.jsxs(Ea,{defaultValue:"en-US",value:p,onValueChange:G=>v(G),children:[R.jsx(Mi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Ra,{})}),R.jsx(ki,{children:nG.map(G=>R.jsxs(lu,{children:[R.jsx(El,{children:G.label}),G.locales.map(A=>R.jsx(Hn,{value:A.code,children:A.name},A.code))]},G.label))})]}),R.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Format"}),R.jsxs(Ea,{defaultValue:"short-date-time",value:b,onValueChange:G=>{console.log("format",G),x(G)},children:[R.jsx(Mi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Ra,{})}),R.jsx(ki,{className:"",id:"type",children:R.jsxs(lu,{children:[R.jsx(El,{children:"Option"}),R.jsx(Hn,{value:"full-date-time",children:"Full Date-Time"}),R.jsx(Hn,{value:"short-date-time",children:"Short Date-Time"}),R.jsx(Hn,{value:"hours-date-time",children:"24-Hour Date-Time"}),R.jsx(Hn,{value:"short-date",children:"Short Date"}),R.jsx(Hn,{value:"long-date",children:"Long Date"})]})})]})]})})}function F(){T({...o,columnSettings:[]})}function z(){var G;T({...o,columnSettings:[...((G=o==null?void 0:o.columnSettings)==null?void 0:G.filter(A=>A.columnIdx!==e))||[]]})}function X(){var G,A,U;if(i==="date"){const V=Pde(p,b),K={columnIdx:e,type:i,options:V};T({...o,columnSettings:[...((G=o==null?void 0:o.columnSettings)==null?void 0:G.filter(q=>q.columnIdx!==e))||[],K]})}else if(i==="number"){let V;y?V={locale:p,currency:y,options:{style:"currency",currency:y,minimumFractionDigits:Number(S)},colorRanges:d.length>0?d:void 0}:V={locale:p,currency:void 0,options:{style:E?"percent":"decimal",minimumFractionDigits:Number(S)},colorRanges:d.length>0?d:void 0};const K={columnIdx:e,type:i,textAlign:s,width:c,options:V};T({...o,columnSettings:[...((A=o==null?void 0:o.columnSettings)==null?void 0:A.filter(q=>q.columnIdx!==e))||[],K]})}else{const V={columnIdx:e,type:"none",textAlign:s,width:c,options:{}};T({...o,columnSettings:[...((U=o==null?void 0:o.columnSettings)==null?void 0:U.filter(K=>K.columnIdx!==e))||[],V]})}}return R.jsxs(gv,{onOpenChange:G=>r(G),children:[R.jsx(mv,{asChild:!0,children:R.jsx(vC,{className:"size-3.5 cursor-pointer text-muted"})}),R.jsx(Sp,{align:"center",className:"max-w-70 z-20",children:R.jsxs("div",{className:"grid gap-4",children:[R.jsxs("div",{className:"space-y-2",children:[R.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),R.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),R.jsxs("div",{className:"grid gap-2",children:[R.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[R.jsx(Tn,{htmlFor:"scale",children:"Type"}),R.jsxs(Ea,{value:i||"none",onValueChange:G=>a(G),children:[R.jsx(Mi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Ra,{})}),R.jsx(ki,{id:"type",children:R.jsxs(lu,{children:[R.jsx(El,{children:"Option"}),R.jsx(Hn,{value:"number",children:"Number"}),R.jsx(Hn,{value:"date",children:"Date"}),R.jsx(Hn,{value:"none",children:"None"})]})})]})]}),D(),R.jsx(Kf,{}),i==="number"&&M(),i==="date"&&L(),i==="number"&&R.jsxs(R.Fragment,{children:[R.jsx(Kf,{}),R.jsx(v8,{colorRanges:d,setColorRanges:h})]}),R.jsx(Kf,{}),R.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[R.jsx(no,{onClick:F,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),R.jsx(no,{onClick:z,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),R.jsx(no,{onClick:X,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function zde(e){const t=new Date(e);return!isNaN(t.getTime())}function x8({data:e,card:t}){var C,E,$,T;const[n,r]=m.useState([]),{keys:o}=tr(e),i=we(D=>D.filteringCards),a=we(D=>D.themeStyle),s=we(D=>D.isVisualEditing),l=i==null?void 0:i.find(D=>D.id===t.id),c=(C=t==null?void 0:t.preferences)==null?void 0:C.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:d,removeFilterValue:h,removeFilteringCard:p}=dr(),v=t==null?void 0:t.preferences;function b(D,M){if((M==null?void 0:M.type)==="date"&&zde(D)){const{locale:L,options:F}=M.options,z=new Date(D);return new Date(z.getTime()).toLocaleDateString(L,F)}if((M==null?void 0:M.type)==="number"){const{locale:L,currency:F,options:z}=M.options;return F?new Intl.NumberFormat(L,{style:"currency",currency:F,...z}).format(D):new Intl.NumberFormat(L,z).format(D)}return D}const x=o.map((D,M)=>({accessorKey:D,header:({column:L})=>{var V;const F=L.getIsSorted(),z=M,X=(V=v==null?void 0:v.columnSettings)==null?void 0:V.find(K=>K.columnIdx===z),G=X==null?void 0:X.textAlign,A=X==null?void 0:X.width,U=A?{width:A}:{};return R.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[R.jsxs("div",{className:ye("flex grow cursor-pointer items-center",{"justify-center":G==="center","justify-end":G==="right","justify-start":G==="left"}),style:U,onClick:()=>L.toggleSorting(L.getIsSorted()==="asc"),children:[D,F==="asc"?R.jsx(g6,{className:"ml-2 h-5 w-5"}):F==="desc"?R.jsx(p6,{className:"ml-2 h-5 w-5"}):null]}),s&&R.jsx(jde,{columnName:L.id,columnIndex:M})]})},cell:({cell:L})=>{var U,V;const F=L.getValue(),z=(U=v==null?void 0:v.columnSettings)==null?void 0:U.find(K=>K.columnIdx===M),X=b(F,z),G=xC(F,(V=z==null?void 0:z.options)==null?void 0:V.colorRanges),A=z==null?void 0:z.textAlign;return z!=null&&z.width&&z.width,R.jsx("p",{className:ye("overflow-auto px-2 py-1",{"text-center":A==="center","text-right":A==="right","text-left":A==="left"}),style:{backgroundColor:G},children:X})}})),y=FI({data:e,columns:x,getCoreRowModel:II(),getPaginationRowModel:LI(),onSortingChange:r,getSortedRowModel:NI(),manualPagination:!0,state:{sorting:n}}),_=y.getSelectedRowModel().rows;m.useEffect(()=>{if(_.length===0){if(l){const D=t.id;h(D),p(t)}return}if(c){const{dimensionKeys:D}=tr(e),M=c.map(L=>{const F=D==null?void 0:D[L.columnIndex],z=_.map(G=>G.getValue(F));return{filterId:t.id+"-"+F,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:F,expression:L.expression,valueType:vb(z[0]===void 0?"":z[0]),operation:"in",values:z}});u(M),d(t)}},[d,u,t,e,l,c,h,p,_]);function S(D){D.toggleSelected()}return R.jsxs(gE,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(E=a==null?void 0:a.chart)==null?void 0:E.options.borderRadius,borderTopLeftRadius:($=a==null?void 0:a.chart)==null?void 0:$.options.borderRadius},onMouseDown:D=>D.stopPropagation(),children:[R.jsx(mE,{children:y.getHeaderGroups().map(D=>R.jsx(Yf,{children:D.headers.map((M,L)=>{var F,z,X,G,A,U,V;return R.jsx(vE,{style:{backgroundColor:(X=(z=(F=a==null?void 0:a.chart)==null?void 0:F.dataset)==null?void 0:z.backgroundColor)==null?void 0:X[0],color:qu((U=(A=(G=a==null?void 0:a.chart)==null?void 0:G.dataset)==null?void 0:A.backgroundColor)==null?void 0:U[0])},className:ye("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":L>0&&L<D.headers.length-1,"border-l":L===1&&D.headers.length==2},(V=a==null?void 0:a.table)==null?void 0:V.tableHeaderColor),children:M.isPlaceholder?null:I_(M.column.columnDef.header,M.getContext())},M.id)})},D.id))}),R.jsx(bE,{children:(T=y.getRowModel().rows)!=null&&T.length?y.getRowModel().rows.map((D,M)=>R.jsx(Yf,{onClick:()=>S(D),className:ye("whitespace-nowrap p-1",{"cursor-pointer data-[state=selected]:border-2 data-[state=selected]:border-dashed":c&&(c==null?void 0:c.length)>0}),"data-state":D.getIsSelected()&&"selected",children:D.getVisibleCells().map((L,F)=>{var A,U;const z=(A=v==null?void 0:v.columnSettings)==null?void 0:A.find(V=>V.columnIdx===F),X=z==null?void 0:z.width,G=X?{maxWidth:X}:{};return R.jsx("td",{style:G,onClick:V=>{var q;const K=((q=window==null?void 0:window.getSelection())==null?void 0:q.toString())||"";(K==null?void 0:K.length)>0&&V.stopPropagation()},className:ye("",{"border-x":F>0&&F<x.length-1||F===1&&x.length==2,"border-l":F==0,"border-r":F===x.length-1,"border-b":M===((U=y.getRowModel().rows)==null?void 0:U.length)-1}),children:I_(L.column.columnDef.cell,L.getContext())},L.id)})},D.id)):R.jsx(Yf,{children:R.jsx(yE,{colSpan:x.length,className:"p-1 text-center",children:"No results."})})})]})}async function Bde(e,t){const n=`${e}/index.js`,r=`${e}/style.css`;return document.querySelector(`link[href="${r}"]`)||await new Promise((i,a)=>{const s=document.createElement("link");s.rel="stylesheet",s.href=r,s.onload=()=>i(void 0),s.onerror=()=>a(new Error("Failed to load CSS")),document.head.appendChild(s)}),{default:(await import(n))[t]}}async function Vde(e){try{const t=await import(e),n=Object.keys(t),r=[];return n.forEach(o=>{typeof t[o]=="function"&&(o==null?void 0:o[0])===(o==null?void 0:o[0].toUpperCase())&&r.push({name:o,component:o})}),r}catch(t){return console.error("Error loading the library:",t),[]}}async function w8(e){try{const t=await fetch(`${e}/manifest.json`);if(!t.ok)throw new Error(`Failed to fetch manifest: ${t.statusText}`);return await t.json()}catch(t){throw console.error("Error loading manifest:",t),t}}const _8=e=>{const[t,n]=m.useState([]),[r,o]=m.useState(!1),[i,a]=m.useState(null);m.useEffect(()=>{window.React=m,window.ReactDOM=Er,o(!0)},[]),m.useEffect(()=>{e&&r&&w8(e).then(c=>{n(c.visuals),a(c)}).catch(()=>{Vde(e).then(c=>{console.log("componentNames",c),n(c)}).catch(c=>{console.error("Error loading manifest:",c)})})},[e,r]);const s=m.useMemo(()=>(t==null?void 0:t.map(c=>{const{name:u,component:d,dataInputs:h}=c;return{name:u,componentName:d,Component:m.lazy(()=>Bde(e,d)),type:h&&h.length>1?"multiple":"single"}}))||[],[t,e]);function l(c){const u=s==null?void 0:s.find(d=>d.name===c);return u?u.Component:null}return{getCard:l,components:s,manifest:i}};function Hde({onLoadingStatus:e,card:t}){const{isFetching:n,isLoading:r}=ZC(t);return m.useEffect(()=>{e==null||e(r)},[n,r,e]),R.jsx(R.Fragment,{})}function Wde({card:e,frame:t}){var v,b,x,y,_,S,C,E,$;const n=we(T=>T.themeStyle),r={colors:((b=(v=n==null?void 0:n.chart)==null?void 0:v.dataset)==null?void 0:b.backgroundColor)||[]},[o,i]=m.useState(!1),{getCard:a}=_8(((x=e.customCardPreferences)==null?void 0:x.url)||""),s=((y=e.customCardPreferences)==null?void 0:y.visualType)||"single",l=(_=e.customCardPreferences)==null?void 0:_.componentName,{data:c}=Bb(e);if(!l)return null;const u=a(l),d=T=>{console.log("data",T),e.customCardPreferences},h=Object.keys(((S=e.customCardPreferences)==null?void 0:S.dataInputCardIds)||{}).map(T=>{var L,F,z;const D=(F=(L=e.customCardPreferences)==null?void 0:L.dataInputCardIds)==null?void 0:F[T].cardId,M=(z=t==null?void 0:t.cards)==null?void 0:z.find(X=>X.id===D);return M||null});function p(T){i(T)}return R.jsx("div",{className:"semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto",children:R.jsxs(m.Suspense,{fallback:R.jsx(R.Fragment,{}),children:[u&&s==="single"&&R.jsx(u,{theme:r,settings:(C=e.customCardPreferences)==null?void 0:C.settings,onDataChange:d,data:(c==null?void 0:c.records)||[]}),u&&s==="multiple"&&R.jsxs(R.Fragment,{children:[Object.keys(((E=e.customCardPreferences)==null?void 0:E.dataInputCardIds)||{}).map(T=>{var L,F,z;const D=(F=(L=e.customCardPreferences)==null?void 0:L.dataInputCardIds)==null?void 0:F[T].cardId,M=(z=t==null?void 0:t.cards)==null?void 0:z.find(X=>X.id===D);return M?R.jsx(Hde,{onLoadingStatus:p,onDataChange:d,dataInputIndex:T,card:M},M.id):null}),s==="multiple"&&R.jsx("div",{className:ye("flex flex-col gap-2",{"opacity-50":o}),children:R.jsx(u,{theme:r,onDataChange:d,settings:h.map(T=>{var D;return(D=T==null?void 0:T.customCardPreferences)==null?void 0:D.settings}),data:h.map(T=>(T==null?void 0:T.data)||[])})})]})]},($=e.customCardPreferences)==null?void 0:$.componentName)})}/*!
319
+ * chartjs-plugin-datalabels v2.2.0
320
+ * https://chartjs-plugin-datalabels.netlify.app
321
+ * (c) 2017-2022 chartjs-plugin-datalabels contributors
322
+ * Released under the MIT license
323
+ */var hD=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}(),Xf={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
324
+ `)):Array.isArray(n)?e.push.apply(e,n):Tt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),o=r.length,i=e.font,a=0,s;for(e.font=n.string,s=0;s<o;++s)a=Math.max(e.measureText(r[s]).width,a);return e.font=i,{height:o*n.lineHeight,width:a}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],o,i,a,s;for(o=0,a=t.length;o<a;++o)s=t[o],i=n.indexOf(s),i===-1?r.push([s,1]):n.splice(i,1);for(o=0,a=n.length;o<a;++o)r.push([n[o],-1]);return r},rasterize:function(e){return Math.round(e*hD)/hD}};function tx(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var o=e.x-n,i=e.y-r,a=Math.sqrt(o*o+i*i);return{x:a?o/a:0,y:a?i/a:-1}}function Ude(e,t,n,r,o){switch(o){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:o*=Math.PI/180,n=Math.cos(o),r=Math.sin(o);break}return{x:e,y:t,vx:n,vy:r}}var qde=0,S8=1,C8=2,E8=4,R8=8;function vm(e,t,n){var r=qde;return e<n.left?r|=S8:e>n.right&&(r|=C8),t<n.top?r|=R8:t>n.bottom&&(r|=E8),r}function Gde(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,a=vm(n,r,t),s=vm(o,i,t),l,c,u;!(!(a|s)||a&s);)l=a||s,l&R8?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&E8?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&C8?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&S8&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===a?(n=c,r=u,a=vm(n,r,t)):(o=c,i=u,s=vm(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function ym(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=Gde(r,t.area)),n==="start"?(o=r.x0,i=r.y0):n==="end"?(o=r.x1,i=r.y1):(o=(r.x0+r.x1)/2,i=(r.y0+r.y1)/2),Ude(o,i,e.vx,e.vy,t.align)}var xm={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),o=Math.sin(n),i=e.innerRadius,a=e.outerRadius;return ym({x0:e.x+r*i,y0:e.y+o*i,x1:e.x+r*a,y1:e.y+o*a,vx:r,vy:o},t)},point:function(e,t){var n=tx(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return ym({x0:e.x-r,y0:e.y-o,x1:e.x+r,y1:e.y+o,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=tx(e,t.origin),r=e.x,o=e.y,i=0,a=0;return e.horizontal?(r=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(o=Math.min(e.y,e.base),a=Math.abs(e.base-e.y)),ym({x0:r,y0:o+a,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=tx(e,t.origin);return ym({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)}},ka=Xf.rasterize;function Yde(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,o=e.size.width,i=-o/2,a=-r/2;return{frame:{x:i-n.left-t,y:a-n.top-t,w:o+n.width+t*2,h:r+n.height+t*2},text:{x:i,y:a,w:o,h:r}}}function Kde(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 Xde(e){return e instanceof fu?xm.arc:e instanceof Yl?xm.point:e instanceof Kl?xm.bar:xm.fallback}function Qde(e,t,n,r,o,i){var a=Math.PI/2;if(i){var s=Math.min(i,o/2,r/2),l=t+s,c=n+s,u=t+r-s,d=n+o-s;e.moveTo(t,c),l<u&&c<d?(e.arc(l,c,s,-Math.PI,-a),e.arc(u,c,s,-a,0),e.arc(u,d,s,0,a),e.arc(l,d,s,a,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,s,-a,a),e.arc(l,c,s,a,Math.PI+a)):c<d?(e.arc(l,c,s,-Math.PI,0),e.arc(l,d,s,0,Math.PI)):e.arc(l,c,s,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function Jde(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),Qde(e,ka(t.x)+i/2,ka(t.y)+i/2,ka(t.w)-i,ka(t.h)-i,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),o&&i&&(e.strokeStyle=o,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function Zde(e,t,n){var r=n.lineHeight,o=e.w,i=e.x,a=e.y+r/2;return t==="center"?i+=o/2:(t==="end"||t==="right")&&(i+=o),{h:r,w:o,x:i,y:a}}function efe(e,t,n){var r=e.shadowBlur,o=n.stroked,i=ka(n.x),a=ka(n.y),s=ka(n.w);o&&e.strokeText(t,i,a,s),n.filled&&(r&&o&&(e.shadowBlur=0),e.fillText(t,i,a,s),r&&o&&(e.shadowBlur=r))}function tfe(e,t,n,r){var o=r.textAlign,i=r.color,a=!!i,s=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,d=c&&u,h;if(!(!l||!a&&!d))for(n=Zde(n,o,s),e.font=s.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,a&&(e.fillStyle=i),d&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),h=0,l=t.length;h<l;++h)efe(e,t[h],{stroked:d,filled:a,w:n.w,x:n.x,y:n.y+n.h*h})}var P8=function(e,t,n,r){var o=this;o._config=e,o._index=r,o._model=null,o._rects=null,o._ctx=t,o._el=n};or(P8.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,a=qn(wn([n.font,{}],r,i)),s=wn([n.color,An.color],r,i);return{align:wn([n.align,"center"],r,i),anchor:wn([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:wn([n.backgroundColor,null],r,i),borderColor:wn([n.borderColor,null],r,i),borderRadius:wn([n.borderRadius,0],r,i),borderWidth:wn([n.borderWidth,0],r,i),clamp:wn([n.clamp,!1],r,i),clip:wn([n.clip,!1],r,i),color:s,display:e,font:a,lines:t,offset:wn([n.offset,4],r,i),opacity:wn([n.opacity,1],r,i),origin:Kde(o._el,r),padding:fr(wn([n.padding,4],r,i)),positioner:Xde(o._el),rotation:wn([n.rotation,0],r,i)*(Math.PI/180),size:Xf.textSize(o._ctx,t,a),textAlign:wn([n.textAlign,"start"],r,i),textShadowBlur:wn([n.textShadowBlur,0],r,i),textShadowColor:wn([n.textShadowColor,s],r,i),textStrokeColor:wn([n.textStrokeColor,s],r,i),textStrokeWidth:wn([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,a,s,l,c=wn([i.display,!0],e,o);c&&(a=e.dataset.data[o],s=st(cn(i.formatter,[a,e]),a),l=Tt(s)?[]:Xf.toTextLines(s),l.length&&(n=t._modelize(c,l,i,e),r=Yde(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,o=n._model,i=n._rects,a;this.visible()&&(r.save(),o.clip&&(a=o.area,r.beginPath(),r.rect(a.left,a.top,a.right-a.left,a.bottom-a.top),r.clip()),r.globalAlpha=Xf.bound(0,o.opacity,1),r.translate(ka(t.x),ka(t.y)),r.rotate(o.rotation),Jde(r,i.frame,o),tfe(r,o.lines,i.text,o),r.restore())}});var nfe=Number.MIN_SAFE_INTEGER||-9007199254740991,rfe=Number.MAX_SAFE_INTEGER||9007199254740991;function uf(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t.x,a=t.y;return{x:i+r*(e.x-i)-o*(e.y-a),y:a+o*(e.x-i)+r*(e.y-a)}}function pD(e,t){var n=rfe,r=nfe,o=t.origin,i,a,s,l,c;for(i=0;i<e.length;++i)a=e[i],s=a.x-o.x,l=a.y-o.y,c=t.vx*s+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function wm(e,t){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/o,vy:(t.y-e.y)/o,origin:e,ln:o}}var $8=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};or($8.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=uf(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[wm(t[0],t[1]),wm(t[0],t[3])],o,i,a;for(this._rotation!==e._rotation&&r.push(wm(n[0],n[1]),wm(n[0],n[3])),o=0;o<r.length;++o)if(i=pD(t,r[o]),a=pD(n,r[o]),i.max<a.min||a.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[uf({x:t.x,y:t.y},r,n),uf({x:t.x+t.w,y:t.y},r,n),uf({x:t.x+t.w,y:t.y+t.h},r,n),uf({x:t.x,y:t.y+t.h},r,n)]}});function O8(e,t,n){var r=t.positioner(e,t),o=r.vx,i=r.vy;if(!o&&!i)return{x:r.x,y:r.y};var a=n.w,s=n.h,l=t.rotation,c=Math.abs(a/2*Math.cos(l))+Math.abs(s/2*Math.sin(l)),u=Math.abs(a/2*Math.sin(l))+Math.abs(s/2*Math.cos(l)),d=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*d,u*=i*d,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function ofe(e,t){var n,r,o,i;for(n=e.length-1;n>=0;--n)for(o=e[n].$layout,r=n-1;r>=0&&o._visible;--r)i=e[r].$layout,i._visible&&o._box.intersects(i._box)&&t(o,i);return e}function ife(e){var t,n,r,o,i,a,s;for(t=0,n=e.length;t<n;++t)r=e[t],o=r.$layout,o._visible&&(s=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),i=r.geometry(),a=O8(s,r.model(),i),o._box.update(a,i,r.rotation()));return ofe(e,function(l,c){var u=l._hidable,d=c._hidable;u&&d||d?c._visible=!1:u&&(l._visible=!1)})}var Qf={prepare:function(e){var t=[],n,r,o,i,a;for(n=0,o=e.length;n<o;++n)for(r=0,i=e[n].length;r<i;++r)a=e[n][r],t.push(a),a.$layout={_box:new $8,_hidable:!1,_visible:!0,_set:n,_idx:a._index};return t.sort(function(s,l){var c=s.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,o,i,a;for(n=0,r=e.length;n<r;++n)o=e[n],i=o.model(),a=o.$layout,a._hidable=i&&i.display==="auto",a._visible=o.visible(),t|=a._hidable;t&&ife(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,o,i,a,s;for(n=0,r=t.length;n<r;++n)o=t[n],i=o.$layout,i._visible&&(a=o.geometry(),s=O8(o._el,o.model(),a),i._box.update(s,a,o.rotation()),o.draw(e,s))}},afe=function(e){if(Tt(e))return null;var t=e,n,r,o;if(kt(e))if(!Tt(e.label))t=e.label;else if(!Tt(e.r))t=e.r;else for(t="",n=Object.keys(e),o=0,r=n.length;o<r;++o)t+=(o!==0?", ":"")+n[o]+": "+e[n[o]];return""+t},sfe={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:afe,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},Xr="$datalabels",T8="$default";function lfe(e,t){var n=e.datalabels,r={},o=[],i,a;return n===!1?null:(n===!0&&(n={}),t=or({},[t,n]),i=t.labels||{},a=Object.keys(i),delete t.labels,a.length?a.forEach(function(s){i[s]&&o.push(or({},[t,i[s],{_key:s}]))}):o.push(t),r=o.reduce(function(s,l){return nn(l.listeners||{},function(c,u){s[u]=s[u]||{},s[u][l._key||T8]=c}),delete l.listeners,s},{}),{labels:o,listeners:r})}function z_(e,t,n,r){if(t){var o=n.$context,i=n.$groups,a;t[i._set]&&(a=t[i._set][i._key],a&&cn(a,[o,r])===!0&&(e[Xr]._dirty=!0,n.update(o)))}}function cfe(e,t,n,r,o){var i,a;!n&&!r||(n?r?n!==r&&(a=i=!0):a=!0:i=!0,a&&z_(e,t.leave,n,o),i&&z_(e,t.enter,r,o))}function ufe(e,t){var n=e[Xr],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=Qf.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,cfe(e,r,o,i,t)}}function dfe(e,t){var n=e[Xr],r=n._listeners.click,o=r&&Qf.lookup(n._labels,t);o&&z_(e,r,o,t)}var ffe={id:"datalabels",defaults:sfe,beforeInit:function(e){e[Xr]={_actives:[]}},beforeUpdate:function(e){var t=e[Xr];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Xr],i=o._datasets[r]=[],a=e.isDatasetVisible(r),s=e.data.datasets[r],l=lfe(s,n),c=t.meta.data||[],u=e.ctx,d,h,p,v,b,x,y,_;for(u.save(),d=0,p=c.length;d<p;++d)if(y=c[d],y[Xr]=[],a&&y&&e.getDataVisibility(d)&&!y.skip)for(h=0,v=l.labels.length;h<v;++h)b=l.labels[h],x=b._key,_=new P8(b,u,y,d),_.$groups={_set:r,_key:x||T8},_.$context={active:!1,chart:e,dataIndex:d,dataset:s,datasetIndex:r},_.update(_.$context),y[Xr].push(_),i.push(_);u.restore(),or(o._listeners,l.listeners,{merger:function(S,C,E){C[S]=C[S]||{},C[S][t.index]=E[S],o._listened=!0}})},afterUpdate:function(e){e[Xr]._labels=Qf.prepare(e[Xr]._datasets)},afterDatasetsDraw:function(e){Qf.draw(e,e[Xr]._labels)},beforeEvent:function(e,t){if(e[Xr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":ufe(e,n);break;case"click":dfe(e,n);break}}},afterEvent:function(e){var t=e[Xr],n=t._actives,r=t._actives=e.getActiveElements(),o=Xf.arrayDiff(n,r),i,a,s,l,c,u,d;for(i=0,a=o.length;i<a;++i)if(c=o[i],c[1])for(d=c[0].element[Xr]||[],s=0,l=d.length;s<l;++s)u=d[s],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(Qf.update(t._labels),e.render()),delete t._dirty}};Dn.register(...bre);Dn.register(ffe);Dn.register(Yl);Dn.register(yd);Dn.register(xd);Dn.register(La);Dn.register(wc);Dn.register(Vs);Dn.register(Hs);Dn.register(R0);Dn.register(D3);function IE({cfg:e,onDatapointClick:t}){var d;const[n,r]=m.useState(""),o=we(h=>h.selectedLensId),i=m.useRef(null),[a,s]=m.useState(),l=we(h=>h.themeStyle);function c(h,p){var b,x;if((((b=h.data.datasets)==null?void 0:b.filter(y=>!!y.fill))||[]).length>0){const y=(x=h==null?void 0:h.data.datasets)==null?void 0:x.map(S=>({...S,backgroundColor:[S.backgroundColor].map(C=>{const E=p.createLinearGradient(0,0,0,400);return E.addColorStop(0,C),E.addColorStop(.7,D6("--semaphor-background")),E})}));return{...h,data:{...h.data,datasets:y}}}return h}m.useEffect(()=>{if(i.current){const h=window.getComputedStyle(i.current);r(h.fontFamily)}},[]),m.useEffect(()=>{var v,b,x,y;if(!n)return;(b=(v=l==null?void 0:l.chart)==null?void 0:v.font)!=null&&b.family&&(Dn.defaults.font={...Dn.defaults.font,...(x=l==null?void 0:l.chart)==null?void 0:x.font,family:n}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const h=(y=i==null?void 0:i.current)==null?void 0:y.getContext("2d");if(!h)return;let p;try{const _=c(e,h);p=new Dn(h,_),s(p)}catch(_){console.log("error creating chart",_)}return()=>{p&&p.destroy()}},[(d=l==null?void 0:l.chart)==null?void 0:d.font,o,n]);function u(h){var v,b;if(!a)return;const p=a==null?void 0:a.getElementsAtEventForMode(h,"nearest",{intersect:!0},!0);if(p&&p.length>0){const x=p[0].datasetIndex,y=p[0].index,_=(b=(v=p[0].element)==null?void 0:v.$context)==null?void 0:b.raw;t==null||t(a,x,y,_)}}return R.jsx("div",{onClick:u,className:"relative h-[99%]",children:R.jsx("canvas",{ref:i})})}function hfe({card:e,frame:t}){var X,G,A;const{customCards:n}=_i();m.useRef(null);const r=we(U=>U.themeStyle),o=we(U=>U.selectedSheetId),i=we(U=>U.isDashboardEditing),a=we(U=>U.selectedLensId),s=we(U=>U.dashboard.filters),l=s==null?void 0:s.find(U=>U.id===t.filterId),{setCardTitle:c,setCardDescription:u,setSelectedFrameId:d,updateFilter:h}=dr(),{updateFrame:p}=dr(),v=((X=e.customCardPreferences)==null?void 0:X.showCardHeader)??!0,{isError:b,isLoading:x,isFetching:y,cfg:_,visualKey:S,data:C,handleDatapointClick:E}=ZC(e);function $(){if(n&&n.length>0){const U=n.find(V=>V.cardId===e.id);if(U&&U.replaceDefault){const V=U.content;if(V)return R.jsx(V,{card:e})}}return e.type==="kpi"?R.jsx(T7,{card:e,data:(C==null?void 0:C.records)||[]}):e.type==="text"?R.jsx(wI,{isLoading:x||y,card:e,data:(C==null?void 0:C.records)||[]}):z}function T(){return["{{ filters | where }}","{{ filters | and }}"].some(V=>{var K;return(K=e.sql)==null?void 0:K.includes(V)})?R.jsx(Yle,{}):null}function D(){if(b)return R.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(e.type==="table"&&(C!=null&&C.records)&&(C==null?void 0:C.records.length)>0)return R.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:R.jsx(x8,{card:e,data:(C==null?void 0:C.records)||[]})});if(e.type==="custom")return R.jsx(Wde,{frame:t,card:e});if(n&&n.length>0){const U=n.find(V=>V.cardId===e.id);if(U&&U.content){const V=U.content;return R.jsx(V,{card:e})}}if(_)return R.jsx(IE,{cfg:_,onDatapointClick:E},`${S}-${a}`)}function M(){if(n&&n.length>0){const U=n.find(V=>V.cardId===e.id);if(U&&U.footer){const V=U.footer;if(V)return R.jsx(V,{card:e})}}return null}function L(){var U,V,K;return R.jsx(VS,{value:t.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:q=>{const O={...t,activeCardId:q};p(o,O)},children:R.jsx(Sb,{style:{borderRadius:(V=(U=r==null?void 0:r.chart)==null?void 0:U.options)==null?void 0:V.borderRadius},className:"flex-end flex-wrap items-center",children:(K=t.cards.filter(q=>{var O;return!((O=q.tabTitle)!=null&&O.endsWith("__Header"))&&(q.displayTab===!0||q.displayTab===void 0)}))==null?void 0:K.map(q=>{var O,H;return R.jsx(Cb,{style:{borderRadius:(H=(O=r==null?void 0:r.chart)==null?void 0:O.options)==null?void 0:H.borderRadius},value:q.id,children:q.tabTitle||q.title},q.id)})})})}function F(){let U=t.cards.find(V=>V.type==="kpi"&&V.tabTitle===`${e.tabTitle}__Header`);return U||(U=t.cards.find(V=>V.type==="kpi"&&V.tabTitle==="All__Header")),U?R.jsx("div",{className:"flex items-end gap-2",children:R.jsx(Mse,{renderFilterInfo:T,card:U})}):R.jsxs(R.Fragment,{children:[R.jsxs("div",{role:"card-title-container",className:"flex items-center gap-2",children:[R.jsx(qi,{text:e.title,onSave:V=>c(o,e.id,V),children:R.jsx(pd,{className:ye("text-base",{}),children:e.title})}),(i||e.info)&&R.jsx(X7,{card:e}),e.refreshInterval&&R.jsxs(nI,{children:[R.jsx(rI,{className:"pr-1",children:R.jsx("div",{className:ye("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":x||y})})}),R.jsx(fE,{side:"right",align:"center",children:R.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),T()]}),R.jsx("div",{role:"card-description-container",children:R.jsx(qi,{text:(e==null?void 0:e.description)||"",onSave:V=>u(o,e.id,V),children:R.jsxs(LS,{className:ye("",{}),children:[" ",e.description]})})})]})}if(!e.id)return null;const z=R.jsxs(R.Fragment,{children:[v?R.jsx(xb,{children:R.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[R.jsx("div",{className:"grow",role:"header-container",children:F()}),R.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.cards.length>1&&L(),R.jsx("div",{children:l&&R.jsxs("div",{style:{borderRadius:(A=(G=r==null?void 0:r.chart)==null?void 0:G.options)==null?void 0:A.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[!hd.includes(l.dataType)&&R.jsx(qi,{className:"my-1",containerClassName:"shrink-0",text:l.title||l.column,onSave:U=>h({...l,title:U}),children:R.jsx(Tn,{className:"px-3",children:l.title})}),o2(l)]})})]})]})}):R.jsx("div",{className:"h-8"}),R.jsx(wb,{className:"relative flex grow flex-col",children:D()}),R.jsx(ck,{children:M()})]});return R.jsx("div",{className:ye("flex h-full flex-col",{"animate-pulse":x||y}),children:$()})}function pfe({frame:e,footer:t,className:n,...r}){var b,x;const o=m.useRef(null),i=we(y=>y.themeStyle),a=we(y=>y.selectedFrameId),s=we(y=>y.isDashboardEditing),{setSelectedFrameId:l}=dr(),{setSelectedConnectionId:c,setSelectedDatabaseName:u,setSelectedSchemaName:d,setSelectedTableName:h}=Lb(),p=e.cards.find(y=>y.id===e.activeCardId);eJ(e,o);function v(y){y.stopPropagation(),l(e.id),p!=null&&p.connectionId&&c(p==null?void 0:p.connectionId),p!=null&&p.lastSelectedDatabase&&u(p==null?void 0:p.lastSelectedDatabase),p!=null&&p.lastSelectedSchema&&d(p==null?void 0:p.lastSelectedSchema),p!=null&&p.lastSelectedTable&&h(p==null?void 0:p.lastSelectedTable)}return R.jsx(zb,{FallbackComponent:yC,children:R.jsxs("div",{tabIndex:-1,ref:o,role:"card-frame",onClick:v,style:{borderRadius:(x=(b=i==null?void 0:i.chart)==null?void 0:b.options)==null?void 0:x.borderRadius},className:ye("relative flex h-full flex-col rounded-sm border bg-background shadow-sm",{"border-dashed border-foreground/50":a===e.id&&s},i==null?void 0:i.dashboardCard,n,"semaphor-card-frame"),...r,children:[R.jsx(O6,{frame:e}),R.jsx(hfe,{card:p,frame:e},p.id)]})})}function Ht(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 Ao(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Lr(e,t){const n=Ht(e);return isNaN(t)?Ao(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function xi(e,t){const n=Ht(e);if(isNaN(t))return Ao(e,NaN);if(!t)return n;const r=n.getDate(),o=Ao(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}const NE=6048e5,gfe=864e5;let mfe={};function Cp(){return mfe}function Ji(e,t){var s,l,c,u;const n=Cp(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Ht(e),i=o.getDay(),a=(i<r?7:0)+i-r;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function dc(e){return Ji(e,{weekStartsOn:1})}function D8(e){const t=Ht(e),n=t.getFullYear(),r=Ao(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=dc(r),i=Ao(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const a=dc(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function cd(e){const t=Ht(e);return t.setHours(0,0,0,0),t}function X0(e){const t=Ht(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 Hi(e,t){const n=cd(e),r=cd(t),o=+n-X0(n),i=+r-X0(r);return Math.round((o-i)/gfe)}function bfe(e){const t=D8(e),n=Ao(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),dc(n)}function B_(e,t){const n=t*7;return Lr(e,n)}function vfe(e,t){return xi(e,t*12)}function yfe(e){let t;return e.forEach(function(n){const r=Ht(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function xfe(e){let t;return e.forEach(n=>{const r=Ht(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function to(e,t){const n=cd(e),r=cd(t);return+n==+r}function LE(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function wfe(e){if(!LE(e)&&typeof e!="number")return!1;const t=Ht(e);return!isNaN(Number(t))}function _h(e,t){const n=Ht(e),r=Ht(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function _fe(e,t,n){const r=Ji(e,n),o=Ji(t,n),i=+r-X0(r),a=+o-X0(o);return Math.round((i-a)/NE)}function FE(e){const t=Ht(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function ro(e){const t=Ht(e);return t.setDate(1),t.setHours(0,0,0,0),t}function A8(e){const t=Ht(e),n=Ao(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function jE(e,t){var s,l,c,u;const n=Cp(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Ht(e),i=o.getDay(),a=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+a),o.setHours(23,59,59,999),o}function M8(e){return jE(e,{weekStartsOn:1})}const Sfe={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"}},Cfe=(e,t,n)=>{let r;const o=Sfe[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function nx(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Efe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Rfe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Pfe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},$fe={date:nx({formats:Efe,defaultWidth:"full"}),time:nx({formats:Rfe,defaultWidth:"full"}),dateTime:nx({formats:Pfe,defaultWidth:"full"})},Ofe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tfe=(e,t,n,r)=>Ofe[e];function df(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):a;o=e.formattingValues[s]||e.formattingValues[a]}else{const a=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[s]||e.values[a]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const Dfe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Afe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Mfe={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"]},kfe={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"]},Ife={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"}},Nfe={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"}},Lfe=(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"},Ffe={ordinalNumber:Lfe,era:df({values:Dfe,defaultWidth:"wide"}),quarter:df({values:Afe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:df({values:Mfe,defaultWidth:"wide"}),day:df({values:kfe,defaultWidth:"wide"}),dayPeriod:df({values:Ife,defaultWidth:"wide",formattingValues:Nfe,defaultFormattingWidth:"wide"})};function ff(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const a=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?zfe(s,d=>d.test(a)):jfe(s,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function jfe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function zfe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Bfe(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const s=t.slice(o.length);return{value:a,rest:s}}}const Vfe=/^(\d+)(th|st|nd|rd)?/i,Hfe=/\d+/i,Wfe={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},Ufe={any:[/^b/i,/^(a|c)/i]},qfe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Gfe={any:[/1/i,/2/i,/3/i,/4/i]},Yfe={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},Kfe={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]},Xfe={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},Qfe={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]},Jfe={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},Zfe={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}},ehe={ordinalNumber:Bfe({matchPattern:Vfe,parsePattern:Hfe,valueCallback:e=>parseInt(e,10)}),era:ff({matchPatterns:Wfe,defaultMatchWidth:"wide",parsePatterns:Ufe,defaultParseWidth:"any"}),quarter:ff({matchPatterns:qfe,defaultMatchWidth:"wide",parsePatterns:Gfe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ff({matchPatterns:Yfe,defaultMatchWidth:"wide",parsePatterns:Kfe,defaultParseWidth:"any"}),day:ff({matchPatterns:Xfe,defaultMatchWidth:"wide",parsePatterns:Qfe,defaultParseWidth:"any"}),dayPeriod:ff({matchPatterns:Jfe,defaultMatchWidth:"any",parsePatterns:Zfe,defaultParseWidth:"any"})},k8={code:"en-US",formatDistance:Cfe,formatLong:$fe,formatRelative:Tfe,localize:Ffe,match:ehe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function the(e){const t=Ht(e);return Hi(t,A8(t))+1}function I8(e){const t=Ht(e),n=+dc(t)-+bfe(t);return Math.round(n/NE)+1}function N8(e,t){var u,d,h,p;const n=Ht(e),r=n.getFullYear(),o=Cp(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,a=Ao(e,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const s=Ji(a,t),l=Ao(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=Ji(l,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function nhe(e,t){var s,l,c,u;const n=Cp(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=N8(e,t),i=Ao(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Ji(i,t)}function L8(e,t){const n=Ht(e),r=+Ji(n,t)-+nhe(n,t);return Math.round(r/NE)+1}function sn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ds={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return sn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):sn(n+1,2)},d(e,t){return sn(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 sn(e.getHours()%12||12,t.length)},H(e,t){return sn(e.getHours(),t.length)},m(e,t){return sn(e.getMinutes(),t.length)},s(e,t){return sn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return sn(o,t.length)}},Zc={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},gD={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return ds.y(e,t)},Y:function(e,t,n,r){const o=N8(e,r),i=o>0?o:1-o;if(t==="YY"){const a=i%100;return sn(a,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):sn(i,t.length)},R:function(e,t){const n=D8(e);return sn(n,t.length)},u:function(e,t){const n=e.getFullYear();return sn(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 sn(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 sn(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 ds.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 sn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=L8(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):sn(o,t.length)},I:function(e,t,n){const r=I8(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):sn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ds.d(e,t)},D:function(e,t,n){const r=the(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):sn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return sn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return sn(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return sn(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Zc.noon:r===0?o=Zc.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Zc.evening:r>=12?o=Zc.afternoon:r>=4?o=Zc.morning:o=Zc.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ds.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ds.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):sn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):sn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ds.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ds.s(e,t)},S:function(e,t){return ds.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return bD(r);case"XXXX":case"XX":return _l(r);case"XXXXX":case"XXX":default:return _l(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return bD(r);case"xxxx":case"xx":return _l(r);case"xxxxx":case"xxx":default:return _l(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+mD(r,":");case"OOOO":default:return"GMT"+_l(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+mD(r,":");case"zzzz":default:return"GMT"+_l(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return sn(r,t.length)},T:function(e,t,n){const r=e.getTime();return sn(r,t.length)}};function mD(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+sn(i,2)}function bD(e,t){return e%60===0?(e>0?"-":"+")+sn(Math.abs(e)/60,2):_l(e,t)}function _l(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=sn(Math.trunc(r/60),2),i=sn(r%60,2);return n+o+t+i}const vD=(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"})}},F8=(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"})}},rhe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return vD(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",vD(r,t)).replace("{{time}}",F8(o,t))},ohe={p:F8,P:rhe},ihe=/^D+$/,ahe=/^Y+$/,she=["D","DD","YY","YYYY"];function lhe(e){return ihe.test(e)}function che(e){return ahe.test(e)}function uhe(e,t,n){const r=dhe(e,t,n);if(console.warn(r),she.includes(e))throw new RangeError(r)}function dhe(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 fhe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,hhe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,phe=/^'([^]*?)'?$/,ghe=/''/g,mhe=/[a-zA-Z]/;function Gi(e,t,n){var u,d,h,p,v,b,x,y;const r=Cp(),o=(n==null?void 0:n.locale)??r.locale??k8,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,a=(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??((y=(x=r.locale)==null?void 0:x.options)==null?void 0:y.weekStartsOn)??0,s=Ht(e);if(!wfe(s))throw new RangeError("Invalid time value");let l=t.match(hhe).map(_=>{const S=_[0];if(S==="p"||S==="P"){const C=ohe[S];return C(_,o.formatLong)}return _}).join("").match(fhe).map(_=>{if(_==="''")return{isToken:!1,value:"'"};const S=_[0];if(S==="'")return{isToken:!1,value:bhe(_)};if(gD[S])return{isToken:!0,value:_};if(S.match(mhe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:_}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const c={firstWeekContainsDate:i,weekStartsOn:a,locale:o};return l.map(_=>{if(!_.isToken)return _.value;const S=_.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&che(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&lhe(S))&&uhe(S,t,String(e));const C=gD[S[0]];return C(s,S,o.localize,c)}).join("")}function bhe(e){const t=e.match(phe);return t?t[1].replace(ghe,"'"):e}function vhe(e){const t=Ht(e),n=t.getFullYear(),r=t.getMonth(),o=Ao(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function yhe(e){return Math.trunc(+Ht(e)/1e3)}function xhe(e){const t=Ht(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function whe(e,t){return _fe(xhe(e),ro(e),t)+1}function V_(e,t){const n=Ht(e),r=Ht(t);return n.getTime()>r.getTime()}function j8(e,t){const n=Ht(e),r=Ht(t);return+n<+r}function zE(e,t){const n=Ht(e),r=Ht(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function _he(e,t){const n=Ht(e),r=Ht(t);return n.getFullYear()===r.getFullYear()}function rx(e,t){return Lr(e,-t)}function ox(e,t){const n=Ht(e),r=n.getFullYear(),o=n.getDate(),i=Ao(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const a=vhe(i);return n.setMonth(t,Math.min(o,a)),n}function yD(e,t){const n=Ht(e);return isNaN(+n)?Ao(e,NaN):(n.setFullYear(t),n)}var ot=function(){return ot=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ot.apply(this,arguments)};function She(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function z8(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var H_={exports:{}},hf={};/**
325
+ * @license React
326
+ * react-jsx-runtime.development.js
327
+ *
328
+ * Copyright (c) Facebook, Inc. and its affiliates.
329
+ *
330
+ * This source code is licensed under the MIT license found in the
331
+ * LICENSE file in the root directory of this source tree.
332
+ */var xD;function Che(){return xD||(xD=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function x(k){if(k===null||typeof k!="object")return null;var ne=v&&k[v]||k[b];return typeof ne=="function"?ne:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(k){{for(var ne=arguments.length,fe=new Array(ne>1?ne-1:0),$e=1;$e<ne;$e++)fe[$e-1]=arguments[$e];S("error",k,fe)}}function S(k,ne,fe){{var $e=y.ReactDebugCurrentFrame,Ve=$e.getStackAddendum();Ve!==""&&(ne+="%s",fe=fe.concat([Ve]));var qe=fe.map(function(ze){return String(ze)});qe.unshift("Warning: "+ne),Function.prototype.apply.call(console[k],console,qe)}}var C=!1,E=!1,$=!1,T=!1,D=!1,M;M=Symbol.for("react.module.reference");function L(k){return!!(typeof k=="string"||typeof k=="function"||k===r||k===i||D||k===o||k===c||k===u||T||k===p||C||E||$||typeof k=="object"&&k!==null&&(k.$$typeof===h||k.$$typeof===d||k.$$typeof===a||k.$$typeof===s||k.$$typeof===l||k.$$typeof===M||k.getModuleId!==void 0))}function F(k,ne,fe){var $e=k.displayName;if($e)return $e;var Ve=ne.displayName||ne.name||"";return Ve!==""?fe+"("+Ve+")":fe}function z(k){return k.displayName||"Context"}function X(k){if(k==null)return null;if(typeof k.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof k=="function")return k.displayName||k.name||null;if(typeof k=="string")return k;switch(k){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof k=="object")switch(k.$$typeof){case s:var ne=k;return z(ne)+".Consumer";case a:var fe=k;return z(fe._context)+".Provider";case l:return F(k,k.render,"ForwardRef");case d:var $e=k.displayName||null;return $e!==null?$e:X(k.type)||"Memo";case h:{var Ve=k,qe=Ve._payload,ze=Ve._init;try{return X(ze(qe))}catch{return null}}}return null}var G=Object.assign,A=0,U,V,K,q,O,H,Y;function I(){}I.__reactDisabledLog=!0;function te(){{if(A===0){U=console.log,V=console.info,K=console.warn,q=console.error,O=console.group,H=console.groupCollapsed,Y=console.groupEnd;var k={configurable:!0,enumerable:!0,value:I,writable:!0};Object.defineProperties(console,{info:k,log:k,warn:k,error:k,group:k,groupCollapsed:k,groupEnd:k})}A++}}function ce(){{if(A--,A===0){var k={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G({},k,{value:U}),info:G({},k,{value:V}),warn:G({},k,{value:K}),error:G({},k,{value:q}),group:G({},k,{value:O}),groupCollapsed:G({},k,{value:H}),groupEnd:G({},k,{value:Y})})}A<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=y.ReactCurrentDispatcher,he;function ie(k,ne,fe){{if(he===void 0)try{throw Error()}catch(Ve){var $e=Ve.stack.trim().match(/\n( *(at )?)/);he=$e&&$e[1]||""}return`
333
+ `+he+k}}var re=!1,le;{var xe=typeof WeakMap=="function"?WeakMap:Map;le=new xe}function Z(k,ne){if(!k||re)return"";{var fe=le.get(k);if(fe!==void 0)return fe}var $e;re=!0;var Ve=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var qe;qe=de.current,de.current=null,te();try{if(ne){var ze=function(){throw Error()};if(Object.defineProperty(ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ze,[])}catch(pt){$e=pt}Reflect.construct(k,[],ze)}else{try{ze.call()}catch(pt){$e=pt}k.call(ze.prototype)}}else{try{throw Error()}catch(pt){$e=pt}k()}}catch(pt){if(pt&&$e&&typeof pt.stack=="string"){for(var Fe=pt.stack.split(`
334
+ `),Ae=$e.stack.split(`
335
+ `),J=Fe.length-1,me=Ae.length-1;J>=1&&me>=0&&Fe[J]!==Ae[me];)me--;for(;J>=1&&me>=0;J--,me--)if(Fe[J]!==Ae[me]){if(J!==1||me!==1)do if(J--,me--,me<0||Fe[J]!==Ae[me]){var Me=`
336
+ `+Fe[J].replace(" at new "," at ");return k.displayName&&Me.includes("<anonymous>")&&(Me=Me.replace("<anonymous>",k.displayName)),typeof k=="function"&&le.set(k,Me),Me}while(J>=1&&me>=0);break}}}finally{re=!1,de.current=qe,ce(),Error.prepareStackTrace=Ve}var lt=k?k.displayName||k.name:"",Rn=lt?ie(lt):"";return typeof k=="function"&&le.set(k,Rn),Rn}function ve(k,ne,fe){return Z(k,!1)}function Ce(k){var ne=k.prototype;return!!(ne&&ne.isReactComponent)}function Oe(k,ne,fe){if(k==null)return"";if(typeof k=="function")return Z(k,Ce(k));if(typeof k=="string")return ie(k);switch(k){case c:return ie("Suspense");case u:return ie("SuspenseList")}if(typeof k=="object")switch(k.$$typeof){case l:return ve(k.render);case d:return Oe(k.type,ne,fe);case h:{var $e=k,Ve=$e._payload,qe=$e._init;try{return Oe(qe(Ve),ne,fe)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,We={},Be=y.ReactDebugCurrentFrame;function Ie(k){if(k){var ne=k._owner,fe=Oe(k.type,k._source,ne?ne.type:null);Be.setExtraStackFrame(fe)}else Be.setExtraStackFrame(null)}function Ke(k,ne,fe,$e,Ve){{var qe=Function.call.bind(Te);for(var ze in k)if(qe(k,ze)){var Fe=void 0;try{if(typeof k[ze]!="function"){var Ae=Error(($e||"React class")+": "+fe+" type `"+ze+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof k[ze]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ae.name="Invariant Violation",Ae}Fe=k[ze](ne,ze,$e,fe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(J){Fe=J}Fe&&!(Fe instanceof Error)&&(Ie(Ve),_("%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).",$e||"React class",fe,ze,typeof Fe),Ie(null)),Fe instanceof Error&&!(Fe.message in We)&&(We[Fe.message]=!0,Ie(Ve),_("Failed %s type: %s",fe,Fe.message),Ie(null))}}}var dt=Array.isArray;function Bt(k){return dt(k)}function It(k){{var ne=typeof Symbol=="function"&&Symbol.toStringTag,fe=ne&&k[Symbol.toStringTag]||k.constructor.name||"Object";return fe}}function Qt(k){try{return pe(k),!1}catch{return!0}}function pe(k){return""+k}function Re(k){if(Qt(k))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",It(k)),pe(k)}var Le=y.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},Ze,Jt,ln;ln={};function rn(k){if(Te.call(k,"ref")){var ne=Object.getOwnPropertyDescriptor(k,"ref").get;if(ne&&ne.isReactWarning)return!1}return k.ref!==void 0}function En(k){if(Te.call(k,"key")){var ne=Object.getOwnPropertyDescriptor(k,"key").get;if(ne&&ne.isReactWarning)return!1}return k.key!==void 0}function vn(k,ne){if(typeof k.ref=="string"&&Le.current&&ne&&Le.current.stateNode!==ne){var fe=X(Le.current.type);ln[fe]||(_('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',X(Le.current.type),k.ref),ln[fe]=!0)}}function Wt(k,ne){{var fe=function(){Ze||(Ze=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",ne))};fe.isReactWarning=!0,Object.defineProperty(k,"key",{get:fe,configurable:!0})}}function dn(k,ne){{var fe=function(){Jt||(Jt=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",ne))};fe.isReactWarning=!0,Object.defineProperty(k,"ref",{get:fe,configurable:!0})}}var $n=function(k,ne,fe,$e,Ve,qe,ze){var Fe={$$typeof:t,type:k,key:ne,ref:fe,props:ze,_owner:qe};return Fe._store={},Object.defineProperty(Fe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Fe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:$e}),Object.defineProperty(Fe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ve}),Object.freeze&&(Object.freeze(Fe.props),Object.freeze(Fe)),Fe};function rt(k,ne,fe,$e,Ve){{var qe,ze={},Fe=null,Ae=null;fe!==void 0&&(Re(fe),Fe=""+fe),En(ne)&&(Re(ne.key),Fe=""+ne.key),rn(ne)&&(Ae=ne.ref,vn(ne,Ve));for(qe in ne)Te.call(ne,qe)&&!Ge.hasOwnProperty(qe)&&(ze[qe]=ne[qe]);if(k&&k.defaultProps){var J=k.defaultProps;for(qe in J)ze[qe]===void 0&&(ze[qe]=J[qe])}if(Fe||Ae){var me=typeof k=="function"?k.displayName||k.name||"Unknown":k;Fe&&Wt(ze,me),Ae&&dn(ze,me)}return $n(k,Fe,Ae,Ve,$e,Le.current,ze)}}var mt=y.ReactCurrentOwner,Nt=y.ReactDebugCurrentFrame;function on(k){if(k){var ne=k._owner,fe=Oe(k.type,k._source,ne?ne.type:null);Nt.setExtraStackFrame(fe)}else Nt.setExtraStackFrame(null)}var _t;_t=!1;function zn(k){return typeof k=="object"&&k!==null&&k.$$typeof===t}function ni(){{if(mt.current){var k=X(mt.current.type);if(k)return`
337
+
338
+ Check the render method of \``+k+"`."}return""}}function Ya(k){{if(k!==void 0){var ne=k.fileName.replace(/^.*[\\\/]/,""),fe=k.lineNumber;return`
339
+
340
+ Check your code at `+ne+":"+fe+"."}return""}}var ri={};function aa(k){{var ne=ni();if(!ne){var fe=typeof k=="string"?k:k.displayName||k.name;fe&&(ne=`
341
+
342
+ Check the top-level render call using <`+fe+">.")}return ne}}function Ci(k,ne){{if(!k._store||k._store.validated||k.key!=null)return;k._store.validated=!0;var fe=aa(ne);if(ri[fe])return;ri[fe]=!0;var $e="";k&&k._owner&&k._owner!==mt.current&&($e=" It was passed a child from "+X(k._owner.type)+"."),on(k),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',fe,$e),on(null)}}function sa(k,ne){{if(typeof k!="object")return;if(Bt(k))for(var fe=0;fe<k.length;fe++){var $e=k[fe];zn($e)&&Ci($e,ne)}else if(zn(k))k._store&&(k._store.validated=!0);else if(k){var Ve=x(k);if(typeof Ve=="function"&&Ve!==k.entries)for(var qe=Ve.call(k),ze;!(ze=qe.next()).done;)zn(ze.value)&&Ci(ze.value,ne)}}}function Ka(k){{var ne=k.type;if(ne==null||typeof ne=="string")return;var fe;if(typeof ne=="function")fe=ne.propTypes;else if(typeof ne=="object"&&(ne.$$typeof===l||ne.$$typeof===d))fe=ne.propTypes;else return;if(fe){var $e=X(ne);Ke(fe,k.props,"prop",$e,k)}else if(ne.PropTypes!==void 0&&!_t){_t=!0;var Ve=X(ne);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ve||"Unknown")}typeof ne.getDefaultProps=="function"&&!ne.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ei(k){{for(var ne=Object.keys(k.props),fe=0;fe<ne.length;fe++){var $e=ne[fe];if($e!=="children"&&$e!=="key"){on(k),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$e),on(null);break}}k.ref!==null&&(on(k),_("Invalid attribute `ref` supplied to `React.Fragment`."),on(null))}}function la(k,ne,fe,$e,Ve,qe){{var ze=L(k);if(!ze){var Fe="";(k===void 0||typeof k=="object"&&k!==null&&Object.keys(k).length===0)&&(Fe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ae=Ya(Ve);Ae?Fe+=Ae:Fe+=ni();var J;k===null?J="null":Bt(k)?J="array":k!==void 0&&k.$$typeof===t?(J="<"+(X(k.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):J=typeof k,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",J,Fe)}var me=rt(k,ne,fe,Ve,qe);if(me==null)return me;if(ze){var Me=ne.children;if(Me!==void 0)if($e)if(Bt(Me)){for(var lt=0;lt<Me.length;lt++)sa(Me[lt],k);Object.freeze&&Object.freeze(Me)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else sa(Me,k)}return k===r?Ei(me):Ka(me),me}}function Jn(k,ne,fe){return la(k,ne,fe,!0)}function Ri(k,ne,fe){return la(k,ne,fe,!1)}var Xa=Ri,Qa=Jn;hf.Fragment=r,hf.jsx=Xa,hf.jsxs=Qa}()),hf}var pf={};/**
343
+ * @license React
344
+ * react-jsx-runtime.production.min.js
345
+ *
346
+ * Copyright (c) Facebook, Inc. and its affiliates.
347
+ *
348
+ * This source code is licensed under the MIT license found in the
349
+ * LICENSE file in the root directory of this source tree.
350
+ */var wD;function Ehe(){if(wD)return pf;wD=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(s,l,c){var u,d={},h=null,p=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(s&&s.defaultProps)for(u in l=s.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:s,key:h,ref:p,props:d,_owner:o.current}}return pf.Fragment=n,pf.jsx=a,pf.jsxs=a,pf}process.env.NODE_ENV==="production"?H_.exports=Ehe():H_.exports=Che();var Ee=H_.exports;function Ep(e){return e.mode==="multiple"}function Rp(e){return e.mode==="range"}function bv(e){return e.mode==="single"}var Rhe={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 Phe(e,t){return Gi(e,"LLLL y",t)}function $he(e,t){return Gi(e,"d",t)}function Ohe(e,t){return Gi(e,"LLLL",t)}function The(e){return"".concat(e)}function Dhe(e,t){return Gi(e,"cccccc",t)}function Ahe(e,t){return Gi(e,"yyyy",t)}var Mhe=Object.freeze({__proto__:null,formatCaption:Phe,formatDay:$he,formatMonthCaption:Ohe,formatWeekNumber:The,formatWeekdayName:Dhe,formatYearCaption:Ahe}),khe=function(e,t,n){return Gi(e,"do MMMM (EEEE)",n)},Ihe=function(){return"Month: "},Nhe=function(){return"Go to next month"},Lhe=function(){return"Go to previous month"},Fhe=function(e,t){return Gi(e,"cccc",t)},jhe=function(e){return"Week n. ".concat(e)},zhe=function(){return"Year: "},Bhe=Object.freeze({__proto__:null,labelDay:khe,labelMonthDropdown:Ihe,labelNext:Nhe,labelPrevious:Lhe,labelWeekNumber:jhe,labelWeekday:Fhe,labelYearDropdown:zhe});function Vhe(){var e="buttons",t=Rhe,n=k8,r={},o={},i=1,a={},s=new Date;return{captionLayout:e,classNames:t,formatters:Mhe,labels:Bhe,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:a,today:s,mode:"default"}}function Hhe(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,a=e.toDate;return r?i=ro(r):t&&(i=new Date(t,0,1)),o?a=FE(o):n&&(a=new Date(n,11,31)),{fromDate:i?cd(i):void 0,toDate:a?cd(a):void 0}}var B8=m.createContext(void 0);function Whe(e){var t,n=e.initialProps,r=Vhe(),o=Hhe(n),i=o.fromDate,a=o.toDate,s=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;s!=="buttons"&&(!i||!a)&&(s="buttons");var l;(bv(n)||Ep(n)||Rp(n))&&(l=n.onSelect);var c=ot(ot(ot({},r),n),{captionLayout:s,classNames:ot(ot({},r.classNames),n.classNames),components:ot({},n.components),formatters:ot(ot({},r.formatters),n.formatters),fromDate:i,labels:ot(ot({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:ot(ot({},r.modifiers),n.modifiers),modifiersClassNames:ot(ot({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:ot(ot({},r.styles),n.styles),toDate:a});return Ee.jsx(B8.Provider,{value:c,children:e.children})}function bn(){var e=m.useContext(B8);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function V8(e){var t=bn(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return Ee.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function Uhe(e){return Ee.jsx("svg",ot({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:Ee.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function H8(e){var t,n,r=e.onChange,o=e.value,i=e.children,a=e.caption,s=e.className,l=e.style,c=bn(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Uhe;return Ee.jsxs("div",{className:s,style:l,children:[Ee.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),Ee.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),Ee.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[a,Ee.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function qhe(e){var t,n=bn(),r=n.fromDate,o=n.toDate,i=n.styles,a=n.locale,s=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return Ee.jsx(Ee.Fragment,{});if(!o)return Ee.jsx(Ee.Fragment,{});var d=[];if(_he(r,o))for(var h=ro(r),p=r.getMonth();p<=o.getMonth();p++)d.push(ox(h,p));else for(var h=ro(new Date),p=0;p<=11;p++)d.push(ox(h,p));var v=function(x){var y=Number(x.target.value),_=ox(ro(e.displayMonth),y);e.onChange(_)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:H8;return Ee.jsx(b,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:s(e.displayMonth,{locale:a}),children:d.map(function(x){return Ee.jsx("option",{value:x.getMonth(),children:s(x,{locale:a})},x.getMonth())})})}function Ghe(e){var t,n=e.displayMonth,r=bn(),o=r.fromDate,i=r.toDate,a=r.locale,s=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,h=[];if(!o)return Ee.jsx(Ee.Fragment,{});if(!i)return Ee.jsx(Ee.Fragment,{});for(var p=o.getFullYear(),v=i.getFullYear(),b=p;b<=v;b++)h.push(yD(A8(new Date),b));var x=function(_){var S=yD(ro(n),Number(_.target.value));e.onChange(S)},y=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:H8;return Ee.jsx(y,{name:"years","aria-label":d(),className:l.dropdown_year,style:s.dropdown_year,onChange:x,value:n.getFullYear(),caption:u(n,{locale:a}),children:h.map(function(_){return Ee.jsx("option",{value:_.getFullYear(),children:u(_,{locale:a})},_.getFullYear())})})}function Yhe(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function Khe(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,a=e.fromDate,s=e.numberOfMonths,l=s===void 0?1:s;if(i&&_h(i,o)<0){var c=-1*(l-1);o=xi(i,c)}return a&&_h(o,a)<0&&(o=a),ro(o)}function Xhe(){var e=bn(),t=Khe(e),n=Yhe(t,e.month),r=n[0],o=n[1],i=function(a){var s;if(!e.disableNavigation){var l=ro(a);o(l),(s=e.onMonthChange)===null||s===void 0||s.call(e,l)}};return[r,i]}function Qhe(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=ro(e),i=ro(xi(o,r)),a=_h(i,o),s=[],l=0;l<a;l++){var c=xi(o,l);s.push(c)}return n&&(s=s.reverse()),s}function Jhe(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,a=r?i:1,s=ro(e);if(!n)return xi(s,a);var l=_h(n,e);if(!(l<i))return xi(s,a)}}function Zhe(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,a=r?i:1,s=ro(e);if(!n)return xi(s,-a);var l=_h(s,n);if(!(l<=0))return xi(s,-a)}}var W8=m.createContext(void 0);function epe(e){var t=bn(),n=Xhe(),r=n[0],o=n[1],i=Qhe(r,t),a=Jhe(r,t),s=Zhe(r,t),l=function(d){return i.some(function(h){return zE(d,h)})},c=function(d,h){l(d)||(h&&j8(d,h)?o(xi(d,1+t.numberOfMonths*-1)):o(d))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:s,nextMonth:a,isDateDisplayed:l};return Ee.jsx(W8.Provider,{value:u,children:e.children})}function Pp(){var e=m.useContext(W8);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function _D(e){var t,n=bn(),r=n.classNames,o=n.styles,i=n.components,a=Pp().goToMonth,s=function(u){a(xi(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:V8,c=Ee.jsx(l,{id:e.id,displayMonth:e.displayMonth});return Ee.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[Ee.jsx("div",{className:r.vhidden,children:c}),Ee.jsx(qhe,{onChange:s,displayMonth:e.displayMonth}),Ee.jsx(Ghe,{onChange:s,displayMonth:e.displayMonth})]})}function tpe(e){return Ee.jsx("svg",ot({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Ee.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function npe(e){return Ee.jsx("svg",ot({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Ee.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Q0=m.forwardRef(function(e,t){var n=bn(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var a=i.join(" "),s=ot(ot({},o.button_reset),o.button);return e.style&&Object.assign(s,e.style),Ee.jsx("button",ot({},e,{ref:t,type:"button",className:a,style:s}))});function rpe(e){var t,n,r=bn(),o=r.dir,i=r.locale,a=r.classNames,s=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return Ee.jsx(Ee.Fragment,{});var h=c(e.previousMonth,{locale:i}),p=[a.nav_button,a.nav_button_previous].join(" "),v=u(e.nextMonth,{locale:i}),b=[a.nav_button,a.nav_button_next].join(" "),x=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:npe,y=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:tpe;return Ee.jsxs("div",{className:a.nav,style:s.nav,children:[!e.hidePrevious&&Ee.jsx(Q0,{name:"previous-month","aria-label":h,className:p,style:s.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?Ee.jsx(x,{className:a.nav_icon,style:s.nav_icon}):Ee.jsx(y,{className:a.nav_icon,style:s.nav_icon})}),!e.hideNext&&Ee.jsx(Q0,{name:"next-month","aria-label":v,className:b,style:s.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?Ee.jsx(y,{className:a.nav_icon,style:s.nav_icon}):Ee.jsx(x,{className:a.nav_icon,style:s.nav_icon})})]})}function SD(e){var t=bn().numberOfMonths,n=Pp(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,a=n.displayMonths,s=a.findIndex(function(v){return zE(e.displayMonth,v)}),l=s===0,c=s===a.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l),h=function(){r&&i(r)},p=function(){o&&i(o)};return Ee.jsx(rpe,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:r,onPreviousClick:h,onNextClick:p})}function ope(e){var t,n=bn(),r=n.classNames,o=n.disableNavigation,i=n.styles,a=n.captionLayout,s=n.components,l=(t=s==null?void 0:s.CaptionLabel)!==null&&t!==void 0?t:V8,c;return o?c=Ee.jsx(l,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?c=Ee.jsx(_D,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?c=Ee.jsxs(Ee.Fragment,{children:[Ee.jsx(_D,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),Ee.jsx(SD,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=Ee.jsxs(Ee.Fragment,{children:[Ee.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Ee.jsx(SD,{displayMonth:e.displayMonth,id:e.id})]}),Ee.jsx("div",{className:r.caption,style:i.caption,children:c})}function ipe(e){var t=bn(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?Ee.jsx("tfoot",{className:o,style:r.tfoot,children:Ee.jsx("tr",{children:Ee.jsx("td",{colSpan:8,children:n})})}):Ee.jsx(Ee.Fragment,{})}function ape(e,t,n){for(var r=n?dc(new Date):Ji(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var a=Lr(r,i);o.push(a)}return o}function spe(){var e=bn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,a=e.ISOWeek,s=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=ape(o,i,a);return Ee.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&Ee.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,d){return Ee.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:s(u,{locale:o})},d)})]})}function lpe(){var e,t=bn(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:spe;return Ee.jsx("thead",{style:r.head,className:n.head,children:Ee.jsx(i,{})})}function cpe(e){var t=bn(),n=t.locale,r=t.formatters.formatDay;return Ee.jsx(Ee.Fragment,{children:r(e.date,{locale:n})})}var BE=m.createContext(void 0);function upe(e){if(!Ep(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return Ee.jsx(BE.Provider,{value:t,children:e.children})}return Ee.jsx(dpe,{initialProps:e.initialProps,children:e.children})}function dpe(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,a=function(c,u,d){var h,p;(h=t.onDayClick)===null||h===void 0||h.call(t,c,u,d);var v=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!v){var b=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!b){var x=r?z8([],r,!0):[];if(u.selected){var y=x.findIndex(function(_){return to(c,_)});x.splice(y,1)}else x.push(c);(p=t.onSelect)===null||p===void 0||p.call(t,x,c,u,d)}}},s={disabled:[]};r&&s.disabled.push(function(c){var u=i&&r.length>i-1,d=r.some(function(h){return to(h,c)});return!!(u&&!d)});var l={selected:r,onDayClick:a,modifiers:s};return Ee.jsx(BE.Provider,{value:l,children:n})}function VE(){var e=m.useContext(BE);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function fpe(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?to(o,e)&&to(r,e)?void 0:to(o,e)?{from:o,to:void 0}:to(r,e)?void 0:V_(r,e)?{from:e,to:o}:{from:r,to:e}:o?V_(e,o)?{from:o,to:e}:{from:e,to:o}:r?j8(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var HE=m.createContext(void 0);function hpe(e){if(!Rp(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return Ee.jsx(HE.Provider,{value:t,children:e.children})}return Ee.jsx(ppe,{initialProps:e.initialProps,children:e.children})}function ppe(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,a=o.to,s=t.min,l=t.max,c=function(p,v,b){var x,y;(x=t.onDayClick)===null||x===void 0||x.call(t,p,v,b);var _=fpe(p,r);(y=t.onSelect)===null||y===void 0||y.call(t,_,p,v,b)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],a?(u.range_end=[a],to(i,a)||(u.range_middle=[{after:i,before:a}])):u.range_end=[i]):a&&(u.range_start=[a],u.range_end=[a]),s&&(i&&!a&&u.disabled.push({after:rx(i,s-1),before:Lr(i,s-1)}),i&&a&&u.disabled.push({after:i,before:Lr(i,s-1)}),!i&&a&&u.disabled.push({after:rx(a,s-1),before:Lr(a,s-1)})),l){if(i&&!a&&(u.disabled.push({before:Lr(i,-l+1)}),u.disabled.push({after:Lr(i,l-1)})),i&&a){var d=Hi(a,i)+1,h=l-d;u.disabled.push({before:rx(i,h)}),u.disabled.push({after:Lr(a,h)})}!i&&a&&(u.disabled.push({before:Lr(a,-l+1)}),u.disabled.push({after:Lr(a,l-1)}))}return Ee.jsx(HE.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function WE(){var e=m.useContext(HE);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function r0(e){return Array.isArray(e)?z8([],e,!0):e!==void 0?[e]:[]}function gpe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=r0(o)}),t}var wi;(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"})(wi||(wi={}));var mpe=wi.Selected,xa=wi.Disabled,bpe=wi.Hidden,vpe=wi.Today,ix=wi.RangeEnd,ax=wi.RangeMiddle,sx=wi.RangeStart,ype=wi.Outside;function xpe(e,t,n){var r,o=(r={},r[mpe]=r0(e.selected),r[xa]=r0(e.disabled),r[bpe]=r0(e.hidden),r[vpe]=[e.today],r[ix]=[],r[ax]=[],r[sx]=[],r[ype]=[],r);return e.fromDate&&o[xa].push({before:e.fromDate}),e.toDate&&o[xa].push({after:e.toDate}),Ep(e)?o[xa]=o[xa].concat(t.modifiers[xa]):Rp(e)&&(o[xa]=o[xa].concat(n.modifiers[xa]),o[sx]=n.modifiers[sx],o[ax]=n.modifiers[ax],o[ix]=n.modifiers[ix]),o}var U8=m.createContext(void 0);function wpe(e){var t=bn(),n=VE(),r=WE(),o=xpe(t,n,r),i=gpe(t.modifiers),a=ot(ot({},o),i);return Ee.jsx(U8.Provider,{value:a,children:e.children})}function q8(){var e=m.useContext(U8);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function _pe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Spe(e){return!!(e&&typeof e=="object"&&"from"in e)}function Cpe(e){return!!(e&&typeof e=="object"&&"after"in e)}function Epe(e){return!!(e&&typeof e=="object"&&"before"in e)}function Rpe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Ppe(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=Hi(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var a=Hi(e,r)>=0&&Hi(o,e)>=0;return a}return o?to(o,e):r?to(r,e):!1}function $pe(e){return LE(e)}function Ope(e){return Array.isArray(e)&&e.every(LE)}function Tpe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if($pe(n))return to(e,n);if(Ope(n))return n.includes(e);if(Spe(n))return Ppe(e,n);if(Rpe(n))return n.dayOfWeek.includes(e.getDay());if(_pe(n)){var r=Hi(n.before,e),o=Hi(n.after,e),i=r>0,a=o<0,s=V_(n.before,n.after);return s?a&&i:i||a}return Cpe(n)?Hi(e,n.after)>0:Epe(n)?Hi(n.before,e)>0:typeof n=="function"?n(e):!1})}function UE(e,t,n){var r=Object.keys(t).reduce(function(i,a){var s=t[a];return Tpe(e,s)&&i.push(a),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!zE(e,n)&&(o.outside=!0),o}function Dpe(e,t){for(var n=ro(e[0]),r=FE(e[e.length-1]),o,i,a=n;a<=r;){var s=UE(a,t),l=!s.disabled&&!s.hidden;if(!l){a=Lr(a,1);continue}if(s.selected)return a;s.today&&!i&&(i=a),o||(o=a),a=Lr(a,1)}return i||o}var Ape=365;function G8(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,a=t.retry,s=a===void 0?{count:0,lastFocused:e}:a,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,h={day:Lr,week:B_,month:xi,year:vfe,startOfWeek:function(x){return o.ISOWeek?dc(x):Ji(x,{locale:d,weekStartsOn:l})},endOfWeek:function(x){return o.ISOWeek?M8(x):jE(x,{locale:d,weekStartsOn:l})}},p=h[n](e,r==="after"?1:-1);r==="before"&&c?p=yfe([c,p]):r==="after"&&u&&(p=xfe([u,p]));var v=!0;if(i){var b=UE(p,i);v=!b.disabled&&!b.hidden}return v?p:s.count>Ape?s.lastFocused:G8(p,{moveBy:n,direction:r,context:o,modifiers:i,retry:ot(ot({},s),{count:s.count+1})})}var Y8=m.createContext(void 0);function Mpe(e){var t=Pp(),n=q8(),r=m.useState(),o=r[0],i=r[1],a=m.useState(),s=a[0],l=a[1],c=Dpe(t.displayMonths,n),u=o??(s&&t.isDateDisplayed(s))?s:c,d=function(){l(o),i(void 0)},h=function(x){i(x)},p=bn(),v=function(x,y){if(o){var _=G8(o,{moveBy:x,direction:y,context:p,modifiers:n});to(o,_)||(t.goToDate(_,o),h(_))}},b={focusedDay:o,focusTarget:u,blur:d,focus:h,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 Ee.jsx(Y8.Provider,{value:b,children:e.children})}function qE(){var e=m.useContext(Y8);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function kpe(e,t){var n=q8(),r=UE(e,n,t);return r}var GE=m.createContext(void 0);function Ipe(e){if(!bv(e.initialProps)){var t={selected:void 0};return Ee.jsx(GE.Provider,{value:t,children:e.children})}return Ee.jsx(Npe,{initialProps:e.initialProps,children:e.children})}function Npe(e){var t=e.initialProps,n=e.children,r=function(i,a,s){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,a,s),a.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,a,s);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,a,s)},o={selected:t.selected,onDayClick:r};return Ee.jsx(GE.Provider,{value:o,children:n})}function K8(){var e=m.useContext(GE);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Lpe(e,t){var n=bn(),r=K8(),o=VE(),i=WE(),a=qE(),s=a.focusDayAfter,l=a.focusDayBefore,c=a.focusWeekAfter,u=a.focusWeekBefore,d=a.blur,h=a.focus,p=a.focusMonthBefore,v=a.focusMonthAfter,b=a.focusYearBefore,x=a.focusYearAfter,y=a.focusStartOfWeek,_=a.focusEndOfWeek,S=function(V){var K,q,O,H;bv(n)?(K=r.onDayClick)===null||K===void 0||K.call(r,e,t,V):Ep(n)?(q=o.onDayClick)===null||q===void 0||q.call(o,e,t,V):Rp(n)?(O=i.onDayClick)===null||O===void 0||O.call(i,e,t,V):(H=n.onDayClick)===null||H===void 0||H.call(n,e,t,V)},C=function(V){var K;h(e),(K=n.onDayFocus)===null||K===void 0||K.call(n,e,t,V)},E=function(V){var K;d(),(K=n.onDayBlur)===null||K===void 0||K.call(n,e,t,V)},$=function(V){var K;(K=n.onDayMouseEnter)===null||K===void 0||K.call(n,e,t,V)},T=function(V){var K;(K=n.onDayMouseLeave)===null||K===void 0||K.call(n,e,t,V)},D=function(V){var K;(K=n.onDayPointerEnter)===null||K===void 0||K.call(n,e,t,V)},M=function(V){var K;(K=n.onDayPointerLeave)===null||K===void 0||K.call(n,e,t,V)},L=function(V){var K;(K=n.onDayTouchCancel)===null||K===void 0||K.call(n,e,t,V)},F=function(V){var K;(K=n.onDayTouchEnd)===null||K===void 0||K.call(n,e,t,V)},z=function(V){var K;(K=n.onDayTouchMove)===null||K===void 0||K.call(n,e,t,V)},X=function(V){var K;(K=n.onDayTouchStart)===null||K===void 0||K.call(n,e,t,V)},G=function(V){var K;(K=n.onDayKeyUp)===null||K===void 0||K.call(n,e,t,V)},A=function(V){var K;switch(V.key){case"ArrowLeft":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?s():l();break;case"ArrowRight":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?l():s();break;case"ArrowDown":V.preventDefault(),V.stopPropagation(),c();break;case"ArrowUp":V.preventDefault(),V.stopPropagation(),u();break;case"PageUp":V.preventDefault(),V.stopPropagation(),V.shiftKey?b():p();break;case"PageDown":V.preventDefault(),V.stopPropagation(),V.shiftKey?x():v();break;case"Home":V.preventDefault(),V.stopPropagation(),y();break;case"End":V.preventDefault(),V.stopPropagation(),_();break}(K=n.onDayKeyDown)===null||K===void 0||K.call(n,e,t,V)},U={onClick:S,onFocus:C,onBlur:E,onKeyDown:A,onKeyUp:G,onMouseEnter:$,onMouseLeave:T,onPointerEnter:D,onPointerLeave:M,onTouchCancel:L,onTouchEnd:F,onTouchMove:z,onTouchStart:X};return U}function Fpe(){var e=bn(),t=K8(),n=VE(),r=WE(),o=bv(e)?t.selected:Ep(e)?n.selected:Rp(e)?r.selected:void 0;return o}function jpe(e){return Object.values(wi).includes(e)}function zpe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var o=e.modifiersClassNames[r];if(o)n.push(o);else if(jpe(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Bpe(e,t){var n=ot({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=ot(ot({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function Vpe(e,t,n){var r,o,i,a=bn(),s=qE(),l=kpe(e,t),c=Lpe(e,l),u=Fpe(),d=!!(a.onDayClick||a.mode!=="default");m.useEffect(function(){var $;l.outside||s.focusedDay&&d&&to(s.focusedDay,e)&&(($=n.current)===null||$===void 0||$.focus())},[s.focusedDay,e,n,d,l.outside]);var h=zpe(a,l).join(" "),p=Bpe(a,l),v=!!(l.outside&&!a.showOutsideDays||l.hidden),b=(i=(o=a.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:cpe,x=Ee.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),y={style:p,className:h,children:x,role:"gridcell"},_=s.focusTarget&&to(s.focusTarget,e)&&!l.outside,S=s.focusedDay&&to(s.focusedDay,e),C=ot(ot(ot({},y),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=S||_?0:-1,r)),c),E={isButton:d,isHidden:v,activeModifiers:l,selectedDays:u,buttonProps:C,divProps:y};return E}function Hpe(e){var t=m.useRef(null),n=Vpe(e.date,e.displayMonth,t);return n.isHidden?Ee.jsx("div",{role:"gridcell"}):n.isButton?Ee.jsx(Q0,ot({name:"day",ref:t},n.buttonProps)):Ee.jsx("div",ot({},n.divProps))}function Wpe(e){var t=e.number,n=e.dates,r=bn(),o=r.onWeekNumberClick,i=r.styles,a=r.classNames,s=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:s});if(!o)return Ee.jsx("span",{className:a.weeknumber,style:i.weeknumber,children:u});var d=l(Number(t),{locale:s}),h=function(p){o(t,n,p)};return Ee.jsx(Q0,{name:"week-number","aria-label":d,className:a.weeknumber,style:i.weeknumber,onClick:h,children:u})}function Upe(e){var t,n,r=bn(),o=r.styles,i=r.classNames,a=r.showWeekNumber,s=r.components,l=(t=s==null?void 0:s.Day)!==null&&t!==void 0?t:Hpe,c=(n=s==null?void 0:s.WeekNumber)!==null&&n!==void 0?n:Wpe,u;return a&&(u=Ee.jsx("td",{className:i.cell,style:o.cell,children:Ee.jsx(c,{number:e.weekNumber,dates:e.dates})})),Ee.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(d){return Ee.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:Ee.jsx(l,{displayMonth:e.displayMonth,date:d})},yhe(d))})]})}function CD(e,t,n){for(var r=n!=null&&n.ISOWeek?M8(t):jE(t,n),o=n!=null&&n.ISOWeek?dc(e):Ji(e,n),i=Hi(r,o),a=[],s=0;s<=i;s++)a.push(Lr(o,s));var l=a.reduce(function(c,u){var d=n!=null&&n.ISOWeek?I8(u):L8(u,n),h=c.find(function(p){return p.weekNumber===d});return h?(h.dates.push(u),c):(c.push({weekNumber:d,dates:[u]}),c)},[]);return l}function qpe(e,t){var n=CD(ro(e),FE(e),t);if(t!=null&&t.useFixedWeeks){var r=whe(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],a=B_(i,6-r),s=CD(B_(i,1),a,t);n.push.apply(n,s)}}return n}function Gpe(e){var t,n,r,o=bn(),i=o.locale,a=o.classNames,s=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,h=o.firstWeekContainsDate,p=o.ISOWeek,v=qpe(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:i,weekStartsOn:d,firstWeekContainsDate:h}),b=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:lpe,x=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:Upe,y=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:ipe;return Ee.jsxs("table",{id:e.id,className:a.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&Ee.jsx(b,{}),Ee.jsx("tbody",{className:a.tbody,style:s.tbody,children:v.map(function(_){return Ee.jsx(x,{displayMonth:e.displayMonth,dates:_.dates,weekNumber:_.weekNumber},_.weekNumber)})}),Ee.jsx(y,{displayMonth:e.displayMonth})]})}function Ype(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Kpe=Ype()?m.useLayoutEffect:m.useEffect,lx=!1,Xpe=0;function ED(){return"react-day-picker-".concat(++Xpe)}function Qpe(e){var t,n=e??(lx?ED():null),r=m.useState(n),o=r[0],i=r[1];return Kpe(function(){o===null&&i(ED())},[]),m.useEffect(function(){lx===!1&&(lx=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function Jpe(e){var t,n,r=bn(),o=r.dir,i=r.classNames,a=r.styles,s=r.components,l=Pp().displayMonths,c=Qpe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,d=[i.month],h=a.month,p=e.displayIndex===0,v=e.displayIndex===l.length-1,b=!p&&!v;o==="rtl"&&(t=[p,v],v=t[0],p=t[1]),p&&(d.push(i.caption_start),h=ot(ot({},h),a.caption_start)),v&&(d.push(i.caption_end),h=ot(ot({},h),a.caption_end)),b&&(d.push(i.caption_between),h=ot(ot({},h),a.caption_between));var x=(n=s==null?void 0:s.Caption)!==null&&n!==void 0?n:ope;return Ee.jsxs("div",{className:d.join(" "),style:h,children:[Ee.jsx(x,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Ee.jsx(Gpe,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function Zpe(e){var t=bn(),n=t.classNames,r=t.styles;return Ee.jsx("div",{className:n.months,style:r.months,children:e.children})}function ege(e){var t,n,r=e.initialProps,o=bn(),i=qE(),a=Pp(),s=m.useState(!1),l=s[0],c=s[1];m.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var d=ot(ot({},o.styles.root),o.style),h=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,b){var x;return ot(ot({},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:Zpe;return Ee.jsx("div",ot({className:u.join(" "),style:d,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:Ee.jsx(p,{children:a.displayMonths.map(function(v,b){return Ee.jsx(Jpe,{displayIndex:b,displayMonth:v},b)})})}))}function tge(e){var t=e.children,n=She(e,["children"]);return Ee.jsx(Whe,{initialProps:n,children:Ee.jsx(epe,{children:Ee.jsx(Ipe,{initialProps:n,children:Ee.jsx(upe,{initialProps:n,children:Ee.jsx(hpe,{initialProps:n,children:Ee.jsx(wpe,{children:Ee.jsx(Mpe,{children:t})})})})})})})}function nge(e){return Ee.jsx(tge,ot({},e,{children:Ee.jsx(ege,{initialProps:e})}))}function X8({className:e,classNames:t,showOutsideDays:n=!0,...r}){return R.jsx(nge,{showOutsideDays:n,className:ye("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:ye(xh({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:ye(xh({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...o})=>R.jsx(pC,{...o,className:"h-4 w-4"}),IconRight:({...o})=>R.jsx(jb,{...o,className:"h-4 w-4"})},...r})}X8.displayName="Calendar";function Q8(e){const{authToken:t}=_i(),n=we(_=>_.dashboard.filters),r=we(_=>_.selectedSheetId),o=we(_=>_.filterValues),[i,a]=m.useState(!0),s=n==null?void 0:n.filter(_=>_.sheetId===r||!_.sheetId),l=o==null?void 0:o.filter(_=>(s==null?void 0:s.some(S=>S.id===_.filterId))||_.filterId.endsWith(r));function c(_){return i?{allowQuery:!0,filterValues:_.filter(E=>E.filterId!==e.id)}:(_==null?void 0:_.find(C=>C.filterId===e.id))?{allowQuery:!1,filterValues:_}:{allowQuery:!0,filterValues:_}}const{allowQuery:u,filterValues:d}=c(l||[]),{data:h,isLoading:p,isFetching:v,isError:b,refetch:x,isSuccess:y}=ap({queryKey:["filter",e.id,e.sql,JSON.stringify(d)],queryFn:()=>fb("https://semaphor.cloud/api/v1/query",(t==null?void 0:t.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:d,cache_config:AS()}),enabled:!!e.sql&&!!e.connectionId&&u,placeholderData:_=>_});return m.useEffect(()=>{y&&i&&a(!1)},[y,i]),{data:h,isLoading:p,isFetching:v,isError:b,refetch:x}}function rge({filter:e,className:t}){var S,C,E,$,T,D,M,L;const n=we(F=>F.themeStyle),[r,o]=m.useState(!1),[i,a]=m.useState(),[s,l]=m.useState(),c=we(F=>F.filterValues);_i();const u=we(F=>F.actions.addOrUpdateFilterValue),d=we(F=>F.actions.removeFilterValue),{data:h,isLoading:p,isFetching:v,isError:b,refetch:x}=Q8(e);m.useEffect(()=>{var F;if(((F=h==null?void 0:h.records)==null?void 0:F.length)>0){const z=h.records[0];if(!z.min||!z.max)return;a({from:new Date(z.min),to:new Date(z.max)}),l({from:new Date(z.min),to:new Date(z.max)})}},[h]),m.useEffect(()=>{if(c&&!c.find(z=>z.filterId===e.id)){a(s);return}},[c,e.id,s]);function y(){d(e.id),a(s),o(!1)}function _(){if(!i)return;console.log(i);const F=[i==null?void 0:i.from,i==null?void 0:i.to];console.log(F);const z={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:vu(e),name:e.column,operation:"between",values:F};u(z),o(!1)}return p?R.jsx("div",{children:R.jsx(yb,{className:"h-8 w-full bg-foreground/10"})}):b?R.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):h?R.jsx("div",{className:ye("grid gap-2",t),children:R.jsxs(gv,{open:r,onOpenChange:o,children:[R.jsx(mv,{style:{borderRadius:(C=(S=n==null?void 0:n.chart)==null?void 0:S.options)==null?void 0:C.borderRadius},asChild:!0,children:R.jsxs(no,{size:"sm",id:"date",variant:"outline",className:ye("h-[34px] w-full justify-start rounded-sm text-left font-normal",!i&&"text-muted-foreground"),children:[R.jsx(v6,{className:"mr-2 h-4 w-4"}),i!=null&&i.from?i.to?R.jsxs(R.Fragment,{children:[Gi(i.from,"LLL dd, y")," -"," ",Gi(i.to,"LLL dd, y")]}):Gi(i.from,"LLL dd, y"):R.jsx("span",{children:"Pick a date"})]})}),R.jsxs(Sp,{style:{borderRadius:($=(E=n==null?void 0:n.chart)==null?void 0:E.options)==null?void 0:$.borderRadius},className:"w-auto p-0",align:"start",children:[R.jsx("div",{className:"px-4 pt-3",children:R.jsx(Tn,{children:e.title})}),R.jsx(X8,{initialFocus:!0,mode:"range",defaultMonth:i==null?void 0:i.from,selected:i,onSelect:a,numberOfMonths:2}),R.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[R.jsx(no,{style:{borderRadius:(D=(T=n==null?void 0:n.chart)==null?void 0:T.options)==null?void 0:D.borderRadius},size:"sm",variant:"outline",onClick:_,children:"Apply"}),R.jsx(no,{style:{borderRadius:(L=(M=n==null?void 0:n.chart)==null?void 0:M.options)==null?void 0:L.borderRadius},size:"sm",variant:"outline",onClick:y,children:"Clear"})]})]})]})}):R.jsxs(Tn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}/**
351
+ * react-virtual
352
+ *
353
+ * Copyright (c) TanStack
354
+ *
355
+ * This source code is licensed under the MIT license found in the
356
+ * LICENSE.md file in the root directory of this source tree.
357
+ *
358
+ * @license MIT
359
+ */function J0(){return J0=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},J0.apply(this,arguments)}/**
360
+ * virtual-core
361
+ *
362
+ * Copyright (c) TanStack
363
+ *
364
+ * This source code is licensed under the MIT license found in the
365
+ * LICENSE.md file in the root directory of this source tree.
366
+ *
367
+ * @license MIT
368
+ */function Z0(){return Z0=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},Z0.apply(this,arguments)}/**
369
+ * virtual-core
370
+ *
371
+ * Copyright (c) TanStack
372
+ *
373
+ * This source code is licensed under the MIT license found in the
374
+ * LICENSE.md file in the root directory of this source tree.
375
+ *
376
+ * @license MIT
377
+ */function eu(e,t,n){var r,o=(r=n.initialDeps)!=null?r:[],i;return function(){var a;n.key&&n.debug!=null&&n.debug()&&(a=Date.now());var s=e(),l=s.length!==o.length||s.some(function(v,b){return o[b]!==v});if(!l)return i;o=s;var c;if(n.key&&n.debug!=null&&n.debug()&&(c=Date.now()),i=t.apply(void 0,s),n.key&&n.debug!=null&&n.debug()){var u=Math.round((Date.now()-a)*100)/100,d=Math.round((Date.now()-c)*100)/100,h=d/16,p=function(b,x){for(b=String(b);b.length<x;)b=" "+b;return b};console.info("%c⏱ "+p(d,5)+" /"+p(u,5)+" ms",`
378
+ font-size: .6rem;
379
+ font-weight: bold;
380
+ color: hsl(`+Math.max(0,Math.min(120-120*h,120))+"deg 100% 31%);",n==null?void 0:n.key)}return n==null||n.onChange==null||n.onChange(i),i}}function cx(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var oge=function(t,n){return Math.abs(t-n)<1};/**
381
+ * virtual-core
382
+ *
383
+ * Copyright (c) TanStack
384
+ *
385
+ * This source code is licensed under the MIT license found in the
386
+ * LICENSE.md file in the root directory of this source tree.
387
+ *
388
+ * @license MIT
389
+ */var ige=function(t){return t},age=function(t){for(var n=Math.max(t.startIndex-t.overscan,0),r=Math.min(t.endIndex+t.overscan,t.count-1),o=[],i=n;i<=r;i++)o.push(i);return o},sge=function(t,n){var r=t.scrollElement;if(r){var o=function(s){var l=s.width,c=s.height;n({width:Math.round(l),height:Math.round(c)})};o(r.getBoundingClientRect());var i=new ResizeObserver(function(a){var s=a[0];if(s!=null&&s.borderBoxSize){var l=s.borderBoxSize[0];if(l){o({width:l.inlineSize,height:l.blockSize});return}}o(r.getBoundingClientRect())});return i.observe(r,{box:"border-box"}),function(){i.unobserve(r)}}},lge=function(t,n){var r=t.scrollElement;if(r){var o=function(){n(r[t.options.horizontal?"scrollLeft":"scrollTop"])};return o(),r.addEventListener("scroll",o,{passive:!0}),function(){r.removeEventListener("scroll",o)}}},cge=function(t,n,r){if(n!=null&&n.borderBoxSize){var o=n.borderBoxSize[0];if(o){var i=Math.round(o[r.options.horizontal?"inlineSize":"blockSize"]);return i}}return Math.round(t.getBoundingClientRect()[r.options.horizontal?"width":"height"])},uge=function(t,n,r){var o,i,a=n.adjustments,s=a===void 0?0:a,l=n.behavior,c=t+s;(o=r.scrollElement)==null||o.scrollTo==null||o.scrollTo((i={},i[r.options.horizontal?"left":"top"]=c,i.behavior=l,i))},dge=function(t){var n=this;this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeoutId=null,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=function(){var r=null,o=function(){return r||(typeof ResizeObserver<"u"?r=new ResizeObserver(function(a){a.forEach(function(s){n._measureElement(s.target,s)})}):null)};return{disconnect:function(){var a;return(a=o())==null?void 0:a.disconnect()},observe:function(a){var s;return(s=o())==null?void 0:s.observe(a,{box:"border-box"})},unobserve:function(a){var s;return(s=o())==null?void 0:s.unobserve(a)}}}(),this.range=null,this.setOptions=function(r){Object.entries(r).forEach(function(o){var i=o[0],a=o[1];typeof a>"u"&&delete r[i]}),n.options=Z0({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ige,rangeExtractor:age,onChange:function(){},measureElement:cge,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},r)},this.notify=function(r){n.options.onChange==null||n.options.onChange(n,r)},this.maybeNotify=eu(function(){return n.calculateRange(),[n.isScrolling,n.range?n.range.startIndex:null,n.range?n.range.endIndex:null]},function(r){n.notify(r)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:function(){return n.options.debug},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){n.unsubs.filter(Boolean).forEach(function(r){return r()}),n.unsubs=[],n.scrollElement=null},this._didMount=function(){return n.measureElementCache.forEach(n.observer.observe),function(){n.observer.disconnect(),n.cleanup()}},this._willUpdate=function(){var r=n.options.getScrollElement();n.scrollElement!==r&&(n.cleanup(),n.scrollElement=r,n._scrollToOffset(n.scrollOffset,{adjustments:void 0,behavior:void 0}),n.unsubs.push(n.options.observeElementRect(n,function(o){n.scrollRect=o,n.maybeNotify()})),n.unsubs.push(n.options.observeElementOffset(n,function(o){n.scrollAdjustments=0,n.scrollOffset!==o&&(n.isScrollingTimeoutId!==null&&(clearTimeout(n.isScrollingTimeoutId),n.isScrollingTimeoutId=null),n.isScrolling=!0,n.scrollDirection=n.scrollOffset<o?"forward":"backward",n.scrollOffset=o,n.maybeNotify(),n.isScrollingTimeoutId=setTimeout(function(){n.isScrollingTimeoutId=null,n.isScrolling=!1,n.scrollDirection=null,n.maybeNotify()},n.options.scrollingDelay))})))},this.getSize=function(){return n.scrollRect[n.options.horizontal?"width":"height"]},this.memoOptions=eu(function(){return[n.options.count,n.options.paddingStart,n.options.scrollMargin,n.options.getItemKey]},function(r,o,i,a){return n.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:o,scrollMargin:i,getItemKey:a}},{key:!1}),this.getFurthestMeasurement=function(r,o){for(var i=new Map,a=new Map,s=o-1;s>=0;s--){var l=r[s];if(!i.has(l.lane)){var c=a.get(l.lane);if(c==null||l.end>c.end?a.set(l.lane,l):l.end<c.end&&i.set(l.lane,!0),i.size===n.options.lanes)break}}return a.size===n.options.lanes?Array.from(a.values()).sort(function(u,d){return u.end-d.end})[0]:void 0},this.getMeasurements=eu(function(){return[n.memoOptions(),n.itemSizeCache]},function(r,o){var i=r.count,a=r.paddingStart,s=r.scrollMargin,l=r.getItemKey,c=n.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,n.pendingMeasuredCacheIndexes):0;n.pendingMeasuredCacheIndexes=[];for(var u=n.measurementsCache.slice(0,c),d=c;d<i;d++){var h=l(d),p=n.options.lanes===1?u[d-1]:n.getFurthestMeasurement(u,d),v=p?p.end:a+s,b=o.get(h),x=typeof b=="number"?b:n.options.estimateSize(d),y=v+x,_=p?p.lane:d%n.options.lanes;u[d]={index:d,start:v,size:x,end:y,key:h,lane:_}}return n.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return n.options.debug}}),this.calculateRange=eu(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,o,i){return n.range=r.length>0&&o>0?fge({measurements:r,outerSize:o,scrollOffset:i}):null},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return n.options.debug}}),this.getIndexes=eu(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,o,i,a){return o===null?[]:r(Z0({},o,{overscan:i,count:a}))},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.indexFromElement=function(r){var o=n.options.indexAttribute,i=r.getAttribute(o);return i?parseInt(i,10):(console.warn("Missing attribute name '"+o+"={index}' on measured element."),-1)},this._measureElement=function(r,o){var i=n.measurementsCache[n.indexFromElement(r)];if(!i||!r.isConnected){n.measureElementCache.forEach(function(l,c){l===r&&(n.observer.unobserve(r),n.measureElementCache.delete(c))});return}var a=n.measureElementCache.get(i.key);a!==r&&(a&&n.observer.unobserve(a),n.observer.observe(r),n.measureElementCache.set(i.key,r));var s=n.options.measureElement(r,o,n);n.resizeItem(i,s)},this.resizeItem=function(r,o){var i,a=(i=n.itemSizeCache.get(r.key))!=null?i:r.size,s=o-a;s!==0&&(r.start<n.scrollOffset&&(process.env.NODE_ENV!=="production"&&n.options.debug&&console.info("correction",s),n._scrollToOffset(n.scrollOffset,{adjustments:n.scrollAdjustments+=s,behavior:void 0})),n.pendingMeasuredCacheIndexes.push(r.index),n.itemSizeCache=new Map(n.itemSizeCache.set(r.key,o)),n.notify(!1))},this.measureElement=function(r){r&&n._measureElement(r,void 0)},this.getVirtualItems=eu(function(){return[n.getIndexes(),n.getMeasurements()]},function(r,o){for(var i=[],a=0,s=r.length;a<s;a++){var l=r[a],c=o[l];i.push(c)}return i},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.getVirtualItemForOffset=function(r){var o=n.getMeasurements();return cx(o[J8(0,o.length-1,function(i){return cx(o[i]).start},r)])},this.getOffsetForAlignment=function(r,o){var i=n.getSize();o==="auto"&&(r<=n.scrollOffset?o="start":r>=n.scrollOffset+i?o="end":o="start"),o==="start"?r=r:o==="end"?r=r-i:o==="center"&&(r=r-i/2);var a=n.options.horizontal?"scrollWidth":"scrollHeight",s=n.scrollElement?"document"in n.scrollElement?n.scrollElement.document.documentElement[a]:n.scrollElement[a]:0,l=s-n.getSize();return Math.max(Math.min(l,r),0)},this.getOffsetForIndex=function(r,o){o===void 0&&(o="auto"),r=Math.max(0,Math.min(r,n.options.count-1));var i=cx(n.getMeasurements()[r]);if(o==="auto")if(i.end>=n.scrollOffset+n.getSize()-n.options.scrollPaddingEnd)o="end";else if(i.start<=n.scrollOffset+n.options.scrollPaddingStart)o="start";else return[n.scrollOffset,o];var a=o==="end"?i.end+n.options.scrollPaddingEnd:i.start-n.options.scrollPaddingStart;return[n.getOffsetForAlignment(a,o),o]},this.isDynamicMode=function(){return n.measureElementCache.size>0},this.cancelScrollToIndex=function(){n.scrollToIndexTimeoutId!==null&&(clearTimeout(n.scrollToIndexTimeoutId),n.scrollToIndexTimeoutId=null)},this.scrollToOffset=function(r,o){var i=o===void 0?{}:o,a=i.align,s=a===void 0?"start":a,l=i.behavior;n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.getOffsetForAlignment(r,s),{adjustments:void 0,behavior:l})},this.scrollToIndex=function(r,o){var i=o===void 0?{}:o,a=i.align,s=a===void 0?"auto":a,l=i.behavior;r=Math.max(0,Math.min(r,n.options.count-1)),n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");var c=n.getOffsetForIndex(r,s),u=c[0],d=c[1];n._scrollToOffset(u,{adjustments:void 0,behavior:l}),l!=="smooth"&&n.isDynamicMode()&&(n.scrollToIndexTimeoutId=setTimeout(function(){n.scrollToIndexTimeoutId=null;var h=n.measureElementCache.has(n.options.getItemKey(r));if(h){var p=n.getOffsetForIndex(r,d),v=p[0];oge(v,n.scrollOffset)||n.scrollToIndex(r,{align:d,behavior:l})}else n.scrollToIndex(r,{align:d,behavior:l})}))},this.scrollBy=function(r,o){var i=o===void 0?{}:o,a=i.behavior;n.cancelScrollToIndex(),a==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.scrollOffset+r,{adjustments:void 0,behavior:a})},this.getTotalSize=function(){var r;return(((r=n.getMeasurements()[n.options.count-1])==null?void 0:r.end)||n.options.paddingStart)-n.options.scrollMargin+n.options.paddingEnd},this._scrollToOffset=function(r,o){var i=o.adjustments,a=o.behavior;n.options.scrollToFn(r,{behavior:a,adjustments:i},n)},this.measure=function(){n.itemSizeCache=new Map,n.notify(!1)},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(function(r){n.itemSizeCache.set(r.key,r.size)}),this.maybeNotify()},J8=function(t,n,r,o){for(;t<=n;){var i=(t+n)/2|0,a=r(i);if(a<o)t=i+1;else if(a>o)n=i-1;else return i}return t>0?t-1:0};function fge(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,o=t.length-1,i=function(c){return t[c].start},a=J8(0,o,i,r),s=a;s<o&&t[s].end<r+n;)s++;return{startIndex:a,endIndex:s}}/**
390
+ * react-virtual
391
+ *
392
+ * Copyright (c) TanStack
393
+ *
394
+ * This source code is licensed under the MIT license found in the
395
+ * LICENSE.md file in the root directory of this source tree.
396
+ *
397
+ * @license MIT
398
+ */var hge=typeof document<"u"?j.useLayoutEffect:j.useEffect;function pge(e){var t=j.useReducer(function(){return{}},{})[1],n=J0({},e,{onChange:function(a,s){s?Er.flushSync(t):t(),e.onChange==null||e.onChange(a,s)}}),r=j.useState(function(){return new dge(n)}),o=r[0];return o.setOptions(n),j.useEffect(function(){return o._didMount()},[]),hge(function(){return o._willUpdate()}),o}function gge(e){return pge(J0({observeElementRect:sge,observeElementOffset:lge,scrollToFn:uge},e))}var mge=Object.defineProperty,bge=(e,t,n)=>t in e?mge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ux=(e,t,n)=>(bge(e,typeof t!="symbol"?t+"":t,n),n);let vge=class{constructor(){ux(this,"current",this.detect()),ux(this,"handoffState","pending"),ux(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"}},Zl=new vge,Qn=(e,t)=>{Zl.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function Yi(e){let t=m.useRef(e);return Qn(()=>{t.current=e},[e]),t}function YE(e,t){let[n,r]=m.useState(e),o=Yi(e);return Qn(()=>r(o.current),[o,r,...t]),n}let $t=function(e){let t=Yi(e);return m.useCallback((...n)=>t.current(...n),[t])};function yge(e,t,n){let[r,o]=m.useState(n),i=e!==void 0,a=m.useRef(i),s=m.useRef(!1),l=m.useRef(!1);return i&&!a.current&&!s.current?(s.current=!0,a.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&a.current&&!l.current&&(l.current=!0,a.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,$t(c=>(i||o(c),t==null?void 0:t(c)))]}function xge(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function fc(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return xge(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=fc();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function $p(){let[e]=m.useState(fc);return m.useEffect(()=>()=>e.dispose(),[e]),e}function wge(){let e=typeof document>"u";return"useSyncExternalStore"in j?(t=>t.useSyncExternalStore)(j)(()=>()=>{},()=>!1,()=>!e):!1}function KE(){let e=wge(),[t,n]=j.useState(Zl.isHandoffComplete);return t&&Zl.isHandoffComplete===!1&&n(!1),j.useEffect(()=>{t!==!0&&n(!0)},[t]),j.useEffect(()=>Zl.handoff(),[]),e?!1:t}var RD;let Op=(RD=m.useId)!=null?RD:function(){let e=KE(),[t,n]=m.useState(e?()=>Zl.nextId():null);return Qn(()=>{t===null&&n(Zl.nextId())},[t]),t!=null?""+t:void 0};function ur(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ur),r}function XE(e){return Zl.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let PD=["[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 _ge=(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))(_ge||{}),Sge=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Sge||{}),Cge=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Cge||{}),Z8=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Z8||{});function Ege(e,t=0){var n;return e===((n=XE(e))==null?void 0:n.body)?!1:ur(t,{0(){return e.matches(PD)},1(){let r=e;for(;r!==null;){if(r.matches(PD))return!0;r=r.parentElement}return!1}})}var Rge=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Rge||{});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 Pge(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let a=o.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function $ge(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Oge(){return/Android/gi.test(window.navigator.userAgent)}function e4(){return $ge()||Oge()}function _m(e,t,n){let r=Yi(t);m.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,n),()=>document.removeEventListener(e,o,n)},[e,n])}function Tge(e,t,n){let r=Yi(t);m.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,n),()=>window.removeEventListener(e,o,n)},[e,n])}function Dge(e,t,n=!0){let r=m.useRef(!1);m.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function o(a,s){if(!r.current||a.defaultPrevented)return;let l=s(a);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let c=function u(d){return typeof d=="function"?u(d()):Array.isArray(d)||d instanceof Set?d:[d]}(e);for(let u of c){if(u===null)continue;let d=u instanceof HTMLElement?u:u.current;if(d!=null&&d.contains(l)||a.composed&&a.composedPath().includes(d))return}return!Ege(l,Z8.Loose)&&l.tabIndex!==-1&&a.preventDefault(),t(a,l)}let i=m.useRef(null);_m("pointerdown",a=>{var s,l;r.current&&(i.current=((l=(s=a.composedPath)==null?void 0:s.call(a))==null?void 0:l[0])||a.target)},!0),_m("mousedown",a=>{var s,l;r.current&&(i.current=((l=(s=a.composedPath)==null?void 0:s.call(a))==null?void 0:l[0])||a.target)},!0),_m("click",a=>{e4()||i.current&&(o(a,()=>i.current),i.current=null)},!0),_m("touchend",a=>o(a,()=>a.target instanceof HTMLElement?a.target:null),!0),Tge("blur",a=>o(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Age(...e){return m.useMemo(()=>XE(...e),[...e])}function $D(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 Mge(e,t){let[n,r]=m.useState(()=>$D(e));return Qn(()=>{r($D(e))},[e.type,e.as]),Qn(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let kge=Symbol();function Cc(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=$t(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[kge]))?void 0:n}function OD(e){return[e.screenX,e.screenY]}function Ige(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=OD(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=OD(t)}}}function Nge({container:e,accept:t,walk:n,enabled:r=!0}){let o=m.useRef(t),i=m.useRef(n);m.useEffect(()=>{o.current=t,i.current=n},[t,n]),Qn(()=>{if(!e||!r)return;let a=XE(e);if(!a)return;let s=o.current,l=i.current,c=Object.assign(d=>s(d),{acceptNode:s}),u=a.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[e,r,o,i])}function TD(e,t){let n=m.useRef([]),r=$t(e);m.useEffect(()=>{let o=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let s=r(t,o);return n.current=t,s}},[r,...t])}function eb(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var tb=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(tb||{}),Ms=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ms||{});function Ua({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:a,mergeRefs:s}){s=s??Lge;let l=t4(t,e);if(i)return Sm(l,n,r,a,s);let c=o??0;if(c&2){let{static:u=!1,...d}=l;if(u)return Sm(d,n,r,a,s)}if(c&1){let{unmount:u=!0,...d}=l;return ur(u?0:1,{0(){return null},1(){return Sm({...d,hidden:!0,style:{display:"none"}},n,r,a,s)}})}return Sm(l,n,r,a,s)}function Sm(e,t={},n,r,o){let{as:i=n,children:a,refName:s="ref",...l}=dx(e,["unmount","static"]),c=e.ref!==void 0?{[s]:e.ref}:{},u=typeof a=="function"?a(t):a;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let d={};if(t){let h=!1,p=[];for(let[v,b]of Object.entries(t))typeof b=="boolean"&&(h=!0),b===!0&&p.push(v);h&&(d["data-headlessui-state"]=p.join(" "))}if(i===m.Fragment&&Object.keys(W_(l)).length>0){if(!m.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(b=>` - ${b}`).join(`
399
+ `),"","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(`
400
+ `)].join(`
401
+ `));let h=u.props,p=typeof(h==null?void 0:h.className)=="function"?(...b)=>eb(h==null?void 0:h.className(...b),l.className):eb(h==null?void 0:h.className,l.className),v=p?{className:p}:{};return m.cloneElement(u,Object.assign({},t4(u.props,W_(dx(l,["ref"]))),d,c,{ref:o(u.ref,c.ref)},v))}return m.createElement(i,Object.assign({},dx(l,["ref"]),i!==m.Fragment&&c,i!==m.Fragment&&d),u)}function Lge(...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 t4(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](o,...i){let a=n[r];for(let s of a){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function ia(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function W_(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function dx(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Fge="div";var n4=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(n4||{});function jge(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Ua({ourProps:i,theirProps:o,slot:{},defaultTag:Fge,name:"Hidden"})}let zge=ia(jge),QE=m.createContext(null);QE.displayName="OpenClosedContext";var So=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(So||{});function JE(){return m.useContext(QE)}function r4({value:e,children:t}){return m.createElement(QE.Provider,{value:e},t)}function Bge(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Rl=[];Bge(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Rl[0]!==t.target&&(Rl.unshift(t.target),Rl=Rl.filter(n=>n!=null&&n.isConnected),Rl.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 Vge(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&&Hge(n)?!1:r}function Hge(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function Wge(e){throw new Error("Unexpected object: "+e)}var Kn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Kn||{});function DD(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:Wge(e)}}function o4(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))a4(n,i4(t,r),o);return n}function i4(e,t){return e?e+"["+t+"]":t}function a4(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())a4(e,i4(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):o4(n,t,e)}var bo=(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))(bo||{}),Uge=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Uge||{}),qge=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(qge||{}),Gge=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Gge||{}),Yge=(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))(Yge||{});function fx(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((a,s)=>a.dataRef.current.order-s.dataRef.current.order):Pge(r,a=>a.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let Kge={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,r,o,i,a;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((o=e.dataRef.current)!=null&&o.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let u=t.focus===Kn.Specific?t.idx:DD(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var h,p;return(p=(h=e.activeOptionIndex)!=null?h:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?p:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),d=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===u&&e.activationTrigger===d?e:{...e,activeOptionIndex:u,activationTrigger:d}}let s=fx(e);if(s.activeOptionIndex===null){let u=s.options.findIndex(d=>!d.dataRef.current.disabled);u!==-1&&(s.activeOptionIndex=u)}let l=t.focus===Kn.Specific?t.idx:DD(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),c=(a=t.trigger)!=null?a:2;return e.activeOptionIndex===l&&e.activationTrigger===c?e:{...e,...s,activeOptionIndex:l,activationTrigger:c}},3:(e,t)=>{var n,r,o;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,a=fx(e,l=>(l.push(i),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(a.activeOptionIndex=a.options.indexOf(i));let s={...e,...a,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(s.activeOptionIndex=0),s},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(o=>o.id!==t.id)};let r=fx(e,o=>{let i=o.findIndex(a=>a.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?r=o:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},ZE=m.createContext(null);ZE.displayName="ComboboxActionsContext";function Tp(e){let t=m.useContext(ZE);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Tp),n}return t}let s4=m.createContext(null);function Xge(e){var t;let n=Ec("VirtualProvider"),[r,o]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[n.optionsRef.current]),i=gge({scrollPaddingStart:r,scrollPaddingEnd:o,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[a,s]=m.useState(0);return Qn(()=>{s(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(s4.Provider,{value:i},m.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&i.scrollToIndex(n.activeOptionIndex)}}},i.getVirtualItems().map(l=>{var c;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((c=e.children)==null?void 0:c.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${a}-${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 e2=m.createContext(null);e2.displayName="ComboboxDataContext";function Ec(e){let t=m.useContext(e2);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ec),n}return t}function Qge(e,t){return ur(t.type,Kge,e,t)}let Jge=m.Fragment;function Zge(e,t){let{value:n,defaultValue:r,onChange:o,form:i,name:a,by:s=null,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:d=!1,immediate:h=!1,virtual:p=null,...v}=e,b=!1,x=null,[y=d?[]:void 0,_]=yge(n,o,r),[S,C]=m.useReducer(Qge,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),E=m.useRef(!1),$=m.useRef({static:!1,hold:!1}),T=m.useRef(null),D=m.useRef(null),M=m.useRef(null),L=m.useRef(null),F=$t(typeof s=="string"?(re,le)=>{let xe=s;return(re==null?void 0:re[xe])===(le==null?void 0:le[xe])}:s??((re,le)=>re===le)),z=$t(re=>S.options.findIndex(le=>F(le.dataRef.current.value,re))),X=m.useCallback(re=>ur(A.mode,{1:()=>y.some(le=>F(le,re)),0:()=>F(y,re)}),[y]),G=$t(re=>S.activeOptionIndex===z(re)),A=m.useMemo(()=>({...S,immediate:b,optionsPropsRef:$,labelRef:T,inputRef:D,buttonRef:M,optionsRef:L,value:y,defaultValue:r,disabled:l,mode:d?1:0,virtual:S.virtual,get activeOptionIndex(){if(E.current&&S.activeOptionIndex===null&&S.options.length>0){let re=S.options.findIndex(le=>!le.dataRef.current.disabled);if(re!==-1)return re}return S.activeOptionIndex},calculateIndex:z,compare:F,isSelected:X,isActive:G,nullable:u,__demoMode:c}),[y,r,l,d,u,c,S,x]);Qn(()=>{},[x,void 0]),Qn(()=>{S.dataRef.current=A},[A]),Dge([A.buttonRef,A.inputRef,A.optionsRef],()=>ce.closeCombobox(),A.comboboxState===0);let U=m.useMemo(()=>{var re,le,xe;return{open:A.comboboxState===0,disabled:l,activeIndex:A.activeOptionIndex,activeOption:A.activeOptionIndex===null?null:A.virtual?A.virtual.options[(re=A.activeOptionIndex)!=null?re:0]:(xe=(le=A.options[A.activeOptionIndex])==null?void 0:le.dataRef.current.value)!=null?xe:null,value:y}},[A,l,y]),V=$t(()=>{if(A.activeOptionIndex!==null){if(A.virtual)I(A.virtual.options[A.activeOptionIndex]);else{let{dataRef:re}=A.options[A.activeOptionIndex];I(re.current.value)}ce.goToOption(Kn.Specific,A.activeOptionIndex)}}),K=$t(()=>{C({type:0}),E.current=!0}),q=$t(()=>{C({type:1}),E.current=!1}),O=$t((re,le,xe)=>(E.current=!1,re===Kn.Specific?C({type:2,focus:Kn.Specific,idx:le,trigger:xe}):C({type:2,focus:re,trigger:xe}))),H=$t((re,le)=>(C({type:3,payload:{id:re,dataRef:le}}),()=>{A.isActive(le.current.value)&&(E.current=!0),C({type:4,id:re})})),Y=$t(re=>(C({type:5,id:re}),()=>C({type:5,id:null}))),I=$t(re=>ur(A.mode,{0(){return _==null?void 0:_(re)},1(){let le=A.value.slice(),xe=le.findIndex(Z=>F(Z,re));return xe===-1?le.push(re):le.splice(xe,1),_==null?void 0:_(le)}})),te=$t(re=>{C({type:6,trigger:re})}),ce=m.useMemo(()=>({onChange:I,registerOption:H,registerLabel:Y,goToOption:O,closeCombobox:q,openCombobox:K,setActivationTrigger:te,selectActiveOption:V}),[]),de=t===null?{}:{ref:t},he=m.useRef(null),ie=$p();return m.useEffect(()=>{he.current&&r!==void 0&&ie.addEventListener(he.current,"reset",()=>{_==null||_(r)})},[he,_]),m.createElement(ZE.Provider,{value:ce},m.createElement(e2.Provider,{value:A},m.createElement(r4,{value:ur(A.comboboxState,{0:So.Open,1:So.Closed})},a!=null&&y!=null&&o4({[a]:y}).map(([re,le],xe)=>m.createElement(zge,{features:n4.Hidden,ref:xe===0?Z=>{var ve;he.current=(ve=Z==null?void 0:Z.closest("form"))!=null?ve:null}:void 0,...W_({key:re,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:re,value:le})})),Ua({ourProps:de,theirProps:v,slot:U,defaultTag:Jge,name:"Combobox"}))))}let eme="input";function tme(e,t){var n,r,o,i,a;let s=Op(),{id:l=`headlessui-combobox-input-${s}`,onChange:c,displayValue:u,type:d="text",...h}=e,p=Ec("Combobox.Input"),v=Tp("Combobox.Input"),b=Cc(p.inputRef,t),x=Age(p.inputRef),y=m.useRef(!1),_=$p(),S=$t(()=>{v.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),v.goToOption(Kn.Nothing)}),C=function(){var A;return typeof u=="function"&&p.value!==void 0?(A=u(p.value))!=null?A:"":typeof p.value=="string"?p.value:""}();TD(([A,U],[V,K])=>{if(y.current)return;let q=p.inputRef.current;q&&((K===0&&U===1||A!==V)&&(q.value=A),requestAnimationFrame(()=>{if(y.current||!q||(x==null?void 0:x.activeElement)!==q)return;let{selectionStart:O,selectionEnd:H}=q;Math.abs((H??0)-(O??0))===0&&O===0&&q.setSelectionRange(q.value.length,q.value.length)}))},[C,p.comboboxState,x]),TD(([A],[U])=>{if(A===0&&U===1){if(y.current)return;let V=p.inputRef.current;if(!V)return;let K=V.value,{selectionStart:q,selectionEnd:O,selectionDirection:H}=V;V.value="",V.value=K,H!==null?V.setSelectionRange(q,O,H):V.setSelectionRange(q,O)}},[p.comboboxState]);let E=m.useRef(!1),$=$t(()=>{E.current=!0}),T=$t(()=>{_.nextFrame(()=>{E.current=!1})}),D=$t(A=>{switch(y.current=!0,A.key){case bo.Enter:if(y.current=!1,p.comboboxState!==0||E.current)return;if(A.preventDefault(),A.stopPropagation(),p.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),p.mode===0&&v.closeCombobox();break;case bo.ArrowDown:return y.current=!1,A.preventDefault(),A.stopPropagation(),ur(p.comboboxState,{0:()=>v.goToOption(Kn.Next),1:()=>v.openCombobox()});case bo.ArrowUp:return y.current=!1,A.preventDefault(),A.stopPropagation(),ur(p.comboboxState,{0:()=>v.goToOption(Kn.Previous),1:()=>{v.openCombobox(),_.nextFrame(()=>{p.value||v.goToOption(Kn.Last)})}});case bo.Home:if(A.shiftKey)break;return y.current=!1,A.preventDefault(),A.stopPropagation(),v.goToOption(Kn.First);case bo.PageUp:return y.current=!1,A.preventDefault(),A.stopPropagation(),v.goToOption(Kn.First);case bo.End:if(A.shiftKey)break;return y.current=!1,A.preventDefault(),A.stopPropagation(),v.goToOption(Kn.Last);case bo.PageDown:return y.current=!1,A.preventDefault(),A.stopPropagation(),v.goToOption(Kn.Last);case bo.Escape:return y.current=!1,p.comboboxState!==0?void 0:(A.preventDefault(),p.optionsRef.current&&!p.optionsPropsRef.current.static&&A.stopPropagation(),p.nullable&&p.mode===0&&p.value===null&&S(),v.closeCombobox());case bo.Tab:if(y.current=!1,p.comboboxState!==0)return;p.mode===0&&p.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),M=$t(A=>{c==null||c(A),p.nullable&&p.mode===0&&A.target.value===""&&S(),v.openCombobox()}),L=$t(A=>{var U,V,K;let q=(U=A.relatedTarget)!=null?U:Rl.find(O=>O!==A.currentTarget);if(y.current=!1,!((V=p.optionsRef.current)!=null&&V.contains(q))&&!((K=p.buttonRef.current)!=null&&K.contains(q))&&p.comboboxState===0)return A.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?S():p.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),F=$t(A=>{var U,V,K;let q=(U=A.relatedTarget)!=null?U:Rl.find(O=>O!==A.currentTarget);(V=p.buttonRef.current)!=null&&V.contains(q)||(K=p.optionsRef.current)!=null&&K.contains(q)||p.disabled||p.immediate&&p.comboboxState!==0&&(v.openCombobox(),_.nextFrame(()=>{v.setActivationTrigger(1)}))}),z=YE(()=>{if(p.labelId)return[p.labelId].join(" ")},[p.labelId]),X=m.useMemo(()=>({open:p.comboboxState===0,disabled:p.disabled}),[p]),G={ref:b,id:l,role:"combobox",type:d,"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(A=>{var U;return!((U=p.virtual)!=null&&U.disabled(A.dataRef.current.value))&&p.compare(A.dataRef.current.value,p.virtual.options[p.activeOptionIndex])}))==null?void 0:r.id:(o=p.options[p.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":z,"aria-autocomplete":"list",defaultValue:(a=(i=e.defaultValue)!=null?i:p.defaultValue!==void 0?u==null?void 0:u(p.defaultValue):null)!=null?a:p.defaultValue,disabled:p.disabled,onCompositionStart:$,onCompositionEnd:T,onKeyDown:D,onChange:M,onFocus:F,onBlur:L};return Ua({ourProps:G,theirProps:h,slot:X,defaultTag:eme,name:"Combobox.Input"})}let nme="button";function rme(e,t){var n;let r=Ec("Combobox.Button"),o=Tp("Combobox.Button"),i=Cc(r.buttonRef,t),a=Op(),{id:s=`headlessui-combobox-button-${a}`,...l}=e,c=$p(),u=$t(b=>{switch(b.key){case bo.ArrowDown:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&o.openCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case bo.ArrowUp:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),c.nextFrame(()=>{r.value||o.goToOption(Kn.Last)})),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case bo.Escape:return r.comboboxState!==0?void 0:(b.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&b.stopPropagation(),o.closeCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})}));default:return}}),d=$t(b=>{if(Vge(b.currentTarget))return b.preventDefault();r.comboboxState===0?o.closeCombobox():(b.preventDefault(),o.openCombobox()),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),h=YE(()=>{if(r.labelId)return[r.labelId,s].join(" ")},[r.labelId,s]),p=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:i,id:s,type:Mge(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":h,disabled:r.disabled,onClick:d,onKeyDown:u};return Ua({ourProps:v,theirProps:l,slot:p,defaultTag:nme,name:"Combobox.Button"})}let ome="label";function ime(e,t){let n=Op(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=Ec("Combobox.Label"),a=Tp("Combobox.Label"),s=Cc(i.labelRef,t);Qn(()=>a.registerLabel(r),[r]);let l=$t(()=>{var u;return(u=i.inputRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return Ua({ourProps:{ref:s,id:r,onClick:l},theirProps:o,slot:c,defaultTag:ome,name:"Combobox.Label"})}let ame="ul",sme=tb.RenderStrategy|tb.Static;function lme(e,t){let n=Op(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,a=Ec("Combobox.Options"),s=Cc(a.optionsRef,t),l=JE(),c=l!==null?(l&So.Open)===So.Open:a.comboboxState===0;Qn(()=>{var p;a.optionsPropsRef.current.static=(p=e.static)!=null?p:!1},[a.optionsPropsRef,e.static]),Qn(()=>{a.optionsPropsRef.current.hold=o},[a.optionsPropsRef,o]),Nge({container:a.optionsRef.current,enabled:a.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 u=YE(()=>{var p,v;return(v=a.labelId)!=null?v:(p=a.buttonRef.current)==null?void 0:p.id},[a.labelId,a.buttonRef.current]),d=m.useMemo(()=>({open:a.comboboxState===0,option:void 0}),[a]),h={"aria-labelledby":u,role:"listbox","aria-multiselectable":a.mode===1?!0:void 0,id:r,ref:s};return a.virtual&&a.comboboxState===0&&Object.assign(i,{children:m.createElement(Xge,null,i.children)}),Ua({ourProps:h,theirProps:i,slot:d,defaultTag:ame,features:sme,visible:c,name:"Combobox.Options"})}let cme="li";function ume(e,t){var n;let r=Op(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:a,order:s=null,...l}=e,c=Ec("Combobox.Option"),u=Tp("Combobox.Option"),d=c.virtual?c.activeOptionIndex===c.calculateIndex(a):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===o,h=c.isSelected(a),p=m.useRef(null),v=Yi({disabled:i,value:a,domRef:p,order:s}),b=m.useContext(s4),x=Cc(t,p,b?b.measureElement:null),y=$t(()=>u.onChange(a));Qn(()=>u.registerOption(o,v),[v,o]);let _=m.useRef(!(c.virtual||c.__demoMode));Qn(()=>{if(!c.virtual||!c.__demoMode)return;let L=fc();return L.requestAnimationFrame(()=>{_.current=!0}),L.dispose},[c.virtual,c.__demoMode]),Qn(()=>{if(!_.current||c.comboboxState!==0||!d||c.activationTrigger===0)return;let L=fc();return L.requestAnimationFrame(()=>{var F,z;(z=(F=p.current)==null?void 0:F.scrollIntoView)==null||z.call(F,{block:"nearest"})}),L.dispose},[p,d,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let S=$t(L=>{var F;if(i||(F=c.virtual)!=null&&F.disabled(a))return L.preventDefault();y(),e4()||requestAnimationFrame(()=>{var z;return(z=c.inputRef.current)==null?void 0:z.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),C=$t(()=>{var L;if(i||(L=c.virtual)!=null&&L.disabled(a))return u.goToOption(Kn.Nothing);let F=c.calculateIndex(a);u.goToOption(Kn.Specific,F)}),E=Ige(),$=$t(L=>E.update(L)),T=$t(L=>{var F;if(!E.wasMoved(L)||i||(F=c.virtual)!=null&&F.disabled(a)||d)return;let z=c.calculateIndex(a);u.goToOption(Kn.Specific,z,0)}),D=$t(L=>{var F;E.wasMoved(L)&&(i||(F=c.virtual)!=null&&F.disabled(a)||d&&(c.optionsPropsRef.current.hold||u.goToOption(Kn.Nothing)))}),M=m.useMemo(()=>({active:d,selected:h,disabled:i}),[d,h,i]);return Ua({ourProps:{id:o,ref:x,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:S,onFocus:C,onPointerEnter:$,onMouseEnter:$,onPointerMove:T,onMouseMove:T,onPointerLeave:D,onMouseLeave:D},theirProps:l,slot:M,defaultTag:cme,name:"Combobox.Option"})}let dme=ia(Zge),fme=ia(rme),hme=ia(tme),pme=ia(ime),gme=ia(lme),mme=ia(ume),gf=Object.assign(dme,{Input:hme,Button:fme,Label:pme,Options:gme,Option:mme});function t2(){let e=m.useRef(!1);return Qn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function bme(e=0){let[t,n]=m.useState(e),r=t2(),o=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),i=m.useCallback(l=>!!(t&l),[t]),a=m.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),s=m.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:a,toggleFlag:s}}function vme(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function hx(e,...t){e&&t.length>0&&e.classList.add(...t)}function px(e,...t){e&&t.length>0&&e.classList.remove(...t)}function yme(e,t){let n=fc();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,a]=[r,o].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,d)=>d-u);return c}),s=i+a;if(s!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},s),c.addEventListener(e,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function xme(e,t,n,r){let o=n?"enter":"leave",i=fc(),a=r!==void 0?vme(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=ur(o,{enter:()=>t.enter,leave:()=>t.leave}),l=ur(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=ur(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return px(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),hx(e,...t.base,...s,...c),i.nextFrame(()=>{px(e,...t.base,...s,...c),hx(e,...t.base,...s,...l),yme(e,()=>(px(e,...t.base,...s),hx(e,...t.base,...t.entered),a()))}),i.dispose}function wme({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let a=t2(),s=$p(),l=Yi(n);Qn(()=>{e&&(l.current="enter")},[e]),Qn(()=>{let c=fc();s.add(c.dispose);let u=t.current;if(u&&l.current!=="idle"&&a.current)return c.dispose(),o.current(l.current),c.add(xme(u,r.current,l.current==="enter",()=>{c.dispose(),i.current(l.current)})),c.dispose},[n])}function fs(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let vv=m.createContext(null);vv.displayName="TransitionContext";var _me=(e=>(e.Visible="visible",e.Hidden="hidden",e))(_me||{});function Sme(){let e=m.useContext(vv);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Cme(){let e=m.useContext(yv);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let yv=m.createContext(null);yv.displayName="NestingContext";function xv(e){return"children"in e?xv(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function l4(e,t){let n=Yi(e),r=m.useRef([]),o=t2(),i=$p(),a=$t((p,v=Ms.Hidden)=>{let b=r.current.findIndex(({el:x})=>x===p);b!==-1&&(ur(v,{[Ms.Unmount](){r.current.splice(b,1)},[Ms.Hidden](){r.current[b].state="hidden"}}),i.microTask(()=>{var x;!xv(r)&&o.current&&((x=n.current)==null||x.call(n))}))}),s=$t(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"}),()=>a(p,Ms.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),u=m.useRef({enter:[],leave:[],idle:[]}),d=$t((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(u.current[v].map(([y,_])=>_)).then(()=>x())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(v)):b(v)}),h=$t((p,v,b)=>{Promise.all(u.current[v].splice(0).map(([x,y])=>y)).then(()=>{var x;(x=l.current.shift())==null||x()}).then(()=>b(v))});return m.useMemo(()=>({children:r,register:s,unregister:a,onStart:d,onStop:h,wait:c,chains:u}),[s,a,r,d,h,u,c])}function Eme(){}let Rme=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function AD(e){var t;let n={};for(let r of Rme)n[r]=(t=e[r])!=null?t:Eme;return n}function Pme(e){let t=m.useRef(AD(e));return m.useEffect(()=>{t.current=AD(e)},[e]),t}let $me="div",c4=tb.RenderStrategy;function Ome(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:a,afterLeave:s,enter:l,enterFrom:c,enterTo:u,entered:d,leave:h,leaveFrom:p,leaveTo:v,...b}=e,x=m.useRef(null),y=Cc(x,t),_=(n=b.unmount)==null||n?Ms.Unmount:Ms.Hidden,{show:S,appear:C,initial:E}=Sme(),[$,T]=m.useState(S?"visible":"hidden"),D=Cme(),{register:M,unregister:L}=D;m.useEffect(()=>M(x),[M,x]),m.useEffect(()=>{if(_===Ms.Hidden&&x.current){if(S&&$!=="visible"){T("visible");return}return ur($,{hidden:()=>L(x),visible:()=>M(x)})}},[$,x,M,L,S,_]);let F=Yi({base:fs(b.className),enter:fs(l),enterFrom:fs(c),enterTo:fs(u),entered:fs(d),leave:fs(h),leaveFrom:fs(p),leaveTo:fs(v)}),z=Pme({beforeEnter:o,afterEnter:i,beforeLeave:a,afterLeave:s}),X=KE();m.useEffect(()=>{if(X&&$==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,$,X]);let G=E&&!C,A=C&&S&&E,U=!X||G?"idle":S?"enter":"leave",V=bme(0),K=$t(te=>ur(te,{enter:()=>{V.addFlag(So.Opening),z.current.beforeEnter()},leave:()=>{V.addFlag(So.Closing),z.current.beforeLeave()},idle:()=>{}})),q=$t(te=>ur(te,{enter:()=>{V.removeFlag(So.Opening),z.current.afterEnter()},leave:()=>{V.removeFlag(So.Closing),z.current.afterLeave()},idle:()=>{}})),O=l4(()=>{T("hidden"),L(x)},D),H=m.useRef(!1);wme({immediate:A,container:x,classes:F,direction:U,onStart:Yi(te=>{H.current=!0,O.onStart(x,te,K)}),onStop:Yi(te=>{H.current=!1,O.onStop(x,te,q),te==="leave"&&!xv(O)&&(T("hidden"),L(x))})});let Y=b,I={ref:y};return A?Y={...Y,className:eb(b.className,...F.current.enter,...F.current.enterFrom)}:H.current&&(Y.className=eb(b.className,(r=x.current)==null?void 0:r.className),Y.className===""&&delete Y.className),m.createElement(yv.Provider,{value:O},m.createElement(r4,{value:ur($,{visible:So.Open,hidden:So.Closed})|V.flags},Ua({ourProps:I,theirProps:Y,defaultTag:$me,features:c4,visible:$==="visible",name:"Transition.Child"})))}function Tme(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,a=m.useRef(null),s=Cc(a,t);KE();let l=JE();if(n===void 0&&l!==null&&(n=(l&So.Open)===So.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=m.useState(n?"visible":"hidden"),d=l4(()=>{u("hidden")}),[h,p]=m.useState(!0),v=m.useRef([n]);Qn(()=>{h!==!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:h}),[n,r,h]);m.useEffect(()=>{if(n)u("visible");else if(!xv(d))u("hidden");else{let S=a.current;if(!S)return;let C=S.getBoundingClientRect();C.x===0&&C.y===0&&C.width===0&&C.height===0&&u("hidden")}},[n,d]);let x={unmount:o},y=$t(()=>{var S;h&&p(!1),(S=e.beforeEnter)==null||S.call(e)}),_=$t(()=>{var S;h&&p(!1),(S=e.beforeLeave)==null||S.call(e)});return m.createElement(yv.Provider,{value:d},m.createElement(vv.Provider,{value:b},Ua({ourProps:{...x,as:m.Fragment,children:m.createElement(u4,{ref:s,...x,...i,beforeEnter:y,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:c4,visible:c==="visible",name:"Transition"})))}function Dme(e,t){let n=m.useContext(vv)!==null,r=JE()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(U_,{ref:t,...e}):m.createElement(u4,{ref:t,...e}))}let U_=ia(Tme),u4=ia(Ome),Ame=ia(Dme),Mme=Object.assign(U_,{Child:Ame,Root:U_});function kme(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[o,i]=e.split(r);return{operation:r,value:i.trim()}}else return null}function Ime(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,o=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return hd.includes(e)?o:r}const d4="Checkbox",[Nme,d5e]=hr(d4),[Lme,Fme]=Nme(d4),jme=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,...u}=e,[d,h]=m.useState(null),p=Rt(t,S=>h(S)),v=m.useRef(!1),b=d?!!d.closest("form"):!0,[x=!1,y]=Fr({prop:o,defaultProp:i,onChange:c}),_=m.useRef(x);return m.useEffect(()=>{const S=d==null?void 0:d.form;if(S){const C=()=>y(_.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[d,y]),m.createElement(Lme,{scope:n,state:x,disabled:s},m.createElement(Qe.button,ue({type:"button",role:"checkbox","aria-checked":ec(x)?"mixed":x,"aria-required":a,"data-state":f4(x),"data-disabled":s?"":void 0,disabled:s,value:l},u,{ref:p,onKeyDown:ke(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:ke(e.onClick,S=>{y(C=>ec(C)?!0:!C),b&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),b&&m.createElement(Vme,{control:d,bubbles:!v.current,name:r,value:l,checked:x,required:a,disabled:s,style:{transform:"translateX(-100%)"}}))}),zme="CheckboxIndicator",Bme=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Fme(zme,n);return m.createElement(pr,{present:r||ec(i.state)||i.state===!0},m.createElement(Qe.span,ue({"data-state":f4(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Vme=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),a=lv(n),s=Jb(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const h=new Event("click",{bubbles:r});l.indeterminate=ec(n),d.call(l,ec(n)?!1:n),l.dispatchEvent(h)}},[a,n,r]),m.createElement("input",ue({type:"checkbox","aria-hidden":!0,defaultChecked:ec(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ec(e){return e==="indeterminate"}function f4(e){return ec(e)?"indeterminate":e?"checked":"unchecked"}const h4=jme,Hme=Bme,wv=j.forwardRef(({className:e,...t},n)=>R.jsx(h4,{ref:n,className:ye("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:R.jsx(Hme,{className:ye("flex items-center justify-center text-current"),children:R.jsx(up,{className:"h-4 w-4"})})}));wv.displayName=h4.displayName;function Wme({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,a]=m.useState(""),s=m.useRef(null);_i();const l=we(D=>D.filterValues),c=we(D=>D.selectedSheetId),u=we(D=>D.actions.addOrUpdateFilterValue),d=we(D=>D.actions.removeFilterValue),{data:h,isLoading:p,isFetching:v,isError:b,refetch:x}=Q8(e),y=m.useMemo(()=>{var D;return(D=h==null?void 0:h.records)==null?void 0:D.map(M=>{let L=e.column.split(".").slice(-1)[0].replace(/"/g,"");return M[L]===void 0&&(L=L.toLowerCase()),{id:M[L],value:M[L]}})},[h,e.column]);m.useEffect(()=>{if(l){const D=l.find(M=>M.filterId===e.id);if(!D){n([]);return}if(D.operation==="in"){const M=y==null?void 0:y.filter(L=>D.values.includes(L.value));M&&n(M)}else o(`${D.operation} ${D.values[0]}`)}},[h,c,l]),m.useEffect(()=>{if(l&&!l.find(M=>M.filterId===e.id)){n([]);return}},[l,e.id]);function _(D){const M=kme(D[0].toString());if(!(M!=null&&M.value)||!(M!=null&&M.operation))return;const L={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:vu(e),name:e.column,operation:M.operation,values:[Number(M.value)]};u(L)}function S(D){if(Array.isArray(D)||(D=[D]),console.log("onComboBoxChange",D),D.length===1&&y.find(L=>L.value===D[0].value)===void 0){_(D);return}if(n(D),D.length===0){d(e.id);return}const M={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:vu(e),operation:e.operation,values:D.map(L=>L.value)};u(M)}function C(D){if(D){n(y);const M={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:vu(e),operation:e.operation,values:y.map(L=>L.value)};u(M)}else n([]),d(e.id)}const E=t.length===(y==null?void 0:y.length);if(p)return R.jsx("div",{children:R.jsx(yb,{className:"h-8 w-full bg-foreground/10"})});if(b)return R.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let $=[];op.includes(e.dataType)?$=y:$=i===""?y:y==null?void 0:y.filter(D=>D.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,"")));const T=e.type==="single";return R.jsx("div",{className:"w-full",children:R.jsx(gf,{value:t,multiple:!T,onChange:S,children:R.jsxs("div",{className:"relative",children:[R.jsxs("div",{className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[R.jsx(gf.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:D=>D.map(L=>L.value).join(", ")||r,onChange:D=>{o(D.target.value),a(D.target.value)}}),R.jsx(gf.Button,{ref:s,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:R.jsx(yQ,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),R.jsx(Mme,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>a(""),children:R.jsxs(gf.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm",children:[e.type==="multiple"||e.type===void 0&&R.jsxs("div",{className:"flex items-center justify-between gap-2 border-b px-4 py-2",children:[R.jsx("span",{children:"Select All"}),R.jsx(wv,{checked:E,onCheckedChange:C})]}),($==null?void 0:$.length)===0&&i!==""?R.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):$==null?void 0:$.map(D=>R.jsx(gf.Option,{className:({active:M})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${M?"bg-muted":"text-foreground-900"}`,value:D,children:({selected:M,active:L})=>R.jsxs("div",{className:"",children:[R.jsx("span",{className:`block ${M?"font-medium":"font-normal"}`,children:typeof D.value=="boolean"?D.value?"True":"False":D.value}),M?R.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:R.jsx(d6,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},D.value))]})})]})})})}const n2=j.forwardRef(({className:e,...t},n)=>R.jsx("textarea",{className:ye("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}));n2.displayName="Textarea";const p4="Radio",[Ume,g4]=hr(p4),[qme,Gme]=Ume(p4),Yme=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:a,value:s="on",onCheck:l,...c}=e,[u,d]=m.useState(null),h=Rt(t,b=>d(b)),p=m.useRef(!1),v=u?!!u.closest("form"):!0;return m.createElement(qme,{scope:n,checked:o,disabled:a},m.createElement(Qe.button,ue({type:"button",role:"radio","aria-checked":o,"data-state":m4(o),"data-disabled":a?"":void 0,disabled:a,value:s},c,{ref:h,onClick:ke(e.onClick,b=>{o||l==null||l(),v&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})),v&&m.createElement(Qme,{control:u,bubbles:!p.current,name:r,value:s,checked:o,required:i,disabled:a,style:{transform:"translateX(-100%)"}}))}),Kme="RadioIndicator",Xme=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=Gme(Kme,n);return m.createElement(pr,{present:r||i.checked},m.createElement(Qe.span,ue({"data-state":m4(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),Qme=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),a=lv(n),s=Jb(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const h=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(h)}},[a,n,r]),m.createElement("input",ue({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function m4(e){return e?"checked":"unchecked"}const Jme=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b4="RadioGroup",[Zme,f5e]=hr(b4,[gd,g4]),v4=gd(),y4=g4(),[e0e,t0e]=Zme(b4),n0e=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:a=!1,disabled:s=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...h}=e,p=v4(n),v=vc(c),[b,x]=Fr({prop:i,defaultProp:o,onChange:d});return m.createElement(e0e,{scope:n,name:r,required:a,disabled:s,value:b,onValueChange:x},m.createElement(jS,ue({asChild:!0},p,{orientation:l,dir:v,loop:u}),m.createElement(Qe.div,ue({role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:v},h,{ref:t}))))}),r0e="RadioGroupItem",o0e=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=t0e(r0e,n),a=i.disabled||r,s=v4(n),l=y4(n),c=m.useRef(null),u=Rt(t,c),d=i.value===o.value,h=m.useRef(!1);return m.useEffect(()=>{const p=b=>{Jme.includes(b.key)&&(h.current=!0)},v=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),m.createElement(zS,ue({asChild:!0},s,{focusable:!a,active:d}),m.createElement(Yme,ue({disabled:a,required:i.required,checked:d},l,o,{name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:ke(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:ke(o.onFocus,()=>{var p;h.current&&((p=c.current)===null||p===void 0||p.click())})})))}),i0e=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=y4(n);return m.createElement(Xme,ue({},o,r,{ref:t}))}),x4=n0e,w4=o0e,a0e=i0e,r2=j.forwardRef(({className:e,...t},n)=>R.jsx(x4,{className:ye("grid gap-2",e),...t,ref:n}));r2.displayName=x4.displayName;const nb=j.forwardRef(({className:e,...t},n)=>R.jsx(w4,{ref:n,className:ye("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:R.jsx(a0e,{className:"flex items-center justify-center",children:R.jsx(gC,{className:"h-2.5 w-2.5 fill-current text-current"})})}));nb.displayName=w4.displayName;function s0e({label:e,onCheckedChange:t,checked:n}){return R.jsxs("div",{className:"flex items-center space-x-2",children:[R.jsx(wv,{onCheckedChange:t,id:"terms",checked:n}),R.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function l0e({filter:e}){const[t,n]=m.useState(e.sql),[r,o]=m.useState(!1),i=we(d=>d.selectedSheetId),{updateFilter:a}=dr();function s(){const d={...e,sql:t};a(d),o(!1)}function l(d){console.log("operation",d);const h={...e,operation:d};a(h)}function c(d){const h={...e,type:d};a(h)}function u(d){if(!i)return;const h={...e,sheetId:d?i:void 0};a(h)}return R.jsxs(gv,{open:r,onOpenChange:o,children:[R.jsx(mv,{children:R.jsx(vC,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),R.jsxs(Sp,{onMouseDown:d=>d.stopPropagation(),onDoubleClick:d=>d.stopPropagation(),className:"z-50 m-2 w-full min-w-[350px] space-y-4",children:[R.jsxs("div",{className:"space-y-2",children:[R.jsxs("div",{className:"flex items-center gap-3",children:[R.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),R.jsx("p",{className:"rounded-md bg-muted px-2 py-1 text-xs text-muted-foreground",children:e.column})]}),R.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),R.jsx(wp,{}),R.jsxs("div",{className:"space-y-2",children:[R.jsx(Tn,{children:"Type"}),R.jsxs(r2,{onValueChange:c,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[R.jsxs("div",{className:"flex items-center space-x-2",children:[R.jsx(nb,{value:"multiple",id:"r1"}),R.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),R.jsxs("div",{className:"flex items-center space-x-2",children:[R.jsx(nb,{value:"single",id:"r2"}),R.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),R.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[R.jsxs("div",{className:"col-span-2 space-y-1",children:[R.jsx(Tn,{children:"Table Column"}),R.jsx(Tn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),R.jsxs("div",{className:"col-span-2 space-y-1",children:[R.jsx(Tn,{children:"Data Type"}),R.jsx(Tn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),R.jsxs("div",{className:"col-span-2 space-y-1",children:[R.jsx(Tn,{className:"text-sm",children:"Filter Operation"}),R.jsx(c0e,{updateFilterOperation:l,value:e.operation})]})]}),R.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[R.jsx(Tn,{className:"text-sm",children:"Values SQL"}),R.jsx(n2,{onKeyDown:d=>{d.stopPropagation()},value:t,onChange:d=>n(d.target.value),className:`min-w-full grow resize font-mono text-xs ${Lf}`})]}),R.jsx("div",{children:R.jsx(s0e,{label:"Local to sheet",onCheckedChange:u,checked:!!e.sheetId})}),R.jsx("div",{className:"flex justify-end gap-2",children:R.jsxs(no,{onClick:s,size:"sm",variant:"outline",children:[R.jsx(up,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function c0e({value:e,updateFilterOperation:t}){return R.jsxs(Ea,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[R.jsx(Mi,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:R.jsx(Ra,{placeholder:"Operation"})}),R.jsxs(ki,{children:[R.jsx(Hn,{value:"=",children:"Equals"}),R.jsx(Hn,{value:"in",children:"Contains"}),R.jsx(Hn,{value:"like",children:"Like"})]})]})}function _4({filter:e}){const t=we(s=>s.isDashboardEditing),n=we(s=>s.filterValues),r=n==null?void 0:n.some(s=>s.filterId===e.id),{removeFilterValue:o,removeFilter:i,updateFilter:a}=dr();return R.jsx(qi,{className:"my-1",text:e.title||e.column,onSave:s=>a({...e,title:s}),children:R.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[R.jsxs("div",{className:"flex grow items-center gap-2",children:[R.jsx(Tn,{className:"inline-block text-sm",children:e.title}),t&&R.jsx(l0e,{filter:e})]}),R.jsxs("div",{className:"flex items-center gap-2",children:[r&&R.jsx("button",{onClick:()=>o(e.id),className:"text-foreground/30 hover:text-foreground/50",children:R.jsx(mC,{className:"size-3.5"})}),t&&R.jsx(md,{onClick:()=>{o(e.id),i(e.id)},className:"size-3.5 cursor-pointer text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})]})]})})}var u0e=e=>{switch(e){case"success":return h0e;case"info":return g0e;case"warning":return p0e;case"error":return m0e;default:return null}},d0e=Array(12).fill(0),f0e=({visible:e})=>m.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},m.createElement("div",{className:"sonner-spinner"},d0e.map((t,n)=>m.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),h0e=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),p0e=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),g0e=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),m0e=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),b0e=()=>{let[e,t]=m.useState(document.hidden);return m.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},q_=1,v0e=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:q_++,i=this.toasts.find(s=>s.id===o),a=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(s=>s.id===o?(this.publish({...s,...e,id:o,title:n}),{...s,...e,id:o,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0;return r.then(async i=>{if(x0e(i)&&!i.ok){o=!1;let a=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,s=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:a,description:s})}else if(t.success!==void 0){o=!1;let a=typeof t.success=="function"?await t.success(i):t.success,s=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:a,description:s})}}).catch(async i=>{if(t.error!==void 0){o=!1;let a=typeof t.error=="function"?await t.error(i):t.error,s=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:a,description:s})}}).finally(()=>{var i;o&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||q_++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},vo=new v0e,y0e=(e,t)=>{let n=(t==null?void 0:t.id)||q_++;return vo.addToast({title:e,...t,id:n}),n},x0e=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",w0e=y0e,_0e=()=>vo.toasts,S4=Object.assign(w0e,{success:vo.success,info:vo.info,warning:vo.warning,error:vo.error,custom:vo.custom,message:vo.message,promise:vo.promise,dismiss:vo.dismiss,loading:vo.loading},{getHistory:_0e});function S0e(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}S0e(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
402
+ `);function Cm(e){return e.label!==void 0}var C0e=3,E0e="32px",R0e=4e3,P0e=356,$0e=14,O0e=20,T0e=200;function D0e(...e){return e.filter(Boolean).join(" ")}var A0e=e=>{var t,n,r,o,i,a,s,l,c,u;let{invert:d,toast:h,unstyled:p,interacting:v,setHeights:b,visibleToasts:x,heights:y,index:_,toasts:S,expanded:C,removeToast:E,defaultRichColors:$,closeButton:T,style:D,cancelButtonStyle:M,actionButtonStyle:L,className:F="",descriptionClassName:z="",duration:X,position:G,gap:A,loadingIcon:U,expandByDefault:V,classNames:K,icons:q,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:H,cn:Y}=e,[I,te]=m.useState(!1),[ce,de]=m.useState(!1),[he,ie]=m.useState(!1),[re,le]=m.useState(!1),[xe,Z]=m.useState(0),[ve,Ce]=m.useState(0),Oe=m.useRef(null),Te=m.useRef(null),We=_===0,Be=_+1<=x,Ie=h.type,Ke=h.dismissible!==!1,dt=h.className||"",Bt=h.descriptionClassName||"",It=m.useMemo(()=>y.findIndex(rt=>rt.toastId===h.id)||0,[y,h.id]),Qt=m.useMemo(()=>{var rt;return(rt=h.closeButton)!=null?rt:T},[h.closeButton,T]),pe=m.useMemo(()=>h.duration||X||R0e,[h.duration,X]),Re=m.useRef(0),Le=m.useRef(0),Ge=m.useRef(0),Ze=m.useRef(null),[Jt,ln]=G.split("-"),rn=m.useMemo(()=>y.reduce((rt,mt,Nt)=>Nt>=It?rt:rt+mt.height,0),[y,It]),En=b0e(),vn=h.invert||d,Wt=Ie==="loading";Le.current=m.useMemo(()=>It*A+rn,[It,rn]),m.useEffect(()=>{te(!0)},[]),m.useLayoutEffect(()=>{if(!I)return;let rt=Te.current,mt=rt.style.height;rt.style.height="auto";let Nt=rt.getBoundingClientRect().height;rt.style.height=mt,Ce(Nt),b(on=>on.find(_t=>_t.toastId===h.id)?on.map(_t=>_t.toastId===h.id?{..._t,height:Nt}:_t):[{toastId:h.id,height:Nt,position:h.position},...on])},[I,h.title,h.description,b,h.id]);let dn=m.useCallback(()=>{de(!0),Z(Le.current),b(rt=>rt.filter(mt=>mt.toastId!==h.id)),setTimeout(()=>{E(h)},T0e)},[h,E,b,Le]);m.useEffect(()=>{if(h.promise&&Ie==="loading"||h.duration===1/0||h.type==="loading")return;let rt,mt=pe;return C||v||H&&En?(()=>{if(Ge.current<Re.current){let Nt=new Date().getTime()-Re.current;mt=mt-Nt}Ge.current=new Date().getTime()})():mt!==1/0&&(Re.current=new Date().getTime(),rt=setTimeout(()=>{var Nt;(Nt=h.onAutoClose)==null||Nt.call(h,h),dn()},mt)),()=>clearTimeout(rt)},[C,v,V,h,pe,dn,h.promise,Ie,H,En]),m.useEffect(()=>{let rt=Te.current;if(rt){let mt=rt.getBoundingClientRect().height;return Ce(mt),b(Nt=>[{toastId:h.id,height:mt,position:h.position},...Nt]),()=>b(Nt=>Nt.filter(on=>on.toastId!==h.id))}},[b,h.id]),m.useEffect(()=>{h.delete&&dn()},[dn,h.delete]);function $n(){return q!=null&&q.loading?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},q.loading):U?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},U):m.createElement(f0e,{visible:Ie==="loading"})}return m.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Te,className:Y(F,dt,K==null?void 0:K.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[Ie],(n=h==null?void 0:h.classNames)==null?void 0:n[Ie]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:$,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":I,"data-promise":!!h.promise,"data-removed":ce,"data-visible":Be,"data-y-position":Jt,"data-x-position":ln,"data-index":_,"data-front":We,"data-swiping":he,"data-dismissible":Ke,"data-type":Ie,"data-invert":vn,"data-swipe-out":re,"data-expanded":!!(C||V&&I),style:{"--index":_,"--toasts-before":_,"--z-index":S.length-_,"--offset":`${ce?xe:Le.current}px`,"--initial-height":V?"auto":`${ve}px`,...D,...h.style},onPointerDown:rt=>{Wt||!Ke||(Oe.current=new Date,Z(Le.current),rt.target.setPointerCapture(rt.pointerId),rt.target.tagName!=="BUTTON"&&(ie(!0),Ze.current={x:rt.clientX,y:rt.clientY}))},onPointerUp:()=>{var rt,mt,Nt,on;if(re||!Ke)return;Ze.current=null;let _t=Number(((rt=Te.current)==null?void 0:rt.style.getPropertyValue("--swipe-amount").replace("px",""))||0),zn=new Date().getTime()-((mt=Oe.current)==null?void 0:mt.getTime()),ni=Math.abs(_t)/zn;if(Math.abs(_t)>=O0e||ni>.11){Z(Le.current),(Nt=h.onDismiss)==null||Nt.call(h,h),dn(),le(!0);return}(on=Te.current)==null||on.style.setProperty("--swipe-amount","0px"),ie(!1)},onPointerMove:rt=>{var mt;if(!Ze.current||!Ke)return;let Nt=rt.clientY-Ze.current.y,on=rt.clientX-Ze.current.x,_t=(Jt==="top"?Math.min:Math.max)(0,Nt),zn=rt.pointerType==="touch"?10:2;Math.abs(_t)>zn?(mt=Te.current)==null||mt.style.setProperty("--swipe-amount",`${Nt}px`):Math.abs(on)>zn&&(Ze.current=null)}},Qt&&!h.jsx?m.createElement("button",{"aria-label":O,"data-disabled":Wt,"data-close-button":!0,onClick:Wt||!Ke?()=>{}:()=>{var rt;dn(),(rt=h.onDismiss)==null||rt.call(h,h)},className:Y(K==null?void 0:K.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},m.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||m.isValidElement(h.title)?h.jsx||h.title:m.createElement(m.Fragment,null,Ie||h.icon||h.promise?m.createElement("div",{"data-icon":"",className:Y(K==null?void 0:K.icon,(i=h==null?void 0:h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||$n():null,h.type!=="loading"?h.icon||(q==null?void 0:q[Ie])||u0e(Ie):null):null,m.createElement("div",{"data-content":"",className:Y(K==null?void 0:K.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},m.createElement("div",{"data-title":"",className:Y(K==null?void 0:K.title,(s=h==null?void 0:h.classNames)==null?void 0:s.title)},h.title),h.description?m.createElement("div",{"data-description":"",className:Y(z,Bt,K==null?void 0:K.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},h.description):null),m.isValidElement(h.cancel)?h.cancel:h.cancel&&Cm(h.cancel)?m.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||M,onClick:rt=>{var mt,Nt;Cm(h.cancel)&&Ke&&((Nt=(mt=h.cancel).onClick)==null||Nt.call(mt,rt),dn())},className:Y(K==null?void 0:K.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,m.isValidElement(h.action)?h.action:h.action&&Cm(h.action)?m.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:rt=>{var mt,Nt;Cm(h.action)&&(rt.defaultPrevented||((Nt=(mt=h.action).onClick)==null||Nt.call(mt,rt),dn()))},className:Y(K==null?void 0:K.actionButton,(u=h==null?void 0:h.classNames)==null?void 0:u.actionButton)},h.action.label):null))};function MD(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var M0e=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:a,offset:s,theme:l="light",richColors:c,duration:u,style:d,visibleToasts:h=C0e,toastOptions:p,dir:v=MD(),gap:b=$0e,loadingIcon:x,icons:y,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S,cn:C=D0e}=e,[E,$]=m.useState([]),T=m.useMemo(()=>Array.from(new Set([n].concat(E.filter(H=>H.position).map(H=>H.position)))),[E,n]),[D,M]=m.useState([]),[L,F]=m.useState(!1),[z,X]=m.useState(!1),[G,A]=m.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=m.useRef(null),V=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=m.useRef(null),q=m.useRef(!1),O=m.useCallback(H=>{var Y;(Y=E.find(I=>I.id===H.id))!=null&&Y.delete||vo.dismiss(H.id),$(I=>I.filter(({id:te})=>te!==H.id))},[E]);return m.useEffect(()=>vo.subscribe(H=>{if(H.dismiss){$(Y=>Y.map(I=>I.id===H.id?{...I,delete:!0}:I));return}setTimeout(()=>{Er.flushSync(()=>{$(Y=>{let I=Y.findIndex(te=>te.id===H.id);return I!==-1?[...Y.slice(0,I),{...Y[I],...H},...Y.slice(I+1)]:[H,...Y]})})})}),[]),m.useEffect(()=>{if(l!=="system"){A(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A("dark"):A("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:H})=>{A(H?"dark":"light")})},[l]),m.useEffect(()=>{E.length<=1&&F(!1)},[E]),m.useEffect(()=>{let H=Y=>{var I,te;r.every(ce=>Y[ce]||Y.code===ce)&&(F(!0),(I=U.current)==null||I.focus()),Y.code==="Escape"&&(document.activeElement===U.current||(te=U.current)!=null&&te.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[r]),m.useEffect(()=>{if(U.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,q.current=!1)}},[U.current]),E.length?m.createElement("section",{"aria-label":`${_} ${V}`,tabIndex:-1},T.map((H,Y)=>{var I;let[te,ce]=H.split("-");return m.createElement("ol",{key:H,dir:v==="auto"?MD():v,tabIndex:-1,ref:U,className:a,"data-sonner-toaster":!0,"data-theme":G,"data-y-position":te,"data-x-position":ce,style:{"--front-toast-height":`${((I=D[0])==null?void 0:I.height)||0}px`,"--offset":typeof s=="number"?`${s}px`:s||E0e,"--width":`${P0e}px`,"--gap":`${b}px`,...d},onBlur:de=>{q.current&&!de.currentTarget.contains(de.relatedTarget)&&(q.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||q.current||(q.current=!0,K.current=de.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{z||F(!1)},onPointerDown:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},E.filter(de=>!de.position&&Y===0||de.position===H).map((de,he)=>{var ie,re;return m.createElement(A0e,{key:de.id,icons:y,index:he,toast:de,defaultRichColors:c,duration:(ie=p==null?void 0:p.duration)!=null?ie:u,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:h,closeButton:(re=p==null?void 0:p.closeButton)!=null?re:i,interacting:z,position:H,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:O,toasts:E.filter(le=>le.position==de.position),heights:D.filter(le=>le.position==de.position),setHeights:M,expandByDefault:o,gap:b,loadingIcon:x,expanded:L,pauseWhenPageIsHidden:S,cn:C})}))})):null};function k0e(){const{getSelectedFrame:e,addFrame:t,setSelectedFrameId:n}=dr(),r=we(l=>l.dashboard.sheets),i=we(l=>l.selectedSheetId)??(r==null?void 0:r[0].id),a=we(l=>l.isDashboardEditing),s=we(l=>l.isVisualEditing);m.useEffect(()=>{if(!a||s)return;async function l(d){const h=d.ctrlKey||d.metaKey;h&&d.key==="c"?(await c(),S4.success("Card copied to clipboard"),d.preventDefault()):h&&d.key==="v"&&(await u(),d.preventDefault())}async function c(){try{const d=e();d&&await navigator.clipboard.writeText(JSON.stringify(d))}catch(d){console.error("Failed to copy text:",d)}}async function u(){if(!i)return null;try{const d=await navigator.clipboard.readText();try{const h=JSON.parse(d);if(h&&h.id){h.id=Fs();const p=h.activeCardId;h.cards.forEach(v=>{const b=v.id;v.id=Fs(),b===p&&(h.activeCardId=v.id,v.title=`${v.title} (Copy)`)}),t(i,h),n(h.id)}}catch(h){console.error("Failed to parse clipboard contents: ",h)}return d}catch(d){return console.error("Failed to paste text:",d),null}}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,e,n,i,a,s])}const I0e=f$.WidthProvider(f$.Responsive),o2=e=>hd.includes(e.dataType)?R.jsx(rge,{filter:e}):R.jsx(Wme,{filter:e});function N0e({sheet:e}){var x;const t=we(y=>y.isDashboardEditing);we(y=>y.currentBreakpoint);const n=we(y=>y.themeStyle);m.useState([]);const r=we(y=>y.selectedSheetId);we(y=>y.selectedLensId);const o=e.layouts,i=we(y=>y.dashboard.filters),a=e.frames,{getSelectedSheet:s,setSheetLayouts:l,setCurrentBreakpoint:c}=we(y=>y.actions),u=s();k0e();const d=m.useCallback(y=>{c(y)},[c]),h=m.useCallback((y,_)=>{u!=null&&u.id&&l(u.id,_)},[u==null?void 0:u.id,l]);if(!r)return null;const p=(y,_)=>R.jsx(C4,{className:"after:content-none",ref:_,handleAxis:y});function v(){const y=i==null?void 0:i.filter(_=>_.sheetId===r||!_.sheetId);return y==null?void 0:y.map(_=>{var S,C;return _.location==="frame"?null:R.jsxs("div",{style:{borderRadius:(C=(S=n==null?void 0:n.chart)==null?void 0:S.options)==null?void 0:C.borderRadius},className:ye("z-50 flex flex-col rounded-md border bg-background px-3 py-2"),children:[R.jsx(_4,{filter:_}),o2(_)]},_.id)})}function b(){return a==null?void 0:a.map(y=>R.jsx("div",{role:"dashboard-frame-container",className:ye("group overflow-hidden",n==null?void 0:n.dashboardCardContainer),children:R.jsx(zb,{FallbackComponent:({error:_,resetErrorBoundary:S})=>R.jsx(rJ,{error:_,resetErrorBoundary:S,frame:y}),children:R.jsx(pfe,{frame:y})})},y.id))}return R.jsx(R.Fragment,{children:R.jsxs(I0e,{margin:[10,10],isDraggable:t,resizeHandles:t?["sw","nw","ne","se","e","w"]:[],className:ye((x=n==null?void 0:n.gridLayout)==null?void 0:x.className),layouts:o,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:d,onLayoutChange:h,resizeHandle:p,children:[v(),b()]})})}const C4=m.forwardRef(({className:e,handleAxis:t,...n},r)=>(we(o=>o.themeStyle),R.jsx("div",{ref:r,className:ye(`react-resizable-handle z-10 react-resizable-handle-${t} absolute border-foreground/40`,{"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0":t==="nw","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne","border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw","border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0 group-hover:border-t-0":t==="e","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0 group-hover:border-t-0":t==="w"},e),...n})));C4.displayName="ResizeHandle";let L0e=(e,t=21)=>(n=t)=>{let r="",o=n;for(;o--;)r+=e[Math.random()*e.length|0];return r};var Ed={exports:{}};const F0e=typeof Buffer<"u",kD=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,ID=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function E4(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),F0e&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));const r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;const o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if(o==="ignore"&&i==="ignore")return r;if(o!=="ignore"&&i!=="ignore"){if(kD.test(e)===!1&&ID.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(kD.test(e)===!1)return r}else if(ID.test(e)===!1)return r;return R4(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function R4(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const i=o;o=[];for(const a of i){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(a,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete a.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(a,"constructor")&&Object.prototype.hasOwnProperty.call(a.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete a.constructor}for(const s in a){const l=a[s];l&&typeof l=="object"&&o.push(l)}}}return e}function i2(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return E4(e,t,n)}finally{Error.stackTraceLimit=r}}function j0e(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return E4(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Ed.exports=i2;Ed.exports.default=i2;Ed.exports.parse=i2;Ed.exports.safeParse=j0e;Ed.exports.scan=R4;var z0e=Ed.exports;const ND=mc(z0e);var P4=L0e("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);function B0e(e){const t=["ROOT"];let n=-1,r=null;function o(l,c,u){switch(l){case'"':{n=c,t.pop(),t.push(u),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,r=c,t.pop(),t.push(u),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(u),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(u),t.push("INSIDE_ARRAY_START");break}}}function i(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function a(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":o(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const d=e.substring(r,l+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l)):n=l;break}}}let s=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{s+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{s+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{s+="]";break}case"INSIDE_LITERAL":{const u=e.substring(r,e.length);"true".startsWith(u)?s+="true".slice(u.length):"false".startsWith(u)?s+="false".slice(u.length):"null".startsWith(u)&&(s+="null".slice(u.length))}}return s}function V0e(e){if(e!=null)try{return ND.parse(e)}catch{try{const n=B0e(e);return ND.parse(n)}catch{}}}var Sh={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Ch={code:"1",name:"function_call",parse:e=>{if(e==null||typeof e!="object"||!("function_call"in e)||typeof e.function_call!="object"||e.function_call==null||!("name"in e.function_call)||!("arguments"in e.function_call)||typeof e.function_call.name!="string"||typeof e.function_call.arguments!="string")throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},Eh={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},Rh={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Ph={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},$h={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},Oh={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},Th={code:"7",name:"tool_calls",parse:e=>{if(e==null||typeof e!="object"||!("tool_calls"in e)||typeof e.tool_calls!="object"||e.tool_calls==null||!Array.isArray(e.tool_calls)||e.tool_calls.some(t=>t==null||typeof t!="object"||!("id"in t)||typeof t.id!="string"||!("type"in t)||typeof t.type!="string"||!("function"in t)||t.function==null||typeof t.function!="object"||!("arguments"in t.function)||typeof t.function.name!="string"||typeof t.function.arguments!="string"))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},Dh={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},Ah={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},Mh={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},kh={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},Ih={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},Nh={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string"||!("usage"in e)||e.usage==null||typeof e.usage!="object"||!("promptTokens"in e.usage)||!("completionTokens"in e.usage))throw new Error('"finish_message" parts expect an object with a "finishReason" and "usage" property.');return typeof e.usage.promptTokens!="number"&&(e.usage.promptTokens=Number.NaN),typeof e.usage.completionTokens!="number"&&(e.usage.completionTokens=Number.NaN),{type:"finish_message",value:e}}},H0e=[Sh,Ch,Eh,Rh,Ph,$h,Oh,Th,Dh,Ah,Mh,kh,Ih,Nh],W0e={[Sh.code]:Sh,[Ch.code]:Ch,[Eh.code]:Eh,[Rh.code]:Rh,[Ph.code]:Ph,[$h.code]:$h,[Oh.code]:Oh,[Th.code]:Th,[Dh.code]:Dh,[Ah.code]:Ah,[Mh.code]:Mh,[kh.code]:kh,[Ih.code]:Ih,[Nh.code]:Nh};Sh.name+"",Sh.code,Ch.name+"",Ch.code,Eh.name+"",Eh.code,Rh.name+"",Rh.code,Ph.name+"",Ph.code,$h.name+"",$h.code,Oh.name+"",Oh.code,Th.name+"",Th.code,Dh.name+"",Dh.code,Ah.name+"",Ah.code,Mh.name+"",Mh.code,kh.name+"",kh.code,Ih.name+"",Ih.code,Nh.name+"",Nh.code;var U0e=H0e.map(e=>e.code),$4=e=>{const t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!U0e.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return W0e[r].parse(i)},q0e=10;function G0e(e,t){const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function*Y0e(e,{isAborted:t}={}){const n=new TextDecoder,r=[];let o=0;for(;;){const{value:i}=await e.read();if(i&&(r.push(i),o+=i.length,i[i.length-1]!==q0e))continue;if(r.length===0)break;const a=G0e(r,o);o=0;const s=n.decode(a,{stream:!0}).split(`
403
+ `).filter(l=>l!=="").map($4);for(const l of s)yield l;if(t!=null&&t()){e.cancel();break}}}function Em(e,t){return!e||!t||!t.length?e:{...e,annotations:[...t]}}async function K0e({reader:e,abortControllerRef:t,update:n,onToolCall:r,onFinish:o,generateId:i=P4,getCurrentDate:a=()=>new Date}){var s;const l=a(),c={data:[]};let u;const d={};let h={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},p="unknown";for await(const{type:v,value:b}of Y0e(e,{isAborted:()=>(t==null?void 0:t.current)===null})){if(v==="text"&&(c.text?c.text={...c.text,content:(c.text.content||"")+b}:c.text={id:i(),role:"assistant",content:b,createdAt:l}),v==="finish_message"){const{completionTokens:C,promptTokens:E}=b.usage;p=b.finishReason,h={completionTokens:C,promptTokens:E,totalTokens:C+E}}if(v==="tool_call_streaming_start")c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),d[b.toolCallId]={text:"",toolName:b.toolName,prefixMapIndex:c.text.toolInvocations.length},c.text.toolInvocations.push({state:"partial-call",toolCallId:b.toolCallId,toolName:b.toolName,args:void 0});else if(v==="tool_call_delta"){const C=d[b.toolCallId];C.text+=b.argsTextDelta,c.text.toolInvocations[C.prefixMapIndex]={state:"partial-call",toolCallId:b.toolCallId,toolName:C.toolName,args:V0e(C.text)},c.text.internalUpdateId=i()}else if(v==="tool_call"){if(d[b.toolCallId]!=null?c.text.toolInvocations[d[b.toolCallId].prefixMapIndex]={state:"call",...b}:(c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),c.text.toolInvocations.push({state:"call",...b})),c.text.internalUpdateId=i(),r){const C=await r({toolCall:b});C!=null&&(c.text.toolInvocations[c.text.toolInvocations.length-1]={state:"result",...b,result:C})}}else if(v==="tool_result"){const C=(s=c.text)==null?void 0:s.toolInvocations;if(C==null)throw new Error("tool_result must be preceded by a tool_call");const E=C.findIndex($=>$.toolCallId===b.toolCallId);if(E===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");C[E]={...C[E],state:"result",...b}}let x=null;v==="function_call"&&(c.function_call={id:i(),role:"assistant",content:"",function_call:b.function_call,name:b.function_call.name,createdAt:l},x=c.function_call);let y=null;v==="tool_calls"&&(c.tool_calls={id:i(),role:"assistant",content:"",tool_calls:b.tool_calls,createdAt:l},y=c.tool_calls),v==="data"&&c.data.push(...b);let _=c.text;v==="message_annotations"&&(u?u.push(...b):u=[...b],x=Em(c.function_call,u),y=Em(c.tool_calls,u),_=Em(c.text,u)),u!=null&&u.length&&["text","function_call","tool_calls"].forEach(E=>{c[E]&&(c[E].annotations=[...u])});const S=[x,y,_].filter(Boolean).map(C=>({...Em(C,u)}));n(S,[...c.data])}return o==null||o({prefixMap:c,finishReason:p,usage:h}),{messages:[c.text,c.function_call,c.tool_calls].filter(Boolean),data:c.data}}var X0e=()=>fetch;async function Q0e({api:e,body:t,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:a,onResponse:s,onUpdate:l,onFinish:c,onToolCall:u,generateId:d,fetch:h=X0e()}){var p,v;const b=await h(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(p=i==null?void 0:i())==null?void 0:p.signal,credentials:r}).catch(y=>{throw a(),y});if(s)try{await s(b)}catch(y){throw y}if(!b.ok)throw a(),new Error((v=await b.text())!=null?v:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");const x=b.body.getReader();switch(n){case"text":{const y=J0e(),_={id:d(),createdAt:new Date,role:"assistant",content:""};for(;;){const{done:S,value:C}=await x.read();if(S)break;if(_.content+=y(C),l([{..._}],[]),(i==null?void 0:i())===null){x.cancel();break}}return c==null||c(_,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"}),{messages:[_],data:[]}}case"data":return await K0e({reader:x,abortControllerRef:i!=null?{current:i()}:void 0,update:l,onToolCall:u,onFinish({prefixMap:y,finishReason:_,usage:S}){c&&y.text!=null&&c(y.text,{usage:S,finishReason:_})},generateId:d});default:{const y=n;throw new Error(`Unknown stream protocol: ${y}`)}}}function J0e(e){const t=new TextDecoder;return e?function(n){return t.decode(n,{stream:!0}).split(`
404
+ `).filter(o=>o!=="").map($4).filter(Boolean)}:function(n){return n?t.decode(n,{stream:!0}):""}}async function Z0e({getStreamedResponse:e,experimental_onFunctionCall:t,experimental_onToolCall:n,updateChatRequest:r,getCurrentMessages:o}){for(;;){const i=await e();if("messages"in i){let a=!1;for(const s of i.messages)if(!((s.function_call===void 0||typeof s.function_call=="string")&&(s.tool_calls===void 0||typeof s.tool_calls=="string"))){if(a=!0,t){const l=s.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0){a=!1;break}r(c)}if(n){const l=s.tool_calls;if(!Array.isArray(l)||l.some(u=>typeof u!="object")){console.warn("experimental_onToolCall should not be defined when using tools");continue}const c=await n(o(),l);if(c===void 0){a=!1;break}r(c)}}if(!a)break}else{let a=function(l){for(const c of l.messages){if(c.tool_calls!==void 0)for(const u of c.tool_calls)typeof u=="object"&&u.function.arguments&&typeof u.function.arguments!="string"&&(u.function.arguments=JSON.stringify(u.function.arguments));c.function_call!==void 0&&typeof c.function_call=="object"&&c.function_call.arguments&&typeof c.function_call.arguments!="string"&&(c.function_call.arguments=JSON.stringify(c.function_call.arguments))}};const s=i;if((s.function_call===void 0||typeof s.function_call=="string")&&(s.tool_calls===void 0||typeof s.tool_calls=="string"))break;if(t){const l=s.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0)break;a(c),r(c)}if(n){const l=s.tool_calls;if(typeof l!="object"){console.warn("experimental_onToolCall should not be defined when using functions");continue}const c=await n(o(),l);if(c===void 0)break;a(c),r(c)}}}}var ebe=ES();const ks=()=>{},Jr=ks(),gx=Object,Ut=e=>e===Jr,Bi=e=>typeof e=="function",Ys=(e,t)=>({...e,...t}),tbe=e=>Bi(e.then),Rm=new WeakMap;let nbe=0;const Lh=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(gx(e)===e&&!r&&n!=RegExp){if(o=Rm.get(e),o)return o;if(o=++nbe+"~",Rm.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=Lh(e[i])+",";Rm.set(e,o)}if(n==gx){o="#";const a=gx.keys(e).sort();for(;!Ut(i=a.pop());)Ut(e[i])||(o+=i+":"+Lh(e[i])+",");Rm.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Ta=new WeakMap,mx={},Pm={},a2="undefined",_v=typeof window!=a2,G_=typeof document!=a2,rbe=()=>_v&&typeof window.requestAnimationFrame!=a2,O4=(e,t)=>{const n=Ta.get(e);return[()=>!Ut(t)&&e.get(t)||mx,r=>{if(!Ut(t)){const o=e.get(t);t in Pm||(Pm[t]=o),n[5](t,Ys(o,r),o||mx)}},n[6],()=>!Ut(t)&&t in Pm?Pm[t]:!Ut(t)&&e.get(t)||mx]};let Y_=!0;const obe=()=>Y_,[K_,X_]=_v&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ks,ks],ibe=()=>{const e=G_&&document.visibilityState;return Ut(e)||e!=="hidden"},abe=e=>(G_&&document.addEventListener("visibilitychange",e),K_("focus",e),()=>{G_&&document.removeEventListener("visibilitychange",e),X_("focus",e)}),sbe=e=>{const t=()=>{Y_=!0,e()},n=()=>{Y_=!1};return K_("online",t),K_("offline",n),()=>{X_("online",t),X_("offline",n)}},lbe={isOnline:obe,isVisible:ibe},cbe={initFocus:abe,initReconnect:sbe},LD=!m.useId,Fh=!_v||"Deno"in window,ube=e=>rbe()?window.requestAnimationFrame(e):setTimeout(e,1),bx=Fh?m.useEffect:m.useLayoutEffect,vx=typeof navigator<"u"&&navigator.connection,FD=!Fh&&vx&&(["slow-2g","2g"].includes(vx.effectiveType)||vx.saveData),s2=e=>{if(Bi(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Lh(e):"",[e,t]};let dbe=0;const Q_=()=>++dbe,T4=0,D4=1,A4=2,fbe=3;var mf={__proto__:null,ERROR_REVALIDATE_EVENT:fbe,FOCUS_EVENT:T4,MUTATE_EVENT:A4,RECONNECT_EVENT:D4};async function M4(...e){const[t,n,r,o]=e,i=Ys({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let a=i.populateCache;const s=i.rollbackOnError;let l=i.optimisticData;const c=h=>typeof s=="function"?s(h):s!==!1,u=i.throwOnError;if(Bi(n)){const h=n,p=[],v=t.keys();for(const b of v)!/^\$(inf|sub)\$/.test(b)&&h(t.get(b)._k)&&p.push(b);return Promise.all(p.map(d))}return d(n);async function d(h){const[p]=s2(h);if(!p)return;const[v,b]=O4(t,p),[x,y,_,S]=Ta.get(t),C=()=>{const X=x[p];return(Bi(i.revalidate)?i.revalidate(v().data,h):i.revalidate!==!1)&&(delete _[p],delete S[p],X&&X[0])?X[0](A4).then(()=>v().data):v().data};if(e.length<3)return C();let E=r,$;const T=Q_();y[p]=[T,0];const D=!Ut(l),M=v(),L=M.data,F=M._c,z=Ut(F)?L:F;if(D&&(l=Bi(l)?l(z,L):l,b({data:l,_c:z})),Bi(E))try{E=E(z)}catch(X){$=X}if(E&&tbe(E))if(E=await E.catch(X=>{$=X}),T!==y[p][0]){if($)throw $;return E}else $&&D&&c($)&&(a=!0,b({data:z,_c:Jr}));if(a&&!$)if(Bi(a)){const X=a(E,z);b({data:X,error:Jr,_c:Jr})}else b({data:E,error:Jr,_c:Jr});if(y[p][1]=Q_(),Promise.resolve(C()).then(()=>{b({_c:Jr})}),$){if(u)throw $;return}return E}}const jD=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},hbe=(e,t)=>{if(!Ta.has(e)){const n=Ys(cbe,t),r={},o=M4.bind(Jr,e);let i=ks;const a={},s=(u,d)=>{const h=a[u]||[];return a[u]=h,h.push(d),()=>h.splice(h.indexOf(d),1)},l=(u,d,h)=>{e.set(u,d);const p=a[u];if(p)for(const v of p)v(d,h)},c=()=>{if(!Ta.has(e)&&(Ta.set(e,[r,{},{},{},o,l,s]),!Fh)){const u=n.initFocus(setTimeout.bind(Jr,jD.bind(Jr,r,T4))),d=n.initReconnect(setTimeout.bind(Jr,jD.bind(Jr,r,D4)));i=()=>{u&&u(),d&&d(),Ta.delete(e)}}};return c(),[e,o,c,i]}return[e,Ta.get(e)[4]]},pbe=(e,t,n,r,o)=>{const i=n.errorRetryCount,a=o.retryCount,s=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!Ut(i)&&a>i||setTimeout(r,s,o)},gbe=(e,t)=>Lh(e)==Lh(t),[k4,mbe]=hbe(new Map),bbe=Ys({onLoadingSlow:ks,onSuccess:ks,onError:ks,onErrorRetry:pbe,onDiscarded:ks,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:FD?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:FD?5e3:3e3,compare:gbe,isPaused:()=>!1,cache:k4,mutate:mbe,fallback:{}},lbe),vbe=(e,t)=>{const n=Ys(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:a}=t;r&&i&&(n.use=r.concat(i)),o&&a&&(n.fallback=Ys(o,a))}return n},ybe=m.createContext({}),xbe="$inf$",I4=_v&&window.__SWR_DEVTOOLS_USE__,wbe=I4?window.__SWR_DEVTOOLS_USE__:[],_be=()=>{I4&&(window.__SWR_DEVTOOLS_REACT__=m)},Sbe=e=>Bi(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Cbe=()=>Ys(bbe,m.useContext(ybe)),Ebe=e=>(t,n,r)=>e(t,n&&((...i)=>{const[a]=s2(t),[,,,s]=Ta.get(k4);if(a.startsWith(xbe))return n(...i);const l=s[a];return Ut(l)?n(...i):(delete s[a],l)}),r),Rbe=wbe.concat(Ebe),Pbe=e=>function(...n){const r=Cbe(),[o,i,a]=Sbe(n),s=vbe(r,a);let l=e;const{use:c}=s,u=(c||[]).concat(Rbe);for(let d=u.length;d--;)l=u[d](l);return l(o,i||s.fetcher||null,s)},$be=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};_be();const zD=m.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),yx={dedupe:!0},Obe=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:a,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:h}=n,[p,v,b,x]=Ta.get(r),[y,_]=s2(e),S=m.useRef(!1),C=m.useRef(!1),E=m.useRef(y),$=m.useRef(t),T=m.useRef(n),D=()=>T.current,M=()=>D().isVisible()&&D().isOnline(),[L,F,z,X]=O4(r,y),G=m.useRef({}).current,A=Ut(a)?n.fallback[y]:a,U=(Z,ve)=>{for(const Ce in G){const Oe=Ce;if(Oe==="data"){if(!o(Z[Oe],ve[Oe])&&(!Ut(Z[Oe])||!o(ce,ve[Oe])))return!1}else if(ve[Oe]!==Z[Oe])return!1}return!0},V=m.useMemo(()=>{const Z=!y||!t?!1:Ut(s)?D().isPaused()||i?!1:Ut(l)?!0:l:s,ve=Ie=>{const Ke=Ys(Ie);return delete Ke._k,Z?{isValidating:!0,isLoading:!0,...Ke}:Ke},Ce=L(),Oe=X(),Te=ve(Ce),We=Ce===Oe?Te:ve(Oe);let Be=Te;return[()=>{const Ie=ve(L());return U(Ie,Be)?(Be.data=Ie.data,Be.isLoading=Ie.isLoading,Be.isValidating=Ie.isValidating,Be.error=Ie.error,Be):(Be=Ie,Ie)},()=>We]},[r,y]),K=ebe.useSyncExternalStore(m.useCallback(Z=>z(y,(ve,Ce)=>{U(Ce,ve)||Z()}),[r,y]),V[0],V[1]),q=!S.current,O=p[y]&&p[y].length>0,H=K.data,Y=Ut(H)?A:H,I=K.error,te=m.useRef(Y),ce=h?Ut(H)?te.current:H:Y,de=O&&!Ut(I)?!1:q&&!Ut(s)?s:D().isPaused()?!1:i?Ut(Y)?!1:l:Ut(Y)||l,he=!!(y&&t&&q&&de),ie=Ut(K.isValidating)?he:K.isValidating,re=Ut(K.isLoading)?he:K.isLoading,le=m.useCallback(async Z=>{const ve=$.current;if(!y||!ve||C.current||D().isPaused())return!1;let Ce,Oe,Te=!0;const We=Z||{},Be=!b[y]||!We.dedupe,Ie=()=>LD?!C.current&&y===E.current&&S.current:y===E.current,Ke={isValidating:!1,isLoading:!1},dt=()=>{F(Ke)},Bt=()=>{const Qt=b[y];Qt&&Qt[1]===Oe&&delete b[y]},It={isValidating:!0};Ut(L().data)&&(It.isLoading=!0);try{if(Be&&(F(It),n.loadingTimeout&&Ut(L().data)&&setTimeout(()=>{Te&&Ie()&&D().onLoadingSlow(y,n)},n.loadingTimeout),b[y]=[ve(_),Q_()]),[Ce,Oe]=b[y],Ce=await Ce,Be&&setTimeout(Bt,n.dedupingInterval),!b[y]||b[y][1]!==Oe)return Be&&Ie()&&D().onDiscarded(y),!1;Ke.error=Jr;const Qt=v[y];if(!Ut(Qt)&&(Oe<=Qt[0]||Oe<=Qt[1]||Qt[1]===0))return dt(),Be&&Ie()&&D().onDiscarded(y),!1;const pe=L().data;Ke.data=o(pe,Ce)?pe:Ce,Be&&Ie()&&D().onSuccess(Ce,y,n)}catch(Qt){Bt();const pe=D(),{shouldRetryOnError:Re}=pe;pe.isPaused()||(Ke.error=Qt,Be&&Ie()&&(pe.onError(Qt,y,pe),(Re===!0||Bi(Re)&&Re(Qt))&&(!D().revalidateOnFocus||!D().revalidateOnReconnect||M())&&pe.onErrorRetry(Qt,y,pe,Le=>{const Ge=p[y];Ge&&Ge[0]&&Ge[0](mf.ERROR_REVALIDATE_EVENT,Le)},{retryCount:(We.retryCount||0)+1,dedupe:!0})))}return Te=!1,dt(),!0},[y,r]),xe=m.useCallback((...Z)=>M4(r,E.current,...Z),[]);if(bx(()=>{$.current=t,T.current=n,Ut(H)||(te.current=H)}),bx(()=>{if(!y)return;const Z=le.bind(Jr,yx);let ve=0;const Oe=$be(y,p,(Te,We={})=>{if(Te==mf.FOCUS_EVENT){const Be=Date.now();D().revalidateOnFocus&&Be>ve&&M()&&(ve=Be+D().focusThrottleInterval,Z())}else if(Te==mf.RECONNECT_EVENT)D().revalidateOnReconnect&&M()&&Z();else{if(Te==mf.MUTATE_EVENT)return le();if(Te==mf.ERROR_REVALIDATE_EVENT)return le(We)}});return C.current=!1,E.current=y,S.current=!0,F({_k:_}),de&&(Ut(Y)||Fh?Z():ube(Z)),()=>{C.current=!0,Oe()}},[y]),bx(()=>{let Z;function ve(){const Oe=Bi(c)?c(L().data):c;Oe&&Z!==-1&&(Z=setTimeout(Ce,Oe))}function Ce(){!L().error&&(u||D().isVisible())&&(d||D().isOnline())?le(yx).then(ve):ve()}return ve(),()=>{Z&&(clearTimeout(Z),Z=-1)}},[c,u,d,y]),m.useDebugValue(ce),i&&Ut(Y)&&y){if(!LD&&Fh)throw new Error("Fallback data is required when using suspense in SSR.");$.current=t,T.current=n,C.current=!1;const Z=x[y];if(!Ut(Z)){const ve=xe(Z);zD(ve)}if(Ut(I)){const ve=le(yx);Ut(ce)||(ve.status="fulfilled",ve.value=!0),zD(ve)}else throw I}return{mutate:xe,get data(){return G.data=!0,ce},get error(){return G.error=!0,I},get isValidating(){return G.isValidating=!0,ie},get isLoading(){return G.isLoading=!0,re}}},$m=Pbe(Obe);var Tbe=async(e,t,n,r,o,i,a,s,l,c,u,d,h,p,v,b,x)=>{var y;const _=a.current;n(t.messages,!1);const S=p?t.messages:t.messages.map(({role:C,content:E,experimental_attachments:$,name:T,data:D,annotations:M,toolInvocations:L,function_call:F,tool_calls:z,tool_call_id:X})=>({role:C,content:E,...$!==void 0&&{experimental_attachments:$},...T!==void 0&&{name:T},...D!==void 0&&{data:D},...M!==void 0&&{annotations:M},...L!==void 0&&{toolInvocations:L},tool_call_id:X,...F!==void 0&&{function_call:F},...z!==void 0&&{tool_calls:z}}));return await Q0e({api:e,body:(y=v==null?void 0:v({messages:t.messages,requestData:t.data,requestBody:t.body}))!=null?y:{messages:S,data:t.data,...i.current.body,...t.body,...t.functions!==void 0&&{functions:t.functions},...t.function_call!==void 0&&{function_call:t.function_call},...t.tools!==void 0&&{tools:t.tools},...t.tool_choice!==void 0&&{tool_choice:t.tool_choice}},streamProtocol:c,credentials:i.current.credentials,headers:{...i.current.headers,...t.headers},abortController:()=>s.current,restoreMessagesOnFailure(){x||n(_,!1)},onResponse:d,onUpdate(C,E){n([...t.messages,...C],!1),r([...o||[],...E||[]],!1)},onToolCall:h,onFinish:u,generateId:l,fetch:b})};function Dbe({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,experimental_onFunctionCall:i,experimental_onToolCall:a,onToolCall:s,experimental_prepareRequestBody:l,experimental_maxAutomaticRoundtrips:c=0,maxAutomaticRoundtrips:u=c,maxToolRoundtrips:d=u,streamMode:h,streamProtocol:p,onResponse:v,onFinish:b,onError:x,credentials:y,headers:_,body:S,generateId:C=P4,fetch:E,keepLastMessageOnError:$=!1}={}){h&&(p??(p=h==="text"?"text":void 0));const T=m.useId(),D=t??T,M=typeof e=="string"?[e,D]:D,[L]=m.useState([]),{data:F,mutate:z}=$m([M,"messages"],null,{fallbackData:n??L}),{data:X=!1,mutate:G}=$m([M,"loading"],null),{data:A,mutate:U}=$m([M,"streamData"],null),{data:V=void 0,mutate:K}=$m([M,"error"],null),q=m.useRef(F||[]);m.useEffect(()=>{q.current=F||[]},[F]);const O=m.useRef(null),H=m.useRef({credentials:y,headers:_,body:S});m.useEffect(()=>{H.current={credentials:y,headers:_,body:S}},[y,_,S]);const Y=m.useCallback(async Z=>{const ve=q.current.length;try{G(!0),K(void 0);const Te=new AbortController;O.current=Te,await Z0e({getStreamedResponse:()=>Tbe(e,Z,z,U,A,H,q,O,C,p,b,v,s,o,l,E,$),experimental_onFunctionCall:i,experimental_onToolCall:a,updateChatRequest:We=>{Z=We},getCurrentMessages:()=>q.current}),O.current=null}catch(Te){if(Te.name==="AbortError")return O.current=null,null;x&&Te instanceof Error&&x(Te),K(Te)}finally{G(!1)}const Ce=q.current,Oe=Ce[Ce.length-1];Ce.length>ve&&Oe!=null&&d>0&&BD(Oe)&&Abe(Ce)<=d&&await Y({messages:Ce})},[z,G,e,H,v,b,x,K,U,A,p,o,i,a,l,s,d,q,O,C,E,$]),I=m.useCallback(async(Z,{options:ve,functions:Ce,function_call:Oe,tools:Te,tool_choice:We,data:Be,headers:Ie,body:Ke}={})=>{Z.id||(Z.id=C());const dt={headers:Ie??(ve==null?void 0:ve.headers),body:Ke??(ve==null?void 0:ve.body)},Bt={messages:q.current.concat(Z),options:dt,headers:dt.headers,body:dt.body,data:Be,...Ce!==void 0&&{functions:Ce},...Oe!==void 0&&{function_call:Oe},...Te!==void 0&&{tools:Te},...We!==void 0&&{tool_choice:We}};return Y(Bt)},[Y,C]),te=m.useCallback(async({options:Z,functions:ve,function_call:Ce,tools:Oe,tool_choice:Te,data:We,headers:Be,body:Ie}={})=>{if(q.current.length===0)return null;const Ke={headers:Be??(Z==null?void 0:Z.headers),body:Ie??(Z==null?void 0:Z.body)};if(q.current[q.current.length-1].role==="assistant"){const It={messages:q.current.slice(0,-1),options:Ke,headers:Ke.headers,body:Ke.body,data:We,...ve!==void 0&&{functions:ve},...Ce!==void 0&&{function_call:Ce},...Oe!==void 0&&{tools:Oe},...Te!==void 0&&{tool_choice:Te}};return Y(It)}const Bt={messages:q.current,options:Ke,headers:Ke.headers,body:Ke.body,data:We,...ve!==void 0&&{functions:ve},...Ce!==void 0&&{function_call:Ce},...Oe!==void 0&&{tools:Oe},...Te!==void 0&&{tool_choice:Te}};return Y(Bt)},[Y]),ce=m.useCallback(()=>{O.current&&(O.current.abort(),O.current=null)},[]),de=m.useCallback(Z=>{typeof Z=="function"&&(Z=Z(q.current)),z(Z,!1),q.current=Z},[z]),[he,ie]=m.useState(r),re=m.useCallback(async(Z,ve={},Ce)=>{var Oe,Te,We,Be,Ie;if((Oe=Z==null?void 0:Z.preventDefault)==null||Oe.call(Z),!he&&!ve.allowEmptySubmit)return;Ce&&(H.current={...H.current,...Ce});const Ke=[],dt=ve.experimental_attachments;if(dt)if(dt instanceof FileList)for(const pe of Array.from(dt)){const{name:Re,type:Le}=pe,Ge=await new Promise((Ze,Jt)=>{const ln=new FileReader;ln.onload=rn=>{var En;Ze((En=rn.target)==null?void 0:En.result)},ln.onerror=rn=>Jt(rn),ln.readAsDataURL(pe)});Ke.push({name:Re,contentType:Le,url:Ge})}else if(Array.isArray(dt))for(const pe of dt){const{name:Re,url:Le,contentType:Ge}=pe;Ke.push({name:Re,contentType:Ge,url:Le})}else throw new Error("Invalid attachments type");const Bt={headers:(We=ve.headers)!=null?We:(Te=ve.options)==null?void 0:Te.headers,body:(Ie=ve.body)!=null?Ie:(Be=ve.options)==null?void 0:Be.body},Qt={messages:!he&&ve.allowEmptySubmit?q.current:q.current.concat({id:C(),createdAt:new Date,role:"user",content:he,experimental_attachments:Ke.length>0?Ke:void 0}),options:Bt,headers:Bt.headers,body:Bt.body,data:ve.data};Y(Qt),ie("")},[he,C,Y]),le=Z=>{ie(Z.target.value)},xe=({toolCallId:Z,result:ve})=>{const Ce=q.current.map((Te,We,Be)=>We===Be.length-1&&Te.role==="assistant"&&Te.toolInvocations?{...Te,toolInvocations:Te.toolInvocations.map(Ie=>Ie.toolCallId===Z?{...Ie,result:ve}:Ie)}:Te);z(Ce,!1);const Oe=Ce[Ce.length-1];BD(Oe)&&Y({messages:Ce})};return{messages:F||[],error:V,append:I,reload:te,stop:ce,setMessages:de,input:he,setInput:ie,handleInputChange:le,handleSubmit:re,isLoading:X,data:A,addToolResult:xe,experimental_addToolResult:xe}}function BD(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function Abe(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}const N4="Switch",[Mbe,h5e]=hr(N4),[kbe,Ibe]=Mbe(N4),Nbe=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,...u}=e,[d,h]=m.useState(null),p=Rt(t,_=>h(_)),v=m.useRef(!1),b=d?!!d.closest("form"):!0,[x=!1,y]=Fr({prop:o,defaultProp:i,onChange:c});return m.createElement(kbe,{scope:n,checked:x,disabled:s},m.createElement(Qe.button,ue({type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":L4(x),"data-disabled":s?"":void 0,disabled:s,value:l},u,{ref:p,onClick:ke(e.onClick,_=>{y(S=>!S),b&&(v.current=_.isPropagationStopped(),v.current||_.stopPropagation())})})),b&&m.createElement(jbe,{control:d,bubbles:!v.current,name:r,value:l,checked:x,required:a,disabled:s,style:{transform:"translateX(-100%)"}}))}),Lbe="SwitchThumb",Fbe=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Ibe(Lbe,n);return m.createElement(Qe.span,ue({"data-state":L4(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),jbe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),a=lv(n),s=Jb(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const h=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(h)}},[a,n,r]),m.createElement("input",ue({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function L4(e){return e?"checked":"unchecked"}const Sv=Nbe,F4=Fbe,j4=j.forwardRef(({className:e,...t},n)=>R.jsx(Sv,{className:ye("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:R.jsx(F4,{className:ye("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")})}));j4.displayName=Sv.displayName;const zbe=j.forwardRef(({className:e,...t},n)=>R.jsx(Sv,{className:ye("peer inline-flex h-4 w-8 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:R.jsx(F4,{className:ye("pointer-events-none block h-3 w-3 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));zbe.displayName=Sv.displayName;function Bbe(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Vbe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hbe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wbe={};function VD(e,t){return((t||Wbe).jsx?Hbe:Vbe).test(e)}const Ube=/[ \t\n\f\r]/g;function qbe(e){return typeof e=="object"?e.type==="text"?HD(e.value):!1:HD(e)}function HD(e){return e.replace(Ube,"")===""}class Dp{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Dp.prototype.property={};Dp.prototype.normal={};Dp.prototype.space=null;function z4(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new Dp(n,r,t)}function J_(e){return e.toLowerCase()}class ti{constructor(t,n){this.property=t,this.attribute=n}}ti.prototype.space=null;ti.prototype.boolean=!1;ti.prototype.booleanish=!1;ti.prototype.overloadedBoolean=!1;ti.prototype.number=!1;ti.prototype.commaSeparated=!1;ti.prototype.spaceSeparated=!1;ti.prototype.commaOrSpaceSeparated=!1;ti.prototype.mustUseProperty=!1;ti.prototype.defined=!1;let Gbe=0;const xt=Rc(),Un=Rc(),B4=Rc(),De=Rc(),gn=Rc(),Pu=Rc(),po=Rc();function Rc(){return 2**++Gbe}const Z_=Object.freeze(Object.defineProperty({__proto__:null,boolean:xt,booleanish:Un,commaOrSpaceSeparated:po,commaSeparated:Pu,number:De,overloadedBoolean:B4,spaceSeparated:gn},Symbol.toStringTag,{value:"Module"})),xx=Object.keys(Z_);class l2 extends ti{constructor(t,n,r,o){let i=-1;if(super(t,n),WD(this,"space",o),typeof r=="number")for(;++i<xx.length;){const a=xx[i];WD(this,xx[i],(r&Z_[a])===Z_[a])}}}l2.prototype.defined=!0;function WD(e,t,n){n&&(e[t]=n)}const Ybe={}.hasOwnProperty;function Rd(e){const t={},n={};let r;for(r in e.properties)if(Ybe.call(e.properties,r)){const o=e.properties[r],i=new l2(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[J_(r)]=r,n[J_(i.attribute)]=r}return new Dp(t,n,e.space)}const V4=Rd({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}}),H4=Rd({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function W4(e,t){return t in e?e[t]:t}function U4(e,t){return W4(e,t.toLowerCase())}const q4=Rd({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:U4,properties:{xmlns:null,xmlnsXLink:null}}),G4=Rd({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Un,ariaAutoComplete:null,ariaBusy:Un,ariaChecked:Un,ariaColCount:De,ariaColIndex:De,ariaColSpan:De,ariaControls:gn,ariaCurrent:null,ariaDescribedBy:gn,ariaDetails:null,ariaDisabled:Un,ariaDropEffect:gn,ariaErrorMessage:null,ariaExpanded:Un,ariaFlowTo:gn,ariaGrabbed:Un,ariaHasPopup:null,ariaHidden:Un,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gn,ariaLevel:De,ariaLive:null,ariaModal:Un,ariaMultiLine:Un,ariaMultiSelectable:Un,ariaOrientation:null,ariaOwns:gn,ariaPlaceholder:null,ariaPosInSet:De,ariaPressed:Un,ariaReadOnly:Un,ariaRelevant:null,ariaRequired:Un,ariaRoleDescription:gn,ariaRowCount:De,ariaRowIndex:De,ariaRowSpan:De,ariaSelected:Un,ariaSetSize:De,ariaSort:null,ariaValueMax:De,ariaValueMin:De,ariaValueNow:De,ariaValueText:null,role:null}}),Kbe=Rd({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:U4,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pu,acceptCharset:gn,accessKey:gn,action:null,allow:null,allowFullScreen:xt,allowPaymentRequest:xt,allowUserMedia:xt,alt:null,as:null,async:xt,autoCapitalize:null,autoComplete:gn,autoFocus:xt,autoPlay:xt,blocking:gn,capture:null,charSet:null,checked:xt,cite:null,className:gn,cols:De,colSpan:null,content:null,contentEditable:Un,controls:xt,controlsList:gn,coords:De|Pu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:xt,defer:xt,dir:null,dirName:null,disabled:xt,download:B4,draggable:Un,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:xt,formTarget:null,headers:gn,height:De,hidden:xt,high:De,href:null,hrefLang:null,htmlFor:gn,httpEquiv:gn,id:null,imageSizes:null,imageSrcSet:null,inert:xt,inputMode:null,integrity:null,is:null,isMap:xt,itemId:null,itemProp:gn,itemRef:gn,itemScope:xt,itemType:gn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:xt,low:De,manifest:null,max:null,maxLength:De,media:null,method:null,min:null,minLength:De,multiple:xt,muted:xt,name:null,nonce:null,noModule:xt,noValidate:xt,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:xt,optimum:De,pattern:null,ping:gn,placeholder:null,playsInline:xt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:xt,referrerPolicy:null,rel:gn,required:xt,reversed:xt,rows:De,rowSpan:De,sandbox:gn,scope:null,scoped:xt,seamless:xt,selected:xt,shadowRootDelegatesFocus:xt,shadowRootMode:null,shape:null,size:De,sizes:null,slot:null,span:De,spellCheck:Un,src:null,srcDoc:null,srcLang:null,srcSet:null,start:De,step:null,style:null,tabIndex:De,target:null,title:null,translate:null,type:null,typeMustMatch:xt,useMap:null,value:Un,width:De,wrap:null,align:null,aLink:null,archive:gn,axis:null,background:null,bgColor:null,border:De,borderColor:null,bottomMargin:De,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:xt,declare:xt,event:null,face:null,frame:null,frameBorder:null,hSpace:De,leftMargin:De,link:null,longDesc:null,lowSrc:null,marginHeight:De,marginWidth:De,noResize:xt,noHref:xt,noShade:xt,noWrap:xt,object:null,profile:null,prompt:null,rev:null,rightMargin:De,rules:null,scheme:null,scrolling:Un,standby:null,summary:null,text:null,topMargin:De,valueType:null,version:null,vAlign:null,vLink:null,vSpace:De,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:xt,disableRemotePlayback:xt,prefix:null,property:null,results:De,security:null,unselectable:null}}),Xbe=Rd({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:W4,properties:{about:po,accentHeight:De,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:De,amplitude:De,arabicForm:null,ascent:De,attributeName:null,attributeType:null,azimuth:De,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:De,by:null,calcMode:null,capHeight:De,className:gn,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:De,diffuseConstant:De,direction:null,display:null,dur:null,divisor:De,dominantBaseline:null,download:xt,dx:null,dy:null,edgeMode:null,editable:null,elevation:De,enableBackground:null,end:null,event:null,exponent:De,externalResourcesRequired:null,fill:null,fillOpacity:De,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:Pu,g2:Pu,glyphName:Pu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:De,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:De,horizOriginX:De,horizOriginY:De,id:null,ideographic:De,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:De,k:De,k1:De,k2:De,k3:De,k4:De,kernelMatrix:po,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:De,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:De,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:De,overlineThickness:De,paintOrder:null,panose1:null,path:null,pathLength:De,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:De,pointsAtY:De,pointsAtZ:De,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:po,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:po,rev:po,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:po,requiredFeatures:po,requiredFonts:po,requiredFormats:po,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:De,specularExponent:De,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:De,strikethroughThickness:De,string:null,stroke:null,strokeDashArray:po,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:De,strokeOpacity:De,strokeWidth:null,style:null,surfaceScale:De,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:po,tabIndex:De,tableValues:null,target:null,targetX:De,targetY:De,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:po,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:De,underlineThickness:De,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:De,values:null,vAlphabetic:De,vMathematical:De,vectorEffect:null,vHanging:De,vIdeographic:De,version:null,vertAdvY:De,vertOriginX:De,vertOriginY:De,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:De,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Qbe=/^data[-\w.:]+$/i,UD=/-[a-z]/g,Jbe=/[A-Z]/g;function Zbe(e,t){const n=J_(t);let r=t,o=ti;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Qbe.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(UD,tve);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!UD.test(i)){let a=i.replace(Jbe,eve);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=l2}return new o(r,t)}function eve(e){return"-"+e.toLowerCase()}function tve(e){return e.charAt(1).toUpperCase()}const nve={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"},rve=z4([H4,V4,q4,G4,Kbe],"html"),c2=z4([H4,V4,q4,G4,Xbe],"svg");function ove(e){return e.join(" ").trim()}var Y4={},qD=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ive=/\n/g,ave=/^\s*/,sve=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,lve=/^:\s*/,cve=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,uve=/^[;\s]*/,dve=/^\s+|\s+$/g,fve=`
405
+ `,GD="/",YD="*",Pl="",hve="comment",pve="declaration",gve=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(v){var b=v.match(ive);b&&(n+=b.length);var x=v.lastIndexOf(fve);r=~x?v.length-x:r+v.length}function i(){var v={line:n,column:r};return function(b){return b.position=new a(v),c(),b}}function a(v){this.start=v,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(v){var b=new Error(t.source+":"+n+":"+r+": "+v);if(b.reason=v,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(v){var b=v.exec(e);if(b){var x=b[0];return o(x),e=e.slice(x.length),b}}function c(){l(ave)}function u(v){var b;for(v=v||[];b=d();)b!==!1&&v.push(b);return v}function d(){var v=i();if(!(GD!=e.charAt(0)||YD!=e.charAt(1))){for(var b=2;Pl!=e.charAt(b)&&(YD!=e.charAt(b)||GD!=e.charAt(b+1));)++b;if(b+=2,Pl===e.charAt(b-1))return s("End of comment missing");var x=e.slice(2,b-2);return r+=2,o(x),e=e.slice(b),r+=2,v({type:hve,comment:x})}}function h(){var v=i(),b=l(sve);if(b){if(d(),!l(lve))return s("property missing ':'");var x=l(cve),y=v({type:pve,property:KD(b[0].replace(qD,Pl)),value:x?KD(x[0].replace(qD,Pl)):Pl});return l(uve),y}}function p(){var v=[];u(v);for(var b;b=h();)b!==!1&&(v.push(b),u(v));return v}return c(),p()};function KD(e){return e?e.replace(dve,Pl):Pl}var mve=ys&&ys.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Y4,"__esModule",{value:!0});var bve=mve(gve);function vve(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,bve.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var a=i.property,s=i.value;o?t(a,s,i):s&&(n=n||{},n[a]=s)}}),n}var XD=Y4.default=vve;const yve=XD.default||XD,K4=X4("end"),u2=X4("start");function X4(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 xve(e){const t=u2(e),n=K4(e);if(t&&n)return{start:t,end:n}}function Jf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?QD(e.position):"start"in e||"end"in e?QD(e):"line"in e||"column"in e?eS(e):""}function eS(e){return JD(e&&e.line)+":"+JD(e&&e.column)}function QD(e){return eS(e&&e.start)+"-"+eS(e&&e.end)}function JD(e){return e&&typeof e=="number"?e:1}class Rr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(a=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=s?s.line:void 0,this.name=Jf(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}Rr.prototype.file="";Rr.prototype.name="";Rr.prototype.reason="";Rr.prototype.message="";Rr.prototype.stack="";Rr.prototype.column=void 0;Rr.prototype.line=void 0;Rr.prototype.ancestors=void 0;Rr.prototype.cause=void 0;Rr.prototype.fatal=void 0;Rr.prototype.place=void 0;Rr.prototype.ruleId=void 0;Rr.prototype.source=void 0;const d2={}.hasOwnProperty,wve=new Map,_ve=/[A-Z]/g,Sve=/-([a-z])/g,Cve=new Set(["table","tbody","thead","tfoot","tr"]),Eve=new Set(["td","th"]),Q4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Rve(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=kve(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=Mve(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?c2:rve,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=J4(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function J4(e,t,n){if(t.type==="element")return Pve(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return $ve(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Tve(e,t,n);if(t.type==="mdxjsEsm")return Ove(e,t);if(t.type==="root")return Dve(e,t,n);if(t.type==="text")return Ave(e,t)}function Pve(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=c2,e.schema=o),e.ancestors.push(t);const i=e9(e,t.tagName,!1),a=Ive(e,t);let s=h2(e,t);return Cve.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!qbe(l):!0})),Z4(e,a,i,t),f2(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function $ve(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}jh(e,t.position)}function Ove(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);jh(e,t.position)}function Tve(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=c2,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:e9(e,t.name,!0),a=Nve(e,t),s=h2(e,t);return Z4(e,a,i,t),f2(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function Dve(e,t,n){const r={};return f2(r,h2(e,t)),e.create(t,e.Fragment,r,n)}function Ave(e,t){return t.value}function Z4(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function f2(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Mve(e,t,n){return r;function r(o,i,a,s){const c=Array.isArray(a.children)?n:t;return s?c(i,a,s):c(i,a)}}function kve(e,t){return n;function n(r,o,i,a){const s=Array.isArray(i.children),l=u2(r);return t(o,i,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Ive(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&d2.call(t.properties,o)){const i=Lve(e,o,t.properties[o]);if(i){const[a,s]=i;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&Eve.has(t.tagName)?r=s:n[a]=s}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Nve(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else jh(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,i=e.evaluater.evaluateExpression(s.expression)}else jh(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function h2(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:wve;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;a=l+"-"+c,o.set(l,c+1)}}const s=J4(e,i,a);s!==void 0&&n.push(s)}return n}function Lve(e,t,n){const r=Zbe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Bbe(n):ove(n)),r.property==="style"){let o=typeof n=="object"?n:Fve(e,String(n));return e.stylePropertyNameCase==="css"&&(o=jve(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?nve[r.property]||r.property:r.attribute,n]}}function Fve(e,t){const n={};try{yve(t,r)}catch(o){if(!e.ignoreInvalidStyle){const i=o,a=new Rr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Q4+"#cannot-parse-style-attribute",a}}return n;function r(o,i){let a=o;a.slice(0,2)!=="--"&&(a.slice(0,4)==="-ms-"&&(a="ms-"+a.slice(4)),a=a.replace(Sve,Bve)),n[a]=i}}function e9(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,a;for(;++i<o.length;){const s=VD(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}r=a}else r=VD(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return d2.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);jh(e)}function jh(e,t){const n=new Rr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Q4+"#cannot-handle-mdx-estrees-without-createevaluater",n}function jve(e){const t={};let n;for(n in e)d2.call(e,n)&&(t[zve(n)]=e[n]);return t}function zve(e){let t=e.replace(_ve,Vve);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Bve(e,t){return t.toUpperCase()}function Vve(e){return"-"+e.toLowerCase()}const wx={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"]},Hve={};function Wve(e,t){const n=t||Hve,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return t9(e,r,o)}function t9(e,t,n){if(Uve(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 ZD(e.children,t,n)}return Array.isArray(e)?ZD(e,t,n):""}function ZD(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=t9(e[o],t,n);return r.join("")}function Uve(e){return!!(e&&typeof e=="object")}const eA=document.createElement("i");function p2(e){const t="&"+e+";";eA.innerHTML=t;const n=eA.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Zi(e,t,n,r){const o=e.length;let i=0,a;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function Go(e,t){return e.length>0?(Zi(e,e.length,0,t),e):t}const tA={}.hasOwnProperty;function qve(e){const t={};let n=-1;for(;++n<e.length;)Gve(t,e[n]);return t}function Gve(e,t){let n;for(n in t){const o=(tA.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){tA.call(o,a)||(o[a]=[]);const s=i[a];Yve(o[a],Array.isArray(s)?s:s?[s]:[])}}}function Yve(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Zi(e,0,0,r)}function n9(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 $u(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Kve=Js(new RegExp("\\p{P}","u")),Vi=Js(/[A-Za-z]/),Co=Js(/[\dA-Za-z]/),Xve=Js(/[#-'*+\--9=?A-Z^-~]/);function tS(e){return e!==null&&(e<32||e===127)}const nS=Js(/\d/),Qve=Js(/[\dA-Fa-f]/),r9=Js(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function oo(e){return e!==null&&(e<0||e===32)}function Kt(e){return e===-2||e===-1||e===32}function Jve(e){return r9(e)||Kve(e)}const Zve=Js(/\s/);function Js(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Pd(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(i===37&&Co(e.charCodeAt(n+1))&&Co(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const s=e.charCodeAt(n+1);i<56320&&s>56319&&s<57344?(a=String.fromCharCode(i,s),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function mn(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return Kt(l)?(e.enter(n),s(l)):t(l)}function s(l){return Kt(l)&&i++<o?(e.consume(l),s):(e.exit(n),t(l))}}const eye={tokenize:tye};function tye(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),mn(e,t,"linePrefix")}function o(s){return e.enter("paragraph"),i(s)}function i(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return it(s)?(e.consume(s),e.exit("chunkText"),i):(e.consume(s),a)}}const nye={tokenize:rye},nA={tokenize:oye};function rye(e){const t=this,n=[];let r=0,o,i,a;return s;function s(S){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,l,c)(S)}return c(S)}function l(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&_();const C=t.events.length;let E=C,$;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){$=t.events[E][1].end;break}y(r);let T=C;for(;T<t.events.length;)t.events[T][1].end=Object.assign({},$),T++;return Zi(t.events,E+1,0,t.events.slice(C)),t.events.length=T,c(S)}return s(S)}function c(S){if(r===n.length){if(!o)return h(S);if(o.currentConstruct&&o.currentConstruct.concrete)return v(S);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(nA,u,d)(S)}function u(S){return o&&_(),y(r),h(S)}function d(S){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,v(S)}function h(S){return t.containerState={},e.attempt(nA,p,v)(S)}function p(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function v(S){if(S===null){o&&_(),y(0),e.consume(S);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:o}),b(S)}function b(S){if(S===null){x(e.exit("chunkFlow"),!0),y(0),e.consume(S);return}return it(S)?(e.consume(S),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(S),b)}function x(S,C){const E=t.sliceStream(S);if(C&&E.push(null),S.previous=i,i&&(i.next=S),i=S,o.defineSkip(S.start),o.write(E),t.parser.lazy[S.start.line]){let $=o.events.length;for(;$--;)if(o.events[$][1].start.offset<a&&(!o.events[$][1].end||o.events[$][1].end.offset>a))return;const T=t.events.length;let D=T,M,L;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(M){L=t.events[D][1].end;break}M=!0}for(y(r),$=T;$<t.events.length;)t.events[$][1].end=Object.assign({},L),$++;Zi(t.events,D+1,0,t.events.slice(T)),t.events.length=$}}function y(S){let C=n.length;for(;C-- >S;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=S}function _(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function oye(e,t,n){return mn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rA(e){if(e===null||oo(e)||Zve(e))return 1;if(Jve(e))return 2}function g2(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const rS={name:"attention",tokenize:aye,resolveAll:iye};function iye(e,t){let n=-1,r,o,i,a,s,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);oA(d,-l),oA(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},s.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Go(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Go(c,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",i,t]]),c=Go(c,g2(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Go(c,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Go(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Zi(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function aye(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=rA(r);let i;return a;function a(l){return i=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===i)return e.consume(l),s;const c=e.exit("attentionSequence"),u=rA(l),d=!u||u===2&&o||n.includes(l),h=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?d:d&&(o||!h)),c._close=!!(i===42?h:h&&(u||!d)),t(l)}}function oA(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const sye={name:"autolink",tokenize:lye};function lye(e,t,n){let r=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return Vi(p)?(e.consume(p),a):c(p)}function a(p){return p===43||p===45||p===46||Co(p)?(r=1,s(p)):c(p)}function s(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Co(p))&&r++<32?(e.consume(p),s):(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||tS(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):Xve(p)?(e.consume(p),c):n(p)}function u(p){return Co(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||Co(p))&&r++<63){const v=p===45?h:d;return e.consume(p),v}return n(p)}}const Cv={tokenize:cye,partial:!0};function cye(e,t,n){return r;function r(i){return Kt(i)?mn(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||it(i)?t(i):n(i)}}const o9={name:"blockQuote",tokenize:uye,continuation:{tokenize:dye},exit:fye};function uye(e,t,n){const r=this;return o;function o(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return n(a)}function i(a){return Kt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function dye(e,t,n){const r=this;return o;function o(a){return Kt(a)?mn(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(o9,t,n)(a)}}function fye(e){e.exit("blockQuote")}const i9={name:"characterEscape",tokenize:hye};function hye(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return r9(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const a9={name:"characterReference",tokenize:pye};function pye(e,t,n){const r=this;let o=0,i,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,a=Co,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=Qve,u):(e.enter("characterReferenceValue"),i=7,a=nS,u(d))}function u(d){if(d===59&&o){const h=e.exit("characterReferenceValue");return a===Co&&!p2(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&o++<i?(e.consume(d),u):n(d)}}const iA={tokenize:mye,partial:!0},aA={name:"codeFenced",tokenize:gye,concrete:!0};function gye(e,t,n){const r=this,o={tokenize:E,partial:!0};let i=0,a=0,s;return l;function l($){return c($)}function c($){const T=r.events[r.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,s=$,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u($)}function u($){return $===s?(a++,e.consume($),u):a<3?n($):(e.exit("codeFencedFenceSequence"),Kt($)?mn(e,d,"whitespace")($):d($))}function d($){return $===null||it($)?(e.exit("codeFencedFence"),r.interrupt?t($):e.check(iA,b,C)($)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h($))}function h($){return $===null||it($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d($)):Kt($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),mn(e,p,"whitespace")($)):$===96&&$===s?n($):(e.consume($),h)}function p($){return $===null||it($)?d($):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v($))}function v($){return $===null||it($)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d($)):$===96&&$===s?n($):(e.consume($),v)}function b($){return e.attempt(o,C,x)($)}function x($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),y}function y($){return i>0&&Kt($)?mn(e,_,"linePrefix",i+1)($):_($)}function _($){return $===null||it($)?e.check(iA,b,C)($):(e.enter("codeFlowValue"),S($))}function S($){return $===null||it($)?(e.exit("codeFlowValue"),_($)):(e.consume($),S)}function C($){return e.exit("codeFenced"),t($)}function E($,T,D){let M=0;return L;function L(A){return $.enter("lineEnding"),$.consume(A),$.exit("lineEnding"),F}function F(A){return $.enter("codeFencedFence"),Kt(A)?mn($,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):z(A)}function z(A){return A===s?($.enter("codeFencedFenceSequence"),X(A)):D(A)}function X(A){return A===s?(M++,$.consume(A),X):M>=a?($.exit("codeFencedFenceSequence"),Kt(A)?mn($,G,"whitespace")(A):G(A)):D(A)}function G(A){return A===null||it(A)?($.exit("codeFencedFence"),T(A)):D(A)}}}function mye(e,t,n){const r=this;return o;function o(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const _x={name:"codeIndented",tokenize:vye},bye={tokenize:yye,partial:!0};function vye(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),mn(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):it(c)?e.attempt(bye,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||it(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function yye(e,t,n){const r=this;return o;function o(a){return r.parser.lazy[r.now().line]?n(a):it(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):mn(e,i,"linePrefix",5)(a)}function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):it(a)?o(a):n(a)}}const xye={name:"codeText",tokenize:Sye,resolve:wye,previous:_ye};function wye(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function _ye(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Sye(e,t,n){let r=0,o,i;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(i=e.enter("codeTextSequence"),o=0,u(d)):it(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||it(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}function s9(e){const t={};let n=-1,r,o,i,a,s,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Cye(e,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--&&(a=e[i],a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(o&&(e[o][1].type="lineEndingBlank"),a[1].type="lineEnding",o=i);o&&(r[1].end=Object.assign({},e[o][1].start),s=e.slice(o,n),s.unshift(r),Zi(e,o,n-o+1,s))}}return!c}function Cye(e,t){const n=e[t][1],r=e[t][2];let o=t-1;const i=[],a=n._tokenizer||r.parser[n.contentType](n.start),s=a.events,l=[],c={};let u,d,h=-1,p=n,v=0,b=0;const x=[b];for(;p;){for(;e[++o][1]!==p;);i.push(o),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++h<s.length;)s[h][0]==="exit"&&s[h-1][0]==="enter"&&s[h][1].type===s[h-1][1].type&&s[h][1].start.line!==s[h][1].end.line&&(b=h+1,x.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),h=x.length;h--;){const y=s.slice(x[h],x[h+1]),_=i.pop();l.unshift([_,_+y.length-1]),Zi(e,_,2,y)}for(h=-1;++h<l.length;)c[v+l[h][0]]=v+l[h][1],v+=l[h][1]-l[h][0]-1;return c}const Eye={tokenize:$ye,resolve:Pye},Rye={tokenize:Oye,partial:!0};function Pye(e){return s9(e),e}function $ye(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(s)}function o(s){return s===null?i(s):it(s)?e.check(Rye,a,i)(s):(e.consume(s),o)}function i(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function Oye(e,t,n){const r=this;return o;function o(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),mn(e,i,"linePrefix")}function i(a){if(a===null||it(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function l9(e,t,n,r,o,i,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(y){return y===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||tS(y)?n(y):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(s),h(y)):y===null||y===60||it(y)?n(y):(e.consume(y),y===92?v:p)}function v(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function b(y){return!u&&(y===null||y===41||oo(y))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,b):y===41?(e.consume(y),u--,b):y===null||y===32||y===40||tS(y)?n(y):(e.consume(y),y===92?x:b)}function x(y){return y===40||y===41||y===92?(e.consume(y),b):b(y)}}function c9(e,t,n,r,o,i){const a=this;let s=0,l;return c;function c(p){return e.enter(r),e.enter(o),e.consume(p),e.exit(o),e.enter(i),u}function u(p){return s>999||p===null||p===91||p===93&&!l||p===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(i),e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):it(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||it(p)||s++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!Kt(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),s++,d):d(p)}}function u9(e,t,n,r,o,i){let a;return s;function s(h){return h===34||h===39||h===40?(e.enter(r),e.enter(o),e.consume(h),e.exit(o),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):(e.enter(i),c(h))}function c(h){return h===a?(e.exit(i),l(a)):h===null?n(h):it(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),mn(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===a||h===null||it(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===a||h===92?(e.consume(h),u):u(h)}}function Zf(e,t){let n;return r;function r(o){return it(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Kt(o)?mn(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Tye={name:"definition",tokenize:Aye},Dye={tokenize:Mye,partial:!0};function Aye(e,t,n){const r=this;let o;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return c9.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return o=$u(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 oo(p)?Zf(e,c)(p):c(p)}function c(p){return l9(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(Dye,d,d)(p)}function d(p){return Kt(p)?mn(e,h,"whitespace")(p):h(p)}function h(p){return p===null||it(p)?(e.exit("definition"),r.parser.defined.push(o),t(p)):n(p)}}function Mye(e,t,n){return r;function r(s){return oo(s)?Zf(e,o)(s):n(s)}function o(s){return u9(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return Kt(s)?mn(e,a,"whitespace")(s):a(s)}function a(s){return s===null||it(s)?t(s):n(s)}}const kye={name:"hardBreakEscape",tokenize:Iye};function Iye(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return it(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const Nye={name:"headingAtx",tokenize:Fye,resolve:Lye};function Lye(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Zi(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function Fye(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||oo(u)?(e.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||it(u)?(e.exit("atxHeading"),t(u)):Kt(u)?mn(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||oo(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const jye=["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"],sA=["pre","script","style","textarea"],zye={name:"htmlFlow",tokenize:Wye,resolveTo:Hye,concrete:!0},Bye={tokenize:qye,partial:!0},Vye={tokenize:Uye,partial:!0};function Hye(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 Wye(e,t,n){const r=this;let o,i,a,s,l;return c;function c(I){return u(I)}function u(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),d}function d(I){return I===33?(e.consume(I),h):I===47?(e.consume(I),i=!0,b):I===63?(e.consume(I),o=3,r.interrupt?t:O):Vi(I)?(e.consume(I),a=String.fromCharCode(I),x):n(I)}function h(I){return I===45?(e.consume(I),o=2,p):I===91?(e.consume(I),o=5,s=0,v):Vi(I)?(e.consume(I),o=4,r.interrupt?t:O):n(I)}function p(I){return I===45?(e.consume(I),r.interrupt?t:O):n(I)}function v(I){const te="CDATA[";return I===te.charCodeAt(s++)?(e.consume(I),s===te.length?r.interrupt?t:z:v):n(I)}function b(I){return Vi(I)?(e.consume(I),a=String.fromCharCode(I),x):n(I)}function x(I){if(I===null||I===47||I===62||oo(I)){const te=I===47,ce=a.toLowerCase();return!te&&!i&&sA.includes(ce)?(o=1,r.interrupt?t(I):z(I)):jye.includes(a.toLowerCase())?(o=6,te?(e.consume(I),y):r.interrupt?t(I):z(I)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):i?_(I):S(I))}return I===45||Co(I)?(e.consume(I),a+=String.fromCharCode(I),x):n(I)}function y(I){return I===62?(e.consume(I),r.interrupt?t:z):n(I)}function _(I){return Kt(I)?(e.consume(I),_):L(I)}function S(I){return I===47?(e.consume(I),L):I===58||I===95||Vi(I)?(e.consume(I),C):Kt(I)?(e.consume(I),S):L(I)}function C(I){return I===45||I===46||I===58||I===95||Co(I)?(e.consume(I),C):E(I)}function E(I){return I===61?(e.consume(I),$):Kt(I)?(e.consume(I),E):S(I)}function $(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),l=I,T):Kt(I)?(e.consume(I),$):D(I)}function T(I){return I===l?(e.consume(I),l=null,M):I===null||it(I)?n(I):(e.consume(I),T)}function D(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||oo(I)?E(I):(e.consume(I),D)}function M(I){return I===47||I===62||Kt(I)?S(I):n(I)}function L(I){return I===62?(e.consume(I),F):n(I)}function F(I){return I===null||it(I)?z(I):Kt(I)?(e.consume(I),F):n(I)}function z(I){return I===45&&o===2?(e.consume(I),U):I===60&&o===1?(e.consume(I),V):I===62&&o===4?(e.consume(I),H):I===63&&o===3?(e.consume(I),O):I===93&&o===5?(e.consume(I),q):it(I)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Bye,Y,X)(I)):I===null||it(I)?(e.exit("htmlFlowData"),X(I)):(e.consume(I),z)}function X(I){return e.check(Vye,G,Y)(I)}function G(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),A}function A(I){return I===null||it(I)?X(I):(e.enter("htmlFlowData"),z(I))}function U(I){return I===45?(e.consume(I),O):z(I)}function V(I){return I===47?(e.consume(I),a="",K):z(I)}function K(I){if(I===62){const te=a.toLowerCase();return sA.includes(te)?(e.consume(I),H):z(I)}return Vi(I)&&a.length<8?(e.consume(I),a+=String.fromCharCode(I),K):z(I)}function q(I){return I===93?(e.consume(I),O):z(I)}function O(I){return I===62?(e.consume(I),H):I===45&&o===2?(e.consume(I),O):z(I)}function H(I){return I===null||it(I)?(e.exit("htmlFlowData"),Y(I)):(e.consume(I),H)}function Y(I){return e.exit("htmlFlow"),t(I)}}function Uye(e,t,n){const r=this;return o;function o(a){return it(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function qye(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Cv,t,n)}}const Gye={name:"htmlText",tokenize:Yye};function Yye(e,t,n){const r=this;let o,i,a;return s;function s(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),l}function l(O){return O===33?(e.consume(O),c):O===47?(e.consume(O),E):O===63?(e.consume(O),S):Vi(O)?(e.consume(O),D):n(O)}function c(O){return O===45?(e.consume(O),u):O===91?(e.consume(O),i=0,v):Vi(O)?(e.consume(O),_):n(O)}function u(O){return O===45?(e.consume(O),p):n(O)}function d(O){return O===null?n(O):O===45?(e.consume(O),h):it(O)?(a=d,V(O)):(e.consume(O),d)}function h(O){return O===45?(e.consume(O),p):d(O)}function p(O){return O===62?U(O):O===45?h(O):d(O)}function v(O){const H="CDATA[";return O===H.charCodeAt(i++)?(e.consume(O),i===H.length?b:v):n(O)}function b(O){return O===null?n(O):O===93?(e.consume(O),x):it(O)?(a=b,V(O)):(e.consume(O),b)}function x(O){return O===93?(e.consume(O),y):b(O)}function y(O){return O===62?U(O):O===93?(e.consume(O),y):b(O)}function _(O){return O===null||O===62?U(O):it(O)?(a=_,V(O)):(e.consume(O),_)}function S(O){return O===null?n(O):O===63?(e.consume(O),C):it(O)?(a=S,V(O)):(e.consume(O),S)}function C(O){return O===62?U(O):S(O)}function E(O){return Vi(O)?(e.consume(O),$):n(O)}function $(O){return O===45||Co(O)?(e.consume(O),$):T(O)}function T(O){return it(O)?(a=T,V(O)):Kt(O)?(e.consume(O),T):U(O)}function D(O){return O===45||Co(O)?(e.consume(O),D):O===47||O===62||oo(O)?M(O):n(O)}function M(O){return O===47?(e.consume(O),U):O===58||O===95||Vi(O)?(e.consume(O),L):it(O)?(a=M,V(O)):Kt(O)?(e.consume(O),M):U(O)}function L(O){return O===45||O===46||O===58||O===95||Co(O)?(e.consume(O),L):F(O)}function F(O){return O===61?(e.consume(O),z):it(O)?(a=F,V(O)):Kt(O)?(e.consume(O),F):M(O)}function z(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),o=O,X):it(O)?(a=z,V(O)):Kt(O)?(e.consume(O),z):(e.consume(O),G)}function X(O){return O===o?(e.consume(O),o=void 0,A):O===null?n(O):it(O)?(a=X,V(O)):(e.consume(O),X)}function G(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||oo(O)?M(O):(e.consume(O),G)}function A(O){return O===47||O===62||oo(O)?M(O):n(O)}function U(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function V(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),K}function K(O){return Kt(O)?mn(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):q(O)}function q(O){return e.enter("htmlTextData"),a(O)}}const m2={name:"labelEnd",tokenize:e1e,resolveTo:Zye,resolveAll:Jye},Kye={tokenize:t1e},Xye={tokenize:n1e},Qye={tokenize:r1e};function Jye(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 Zye(e,t){let n=e.length,r=0,o,i,a,s;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(a=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[a][1].end)},u={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[a-2][1].start)};return s=[["enter",l,t],["enter",c,t]],s=Go(s,e.slice(i+1,i+r+3)),s=Go(s,[["enter",u,t]]),s=Go(s,g2(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),s=Go(s,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),s=Go(s,e.slice(a+1)),s=Go(s,[["exit",l,t]]),Zi(e,i,e.length,s),e}function e1e(e,t,n){const r=this;let o=r.events.length,i,a;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return s;function s(h){return i?i._inactive?d(h):(a=r.parser.defined.includes($u(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Kye,u,a?u:d)(h):h===91?e.attempt(Xye,u,a?c:d)(h):a?u(h):d(h)}function c(h){return e.attempt(Qye,u,d)(h)}function u(h){return t(h)}function d(h){return i._balanced=!0,n(h)}}function t1e(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),o}function o(d){return oo(d)?Zf(e,i)(d):i(d)}function i(d){return d===41?u(d):l9(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return oo(d)?Zf(e,l)(d):u(d)}function s(d){return n(d)}function l(d){return d===34||d===39||d===40?u9(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return oo(d)?Zf(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function n1e(e,t,n){const r=this;return o;function o(s){return c9.call(r,e,i,a,"reference","referenceMarker","referenceString")(s)}function i(s){return r.parser.defined.includes($u(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function r1e(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const o1e={name:"labelStartImage",tokenize:i1e,resolveAll:m2.resolveAll};function i1e(e,t,n){const r=this;return o;function o(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),i}function i(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const a1e={name:"labelStartLink",tokenize:s1e,resolveAll:m2.resolveAll};function s1e(e,t,n){const r=this;return o;function o(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Sx={name:"lineEnding",tokenize:l1e};function l1e(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),mn(e,t,"linePrefix")}}const o0={name:"thematicBreak",tokenize:c1e};function c1e(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),a(c)}function a(c){return o=c,s(c)}function s(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||it(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Kt(c)?mn(e,s,"whitespace")(c):s(c))}}const Kr={name:"list",tokenize:f1e,continuation:{tokenize:h1e},exit:g1e},u1e={tokenize:m1e,partial:!0},d1e={tokenize:p1e,partial:!0};function f1e(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,a=0;return s;function s(p){const v=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:nS(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(o0,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 nS(p)&&++a<10?(e.consume(p),l):(!r.interrupt||a<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(Cv,r.interrupt?n:u,e.attempt(u1e,h,d))}function u(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function d(p){return Kt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function h1e(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Cv,o,i);function o(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,mn(e,t,"listItemIndent",r.containerState.size+1)(s)}function i(s){return r.containerState.furtherBlankLines||!Kt(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(d1e,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,mn(e,e.attempt(Kr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function p1e(e,t,n){const r=this;return mn(e,o,"listItemIndent",r.containerState.size+1);function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function g1e(e){e.exit(this.containerState.type)}function m1e(e,t,n){const r=this;return mn(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const a=r.events[r.events.length-1];return!Kt(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const lA={name:"setextUnderline",tokenize:v1e,resolveTo:b1e};function b1e(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=a,e.push(["exit",a,t]),e}function v1e(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),o=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===o?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Kt(c)?mn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||it(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const y1e={tokenize:x1e};function x1e(e){const t=this,n=e.attempt(Cv,r,e.attempt(this.parser.constructs.flowInitial,o,mn(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Eye,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const w1e={resolveAll:f9()},_1e=d9("string"),S1e=d9("text");function d9(e){return{tokenize:t,resolveAll:f9(e==="text"?C1e:void 0)};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,a,s);return a;function a(u){return c(u)?i(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=o[u];let h=-1;if(d)for(;++h<d.length;){const p=d[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function f9(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function C1e(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,a=-1,s=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){i++;break}}if(s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-s,offset:r.end.offset-s,_index:r.start._index+i,_bufferIndex:i?a:r.start._bufferIndex+a},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 E1e(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},i=[];let a=[],s=[];const l={consume:_,enter:S,exit:C,attempt:T(E),check:T($),interrupt:T($,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:h,now:v,defineSkip:b,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(F){return a=Go(a,F),x(),a[a.length-1]!==null?[]:(D(t,0),c.events=g2(i,c.events,c),c.events)}function h(F,z){return P1e(p(F),z)}function p(F){return R1e(a,F)}function v(){const{line:F,column:z,offset:X,_index:G,_bufferIndex:A}=r;return{line:F,column:z,offset:X,_index:G,_bufferIndex:A}}function b(F){o[F.line]=F.column,L()}function x(){let F;for(;r._index<a.length;){const z=a[r._index];if(typeof z=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<z.length;)y(z.charCodeAt(r._bufferIndex));else y(z)}}function y(F){u=u(F)}function _(F){it(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,L()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=F}function S(F,z){const X=z||{};return X.type=F,X.start=v(),c.events.push(["enter",X,c]),s.push(X),X}function C(F){const z=s.pop();return z.end=v(),c.events.push(["exit",z,c]),z}function E(F,z){D(F,z.from)}function $(F,z){z.restore()}function T(F,z){return X;function X(G,A,U){let V,K,q,O;return Array.isArray(G)?Y(G):"tokenize"in G?Y([G]):H(G);function H(de){return he;function he(ie){const re=ie!==null&&de[ie],le=ie!==null&&de.null,xe=[...Array.isArray(re)?re:re?[re]:[],...Array.isArray(le)?le:le?[le]:[]];return Y(xe)(ie)}}function Y(de){return V=de,K=0,de.length===0?U:I(de[K])}function I(de){return he;function he(ie){return O=M(),q=de,de.partial||(c.currentConstruct=de),de.name&&c.parser.constructs.disable.null.includes(de.name)?ce():de.tokenize.call(z?Object.assign(Object.create(c),z):c,l,te,ce)(ie)}}function te(de){return F(q,O),A}function ce(de){return O.restore(),++K<V.length?I(V[K]):U}}}function D(F,z){F.resolveAll&&!i.includes(F)&&i.push(F),F.resolve&&Zi(c.events,z,c.events.length-z,F.resolve(c.events.slice(z),c)),F.resolveTo&&(c.events=F.resolveTo(c.events,c))}function M(){const F=v(),z=c.previous,X=c.currentConstruct,G=c.events.length,A=Array.from(s);return{restore:U,from:G};function U(){r=F,c.previous=z,c.currentConstruct=X,c.events.length=G,s=A,L()}}function L(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function R1e(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}function P1e(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
406
+ `;break}case-3:{a=`\r
407
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&o)continue;a=" ";break}default:a=String.fromCharCode(i)}o=i===-2,r.push(a)}return r.join("")}const $1e={42:Kr,43:Kr,45:Kr,48:Kr,49:Kr,50:Kr,51:Kr,52:Kr,53:Kr,54:Kr,55:Kr,56:Kr,57:Kr,62:o9},O1e={91:Tye},T1e={[-2]:_x,[-1]:_x,32:_x},D1e={35:Nye,42:o0,45:[lA,o0],60:zye,61:lA,95:o0,96:aA,126:aA},A1e={38:a9,92:i9},M1e={[-5]:Sx,[-4]:Sx,[-3]:Sx,33:o1e,38:a9,42:rS,60:[sye,Gye],91:a1e,92:[kye,i9],93:m2,95:rS,96:xye},k1e={null:[rS,w1e]},I1e={null:[42,95]},N1e={null:[]},L1e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:I1e,contentInitial:O1e,disable:N1e,document:$1e,flow:D1e,flowInitial:T1e,insideSpan:k1e,string:A1e,text:M1e},Symbol.toStringTag,{value:"Module"}));function F1e(e){const n=qve([L1e,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(eye),document:o(nye),flow:o(y1e),string:o(_1e),text:o(S1e)};return r;function o(i){return a;function a(s){return E1e(r,i,s)}}}function j1e(e){for(;!s9(e););return e}const cA=/[\0\t\n\r]/g;function z1e(){let e=1,t="",n=!0,r;return o;function o(i,a,s){const l=[];let c,u,d,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(cA.lastIndex=d,c=cA.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){t=i.slice(d);break}if(p===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(i.slice(d,h)),e+=h-d),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const B1e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function V1e(e){return e.replace(B1e,H1e)}function H1e(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return n9(n.slice(i?2:1),i?16:10)}return p2(n)||e}const h9={}.hasOwnProperty;function W1e(e,t,n){return typeof t!="string"&&(n=t,t=void 0),U1e(n)(j1e(F1e(n).document().write(z1e()(e,t,!0))))}function U1e(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Be),autolinkProtocol:M,autolinkEmail:M,atxHeading:i(Ce),blockQuote:i(re),characterEscape:M,characterReference:M,codeFenced:i(le),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(le,a),codeText:i(xe,a),codeTextData:M,data:M,codeFlowValue:M,definition:i(Z),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(ve),hardBreakEscape:i(Oe),hardBreakTrailing:i(Oe),htmlFlow:i(Te,a),htmlFlowData:M,htmlText:i(Te,a),htmlTextData:M,image:i(We),label:a,link:i(Be),listItem:i(Ke),listItemValue:h,listOrdered:i(Ie,d),listUnordered:i(Ie),paragraph:i(dt),reference:I,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Ce),strong:i(Bt),thematicBreak:i(Qt)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:ie,autolinkProtocol:he,blockQuote:l(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:de,codeFenced:l(x),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:v,codeFlowValue:L,codeIndented:l(y),codeText:l(A),codeTextData:L,data:L,definition:l(),definitionDestinationString:C,definitionLabelString:_,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(z),hardBreakTrailing:l(z),htmlFlow:l(X),htmlFlowData:L,htmlText:l(G),htmlTextData:L,image:l(V),label:q,labelText:K,lineEnding:F,link:l(U),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:O,resourceTitleString:H,resource:Y,setextHeading:l(D),setextHeadingLineSequence:T,setextHeadingText:$,strong:l(),thematicBreak:l()}};p9(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(pe){let Re={type:"root",children:[]};const Le={stack:[Re],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},Ge=[];let Ze=-1;for(;++Ze<pe.length;)if(pe[Ze][1].type==="listOrdered"||pe[Ze][1].type==="listUnordered")if(pe[Ze][0]==="enter")Ge.push(Ze);else{const Jt=Ge.pop();Ze=o(pe,Jt,Ze)}for(Ze=-1;++Ze<pe.length;){const Jt=t[pe[Ze][0]];h9.call(Jt,pe[Ze][1].type)&&Jt[pe[Ze][1].type].call(Object.assign({sliceSerialize:pe[Ze][2].sliceSerialize},Le),pe[Ze][1])}if(Le.tokenStack.length>0){const Jt=Le.tokenStack[Le.tokenStack.length-1];(Jt[1]||uA).call(Le,void 0,Jt[0])}for(Re.position={start:hs(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:hs(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Ze=-1;++Ze<t.transforms.length;)Re=t.transforms[Ze](Re)||Re;return Re}function o(pe,Re,Le){let Ge=Re-1,Ze=-1,Jt=!1,ln,rn,En,vn;for(;++Ge<=Le;){const Wt=pe[Ge];switch(Wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Wt[0]==="enter"?Ze++:Ze--,vn=void 0;break}case"lineEndingBlank":{Wt[0]==="enter"&&(ln&&!vn&&!Ze&&!En&&(En=Ge),vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:vn=void 0}if(!Ze&&Wt[0]==="enter"&&Wt[1].type==="listItemPrefix"||Ze===-1&&Wt[0]==="exit"&&(Wt[1].type==="listUnordered"||Wt[1].type==="listOrdered")){if(ln){let dn=Ge;for(rn=void 0;dn--;){const $n=pe[dn];if($n[1].type==="lineEnding"||$n[1].type==="lineEndingBlank"){if($n[0]==="exit")continue;rn&&(pe[rn][1].type="lineEndingBlank",Jt=!0),$n[1].type="lineEnding",rn=dn}else if(!($n[1].type==="linePrefix"||$n[1].type==="blockQuotePrefix"||$n[1].type==="blockQuotePrefixWhitespace"||$n[1].type==="blockQuoteMarker"||$n[1].type==="listItemIndent"))break}En&&(!rn||En<rn)&&(ln._spread=!0),ln.end=Object.assign({},rn?pe[rn][1].start:Wt[1].end),pe.splice(rn||Ge,0,["exit",ln,Wt[2]]),Ge++,Le++}if(Wt[1].type==="listItemPrefix"){const dn={type:"listItem",_spread:!1,start:Object.assign({},Wt[1].start),end:void 0};ln=dn,pe.splice(Ge,0,["enter",dn,Wt[2]]),Ge++,Le++,En=void 0,vn=!0}}}return pe[Re][1]._spread=Jt,Le}function i(pe,Re){return Le;function Le(Ge){s.call(this,pe(Ge),Ge),Re&&Re.call(this,Ge)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(pe,Re,Le){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Re,Le]),pe.position={start:hs(Re.start),end:void 0}}function l(pe){return Re;function Re(Le){pe&&pe.call(this,Le),c.call(this,Le)}}function c(pe,Re){const Le=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==pe.type&&(Re?Re.call(this,pe,Ge[0]):(Ge[1]||uA).call(this,pe,Ge[0]));else throw new Error("Cannot close `"+pe.type+"` ("+Jf({start:pe.start,end:pe.end})+"): it’s not open");Le.position.end=hs(pe.end)}function u(){return Wve(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(pe){if(this.data.expectingFirstListItemValue){const Re=this.stack[this.stack.length-2];Re.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function p(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.lang=pe}function v(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.meta=pe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe.replace(/(\r?\n|\r)$/g,"")}function _(pe){const Re=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Re,Le.identifier=$u(this.sliceSerialize(pe)).toLowerCase()}function S(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.title=pe}function C(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.url=pe}function E(pe){const Re=this.stack[this.stack.length-1];if(!Re.depth){const Le=this.sliceSerialize(pe).length;Re.depth=Le}}function $(){this.data.setextHeadingSlurpLineEnding=!0}function T(pe){const Re=this.stack[this.stack.length-1];Re.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function M(pe){const Le=this.stack[this.stack.length-1].children;let Ge=Le[Le.length-1];(!Ge||Ge.type!=="text")&&(Ge=It(),Ge.position={start:hs(pe.start),end:void 0},Le.push(Ge)),this.stack.push(Ge)}function L(pe){const Re=this.stack.pop();Re.value+=this.sliceSerialize(pe),Re.position.end=hs(pe.end)}function F(pe){const Re=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=Re.children[Re.children.length-1];Le.position.end=hs(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Re.type)&&(M.call(this,pe),L.call(this,pe))}function z(){this.data.atHardBreak=!0}function X(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe}function G(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe}function A(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe}function U(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Re,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function V(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Re,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function K(pe){const Re=this.sliceSerialize(pe),Le=this.stack[this.stack.length-2];Le.label=V1e(Re),Le.identifier=$u(Re).toLowerCase()}function q(){const pe=this.stack[this.stack.length-1],Re=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Ge=pe.children;Le.children=Ge}else Le.alt=Re}function O(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.url=pe}function H(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.title=pe}function Y(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function te(pe){const Re=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Re,Le.identifier=$u(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function ce(pe){this.data.characterReferenceType=pe.type}function de(pe){const Re=this.sliceSerialize(pe),Le=this.data.characterReferenceType;let Ge;Le?(Ge=n9(Re,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=p2(Re);const Ze=this.stack.pop();Ze.value+=Ge,Ze.position.end=hs(pe.end)}function he(pe){L.call(this,pe);const Re=this.stack[this.stack.length-1];Re.url=this.sliceSerialize(pe)}function ie(pe){L.call(this,pe);const Re=this.stack[this.stack.length-1];Re.url="mailto:"+this.sliceSerialize(pe)}function re(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function xe(){return{type:"inlineCode",value:""}}function Z(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ve(){return{type:"emphasis",children:[]}}function Ce(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function Te(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function Be(){return{type:"link",title:null,url:"",children:[]}}function Ie(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function Ke(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function dt(){return{type:"paragraph",children:[]}}function Bt(){return{type:"strong",children:[]}}function It(){return{type:"text",value:""}}function Qt(){return{type:"thematicBreak"}}}function hs(e){return{line:e.line,column:e.column,offset:e.offset}}function p9(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?p9(e,r):q1e(e,r)}}function q1e(e,t){let n;for(n in t)if(h9.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 uA(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Jf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Jf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Jf({start:t.start,end:t.end})+") is still open")}function G1e(e){const t=this;t.parser=n;function n(r){return W1e(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Y1e(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 K1e(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
408
+ `}]}function X1e(e,t){const n=t.value?t.value+`
409
+ `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function Q1e(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function J1e(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Z1e(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Pd(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function exe(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 txe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function g9(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&a.type==="text"?a.value+=r:o.push({type:"text",value:r}),o}function nxe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return g9(e,t);const o={src:Pd(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function rxe(e,t){const n={src:Pd(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 oxe(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 ixe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return g9(e,t);const o={href:Pd(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function axe(e,t){const n={href:Pd(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 sxe(e,t,n){const r=e.all(t),o=n?lxe(n):m9(t),i={},a=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const u=r[s];(o||s!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
410
+ `}),u.type==="element"&&u.tagName==="p"&&!o?a.push(...u.children):a.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
411
+ `});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)}function lxe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=m9(n[r])}return t}function m9(e){const t=e.spread;return t??e.children.length>1}function cxe(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const a=r[o];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function uxe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dxe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function fxe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hxe(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),o.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=u2(t.children[1]),l=K4(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),o.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function pxe(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const d=t.children[l],h={},p=a?a[l]:void 0;p&&(h.align=p);let v={type:"element",tagName:i,properties:h,children:[]};d&&(v.children=e.all(d),e.patch(d,v),v=e.applyData(d,v)),c.push(v)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function gxe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const dA=9,fA=32;function mxe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(hA(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(hA(t.slice(o),o>0,!1)),i.join("")}function hA(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===dA||i===fA;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===dA||i===fA;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function bxe(e,t){const n={type:"text",value:mxe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function vxe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const yxe={blockquote:Y1e,break:K1e,code:X1e,delete:Q1e,emphasis:J1e,footnoteReference:Z1e,heading:exe,html:txe,imageReference:nxe,image:rxe,inlineCode:oxe,linkReference:ixe,link:axe,listItem:sxe,list:cxe,paragraph:uxe,root:dxe,strong:fxe,table:hxe,tableCell:gxe,tableRow:pxe,text:bxe,thematicBreak:vxe,toml:Om,yaml:Om,definition:Om,footnoteDefinition:Om};function Om(){}const b9=-1,Ev=0,rb=1,ob=2,b2=3,v2=4,y2=5,x2=6,v9=7,y9=8,pA=typeof self=="object"?self:globalThis,xxe=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,a]=t[o];switch(i){case Ev:case b9:return n(a,o);case rb:{const s=n([],o);for(const l of a)s.push(r(l));return s}case ob:{const s=n({},o);for(const[l,c]of a)s[r(l)]=r(c);return s}case b2:return n(new Date(a),o);case v2:{const{source:s,flags:l}=a;return n(new RegExp(s,l),o)}case y2:{const s=n(new Map,o);for(const[l,c]of a)s.set(r(l),r(c));return s}case x2:{const s=n(new Set,o);for(const l of a)s.add(r(l));return s}case v9:{const{name:s,message:l}=a;return n(new pA[s](l),o)}case y9:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o)}return n(new pA[i](a),o)};return r},gA=e=>xxe(new Map,e)(0),tu="",{toString:wxe}={},{keys:_xe}=Object,bf=e=>{const t=typeof e;if(t!=="object"||!e)return[Ev,t];const n=wxe.call(e).slice(8,-1);switch(n){case"Array":return[rb,tu];case"Object":return[ob,tu];case"Date":return[b2,tu];case"RegExp":return[v2,tu];case"Map":return[y2,tu];case"Set":return[x2,tu]}return n.includes("Array")?[rb,n]:n.includes("Error")?[v9,n]:[ob,n]},Tm=([e,t])=>e===Ev&&(t==="function"||t==="symbol"),Sxe=(e,t,n,r)=>{const o=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},i=a=>{if(n.has(a))return n.get(a);let[s,l]=bf(a);switch(s){case Ev:{let u=a;switch(l){case"bigint":s=y9,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([b9],a)}return o([s,u],a)}case rb:{if(l)return o([l,[...a]],a);const u=[],d=o([s,u],a);for(const h of a)u.push(i(h));return d}case ob:{if(l)switch(l){case"BigInt":return o([l,a.toString()],a);case"Boolean":case"Number":case"String":return o([l,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const u=[],d=o([s,u],a);for(const h of _xe(a))(e||!Tm(bf(a[h])))&&u.push([i(h),i(a[h])]);return d}case b2:return o([s,a.toISOString()],a);case v2:{const{source:u,flags:d}=a;return o([s,{source:u,flags:d}],a)}case y2:{const u=[],d=o([s,u],a);for(const[h,p]of a)(e||!(Tm(bf(h))||Tm(bf(p))))&&u.push([i(h),i(p)]);return d}case x2:{const u=[],d=o([s,u],a);for(const h of a)(e||!Tm(bf(h)))&&u.push(i(h));return d}}const{message:c}=a;return o([s,{name:l,message:c}],a)};return i},mA=(e,{json:t,lossy:n}={})=>{const r=[];return Sxe(!(t||n),!!t,new Map,r)(e),r},ib=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?gA(mA(e,t)):structuredClone(e):(e,t)=>gA(mA(e,t));function Cxe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Exe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Rxe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Cxe,r=e.options.footnoteBackLabel||Exe,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=Pd(d.toLowerCase());let p=0;const v=[],b=e.footnoteCounts.get(d);for(;b!==void 0&&++p<=b;){v.length>0&&v.push({type:"text",value:" "});let _=typeof n=="string"?n:n(l,p);typeof _=="string"&&(_={type:"text",value:_}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const x=u[u.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const _=x.children[x.children.length-1];_&&_.type==="text"?_.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...v)}else u.push(...v);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,y),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ib(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
412
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
413
+ `}]}}const x9=function(e){if(e==null)return Txe;if(typeof e=="function")return Rv(e);if(typeof e=="object")return Array.isArray(e)?Pxe(e):$xe(e);if(typeof e=="string")return Oxe(e);throw new Error("Expected function, string, or object as test")};function Pxe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=x9(e[n]);return Rv(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function $xe(e){const t=e;return Rv(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function Oxe(e){return Rv(t);function t(n){return n&&n.type===e}}function Rv(e){return t;function t(n,r,o){return!!(Dxe(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function Txe(){return!0}function Dxe(e){return e!==null&&typeof e=="object"&&"type"in e}const w9=[],Axe=!0,bA=!1,Mxe="skip";function kxe(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=x9(o),a=r?-1:1;s(e,void 0,[])();function s(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=w9,v,b,x;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=Ixe(n(l,u)),p[0]===bA))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==Mxe)for(b=(r?y.children.length:-1)+a,x=u.concat(y);b>-1&&b<y.children.length;){const _=y.children[b];if(v=s(_,b,x)(),v[0]===bA)return v;b=typeof v[1]=="number"?v[1]:b+a}}return p}}}function Ixe(e){return Array.isArray(e)?e:typeof e=="number"?[Axe,e]:e==null?w9:[e]}function _9(e,t,n,r){let o,i,a;typeof t=="function"&&typeof n!="function"?(i=void 0,a=t,o=n):(i=t,a=n,o=r),kxe(e,i,s,o);function s(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return a(l,d,u)}}const oS={}.hasOwnProperty,Nxe={};function Lxe(e,t){const n=t||Nxe,r=new Map,o=new Map,i=new Map,a={...yxe,...n.handlers},s={all:c,applyData:jxe,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:l,options:n,patch:Fxe,wrap:Bxe};return _9(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:o,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),s;function l(u,d){const h=u.type,p=s.handlers[h];if(oS.call(s.handlers,h)&&p)return p(s,u,d);if(s.options.passThrough&&s.options.passThrough.includes(h)){if("children"in u){const{children:b,...x}=u,y=ib(x);return y.children=s.all(u),y}return ib(u)}return(s.options.unknownHandler||zxe)(s,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const v=s.one(h[p],u);if(v){if(p&&h[p-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=vA(v.value)),!Array.isArray(v)&&v.type==="element")){const b=v.children[0];b&&b.type==="text"&&(b.value=vA(b.value))}Array.isArray(v)?d.push(...v):d.push(v)}}}return d}}function Fxe(e,t){e.position&&(t.position=xve(e))}function jxe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&i&&Object.assign(n.properties,ib(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function zxe(e,t){const n=t.data||{},r="value"in t&&!(oS.call(n,"hProperties")||oS.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Bxe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
414
+ `});++r<e.length;)r&&n.push({type:"text",value:`
415
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
416
+ `}),n}function vA(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function yA(e,t){const n=Lxe(e,t),r=n.one(e,void 0),o=Rxe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
417
+ `},o),i}function Vxe(e,t){return e&&"run"in e?async function(n,r){const o=yA(n,{file:r,...t});await e.run(o,r)}:function(n,r){return yA(n,{file:r,...t||e})}}function xA(e){if(e)throw e}var i0=Object.prototype.hasOwnProperty,S9=Object.prototype.toString,wA=Object.defineProperty,_A=Object.getOwnPropertyDescriptor,SA=function(t){return typeof Array.isArray=="function"?Array.isArray(t):S9.call(t)==="[object Array]"},CA=function(t){if(!t||S9.call(t)!=="[object Object]")return!1;var n=i0.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&i0.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||i0.call(t,o)},EA=function(t,n){wA&&n.name==="__proto__"?wA(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},RA=function(t,n){if(n==="__proto__")if(i0.call(t,n)){if(_A)return _A(t,n).value}else return;return t[n]},Hxe=function e(){var t,n,r,o,i,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=RA(s,n),o=RA(t,n),s!==o&&(u&&o&&(CA(o)||(i=SA(o)))?(i?(i=!1,a=r&&SA(r)?r:[]):a=r&&CA(r)?r:{},EA(s,{name:n,newValue:e(u,a,o)})):typeof o<"u"&&EA(s,{name:n,newValue:o}));return s};const Cx=mc(Hxe);function iS(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Wxe(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const a=o.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...o);function s(l,...c){const u=e[++i];let d=-1;if(l){a(l);return}for(;++d<o.length;)(c[d]===null||c[d]===void 0)&&(c[d]=o[d]);o=c,u?Uxe(u,s)(...c):a(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function Uxe(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(o);try{l=e.apply(this,a)}catch(c){const u=c;if(s&&n)throw u;return o(u)}s||(l instanceof Promise?l.then(i,o):l instanceof Error?o(l):i(l))}function o(a,...s){n||(n=!0,t(a,...s))}function i(a){o(null,a)}}const Ai={basename:qxe,dirname:Gxe,extname:Yxe,join:Kxe,sep:"/"};function qxe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ap(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else a<0&&(i=!0,a=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(r=o):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Gxe(e){if(Ap(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Yxe(e){Ap(e);let t=e.length,n=-1,r=0,o=-1,i=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function Kxe(...e){let t=-1,n;for(;++t<e.length;)Ap(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Xxe(n)}function Xxe(e){Ap(e);const t=e.codePointAt(0)===47;let n=Qxe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Qxe(e,t){let n="",r=0,o=-1,i=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(o===a-1||i===1))if(o!==a-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=a,i=0;continue}}else if(n.length>0){n="",r=0,o=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),r=a-o-1;o=a,i=0}else s===46&&i>-1?i++:i=-1}return n}function Ap(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Jxe={cwd:Zxe};function Zxe(){return"/"}function aS(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ewe(e){if(typeof e=="string")e=new URL(e);else if(!aS(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return twe(e)}function twe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Ex=["history","path","basename","stem","extname","dirname"];class C9{constructor(t){let n;t?aS(t)?n={path:t}:typeof t=="string"||nwe(t)?n={value:t}:n=t:n={},this.cwd=Jxe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ex.length;){const i=Ex[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)Ex.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Ai.basename(this.path):void 0}set basename(t){Px(t,"basename"),Rx(t,"basename"),this.path=Ai.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ai.dirname(this.path):void 0}set dirname(t){PA(this.basename,"dirname"),this.path=Ai.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ai.extname(this.path):void 0}set extname(t){if(Rx(t,"extname"),PA(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ai.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){aS(t)&&(t=ewe(t)),Px(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ai.basename(this.path,this.extname):void 0}set stem(t){Px(t,"stem"),Rx(t,"stem"),this.path=Ai.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Rr(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Rx(e,t){if(e&&e.includes(Ai.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ai.sep+"`")}function Px(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function PA(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function nwe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rwe=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};Object.setPrototypeOf(i,r);const a=Object.getOwnPropertyNames(o);for(const s of a){const l=Object.getOwnPropertyDescriptor(o,s);l&&Object.defineProperty(i,s,l)}return i},owe={}.hasOwnProperty;class w2 extends rwe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Wxe()}copy(){const t=new w2;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Cx(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Tx("data",this.frozen),this.namespace[t]=n,this):owe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Tx("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Dm(t),r=this.parser||this.Parser;return $x("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),$x("process",this.parser||this.Parser),Ox("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,a){const s=Dm(t),l=r.parse(s);r.run(l,s,function(u,d,h){if(u||!d||!h)return c(u);const p=d,v=r.stringify(p,h);swe(v)?h.value=v:h.result=v,c(u,h)});function c(u,d){u||!d?a(u):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),$x("processSync",this.parser||this.Parser),Ox("processSync",this.compiler||this.Compiler),this.process(t,o),OA("processSync","process",n),r;function o(i,a){n=!0,xA(i),r=a}}run(t,n,r){$A(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(a,s){const l=Dm(n);o.run(t,l,c);function c(u,d,h){const p=d||t;u?s(u):a?a(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),OA("runSync","run",r),o;function i(a,s){xA(a),o=s,r=!0}}stringify(t,n){this.freeze();const r=Dm(n),o=this.compiler||this.Compiler;return Ox("stringify",o),$A(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Tx("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(o.settings=Cx(!0,o.settings,c.settings))}function s(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[p,...v]=u;const b=r[h][1];iS(b)&&iS(p)&&(p=Cx(!0,b,p)),r[h]=[c,p,...v]}}}}const iwe=new w2().freeze();function $x(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ox(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Tx(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function $A(e){if(!iS(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function OA(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Dm(e){return awe(e)?e:new C9(e)}function awe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function swe(e){return typeof e=="string"||lwe(e)}function lwe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cwe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",TA=[],DA={allowDangerousHtml:!0},uwe=/^(https?|ircs?|mailto|xmpp)$/i,dwe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function E9(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,a=e.disallowedElements,s=e.rehypePlugins||TA,l=e.remarkPlugins||TA,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...DA}:DA,u=e.skipHtml,d=e.unwrapDisallowed,h=e.urlTransform||fwe,p=iwe().use(G1e).use(l).use(Vxe,c).use(s),v=new C9;typeof r=="string"&&(v.value=r);for(const _ of dwe)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+cwe+_.id,void 0);const b=p.parse(v);let x=p.runSync(b,v);return o&&(x={type:"element",tagName:"div",properties:{className:o},children:x.type==="root"?x.children:[x]}),_9(x,y),Rve(x,{Fragment:R.Fragment,components:i,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function y(_,S,C){if(_.type==="raw"&&C&&typeof S=="number")return u?C.children.splice(S,1):C.children[S]={type:"text",value:_.value},S;if(_.type==="element"){let E;for(E in wx)if(Object.hasOwn(wx,E)&&Object.hasOwn(_.properties,E)){const $=_.properties[E],T=wx[E];(T===null||T.includes(_.tagName))&&(_.properties[E]=h(String($||""),E,_))}}if(_.type==="element"){let E=t?!t.includes(_.tagName):a?a.includes(_.tagName):!1;if(!E&&n&&typeof S=="number"&&(E=!n(_,S,C)),E&&C&&typeof S=="number")return d&&_.children?C.children.splice(S,1,..._.children):C.children.splice(S,1),S}}}function fwe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t<0||o>-1&&t>o||n>-1&&t>n||r>-1&&t>r||uwe.test(e.slice(0,t))?e:""}function hwe(){const e=m.useRef(null),[t,n]=m.useState(""),[r,o]=m.useState(!1),i=we(M=>M.dashboard.aiScopeTables);Lb();const a=we(M=>M.selectedSheetId),{addFrame:s,setSelectedFrameId:l,setIsDashboardEditing:c}=dr(),{authToken:u}=_i(),d=NS(),{messages:h,input:p,handleInputChange:v,handleSubmit:b,addToolResult:x,stop:y,isLoading:_}=Dbe({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},maxToolRoundtrips:5,async onToolCall({toolCall:M}){if(C(M.toolName),M.toolName==="getLocation"){const L=["New York","Los Angeles","Chicago","San Francisco"];return L[Math.floor(Math.random()*L.length)]}if(M.toolName==="getTables")return JSON.stringify(i||[]);if(M.toolName==="getData"){console.log(M.args);const L=M.args;if(!(L!=null&&L.sql)||!(L!=null&&L.connectionId))return"Please provide sql, connectionId and table";const F=await d.fetchQuery({queryKey:["chat",L.connectionId,L.sql],queryFn:()=>fb("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:L.connectionId,sql:L.sql,cache_config:AS()})});return n("Summarizing"),JSON.stringify(F)}},onFinish(M,L){console.log("onFinish",M,L),M.content&&n("")}}),S=()=>{var M;(M=e.current)==null||M.scrollIntoView({behavior:"smooth"})};m.useEffect(()=>{S()},[h]);function C(M){M==="getTables"&&n("Initializing"),M==="getSchemas"&&n("Analyzing"),M==="getData"&&n("Fetching")}function E(M){const L=M.toolInvocations||[];return L.length===0||L.find(z=>z.toolName==="getData"&&"result"in z)?!0:r}function $(M){return M==null?void 0:M.map(L=>{var z;const F=L.role==="user";return E(L)?R.jsxs("div",{className:ye("relative rounded-md bg-background px-4 py-4 text-sm text-foreground/80",{"bg-muted":F}),children:[R.jsx("div",{className:"space-y-2",children:R.jsxs("div",{className:"flex shrink-0 items-start gap-3",children:[R.jsx("div",{className:"text-muted-foreground",children:F?R.jsx($6,{className:"size-5 shrink-0"}):R.jsx(zw,{className:"size-5 shrink-0"})}),R.jsx("div",{children:R.jsx(E9,{components:pwe,children:L.content})})]})}),(z=L.toolInvocations)==null?void 0:z.map(X=>{const G=X.toolCallId;return"result"in X?R.jsx("div",{children:T(X)},G):R.jsxs("div",{children:["Calling ",X.toolName,"..."]},G)})]},L.id):null})}function T(M){if("result"in M){let L;try{const F=JSON.parse(M.result);if(L=R.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(F,null,2)}),M.toolName==="getData"){const z=JC({cardType:M.args.chartType,data:F.records});return R.jsxs("div",{className:"space-y-2",children:[r&&R.jsxs("div",{children:[R.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${M.toolName}: `,L]}),R.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[R.jsx(no,{onClick:()=>{const X=M.args.chartTitle,G=M.args.connectionId;D({sql:M.args.sql,data:F.records,cardType:M.args.chartType,cardCfg:z,cardTitle:X,connectionId:G})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),z&&R.jsx(IE,{cfg:z})]})]})}}catch{L=R.jsx("span",{children:M.result})}return R.jsxs("div",{children:[R.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${M.toolName}: `,L]})}return`Calling ${M.toolName}...`}function D({sql:M,data:L,cardCfg:F,cardTitle:z,connectionId:X,cardType:G}){if(!a)return;const A={id:Fs(),title:z||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:G==="horizontalBar"?"y":"x"}},type:F.type,cfg:F,sql:M,data:L,connectionId:X},U={id:Fs(),cards:[A],activeCardId:A.id};c(!0),s(a,U,"start"),l(U.id)}return R.jsxs("div",{role:"chat-box",className:"flex h-full grow flex-col justify-between break-words rounded-md bg-muted/30 px-6 py-8",children:[R.jsxs("div",{className:"flex items-center gap-3",children:[R.jsx(Tn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),R.jsxs(Zb,{openDelay:700,children:[R.jsx(ev,{children:R.jsx(E6,{className:"size-4 text-muted-foreground"})}),R.jsx(xp,{className:"w-70",children:R.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[R.jsx(zw,{className:"size-5"}),R.jsxs("div",{className:"space-y-1",children:[R.jsx("p",{className:"text-sm",children:i&&(i==null?void 0:i.length)>0?"I can analyze following datasets":"No datasets in scope"}),R.jsx("div",{className:"space-y-2 pt-2",children:i==null?void 0:i.map((M,L)=>R.jsxs("div",{className:"flex gap-2 text-xs",children:[R.jsx(P6,{className:"size-4 opacity-70"}),R.jsx("span",{children:M.tableName})]},L))})]})]})})]}),!1]}),R.jsx(wp,{className:"my-4"}),R.jsx("div",{className:"",children:R.jsxs("form",{className:"mb-1 flex w-full grow items-center justify-between gap-2 rounded-md",onSubmit:b,children:[R.jsxs("div",{className:"flex w-full items-center justify-between rounded-md border bg-background",children:[R.jsx(Jl,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:p,disabled:_,placeholder:"What can I help you with?",onChange:v}),R.jsx("button",{className:"mr-3",children:R.jsx(h6,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),_&&R.jsx(no,{size:"sm",className:"rounded-full",onClick:()=>y(),children:R.jsx(LQ,{className:"size-2.5 bg-background"})})]})}),R.jsxs(iv,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end",children:[R.jsxs("div",{className:"flex items-center text-xs text-foreground/90",children:[_&&t!==""&&R.jsx(CQ,{className:"size-10 animate-pulse"}),t]}),R.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:$(h)}),R.jsx(av,{orientation:"vertical"})]})]})}const pwe={li:({node:e,...t})=>R.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t}),pre:({node:e,...t})=>R.jsx("pre",{className:"word my-2 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-xs text-foreground/80",...t})},{createElement:ud,createContext:gwe,createRef:p5e,forwardRef:R9,useCallback:go,useContext:P9,useEffect:tc,useImperativeHandle:$9,useLayoutEffect:mwe,useMemo:bwe,useRef:Yo,useState:ab}=j,AA=j.useId,Pv=gwe(null);Pv.displayName="PanelGroupContext";const zh=mwe,vwe=typeof AA=="function"?AA:()=>null;let ywe=0;function _2(e=null){const t=vwe(),n=Yo(e||t||null);return n.current===null&&(n.current=""+ywe++),e??n.current}function O9({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:a,maxSize:s,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:h,style:p,tagName:v="div",...b}){const x=P9(Pv);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:_,getPanelSize:S,getPanelStyle:C,groupId:E,isPanelCollapsed:$,registerPanel:T,resizePanel:D,unregisterPanel:M}=x,L=_2(a),F=Yo({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:s,minSize:l},id:L,idIsFromProps:a!==void 0,order:h});Yo({didLogMissingDefaultSizeWarning:!1}),zh(()=>{const{callbacks:X,constraints:G}=F.current;F.current.id=L,F.current.idIsFromProps=a!==void 0,F.current.order=h,X.onCollapse=c,X.onExpand=u,X.onResize=d,G.collapsedSize=n,G.collapsible=r,G.defaultSize=o,G.maxSize=s,G.minSize=l}),zh(()=>{const X=F.current;return T(X),()=>{M(X)}},[h,L,T,M]),$9(i,()=>({collapse:()=>{y(F.current)},expand:()=>{_(F.current)},getId(){return L},getSize(){return S(F.current)},isCollapsed(){return $(F.current)},isExpanded(){return!$(F.current)},resize:X=>{D(F.current,X)}}),[y,_,S,$,L,D]);const z=C(F.current,o);return ud(v,{...b,children:e,className:t,style:{...z,...p},"data-panel":"","data-panel-id":L,"data-panel-group-id":E,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const T9=R9((e,t)=>ud(O9,{...e,forwardedRef:t}));O9.displayName="Panel";T9.displayName="forwardRef(Panel)";function wt(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const D9=10;function Bh(e,t,n=D9){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function yo(e,t,n){return Bh(e,t,n)===0}function mu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];wt(r!=null);let{collapsedSize:o=0,collapsible:i,maxSize:a=100,minSize:s=0}=r;if(Bh(n,s)<0)if(i){const l=(o+s)/2;Bh(n,l)<0?n=o:n=s}else n=s;return n=Math.min(a,n),n=parseFloat(n.toFixed(D9)),n}function kf({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(yo(e,0))return t;const i=[...t],[a,s]=r;wt(a!=null),wt(s!=null);let l=0;if(o==="keyboard"){{const u=e<0?s:a,d=n[u];if(wt(d),d.collapsible){const h=t[u];wt(h!=null);const p=n[u];wt(p);const{collapsedSize:v=0,minSize:b=0}=p;if(yo(h,v)){const x=b-h;Bh(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const u=e<0?a:s,d=n[u];wt(d);const{collapsible:h}=d;if(h){const p=t[u];wt(p!=null);const v=n[u];wt(v);const{collapsedSize:b=0,minSize:x=0}=v;if(yo(p,x)){const y=p-b;Bh(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}}{const u=e<0?1:-1;let d=e<0?s:a,h=0;for(;;){const v=t[d];wt(v!=null);const x=mu({panelConstraints:n,panelIndex:d,size:100})-v;if(h+=x,d+=u,d<0||d>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-p:p}{let d=e<0?a:s;for(;d>=0&&d<n.length;){const h=Math.abs(e)-Math.abs(l),p=t[d];wt(p!=null);const v=p-h,b=mu({panelConstraints:n,panelIndex:d,size:v});if(!yo(p,b)&&(l+=p-b,i[d]=b,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?d--:d++}}if(yo(l,0))return t;{const u=e<0?s:a,d=t[u];wt(d!=null);const h=d+l,p=mu({panelConstraints:n,panelIndex:u,size:h});if(i[u]=p,!yo(p,h)){let v=h-p,x=e<0?s:a;for(;x>=0&&x<n.length;){const y=i[x];wt(y!=null);const _=y+v,S=mu({panelConstraints:n,panelIndex:x,size:_});if(yo(y,S)||(v-=S-y,i[x]=S),yo(v,0))break;e>0?x--:x++}}}const c=i.reduce((u,d)=>d+u,0);return yo(c,100)?i:t}function xwe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,a=0;const s=n[0];wt(s!=null),t.forEach((d,h)=>{const{constraints:p}=d,{maxSize:v=100,minSize:b=0}=p;h===s?(r=b,o=v):(i+=b,a+=v)});const l=Math.min(o,100-i),c=Math.max(r,100-a),u=e[s];return{valueMax:l,valueMin:c,valueNow:u}}function Vh(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function A9(e,t){const r=Vh(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function M9(e,t){const n=A9(e,t);return n!=null?[n,n+1]:[-1,-1]}function k9(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function $v(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function wwe(e,t,n){var r,o,i,a;const s=$v(t),l=Vh(e),c=s?l.indexOf(s):-1,u=(r=(o=n[c])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,d=(i=(a=n[c+1])===null||a===void 0?void 0:a.id)!==null&&i!==void 0?i:null;return[u,d]}function _we({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){Yo({didWarnAboutMissingResizeHandle:!1}),zh(()=>{const a=Vh(n);for(let s=0;s<o.length-1;s++){const{valueMax:l,valueMin:c,valueNow:u}=xwe({layout:r,panelsArray:o,pivotIndices:[s,s+1]}),d=a[s];if(d!=null){const h=o[s];wt(h),d.setAttribute("aria-controls",h.id),d.setAttribute("aria-valuemax",""+Math.round(l)),d.setAttribute("aria-valuemin",""+Math.round(c)),d.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{a.forEach((s,l)=>{s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")})}},[n,r,o]),tc(()=>{const a=t.current;wt(a);const{panelDataArray:s}=a,l=k9(n);wt(l!=null,`No group found for id "${n}"`);const c=Vh(n);wt(c);const u=c.map(d=>{const h=d.getAttribute("data-panel-resize-handle-id");wt(h);const[p,v]=wwe(n,h,s);if(p==null||v==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const y=s.findIndex(_=>_.id===p);if(y>=0){const _=s[y];wt(_);const S=r[y],{collapsedSize:C=0,collapsible:E,minSize:$=0}=_.constraints;if(S!=null&&E){const T=kf({delta:yo(S,C)?$-C:C-S,layout:r,panelConstraints:s.map(D=>D.constraints),pivotIndices:M9(n,h),trigger:"keyboard"});r!==T&&i(T)}}break}}};return d.addEventListener("keydown",b),()=>{d.removeEventListener("keydown",b)}});return()=>{u.forEach(d=>d())}},[e,t,n,r,o,i])}function MA(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 I9(e){return e.type==="keydown"}function N9(e){return e.type.startsWith("mouse")}function L9(e){return e.type.startsWith("touch")}function F9(e,t){const n=e==="horizontal";if(N9(t))return n?t.clientX:t.clientY;if(L9(t)){const r=t.touches[0];return wt(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function Swe(e,t,n,r){const o=n==="horizontal",i=$v(t);wt(i);const a=i.getAttribute("data-panel-group-id");wt(a);let{initialCursorPosition:s}=r;const l=F9(n,e),c=k9(a);wt(c);const u=c.getBoundingClientRect(),d=o?u.width:u.height;return(l-s)/d*100}function Cwe(e,t,n,r,o){if(I9(e)){const i=n==="horizontal";let a=0;e.shiftKey?a=100:o!=null?a=o:a=10;let s=0;switch(e.key){case"ArrowDown":s=i?0:a;break;case"ArrowLeft":s=i?-a:0;break;case"ArrowRight":s=i?a:0;break;case"ArrowUp":s=i?0:-a;break;case"End":s=100;break;case"Home":s=-100;break}return s}else return r==null?0:Swe(e,t,n,r)}function Ewe({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const a=n[i];wt(a);const{defaultSize:s}=a;s!=null&&(r++,t[i]=s,o-=s)}for(let i=0;i<e.length;i++){const a=n[i];wt(a);const{defaultSize:s}=a;if(s!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function nu(e,t,n){t.forEach((r,o)=>{const i=e[o];wt(i);const{callbacks:a,constraints:s,id:l}=i,{collapsedSize:c=0,collapsible:u}=s,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:h,onExpand:p,onResize:v}=a;v&&v(r,d),u&&(h||p)&&(p&&(d==null||d===c)&&r!==c&&p(),h&&(d==null||d!==c)&&r===c&&h())}})}function Am(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 Rwe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const a=n[o];let s;return a==null?s=e??"1":r.length===1?s="1":s=a.toPrecision(i),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let sS=null,Ml=null;function j9(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 Pwe(){Ml!==null&&(document.head.removeChild(Ml),sS=null,Ml=null)}function Dx(e){if(sS===e)return;sS=e;const t=j9(e);Ml===null&&(Ml=document.createElement("style"),document.head.appendChild(Ml)),Ml.innerHTML=`*{cursor: ${t}!important;}`}function $we(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function kA(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 z9(e){return`react-resizable-panels:${e}`}function B9(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function V9(e,t){try{const n=z9(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Owe(e,t,n){var r,o;const i=(r=V9(e,n))!==null&&r!==void 0?r:{},a=B9(t);return(o=i[a])!==null&&o!==void 0?o:null}function Twe(e,t,n,r,o){var i;const a=z9(e),s=B9(t),l=(i=V9(e,o))!==null&&i!==void 0?i:{};l[s]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(a,JSON.stringify(l))}catch(c){console.error(c)}}function IA({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,a)=>i+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!yo(r,100))for(let i=0;i<t.length;i++){const a=n[i];wt(a!=null);const s=100/r*a;n[i]=s}let o=0;for(let i=0;i<t.length;i++){const a=n[i];wt(a!=null);const s=mu({panelConstraints:t,panelIndex:i,size:a});a!=s&&(o+=a-s,n[i]=s)}if(!yo(o,0))for(let i=0;i<t.length;i++){const a=n[i];wt(a!=null);const s=a+o,l=mu({panelConstraints:t,panelIndex:i,size:s});if(a!==l&&(o-=l-a,n[i]=l,yo(o,0)))break}return n}const Dwe=100,If={getItem:e=>(kA(If),If.getItem(e)),setItem:(e,t)=>{kA(If),If.setItem(e,t)}},NA={};function H9({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:a=null,keyboardResizeBy:s=null,storage:l=If,style:c,tagName:u="div",...d}){const h=_2(i),[p,v]=ab(null),[b,x]=ab([]),y=Yo({}),_=Yo(new Map),S=Yo(0),C=Yo({autoSaveId:e,direction:r,dragState:p,id:h,keyboardResizeBy:s,onLayout:a,storage:l}),E=Yo({layout:b,panelDataArray:[],panelDataArrayChanged:!1});Yo({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),$9(o,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:O}=E.current;return O},setLayout:O=>{const{onLayout:H}=C.current,{layout:Y,panelDataArray:I}=E.current,te=IA({layout:O,panelConstraints:I.map(ce=>ce.constraints)});MA(Y,te)||(x(te),E.current.layout=te,H&&H(te),nu(I,te,y.current))}}),[]),zh(()=>{C.current.autoSaveId=e,C.current.direction=r,C.current.dragState=p,C.current.id=h,C.current.onLayout=a,C.current.storage=l}),_we({committedValuesRef:C,eagerValuesRef:E,groupId:h,layout:b,panelDataArray:E.current.panelDataArray,setLayout:x}),tc(()=>{const{panelDataArray:O}=E.current;if(e){if(b.length===0||b.length!==O.length)return;let H=NA[e];H==null&&(H=$we(Twe,Dwe),NA[e]=H);const Y=[...O],I=new Map(_.current);H(e,Y,I,b,l)}},[e,b,l]),tc(()=>{});const $=go(O=>{const{onLayout:H}=C.current,{layout:Y,panelDataArray:I}=E.current;if(O.constraints.collapsible){const te=I.map(ie=>ie.constraints),{collapsedSize:ce=0,panelSize:de,pivotIndices:he}=ru(I,O,Y);if(wt(de!=null),de!==ce){_.current.set(O.id,de);const re=cu(I,O)===I.length-1?de-ce:ce-de,le=kf({delta:re,layout:Y,panelConstraints:te,pivotIndices:he,trigger:"imperative-api"});Am(Y,le)||(x(le),E.current.layout=le,H&&H(le),nu(I,le,y.current))}}},[]),T=go(O=>{const{onLayout:H}=C.current,{layout:Y,panelDataArray:I}=E.current;if(O.constraints.collapsible){const te=I.map(re=>re.constraints),{collapsedSize:ce=0,panelSize:de,minSize:he=0,pivotIndices:ie}=ru(I,O,Y);if(de===ce){const re=_.current.get(O.id),le=re!=null&&re>=he?re:he,Z=cu(I,O)===I.length-1?de-le:le-de,ve=kf({delta:Z,layout:Y,panelConstraints:te,pivotIndices:ie,trigger:"imperative-api"});Am(Y,ve)||(x(ve),E.current.layout=ve,H&&H(ve),nu(I,ve,y.current))}}},[]),D=go(O=>{const{layout:H,panelDataArray:Y}=E.current,{panelSize:I}=ru(Y,O,H);return wt(I!=null),I},[]),M=go((O,H)=>{const{panelDataArray:Y}=E.current,I=cu(Y,O);return Rwe({defaultSize:H,dragState:p,layout:b,panelData:Y,panelIndex:I})},[p,b]),L=go(O=>{const{layout:H,panelDataArray:Y}=E.current,{collapsedSize:I=0,collapsible:te,panelSize:ce}=ru(Y,O,H);return te===!0&&ce===I},[]),F=go(O=>{const{layout:H,panelDataArray:Y}=E.current,{collapsedSize:I=0,collapsible:te,panelSize:ce}=ru(Y,O,H);return wt(ce!=null),!te||ce>I},[]),z=go(O=>{const{panelDataArray:H}=E.current;H.push(O),H.sort((Y,I)=>{const te=Y.order,ce=I.order;return te==null&&ce==null?0:te==null?-1:ce==null?1:te-ce}),E.current.panelDataArrayChanged=!0},[]);zh(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:O,onLayout:H,storage:Y}=C.current,{layout:I,panelDataArray:te}=E.current;let ce=null;if(O){const he=Owe(O,te,Y);he&&(_.current=new Map(Object.entries(he.expandToSizes)),ce=he.layout)}ce==null&&(ce=Ewe({panelDataArray:te}));const de=IA({layout:ce,panelConstraints:te.map(he=>he.constraints)});MA(I,de)||(x(de),E.current.layout=de,H&&H(de),nu(te,de,y.current))}});const X=go(O=>function(Y){Y.preventDefault();const{direction:I,dragState:te,id:ce,keyboardResizeBy:de,onLayout:he}=C.current,{layout:ie,panelDataArray:re}=E.current,{initialLayout:le}=te??{},xe=M9(ce,O);let Z=Cwe(Y,O,I,te,de);if(Z===0)return;const ve=I==="horizontal";document.dir==="rtl"&&ve&&(Z=-Z);const Ce=re.map(We=>We.constraints),Oe=kf({delta:Z,layout:le??ie,panelConstraints:Ce,pivotIndices:xe,trigger:I9(Y)?"keyboard":"mouse-or-touch"}),Te=!Am(ie,Oe);(N9(Y)||L9(Y))&&S.current!=Z&&(S.current=Z,Dx(Te?ve?"horizontal":"vertical":ve?Z<0?"horizontal-min":"horizontal-max":Z<0?"vertical-min":"vertical-max")),Te&&(x(Oe),E.current.layout=Oe,he&&he(Oe),nu(re,Oe,y.current))},[]),G=go((O,H)=>{const{onLayout:Y}=C.current,{layout:I,panelDataArray:te}=E.current,ce=te.map(xe=>xe.constraints),{panelSize:de,pivotIndices:he}=ru(te,O,I);wt(de!=null);const re=cu(te,O)===te.length-1?de-H:H-de,le=kf({delta:re,layout:I,panelConstraints:ce,pivotIndices:he,trigger:"imperative-api"});Am(I,le)||(x(le),E.current.layout=le,Y&&Y(le),nu(te,le,y.current))},[]),A=go((O,H)=>{const{direction:Y}=C.current,{layout:I}=E.current,te=$v(O);wt(te);const ce=F9(Y,H);v({dragHandleId:O,dragHandleRect:te.getBoundingClientRect(),initialCursorPosition:ce,initialLayout:I})},[]),U=go(()=>{Pwe(),v(null)},[]),V=go(O=>{const{panelDataArray:H}=E.current,Y=cu(H,O);Y>=0&&(H.splice(Y,1),delete y.current[O.id],E.current.panelDataArrayChanged=!0)},[]),K=bwe(()=>({collapsePanel:$,direction:r,dragState:p,expandPanel:T,getPanelSize:D,getPanelStyle:M,groupId:h,isPanelCollapsed:L,isPanelExpanded:F,registerPanel:z,registerResizeHandle:X,resizePanel:G,startDragging:A,stopDragging:U,unregisterPanel:V}),[$,p,r,T,D,M,h,L,F,z,X,G,A,U,V]),q={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return ud(Pv.Provider,{value:K},ud(u,{...d,children:t,className:n,style:{...q,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h}))}const W9=R9((e,t)=>ud(H9,{...e,forwardedRef:t}));H9.displayName="PanelGroup";W9.displayName="forwardRef(PanelGroup)";function cu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function ru(e,t,n){const r=e.map(c=>c.constraints),o=cu(e,t),i=r[o],s=o===e.length-1?[o-1,o]:[o,o+1],l=n[o];return{...i,panelSize:l,pivotIndices:s}}function Awe({disabled:e,handleId:t,resizeHandler:n}){tc(()=>{if(e||n==null)return;const r=$v(t);if(r==null)return;const o=i=>{if(!i.defaultPrevented)switch(i.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{i.preventDefault(),n(i);break}case"F6":{i.preventDefault();const a=r.getAttribute("data-panel-group-id");wt(a);const s=Vh(a),l=A9(a,t);wt(l!==null);const c=i.shiftKey?l>0?l-1:s.length-1:l+1<s.length?l+1:0;s[c].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function S2({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:a=0,tagName:s="div",...l}){const c=Yo(null),u=Yo({onDragging:o});tc(()=>{u.current.onDragging=o});const d=P9(Pv);if(d===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:h,dragState:p,groupId:v,registerResizeHandle:b,startDragging:x,stopDragging:y}=d,_=_2(r),S=(p==null?void 0:p.dragHandleId)===_,[C,E]=ab(!1),[$,T]=ab(null),D=go(()=>{const L=c.current;wt(L),L.blur(),y();const{onDragging:F}=u.current;F&&F(!1)},[y]);tc(()=>{if(n)T(null);else{const L=b(_);T(()=>L)}},[n,_,b]),tc(()=>{if(n||$==null||!S)return;const L=G=>{$(G)},F=G=>{$(G)},z=c.current;wt(z);const X=z.ownerDocument;return X.body.addEventListener("contextmenu",D),X.body.addEventListener("mousemove",L),X.body.addEventListener("touchmove",L),X.body.addEventListener("mouseleave",F),window.addEventListener("mouseup",D),window.addEventListener("touchend",D),()=>{X.body.removeEventListener("contextmenu",D),X.body.removeEventListener("mousemove",L),X.body.removeEventListener("touchmove",L),X.body.removeEventListener("mouseleave",F),window.removeEventListener("mouseup",D),window.removeEventListener("touchend",D)}},[h,n,S,$,D]),Awe({disabled:n,handleId:_,resizeHandler:$});const M={cursor:j9(h),touchAction:"none",userSelect:"none"};return ud(s,{...l,children:e,className:t,onBlur:()=>E(!1),onFocus:()=>E(!0),onMouseDown:L=>{x(_,L.nativeEvent);const F=u.current;wt(F);const{onDragging:z}=F;z&&z(!0)},onMouseUp:D,onTouchCancel:D,onTouchEnd:D,onTouchStart:L=>{x(_,L.nativeEvent);const F=u.current;wt(F);const{onDragging:z}=F;z&&z(!0)},ref:c,role:"separator",style:{...M,...i},tabIndex:a,"data-panel-group-direction":h,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":S?"pointer":C?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}S2.displayName="PanelResizeHandle";const U9=({className:e,...t})=>R.jsx(W9,{className:ye("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),lS=T9,Mwe=({withHandle:e,className:t,...n})=>R.jsx(S2,{className:ye("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&&R.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:R.jsx(_6,{className:"h-2.5 w-2.5"})})}),kwe=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>R.jsx(S2,{className:ye("relative flex w-px items-start justify-end bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",{"justify-start":r},t),...o,children:e&&R.jsx("div",{className:ye("z-50 flex items-center justify-start",{"border-l":r}),children:R.jsx(no,{variant:"secondary",className:ye("h-7 p-1",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-2 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?R.jsx(jb,{className:"size-4"}):R.jsx(pC,{className:"size-4"})})})});function Iwe(e,t=[]){let n=[];function r(i,a){const s=j.createContext(a),l=n.length;n=[...n,a];function c(d){const{scope:h,children:p,...v}=d,b=(h==null?void 0:h[e][l])||s,x=j.useMemo(()=>v,Object.values(v));return R.jsx(b.Provider,{value:x,children:p})}function u(d,h){const p=(h==null?void 0:h[e][l])||s,v=j.useContext(p);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(a=>j.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return j.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,Nwe(o,...t)]}function Nwe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Lwe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Fwe(...e){return t=>e.forEach(n=>Lwe(n,t))}function q9(...e){return j.useCallback(Fwe(...e),e)}function Ns(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function jwe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function zwe(...e){return t=>e.forEach(n=>jwe(n,t))}function Pc(...e){return j.useCallback(zwe(...e),e)}function Bwe(e,t){const n=j.createContext(t);function r(i){const{children:a,...s}=i,l=j.useMemo(()=>s,Object.values(s));return R.jsx(n.Provider,{value:l,children:a})}function o(i){const a=j.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,o]}function Vwe(e,t=[]){let n=[];function r(i,a){const s=j.createContext(a),l=n.length;n=[...n,a];function c(d){const{scope:h,children:p,...v}=d,b=(h==null?void 0:h[e][l])||s,x=j.useMemo(()=>v,Object.values(v));return R.jsx(b.Provider,{value:x,children:p})}function u(d,h){const p=(h==null?void 0:h[e][l])||s,v=j.useContext(p);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(a=>j.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return j.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,Hwe(o,...t)]}function Hwe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var sb=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},Wwe=j.useId||(()=>{}),Uwe=0;function Ax(e){const[t,n]=j.useState(Wwe());return sb(()=>{e||n(r=>r??String(Uwe++))},[e]),e||(t?`radix-${t}`:"")}function hc(e){const t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function qwe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Gwe({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=hc(n),l=j.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function Gwe({defaultProp:e,onChange:t}){const n=j.useState(e),[r]=n,o=j.useRef(r),i=hc(t);return j.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var Ywe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],qa=Ywe.reduce((e,t)=>{const n=j.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?sv:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Kwe(e,t){e&&_S.flushSync(()=>e.dispatchEvent(t))}function Xwe(e,t=globalThis==null?void 0:globalThis.document){const n=hc(e);j.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Qwe="DismissableLayer",cS="dismissableLayer.update",Jwe="dismissableLayer.pointerDownOutside",Zwe="dismissableLayer.focusOutside",LA,G9=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Y9=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=j.useContext(G9),[u,d]=j.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=j.useState({}),v=Pc(t,T=>d(T)),b=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(x),_=u?b.indexOf(u):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,C=_>=y,E=n_e(T=>{const D=T.target,M=[...c.branches].some(L=>L.contains(D));!C||M||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},h),$=r_e(T=>{const D=T.target;[...c.branches].some(L=>L.contains(D))||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},h);return Xwe(T=>{_===c.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},h),j.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(LA=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),FA(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=LA)}},[u,h,n,c]),j.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),FA())},[u,c]),j.useEffect(()=>{const T=()=>p({});return document.addEventListener(cS,T),()=>document.removeEventListener(cS,T)},[]),R.jsx(qa.div,{...l,ref:v,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:Ns(e.onFocusCapture,$.onFocusCapture),onBlurCapture:Ns(e.onBlurCapture,$.onBlurCapture),onPointerDownCapture:Ns(e.onPointerDownCapture,E.onPointerDownCapture)})});Y9.displayName=Qwe;var e_e="DismissableLayerBranch",t_e=j.forwardRef((e,t)=>{const n=j.useContext(G9),r=j.useRef(null),o=Pc(t,r);return j.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),R.jsx(qa.div,{...e,ref:o})});t_e.displayName=e_e;function n_e(e,t=globalThis==null?void 0:globalThis.document){const n=hc(e),r=j.useRef(!1),o=j.useRef(()=>{});return j.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let l=function(){K9(Jwe,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function r_e(e,t=globalThis==null?void 0:globalThis.document){const n=hc(e),r=j.useRef(!1);return j.useEffect(()=>{const o=i=>{i.target&&!r.current&&K9(Zwe,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function FA(){const e=new CustomEvent(cS);document.dispatchEvent(e)}function K9(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Kwe(o,i):o.dispatchEvent(i)}var Mx="focusScope.autoFocusOnMount",kx="focusScope.autoFocusOnUnmount",jA={bubbles:!1,cancelable:!0},o_e="FocusScope",X9=j.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=j.useState(null),c=hc(o),u=hc(i),d=j.useRef(null),h=Pc(t,b=>l(b)),p=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let b=function(S){if(p.paused||!s)return;const C=S.target;s.contains(C)?d.current=C:bs(d.current,{select:!0})},x=function(S){if(p.paused||!s)return;const C=S.relatedTarget;C!==null&&(s.contains(C)||bs(d.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&bs(s)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const _=new MutationObserver(y);return s&&_.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),_.disconnect()}}},[r,s,p.paused]),j.useEffect(()=>{if(s){BA.add(p);const b=document.activeElement;if(!s.contains(b)){const y=new CustomEvent(Mx,jA);s.addEventListener(Mx,c),s.dispatchEvent(y),y.defaultPrevented||(i_e(u_e(Q9(s)),{select:!0}),document.activeElement===b&&bs(s))}return()=>{s.removeEventListener(Mx,c),setTimeout(()=>{const y=new CustomEvent(kx,jA);s.addEventListener(kx,u),s.dispatchEvent(y),y.defaultPrevented||bs(b??document.body,{select:!0}),s.removeEventListener(kx,u),BA.remove(p)},0)}}},[s,c,u,p]);const v=j.useCallback(b=>{if(!n&&!r||p.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,y=document.activeElement;if(x&&y){const _=b.currentTarget,[S,C]=a_e(_);S&&C?!b.shiftKey&&y===C?(b.preventDefault(),n&&bs(S,{select:!0})):b.shiftKey&&y===S&&(b.preventDefault(),n&&bs(C,{select:!0})):y===_&&b.preventDefault()}},[n,r,p.paused]);return R.jsx(qa.div,{tabIndex:-1,...a,ref:h,onKeyDown:v})});X9.displayName=o_e;function i_e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bs(r,{select:t}),document.activeElement!==n)return}function a_e(e){const t=Q9(e),n=zA(t,e),r=zA(t.reverse(),e);return[n,r]}function Q9(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zA(e,t){for(const n of e)if(!s_e(n,{upTo:t}))return n}function s_e(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 l_e(e){return e instanceof HTMLInputElement&&"select"in e}function bs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&l_e(e)&&t&&e.select()}}var BA=c_e();function c_e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=VA(e,t),e.unshift(t)},remove(t){var n;e=VA(e,t),(n=e[0])==null||n.resume()}}}function VA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function u_e(e){return e.filter(t=>t.tagName!=="A")}var d_e="Portal",J9=j.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=j.useState(!1);sb(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?Er.createPortal(R.jsx(qa.div,{...r,ref:t}),a):null});J9.displayName=d_e;function f_e(e,t){return j.useReducer((n,r)=>t[n][r]??n,e)}var Ov=e=>{const{present:t,children:n}=e,r=h_e(t),o=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),i=Pc(r.ref,p_e(o));return typeof n=="function"||r.isPresent?j.cloneElement(o,{ref:i}):null};Ov.displayName="Presence";function h_e(e){const[t,n]=j.useState(),r=j.useRef({}),o=j.useRef(e),i=j.useRef("none"),a=e?"mounted":"unmounted",[s,l]=f_e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const c=Mm(r.current);i.current=s==="mounted"?c:"none"},[s]),sb(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=Mm(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),sb(()=>{if(t){const c=d=>{const p=Mm(r.current).includes(d.animationName);d.target===t&&p&&_S.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Mm(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:j.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Mm(e){return(e==null?void 0:e.animationName)||"none"}function p_e(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ix=0;function g_e(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??HA()),document.body.insertAdjacentElement("beforeend",e[1]??HA()),Ix++,()=>{Ix===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ix--}},[])}function HA(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Z9=PE(),Nx=function(){},Tv=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:Nx,onWheelCapture:Nx,onTouchMoveCapture:Nx}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,p=e.noIsolation,v=e.inert,b=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,_=e.gapMode,S=cv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,E=RE([n,t]),$=Nn(Nn({},S),o);return j.createElement(j.Fragment,null,u&&j.createElement(C,{sideCar:Z9,removeScrollBar:c,shards:d,noIsolation:p,inert:v,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:_}),a?j.cloneElement(j.Children.only(s),Nn(Nn({},$),{ref:E})):j.createElement(y,Nn({},$,{className:l,ref:E}),s))});Tv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Tv.classNames={fullWidth:Ru,zeroRight:Eu};var uS=!1;if(typeof window<"u")try{var km=Object.defineProperty({},"passive",{get:function(){return uS=!0,!0}});window.addEventListener("test",km,km),window.removeEventListener("test",km,km)}catch{uS=!1}var ou=uS?{passive:!1}:!1,m_e=function(e){return e.tagName==="TEXTAREA"},eN=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!m_e(e)&&n[t]==="visible")},b_e=function(e){return eN(e,"overflowY")},v_e=function(e){return eN(e,"overflowX")},WA=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=tN(e,r);if(o){var i=nN(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},y_e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},x_e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},tN=function(e,t){return e==="v"?b_e(t):v_e(t)},nN=function(e,t){return e==="v"?y_e(t):x_e(t)},w_e=function(e,t){return e==="h"&&t==="rtl"?-1:1},__e=function(e,t,n,r,o){var i=w_e(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,h=0;do{var p=nN(e,s),v=p[0],b=p[1],x=p[2],y=b-x-i*v;(v||y)&&tN(e,s)&&(d+=y,h+=v),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(o&&Math.abs(d)<1||!o&&a>d)||!u&&(o&&Math.abs(h)<1||!o&&-a>h))&&(c=!0),c},Im=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},UA=function(e){return[e.deltaX,e.deltaY]},qA=function(e){return e&&"current"in e?e.current:e},S_e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},C_e=function(e){return`
418
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
419
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
420
+ `)},E_e=0,iu=[];function R_e(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),o=j.useState(E_e++)[0],i=j.useState(dv)[0],a=j.useRef(e);j.useEffect(function(){a.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=EE([e.lockRef.current],(e.shards||[]).map(qA),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=j.useCallback(function(b,x){if("touches"in b&&b.touches.length===2)return!a.current.allowPinchZoom;var y=Im(b),_=n.current,S="deltaX"in b?b.deltaX:_[0]-y[0],C="deltaY"in b?b.deltaY:_[1]-y[1],E,$=b.target,T=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in b&&T==="h"&&$.type==="range")return!1;var D=WA(T,$);if(!D)return!0;if(D?E=T:(E=T==="v"?"h":"v",D=WA(T,$)),!D)return!1;if(!r.current&&"changedTouches"in b&&(S||C)&&(r.current=E),!E)return!0;var M=r.current||E;return __e(M,x,b,M==="h"?S:C,!0)},[]),l=j.useCallback(function(b){var x=b;if(!(!iu.length||iu[iu.length-1]!==i)){var y="deltaY"in x?UA(x):Im(x),_=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&S_e(E.delta,y)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var S=(a.current.shards||[]).map(qA).filter(Boolean).filter(function(E){return E.contains(x.target)}),C=S.length>0?s(x,S[0]):!a.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),c=j.useCallback(function(b,x,y,_){var S={name:b,delta:x,target:y,should:_,shadowParent:P_e(y)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=j.useCallback(function(b){n.current=Im(b),r.current=void 0},[]),d=j.useCallback(function(b){c(b.type,UA(b),b.target,s(b,e.lockRef.current))},[]),h=j.useCallback(function(b){c(b.type,Im(b),b.target,s(b,e.lockRef.current))},[]);j.useEffect(function(){return iu.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ou),document.addEventListener("touchmove",l,ou),document.addEventListener("touchstart",u,ou),function(){iu=iu.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,ou),document.removeEventListener("touchmove",l,ou),document.removeEventListener("touchstart",u,ou)}},[]);var p=e.removeScrollBar,v=e.inert;return j.createElement(j.Fragment,null,v?j.createElement(i,{styles:C_e(o)}):null,p?j.createElement(OE,{gapMode:e.gapMode}):null)}function P_e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $_e=$E(Z9,R_e);var rN=j.forwardRef(function(e,t){return j.createElement(Tv,Nn({},e,{ref:t,sideCar:$_e}))});rN.classNames=Tv.classNames;const O_e=rN;var C2="Dialog",[oN,iN]=Vwe(C2),[T_e,Si]=oN(C2),aN=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=j.useRef(null),l=j.useRef(null),[c=!1,u]=qwe({prop:r,defaultProp:o,onChange:i});return R.jsx(T_e,{scope:t,triggerRef:s,contentRef:l,contentId:Ax(),titleId:Ax(),descriptionId:Ax(),open:c,onOpenChange:u,onOpenToggle:j.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};aN.displayName=C2;var sN="DialogTrigger",lN=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Si(sN,n),i=Pc(t,o.triggerRef);return R.jsx(qa.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":P2(o.open),...r,ref:i,onClick:Ns(e.onClick,o.onOpenToggle)})});lN.displayName=sN;var E2="DialogPortal",[D_e,cN]=oN(E2,{forceMount:void 0}),uN=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Si(E2,t);return R.jsx(D_e,{scope:t,forceMount:n,children:j.Children.map(r,a=>R.jsx(Ov,{present:n||i.open,children:R.jsx(J9,{asChild:!0,container:o,children:a})}))})};uN.displayName=E2;var lb="DialogOverlay",dN=j.forwardRef((e,t)=>{const n=cN(lb,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Si(lb,e.__scopeDialog);return i.modal?R.jsx(Ov,{present:r||i.open,children:R.jsx(A_e,{...o,ref:t})}):null});dN.displayName=lb;var A_e=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Si(lb,n);return R.jsx(O_e,{as:sv,allowPinchZoom:!0,shards:[o.contentRef],children:R.jsx(qa.div,{"data-state":P2(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),pc="DialogContent",fN=j.forwardRef((e,t)=>{const n=cN(pc,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Si(pc,e.__scopeDialog);return R.jsx(Ov,{present:r||i.open,children:i.modal?R.jsx(M_e,{...o,ref:t}):R.jsx(k_e,{...o,ref:t})})});fN.displayName=pc;var M_e=j.forwardRef((e,t)=>{const n=Si(pc,e.__scopeDialog),r=j.useRef(null),o=Pc(t,n.contentRef,r);return j.useEffect(()=>{const i=r.current;if(i)return _p(i)},[]),R.jsx(hN,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ns(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ns(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:Ns(e.onFocusOutside,i=>i.preventDefault())})}),k_e=j.forwardRef((e,t)=>{const n=Si(pc,e.__scopeDialog),r=j.useRef(!1),o=j.useRef(!1);return R.jsx(hN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),hN=j.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Si(pc,n),l=j.useRef(null),c=Pc(t,l);return g_e(),R.jsxs(R.Fragment,{children:[R.jsx(X9,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:R.jsx(Y9,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":P2(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),R.jsxs(R.Fragment,{children:[R.jsx(N_e,{titleId:s.titleId}),R.jsx(F_e,{contentRef:l,descriptionId:s.descriptionId})]})]})}),R2="DialogTitle",pN=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Si(R2,n);return R.jsx(qa.h2,{id:o.titleId,...r,ref:t})});pN.displayName=R2;var gN="DialogDescription",mN=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Si(gN,n);return R.jsx(qa.p,{id:o.descriptionId,...r,ref:t})});mN.displayName=gN;var bN="DialogClose",vN=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Si(bN,n);return R.jsx(qa.button,{type:"button",...r,ref:t,onClick:Ns(e.onClick,()=>o.onOpenChange(!1))})});vN.displayName=bN;function P2(e){return e?"open":"closed"}var yN="DialogTitleWarning",[I_e,xN]=Bwe(yN,{contentName:pc,titleName:R2,docsSlug:"dialog"}),N_e=({titleId:e})=>{const t=xN(yN),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
421
+
422
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
423
+
424
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},L_e="DialogDescriptionWarning",F_e=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xN(L_e).contentName}}.`;return j.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},wN=aN,_N=lN,SN=uN,$2=dN,O2=fN,T2=pN,D2=mN,A2=vN;function j_e(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var CN="AlertDialog",[z_e,g5e]=Iwe(CN,[iN]),Ga=iN(),EN=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ga(t);return R.jsx(wN,{...r,...n,modal:!0})};EN.displayName=CN;var B_e="AlertDialogTrigger",V_e=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ga(n);return R.jsx(_N,{...o,...r,ref:t})});V_e.displayName=B_e;var H_e="AlertDialogPortal",RN=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ga(t);return R.jsx(SN,{...r,...n})};RN.displayName=H_e;var W_e="AlertDialogOverlay",PN=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ga(n);return R.jsx($2,{...o,...r,ref:t})});PN.displayName=W_e;var Ou="AlertDialogContent",[U_e,q_e]=z_e(Ou),$N=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=Ga(n),a=j.useRef(null),s=q9(t,a),l=j.useRef(null);return R.jsx(I_e,{contentName:Ou,titleName:ON,docsSlug:"alert-dialog",children:R.jsx(U_e,{scope:n,cancelRef:l,children:R.jsxs(O2,{role:"alertdialog",...i,...o,ref:s,onOpenAutoFocus:j_e(o.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[R.jsx(_I,{children:r}),R.jsx(Y_e,{contentRef:a})]})})})});$N.displayName=Ou;var ON="AlertDialogTitle",TN=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ga(n);return R.jsx(T2,{...o,...r,ref:t})});TN.displayName=ON;var DN="AlertDialogDescription",AN=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ga(n);return R.jsx(D2,{...o,...r,ref:t})});AN.displayName=DN;var G_e="AlertDialogAction",MN=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ga(n);return R.jsx(A2,{...o,...r,ref:t})});MN.displayName=G_e;var kN="AlertDialogCancel",IN=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=q_e(kN,n),i=Ga(n),a=q9(t,o);return R.jsx(A2,{...i,...r,ref:a})});IN.displayName=kN;var Y_e=({contentRef:e})=>{const t=`\`${Ou}\` requires a description for the component to be accessible for screen reader users.
425
+
426
+ You can add a description to the \`${Ou}\` by passing a \`${DN}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
427
+
428
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ou}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
429
+
430
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return j.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},K_e=EN,X_e=RN,NN=PN,LN=$N,FN=MN,jN=IN,zN=TN,BN=AN;const Q_e=K_e,J_e=X_e,VN=j.forwardRef(({className:e,...t},n)=>R.jsx(NN,{className:ye("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));VN.displayName=NN.displayName;const HN=j.forwardRef(({className:e,...t},n)=>R.jsx(J_e,{children:R.jsxs(bc,{children:[R.jsx(VN,{}),R.jsx(LN,{ref:n,className:ye("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]})}));HN.displayName=LN.displayName;const WN=({className:e,...t})=>R.jsx("div",{className:ye("flex flex-col space-y-2 text-center sm:text-left",e),...t});WN.displayName="AlertDialogHeader";const UN=({className:e,...t})=>R.jsx("div",{className:ye("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});UN.displayName="AlertDialogFooter";const qN=j.forwardRef(({className:e,...t},n)=>R.jsx(zN,{ref:n,className:ye("text-lg font-semibold",e),...t}));qN.displayName=zN.displayName;const GN=j.forwardRef(({className:e,...t},n)=>R.jsx(BN,{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));GN.displayName=BN.displayName;const YN=j.forwardRef(({className:e,...t},n)=>R.jsx(FN,{ref:n,className:ye(xh(),e),...t}));YN.displayName=FN.displayName;const KN=j.forwardRef(({className:e,...t},n)=>R.jsx(jN,{ref:n,className:ye(xh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));KN.displayName=jN.displayName;function Z_e({open:e,setOpen:t}){const n=we(i=>i.selectedSheetId),{deleteSheet:r}=dr();function o(){n&&(r(n),t(!1))}return R.jsx(Q_e,{open:e,onOpenChange:t,children:R.jsxs(HN,{children:[R.jsxs(WN,{children:[R.jsx(qN,{children:"Delete Sheet"}),R.jsx(GN,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),R.jsxs(UN,{children:[R.jsx(KN,{children:"Cancel"}),R.jsx(YN,{onClick:o,children:"Delete"})]})]})})}function XN(){var x,y;const[e,t]=m.useState(!1),n=we(_=>{var S;return(S=_.dashboard)==null?void 0:S.sheets}),{showAssistant:r}=_i(),o=m.useRef(null),[i,a]=m.useState(!1),s=we(_=>_.isDashboardEditing),l=we(_=>_.themeStyle);we(_=>_.isVisualEditing);const c=we(_=>_.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:d,addSheet:h}=dr();if(!n)return null;function p(_){var S,C;_?((S=o.current)==null||S.resize(35),a(!0)):(a(!1),(C=o.current)==null||C.resize(0))}function v(){const _={id:Fs(),title:"New Sheet"};h(_)}function b(){return(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)?"hsl(var(--semaphor-muted))":(l==null?void 0:l.canvasTheme)==="clear"?"#fff":l==null?void 0:l.canvasTheme}return R.jsxs(VS,{role:"dashboard-tabs-container",className:ye("relative flex grow flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:_=>{u(_)},value:c||n[0].id,children:[R.jsx("div",{children:(n.length>1||s)&&R.jsxs(Sb,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(_=>{var S,C;return R.jsx(qi,{text:_.title,onSave:E=>d(_.id,E),children:R.jsxs(Cb,{style:{borderRadius:(C=(S=l==null?void 0:l.chart)==null?void 0:S.options)==null?void 0:C.borderRadius},onClick:()=>u(_.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:_.id,children:[_.title,s&&c===_.id&&n.length>1&&R.jsx(md,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},_.id)}),s&&R.jsx("div",{style:{borderRadius:(y=(x=l==null?void 0:l.chart)==null?void 0:x.options)==null?void 0:y.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:v,children:R.jsx(bC,{className:"size-3"})})]})}),R.jsxs(U9,{className:"grow",direction:"horizontal",children:[R.jsx(lS,{children:R.jsx("div",{style:{},children:n==null?void 0:n.map(_=>R.jsx(HS,{style:{backgroundColor:b()},className:ye("mt-0",{}),value:_.id,children:R.jsx(N0e,{sheet:_})},_.id))})}),r===!0&&R.jsxs(R.Fragment,{children:[R.jsx(kwe,{open:i,onTabClick:p,withHandle:!0}),R.jsx(lS,{onResize:_=>{_<1?a(!1):i||a(!0)},defaultSize:0,ref:o,children:R.jsx(hwe,{})})]})]}),R.jsx(Z_e,{open:e,setOpen:t})]})}function QN({children:e}){return R.jsx(dG,{defaultTheme:"system",storageKey:"vite-ui-theme",children:R.jsx(ole,{delayDuration:0,children:e})})}function JN(e){return R.jsx(zb,{FallbackComponent:yC,children:R.jsx(ak,{dashboardProps:e,children:R.jsx(QN,{children:R.jsx(uk,{...e,children:R.jsx(XN,{})})})})})}const ZN=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(tSe);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(dS,ue({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(dS,ue({},r,{ref:t}),n)});ZN.displayName="Slot";const dS=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...nSe(r,n.props),ref:t?Ba(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});dS.displayName="SlotClone";const eSe=({children:e})=>m.createElement(m.Fragment,null,e);function tSe(e){return m.isValidElement(e)&&e.type===eSe}function nSe(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const fS=["Enter"," "],rSe=["ArrowDown","PageUp","Home"],eL=["ArrowUp","PageDown","End"],oSe=[...rSe,...eL],iSe={ltr:[...fS,"ArrowRight"],rtl:[...fS,"ArrowLeft"]},aSe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Dv="Menu",[Hh,sSe,lSe]=_b(Dv),[$c,tL]=hr(Dv,[lSe,oa,gd]),M2=oa(),nL=gd(),[cSe,Oc]=$c(Dv),[uSe,Mp]=$c(Dv),dSe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,s=M2(t),[l,c]=m.useState(null),u=m.useRef(!1),d=Xn(i),h=vc(o);return m.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(mp,s,m.createElement(cSe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c},m.createElement(uSe,{scope:t,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:h,modal:a},r)))},rL=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=M2(n);return m.createElement(bp,ue({},o,r,{ref:t}))}),oL="MenuPortal",[fSe,iL]=$c(oL,{forceMount:void 0}),hSe=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Oc(oL,t);return m.createElement(fSe,{scope:t,forceMount:n},m.createElement(pr,{present:n||i.open},m.createElement(aE,{asChild:!0,container:o},r)))},vi="MenuContent",[pSe,k2]=$c(vi),gSe=m.forwardRef((e,t)=>{const n=iL(vi,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Oc(vi,e.__scopeMenu),a=Mp(vi,e.__scopeMenu);return m.createElement(Hh.Provider,{scope:e.__scopeMenu},m.createElement(pr,{present:r||i.open},m.createElement(Hh.Slot,{scope:e.__scopeMenu},a.modal?m.createElement(mSe,ue({},o,{ref:t})):m.createElement(bSe,ue({},o,{ref:t})))))}),mSe=m.forwardRef((e,t)=>{const n=Oc(vi,e.__scopeMenu),r=m.useRef(null),o=Rt(t,r);return m.useEffect(()=>{const i=r.current;if(i)return _p(i)},[]),m.createElement(I2,ue({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ke(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),bSe=m.forwardRef((e,t)=>{const n=Oc(vi,e.__scopeMenu);return m.createElement(I2,ue({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),I2=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:p,disableOutsideScroll:v,...b}=e,x=Oc(vi,n),y=Mp(vi,n),_=M2(n),S=nL(n),C=sSe(n),[E,$]=m.useState(null),T=m.useRef(null),D=Rt(t,T,x.onContentChange),M=m.useRef(0),L=m.useRef(""),F=m.useRef(0),z=m.useRef(null),X=m.useRef("right"),G=m.useRef(0),A=v?TE:m.Fragment,U=v?{as:ZN,allowPinchZoom:!0}:void 0,V=q=>{var O,H;const Y=L.current+q,I=C().filter(re=>!re.disabled),te=document.activeElement,ce=(O=I.find(re=>re.ref.current===te))===null||O===void 0?void 0:O.textValue,de=I.map(re=>re.textValue),he=NSe(de,Y,ce),ie=(H=I.find(re=>re.textValue===he))===null||H===void 0?void 0:H.ref.current;(function re(le){L.current=le,window.clearTimeout(M.current),le!==""&&(M.current=window.setTimeout(()=>re(""),1e3))})(Y),ie&&setTimeout(()=>ie.focus())};m.useEffect(()=>()=>window.clearTimeout(M.current),[]),SE();const K=m.useCallback(q=>{var O,H;return X.current===((O=z.current)===null||O===void 0?void 0:O.side)&&FSe(q,(H=z.current)===null||H===void 0?void 0:H.area)},[]);return m.createElement(pSe,{scope:n,searchRef:L,onItemEnter:m.useCallback(q=>{K(q)&&q.preventDefault()},[K]),onItemLeave:m.useCallback(q=>{var O;K(q)||((O=T.current)===null||O===void 0||O.focus(),$(null))},[K]),onTriggerLeave:m.useCallback(q=>{K(q)&&q.preventDefault()},[K]),pointerGraceTimerRef:F,onPointerGraceIntentChange:m.useCallback(q=>{z.current=q},[])},m.createElement(A,U,m.createElement(CE,{asChild:!0,trapped:o,onMountAutoFocus:ke(i,q=>{var O;q.preventDefault(),(O=T.current)===null||O===void 0||O.focus()}),onUnmountAutoFocus:a},m.createElement(yp,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:p},m.createElement(jS,ue({asChild:!0},S,{dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:$,onEntryFocus:ke(l,q=>{y.isUsingKeyboardRef.current||q.preventDefault()})}),m.createElement(vp,ue({role:"menu","aria-orientation":"vertical","data-state":uL(x.open),"data-radix-menu-content":"",dir:y.dir},_,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:ke(b.onKeyDown,q=>{const H=q.target.closest("[data-radix-menu-content]")===q.currentTarget,Y=q.ctrlKey||q.altKey||q.metaKey,I=q.key.length===1;H&&(q.key==="Tab"&&q.preventDefault(),!Y&&I&&V(q.key));const te=T.current;if(q.target!==te||!oSe.includes(q.key))return;q.preventDefault();const de=C().filter(he=>!he.disabled).map(he=>he.ref.current);eL.includes(q.key)&&de.reverse(),kSe(de)}),onBlur:ke(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(M.current),L.current="")}),onPointerMove:ke(e.onPointerMove,Wh(q=>{const O=q.target,H=G.current!==q.clientX;if(q.currentTarget.contains(O)&&H){const Y=q.clientX>G.current?"right":"left";X.current=Y,G.current=q.clientX}}))})))))))}),vSe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,ue({role:"group"},r,{ref:t}))}),ySe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,ue({},r,{ref:t}))}),hS="MenuItem",GA="menu.itemSelect",N2=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),a=Mp(hS,e.__scopeMenu),s=k2(hS,e.__scopeMenu),l=Rt(t,i),c=m.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const h=new CustomEvent(GA,{bubbles:!0,cancelable:!0});d.addEventListener(GA,p=>r==null?void 0:r(p),{once:!0}),fk(d,h),h.defaultPrevented?c.current=!1:a.onClose()}};return m.createElement(aL,ue({},o,{ref:l,disabled:n,onClick:ke(e.onClick,u),onPointerDown:d=>{var h;(h=e.onPointerDown)===null||h===void 0||h.call(e,d),c.current=!0},onPointerUp:ke(e.onPointerUp,d=>{var h;c.current||(h=d.currentTarget)===null||h===void 0||h.click()}),onKeyDown:ke(e.onKeyDown,d=>{const h=s.searchRef.current!=="";n||h&&d.key===" "||fS.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})}))}),aL=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=k2(hS,n),s=nL(n),l=m.useRef(null),c=Rt(t,l),[u,d]=m.useState(!1),[h,p]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var b;p(((b=v.textContent)!==null&&b!==void 0?b:"").trim())}},[i.children]),m.createElement(Hh.ItemSlot,{scope:n,disabled:r,textValue:o??h},m.createElement(zS,ue({asChild:!0},s,{focusable:!r}),m.createElement(Qe.div,ue({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:ke(e.onPointerMove,Wh(v=>{r?a.onItemLeave(v):(a.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:ke(e.onPointerLeave,Wh(v=>a.onItemLeave(v))),onFocus:ke(e.onFocus,()=>d(!0)),onBlur:ke(e.onBlur,()=>d(!1))}))))}),xSe=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(lL,{scope:e.__scopeMenu,checked:n},m.createElement(N2,ue({role:"menuitemcheckbox","aria-checked":cb(n)?"mixed":n},o,{ref:t,"data-state":L2(n),onSelect:ke(o.onSelect,()=>r==null?void 0:r(cb(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),wSe="MenuRadioGroup",[_Se,SSe]=$c(wSe,{value:void 0,onValueChange:()=>{}}),CSe=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Xn(r);return m.createElement(_Se,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(vSe,ue({},o,{ref:t})))}),ESe="MenuRadioItem",RSe=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=SSe(ESe,e.__scopeMenu),i=n===o.value;return m.createElement(lL,{scope:e.__scopeMenu,checked:i},m.createElement(N2,ue({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":L2(i),onSelect:ke(r.onSelect,()=>{var a;return(a=o.onValueChange)===null||a===void 0?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})))}),sL="MenuItemIndicator",[lL,PSe]=$c(sL,{checked:!1}),$Se=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=PSe(sL,n);return m.createElement(pr,{present:r||cb(i.checked)||i.checked===!0},m.createElement(Qe.span,ue({},o,{ref:t,"data-state":L2(i.checked)})))}),OSe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,ue({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),TSe="MenuSub",[m5e,cL]=$c(TSe),Nm="MenuSubTrigger",DSe=m.forwardRef((e,t)=>{const n=Oc(Nm,e.__scopeMenu),r=Mp(Nm,e.__scopeMenu),o=cL(Nm,e.__scopeMenu),i=k2(Nm,e.__scopeMenu),a=m.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),m.createElement(rL,ue({asChild:!0},c),m.createElement(aL,ue({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":uL(n.open)},e,{ref:Ba(t,o.onTriggerChange),onClick:d=>{var h;(h=e.onClick)===null||h===void 0||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ke(e.onPointerMove,Wh(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:ke(e.onPointerLeave,Wh(d=>{var h;u();const p=(h=n.content)===null||h===void 0?void 0:h.getBoundingClientRect();if(p){var v;const b=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=b==="right",y=x?-5:5,_=p[x?"left":"right"],S=p[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:_,y:p.top},{x:S,y:p.top},{x:S,y:p.bottom},{x:_,y:p.bottom}],side:b}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ke(e.onKeyDown,d=>{const h=i.searchRef.current!=="";if(!(e.disabled||h&&d.key===" ")&&iSe[r.dir].includes(d.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),d.preventDefault()}})})))}),ASe="MenuSubContent",MSe=m.forwardRef((e,t)=>{const n=iL(vi,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Oc(vi,e.__scopeMenu),a=Mp(vi,e.__scopeMenu),s=cL(ASe,e.__scopeMenu),l=m.useRef(null),c=Rt(t,l);return m.createElement(Hh.Provider,{scope:e.__scopeMenu},m.createElement(pr,{present:r||i.open},m.createElement(Hh.Slot,{scope:e.__scopeMenu},m.createElement(I2,ue({id:s.contentId,"aria-labelledby":s.triggerId},o,{ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)===null||d===void 0||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:ke(e.onFocusOutside,u=>{u.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ke(e.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:ke(e.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),h=aSe[a.dir].includes(u.key);if(d&&h){var p;i.onOpenChange(!1),(p=s.trigger)===null||p===void 0||p.focus(),u.preventDefault()}})})))))});function uL(e){return e?"open":"closed"}function cb(e){return e==="indeterminate"}function L2(e){return cb(e)?"indeterminate":e?"checked":"unchecked"}function kSe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ISe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function NSe(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=ISe(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function LSe(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i].x,l=t[i].y,c=t[a].x,u=t[a].y;l>r!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function FSe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return LSe(n,t)}function Wh(e){return t=>t.pointerType==="mouse"?e(t):void 0}const jSe=dSe,zSe=rL,BSe=hSe,VSe=gSe,HSe=ySe,WSe=N2,USe=xSe,qSe=CSe,GSe=RSe,YSe=$Se,KSe=OSe,XSe=DSe,QSe=MSe,dL="DropdownMenu",[JSe,b5e]=hr(dL,[tL]),Mo=tL(),[ZSe,fL]=JSe(dL),eCe=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,l=Mo(t),c=m.useRef(null),[u=!1,d]=Fr({prop:o,defaultProp:i,onChange:a});return m.createElement(ZSe,{scope:t,triggerId:yi(),triggerRef:c,contentId:yi(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(h=>!h),[d]),modal:s},m.createElement(jSe,ue({},l,{open:u,onOpenChange:d,dir:r,modal:s}),n))},tCe="DropdownMenuTrigger",nCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=fL(tCe,n),a=Mo(n);return m.createElement(zSe,ue({asChild:!0},a),m.createElement(Qe.button,ue({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:Ba(t,i.triggerRef),onPointerDown:ke(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:ke(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})))}),rCe=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Mo(t);return m.createElement(BSe,ue({},r,n))},oCe="DropdownMenuContent",iCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=fL(oCe,n),i=Mo(n),a=m.useRef(!1);return m.createElement(VSe,ue({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:ke(e.onCloseAutoFocus,s=>{var l;a.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:ke(e.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(a.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)"}}))}),aCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mo(n);return m.createElement(HSe,ue({},o,r,{ref:t}))}),sCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mo(n);return m.createElement(WSe,ue({},o,r,{ref:t}))}),lCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mo(n);return m.createElement(USe,ue({},o,r,{ref:t}))}),cCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mo(n);return m.createElement(qSe,ue({},o,r,{ref:t}))}),uCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mo(n);return m.createElement(GSe,ue({},o,r,{ref:t}))}),dCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mo(n);return m.createElement(YSe,ue({},o,r,{ref:t}))}),fCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mo(n);return m.createElement(KSe,ue({},o,r,{ref:t}))}),hCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mo(n);return m.createElement(XSe,ue({},o,r,{ref:t}))}),pCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mo(n);return m.createElement(QSe,ue({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),gCe=eCe,mCe=nCe,bCe=rCe,hL=iCe,pL=aCe,gL=sCe,mL=lCe,vCe=cCe,bL=uCe,vL=dCe,yL=fCe,xL=hCe,wL=pCe,yCe=gCe,xCe=mCe,wCe=vCe,_Ce=j.forwardRef(({className:e,inset:t,children:n,...r},o)=>R.jsxs(xL,{ref:o,className:ye("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,R.jsx(jb,{className:"ml-auto h-4 w-4"})]}));_Ce.displayName=xL.displayName;const SCe=j.forwardRef(({className:e,...t},n)=>R.jsx(bc,{children:R.jsx(wL,{ref:n,className:ye("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})}));SCe.displayName=wL.displayName;const _L=j.forwardRef(({className:e,sideOffset:t=4,...n},r)=>R.jsx(bCe,{children:R.jsx(bc,{children:R.jsx(hL,{ref:r,sideOffset:t,className:ye("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})})}));_L.displayName=hL.displayName;const SL=j.forwardRef(({className:e,inset:t,...n},r)=>R.jsx(gL,{ref:r,className:ye("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}));SL.displayName=gL.displayName;const CL=j.forwardRef(({className:e,children:t,checked:n,...r},o)=>R.jsxs(mL,{ref:o,className:ye("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:[R.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:R.jsx(vL,{children:R.jsx(up,{className:"h-4 w-4"})})}),t]}));CL.displayName=mL.displayName;const EL=j.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(bL,{ref:r,className:ye("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:[R.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:R.jsx(vL,{children:R.jsx(gC,{className:"h-2 w-2 fill-current"})})}),t]}));EL.displayName=bL.displayName;const RL=j.forwardRef(({className:e,inset:t,...n},r)=>R.jsx(pL,{ref:r,className:ye("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));RL.displayName=pL.displayName;const PL=j.forwardRef(({className:e,...t},n)=>R.jsx(yL,{ref:n,className:ye("-mx-1 my-1 h-px bg-muted",e),...t}));PL.displayName=yL.displayName;const CCe=wN,ECe=_N,RCe=SN,$L=j.forwardRef(({className:e,...t},n)=>R.jsx($2,{ref:n,className:ye("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}));$L.displayName=$2.displayName;const OL=j.forwardRef(({className:e,children:t,...n},r)=>R.jsx(RCe,{children:R.jsxs(bc,{children:[R.jsx($L,{}),R.jsxs(O2,{ref:r,className:ye("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,R.jsxs(A2,{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:[R.jsx(md,{className:"h-4 w-4"}),R.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));OL.displayName=O2.displayName;const TL=({className:e,...t})=>R.jsx("div",{className:ye("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});TL.displayName="DialogHeader";const DL=({className:e,...t})=>R.jsx("div",{className:ye("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});DL.displayName="DialogFooter";const AL=j.forwardRef(({className:e,...t},n)=>R.jsx(T2,{ref:n,className:ye("text-lg font-semibold leading-none tracking-tight",e),...t}));AL.displayName=T2.displayName;const ML=j.forwardRef(({className:e,...t},n)=>R.jsx(D2,{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));ML.displayName=D2.displayName;const kL=m.forwardRef(({className:e,...t},n)=>R.jsx("div",{role:"editor-panel",ref:n,className:ye("flex grow h-full",e),...t}));kL.displayName="EditorPanel";const IL=m.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:ye(" flex flex-col space-y-2 w-[270px]",e),...t}));IL.displayName="EditorAside";const NL=m.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:ye(" grow",e),...t}));NL.displayName="EditorMain";function PCe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function KA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YA(Object(n),!0).forEach(function(r){PCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Ce(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function OCe(e,t){if(e==null)return{};var n=$Ce(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TCe(e,t){return DCe(e)||ACe(e,t)||MCe(e,t)||kCe()}function DCe(e){if(Array.isArray(e))return e}function ACe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(o)throw i}}return n}}function MCe(e,t){if(e){if(typeof e=="string")return XA(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 XA(e,t)}}function XA(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 kCe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
431
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ICe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function JA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QA(Object(n),!0).forEach(function(r){ICe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NCe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,i){return i(o)},r)}}function Nf(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return t.apply(n,[].concat(o,s))}}}function ub(e){return{}.toString.call(e).includes("Object")}function LCe(e){return!Object.keys(e).length}function Uh(e){return typeof e=="function"}function FCe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function jCe(e,t){return ub(t)||Ls("changeType"),Object.keys(t).some(function(n){return!FCe(e,n)})&&Ls("changeField"),t}function zCe(e){Uh(e)||Ls("selectorType")}function BCe(e){Uh(e)||ub(e)||Ls("handlerType"),ub(e)&&Object.values(e).some(function(t){return!Uh(t)})&&Ls("handlersType")}function VCe(e){e||Ls("initialIsRequired"),ub(e)||Ls("initialType"),LCe(e)&&Ls("initialContent")}function HCe(e,t){throw new Error(e[t]||e.default)}var WCe={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"},Ls=Nf(HCe)(WCe),Lm={changes:jCe,selector:zCe,handler:BCe,initial:VCe};function UCe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Lm.initial(e),Lm.handler(t);var n={current:e},r=Nf(YCe)(n,t),o=Nf(GCe)(n),i=Nf(Lm.changes)(e),a=Nf(qCe)(n);function s(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return Lm.selector(c),c(n.current)}function l(c){NCe(r,o,i,a)(c)}return[s,l]}function qCe(e,t){return Uh(t)?t(e.current):t}function GCe(e,t){return e.current=JA(JA({},e.current),t),t}function YCe(e,t,n){return Uh(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var KCe={create:UCe},XCe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function QCe(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return t.apply(n,[].concat(o,s))}}}function JCe(e){return{}.toString.call(e).includes("Object")}function ZCe(e){return e||ZA("configIsRequired"),JCe(e)||ZA("configType"),e.urls?(eEe(),{paths:{vs:e.urls.monacoBase}}):e}function eEe(){console.warn(LL.deprecation)}function tEe(e,t){throw new Error(e[t]||e.default)}var LL={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
432
+ You are using deprecated way of configuration.
433
+
434
+ Instead of using
435
+ monaco.config({ urls: { monacoBase: '...' } })
436
+ use
437
+ monaco.config({ paths: { vs: '...' } })
438
+
439
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
440
+ `},ZA=QCe(tEe)(LL),nEe={config:ZCe},rEe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,a){return a(i)},o)}};function FL(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],FL(e[n],t[n]))}),KA(KA({},e),t)}var oEe={type:"cancelation",msg:"operation is manually canceled"};function Lx(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(oEe):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var iEe=KCe.create({config:XCe,isInitialized:!1,resolve:null,reject:null,monaco:null}),jL=TCe(iEe,2),kp=jL[0],Av=jL[1];function aEe(e){var t=nEe.config(e),n=t.monaco,r=OCe(t,["monaco"]);Av(function(o){return{config:FL(o.config,r),monaco:n}})}function sEe(){var e=kp(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Av({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Lx(Fx);if(window.monaco&&window.monaco.editor)return zL(window.monaco),e.resolve(window.monaco),Lx(Fx);rEe(lEe,uEe)(dEe)}return Lx(Fx)}function lEe(e){return document.body.appendChild(e)}function cEe(e){var t=document.createElement("script");return e&&(t.src=e),t}function uEe(e){var t=kp(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=cEe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function dEe(){var e=kp(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){zL(n),e.resolve(n)},function(n){e.reject(n)})}function zL(e){kp().monaco||Av({monaco:e})}function fEe(){return kp(function(e){var t=e.monaco;return t})}var Fx=new Promise(function(e,t){return Av({resolve:e,reject:t})}),BL={config:aEe,init:sEe,__getMonacoInstance:fEe},hEe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},jx=hEe,pEe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},gEe=pEe;function mEe({children:e}){return m.createElement("div",{style:gEe.container},e)}var bEe=mEe,vEe=bEe;function yEe({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:a}){return m.createElement("section",{style:{...jx.wrapper,width:e,height:t},...a},!n&&m.createElement(vEe,null,r),m.createElement("div",{ref:o,style:{...jx.fullWidth,...!n&&jx.hide},className:i}))}var xEe=yEe,VL=m.memo(xEe);function wEe(e){m.useEffect(e,[])}var HL=wEe;function _Ee(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var wo=_Ee;function eh(){}function bu(e,t,n,r){return SEe(e,r)||CEe(e,t,n,r)}function SEe(e,t){return e.editor.getModel(WL(e,t))}function CEe(e,t,n,r){return e.editor.createModel(t,n,r?WL(e,r):void 0)}function WL(e,t){return e.Uri.parse(t)}function EEe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:a,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:h="100%",width:p="100%",className:v,wrapperProps:b={},beforeMount:x=eh,onMount:y=eh}){let[_,S]=m.useState(!1),[C,E]=m.useState(!0),$=m.useRef(null),T=m.useRef(null),D=m.useRef(null),M=m.useRef(y),L=m.useRef(x),F=m.useRef(!1);HL(()=>{let A=BL.init();return A.then(U=>(T.current=U)&&E(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>$.current?G():A.cancel()}),wo(()=>{if($.current&&T.current){let A=$.current.getOriginalEditor(),U=bu(T.current,e||"",r||n||"text",i||"");U!==A.getModel()&&A.setModel(U)}},[i],_),wo(()=>{if($.current&&T.current){let A=$.current.getModifiedEditor(),U=bu(T.current,t||"",o||n||"text",a||"");U!==A.getModel()&&A.setModel(U)}},[a],_),wo(()=>{let A=$.current.getModifiedEditor();A.getOption(T.current.editor.EditorOption.readOnly)?A.setValue(t||""):t!==A.getValue()&&(A.executeEdits("",[{range:A.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),A.pushUndoStop())},[t],_),wo(()=>{var A,U;(U=(A=$.current)==null?void 0:A.getModel())==null||U.original.setValue(e||"")},[e],_),wo(()=>{let{original:A,modified:U}=$.current.getModel();T.current.editor.setModelLanguage(A,r||n||"text"),T.current.editor.setModelLanguage(U,o||n||"text")},[n,r,o],_),wo(()=>{var A;(A=T.current)==null||A.editor.setTheme(c)},[c],_),wo(()=>{var A;(A=$.current)==null||A.updateOptions(d)},[d],_);let z=m.useCallback(()=>{var V;if(!T.current)return;L.current(T.current);let A=bu(T.current,e||"",r||n||"text",i||""),U=bu(T.current,t||"",o||n||"text",a||"");(V=$.current)==null||V.setModel({original:A,modified:U})},[n,t,o,e,r,i,a]),X=m.useCallback(()=>{var A;!F.current&&D.current&&($.current=T.current.editor.createDiffEditor(D.current,{automaticLayout:!0,...d}),z(),(A=T.current)==null||A.editor.setTheme(c),S(!0),F.current=!0)},[d,c,z]);m.useEffect(()=>{_&&M.current($.current,T.current)},[_]),m.useEffect(()=>{!C&&!_&&X()},[C,_,X]);function G(){var U,V,K,q;let A=(U=$.current)==null?void 0:U.getModel();s||((V=A==null?void 0:A.original)==null||V.dispose()),l||((K=A==null?void 0:A.modified)==null||K.dispose()),(q=$.current)==null||q.dispose()}return m.createElement(VL,{width:p,height:h,isEditorReady:_,loading:u,_ref:D,className:v,wrapperProps:b})}var REe=EEe;m.memo(REe);function PEe(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var $Ee=PEe,Fm=new Map;function OEe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:a="light",line:s,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:h=!1,width:p="100%",height:v="100%",className:b,wrapperProps:x={},beforeMount:y=eh,onMount:_=eh,onChange:S,onValidate:C=eh}){let[E,$]=m.useState(!1),[T,D]=m.useState(!0),M=m.useRef(null),L=m.useRef(null),F=m.useRef(null),z=m.useRef(_),X=m.useRef(y),G=m.useRef(),A=m.useRef(r),U=$Ee(i),V=m.useRef(!1),K=m.useRef(!1);HL(()=>{let H=BL.init();return H.then(Y=>(M.current=Y)&&D(!1)).catch(Y=>(Y==null?void 0:Y.type)!=="cancelation"&&console.error("Monaco initialization: error:",Y)),()=>L.current?O():H.cancel()}),wo(()=>{var Y,I,te,ce;let H=bu(M.current,e||r||"",t||o||"",i||n||"");H!==((Y=L.current)==null?void 0:Y.getModel())&&(d&&Fm.set(U,(I=L.current)==null?void 0:I.saveViewState()),(te=L.current)==null||te.setModel(H),d&&((ce=L.current)==null||ce.restoreViewState(Fm.get(i))))},[i],E),wo(()=>{var H;(H=L.current)==null||H.updateOptions(c)},[c],E),wo(()=>{!L.current||r===void 0||(L.current.getOption(M.current.editor.EditorOption.readOnly)?L.current.setValue(r):r!==L.current.getValue()&&(K.current=!0,L.current.executeEdits("",[{range:L.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),L.current.pushUndoStop(),K.current=!1))},[r],E),wo(()=>{var Y,I;let H=(Y=L.current)==null?void 0:Y.getModel();H&&o&&((I=M.current)==null||I.editor.setModelLanguage(H,o))},[o],E),wo(()=>{var H;s!==void 0&&((H=L.current)==null||H.revealLine(s))},[s],E),wo(()=>{var H;(H=M.current)==null||H.editor.setTheme(a)},[a],E);let q=m.useCallback(()=>{var H;if(!(!F.current||!M.current)&&!V.current){X.current(M.current);let Y=i||n,I=bu(M.current,r||e||"",t||o||"",Y||"");L.current=(H=M.current)==null?void 0:H.editor.create(F.current,{model:I,automaticLayout:!0,...c},u),d&&L.current.restoreViewState(Fm.get(Y)),M.current.editor.setTheme(a),s!==void 0&&L.current.revealLine(s),$(!0),V.current=!0}},[e,t,n,r,o,i,c,u,d,a,s]);m.useEffect(()=>{E&&z.current(L.current,M.current)},[E]),m.useEffect(()=>{!T&&!E&&q()},[T,E,q]),A.current=r,m.useEffect(()=>{var H,Y;E&&S&&((H=G.current)==null||H.dispose(),G.current=(Y=L.current)==null?void 0:Y.onDidChangeModelContent(I=>{K.current||S(L.current.getValue(),I)}))},[E,S]),m.useEffect(()=>{if(E){let H=M.current.editor.onDidChangeMarkers(Y=>{var te;let I=(te=L.current.getModel())==null?void 0:te.uri;if(I&&Y.find(ce=>ce.path===I.path)){let ce=M.current.editor.getModelMarkers({resource:I});C==null||C(ce)}});return()=>{H==null||H.dispose()}}return()=>{}},[E,C]);function O(){var H,Y;(H=G.current)==null||H.dispose(),h?d&&Fm.set(i,L.current.saveViewState()):(Y=L.current.getModel())==null||Y.dispose(),L.current.dispose()}return m.createElement(VL,{width:p,height:v,isEditorReady:E,loading:l,_ref:F,className:b,wrapperProps:x})}var TEe=OEe,UL=m.memo(TEe),DEe=UL;const qL="Collapsible",[AEe,GL]=hr(qL),[MEe,F2]=AEe(qL),kEe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:a,...s}=e,[l=!1,c]=Fr({prop:r,defaultProp:o,onChange:a});return m.createElement(MEe,{scope:n,disabled:i,contentId:yi(),open:l,onOpenToggle:m.useCallback(()=>c(u=>!u),[c])},m.createElement(Qe.div,ue({"data-state":j2(l),"data-disabled":i?"":void 0},s,{ref:t})))}),IEe="CollapsibleTrigger",NEe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=F2(IEe,n);return m.createElement(Qe.button,ue({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":j2(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:ke(e.onClick,o.onOpenToggle)}))}),YL="CollapsibleContent",LEe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=F2(YL,e.__scopeCollapsible);return m.createElement(pr,{present:n||o.open},({present:i})=>m.createElement(FEe,ue({},r,{ref:t,present:i})))}),FEe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,a=F2(YL,n),[s,l]=m.useState(r),c=m.useRef(null),u=Rt(t,c),d=m.useRef(0),h=d.current,p=m.useRef(0),v=p.current,b=a.open||s,x=m.useRef(b),y=m.useRef();return m.useEffect(()=>{const _=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(_)},[]),Cr(()=>{const _=c.current;if(_){y.current=y.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const S=_.getBoundingClientRect();d.current=S.height,p.current=S.width,x.current||(_.style.transitionDuration=y.current.transitionDuration,_.style.animationName=y.current.animationName),l(r)}},[a.open,r]),m.createElement(Qe.div,ue({"data-state":j2(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!b},i,{ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),b&&o)});function j2(e){return e?"open":"closed"}const jEe=kEe,zEe=NEe,BEe=LEe,Zs="Accordion",VEe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[z2,HEe,WEe]=_b(Zs),[Mv,v5e]=hr(Zs,[WEe,GL]),B2=GL(),KL=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(z2.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(YEe,ue({},i,{ref:t})):m.createElement(GEe,ue({},o,{ref:t})))});KL.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[XL,UEe]=Mv(Zs),[QL,qEe]=Mv(Zs,{collapsible:!1}),GEe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...a}=e,[s,l]=Fr({prop:n,defaultProp:r,onChange:o});return m.createElement(XL,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(QL,{scope:e.__scopeAccordion,collapsible:i},m.createElement(JL,ue({},a,{ref:t}))))}),YEe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a=[],s]=Fr({prop:n,defaultProp:r,onChange:o}),l=m.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=m.useCallback(u=>s((d=[])=>d.filter(h=>h!==u)),[s]);return m.createElement(XL,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:c},m.createElement(QL,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(JL,ue({},i,{ref:t}))))}),[KEe,kv]=Mv(Zs),JL=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...a}=e,s=m.useRef(null),l=Rt(s,t),c=HEe(n),d=vc(o)==="ltr",h=ke(e.onKeyDown,p=>{var v;if(!VEe.includes(p.key))return;const b=p.target,x=c().filter(M=>{var L;return!((L=M.ref.current)!==null&&L!==void 0&&L.disabled)}),y=x.findIndex(M=>M.ref.current===b),_=x.length;if(y===-1)return;p.preventDefault();let S=y;const C=0,E=_-1,$=()=>{S=y+1,S>E&&(S=C)},T=()=>{S=y-1,S<C&&(S=E)};switch(p.key){case"Home":S=C;break;case"End":S=E;break;case"ArrowRight":i==="horizontal"&&(d?$():T());break;case"ArrowDown":i==="vertical"&&$();break;case"ArrowLeft":i==="horizontal"&&(d?T():$());break;case"ArrowUp":i==="vertical"&&T();break}const D=S%_;(v=x[D].ref.current)===null||v===void 0||v.focus()});return m.createElement(KEe,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(z2.Slot,{scope:n},m.createElement(Qe.div,ue({},a,{"data-orientation":i,ref:l,onKeyDown:r?void 0:h}))))}),pS="AccordionItem",[XEe,V2]=Mv(pS),QEe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=kv(pS,n),a=UEe(pS,n),s=B2(n),l=yi(),c=r&&a.value.includes(r)||!1,u=i.disabled||e.disabled;return m.createElement(XEe,{scope:n,open:c,disabled:u,triggerId:l},m.createElement(jEe,ue({"data-orientation":i.orientation,"data-state":ZL(c)},s,o,{ref:t,disabled:u,open:c,onOpenChange:d=>{d?a.onItemOpen(r):a.onItemClose(r)}})))}),JEe="AccordionHeader",ZEe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=kv(Zs,n),i=V2(JEe,n);return m.createElement(Qe.h3,ue({"data-orientation":o.orientation,"data-state":ZL(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),eM="AccordionTrigger",e2e=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=kv(Zs,n),i=V2(eM,n),a=qEe(eM,n),s=B2(n);return m.createElement(z2.ItemSlot,{scope:n},m.createElement(zEe,ue({"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},s,r,{ref:t})))}),t2e="AccordionContent",n2e=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=kv(Zs,n),i=V2(t2e,n),a=B2(n);return m.createElement(BEe,ue({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},a,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 ZL(e){return e?"open":"closed"}const r2e=KL,o2e=QEe,i2e=ZEe,eF=e2e,tF=n2e,a2e=r2e,nF=j.forwardRef(({className:e,...t},n)=>R.jsx(o2e,{ref:n,className:ye("border-b",e),...t}));nF.displayName="AccordionItem";const rF=j.forwardRef(({className:e,children:t,...n},r)=>R.jsx(i2e,{className:"flex",children:R.jsxs(eF,{ref:r,className:ye("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,R.jsx(Fb,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));rF.displayName=eF.displayName;const oF=j.forwardRef(({className:e,children:t,...n},r)=>R.jsx(tF,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:R.jsx("div",{className:ye("pb-4 pt-0",e),children:t})}));oF.displayName=tF.displayName;function Tu(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function s2e(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function iF(...e){return t=>e.forEach(n=>s2e(n,t))}function Ip(...e){return m.useCallback(iF(...e),e)}function l2e(e,t=[]){let n=[];function r(i,a){const s=m.createContext(a),l=n.length;n=[...n,a];function c(d){const{scope:h,children:p,...v}=d,b=(h==null?void 0:h[e][l])||s,x=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:x},p)}function u(d,h){const p=(h==null?void 0:h[e][l])||s,v=m.useContext(p);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(a=>m.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,c2e(o,...t)]}function c2e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}const gS=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},u2e=j.useId||(()=>{});let d2e=0;function zx(e){const[t,n]=j.useState(u2e());return gS(()=>{e||n(r=>r??String(d2e++))},[e]),e||(t?`radix-${t}`:"")}function gc(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 f2e({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=h2e({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=gc(n),l=m.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function h2e({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=gc(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const H2=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(g2e);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(mS,ue({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(mS,ue({},r,{ref:t}),n)});H2.displayName="Slot";const mS=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...m2e(r,n.props),ref:iF(t,n.ref)}):m.Children.count(n)>1?m.Children.only(null):null});mS.displayName="SlotClone";const p2e=({children:e})=>m.createElement(m.Fragment,null,e);function g2e(e){return m.isValidElement(e)&&e.type===p2e}function m2e(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?n[r]=(...s)=>{i==null||i(...s),o==null||o(...s)}:r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const b2e=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],Iv=b2e.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?H2:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(s,ue({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function v2e(e,t){e&&Er.flushSync(()=>e.dispatchEvent(t))}function y2e(e){const t=gc(e);m.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const bS="dismissableLayer.update",x2e="dismissableLayer.pointerDownOutside",w2e="dismissableLayer.focusOutside";let tM;const _2e=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),S2e=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=m.useContext(_2e),[u,d]=m.useState(null),[,h]=m.useState({}),p=Ip(t,$=>d($)),v=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(b),y=u?v.indexOf(u):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=x,C=C2e($=>{const T=$.target,D=[...c.branches].some(M=>M.contains(T));!S||D||(o==null||o($),a==null||a($),$.defaultPrevented||s==null||s())}),E=E2e($=>{const T=$.target;[...c.branches].some(M=>M.contains(T))||(i==null||i($),a==null||a($),$.defaultPrevented||s==null||s())});return y2e($=>{y===c.layers.size-1&&(r==null||r($),!$.defaultPrevented&&s&&($.preventDefault(),s()))}),m.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(tM=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),nM(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=tM)}},[u,n,c]),m.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),nM())},[u,c]),m.useEffect(()=>{const $=()=>h({});return document.addEventListener(bS,$),()=>document.removeEventListener(bS,$)},[]),m.createElement(Iv.div,ue({},l,{ref:p,style:{pointerEvents:_?S?"auto":"none":void 0,...e.style},onFocusCapture:Tu(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Tu(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Tu(e.onPointerDownCapture,C.onPointerDownCapture)}))});function C2e(e){const t=gc(e),n=m.useRef(!1),r=m.useRef(()=>{});return m.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){aF(x2e,t,s,{discrete:!0})};const s={originalEvent:a};a.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=l,document.addEventListener("click",r.current,{once:!0})):l()}n.current=!1},i=window.setTimeout(()=>{document.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),document.removeEventListener("pointerdown",o),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function E2e(e){const t=gc(e),n=m.useRef(!1);return m.useEffect(()=>{const r=o=>{o.target&&!n.current&&aF(w2e,t,{originalEvent:o},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function nM(){const e=new CustomEvent(bS);document.dispatchEvent(e)}function aF(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?v2e(o,i):o.dispatchEvent(i)}const Bx="focusScope.autoFocusOnMount",Vx="focusScope.autoFocusOnUnmount",rM={bubbles:!1,cancelable:!0},R2e=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=m.useState(null),c=gc(o),u=gc(i),d=m.useRef(null),h=Ip(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(y){if(p.paused||!s)return;const _=y.target;s.contains(_)?d.current=_:Sl(d.current,{select:!0})},x=function(y){p.paused||!s||s.contains(y.relatedTarget)||Sl(d.current,{select:!0})};return document.addEventListener("focusin",b),document.addEventListener("focusout",x),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x)}}},[r,s,p.paused]),m.useEffect(()=>{if(s){iM.add(p);const b=document.activeElement;if(!s.contains(b)){const y=new CustomEvent(Bx,rM);s.addEventListener(Bx,c),s.dispatchEvent(y),y.defaultPrevented||(P2e(A2e(sF(s)),{select:!0}),document.activeElement===b&&Sl(s))}return()=>{s.removeEventListener(Bx,c),setTimeout(()=>{const y=new CustomEvent(Vx,rM);s.addEventListener(Vx,u),s.dispatchEvent(y),y.defaultPrevented||Sl(b??document.body,{select:!0}),s.removeEventListener(Vx,u),iM.remove(p)},0)}}},[s,c,u,p]);const v=m.useCallback(b=>{if(!n&&!r||p.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,y=document.activeElement;if(x&&y){const _=b.currentTarget,[S,C]=$2e(_);S&&C?!b.shiftKey&&y===C?(b.preventDefault(),n&&Sl(S,{select:!0})):b.shiftKey&&y===S&&(b.preventDefault(),n&&Sl(C,{select:!0})):y===_&&b.preventDefault()}},[n,r,p.paused]);return m.createElement(Iv.div,ue({tabIndex:-1},a,{ref:h,onKeyDown:v}))});function P2e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Sl(r,{select:t}),document.activeElement!==n)return}function $2e(e){const t=sF(e),n=oM(t,e),r=oM(t.reverse(),e);return[n,r]}function sF(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function oM(e,t){for(const n of e)if(!O2e(n,{upTo:t}))return n}function O2e(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 T2e(e){return e instanceof HTMLInputElement&&"select"in e}function Sl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&T2e(e)&&t&&e.select()}}const iM=D2e();function D2e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=aM(e,t),e.unshift(t)},remove(t){var n;e=aM(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function aM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function A2e(e){return e.filter(t=>t.tagName!=="A")}const M2e=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?Er.createPortal(m.createElement(Iv.div,ue({},o,{ref:t})),r):null});function k2e(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Nv=e=>{const{present:t,children:n}=e,r=I2e(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Ip(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};Nv.displayName="Presence";function I2e(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),a=e?"mounted":"unmounted",[s,l]=k2e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=jm(r.current);i.current=s==="mounted"?c:"none"},[s]),gS(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=jm(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),gS(()=>{if(t){const c=d=>{const p=jm(r.current).includes(d.animationName);d.target===t&&p&&Er.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=jm(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function jm(e){return(e==null?void 0:e.animationName)||"none"}let Hx=0;function N2e(){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:sM()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:sM()),Hx++,()=>{Hx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Hx--}},[])}function sM(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var lF=PE(),Wx=function(){},Lv=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:Wx,onWheelCapture:Wx,onTouchMoveCapture:Wx}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,p=e.noIsolation,v=e.inert,b=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,_=cv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=h,C=RE([n,t]),E=Nn(Nn({},_),o);return j.createElement(j.Fragment,null,u&&j.createElement(S,{sideCar:lF,removeScrollBar:c,shards:d,noIsolation:p,inert:v,setCallbacks:i,allowPinchZoom:!!b,lockRef:n}),a?j.cloneElement(j.Children.only(s),Nn(Nn({},E),{ref:C})):j.createElement(y,Nn({},E,{className:l,ref:C}),s))});Lv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lv.classNames={fullWidth:Ru,zeroRight:Eu};var vS=!1;if(typeof window<"u")try{var zm=Object.defineProperty({},"passive",{get:function(){return vS=!0,!0}});window.addEventListener("test",zm,zm),window.removeEventListener("test",zm,zm)}catch{vS=!1}var au=vS?{passive:!1}:!1,L2e=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},F2e=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},lM=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=cF(e,n);if(r){var o=uF(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},j2e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},z2e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},cF=function(e,t){return e==="v"?L2e(t):F2e(t)},uF=function(e,t){return e==="v"?j2e(t):z2e(t)},B2e=function(e,t){return e==="h"&&t==="rtl"?-1:1},V2e=function(e,t,n,r,o){var i=B2e(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,h=0;do{var p=uF(e,s),v=p[0],b=p[1],x=p[2],y=b-x-i*v;(v||y)&&cF(e,s)&&(d+=y,h+=v),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(o&&d===0||!o&&a>d)||!u&&(o&&h===0||!o&&-a>h))&&(c=!0),c},Bm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cM=function(e){return[e.deltaX,e.deltaY]},uM=function(e){return e&&"current"in e?e.current:e},H2e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},W2e=function(e){return`
441
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
442
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
443
+ `)},U2e=0,su=[];function q2e(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),o=j.useState(U2e++)[0],i=j.useState(function(){return dv()})[0],a=j.useRef(e);j.useEffect(function(){a.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=EE([e.lockRef.current],(e.shards||[]).map(uM),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=j.useCallback(function(b,x){if("touches"in b&&b.touches.length===2)return!a.current.allowPinchZoom;var y=Bm(b),_=n.current,S="deltaX"in b?b.deltaX:_[0]-y[0],C="deltaY"in b?b.deltaY:_[1]-y[1],E,$=b.target,T=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in b&&T==="h"&&$.type==="range")return!1;var D=lM(T,$);if(!D)return!0;if(D?E=T:(E=T==="v"?"h":"v",D=lM(T,$)),!D)return!1;if(!r.current&&"changedTouches"in b&&(S||C)&&(r.current=E),!E)return!0;var M=r.current||E;return V2e(M,x,b,M==="h"?S:C,!0)},[]),l=j.useCallback(function(b){var x=b;if(!(!su.length||su[su.length-1]!==i)){var y="deltaY"in x?cM(x):Bm(x),_=t.current.filter(function(E){return E.name===x.type&&E.target===x.target&&H2e(E.delta,y)})[0];if(_&&_.should){x.preventDefault();return}if(!_){var S=(a.current.shards||[]).map(uM).filter(Boolean).filter(function(E){return E.contains(x.target)}),C=S.length>0?s(x,S[0]):!a.current.noIsolation;C&&x.preventDefault()}}},[]),c=j.useCallback(function(b,x,y,_){var S={name:b,delta:x,target:y,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=j.useCallback(function(b){n.current=Bm(b),r.current=void 0},[]),d=j.useCallback(function(b){c(b.type,cM(b),b.target,s(b,e.lockRef.current))},[]),h=j.useCallback(function(b){c(b.type,Bm(b),b.target,s(b,e.lockRef.current))},[]);j.useEffect(function(){return su.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,au),document.addEventListener("touchmove",l,au),document.addEventListener("touchstart",u,au),function(){su=su.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,au),document.removeEventListener("touchmove",l,au),document.removeEventListener("touchstart",u,au)}},[]);var p=e.removeScrollBar,v=e.inert;return j.createElement(j.Fragment,null,v?j.createElement(i,{styles:W2e(o)}):null,p?j.createElement(OE,{gapMode:"margin"}):null)}const G2e=$E(lF,q2e);var dF=j.forwardRef(function(e,t){return j.createElement(Lv,Nn({},e,{ref:t,sideCar:G2e}))});dF.classNames=Lv.classNames;const Y2e=dF,fF="Dialog",[hF,y5e]=l2e(fF),[K2e,Tc]=hF(fF),X2e=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=m.useRef(null),l=m.useRef(null),[c=!1,u]=f2e({prop:r,defaultProp:o,onChange:i});return m.createElement(K2e,{scope:t,triggerRef:s,contentRef:l,contentId:zx(),titleId:zx(),descriptionId:zx(),open:c,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(d=>!d),[u]),modal:a},n)},pF="DialogPortal",[Q2e,gF]=hF(pF,{forceMount:void 0}),J2e=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Tc(pF,t);return m.createElement(Q2e,{scope:t,forceMount:n},m.Children.map(r,a=>m.createElement(Nv,{present:n||i.open},m.createElement(M2e,{asChild:!0,container:o},a))))},yS="DialogOverlay",Z2e=m.forwardRef((e,t)=>{const n=gF(yS,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Tc(yS,e.__scopeDialog);return i.modal?m.createElement(Nv,{present:r||i.open},m.createElement(eRe,ue({},o,{ref:t}))):null}),eRe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Tc(yS,n);return m.createElement(Y2e,{as:H2,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(Iv.div,ue({"data-state":bF(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),qh="DialogContent",tRe=m.forwardRef((e,t)=>{const n=gF(qh,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Tc(qh,e.__scopeDialog);return m.createElement(Nv,{present:r||i.open},i.modal?m.createElement(nRe,ue({},o,{ref:t})):m.createElement(rRe,ue({},o,{ref:t})))}),nRe=m.forwardRef((e,t)=>{const n=Tc(qh,e.__scopeDialog),r=m.useRef(null),o=Ip(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return _p(i)},[]),m.createElement(mF,ue({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Tu(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Tu(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:Tu(e.onFocusOutside,i=>i.preventDefault())}))}),rRe=m.forwardRef((e,t)=>{const n=Tc(qh,e.__scopeDialog),r=m.useRef(!1);return m.createElement(mF,ue({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1},onInteractOutside:o=>{var i,a;(i=e.onInteractOutside)===null||i===void 0||i.call(e,o),o.defaultPrevented||(r.current=!0);const s=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(s))&&o.preventDefault()}}))}),mF=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Tc(qh,n),l=m.useRef(null),c=Ip(t,l);return N2e(),m.createElement(m.Fragment,null,m.createElement(R2e,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(S2e,ue({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":bF(s.open)},a,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)});function bF(e){return e?"open":"closed"}const oRe=X2e,iRe=J2e,aRe=Z2e,sRe=tRe;var dM=1,lRe=.9,cRe=.3,Ux=.1,uRe=0,qx=.999,dRe=.9999,fRe=.99,fM=/[\\\/\-_+.# \t"@\[\(\{&]/,hRe=/[\\\/\-_+.# \t"@\[\(\{&]/g;function xS(e,t,n,r,o,i){if(i===t.length)return o===e.length?dM:fRe;for(var a=r.charAt(i),s=n.indexOf(a,o),l=0,c,u,d;s>=0;)c=xS(e,t,n,r,s+1,i+1),c>l&&(s===o?c*=dM:fM.test(e.charAt(s-1))?(c*=lRe,d=e.slice(o,s-1).match(hRe),d&&o>0&&(c*=Math.pow(qx,d.length))):fM.test(e.slice(o,s-1))?(c*=uRe,o>0&&(c*=Math.pow(qx,s-o))):(c*=cRe,o>0&&(c*=Math.pow(qx,s-o))),e.charAt(s)!==t.charAt(i)&&(c*=dRe)),c<Ux&&n.charAt(s-1)===r.charAt(i+1)&&n.charAt(s-1)!==r.charAt(i)&&(u=xS(e,t,n,r,s+1,i+2),u*Ux>c&&(c=u*Ux)),c>l&&(l=c),s=n.indexOf(a,s+1);return l}function pRe(e,t){return xS(e,t,e.toLowerCase(),t.toLowerCase(),0,0)}var gRe=pRe;const mRe=mc(gRe);var bRe='[cmdk-list-sizer=""]',vf='[cmdk-group=""]',Gx='[cmdk-group-items=""]',vRe='[cmdk-group-heading=""]',vF='[cmdk-item=""]',hM=`${vF}:not([aria-disabled="true"])`,wS="cmdk-item-select",vs="data-value",yRe=(e,t)=>mRe(e,t),yF=j.createContext(void 0),Np=()=>j.useContext(yF),xF=j.createContext(void 0),W2=()=>j.useContext(xF),wF=j.createContext(void 0),_F=j.forwardRef((e,t)=>{let n=j.useRef(null),r=uu(()=>({search:"",value:"",filtered:{count:0,items:new Map,groups:new Set}})),o=uu(()=>new Set),i=uu(()=>new Map),a=uu(()=>new Map),s=uu(()=>new Set),l=SF(e),{label:c,children:u,value:d,onValueChange:h,filter:p,shouldFilter:v,...b}=e,x=j.useId(),y=j.useId(),_=j.useId(),S=TRe();$d(()=>{if(d!==void 0){let q=d.trim().toLowerCase();r.current.value=q,S(6,L),C.emit()}},[d]);let C=j.useMemo(()=>({subscribe:q=>(s.current.add(q),()=>s.current.delete(q)),snapshot:()=>r.current,setState:(q,O,H)=>{var Y,I,te;if(!Object.is(r.current[q],O)){if(r.current[q]=O,q==="search")M(),T(),S(1,D);else if(q==="value")if(((Y=l.current)==null?void 0:Y.value)!==void 0){(te=(I=l.current).onValueChange)==null||te.call(I,O);return}else H||S(5,L);C.emit()}},emit:()=>{s.current.forEach(q=>q())}}),[]),E=j.useMemo(()=>({value:(q,O)=>{O!==a.current.get(q)&&(a.current.set(q,O),r.current.filtered.items.set(q,$(O)),S(2,()=>{T(),C.emit()}))},item:(q,O)=>(o.current.add(q),O&&(i.current.has(O)?i.current.get(O).add(q):i.current.set(O,new Set([q]))),S(3,()=>{M(),T(),r.current.value||D(),C.emit()}),()=>{a.current.delete(q),o.current.delete(q),r.current.filtered.items.delete(q),S(4,()=>{M(),D(),C.emit()})}),group:q=>(i.current.has(q)||i.current.set(q,new Set),()=>{a.current.delete(q),i.current.delete(q)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],listId:x,inputId:_,labelId:y}),[]);function $(q){var O;let H=((O=l.current)==null?void 0:O.filter)??yRe;return q?H(q,r.current.search):0}function T(){if(!n.current||!r.current.search||l.current.shouldFilter===!1)return;let q=r.current.filtered.items,O=[];r.current.filtered.groups.forEach(Y=>{let I=i.current.get(Y),te=0;I.forEach(ce=>{let de=q.get(ce);te=Math.max(de,te)}),O.push([Y,te])});let H=n.current.querySelector(bRe);z().sort((Y,I)=>{let te=Y.getAttribute(vs),ce=I.getAttribute(vs);return(q.get(ce)??0)-(q.get(te)??0)}).forEach(Y=>{let I=Y.closest(Gx);I?I.appendChild(Y.parentElement===I?Y:Y.closest(`${Gx} > *`)):H.appendChild(Y.parentElement===H?Y:Y.closest(`${Gx} > *`))}),O.sort((Y,I)=>I[1]-Y[1]).forEach(Y=>{let I=n.current.querySelector(`${vf}[${vs}="${Y[0]}"]`);I==null||I.parentElement.appendChild(I)})}function D(){let q=z().find(H=>!H.ariaDisabled),O=q==null?void 0:q.getAttribute(vs);C.setState("value",O||void 0)}function M(){if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let q=0;for(let O of o.current){let H=a.current.get(O),Y=$(H);r.current.filtered.items.set(O,Y),Y>0&&q++}for(let[O,H]of i.current)for(let Y of H)if(r.current.filtered.items.get(Y)>0){r.current.filtered.groups.add(O);break}r.current.filtered.count=q}function L(){var q,O,H;let Y=F();Y&&(((q=Y.parentElement)==null?void 0:q.firstChild)===Y&&((H=(O=Y.closest(vf))==null?void 0:O.querySelector(vRe))==null||H.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function F(){return n.current.querySelector(`${vF}[aria-selected="true"]`)}function z(){return Array.from(n.current.querySelectorAll(hM))}function X(q){let O=z()[q];O&&C.setState("value",O.getAttribute(vs))}function G(q){var O;let H=F(),Y=z(),I=Y.findIndex(ce=>ce===H),te=Y[I+q];(O=l.current)!=null&&O.loop&&(te=I+q<0?Y[Y.length-1]:I+q===Y.length?Y[0]:Y[I+q]),te&&C.setState("value",te.getAttribute(vs))}function A(q){let O=F(),H=O==null?void 0:O.closest(vf),Y;for(;H&&!Y;)H=q>0?$Re(H,vf):ORe(H,vf),Y=H==null?void 0:H.querySelector(hM);Y?C.setState("value",Y.getAttribute(vs)):G(q)}let U=()=>X(z().length-1),V=q=>{q.preventDefault(),q.metaKey?U():q.altKey?A(1):G(1)},K=q=>{q.preventDefault(),q.metaKey?X(0):q.altKey?A(-1):G(-1)};return j.createElement("div",{ref:Lp([n,t]),...b,"cmdk-root":"",onKeyDown:q=>{var O;if((O=b.onKeyDown)==null||O.call(b,q),!q.defaultPrevented)switch(q.key){case"n":case"j":{q.ctrlKey&&V(q);break}case"ArrowDown":{V(q);break}case"p":case"k":{q.ctrlKey&&K(q);break}case"ArrowUp":{K(q);break}case"Home":{q.preventDefault(),X(0);break}case"End":{q.preventDefault(),U();break}case"Enter":{q.preventDefault();let H=F();if(H){let Y=new Event(wS);H.dispatchEvent(Y)}}}}},j.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:DRe},c),j.createElement(xF.Provider,{value:C},j.createElement(yF.Provider,{value:E},u)))}),xRe=j.forwardRef((e,t)=>{let n=j.useId(),r=j.useRef(null),o=j.useContext(wF),i=Np(),a=SF(e);$d(()=>i.item(n,o),[]);let s=CF(n,r,[e.value,e.children,r]),l=W2(),c=dd(y=>y.value&&y.value===s.current),u=dd(y=>i.filter()===!1?!0:y.search?y.filtered.items.get(n)>0:!0);j.useEffect(()=>{let y=r.current;if(!(!y||e.disabled))return y.addEventListener(wS,d),()=>y.removeEventListener(wS,d)},[u,e.onSelect,e.disabled]);function d(){var y,_;(_=(y=a.current).onSelect)==null||_.call(y,s.current)}function h(){l.setState("value",s.current,!0)}if(!u)return null;let{disabled:p,value:v,onSelect:b,...x}=e;return j.createElement("div",{ref:Lp([r,t]),...x,"cmdk-item":"",role:"option","aria-disabled":p||void 0,"aria-selected":c||void 0,"data-selected":c||void 0,onPointerMove:p?void 0:h,onClick:p?void 0:d},e.children)}),wRe=j.forwardRef((e,t)=>{let{heading:n,children:r,...o}=e,i=j.useId(),a=j.useRef(null),s=j.useRef(null),l=j.useId(),c=Np(),u=dd(h=>c.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);$d(()=>c.group(i),[]),CF(i,a,[e.value,e.heading,s]);let d=j.createElement(wF.Provider,{value:i},r);return j.createElement("div",{ref:Lp([a,t]),...o,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&j.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),j.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},d))}),_Re=j.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=j.useRef(null),i=dd(a=>!a.search);return!n&&!i?null:j.createElement("div",{ref:Lp([o,t]),...r,"cmdk-separator":"",role:"separator"})}),SRe=j.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=W2(),a=dd(l=>l.search),s=Np();return j.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),j.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,id:s.inputId,type:"text",value:o?e.value:a,onChange:l=>{o||i.setState("search",l.target.value),n==null||n(l.target.value)}})}),CRe=j.forwardRef((e,t)=>{let{children:n,...r}=e,o=j.useRef(null),i=j.useRef(null),a=Np();return j.useEffect(()=>{if(i.current&&o.current){let s=i.current,l=o.current,c,u=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let d=s.getBoundingClientRect().height;l.style.setProperty("--cmdk-list-height",d.toFixed(1)+"px")})});return u.observe(s),()=>{cancelAnimationFrame(c),u.unobserve(s)}}},[]),j.createElement("div",{ref:Lp([o,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:a.listId,"aria-labelledby":a.inputId},j.createElement("div",{ref:i,"cmdk-list-sizer":""},n))}),ERe=j.forwardRef((e,t)=>{let{open:n,onOpenChange:r,container:o,...i}=e;return j.createElement(oRe,{open:n,onOpenChange:r},j.createElement(iRe,{container:o},j.createElement(aRe,{"cmdk-overlay":""}),j.createElement(sRe,{"aria-label":e.label,"cmdk-dialog":""},j.createElement(_F,{ref:t,...i}))))}),RRe=j.forwardRef((e,t)=>{let n=j.useRef(!0),r=dd(o=>o.filtered.count===0);return j.useEffect(()=>{n.current=!1},[]),n.current||!r?null:j.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),PRe=j.forwardRef((e,t)=>{let{progress:n,children:r,...o}=e;return j.createElement("div",{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},j.createElement("div",{"aria-hidden":!0},r))}),io=Object.assign(_F,{List:CRe,Item:xRe,Input:SRe,Group:wRe,Separator:_Re,Dialog:ERe,Empty:RRe,Loading:PRe});function $Re(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ORe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function SF(e){let t=j.useRef(e);return $d(()=>{t.current=e}),t}var $d=typeof window>"u"?j.useEffect:j.useLayoutEffect;function uu(e){let t=j.useRef();return t.current===void 0&&(t.current=e()),t}function Lp(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function dd(e){let t=W2(),n=()=>e(t.snapshot());return j.useSyncExternalStore(t.subscribe,n,n)}function CF(e,t,n){let r=j.useRef(),o=Np();return $d(()=>{var i;let a=(()=>{var s;for(let l of n){if(typeof l=="string")return l.trim().toLowerCase();if(typeof l=="object"&&"current"in l&&l.current)return(s=l.current.textContent)==null?void 0:s.trim().toLowerCase()}})();o.value(e,a),(i=t.current)==null||i.setAttribute(vs,a),r.current=a}),r}var TRe=()=>{let[e,t]=j.useState(),n=uu(()=>new Map);return $d(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}},DRe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const EF=j.forwardRef(({className:e,...t},n)=>R.jsx(io,{ref:n,className:ye("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));EF.displayName=io.displayName;const RF=j.forwardRef(({className:e,...t},n)=>R.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[R.jsx(R6,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),R.jsx(io.Input,{ref:n,className:ye("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));RF.displayName=io.Input.displayName;const PF=j.forwardRef(({className:e,...t},n)=>R.jsx(io.List,{ref:n,className:ye("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));PF.displayName=io.List.displayName;const $F=j.forwardRef((e,t)=>R.jsx(io.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));$F.displayName=io.Empty.displayName;const OF=j.forwardRef(({className:e,...t},n)=>R.jsx(io.Group,{ref:n,className:ye("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));OF.displayName=io.Group.displayName;const ARe=j.forwardRef(({className:e,...t},n)=>R.jsx(io.Separator,{ref:n,className:ye("-mx-1 h-px bg-border",e),...t}));ARe.displayName=io.Separator.displayName;const TF=j.forwardRef(({className:e,...t},n)=>R.jsx(io.Item,{ref:n,className:ye("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));TF.displayName=io.Item.displayName;var MRe=Object.defineProperty,kRe=(e,t,n)=>t in e?MRe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vm=(e,t,n)=>(kRe(e,typeof t!="symbol"?t+"":t,n),n);const IRe={stringify:e=>e,parse:e=>e},NRe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},LRe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},FRe={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}},jRe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},Yx={string:IRe,number:NRe,boolean:LRe,function:FRe,json:jRe},Kx=Symbol.for("r2wc.render"),Hm=Symbol.for("r2wc.connected"),bl=Symbol.for("r2wc.context"),ps=Symbol.for("r2wc.props");function zRe(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const a=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(d=>d!=="container"),s={},l={},c={};for(const d of a){s[d]=Array.isArray(t.props)?"string":t.props[d];const h=BRe(d);l[d]=h,c[h]=d}class u extends HTMLElement{constructor(){super(),Vm(this,r,!0),Vm(this,o),Vm(this,i,{}),Vm(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[ps].container=this.container;for(const h of a){const p=l[h],v=this.getAttribute(p),b=s[h],x=Yx[b];v&&x!=null&&x.parse&&(this[ps][h]=x.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[Hm]=!0,this[Kx]()}disconnectedCallback(){this[Hm]=!1,this[bl]&&n.unmount(this[bl]),delete this[bl]}attributeChangedCallback(h,p,v){const b=c[h],x=s[b],y=Yx[x];b in s&&y!=null&&y.parse&&(this[ps][b]=y.parse(v,this),this[Kx]())}[(r=Hm,o=bl,i=ps,Kx)](){this[Hm]&&(this[bl]?n.update(this[bl],this[ps]):this[bl]=n.mount(this.container,e,this[ps]))}}for(const d of a){const h=l[d],p=s[d];Object.defineProperty(u.prototype,d,{enumerable:!0,configurable:!0,get(){return this[ps][d]},set(v){this[ps][d]=v;const b=Yx[p];if(b!=null&&b.stringify){const x=b.stringify(v);this.getAttribute(h)!==x&&this.setAttribute(h,x)}}})}return u}function BRe(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function VRe(e,t,n){const r=aw(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function HRe({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function WRe({root:e}){e.unmount()}function URe(e,t={}){return zRe(e,t,{mount:VRe,update:HRe,unmount:WRe})}const qRe={id:"string",version:"string",authToken:"json",defaultFilterValues:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onFilterValuesChange:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean"},GRe=URe(JN,{props:qRe});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=dI;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=Z7;exports.Accordion=a2e;exports.AccordionContent=oF;exports.AccordionItem=nF;exports.AccordionTrigger=rF;exports.BOOLEAN_DATA_TYPES=TS;exports.Bot=zw;exports.Button=no;exports.Calendar=v6;exports.Card=lk;exports.CardContent=wb;exports.CardDescription=LS;exports.CardHeader=xb;exports.CardTitle=pd;exports.CaretSortIcon=mQ;exports.ChartJsVisual=IE;exports.Check=up;exports.CheckIcon=d6;exports.Checkbox=wv;exports.ChevronDown=Fb;exports.ChevronLeft=pC;exports.ChevronRight=jb;exports.ChevronUp=y6;exports.Circle=gC;exports.ClipboardCopyIcon=wQ;exports.ColorFormat=v8;exports.Command=EF;exports.CommandEmpty=$F;exports.CommandGroup=OF;exports.CommandInput=RF;exports.CommandItem=TF;exports.CommandList=PF;exports.Cross2Icon=f6;exports.DATAMODEL_NAMESPCACE=HM;exports.DATE_DATA_TYPES=hd;exports.Dashboard=JN;exports.DashboardPanel=uk;exports.DashboardTabs=XN;exports.DashboardWC=GRe;exports.Dialog=CCe;exports.DialogContent=OL;exports.DialogDescription=ML;exports.DialogFooter=DL;exports.DialogHeader=TL;exports.DialogTitle=AL;exports.DialogTrigger=ECe;exports.Download=x6;exports.DropdownMenu=yCe;exports.DropdownMenuCheckboxItem=CL;exports.DropdownMenuContent=_L;exports.DropdownMenuItem=SL;exports.DropdownMenuLabel=RL;exports.DropdownMenuRadioGroup=wCe;exports.DropdownMenuRadioItem=EL;exports.DropdownMenuSeparator=PL;exports.DropdownMenuTrigger=xCe;exports.Editable=qi;exports.EditorAside=IL;exports.EditorMain=NL;exports.EditorPanel=kL;exports.ErrorBoundary=zb;exports.Fallback=yC;exports.FallbackEditorCard=oJ;exports.Filter=w6;exports.FilterHeader=_4;exports.FilterX=mC;exports.Ft=DEe;exports.GripVertical=_6;exports.HoverCard=Zb;exports.HoverCardContent=xp;exports.HoverCardTrigger=ev;exports.Icon=b6;exports.Info=S6;exports.InfoCircledIcon=TQ;exports.Input=Jl;exports.Jt=S4;exports.KPICard=T7;exports.LOCALE_CURRENCY_PAIRS=sw;exports.Label=Tn;exports.Markdown=E9;exports.NUMBER_DATA_TYPES=op;exports.PYTHON_DEFAULT_CODE=VM;exports.PaperPlaneIcon=h6;exports.Percent=C6;exports.PlayIcon=MQ;exports.Plus=bC;exports.Popover=gv;exports.PopoverContent=Sp;exports.PopoverTrigger=mv;exports.RadioGroup=r2;exports.RadioGroupItem=nb;exports.ResizableHandle=Mwe;exports.ResizablePanel=lS;exports.ResizablePanelGroup=U9;exports.ScanSearch=E6;exports.ScrollArea=iv;exports.ScrollBar=av;exports.Search=R6;exports.Select=Ea;exports.SelectContent=ki;exports.SelectGroup=lu;exports.SelectItem=Hn;exports.SelectLabel=El;exports.SelectSeparator=Kf;exports.SelectTrigger=Mi;exports.SelectValue=Ra;exports.SemaphorContextProvider=ak;exports.SemaphorQueryClient=ok;exports.Separator=wp;exports.Settings=vC;exports.SliderIcon=IQ;exports.Switch=j4;exports.TEXT_DATA_TYPES=bb;exports.Table=P6;exports.Table$1=gE;exports.TableBody=bE;exports.TableCell=yE;exports.TableHead=vE;exports.TableHeader=mE;exports.TableRow=Yf;exports.TableVisual=x8;exports.Tabs=VS;exports.TabsContent=HS;exports.TabsList=Sb;exports.TabsTrigger=Cb;exports.Te=M0e;exports.TextCard=wI;exports.Textarea=n2;exports.Toggle=kE;exports.Tooltip=nI;exports.TooltipContent=fE;exports.TooltipTrigger=rI;exports.TriangleDownIcon=p6;exports.TriangleUpIcon=g6;exports.UXProvider=QN;exports.UserRound=$6;exports.X=md;exports._=Vl;exports.cn=ye;exports.copyToClipboard=Cq;exports.createChartConfig=JC;exports.createLucideIcon=jn;exports.createSqlGenConfig=oG;exports.de=UL;exports.flexRender=I_;exports.fmt=DS;exports.getCanvasBackgroundColor=oh;exports.getColumnDataType=iG;exports.getContrastColor=qu;exports.getCoreRowModel=II;exports.getCssVariableValue=D6;exports.getDefaultFilterSql=Ime;exports.getFilterComponent=o2;exports.getFilterValueType=vu;exports.getKeys=tr;exports.getNumberAxis=wC;exports.getPaginationRowModel=LI;exports.getPlugins=Oq;exports.getQualifiedTableName=WM;exports.getRequest=_q;exports.getSortedRowModel=NI;exports.getSql=rG;exports.getTenantAndEndUserId=Sq;exports.isColumnInSqlGen=aG;exports.jsxRuntimeExports=R;exports.loadManifest=w8;exports.pivotData=b0;exports.postRequest=fb;exports.removeRing=Lf;exports.resolveDataType=vb;exports.titleCase=Pq;exports.useCard=Cae;exports.useCustomVisual=_8;exports.useDashboardActions=dr;exports.useDashboardCardQuery=Bb;exports.useDashboardStore=we;exports.useEditorActions=Lb;exports.useEditorStore=Ir;exports.useQuery=ap;exports.useQueryClient=NS;exports.useReactTable=FI;exports.useSemaphorContext=_i;exports.useTheme=qM;exports.useTopoJson=O7;exports.v4=Fs;