semaphor 0.0.80 → 0.0.82

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.
@@ -1,443 +0,0 @@
1
- "use strict";var FU=Object.defineProperty;var jU=(e,t,n)=>t in e?FU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ne=(e,t,n)=>(jU(e,typeof t!="symbol"?t+"":t,n),n),Yy=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var re=(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 Rg=(e,t,n,r)=>({set _(o){Ue(e,t,o,n)},get _(){return re(e,t,r)}}),jt=(e,t,n)=>(Yy(e,t,"access private method"),n);const m=require("react"),Er=require("react-dom");function EM(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=EM(m),SS=EM(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 CS(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:{}},Gd={};/**
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 gP;function zU(){return gP||(gP=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"),b=Symbol.iterator,v="@@iterator";function x(k){if(k===null||typeof k!="object")return null;var te=b&&k[b]||k[v];return typeof te=="function"?te:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(k){{for(var te=arguments.length,fe=new Array(te>1?te-1:0),$e=1;$e<te;$e++)fe[$e-1]=arguments[$e];S("error",k,fe)}}function S(k,te,fe){{var $e=y.ReactDebugCurrentFrame,Ve=$e.getStackAddendum();Ve!==""&&(te+="%s",fe=fe.concat([Ve]));var qe=fe.map(function(ze){return String(ze)});qe.unshift("Warning: "+te),Function.prototype.apply.call(console[k],console,qe)}}var C=!1,E=!1,$=!1,D=!1,T=!1,A;A=Symbol.for("react.module.reference");function L(k){return!!(typeof k=="string"||typeof k=="function"||k===r||k===i||T||k===o||k===c||k===u||D||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===A||k.getModuleId!==void 0))}function F(k,te,fe){var $e=k.displayName;if($e)return $e;var Ve=te.displayName||te.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 te=k;return z(te)+".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,M=0,U,V,Y,q,O,H,K;function I(){}I.__reactDisabledLog=!0;function oe(){{if(M===0){U=console.log,V=console.info,Y=console.warn,q=console.error,O=console.group,H=console.groupCollapsed,K=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})}M++}}function ce(){{if(M--,M===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:Y}),error:G({},k,{value:q}),group:G({},k,{value:O}),groupCollapsed:G({},k,{value:H}),groupEnd:G({},k,{value:K})})}M<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=y.ReactCurrentDispatcher,he;function ie(k,te,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 ne=!1,le;{var xe=typeof WeakMap=="function"?WeakMap:Map;le=new xe}function Z(k,te){if(!k||ne)return"";{var fe=le.get(k);if(fe!==void 0)return fe}var $e;ne=!0;var Ve=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var qe;qe=de.current,de.current=null,oe();try{if(te){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{ne=!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,te,fe){return Z(k,!1)}function Ce(k){var te=k.prototype;return!!(te&&te.isReactComponent)}function Oe(k,te,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,te,fe);case h:{var $e=k,Ve=$e._payload,qe=$e._init;try{return Oe(qe(Ve),te,fe)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,We={},Be=y.ReactDebugCurrentFrame;function Ie(k){if(k){var te=k._owner,fe=Oe(k.type,k._source,te?te.type:null);Be.setExtraStackFrame(fe)}else Be.setExtraStackFrame(null)}function Ke(k,te,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](te,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 te=typeof Symbol=="function"&&Symbol.toStringTag,fe=te&&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 te=Object.getOwnPropertyDescriptor(k,"ref").get;if(te&&te.isReactWarning)return!1}return k.ref!==void 0}function En(k){if(Te.call(k,"key")){var te=Object.getOwnPropertyDescriptor(k,"key").get;if(te&&te.isReactWarning)return!1}return k.key!==void 0}function vn(k,te){if(typeof k.ref=="string"&&Le.current&&te&&Le.current.stateNode!==te){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,te){{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)",te))};fe.isReactWarning=!0,Object.defineProperty(k,"key",{get:fe,configurable:!0})}}function dn(k,te){{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)",te))};fe.isReactWarning=!0,Object.defineProperty(k,"ref",{get:fe,configurable:!0})}}var $n=function(k,te,fe,$e,Ve,qe,ze){var Fe={$$typeof:t,type:k,key:te,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,te,fe,$e,Ve){{var qe,ze={},Fe=null,Ae=null;fe!==void 0&&(Re(fe),Fe=""+fe),En(te)&&(Re(te.key),Fe=""+te.key),rn(te)&&(Ae=te.ref,vn(te,Ve));for(qe in te)Te.call(te,qe)&&!Ge.hasOwnProperty(qe)&&(ze[qe]=te[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 te=k._owner,fe=Oe(k.type,k._source,te?te.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 ri(){{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 te=k.fileName.replace(/^.*[\\\/]/,""),fe=k.lineNumber;return`
16
-
17
- Check your code at `+te+":"+fe+"."}return""}}var oi={};function aa(k){{var te=ri();if(!te){var fe=typeof k=="string"?k:k.displayName||k.name;fe&&(te=`
18
-
19
- Check the top-level render call using <`+fe+">.")}return te}}function Ci(k,te){{if(!k._store||k._store.validated||k.key!=null)return;k._store.validated=!0;var fe=aa(te);if(oi[fe])return;oi[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,te){{if(typeof k!="object")return;if(Bt(k))for(var fe=0;fe<k.length;fe++){var $e=k[fe];zn($e)&&Ci($e,te)}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,te)}}}function Ka(k){{var te=k.type;if(te==null||typeof te=="string")return;var fe;if(typeof te=="function")fe=te.propTypes;else if(typeof te=="object"&&(te.$$typeof===l||te.$$typeof===d))fe=te.propTypes;else return;if(fe){var $e=X(te);Ke(fe,k.props,"prop",$e,k)}else if(te.PropTypes!==void 0&&!_t){_t=!0;var Ve=X(te);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ve||"Unknown")}typeof te.getDefaultProps=="function"&&!te.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ei(k){{for(var te=Object.keys(k.props),fe=0;fe<te.length;fe++){var $e=te[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,te,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+=ri();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,te,fe,Ve,qe);if(me==null)return me;if(ze){var Me=te.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,te,fe){return la(k,te,fe,!0)}function Ri(k,te,fe){return la(k,te,fe,!1)}var Xa=Ri,Qa=Jn;Gd.Fragment=r,Gd.jsx=Xa,Gd.jsxs=Qa}()),Gd}var Yd={};/**
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 mP;function BU(){if(mP)return Yd;mP=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 Yd.Fragment=n,Yd.jsx=a,Yd.jsxs=a,Yd}process.env.NODE_ENV==="production"?Qx.exports=BU():Qx.exports=zU();var R=Qx.exports;function RM(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=RM(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function l0(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=RM(e))&&(r&&(r+=" "),r+=t);return r}const VU=Object.freeze(Object.defineProperty({__proto__:null,clsx:l0,default:l0},Symbol.toStringTag,{value:"Module"})),ES="-";function HU(e){const t=UU(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(a){const s=a.split(ES);return s[0]===""&&s.length!==1&&s.shift(),PM(s,t)||WU(a)}function i(a,s){const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function PM(e,t){var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?PM(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(ES);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId}const bP=/^\[(.+)\]$/;function WU(e){if(bP.test(e)){const t=bP.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function UU(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return GU(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:vP(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(qU(o)){Jx(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{Jx(a,vP(t,i),n,r)})})}function vP(e,t){let n=e;return t.split(ES).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function qU(e){return e.isThemeGetter}function GU(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 YU(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 $M="!";function KU(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 v=0;v<a.length;v++){let x=a[v];if(l===0){if(x===r&&(n||a.slice(v,v+o)===t)){s.push(a.slice(c,v)),c=v+o;continue}if(x==="/"){u=v;continue}}x==="["?l++:x==="]"&&l--}const d=s.length===0?a:a.substring(c),h=d.startsWith($M),p=h?d.substring(1):d,b=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:b}}}function XU(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 QU(e){return{cache:YU(e.cacheSize),splitModifiers:KU(e),...HU(e)}}const JU=/\s+/;function ZU(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(JU).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=XU(s).join(":");return{isTailwindClass:!0,modifierId:l?p+$M: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 eq(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=OM(t))&&(r&&(r+=" "),r+=n);return r}function OM(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=OM(e[r]))&&(n&&(n+=" "),n+=t);return n}function tq(e,...t){let n,r,o,i=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=QU(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=ZU(l,n);return o(l,u),u}return function(){return i(eq.apply(null,arguments))}}function xn(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const TM=/^\[(?:([a-z-]+):)?(.+)\]$/i,nq=/^\d+\/\d+$/,rq=new Set(["px","full","screen"]),oq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iq=/\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$/,aq=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ci(e){return $l(e)||rq.has(e)||nq.test(e)}function ss(e){return hd(e,"length",gq)}function $l(e){return!!e&&!Number.isNaN(Number(e))}function Pg(e){return hd(e,"number",$l)}function Kd(e){return!!e&&Number.isInteger(Number(e))}function lq(e){return e.endsWith("%")&&$l(e.slice(0,-1))}function Ct(e){return TM.test(e)}function ls(e){return oq.test(e)}const cq=new Set(["length","size","percentage"]);function uq(e){return hd(e,cq,DM)}function dq(e){return hd(e,"position",DM)}const fq=new Set(["image","url"]);function hq(e){return hd(e,fq,bq)}function pq(e){return hd(e,"",mq)}function Xd(){return!0}function hd(e,t,n){const r=TM.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function gq(e){return iq.test(e)}function DM(){return!1}function mq(e){return aq.test(e)}function bq(e){return sq.test(e)}function vq(){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"),b=xn("gradientColorStopPositions"),v=xn("inset"),x=xn("margin"),y=xn("opacity"),_=xn("padding"),S=xn("saturate"),C=xn("scale"),E=xn("sepia"),$=xn("skew"),D=xn("space"),T=xn("translate"),A=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",Ct,t],z=()=>[Ct,t],X=()=>["",ci,ss],G=()=>["auto",$l,Ct],M=()=>["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"],Y=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",Ct],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[$l,Pg],K=()=>[$l,Ct];return{cacheSize:500,separator:":",theme:{colors:[Xd],spacing:[ci,ss],blur:["none","",ls,Ct],brightness:H(),borderColor:[e],borderRadius:["none","","full",ls,Ct],borderSpacing:z(),borderWidth:X(),contrast:H(),grayscale:q(),hueRotate:K(),invert:q(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[lq,ss],inset:F(),margin:F(),opacity:H(),padding:z(),saturate:H(),scale:H(),sepia:q(),skew:K(),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:[...M(),Ct]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kd,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",Kd,Ct]}],"grid-cols":[{"grid-cols":[Xd]}],"col-start-end":[{col:["auto",{span:["full",Kd,Ct]},Ct]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[Xd]}],"row-start-end":[{row:["auto",{span:[Kd,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",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"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":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",Ct,t]}],"min-w":[{"min-w":["min","max","fit",Ct,ci]}],"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",ci,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",Pg]}],"font-family":[{font:[Xd]}],"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,Pg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ci,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",ci,ss]}],"underline-offset":[{"underline-offset":["auto",ci,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:[...M(),dq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"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":[ci,Ct]}],"outline-w":[{outline:[ci,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":[ci,ss]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ls,pq]}],"shadow-color":[{shadow:[Xd]}],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:K()}],ease:[{ease:["linear","in","out","in-out",Ct]}],delay:[{delay:K()}],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:[Kd,Ct]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"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:[ci,ss,Pg]}],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 yq=tq(vq);class xf extends Error{}xf.prototype.name="InvalidTokenError";function xq(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 wq(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 xq(t)}catch{return atob(t)}}function RS(e,t){if(typeof e!="string")throw new xf("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 xf(`Invalid token specified: missing part #${n+1}`);let o;try{o=wq(r)}catch(i){throw new xf(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(o)}catch(i){throw new xf(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}async function _q(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 Sq(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 yq(l0(e))}async function Cq(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 pb(e,t,n={}){try{const r=JSON.stringify(n),o=await _q(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 Sq(a.payload,t);return JSON.parse(s.decryptedData)}return a}catch(r){throw console.error("Error during fetch:",r),r}}function Eq(e){if(!e)return{tenantId:"",endUserId:""};const t=RS(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function Rq(e){if(!e)return;const t=RS(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function AM(e){return e?RS(e).params:void 0}function Pq(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 $q(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>Oq(i,t))}function Oq(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 Tq(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ff="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function Dq(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 Aq(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}var Mq={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const yP=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:()=>{(Mq?"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},kq=e=>e?yP(e):yP;var Zx={exports:{}},Ky={},$g={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 xP;function Iq(){return xP||(xP=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,D=$.getStackAddendum();D!==""&&(C+="%s",E=E.concat([D]));var T=E.map(function(A){return String(A)});T.unshift("Warning: "+C),Function.prototype.apply.call(console[S],console,T)}}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 D=C();i($,D)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var T=a({inst:{value:$,getSnapshot:C}}),A=T[0].inst,L=T[1];return l(function(){A.value=$,A.getSnapshot=C,p(A)&&L({inst:A})},[S,$,C]),s(function(){p(A)&&L({inst:A});var F=function(){p(A)&&L({inst:A})};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 b(S,C,E){return C()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!v,y=x?b: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 wP;function Nq(){if(wP)return Qy;wP=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(),b=r({inst:{value:p,getSnapshot:h}}),v=b[0].inst,x=b[1];return i(function(){v.value=p,v.getSnapshot=h,l(v)&&x({inst:v})},[d,p,h]),o(function(){return l(v)&&x({inst:v}),d(function(){l(v)&&x({inst:v})})},[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 _P;function PS(){return _P||(_P=1,process.env.NODE_ENV==="production"?$g.exports=Nq():$g.exports=Iq()),$g.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 SP;function Lq(){return SP||(SP=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=PS();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,b){var v=i(null),x;v.current===null?(x={hasValue:!1,value:null},v.current=x):x=v.current;var y=s(function(){var E=!1,$,D,T=function(z){if(!E){E=!0,$=z;var X=p(z);if(b!==void 0&&x.hasValue){var G=x.value;if(b(G,X))return D=G,G}return D=X,X}var M=$,U=D;if(r(M,z))return U;var V=p(z);return b!==void 0&&b(U,V)?U:($=z,D=V,V)},A=h===void 0?null:h,L=function(){return T(d())},F=A===null?void 0:function(){return T(A())};return[L,F]},[d,h,p,b]),_=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 CP;function Fq(){if(CP)return Jy;CP=1;var e=m,t=PS();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 b=i(null);if(b.current===null){var v={hasValue:!1,value:null};b.current=v}else v=b.current;b=s(function(){function y($){if(!_){if(_=!0,S=$,$=h($),p!==void 0&&v.hasValue){var D=v.value;if(p(D,$))return C=D}return C=$}if(D=C,r(S,$))return D;var T=h($);return p!==void 0&&p(D,T)?D:(S=$,C=T)}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,b[0],b[1]);return a(function(){v.hasValue=!0,v.value=x},[x]),l(x),x},Jy}process.env.NODE_ENV==="production"?Zx.exports=Fq():Zx.exports=Lq();var jq=Zx.exports;const zq=mc(jq);var MM={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:Bq}=m,{useSyncExternalStoreWithSelector:Vq}=zq;let EP=!1;function Hq(e,t=e.getState,n){(MM?"production":void 0)!=="production"&&n&&!EP&&(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"),EP=!0);const r=Vq(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return Bq(r),r}const RP=e=>{(MM?"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"?kq(e):e,n=(r,o)=>Hq(t,r,o);return Object.assign(n,t),n},kM=e=>e?RP(e):RP;var IM=Symbol.for("immer-nothing"),PP=Symbol.for("immer-draftable"),Po=Symbol.for("immer-state"),Wq=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=Wq[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 Uu=Object.getPrototypeOf;function qu(e){return!!e&&!!e[Po]}function nc(e){var t;return e?NM(e)||Array.isArray(e)||!!e[PP]||!!((t=e.constructor)!=null&&t[PP])||mb(e)||bb(e):!1}var Uq=Object.prototype.constructor.toString();function NM(e){if(!e||typeof e!="object")return!1;const t=Uu(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)===Uq}function nh(e,t){gb(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function gb(e){const t=e[Po];return t?t.type_:Array.isArray(e)?1:mb(e)?2:bb(e)?3:0}function ew(e,t){return gb(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function LM(e,t,n){const r=gb(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function qq(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function mb(e){return e instanceof Map}function bb(e){return e instanceof Set}function vl(e){return e.copy_||e.base_}function tw(e,t){if(mb(e))return new Map(e);if(bb(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&NM(e))return Uu(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(Uu(e),n)}function $S(e,t=!1){return vb(e)||qu(e)||!nc(e)||(gb(e)>1&&(e.set=e.add=e.clear=e.delete=Gq),Object.freeze(e),t&&nh(e,(n,r)=>$S(r,!0))),e}function Gq(){Zr(2)}function vb(e){return Object.isFrozen(e)}var Yq={};function rc(e){const t=Yq[e];return t||Zr(0,e),t}var rh;function FM(){return rh}function Kq(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function $P(e,t){t&&(rc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function nw(e){rw(e),e.drafts_.forEach(Xq),e.drafts_=null}function rw(e){e===rh&&(rh=e.parent_)}function OP(e){return rh=Kq(rh,e)}function Xq(e){const t=e[Po];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function TP(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=c0(t,e),t.parent_||u0(t,e)),t.patches_&&rc("Patches").generateReplacementPatches_(n[Po].base_,e,t.patches_,t.inversePatches_)):e=c0(t,n,[]),nw(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==IM?e:void 0}function c0(e,t,n){if(vb(t))return t;const r=t[Po];if(!r)return nh(t,(o,i)=>DP(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return u0(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),nh(i,(s,l)=>DP(e,r,o,s,l,n,a)),u0(e,o,!1),n&&e.patches_&&rc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function DP(e,t,n,r,o,i,a){if(process.env.NODE_ENV!=="production"&&o===n&&Zr(5),qu(o)){const s=i&&t&&t.type_!==3&&!ew(t.assigned_,r)?i.concat(r):void 0,l=c0(e,o,s);if(LM(n,r,l),qu(l))e.canAutoFreeze_=!1;else return}else a&&n.add(o);if(nc(o)&&!vb(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;c0(e,o),(!t||!t.scope_.parent_)&&u0(e,o)}}function u0(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&$S(t,n)}function Qq(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:FM(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=OS;n&&(o=[r],i=oh);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=a,s}var OS={get(e,t){if(t===Po)return e;const n=vl(e);if(!ew(n,t))return Jq(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=jM(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(qq(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 Uu(e.base_)},setPrototypeOf(){Zr(12)}},oh={};nh(OS,(e,t)=>{oh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});oh.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Zr(13),oh.set.call(this,e,t,void 0)};oh.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Zr(14),OS.set.call(this,e[0],t,n,e[0])};function Zy(e,t){const n=e[Po];return(n?vl(n):e)[t]}function Jq(e,t,n){var o;const r=jM(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function jM(e,t){if(!(t in e))return;let n=Uu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Uu(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 Zq=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=OP(this),a=iw(t,void 0);let s=!0;try{o=n(a),s=!1}finally{s?nw(i):rw(i)}return $P(i,r),TP(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===IM&&(o=void 0),this.autoFreeze_&&$S(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),qu(e)&&(e=eG(e));const t=OP(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 $P(r,t),TP(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 qu(e)?r(e,t):this.produce(e,o=>r(o,t))}};function iw(e,t){const n=mb(e)?rc("MapSet").proxyMap_(e,t):bb(e)?rc("MapSet").proxySet_(e,t):Qq(e,t);return(t?t.scope_:FM()).drafts_.push(n),n}function eG(e){return qu(e)||Zr(10,e),zM(e)}function zM(e){if(!nc(e)||vb(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 nh(n,(r,o)=>{LM(n,r,zM(o))}),t&&(t.finalized_=!1),n}var $o=new Zq,tG=$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 nG=e=>(t,n,r)=>(r.setState=(o,i,...a)=>{const s=typeof o=="function"?tG(o):o;return t(s,i,...a)},e(r.setState,n,r)),BM=nG;var aw,Og=Er;if(process.env.NODE_ENV==="production")aw=Og.createRoot,Og.hydrateRoot;else{var AP=Og.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;aw=function(e,t){AP.usingClientEntryPoint=!0;try{return Og.createRoot(e,t)}finally{AP.usingClientEntryPoint=!1}}}var VM={},HM={},TS={exports:{}},vt=String,WM=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}};TS.exports=WM();TS.exports.createColors=WM;var rG=TS.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(rG);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])}}})(HM);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(HM);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}}})(VM);let t1=VM;var oG=(t1.__esModule?t1:{default:t1}).default;const Yt=mc(oG),UM=`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
- `,qM="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"}],iG=[{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)"}]}],DS=["lg","md","sm","xs","xxs"],d0={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=ih()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=ih()),Gu(n)}function ih(){return we.getState().theme==="dark"?"#000000":"#FFFFFF"}function Gu(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),b=parseInt(d.substring(4,6),16);t+=h,n+=p,r+=b,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 yb=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],ap=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],pd=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],AS=["boolean"];function MS(e){return e.match(/[A-Z]/)?`"${e}"`:e}function aG(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?`${qM}.${r}`:GM(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 sG(e,t,n="AVG"){var i,a,s,l;let r={};const o=MS(e.column_name);return yb.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]}),ap.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 yb.includes(e.dataType)?"string":ap.includes(e.dataType)?"number":pd.includes(e.dataType)?"date":AS.includes(e.dataType)?"boolean":"string"}function lG(e){let t;const n=e.data_type.toLowerCase();return yb.includes(n)?t="T":ap.includes(n)?t="#":pd.includes(n)?t="D":AS.includes(n)?t="B":t="?",t}function cG(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 GM(e,t){return t==="api"||e===MS("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const uG=e=>{const t=new Date(e);return!isNaN(t.getTime())},dG=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),xb=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?uG(e)?t="date":dG(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function fG({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:xb(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 f0={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
- */f0.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,b=1,v=2,x=1,y=2,_=4,S=8,C=16,E=32,$=64,D=128,T=256,A=512,L=30,F="...",z=800,X=16,G=1,M=2,U=3,V=1/0,Y=9007199254740991,q=17976931348623157e292,O=NaN,H=4294967295,K=H-1,I=H>>>1,oe=[["ary",D],["bind",x],["bindKey",y],["curry",S],["curryRight",C],["flip",A],["partial",E],["partialRight",$],["rearg",T]],ce="[object Arguments]",de="[object Array]",he="[object AsyncFunction]",ie="[object Boolean]",ne="[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),ri=RegExp(_t.source),Ya=/<%-([\s\S]+?)%>/g,oi=/<%([\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=/,? & /,te=/[^\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",Io="\\ufe20-\\ufe2f",el="\\u20d0-\\u20ff",Zn=gr+Io+el,Td="\\u2700-\\u27bf",Dd="a-z\\xdf-\\xf6\\xf8-\\xff",kF="\\xac\\xb1\\xd7\\xf7",IF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",NF="\\u2000-\\u206f",LF=" \\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",G2="A-Z\\xc0-\\xd6\\xd8-\\xde",Y2="\\ufe0e\\ufe0f",K2=kF+IF+NF+LF,Fv="['’]",FF="["+pt+"]",X2="["+K2+"]",zp="["+Zn+"]",Q2="\\d+",jF="["+Td+"]",J2="["+Dd+"]",Z2="[^"+pt+K2+Q2+Td+Dd+G2+"]",jv="\\ud83c[\\udffb-\\udfff]",zF="(?:"+zp+"|"+jv+")",eR="[^"+pt+"]",zv="(?:\\ud83c[\\udde6-\\uddff]){2}",Bv="[\\ud800-\\udbff][\\udc00-\\udfff]",Dc="["+G2+"]",tR="\\u200d",nR="(?:"+J2+"|"+Z2+")",BF="(?:"+Dc+"|"+Z2+")",rR="(?:"+Fv+"(?:d|ll|m|re|s|t|ve))?",oR="(?:"+Fv+"(?:D|LL|M|RE|S|T|VE))?",iR=zF+"?",aR="["+Y2+"]?",VF="(?:"+tR+"(?:"+[eR,zv,Bv].join("|")+")"+aR+iR+")*",HF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",WF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sR=aR+iR+VF,UF="(?:"+[jF,zv,Bv].join("|")+")"+sR,qF="(?:"+[eR+zp+"?",zp,zv,Bv,FF].join("|")+")",GF=RegExp(Fv,"g"),YF=RegExp(zp,"g"),Vv=RegExp(jv+"(?="+jv+")|"+qF+sR,"g"),KF=RegExp([Dc+"?"+J2+"+"+rR+"(?="+[X2,Dc,"$"].join("|")+")",BF+"+"+oR+"(?="+[X2,Dc+nR,"$"].join("|")+")",Dc+"?"+nR+"+"+rR,Dc+"+"+oR,WF,HF,Q2,UF].join("|"),"g"),XF=RegExp("["+tR+pt+Zn+Y2+"]"),QF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,JF=["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"],ZF=-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[ne]=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[ne]=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 ej={À:"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"},tj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},nj={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},rj={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},oj=parseFloat,ij=parseInt,lR=typeof ys=="object"&&ys&&ys.Object===Object&&ys,aj=typeof self=="object"&&self&&self.Object===Object&&self,ir=lR||aj||Function("return this")(),Hv=t&&!t.nodeType&&t,tl=Hv&&!0&&e&&!e.nodeType&&e,cR=tl&&tl.exports===Hv,Wv=cR&&lR.process,No=function(){try{var ae=tl&&tl.require&&tl.require("util").types;return ae||Wv&&Wv.binding&&Wv.binding("util")}catch{}}(),uR=No&&No.isArrayBuffer,dR=No&&No.isDate,fR=No&&No.isMap,hR=No&&No.isRegExp,pR=No&&No.isSet,gR=No&&No.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 sj(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 Lo(ae,be){for(var ge=-1,He=ae==null?0:ae.length;++ge<He&&be(ae[ge],ge,ae)!==!1;);return ae}function lj(ae,be){for(var ge=ae==null?0:ae.length;ge--&&be(ae[ge],ge,ae)!==!1;);return ae}function mR(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 Bp(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 cj(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 uj=Yv("length");function dj(ae){return ae.split("")}function fj(ae){return ae.match(te)||[]}function bR(ae,be,ge){var He;return ge(ae,function(ft,qt,Gn){if(be(ft,qt,Gn))return He=qt,!1}),He}function Vp(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?Cj(ae,be,ge):Vp(ae,vR,ge)}function hj(ae,be,ge,He){for(var ft=ge-1,qt=ae.length;++ft<qt;)if(He(ae[ft],be))return ft;return-1}function vR(ae){return ae!==ae}function yR(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 xR(ae,be,ge,He,ft){return ft(ae,function(qt,Gn,fn){ge=He?(He=!1,qt):be(ge,qt,Gn,fn)}),ge}function pj(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 gj(ae,be){return Pn(be,function(ge){return[ge,ae[ge]]})}function wR(ae){return ae&&ae.slice(0,ER(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 Ad(ae,be){return ae.has(be)}function _R(ae,be){for(var ge=-1,He=ae.length;++ge<He&&Ac(be,ae[ge],0)>-1;);return ge}function SR(ae,be){for(var ge=ae.length;ge--&&Ac(be,ae[ge],0)>-1;);return ge}function mj(ae,be){for(var ge=ae.length,He=0;ge--;)ae[ge]===be&&++He;return He}var bj=Kv(ej),vj=Kv(tj);function yj(ae){return"\\"+rj[ae]}function xj(ae,be){return ae==null?n:ae[be]}function Mc(ae){return XF.test(ae)}function wj(ae){return QF.test(ae)}function _j(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 CR(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 Hp(ae){var be=-1,ge=Array(ae.size);return ae.forEach(function(He){ge[++be]=He}),ge}function Sj(ae){var be=-1,ge=Array(ae.size);return ae.forEach(function(He){ge[++be]=[He,He]}),ge}function Cj(ae,be,ge){for(var He=ge-1,ft=ae.length;++He<ft;)if(ae[He]===be)return He;return-1}function Ej(ae,be,ge){for(var He=ge+1;He--;)if(ae[He]===be)return He;return He}function kc(ae){return Mc(ae)?Pj(ae):uj(ae)}function ii(ae){return Mc(ae)?$j(ae):dj(ae)}function ER(ae){for(var be=ae.length;be--&&Ri.test(ae.charAt(be)););return be}var Rj=Kv(nj);function Pj(ae){for(var be=Vv.lastIndex=0;Vv.test(ae);)++be;return be}function $j(ae){return ae.match(Vv)||[]}function Oj(ae){return ae.match(KF)||[]}var Tj=function ae(be){be=be==null?ir:Ic.defaults(ir.Object(),be,Ic.pick(ir,JF));var ge=be.Array,He=be.Date,ft=be.Error,qt=be.Function,Gn=be.Math,fn=be.Object,ey=be.RegExp,Dj=be.String,Fo=be.TypeError,Wp=ge.prototype,Aj=qt.prototype,Nc=fn.prototype,Up=be["__core-js_shared__"],qp=Aj.toString,an=Nc.hasOwnProperty,Mj=0,RR=function(){var f=/[^.]+$/.exec(Up&&Up.keys&&Up.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),Gp=Nc.toString,kj=qp.call(fn),Ij=ir._,Nj=ey("^"+qp.call(an).replace(Ei,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yp=cR?be.Buffer:n,ts=be.Symbol,Kp=be.Uint8Array,PR=Yp?Yp.allocUnsafe:n,Xp=CR(fn.getPrototypeOf,fn),$R=fn.create,OR=Nc.propertyIsEnumerable,Qp=Wp.splice,TR=ts?ts.isConcatSpreadable:n,Md=ts?ts.iterator:n,nl=ts?ts.toStringTag:n,Jp=function(){try{var f=sl(fn,"defineProperty");return f({},"",{}),f}catch{}}(),Lj=be.clearTimeout!==ir.clearTimeout&&be.clearTimeout,Fj=He&&He.now!==ir.Date.now&&He.now,jj=be.setTimeout!==ir.setTimeout&&be.setTimeout,Zp=Gn.ceil,eg=Gn.floor,ty=fn.getOwnPropertySymbols,zj=Yp?Yp.isBuffer:n,DR=be.isFinite,Bj=Wp.join,Vj=CR(fn.keys,fn),Yn=Gn.max,mr=Gn.min,Hj=He.now,Wj=be.parseInt,AR=Gn.random,Uj=Wp.reverse,ny=sl(be,"DataView"),kd=sl(be,"Map"),ry=sl(be,"Promise"),Lc=sl(be,"Set"),Id=sl(be,"WeakMap"),Nd=sl(fn,"create"),tg=Id&&new Id,Fc={},qj=ll(ny),Gj=ll(kd),Yj=ll(ry),Kj=ll(Lc),Xj=ll(Id),ng=ts?ts.prototype:n,Ld=ng?ng.valueOf:n,MR=ng?ng.toString:n;function B(f){if(Mn(f)&&!ht(f)&&!(f instanceof Lt)){if(f instanceof jo)return f;if(an.call(f,"__wrapped__"))return k5(f)}return new jo(f)}var jc=function(){function f(){}return function(g){if(!On(g))return{};if($R)return $R(g);f.prototype=g;var w=new f;return f.prototype=n,w}}();function rg(){}function jo(f,g){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}B.templateSettings={escape:Ya,evaluate:oi,interpolate:aa,variable:"",imports:{_:B}},B.prototype=rg.prototype,B.prototype.constructor=B,jo.prototype=jc(rg.prototype),jo.prototype.constructor=jo;function Lt(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function Qj(){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 Jj(){if(this.__filtered__){var f=new Lt(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function Zj(){var f=this.__wrapped__.value(),g=this.__dir__,w=ht(f),P=g<0,N=w?f.length:0,W=dB(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 r5(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==M)tt=Or;else if(!Or){if(uo==G)continue e;break e}}et[je++]=tt}return et}Lt.prototype=jc(rg.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 ez(){this.__data__=Nd?Nd(null):{},this.size=0}function tz(f){var g=this.has(f)&&delete this.__data__[f];return this.size-=g?1:0,g}function nz(f){var g=this.__data__;if(Nd){var w=g[f];return w===l?n:w}return an.call(g,f)?g[f]:n}function rz(f){var g=this.__data__;return Nd?g[f]!==n:an.call(g,f)}function oz(f,g){var w=this.__data__;return this.size+=this.has(f)?0:1,w[f]=Nd&&g===n?l:g,this}rl.prototype.clear=ez,rl.prototype.delete=tz,rl.prototype.get=nz,rl.prototype.has=rz,rl.prototype.set=oz;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 iz(){this.__data__=[],this.size=0}function az(f){var g=this.__data__,w=og(g,f);if(w<0)return!1;var P=g.length-1;return w==P?g.pop():Qp.call(g,w,1),--this.size,!0}function sz(f){var g=this.__data__,w=og(g,f);return w<0?n:g[w][1]}function lz(f){return og(this.__data__,f)>-1}function cz(f,g){var w=this.__data__,P=og(w,f);return P<0?(++this.size,w.push([f,g])):w[P][1]=g,this}ca.prototype.clear=iz,ca.prototype.delete=az,ca.prototype.get=sz,ca.prototype.has=lz,ca.prototype.set=cz;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 uz(){this.size=0,this.__data__={hash:new rl,map:new(kd||ca),string:new rl}}function dz(f){var g=mg(this,f).delete(f);return this.size-=g?1:0,g}function fz(f){return mg(this,f).get(f)}function hz(f){return mg(this,f).has(f)}function pz(f,g){var w=mg(this,f),P=w.size;return w.set(f,g),this.size+=w.size==P?0:1,this}ua.prototype.clear=uz,ua.prototype.delete=dz,ua.prototype.get=fz,ua.prototype.has=hz,ua.prototype.set=pz;function ol(f){var g=-1,w=f==null?0:f.length;for(this.__data__=new ua;++g<w;)this.add(f[g])}function gz(f){return this.__data__.set(f,l),this}function mz(f){return this.__data__.has(f)}ol.prototype.add=ol.prototype.push=gz,ol.prototype.has=mz;function ai(f){var g=this.__data__=new ca(f);this.size=g.size}function bz(){this.__data__=new ca,this.size=0}function vz(f){var g=this.__data__,w=g.delete(f);return this.size=g.size,w}function yz(f){return this.__data__.get(f)}function xz(f){return this.__data__.has(f)}function wz(f,g){var w=this.__data__;if(w instanceof ca){var P=w.__data__;if(!kd||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}ai.prototype.clear=bz,ai.prototype.delete=vz,ai.prototype.get=yz,ai.prototype.has=xz,ai.prototype.set=wz;function kR(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,Dj):[],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 IR(f){var g=f.length;return g?f[py(0,g-1)]:n}function _z(f,g){return bg(Vr(f),il(g,0,f.length))}function Sz(f){return bg(Vr(f))}function oy(f,g,w){(w!==n&&!si(f[g],w)||w===n&&!(g in f))&&da(f,g,w)}function Fd(f,g,w){var P=f[g];(!(an.call(f,g)&&si(P,w))||w===n&&!(g in f))&&da(f,g,w)}function og(f,g){for(var w=f.length;w--;)if(si(f[w][0],g))return w;return-1}function Cz(f,g,w,P){return ns(f,function(N,W,Q){g(P,N,w(N),Q)}),P}function NR(f,g){return f&&$i(g,er(g),f)}function Ez(f,g){return f&&$i(g,Wr(g),f)}function da(f,g,w){g=="__proto__"&&Jp?Jp(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 zo(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=hB(f),!ee)return Vr(f,Q)}else{var Pe=br(f),je=Pe==Z||Pe==ve;if(as(f))return a5(f,ee);if(Pe==We||Pe==ce||je&&!N){if(Q=se||je?{}:E5(f),!ee)return se?nB(f,Ez(Q,f)):tB(f,NR(Q,f))}else{if(!pn[Pe])return N?f:{};Q=pB(f,Pe,ee)}}W||(W=new ai);var Ye=W.get(f);if(Ye)return Ye;W.set(f,Q),eP(f)?f.forEach(function(tt){Q.add(zo(tt,g,w,tt,f,W))}):J5(f)&&f.forEach(function(tt,At){Q.set(At,zo(tt,g,w,At,f,W))});var et=_e?se?Ey:Cy:se?Wr:er,St=Se?n:et(f);return Lo(St||f,function(tt,At){St&&(At=tt,tt=f[At]),Fd(Q,At,zo(tt,g,w,At,f,W))}),Q}function Rz(f){var g=er(f);return function(w){return LR(w,f,g)}}function LR(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 FR(f,g,w){if(typeof f!="function")throw new Fo(a);return Ud(function(){f.apply(n,w)},g)}function jd(f,g,w,P){var N=-1,W=Bp,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=Ad,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=d5(Pi),jR=d5(sy,!0);function Pz(f,g){var w=!0;return ns(f,function(P,N,W){return w=!!g(P,N,W),w}),w}function ig(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 $z(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:nP(P);w<P;)f[w++]=g;return f}function zR(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=mB),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=f5(),BR=f5(!0);function Pi(f,g){return f&&ay(f,g,er)}function sy(f,g){return f&&BR(f,g,er)}function ag(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 VR(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)?uB(f):SB(f)}function ly(f,g){return f>g}function Oz(f,g){return f!=null&&an.call(f,g)}function Tz(f,g){return f!=null&&g in fn(f)}function Dz(f,g,w){return f>=mr(g,w)&&f<Yn(g,w)}function cy(f,g,w){for(var P=w?Uv:Bp,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?Ad(je,et):P(_e,et,w))){for(Q=W;--Q;){var St=ee[Q];if(!(St?Ad(St,et):P(f[Q],et,w)))continue e}je&&je.push(et),_e.push(Ye)}}return _e}function Az(f,g,w,P){return Pi(f,function(N,W,Q){g(P,w(N),W,Q)}),P}function zd(f,g,w){g=os(g,f),f=O5(f,g);var P=f==null?f:f[Oi(Vo(g))];return P==null?n:ao(P,f,w)}function HR(f){return Mn(f)&&Pr(f)==ce}function Mz(f){return Mn(f)&&Pr(f)==Le}function kz(f){return Mn(f)&&Pr(f)==ne}function Bd(f,g,w,P,N){return f===g?!0:f==null||g==null||!Mn(f)&&!Mn(g)?f!==f&&g!==g:Iz(f,g,w,P,Bd,N)}function Iz(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 ai),Q||Hc(f)?_5(f,g,w,P,N,W):lB(f,g,se,w,P,N,W);if(!(w&b)){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 ai),N(St,tt,w,P,W)}}return je?(W||(W=new ai),cB(f,g,w,P,N,W)):!1}function Nz(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 ai;if(P)var je=P(_e,Se,se,f,g,Pe);if(!(je===n?Bd(Se,_e,b|v,P,Pe):je))return!1}}return!0}function WR(f){if(!On(f)||vB(f))return!1;var g=ga(f)?Nj:Ae;return g.test(ll(f))}function Lz(f){return Mn(f)&&Pr(f)==Ke}function Fz(f){return Mn(f)&&br(f)==dt}function jz(f){return Mn(f)&&Sg(f.length)&&!!yn[Pr(f)]}function UR(f){return typeof f=="function"?f:f==null?Ur:typeof f=="object"?ht(f)?YR(f[0],f[1]):GR(f):hP(f)}function dy(f){if(!Wd(f))return Vj(f);var g=[];for(var w in fn(f))an.call(f,w)&&w!="constructor"&&g.push(w);return g}function zz(f){if(!On(f))return _B(f);var g=Wd(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 qR(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 GR(f){var g=Py(f);return g.length==1&&g[0][2]?P5(g[0][0],g[0][1]):function(w){return w===f||uy(w,f,g)}}function YR(f,g){return Oy(f)&&R5(g)?P5(Oi(f),g):function(w){var P=jy(w,f);return P===n&&P===g?zy(w,f):Bd(g,P,b|v)}}function sg(f,g,w,P,N){f!==g&&ay(g,function(W,Q){if(N||(N=new ai),On(W))Bz(f,g,Q,w,sg,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 Bz(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=a5(se,!0)):et?(Pe=!1,Se=s5(se,!0)):Se=[]:qd(se)||cl(se)?(Se=ee,cl(ee)?Se=rP(ee):(!On(ee)||ga(ee))&&(Se=E5(se))):Pe=!1}Pe&&(Q.set(se,Se),N(Se,se,P,W,Q),Q.delete(se)),oy(f,w,Se)}function KR(f,g){var w=f.length;if(w)return g+=g<0?w:0,pa(g,w)?f[g]:n}function XR(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=qR(f,function(W,Q,ee){var se=Pn(g,function(_e){return _e(W)});return{criteria:se,index:++P,value:W}});return pj(N,function(W,Q){return eB(W,Q,w)})}function Vz(f,g){return QR(f,g,function(w,P){return zy(f,P)})}function QR(f,g,w){for(var P=-1,N=g.length,W={};++P<N;){var Q=g[P],ee=al(f,Q);w(ee,Q)&&Vd(W,os(Q,f),ee)}return W}function Hz(f){return function(g){return al(g,f)}}function hy(f,g,w,P){var N=P?hj: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&&Qp.call(ee,se,1),Qp.call(f,se,1);return f}function JR(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)?Qp.call(f,N,1):by(f,N)}}return f}function py(f,g){return f+eg(AR()*(g-f+1))}function Wz(f,g,w,P){for(var N=-1,W=Yn(Zp((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>Y)return w;do g%2&&(w+=f),g=eg(g/2),g&&(f+=f);while(g);return w}function Pt(f,g){return Ay($5(f,g,Ur),f+"")}function Uz(f){return IR(Wc(f))}function qz(f,g){var w=Wc(f);return bg(w,il(g,0,w.length))}function Vd(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])?[]:{})}Fd(ee,se,_e),ee=ee[se]}return f}var ZR=tg?function(f,g){return tg.set(f,g),f}:Ur,Gz=Jp?function(f,g){return Jp(f,"toString",{configurable:!0,enumerable:!1,value:Vy(g),writable:!0})}:Ur;function Yz(f){return bg(Wc(f))}function Bo(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 Kz(f,g){var w;return ns(f,function(P,N,W){return w=g(P,N,W),!w}),!!w}function lg(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=eg((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,K)}function e5(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||!si(ee,se)){var se=ee;W[N++]=Q===0?0:Q}}return W}function t5(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 MR?MR.call(f):"";var g=f+"";return g=="0"&&1/f==-V?"-0":g}function rs(f,g,w){var P=-1,N=Bp,W=f.length,Q=!0,ee=[],se=ee;if(w)Q=!1,N=Uv;else if(W>=o){var _e=g?null:aB(f);if(_e)return Hp(_e);Q=!1,N=Ad,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=O5(f,g),f==null||delete f[Oi(Vo(g))]}function n5(f,g,w,P){return Vd(f,g,w(al(f,g)),P)}function cg(f,g,w,P){for(var N=f.length,W=P?N:-1;(P?W--:++W<N)&&g(f[W],W,f););return w?Bo(f,P?0:W,P?W+1:N):Bo(f,P?W+1:0,P?N:W)}function r5(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]=jd(W[N]||Q,f[ee],g,w));return rs(ar(W,1),g,w)}function o5(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]:M5(Zt(f))}var Xz=Pt;function is(f,g,w){var P=f.length;return w=w===n?P:w,!g&&w>=P?f:Bo(f,g,w)}var i5=Lj||function(f){return ir.clearTimeout(f)};function a5(f,g){if(g)return f.slice();var w=f.length,P=PR?PR(w):new f.constructor(w);return f.copy(P),P}function wy(f){var g=new f.constructor(f.byteLength);return new Kp(g).set(new Kp(f)),g}function Qz(f,g){var w=g?wy(f.buffer):f.buffer;return new f.constructor(w,f.byteOffset,f.byteLength)}function Jz(f){var g=new f.constructor(f.source,qe.exec(f));return g.lastIndex=f.lastIndex,g}function Zz(f){return Ld?fn(Ld.call(f)):{}}function s5(f,g){var w=g?wy(f.buffer):f.buffer;return new f.constructor(w,f.byteOffset,f.length)}function l5(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 eB(f,g,w){for(var P=-1,N=f.criteria,W=g.criteria,Q=N.length,ee=w.length;++P<Q;){var se=l5(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 c5(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 u5(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):Fd(w,ee,se)}return w}function tB(f,g){return $i(f,$y(f),g)}function nB(f,g){return $i(f,S5(f),g)}function ug(f,g){return function(w,P){var N=ht(w)?sj:Cz,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 d5(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 f5(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 rB(f,g,w){var P=g&x,N=Hd(f);function W(){var Q=this&&this!==ir&&this instanceof W?N:f;return Q.apply(P?w:this,arguments)}return W}function h5(f){return function(g){g=Zt(g);var w=Mc(g)?ii(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(dP(uP(g).replace(GF,"")),f,"")}}function Hd(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 oB(f,g,w){var P=Hd(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 v5(f,g,dg,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 p5(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 g5(f){return ha(function(g){var w=g.length,P=w,N=jo.prototype.thru;for(f&&g.reverse();P--;){var W=g[P];if(typeof W!="function")throw new Fo(a);if(N&&!Q&&gg(W)=="wrapper")var Q=new jo([],!0)}for(P=Q?P:w;++P<w;){W=g[P];var ee=gg(W),se=ee=="wrapper"?Ry(W):n;se&&Ty(se[0])&&se[1]==(D|S|E|T)&&!se[4].length&&se[9]==1?Q=Q[gg(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 dg(f,g,w,P,N,W,Q,ee,se,_e){var Se=g&D,Pe=g&x,je=g&y,Ye=g&(S|C),et=g&A,St=je?n:Hd(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=mj(Ft,Or);if(P&&(Ft=c5(Ft,P,N,Ye)),W&&(Ft=u5(Ft,W,Q,Ye)),At-=fo,Ye&&At<_e){var Vn=es(Ft,Or);return v5(f,g,dg,tt.placeholder,w,Ft,Vn,ee,se,_e-At)}var li=Pe?w:this,ba=je?li[f]:f;return At=Ft.length,ee?Ft=CB(Ft,ee):et&&At>1&&Ft.reverse(),Se&&se<At&&(Ft.length=se),this&&this!==ir&&this instanceof tt&&(ba=St||Hd(ba)),ba.apply(li,Ft)}return tt}function m5(f,g){return function(w,P){return Az(w,f,g(P),{})}}function fg(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=t5(w),P=t5(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 hg(f,g){g=g===n?" ":lo(g);var w=g.length;if(w<2)return w?gy(g,f):g;var P=gy(g,Zp(f/kc(g)));return Mc(g)?is(ii(P),0,f).join(""):P.slice(0,f)}function iB(f,g,w,P){var N=g&x,W=Hd(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 b5(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),Wz(g,w,P,f)}}function pg(f){return function(g,w){return typeof g=="string"&&typeof w=="string"||(g=Ho(g),w=Ho(w)),f(g,w)}}function v5(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)&&T5(tt,St),tt.placeholder=P,D5(tt,f,g)}function Sy(f){var g=Gn[f];return function(w,P){if(w=Ho(w),P=P==null?0:mr(bt(P),292),P&&DR(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 aB=Lc&&1/Hp(new Lc([,-0]))[1]==V?function(f){return new Lc(f)}:Uy;function y5(f){return function(g){var w=br(g);return w==Ce?Zv(g):w==dt?Sj(g):gj(g,f(g))}}function fa(f,g,w,P,N,W,Q,ee){var se=g&y;if(!se&&typeof f!="function")throw new Fo(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&&wB(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=rB(f,g,w);else g==S||g==C?et=oB(f,g,ee):(g==E||g==(x|E))&&!N.length?et=iB(f,g,w,P):et=dg.apply(n,Ye);var St=je?ZR:T5;return D5(St(et,Ye),f,g)}function x5(f,g,w,P){return f===n||si(f,Nc[w])&&!an.call(P,w)?g:f}function w5(f,g,w,P,N,W){return On(f)&&On(g)&&(W.set(g,f),sg(f,g,n,w5,W),W.delete(g)),f}function sB(f){return qd(f)?n:f}function _5(f,g,w,P,N,W){var Q=w&b,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&v?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(!Ad(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 lB(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 Kp(f),new Kp(g)));case ie:case ne:case Oe:return si(+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&b;if(ee||(ee=Hp),f.size!=g.size&&!se)return!1;var _e=Q.get(f);if(_e)return _e==g;P|=v,Q.set(f,g);var Se=_5(ee(f),ee(g),P,N,W,Q);return Q.delete(f),Se;case It:if(Ld)return Ld.call(f)==Ld.call(g)}return!1}function cB(f,g,w,P,N,W){var Q=w&b,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($5(f,n,L5),f+"")}function Cy(f){return VR(f,er,$y)}function Ey(f){return VR(f,Wr,S5)}var Ry=tg?function(f){return tg.get(f)}:Uy;function gg(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?UR:f,arguments.length?f(arguments[0],arguments[1]):f}function mg(f,g){var w=f.__data__;return bB(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,R5(N)]}return g}function sl(f,g){var w=xj(f,g);return WR(w)?w:n}function uB(f){var g=an.call(f,nl),w=f[nl];try{f[nl]=n;var P=!0}catch{}var N=Gp.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 OR.call(f,g)}))}:qy,S5=ty?function(f){for(var g=[];f;)Za(g,$y(f)),f=Xp(f);return g}:qy,br=Pr;(ny&&br(new ny(new ArrayBuffer(1)))!=Ge||kd&&br(new kd)!=Ce||ry&&br(ry.resolve())!=Be||Lc&&br(new Lc)!=dt||Id&&br(new Id)!=pe)&&(br=function(f){var g=Pr(f),w=g==We?f.constructor:n,P=w?ll(w):"";if(P)switch(P){case qj:return Ge;case Gj:return Ce;case Yj:return Be;case Kj:return dt;case Xj:return pe}return g});function dB(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 fB(f){var g=f.match(Qa);return g?g[1].split(k):[]}function C5(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&&Sg(N)&&pa(Q,N)&&(ht(f)||cl(f)))}function hB(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 E5(f){return typeof f.constructor=="function"&&!Wd(f)?jc(Xp(f)):{}}function pB(f,g,w){var P=f.constructor;switch(g){case Le:return wy(f);case ie:case ne:return new P(+f);case Ge:return Qz(f,w);case Ze:case Jt:case ln:case rn:case En:case vn:case Wt:case dn:case $n:return s5(f,w);case Ce:return new P;case Oe:case Bt:return new P(f);case Ke:return Jz(f);case dt:return new P;case It:return Zz(f)}}function gB(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 mB(f){return ht(f)||cl(f)||!!(TR&&f&&f[TR])}function pa(f,g){var w=typeof f;return g=g??Y,!!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)?si(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 bB(f){var g=typeof f;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?f!=="__proto__":f===null}function Ty(f){var g=gg(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 vB(f){return!!RR&&RR in f}var yB=Up?ga:Gy;function Wd(f){var g=f&&f.constructor,w=typeof g=="function"&&g.prototype||Nc;return f===w}function R5(f){return f===f&&!On(f)}function P5(f,g){return function(w){return w==null?!1:w[f]===g&&(g!==n||f in fn(w))}}function xB(f){var g=wg(f,function(P){return w.size===c&&w.clear(),P}),w=g.cache;return g}function wB(f,g){var w=f[1],P=g[1],N=w|P,W=N<(x|y|D),Q=P==D&&w==S||P==D&&w==T&&f[7].length<=g[8]||P==(D|T)&&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?c5(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?u5(se,ee,g[6]):ee,f[6]=se?es(f[5],u):g[6]),ee=g[7],ee&&(f[7]=ee),P&D&&(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 _B(f){var g=[];if(f!=null)for(var w in fn(f))g.push(w);return g}function SB(f){return Gp.call(f)}function $5(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 O5(f,g){return g.length<2?f:al(f,Bo(g,0,-1))}function CB(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 T5=A5(ZR),Ud=jj||function(f,g){return ir.setTimeout(f,g)},Ay=A5(Gz);function D5(f,g,w){var P=g+"";return Ay(f,gB(P,EB(fB(P),w)))}function A5(f){var g=0,w=0;return function(){var P=Hj(),N=X-(P-w);if(w=P,N>0){if(++g>=z)return arguments[0]}else g=0;return f.apply(n,arguments)}}function bg(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 M5=xB(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 qp.call(f)}catch{}try{return f+""}catch{}}return""}function EB(f,g){return Lo(oe,function(w){var P="_."+w[0];g&w[1]&&!Bp(f,P)&&f.push(P)}),f.sort()}function k5(f){if(f instanceof Lt)return f.clone();var g=new jo(f.__wrapped__,f.__chain__);return g.__actions__=Vr(f.__actions__),g.__index__=f.__index__,g.__values__=f.__values__,g}function RB(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(Zp(P/g));N<P;)Q[W++]=Bo(f,N,N+=g);return Q}function PB(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 $B(){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 OB=Pt(function(f,g){return Bn(f)?jd(f,ar(g,1,Bn,!0)):[]}),TB=Pt(function(f,g){var w=Vo(g);return Bn(w)&&(w=n),Bn(f)?jd(f,ar(g,1,Bn,!0),Je(w,2)):[]}),DB=Pt(function(f,g){var w=Vo(g);return Bn(w)&&(w=n),Bn(f)?jd(f,ar(g,1,Bn,!0),n,w):[]});function AB(f,g,w){var P=f==null?0:f.length;return P?(g=w||g===n?1:bt(g),Bo(f,g<0?0:g,P)):[]}function MB(f,g,w){var P=f==null?0:f.length;return P?(g=w||g===n?1:bt(g),g=P-g,Bo(f,0,g<0?0:g)):[]}function kB(f,g){return f&&f.length?cg(f,Je(g,3),!0,!0):[]}function IB(f,g){return f&&f.length?cg(f,Je(g,3),!0):[]}function NB(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),$z(f,g,w,P)):[]}function I5(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)),Vp(f,Je(g,3),N)}function N5(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)),Vp(f,Je(g,3),N,!0)}function L5(f){var g=f==null?0:f.length;return g?ar(f,1):[]}function LB(f){var g=f==null?0:f.length;return g?ar(f,V):[]}function FB(f,g){var w=f==null?0:f.length;return w?(g=g===n?1:bt(g),ar(f,g)):[]}function jB(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 F5(f){return f&&f.length?f[0]:n}function zB(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 BB(f){var g=f==null?0:f.length;return g?Bo(f,0,-1):[]}var VB=Pt(function(f){var g=Pn(f,yy);return g.length&&g[0]===f[0]?cy(g):[]}),HB=Pt(function(f){var g=Vo(f),w=Pn(f,yy);return g===Vo(w)?g=n:w.pop(),w.length&&w[0]===f[0]?cy(w,Je(g,2)):[]}),WB=Pt(function(f){var g=Vo(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 UB(f,g){return f==null?"":Bj.call(f,g)}function Vo(f){var g=f==null?0:f.length;return g?f[g-1]:n}function qB(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?Ej(f,g,N):Vp(f,vR,N,!0)}function GB(f,g){return f&&f.length?KR(f,bt(g)):n}var YB=Pt(j5);function j5(f,g){return f&&f.length&&g&&g.length?hy(f,g):f}function KB(f,g,w){return f&&f.length&&g&&g.length?hy(f,g,Je(w,2)):f}function XB(f,g,w){return f&&f.length&&g&&g.length?hy(f,g,n,w):f}var QB=ha(function(f,g){var w=f==null?0:f.length,P=iy(f,g);return JR(f,Pn(g,function(N){return pa(N,w)?+N:N}).sort(l5)),P});function JB(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 JR(f,N),w}function My(f){return f==null?f:Uj.call(f)}function ZB(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)),Bo(f,g,w)):[]}function eV(f,g){return lg(f,g)}function tV(f,g,w){return my(f,g,Je(w,2))}function nV(f,g){var w=f==null?0:f.length;if(w){var P=lg(f,g);if(P<w&&si(f[P],g))return P}return-1}function rV(f,g){return lg(f,g,!0)}function oV(f,g,w){return my(f,g,Je(w,2),!0)}function iV(f,g){var w=f==null?0:f.length;if(w){var P=lg(f,g,!0)-1;if(si(f[P],g))return P}return-1}function aV(f){return f&&f.length?e5(f):[]}function sV(f,g){return f&&f.length?e5(f,Je(g,2)):[]}function lV(f){var g=f==null?0:f.length;return g?Bo(f,1,g):[]}function cV(f,g,w){return f&&f.length?(g=w||g===n?1:bt(g),Bo(f,0,g<0?0:g)):[]}function uV(f,g,w){var P=f==null?0:f.length;return P?(g=w||g===n?1:bt(g),g=P-g,Bo(f,g<0?0:g,P)):[]}function dV(f,g){return f&&f.length?cg(f,Je(g,3),!1,!0):[]}function fV(f,g){return f&&f.length?cg(f,Je(g,3)):[]}var hV=Pt(function(f){return rs(ar(f,1,Bn,!0))}),pV=Pt(function(f){var g=Vo(f);return Bn(g)&&(g=n),rs(ar(f,1,Bn,!0),Je(g,2))}),gV=Pt(function(f){var g=Vo(f);return g=typeof g=="function"?g:n,rs(ar(f,1,Bn,!0),n,g)});function mV(f){return f&&f.length?rs(f):[]}function bV(f,g){return f&&f.length?rs(f,Je(g,2)):[]}function vV(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 z5(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 yV=Pt(function(f,g){return Bn(f)?jd(f,g):[]}),xV=Pt(function(f){return vy(Ja(f,Bn))}),wV=Pt(function(f){var g=Vo(f);return Bn(g)&&(g=n),vy(Ja(f,Bn),Je(g,2))}),_V=Pt(function(f){var g=Vo(f);return g=typeof g=="function"?g:n,vy(Ja(f,Bn),n,g)}),SV=Pt(ky);function CV(f,g){return o5(f||[],g||[],Fd)}function EV(f,g){return o5(f||[],g||[],Vd)}var RV=Pt(function(f){var g=f.length,w=g>1?f[g-1]:n;return w=typeof w=="function"?(f.pop(),w):n,z5(f,w)});function B5(f){var g=B(f);return g.__chain__=!0,g}function PV(f,g){return g(f),f}function vg(f,g){return g(f)}var $V=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:vg,args:[N],thisArg:n}),new jo(P,this.__chain__).thru(function(W){return g&&!W.length&&W.push(n),W}))});function OV(){return B5(this)}function TV(){return new jo(this.value(),this.__chain__)}function DV(){this.__values__===n&&(this.__values__=tP(this.value()));var f=this.__index__>=this.__values__.length,g=f?n:this.__values__[this.__index__++];return{done:f,value:g}}function AV(){return this}function MV(f){for(var g,w=this;w instanceof rg;){var P=k5(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 kV(){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:vg,args:[My],thisArg:n}),new jo(g,this.__chain__)}return this.thru(My)}function IV(){return r5(this.__wrapped__,this.__actions__)}var NV=ug(function(f,g,w){an.call(f,w)?++f[w]:da(f,w,1)});function LV(f,g,w){var P=ht(f)?mR:Pz;return w&&$r(f,g,w)&&(g=n),P(f,Je(g,3))}function FV(f,g){var w=ht(f)?Ja:zR;return w(f,Je(g,3))}var jV=p5(I5),zV=p5(N5);function BV(f,g){return ar(yg(f,g),1)}function VV(f,g){return ar(yg(f,g),V)}function HV(f,g,w){return w=w===n?1:bt(w),ar(yg(f,g),w)}function V5(f,g){var w=ht(f)?Lo:ns;return w(f,Je(g,3))}function H5(f,g){var w=ht(f)?lj:jR;return w(f,Je(g,3))}var WV=ug(function(f,g,w){an.call(f,w)?f[w].push(g):da(f,w,[g])});function UV(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)),Cg(f)?w<=N&&f.indexOf(g,w)>-1:!!N&&Ac(f,g,w)>-1}var qV=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):zd(Q,g,w)}),W}),GV=ug(function(f,g,w){da(f,w,g)});function yg(f,g){var w=ht(f)?Pn:qR;return w(f,Je(g,3))}function YV(f,g,w,P){return f==null?[]:(ht(g)||(g=g==null?[]:[g]),w=P?n:w,ht(w)||(w=w==null?[]:[w]),XR(f,g,w))}var KV=ug(function(f,g,w){f[w?0:1].push(g)},function(){return[[],[]]});function XV(f,g,w){var P=ht(f)?qv:xR,N=arguments.length<3;return P(f,Je(g,4),w,N,ns)}function QV(f,g,w){var P=ht(f)?cj:xR,N=arguments.length<3;return P(f,Je(g,4),w,N,jR)}function JV(f,g){var w=ht(f)?Ja:zR;return w(f,_g(Je(g,3)))}function ZV(f){var g=ht(f)?IR:Uz;return g(f)}function eH(f,g,w){(w?$r(f,g,w):g===n)?g=1:g=bt(g);var P=ht(f)?_z:qz;return P(f,g)}function tH(f){var g=ht(f)?Sz:Yz;return g(f)}function nH(f){if(f==null)return 0;if(Hr(f))return Cg(f)?kc(f):f.length;var g=br(f);return g==Ce||g==dt?f.size:dy(f).length}function rH(f,g,w){var P=ht(f)?Gv:Kz;return w&&$r(f,g,w)&&(g=n),P(f,Je(g,3))}var oH=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]]),XR(f,ar(g,1),[])}),xg=Fj||function(){return ir.Date.now()};function iH(f,g){if(typeof g!="function")throw new Fo(a);return f=bt(f),function(){if(--f<1)return g.apply(this,arguments)}}function W5(f,g,w){return g=w?n:g,g=f&&g==null?f.length:g,fa(f,D,n,n,n,n,g)}function U5(f,g){var w;if(typeof g!="function")throw new Fo(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)}),q5=Pt(function(f,g,w){var P=x|y;if(w.length){var N=es(w,Vc(q5));P|=E}return fa(g,P,f,w,N)});function G5(f,g,w){g=w?n:g;var P=fa(f,S,n,n,n,n,n,g);return P.placeholder=G5.placeholder,P}function Y5(f,g,w){g=w?n:g;var P=fa(f,C,n,n,n,n,n,g);return P.placeholder=Y5.placeholder,P}function K5(f,g,w){var P,N,W,Q,ee,se,_e=0,Se=!1,Pe=!1,je=!0;if(typeof f!="function")throw new Fo(a);g=Ho(g)||0,On(w)&&(Se=!!w.leading,Pe="maxWait"in w,W=Pe?Yn(Ho(w.maxWait)||0,g):W,je="trailing"in w?!!w.trailing:je);function Ye(Vn){var li=P,ba=N;return P=N=n,_e=Vn,Q=f.apply(ba,li),Q}function et(Vn){return _e=Vn,ee=Ud(At,g),Se?Ye(Vn):Q}function St(Vn){var li=Vn-se,ba=Vn-_e,pP=g-li;return Pe?mr(pP,W-ba):pP}function tt(Vn){var li=Vn-se,ba=Vn-_e;return se===n||li>=g||li<0||Pe&&ba>=W}function At(){var Vn=xg();if(tt(Vn))return Ft(Vn);ee=Ud(At,St(Vn))}function Ft(Vn){return ee=n,je&&P?Ye(Vn):(P=N=n,Q)}function uo(){ee!==n&&i5(ee),_e=0,P=se=N=ee=n}function Or(){return ee===n?Q:Ft(xg())}function fo(){var Vn=xg(),li=tt(Vn);if(P=arguments,N=this,se=Vn,li){if(ee===n)return et(se);if(Pe)return i5(ee),ee=Ud(At,g),Ye(se)}return ee===n&&(ee=Ud(At,g)),Q}return fo.cancel=uo,fo.flush=Or,fo}var aH=Pt(function(f,g){return FR(f,1,g)}),sH=Pt(function(f,g,w){return FR(f,Ho(g)||0,w)});function lH(f){return fa(f,A)}function wg(f,g){if(typeof f!="function"||g!=null&&typeof g!="function")throw new Fo(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(wg.Cache||ua),w}wg.Cache=ua;function _g(f){if(typeof f!="function")throw new Fo(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 cH(f){return U5(2,f)}var uH=Xz(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)}),X5=Pt(function(f,g){var w=es(g,Vc(X5));return fa(f,$,n,g,w)}),dH=ha(function(f,g){return fa(f,T,n,n,n,g)});function fH(f,g){if(typeof f!="function")throw new Fo(a);return g=g===n?g:bt(g),Pt(f,g)}function hH(f,g){if(typeof f!="function")throw new Fo(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 pH(f,g,w){var P=!0,N=!0;if(typeof f!="function")throw new Fo(a);return On(w)&&(P="leading"in w?!!w.leading:P,N="trailing"in w?!!w.trailing:N),K5(f,g,{leading:P,maxWait:g,trailing:N})}function gH(f){return W5(f,1)}function mH(f,g){return Ny(xy(g),f)}function bH(){if(!arguments.length)return[];var f=arguments[0];return ht(f)?f:[f]}function vH(f){return zo(f,p)}function yH(f,g){return g=typeof g=="function"?g:n,zo(f,p,g)}function xH(f){return zo(f,d|p)}function wH(f,g){return g=typeof g=="function"?g:n,zo(f,d|p,g)}function _H(f,g){return g==null||LR(f,g,er(g))}function si(f,g){return f===g||f!==f&&g!==g}var SH=pg(ly),CH=pg(function(f,g){return f>=g}),cl=HR(function(){return arguments}())?HR:function(f){return Mn(f)&&an.call(f,"callee")&&!OR.call(f,"callee")},ht=ge.isArray,EH=uR?so(uR):Mz;function Hr(f){return f!=null&&Sg(f.length)&&!ga(f)}function Bn(f){return Mn(f)&&Hr(f)}function RH(f){return f===!0||f===!1||Mn(f)&&Pr(f)==ie}var as=zj||Gy,PH=dR?so(dR):kz;function $H(f){return Mn(f)&&f.nodeType===1&&!qd(f)}function OH(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(Wd(f))return!dy(f).length;for(var w in f)if(an.call(f,w))return!1;return!0}function TH(f,g){return Bd(f,g)}function DH(f,g,w){w=typeof w=="function"?w:n;var P=w?w(f,g):n;return P===n?Bd(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"&&!qd(f)}function AH(f){return typeof f=="number"&&DR(f)}function ga(f){if(!On(f))return!1;var g=Pr(f);return g==Z||g==ve||g==he||g==Ie}function Q5(f){return typeof f=="number"&&f==bt(f)}function Sg(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=Y}function On(f){var g=typeof f;return f!=null&&(g=="object"||g=="function")}function Mn(f){return f!=null&&typeof f=="object"}var J5=fR?so(fR):Nz;function MH(f,g){return f===g||uy(f,g,Py(g))}function kH(f,g,w){return w=typeof w=="function"?w:n,uy(f,g,Py(g),w)}function IH(f){return Z5(f)&&f!=+f}function NH(f){if(yB(f))throw new ft(i);return WR(f)}function LH(f){return f===null}function FH(f){return f==null}function Z5(f){return typeof f=="number"||Mn(f)&&Pr(f)==Oe}function qd(f){if(!Mn(f)||Pr(f)!=We)return!1;var g=Xp(f);if(g===null)return!0;var w=an.call(g,"constructor")&&g.constructor;return typeof w=="function"&&w instanceof w&&qp.call(w)==kj}var Fy=hR?so(hR):Lz;function jH(f){return Q5(f)&&f>=-Y&&f<=Y}var eP=pR?so(pR):Fz;function Cg(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=gR?so(gR):jz;function zH(f){return f===n}function BH(f){return Mn(f)&&br(f)==pe}function VH(f){return Mn(f)&&Pr(f)==Re}var HH=pg(fy),WH=pg(function(f,g){return f<=g});function tP(f){if(!f)return[];if(Hr(f))return Cg(f)?ii(f):Vr(f);if(Md&&f[Md])return _j(f[Md]());var g=br(f),w=g==Ce?Zv:g==dt?Hp:Wc;return w(f)}function ma(f){if(!f)return f===0?f:0;if(f=Ho(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 nP(f){return f?il(bt(f),0,H):0}function Ho(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=wR(f);var w=Fe.test(f);return w||J.test(f)?ij(f.slice(2),w?2:8):ze.test(f)?O:+f}function rP(f){return $i(f,Wr(f))}function UH(f){return f?il(bt(f),-Y,Y):f===0?f:0}function Zt(f){return f==null?"":lo(f)}var qH=zc(function(f,g){if(Wd(g)||Hr(g)){$i(g,er(g),f);return}for(var w in g)an.call(g,w)&&Fd(f,w,g[w])}),oP=zc(function(f,g){$i(g,Wr(g),f)}),Eg=zc(function(f,g,w,P){$i(g,Wr(g),f,P)}),GH=zc(function(f,g,w,P){$i(g,er(g),f,P)}),YH=ha(iy);function KH(f,g){var w=jc(f);return g==null?w:NR(w,g)}var XH=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||si(Se,Nc[_e])&&!an.call(f,_e))&&(f[_e]=W[_e])}return f}),QH=Pt(function(f){return f.push(n,w5),ao(iP,n,f)});function JH(f,g){return bR(f,Je(g,3),Pi)}function ZH(f,g){return bR(f,Je(g,3),sy)}function eW(f,g){return f==null?f:ay(f,Je(g,3),Wr)}function tW(f,g){return f==null?f:BR(f,Je(g,3),Wr)}function nW(f,g){return f&&Pi(f,Je(g,3))}function rW(f,g){return f&&sy(f,Je(g,3))}function oW(f){return f==null?[]:ag(f,er(f))}function iW(f){return f==null?[]:ag(f,Wr(f))}function jy(f,g,w){var P=f==null?n:al(f,g);return P===n?w:P}function aW(f,g){return f!=null&&C5(f,g,Oz)}function zy(f,g){return f!=null&&C5(f,g,Tz)}var sW=m5(function(f,g,w){g!=null&&typeof g.toString!="function"&&(g=Gp.call(g)),f[g]=w},Vy(Ur)),lW=m5(function(f,g,w){g!=null&&typeof g.toString!="function"&&(g=Gp.call(g)),an.call(f,g)?f[g].push(w):f[g]=[w]},Je),cW=Pt(zd);function er(f){return Hr(f)?kR(f):dy(f)}function Wr(f){return Hr(f)?kR(f,!0):zz(f)}function uW(f,g){var w={};return g=Je(g,3),Pi(f,function(P,N,W){da(w,g(P,N,W),P)}),w}function dW(f,g){var w={};return g=Je(g,3),Pi(f,function(P,N,W){da(w,N,g(P,N,W))}),w}var fW=zc(function(f,g,w){sg(f,g,w)}),iP=zc(function(f,g,w,P){sg(f,g,w,P)}),hW=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=zo(w,d|h|p,sB));for(var N=g.length;N--;)by(w,g[N]);return w});function pW(f,g){return aP(f,_g(Je(g)))}var gW=ha(function(f,g){return f==null?{}:Vz(f,g)});function aP(f,g){if(f==null)return{};var w=Pn(Ey(f),function(P){return[P]});return g=Je(g),QR(f,w,function(P,N){return g(P,N[0])})}function mW(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 bW(f,g,w){return f==null?f:Vd(f,g,w)}function vW(f,g,w,P){return P=typeof P=="function"?P:n,f==null?f:Vd(f,g,w,P)}var sP=y5(er),lP=y5(Wr);function yW(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(Xp(f)):{}:w={}}return(N?Lo:Pi)(f,function(Q,ee,se){return g(w,Q,ee,se)}),w}function xW(f,g){return f==null?!0:by(f,g)}function wW(f,g,w){return f==null?f:n5(f,g,xy(w))}function _W(f,g,w,P){return P=typeof P=="function"?P:n,f==null?f:n5(f,g,xy(w),P)}function Wc(f){return f==null?[]:Jv(f,er(f))}function SW(f){return f==null?[]:Jv(f,Wr(f))}function CW(f,g,w){return w===n&&(w=g,g=n),w!==n&&(w=Ho(w),w=w===w?w:0),g!==n&&(g=Ho(g),g=g===g?g:0),il(Ho(f),g,w)}function EW(f,g,w){return g=ma(g),w===n?(w=g,g=0):w=ma(w),f=Ho(f),Dz(f,g,w)}function RW(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=AR();return mr(f+N*(g-f+oj("1e-"+((N+"").length-1))),g)}return py(f,g)}var PW=Bc(function(f,g,w){return g=g.toLowerCase(),f+(w?cP(g):g)});function cP(f){return By(Zt(f).toLowerCase())}function uP(f){return f=Zt(f),f&&f.replace(Me,bj).replace(YF,"")}function $W(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 OW(f){return f=Zt(f),f&&ri.test(f)?f.replace(_t,vj):f}function TW(f){return f=Zt(f),f&&la.test(f)?f.replace(Ei,"\\$&"):f}var DW=Bc(function(f,g,w){return f+(w?"-":"")+g.toLowerCase()}),AW=Bc(function(f,g,w){return f+(w?" ":"")+g.toLowerCase()}),MW=h5("toLowerCase");function kW(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 hg(eg(N),w)+f+hg(Zp(N),w)}function IW(f,g,w){f=Zt(f),g=bt(g);var P=g?kc(f):0;return g&&P<g?f+hg(g-P,w):f}function NW(f,g,w){f=Zt(f),g=bt(g);var P=g?kc(f):0;return g&&P<g?hg(g-P,w)+f:f}function LW(f,g,w){return w||g==null?g=0:g&&(g=+g),Wj(Zt(f).replace(Jn,""),g||0)}function FW(f,g,w){return(w?$r(f,g,w):g===n)?g=1:g=bt(g),gy(Zt(f),g)}function jW(){var f=arguments,g=Zt(f[0]);return f.length<3?g:g.replace(f[1],f[2])}var zW=Bc(function(f,g,w){return f+(w?"_":"")+g.toLowerCase()});function BW(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(ii(f),0,w):f.split(g,w)):[]}var VW=Bc(function(f,g,w){return f+(w?" ":"")+By(g)});function HW(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 WW(f,g,w){var P=B.templateSettings;w&&$r(f,g,w)&&(g=n),f=Zt(f),g=Eg({},g,P,x5);var N=Eg({},g.imports,P.imports,x5),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["+ ++ZF+"]")+`
72
- `;f.replace(je,function(tt,At,Ft,uo,Or,fo){return Ft||(Ft=uo),Pe+=f.slice(_e,fo).replace(Rn,yj),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=fP(function(){return qt(W,Ye+"return "+Pe).apply(n,Q)});if(St.source=Pe,Ly(St))throw St;return St}function UW(f){return Zt(f).toLowerCase()}function qW(f){return Zt(f).toUpperCase()}function GW(f,g,w){if(f=Zt(f),f&&(w||g===n))return wR(f);if(!f||!(g=lo(g)))return f;var P=ii(f),N=ii(g),W=_R(P,N),Q=SR(P,N)+1;return is(P,W,Q).join("")}function YW(f,g,w){if(f=Zt(f),f&&(w||g===n))return f.slice(0,ER(f)+1);if(!f||!(g=lo(g)))return f;var P=ii(f),N=SR(P,ii(g))+1;return is(P,0,N).join("")}function KW(f,g,w){if(f=Zt(f),f&&(w||g===n))return f.replace(Jn,"");if(!f||!(g=lo(g)))return f;var P=ii(f),N=_R(P,ii(g));return is(P,N).join("")}function XW(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=ii(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 QW(f){return f=Zt(f),f&&zn.test(f)?f.replace(on,Rj):f}var JW=Bc(function(f,g,w){return f+(w?" ":"")+g.toUpperCase()}),By=h5("toUpperCase");function dP(f,g,w){return f=Zt(f),g=w?n:g,g===n?wj(f)?Oj(f):fj(f):f.match(g)||[]}var fP=Pt(function(f,g){try{return ao(f,n,g)}catch(w){return Ly(w)?w:new ft(w)}}),ZW=ha(function(f,g){return Lo(g,function(w){w=Oi(w),da(f,w,Iy(f[w],f))}),f});function eU(f){var g=f==null?0:f.length,w=Je();return f=g?Pn(f,function(P){if(typeof P[1]!="function")throw new Fo(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 tU(f){return Rz(zo(f,d))}function Vy(f){return function(){return f}}function nU(f,g){return f==null||f!==f?g:f}var rU=g5(),oU=g5(!0);function Ur(f){return f}function Hy(f){return UR(typeof f=="function"?f:zo(f,d))}function iU(f){return GR(zo(f,d))}function aU(f,g){return YR(f,zo(g,d))}var sU=Pt(function(f,g){return function(w){return zd(w,f,g)}}),lU=Pt(function(f,g){return function(w){return zd(f,w,g)}});function Wy(f,g,w){var P=er(g),N=ag(g,P);w==null&&!(On(g)&&(N.length||!P.length))&&(w=g,g=f,f=this,N=ag(g,er(g)));var W=!(On(w)&&"chain"in w)||!!w.chain,Q=ga(f);return Lo(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 cU(){return ir._===this&&(ir._=Ij),this}function Uy(){}function uU(f){return f=bt(f),Pt(function(g){return KR(g,f)})}var dU=_y(Pn),fU=_y(mR),hU=_y(Gv);function hP(f){return Oy(f)?Yv(Oi(f)):Hz(f)}function pU(f){return function(g){return f==null?n:al(f,g)}}var gU=b5(),mU=b5(!0);function qy(){return[]}function Gy(){return!1}function bU(){return{}}function vU(){return""}function yU(){return!0}function xU(f,g){if(f=bt(f),f<1||f>Y)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 wU(f){return ht(f)?Pn(f,Oi):co(f)?[f]:Vr(M5(Zt(f)))}function _U(f){var g=++Mj;return Zt(f)+g}var SU=fg(function(f,g){return f+g},0),CU=Sy("ceil"),EU=fg(function(f,g){return f/g},1),RU=Sy("floor");function PU(f){return f&&f.length?ig(f,Ur,ly):n}function $U(f,g){return f&&f.length?ig(f,Je(g,2),ly):n}function OU(f){return yR(f,Ur)}function TU(f,g){return yR(f,Je(g,2))}function DU(f){return f&&f.length?ig(f,Ur,fy):n}function AU(f,g){return f&&f.length?ig(f,Je(g,2),fy):n}var MU=fg(function(f,g){return f*g},1),kU=Sy("round"),IU=fg(function(f,g){return f-g},0);function NU(f){return f&&f.length?Xv(f,Ur):0}function LU(f,g){return f&&f.length?Xv(f,Je(g,2)):0}return B.after=iH,B.ary=W5,B.assign=qH,B.assignIn=oP,B.assignInWith=Eg,B.assignWith=GH,B.at=YH,B.before=U5,B.bind=Iy,B.bindAll=ZW,B.bindKey=q5,B.castArray=bH,B.chain=B5,B.chunk=RB,B.compact=PB,B.concat=$B,B.cond=eU,B.conforms=tU,B.constant=Vy,B.countBy=NV,B.create=KH,B.curry=G5,B.curryRight=Y5,B.debounce=K5,B.defaults=XH,B.defaultsDeep=QH,B.defer=aH,B.delay=sH,B.difference=OB,B.differenceBy=TB,B.differenceWith=DB,B.drop=AB,B.dropRight=MB,B.dropRightWhile=kB,B.dropWhile=IB,B.fill=NB,B.filter=FV,B.flatMap=BV,B.flatMapDeep=VV,B.flatMapDepth=HV,B.flatten=L5,B.flattenDeep=LB,B.flattenDepth=FB,B.flip=lH,B.flow=rU,B.flowRight=oU,B.fromPairs=jB,B.functions=oW,B.functionsIn=iW,B.groupBy=WV,B.initial=BB,B.intersection=VB,B.intersectionBy=HB,B.intersectionWith=WB,B.invert=sW,B.invertBy=lW,B.invokeMap=qV,B.iteratee=Hy,B.keyBy=GV,B.keys=er,B.keysIn=Wr,B.map=yg,B.mapKeys=uW,B.mapValues=dW,B.matches=iU,B.matchesProperty=aU,B.memoize=wg,B.merge=fW,B.mergeWith=iP,B.method=sU,B.methodOf=lU,B.mixin=Wy,B.negate=_g,B.nthArg=uU,B.omit=hW,B.omitBy=pW,B.once=cH,B.orderBy=YV,B.over=dU,B.overArgs=uH,B.overEvery=fU,B.overSome=hU,B.partial=Ny,B.partialRight=X5,B.partition=KV,B.pick=gW,B.pickBy=aP,B.property=hP,B.propertyOf=pU,B.pull=YB,B.pullAll=j5,B.pullAllBy=KB,B.pullAllWith=XB,B.pullAt=QB,B.range=gU,B.rangeRight=mU,B.rearg=dH,B.reject=JV,B.remove=JB,B.rest=fH,B.reverse=My,B.sampleSize=eH,B.set=bW,B.setWith=vW,B.shuffle=tH,B.slice=ZB,B.sortBy=oH,B.sortedUniq=aV,B.sortedUniqBy=sV,B.split=BW,B.spread=hH,B.tail=lV,B.take=cV,B.takeRight=uV,B.takeRightWhile=dV,B.takeWhile=fV,B.tap=PV,B.throttle=pH,B.thru=vg,B.toArray=tP,B.toPairs=sP,B.toPairsIn=lP,B.toPath=wU,B.toPlainObject=rP,B.transform=yW,B.unary=gH,B.union=hV,B.unionBy=pV,B.unionWith=gV,B.uniq=mV,B.uniqBy=bV,B.uniqWith=vV,B.unset=xW,B.unzip=ky,B.unzipWith=z5,B.update=wW,B.updateWith=_W,B.values=Wc,B.valuesIn=SW,B.without=yV,B.words=dP,B.wrap=mH,B.xor=xV,B.xorBy=wV,B.xorWith=_V,B.zip=SV,B.zipObject=CV,B.zipObjectDeep=EV,B.zipWith=RV,B.entries=sP,B.entriesIn=lP,B.extend=oP,B.extendWith=Eg,Wy(B,B),B.add=SU,B.attempt=fP,B.camelCase=PW,B.capitalize=cP,B.ceil=CU,B.clamp=CW,B.clone=vH,B.cloneDeep=xH,B.cloneDeepWith=wH,B.cloneWith=yH,B.conformsTo=_H,B.deburr=uP,B.defaultTo=nU,B.divide=EU,B.endsWith=$W,B.eq=si,B.escape=OW,B.escapeRegExp=TW,B.every=LV,B.find=jV,B.findIndex=I5,B.findKey=JH,B.findLast=zV,B.findLastIndex=N5,B.findLastKey=ZH,B.floor=RU,B.forEach=V5,B.forEachRight=H5,B.forIn=eW,B.forInRight=tW,B.forOwn=nW,B.forOwnRight=rW,B.get=jy,B.gt=SH,B.gte=CH,B.has=aW,B.hasIn=zy,B.head=F5,B.identity=Ur,B.includes=UV,B.indexOf=zB,B.inRange=EW,B.invoke=cW,B.isArguments=cl,B.isArray=ht,B.isArrayBuffer=EH,B.isArrayLike=Hr,B.isArrayLikeObject=Bn,B.isBoolean=RH,B.isBuffer=as,B.isDate=PH,B.isElement=$H,B.isEmpty=OH,B.isEqual=TH,B.isEqualWith=DH,B.isError=Ly,B.isFinite=AH,B.isFunction=ga,B.isInteger=Q5,B.isLength=Sg,B.isMap=J5,B.isMatch=MH,B.isMatchWith=kH,B.isNaN=IH,B.isNative=NH,B.isNil=FH,B.isNull=LH,B.isNumber=Z5,B.isObject=On,B.isObjectLike=Mn,B.isPlainObject=qd,B.isRegExp=Fy,B.isSafeInteger=jH,B.isSet=eP,B.isString=Cg,B.isSymbol=co,B.isTypedArray=Hc,B.isUndefined=zH,B.isWeakMap=BH,B.isWeakSet=VH,B.join=UB,B.kebabCase=DW,B.last=Vo,B.lastIndexOf=qB,B.lowerCase=AW,B.lowerFirst=MW,B.lt=HH,B.lte=WH,B.max=PU,B.maxBy=$U,B.mean=OU,B.meanBy=TU,B.min=DU,B.minBy=AU,B.stubArray=qy,B.stubFalse=Gy,B.stubObject=bU,B.stubString=vU,B.stubTrue=yU,B.multiply=MU,B.nth=GB,B.noConflict=cU,B.noop=Uy,B.now=xg,B.pad=kW,B.padEnd=IW,B.padStart=NW,B.parseInt=LW,B.random=RW,B.reduce=XV,B.reduceRight=QV,B.repeat=FW,B.replace=jW,B.result=mW,B.round=kU,B.runInContext=ae,B.sample=ZV,B.size=nH,B.snakeCase=zW,B.some=rH,B.sortedIndex=eV,B.sortedIndexBy=tV,B.sortedIndexOf=nV,B.sortedLastIndex=rV,B.sortedLastIndexBy=oV,B.sortedLastIndexOf=iV,B.startCase=VW,B.startsWith=HW,B.subtract=IU,B.sum=NU,B.sumBy=LU,B.template=WW,B.times=xU,B.toFinite=ma,B.toInteger=bt,B.toLength=nP,B.toLower=UW,B.toNumber=Ho,B.toSafeInteger=UH,B.toString=Zt,B.toUpper=qW,B.trim=GW,B.trimEnd=YW,B.trimStart=KW,B.truncate=XW,B.unescape=QW,B.uniqueId=_U,B.upperCase=JW,B.upperFirst=By,B.each=V5,B.eachRight=H5,B.first=F5,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,Lo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){B[f].placeholder=B}),Lo(["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()}}),Lo(["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}}),Lo(["head","last"],function(f,g){var w="take"+(g?"Right":"");Lt.prototype[f]=function(){return this[w](1).value()[0]}}),Lo(["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 zd(w,f,g)})}),Lt.prototype.reject=function(f){return this.filter(_g(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:vg,args:[Pe],thisArg:n}),new jo(tt,je)}return et&&St?f.apply(this,ee):(tt=this.thru(Pe),et?P?tt.value()[0]:tt.value():tt)})}),Lo(["pop","push","shift","sort","splice","unshift"],function(f){var g=Wp[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[dg(n,y).name]=[{name:"wrapper",func:n}],Lt.prototype.clone=Qj,Lt.prototype.reverse=Jj,Lt.prototype.value=Zj,B.prototype.at=$V,B.prototype.chain=OV,B.prototype.commit=TV,B.prototype.next=DV,B.prototype.plant=MV,B.prototype.reverse=kV,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=IV,B.prototype.first=B.prototype.head,Md&&(B.prototype[Md]=AV),B},Ic=Tj();tl?((tl.exports=Ic)._=Ic,Hv._=Ic):ir._=Ic}).call(ys)})(f0,f0.exports);var wf=f0.exports;const Vl=mc(wf);function MP({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 DS.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 kP(e,t){if(!t)return;const n={...t};return DS.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function kS(e){return we.getState().dashboard.globalCacheConfig}const we=kM()(BM((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:d0},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:d0},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(v=>v.sheetId===n),b=(l=r.filterValues)==null?void 0:l.filter(v=>p==null?void 0:p.some(x=>x.id===v.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(v=>!(b!=null&&b.some(x=>x.filterId===v.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(v=>v.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=>{DS.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&&wf.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&&wf.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&&wf.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&&wf.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=>{MP({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=kP(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(b=>b.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=MP({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),kP(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)=>{fG({card:n,dataPoint:r,set:e,get:t})}}}))),dr=()=>we(e=>e.actions),hG={theme:"system",setTheme:()=>null},YM=m.createContext(hG);function pG({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(YM.Provider,{...r,value:a,children:e})}const KM=()=>{const e=m.useContext(YM);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var sp=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 qo(){}function gG(e,t){return typeof e=="function"?e(t):e}function cw(e){return typeof e=="number"&&e>=0&&e!==1/0}function XM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function yu(e,t){return typeof e=="function"?e(t):e}function pi(e,t){return typeof e=="function"?e(t):e}function IP(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==IS(a,t.options))return!1}else if(!sh(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 NP(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ah(t.options.mutationKey)!==ah(i))return!1}else if(!sh(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function IS(e,t){return((t==null?void 0:t.queryKeyHashFn)||ah)(e)}function ah(e){return JSON.stringify(e,(t,n)=>fw(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function sh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!sh(e[n],t[n])):!1}function uw(e,t){if(e===t)return e;const n=LP(e)&&LP(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 LP(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fw(e){if(!FP(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!FP(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function FP(e){return Object.prototype.toString.call(e)==="[object Object]"}function mG(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 bG(e){return e}function vG(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function yG(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var h0=Symbol();function QM(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===h0&&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===h0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var kl,ws,Au,mM,xG=(mM=class extends sp{constructor(){super();Xe(this,kl,void 0);Xe(this,ws,void 0);Xe(this,Au,void 0);Ue(this,Au,t=>{if(!oc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){re(this,ws)||this.setEventListener(re(this,Au))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,ws))==null||t.call(this),Ue(this,ws,void 0))}setEventListener(t){var n;Ue(this,Au,t),(n=re(this,ws))==null||n.call(this),Ue(this,ws,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){re(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 re(this,kl)=="boolean"?re(this,kl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},kl=new WeakMap,ws=new WeakMap,Au=new WeakMap,mM),NS=new xG,Mu,_s,ku,bM,wG=(bM=class extends sp{constructor(){super();Xe(this,Mu,!0);Xe(this,_s,void 0);Xe(this,ku,void 0);Ue(this,ku,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(){re(this,_s)||this.setEventListener(re(this,ku))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,_s))==null||t.call(this),Ue(this,_s,void 0))}setEventListener(t){var n;Ue(this,ku,t),(n=re(this,_s))==null||n.call(this),Ue(this,_s,t(this.setOnline.bind(this)))}setOnline(t){re(this,Mu)!==t&&(Ue(this,Mu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return re(this,Mu)}},Mu=new WeakMap,_s=new WeakMap,ku=new WeakMap,bM),p0=new wG;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 _G(e){return Math.min(1e3*2**e,3e4)}function JM(e){return(e??"online")==="online"?p0.isOnline():!0}var ZM=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 ZM}function e6(e){let t=!1,n=0,r=!1,o;const i=pw(),a=v=>{var x;r||(h(new ZM(v)),(x=e.abort)==null||x.call(e))},s=()=>{t=!0},l=()=>{t=!1},c=()=>NS.isFocused()&&(e.networkMode==="always"||p0.isOnline())&&e.canRun(),u=()=>JM(e.networkMode)&&e.canRun(),d=v=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,v),o==null||o(),i.resolve(v))},h=v=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,v),o==null||o(),i.reject(v))},p=()=>new Promise(v=>{var x;o=y=>{(r||c())&&v(y)},(x=e.onPause)==null||x.call(e)}).then(()=>{var v;o=void 0,r||(v=e.onContinue)==null||v.call(e)}),b=()=>{if(r)return;let v;const x=n===0?e.initialPromise:void 0;try{v=x??e.fn()}catch(y){v=Promise.reject(y)}Promise.resolve(v).then(d).catch(y=>{var $;if(r)return;const _=e.retry??(oc?0:3),S=e.retryDelay??_G,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),mG(C).then(()=>c()?void 0:p()).then(()=>{t?h(y):b()})})};return{promise:i,cancel:a,continue:()=>(o==null||o(),i),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?b():p().then(b),i)}}function SG(){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=SG(),Il,vM,t6=(vM=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(){re(this,Il)&&(clearTimeout(re(this,Il)),Ue(this,Il,void 0))}},Il=new WeakMap,vM),Iu,Nu,Uo,xr,Kh,Nl,fi,wa,yM,CG=(yM=class extends t6{constructor(t){super();Xe(this,fi);Xe(this,Iu,void 0);Xe(this,Nu,void 0);Xe(this,Uo,void 0);Xe(this,xr,void 0);Xe(this,Kh,void 0);Xe(this,Nl,void 0);Ue(this,Nl,!1),Ue(this,Kh,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ue(this,Uo,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ue(this,Iu,EG(this.options)),this.state=t.state??re(this,Iu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=re(this,xr))==null?void 0:t.promise}setOptions(t){this.options={...re(this,Kh),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&re(this,Uo).remove(this)}setData(t,n){const r=hw(this.state.data,t,this.options);return jt(this,fi,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,fi,wa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=re(this,xr))==null?void 0:r.promise;return(o=re(this,xr))==null||o.cancel(t),n?n.then(qo).catch(qo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(re(this,Iu))}isActive(){return this.observers.some(t=>pi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===h0||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||!XM(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,xr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,xr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),re(this,Uo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(re(this,xr)&&(re(this,Nl)?re(this,xr).cancel({revert:!0}):re(this,xr).cancelRetry()),this.scheduleGc()),re(this,Uo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||jt(this,fi,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(re(this,xr))return re(this,xr).continueRetry(),re(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=QM(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,Nu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&jt(this,fi,wa).call(this,{type:"fetch",meta:(u=a.fetchOptions)==null?void 0:u.meta});const s=d=>{var h,p,b,v;n1(d)&&d.silent||jt(this,fi,wa).call(this,{type:"error",error:d}),n1(d)||((p=(h=re(this,Uo).config).onError)==null||p.call(h,d,this),(v=(b=re(this,Uo).config).onSettled)==null||v.call(b,this.state.data,d,this)),this.scheduleGc()};return Ue(this,xr,e6({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,p,b,v;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),s(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(x){s(x);return}(p=(h=re(this,Uo).config).onSuccess)==null||p.call(h,d,this),(v=(b=re(this,Uo).config).onSettled)==null||v.call(b,d,this.state.error,this),this.scheduleGc()},onError:s,onFail:(d,h)=>{jt(this,fi,wa).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{jt(this,fi,wa).call(this,{type:"pause"})},onContinue:()=>{jt(this,fi,wa).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),re(this,xr).start()}},Iu=new WeakMap,Nu=new WeakMap,Uo=new WeakMap,xr=new WeakMap,Kh=new WeakMap,Nl=new WeakMap,fi=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,...n6(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&&re(this,Nu)?{...re(this,Nu),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()}),re(this,Uo).notify({query:this,type:"updated",action:t})})},yM);function n6(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:JM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function EG(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,xM,r6=(xM=class extends sp{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??IS(o,n);let a=this.get(i);return a||(a=new CG({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){re(this,Ii).has(t.queryHash)||(re(this,Ii).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=re(this,Ii).get(t.queryHash);n&&(t.destroy(),n===t&&re(this,Ii).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){cr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return re(this,Ii).get(t)}getAll(){return[...re(this,Ii).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>IP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>IP(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,xM),Ni,Ar,Ll,Li,gs,wM,RG=(wM=class extends t6{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||PG(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){re(this,Ni).includes(t)||(re(this,Ni).push(t),this.clearGcTimeout(),re(this,Ar).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ue(this,Ni,re(this,Ni).filter(n=>n!==t)),this.scheduleGc(),re(this,Ar).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){re(this,Ni).length||(this.state.status==="pending"?this.scheduleGc():re(this,Ar).remove(this))}continue(){var t;return((t=re(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,b,v,x,y,_,S,C,E,$,D;Ue(this,Ll,e6({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,A)=>{jt(this,Li,gs).call(this,{type:"failed",failureCount:T,error:A})},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:()=>re(this,Ar).canRun(this)}));const n=this.state.status==="pending",r=!re(this,Ll).canStart();try{if(!n){jt(this,Li,gs).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=re(this,Ar).config).onMutate)==null?void 0:i.call(o,t,this));const A=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));A!==this.state.context&&jt(this,Li,gs).call(this,{type:"pending",context:A,variables:t,isPaused:r})}const T=await re(this,Ll).start();return await((c=(l=re(this,Ar).config).onSuccess)==null?void 0:c.call(l,T,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,T,t,this.state.context)),await((p=(h=re(this,Ar).config).onSettled)==null?void 0:p.call(h,T,null,this.state.variables,this.state.context,this)),await((v=(b=this.options).onSettled)==null?void 0:v.call(b,T,null,t,this.state.context)),jt(this,Li,gs).call(this,{type:"success",data:T}),T}catch(T){try{throw await((y=(x=re(this,Ar).config).onError)==null?void 0:y.call(x,T,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,T,t,this.state.context)),await((E=(C=re(this,Ar).config).onSettled)==null?void 0:E.call(C,void 0,T,this.state.variables,this.state.context,this)),await((D=($=this.options).onSettled)==null?void 0:D.call($,void 0,T,t,this.state.context)),T}finally{jt(this,Li,gs).call(this,{type:"error",error:T})}}finally{re(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(()=>{re(this,Ni).forEach(r=>{r.onMutationUpdate(t)}),re(this,Ar).notify({mutation:this,type:"updated",action:t})})},wM);function PG(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $a,hi,Xh,_M,$G=(_M=class extends sp{constructor(t={}){super();Xe(this,$a,void 0);Xe(this,hi,void 0);Xe(this,Xh,void 0);this.config=t,Ue(this,$a,new Set),Ue(this,hi,new Map),Ue(this,Xh,0)}build(t,n,r){const o=new RG({mutationCache:this,mutationId:++Rg(this,Xh)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){re(this,$a).add(t);const n=Tg(t);if(typeof n=="string"){const r=re(this,hi).get(n);r?r.push(t):re(this,hi).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(re(this,$a).delete(t)){const n=Tg(t);if(typeof n=="string"){const r=re(this,hi).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&re(this,hi).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Tg(t);if(typeof n=="string"){const r=re(this,hi).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=Tg(t);if(typeof n=="string"){const o=(r=re(this,hi).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(()=>{re(this,$a).forEach(t=>{this.notify({type:"removed",mutation:t})}),re(this,$a).clear(),re(this,hi).clear()})}getAll(){return Array.from(re(this,$a))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>NP(n,r))}findAll(t={}){return this.getAll().filter(n=>NP(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(qo))))}},$a=new WeakMap,hi=new WeakMap,Xh=new WeakMap,_M);function Tg(e){var t;return(t=e.options.scope)==null?void 0:t.id}function jP(e){return{onFetch:(t,n)=>{var u,d,h,p,b;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=((b=t.state.data)==null?void 0:b.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const x=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},y=QM(t.options,t.fetchOptions),_=async(S,C,E)=>{if(v)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 D=await y($),{maxPages:T}=t.options,A=E?yG:vG;return{pages:A(S.pages,D,T),pageParams:A(S.pageParams,C,T)}};if(o&&i.length){const S=o==="backward",C=S?OG:zP,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:zP(r,s);if(l>0&&C==null)break;s=await _(s,C),l++}while(l<S)}return s};t.options.persister?t.fetchFn=()=>{var v,x;return(x=(v=t.options).persister)==null?void 0:x.call(v,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function zP(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 OG(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,Lu,Fu,Es,ju,zu,SM,TG=(SM=class{constructor(e={}){Xe(this,kn,void 0);Xe(this,Ss,void 0);Xe(this,Cs,void 0);Xe(this,Lu,void 0);Xe(this,Fu,void 0);Xe(this,Es,void 0);Xe(this,ju,void 0);Xe(this,zu,void 0);Ue(this,kn,e.queryCache||new r6),Ue(this,Ss,e.mutationCache||new $G),Ue(this,Cs,e.defaultOptions||{}),Ue(this,Lu,new Map),Ue(this,Fu,new Map),Ue(this,Es,0)}mount(){Rg(this,Es)._++,re(this,Es)===1&&(Ue(this,ju,NS.subscribe(async e=>{e&&(await this.resumePausedMutations(),re(this,kn).onFocus())})),Ue(this,zu,p0.subscribe(async e=>{e&&(await this.resumePausedMutations(),re(this,kn).onOnline())})))}unmount(){var e,t;Rg(this,Es)._--,re(this,Es)===0&&((e=re(this,ju))==null||e.call(this),Ue(this,ju,void 0),(t=re(this,zu))==null||t.call(this),Ue(this,zu,void 0))}isFetching(e){return re(this,kn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return re(this,Ss).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=re(this,kn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=re(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 re(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=re(this,kn).get(r.queryHash),i=o==null?void 0:o.state.data,a=gG(t,i);if(a!==void 0)return re(this,kn).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return cr.batch(()=>re(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=re(this,kn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=re(this,kn);cr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=re(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(()=>re(this,kn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(qo).catch(qo)}invalidateQueries(e,t={}){return cr.batch(()=>{if(re(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(()=>re(this,kn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(qo)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(qo)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=re(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(qo).catch(qo)}fetchInfiniteQuery(e){return e.behavior=jP(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qo).catch(qo)}ensureInfiniteQueryData(e){return e.behavior=jP(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p0.isOnline()?re(this,Ss).resumePausedMutations():Promise.resolve()}getQueryCache(){return re(this,kn)}getMutationCache(){return re(this,Ss)}getDefaultOptions(){return re(this,Cs)}setDefaultOptions(e){Ue(this,Cs,e)}setQueryDefaults(e,t){re(this,Lu).set(ah(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...re(this,Lu).values()],n={};return t.forEach(r=>{sh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){re(this,Fu).set(ah(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...re(this,Fu).values()];let n={};return t.forEach(r=>{sh(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...re(this,Cs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=IS(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===h0&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...re(this,Cs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){re(this,kn).clear(),re(this,Ss).clear()}},kn=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,Lu=new WeakMap,Fu=new WeakMap,Es=new WeakMap,ju=new WeakMap,zu=new WeakMap,SM),Qr,zt,Qh,Mr,Fl,Bu,Rs,Fi,Jh,Vu,Hu,jl,zl,Ps,Wu,Bl,_f,Zh,gw,ep,mw,tp,bw,np,vw,rp,yw,op,xw,ip,ww,hb,o6,CM,DG=(CM=class extends sp{constructor(t,n){super();Xe(this,Bl);Xe(this,Zh);Xe(this,ep);Xe(this,tp);Xe(this,np);Xe(this,rp);Xe(this,op);Xe(this,ip);Xe(this,hb);Xe(this,Qr,void 0);Xe(this,zt,void 0);Xe(this,Qh,void 0);Xe(this,Mr,void 0);Xe(this,Fl,void 0);Xe(this,Bu,void 0);Xe(this,Rs,void 0);Xe(this,Fi,void 0);Xe(this,Jh,void 0);Xe(this,Vu,void 0);Xe(this,Hu,void 0);Xe(this,jl,void 0);Xe(this,zl,void 0);Xe(this,Ps,void 0);Xe(this,Wu,new Set);this.options=n,Ue(this,Qr,t),Ue(this,Fi,null),Ue(this,Rs,pw()),this.options.experimental_prefetchInRender||re(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&&(re(this,zt).addObserver(this),BP(re(this,zt),this.options)?jt(this,Bl,_f).call(this):this.updateResult(),jt(this,np,vw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _w(re(this,zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _w(re(this,zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,jt(this,rp,yw).call(this),jt(this,op,xw).call(this),re(this,zt).removeObserver(this)}setOptions(t,n){const r=this.options,o=re(this,zt);if(this.options=re(this,Qr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pi(this.options.enabled,re(this,zt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");jt(this,ip,ww).call(this),re(this,zt).setOptions(this.options),r._defaulted&&!dw(this.options,r)&&re(this,Qr).getQueryCache().notify({type:"observerOptionsUpdated",query:re(this,zt),observer:this});const i=this.hasListeners();i&&VP(re(this,zt),o,this.options,r)&&jt(this,Bl,_f).call(this),this.updateResult(n),i&&(re(this,zt)!==o||pi(this.options.enabled,re(this,zt))!==pi(r.enabled,re(this,zt))||yu(this.options.staleTime,re(this,zt))!==yu(r.staleTime,re(this,zt)))&&jt(this,Zh,gw).call(this);const a=jt(this,ep,mw).call(this);i&&(re(this,zt)!==o||pi(this.options.enabled,re(this,zt))!==pi(r.enabled,re(this,zt))||a!==re(this,Ps))&&jt(this,tp,bw).call(this,a)}getOptimisticResult(t){const n=re(this,Qr).getQueryCache().build(re(this,Qr),t),r=this.createResult(n,t);return MG(this,r)&&(Ue(this,Mr,r),Ue(this,Bu,this.options),Ue(this,Fl,re(this,zt).state)),r}getCurrentResult(){return re(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){re(this,Wu).add(t)}getCurrentQuery(){return re(this,zt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=re(this,Qr).defaultQueryOptions(t),r=re(this,Qr).getQueryCache().build(re(this,Qr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return jt(this,Bl,_f).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),re(this,Mr)))}createResult(t,n){var T;const r=re(this,zt),o=this.options,i=re(this,Mr),a=re(this,Fl),s=re(this,Bu),c=t!==r?t.state:re(this,Qh),{state:u}=t;let d={...u},h=!1,p;if(n._optimisticResults){const A=this.hasListeners(),L=!A&&BP(t,n),F=A&&VP(t,r,n,o);(L||F)&&(d={...d,...n6(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:v,status:x}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(a==null?void 0:a.data)&&n.select===re(this,Jh))p=re(this,Vu);else try{Ue(this,Jh,n.select),p=n.select(d.data),p=hw(i==null?void 0:i.data,p,n),Ue(this,Vu,p),Ue(this,Fi,null)}catch(A){Ue(this,Fi,A)}else p=d.data;if(n.placeholderData!==void 0&&p===void 0&&x==="pending"){let A;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData))A=i.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((T=re(this,Hu))==null?void 0:T.state.data,re(this,Hu)):n.placeholderData,n.select&&A!==void 0)try{A=n.select(A),Ue(this,Fi,null)}catch(L){Ue(this,Fi,L)}A!==void 0&&(x="success",p=hw(i==null?void 0:i.data,A,n),h=!0)}re(this,Fi)&&(b=re(this,Fi),p=re(this,Vu),v=Date.now(),x="error");const y=d.fetchStatus==="fetching",_=x==="pending",S=x==="error",C=_&&y,E=p!==void 0,D={status:x,fetchStatus:d.fetchStatus,isPending:_,isSuccess:x==="success",isError:S,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:S&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&E,isStale:LS(t,n),refetch:this.refetch,promise:re(this,Rs)};if(this.options.experimental_prefetchInRender){const A=z=>{D.status==="error"?z.reject(D.error):D.data!==void 0&&z.resolve(D.data)},L=()=>{const z=Ue(this,Rs,D.promise=pw());A(z)},F=re(this,Rs);switch(F.status){case"pending":t.queryHash===r.queryHash&&A(F);break;case"fulfilled":(D.status==="error"||D.data!==F.value)&&L();break;case"rejected":(D.status!=="error"||D.error!==F.reason)&&L();break}}return D}updateResult(t){const n=re(this,Mr),r=this.createResult(re(this,zt),this.options);if(Ue(this,Fl,re(this,zt).state),Ue(this,Bu,this.options),re(this,Fl).data!==void 0&&Ue(this,Hu,re(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&&!re(this,Wu).size)return!0;const l=new Set(s??re(this,Wu));return this.options.throwOnError&&l.add("error"),Object.keys(re(this,Mr)).some(c=>{const u=c;return re(this,Mr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),jt(this,hb,o6).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&jt(this,np,vw).call(this)}},Qr=new WeakMap,zt=new WeakMap,Qh=new WeakMap,Mr=new WeakMap,Fl=new WeakMap,Bu=new WeakMap,Rs=new WeakMap,Fi=new WeakMap,Jh=new WeakMap,Vu=new WeakMap,Hu=new WeakMap,jl=new WeakMap,zl=new WeakMap,Ps=new WeakMap,Wu=new WeakMap,Bl=new WeakSet,_f=function(t){jt(this,ip,ww).call(this);let n=re(this,zt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(qo)),n},Zh=new WeakSet,gw=function(){jt(this,rp,yw).call(this);const t=yu(this.options.staleTime,re(this,zt));if(oc||re(this,Mr).isStale||!cw(t))return;const r=XM(re(this,Mr).dataUpdatedAt,t)+1;Ue(this,jl,setTimeout(()=>{re(this,Mr).isStale||this.updateResult()},r))},ep=new WeakSet,mw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(re(this,zt)):this.options.refetchInterval)??!1},tp=new WeakSet,bw=function(t){jt(this,op,xw).call(this),Ue(this,Ps,t),!(oc||pi(this.options.enabled,re(this,zt))===!1||!cw(re(this,Ps))||re(this,Ps)===0)&&Ue(this,zl,setInterval(()=>{(this.options.refetchIntervalInBackground||NS.isFocused())&&jt(this,Bl,_f).call(this)},re(this,Ps)))},np=new WeakSet,vw=function(){jt(this,Zh,gw).call(this),jt(this,tp,bw).call(this,jt(this,ep,mw).call(this))},rp=new WeakSet,yw=function(){re(this,jl)&&(clearTimeout(re(this,jl)),Ue(this,jl,void 0))},op=new WeakSet,xw=function(){re(this,zl)&&(clearInterval(re(this,zl)),Ue(this,zl,void 0))},ip=new WeakSet,ww=function(){const t=re(this,Qr).getQueryCache().build(re(this,Qr),this.options);if(t===re(this,zt))return;const n=re(this,zt);Ue(this,zt,t),Ue(this,Qh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},hb=new WeakSet,o6=function(t){cr.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(re(this,Mr))}),re(this,Qr).getQueryCache().notify({query:re(this,zt),type:"observerResultsUpdated"})})},CM);function AG(e,t){return pi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function BP(e,t){return AG(e,t)||e.state.data!==void 0&&_w(e,t,t.refetchOnMount)}function _w(e,t,n){if(pi(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&LS(e,t)}return!1}function VP(e,t,n,r){return(e!==t||pi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&LS(e,n)}function LS(e,t){return pi(t.enabled,e)!==!1&&e.isStaleByTime(yu(t.staleTime,e))}function MG(e,t){return!dw(e.getCurrentResult(),t)}var i6=j.createContext(void 0),FS=e=>{const t=j.useContext(i6);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},kG=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),R.jsx(i6.Provider,{value:e,children:t})),a6=j.createContext(!1),IG=()=>j.useContext(a6);a6.Provider;function NG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var LG=j.createContext(NG()),FG=()=>j.useContext(LG);function jG(e,t){return typeof e=="function"?e(...t):!!e}function HP(){}var zG=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},BG=e=>{j.useEffect(()=>{e.clearReset()},[e])},VG=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&jG(n,[e.error,r]),HG=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)))},WG=(e,t)=>e.isLoading&&e.isFetching&&!t,UG=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,WP=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qG(e,t,n){var u,d,h,p,b;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=FS(n),o=IG(),i=FG(),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",HG(a),zG(a,i),BG(i);const s=!r.getQueryCache().get(a.queryHash),[l]=j.useState(()=>new t(r,a)),c=l.getOptimisticResult(a);if(j.useSyncExternalStore(j.useCallback(v=>{const x=o?HP:l.subscribe(cr.batchCalls(v));return l.updateResult(),x},[l,o]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),j.useEffect(()=>{l.setOptions(a,{listeners:!1})},[a,l]),UG(a,c))throw WP(a,l,i);if(VG({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&&WG(c,o)){const v=s?WP(a,l,i):(b=r.getQueryCache().get(a.queryHash))==null?void 0:b.promise;v==null||v.catch(HP).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?c:l.trackResult(c)}function lp(e,t){return qG(e,DG,t)}function s6({children:e}){const{setIsSessionExpired:t}=dr(),n=new TG({queryCache:new r6({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(kG,{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})),GG={id:"",authToken:void 0},l6=m.createContext(GG),c6=({children:e,dashboardProps:t})=>R.jsx(s6,{children:R.jsx(l6.Provider,{value:t,children:R.jsx(bc,{style:{height:"100%"},children:e})})});function Mo(){const e=m.useContext(l6);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function YG(){const{authToken:e,version:t}=Mo(),n=we(s=>s.selectedLensId),{data:r,isLoading:o,isFetching:i,isError:a}=lp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>Dq(e==null?void 0:e.accessToken,{lensId:n,version:t})});return{data:r,isLoading:o,isFetching:i,isError:a}}function u6(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function UP(e,t){const n=u6(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 KG({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,onFilterValuesChange:i}){const{authToken:a}=Mo(),s=we(M=>M.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:d}=YG(),[h,p]=m.useState(o||[]),{theme:b,setTheme:v}=KM(),x=we(M=>M.dashboard.globalStyle),{setDashboard:y,setDashboardWithFilterValues:_,setSelectedSheetId:S,setStyle:C,setOnSaveFunction:E,setLenses:$,setSelectedLensId:D,setInitStore:T}=we(M=>M.actions);we(M=>M.actions.setCustomCards);const A=we(M=>M.actions.setFilterValues),L=we(M=>M.filterValues),F=we(M=>M.actions.setThemeStyle),z=we(M=>M.actions.setDashboardTheme),X=we(M=>M.actions.setOnEvent);m.useEffect(()=>{a&&T()},[a,T]),m.useEffect(()=>{if(b){const M=u6(b);z(M)}},[b,z]),m.useEffect(()=>{t&&v(t)},[t,v]);const G=m.useCallback(()=>{const M=Vl.cloneDeep(d0),U=Vl.merge(M,x);if(e){const V=Vl.merge(U,e),Y=UP(b,V);F(Y),C(V)}else{const V=UP(b,U);F(V),C(d0)}},[b,e,x,F,C]);return m.useEffect(()=>{l&&l.dashboard&&G()},[b,e,x,G,l]),m.useEffect(()=>{var H,K;function M(I,oe){const ce=I.filters||[],de=[];for(const he of oe){const ie=ce.find(ne=>ne.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:Y,lenses:q}=l,O=M(U,h||[]);_(U,V||O||[]),Y&&D(Y),q&&$(q),S(((K=(H=U==null?void 0:U.sheets)==null?void 0:H[0])==null?void 0:K.id)||null)},[l,y,S,A,s,$,_,D,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 xu({className:e,...t}){return R.jsx("div",{className:ye("animate-pulse rounded-md bg-muted",e),...t})}const d6=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}));d6.displayName="Card";const wb=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:ye("flex flex-col space-y-1.5 p-6",e),...t}));wb.displayName="CardHeader";const gd=j.forwardRef(({className:e,...t},n)=>R.jsx("h3",{ref:n,className:ye("text-2xl font-semibold leading-none tracking-tight",e),...t}));gd.displayName="CardTitle";const jS=j.forwardRef(({className:e,...t},n)=>R.jsx("p",{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));jS.displayName="CardDescription";const _b=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:ye("px-6 pt-0",e),...t}));_b.displayName="CardContent";const f6=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:ye("flex items-center p-6 pt-0",e),...t}));f6.displayName="CardFooter";function h6({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:b,...v}){we(E=>E.selectedSheetId);const x=we(E=>E.themeStyle),y=we(E=>E.isSessionExpired),{isLoading:_,isError:S,isFetching:C}=KG({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:p,onFilterValuesChange:b});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(xu,{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(gd,{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",...v})}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,...b}=d,v=(h==null?void 0:h[e][l])||s,x=m.useMemo(()=>b,Object.values(b));return m.createElement(v.Provider,{value:x},p)}function u(d,h){const p=(h==null?void 0:h[e][l])||s,b=m.useContext(p);if(b)return b;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,XG(o,...t)]}function XG(...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 QG(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Ba(...e){return t=>e.forEach(n=>QG(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(ZG);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,{...eY(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 JG=({children:e})=>m.createElement(m.Fragment,null,e);function ZG(e){return m.isValidElement(e)&&e.type===JG}function eY(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 Sb(e){const t=e+"CollectionProvider",[n,r]=hr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:b,children:v}=p,x=m.useRef(null),y=m.useRef(new Map).current;return m.createElement(o,{scope:b,itemMap:y,collectionRef:x},v)},s=e+"CollectionSlot",l=m.forwardRef((p,b)=>{const{scope:v,children:x}=p,y=i(s,v),_=Rt(b,y.collectionRef);return m.createElement(Sw,{ref:_},x)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",d=m.forwardRef((p,b)=>{const{scope:v,children:x,...y}=p,_=m.useRef(null),S=Rt(b,_),C=i(c,v);return m.useEffect(()=>(C.itemMap.set(_,{ref:_,...y}),()=>void C.itemMap.delete(_))),m.createElement(Sw,{[u]:"",ref:S},x)});function h(p){const b=i(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((C,E)=>y.indexOf(C.ref.current)-y.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},h,r]}const Cr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},tY=j.useId||(()=>{});let nY=0;function xi(e){const[t,n]=j.useState(tY());return Cr(()=>{e||n(r=>r??String(nY++))},[e]),e||(t?`radix-${t}`:"")}const p6=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(oY);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)});p6.displayName="Slot";const Ew=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...iY(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 rY=({children:e})=>m.createElement(m.Fragment,null,e);function oY(e){return m.isValidElement(e)&&e.type===rY}function iY(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 aY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=aY.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?p6: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 g6(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]=sY({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 sY({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 lY=m.createContext(void 0);function vc(e){const t=m.useContext(lY);return e||t||"ltr"}const r1="rovingFocusGroup.onEntryFocus",cY={bubbles:!1,cancelable:!0},zS="RovingFocusGroup",[Rw,m6,uY]=Sb(zS),[dY,md]=hr(zS,[uY]),[fY,hY]=dY(zS),pY=m.forwardRef((e,t)=>m.createElement(Rw.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Rw.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(gY,ue({},e,{ref:t}))))),gY=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),[b=null,v]=Fr({prop:a,defaultProp:s,onChange:l}),[x,y]=m.useState(!1),_=Xn(c),S=m6(n),C=m.useRef(!1),[E,$]=m.useState(0);return m.useEffect(()=>{const D=d.current;if(D)return D.addEventListener(r1,_),()=>D.removeEventListener(r1,_)},[_]),m.createElement(fY,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:b,onItemFocus:m.useCallback(D=>v(D),[v]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>$(D=>D+1),[]),onFocusableItemRemove:m.useCallback(()=>$(D=>D-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,D=>{const T=!C.current;if(D.target===D.currentTarget&&T&&!x){const A=new CustomEvent(r1,cY);if(D.currentTarget.dispatchEvent(A),!A.defaultPrevented){const L=S().filter(M=>M.focusable),F=L.find(M=>M.active),z=L.find(M=>M.id===b),G=[F,z,...L].filter(Boolean).map(M=>M.ref.current);b6(G)}}C.current=!1}),onBlur:ke(e.onBlur,()=>y(!1))})))}),mY="RovingFocusGroupItem",bY=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=e,s=xi(),l=i||s,c=hY(mY,n),u=c.currentTabStopId===l,d=m6(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,b=>{r?c.onItemFocus(l):b.preventDefault()}),onFocus:ke(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ke(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){c.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=xY(b,c.orientation,c.dir);if(v!==void 0){b.preventDefault();let y=d().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const _=y.indexOf(b.currentTarget);y=c.loop?wY(y,_+1):y.slice(_+1)}setTimeout(()=>b6(y))}})})))}),vY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function xY(e,t,n){const r=yY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return vY[r]}function b6(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function wY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const BS=pY,VS=bY;function _Y(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=SY(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 SY(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),a=e?"mounted":"unmounted",[s,l]=_Y(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Dg(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=Dg(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=Dg(r.current).includes(d.animationName);d.target===t&&p&&Er.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Dg(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 Dg(e){return(e==null?void 0:e.animationName)||"none"}const v6="Tabs",[CY,JRe]=hr(v6,[md]),y6=md(),[EY,HS]=CY(v6),RY=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(EY,{scope:n,baseId:xi(),value:d,onValueChange:h,orientation:a,dir:u,activationMode:l},m.createElement(Qe.div,ue({dir:u,"data-orientation":a},c,{ref:t})))}),PY="TabsList",$Y=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=HS(PY,n),a=y6(n);return m.createElement(BS,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})))}),OY="TabsTrigger",TY=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=HS(OY,n),s=y6(n),l=x6(a.baseId,r),c=w6(a.baseId,r),u=r===a.value;return m.createElement(VS,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)})})))}),DY="TabsContent",AY=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=HS(DY,n),l=x6(s.baseId,r),c=w6(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 x6(e,t){return`${e}-trigger-${t}`}function w6(e,t){return`${e}-content-${t}`}const MY=RY,_6=$Y,S6=TY,C6=AY,WS=MY,Cb=j.forwardRef(({className:e,...t},n)=>R.jsx(_6,{ref:n,className:ye("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Cb.displayName=_6.displayName;const Eb=j.forwardRef(({className:e,...t},n)=>R.jsx(S6,{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}));Eb.displayName=S6.displayName;const US=j.forwardRef(({className:e,...t},n)=>R.jsx(C6,{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}));US.displayName=C6.displayName;var E6={exports:{}},cp={},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,ne){var le={};for(var xe in ie)le[xe]=ie[xe];for(var xe in ne)le[xe]=ne[xe];return le}function a(ie){return ie.constructor===Object||ie.constructor==null}function s(ie){return typeof ie.then=="function"}function l(ie,ne){return ie===ne||ie!==ie&&ne!==ne}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",p="[object Map]",b="[object Number]",v="[object Object]",x="[object Set]",y="[object String]",_=Object.prototype.toString;function S(ie){var ne=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&&ne(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===v||It===c?s(Be)||s(Ie)?!1:Z(Be,Ie,Te,Ke):It===u||It===b||It===y?l(Be.valueOf(),Ie.valueOf()):!1}return We}function C(ie,ne,le,xe){var Z=ie.length;if(ne.length!==Z)return!1;for(;Z-- >0;)if(!le(ie[Z],ne[Z],Z,Z,ie,ne,xe))return!1;return!0}var E=o(C);function $(ie,ne){return l(ie.valueOf(),ne.valueOf())}function D(ie,ne,le,xe){var Z=ie.size===ne.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;ne.forEach(function(Ie,Ke){!We&&!ve[Be]&&(We=le(Te,Ke,Ce,Be,ie,ne,xe)&&le(Oe,Ie,Te,Ke,ie,ne,xe))&&(ve[Be]=!0),Be++}),Ce++,Z=We}}),Z}var T=o(D),A="_owner",L=Object.prototype.hasOwnProperty;function F(ie,ne,le,xe){var Z=Object.keys(ie),ve=Z.length;if(Object.keys(ne).length!==ve)return!1;for(var Ce;ve-- >0;){if(Ce=Z[ve],Ce===A){var Oe=!!ie.$$typeof,Te=!!ne.$$typeof;if((Oe||Te)&&Oe!==Te)return!1}if(!L.call(ne,Ce)||!le(ie[Ce],ne[Ce],Ce,Ce,ie,ne,xe))return!1}return!0}var z=o(F);function X(ie,ne){return ie.source===ne.source&&ie.flags===ne.flags}function G(ie,ne,le,xe){var Z=ie.size===ne.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;ne.forEach(function(Be,Ie){!Te&&!ve[We]&&(Te=le(Ce,Be,Oe,Ie,ie,ne,xe))&&(ve[We]=!0),We++}),Z=Te}}),Z}var M=o(G),U=Object.freeze({areArraysEqual:C,areDatesEqual:$,areMapsEqual:D,areObjectsEqual:F,areRegExpsEqual:X,areSetsEqual:G,createIsNestedEqual:r}),V=Object.freeze({areArraysEqual:E,areDatesEqual:$,areMapsEqual:T,areObjectsEqual:z,areRegExpsEqual:X,areSetsEqual:M,createIsNestedEqual:r}),Y=S(U);function q(ie,ne){return Y(ie,ne,void 0)}var O=S(i(U,{createIsNestedEqual:function(){return l}}));function H(ie,ne){return O(ie,ne,void 0)}var K=S(V);function I(ie,ne){return K(ie,ne,new WeakMap)}var oe=S(i(V,{createIsNestedEqual:function(){return l}}));function ce(ie,ne){return oe(ie,ne,new WeakMap)}function de(ie){return S(i(U,ie(U)))}function he(ie){var ne=S(i(V,ie(V)));return function(le,xe,Z){return Z===void 0&&(Z=new WeakMap),ne(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 qS=Pw.exports;const GS=CS(VU);var Dt={},kY=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=YS;Dt.childrenEqual=FY;Dt.cloneLayout=R6;Dt.cloneLayoutItem=Hl;Dt.collides=Rb;Dt.compact=$6;Dt.compactItem=O6;Dt.compactType=JY;Dt.correctBounds=T6;Dt.fastPositionEqual=zY;Dt.fastRGLPropsEqual=void 0;Dt.getAllCollisions=D6;Dt.getFirstCollision=Ol;Dt.getLayoutItem=KS;Dt.getStatics=XS;Dt.modifyLayout=P6;Dt.moveElement=Cf;Dt.moveElementAwayFromCollision=Ow;Dt.noop=void 0;Dt.perc=VY;Dt.resizeItemInDirection=YY;Dt.setTopLeft=XY;Dt.setTransform=KY;Dt.sortLayoutItems=nC;Dt.sortLayoutItemsByColRow=N6;Dt.sortLayoutItemsByRowCol=I6;Dt.synchronizeLayoutWithChildren=QY;Dt.validateLayout=L6;Dt.withLayoutItem=LY;var qP=qS,Sf=IY(m);function IY(e){return e&&e.__esModule?e:{default:e}}const NY=process.env.NODE_ENV==="production";function YS(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 R6(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Hl(e[n]);return t}function P6(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 LY(e,t,n){let r=KS(e,t);return r?(r=n(Hl(r)),e=P6(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 FY(e,t){return(0,qP.deepEqual)(Sf.default.Children.map(e,n=>n==null?void 0:n.key),Sf.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,qP.deepEqual)(Sf.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Sf.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const jY=kY;Dt.fastRGLPropsEqual=jY;function zY(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Rb(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 $6(e,t,n,r){const o=XS(e),i=nC(e,t),a=Array(e.length);for(let s=0,l=i.length;s<l;s++){let c=Hl(i[s]);c.static||(c=O6(o,c,t,n,i,r),o.push(c)),a[e.indexOf(i[s])]=c,c.moved=!1}return a}const BY={x:"w",y:"h"};function $w(e,t,n,r){const o=BY[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;Rb(t,s)&&$w(e,s,n+t[o],r)}}t[r]=n}function O6(e,t,n,r,o,i){const a=n==="vertical",s=n==="horizontal";if(a)for(t.y=Math.min(YS(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 T6(e,t){const n=XS(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 KS(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(Rb(e[n],t))return e[n]}function D6(e,t){return e.filter(n=>Rb(n,t))}function XS(e){return e.filter(t=>t.static)}function Cf(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=nC(e,a);(a==="vertical"&&typeof r=="number"?u>=r:a==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const p=D6(d,t),b=p.length>0;if(b&&l)return R6(e);if(b&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let v=0,x=p.length;v<x;v++){const y=p[v];"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,b=h&&t.x+t.w>h.x;if(h){if(p&&s)return Cf(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(b&&a)return Cf(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,"]."),Cf(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:Cf(e,n,a?n.x+1:void 0,s?n.y+1:void 0,r,l,o)}function VY(e){return e*100+"%"}const A6=(e,t,n,r)=>e+n>r?t:n,M6=(e,t,n)=>e<0?t:n,k6=e=>Math.max(0,e),QS=e=>Math.max(0,e),JS=(e,t,n)=>{let{left:r,height:o,width:i}=t;const a=e.top-(o-e.height);return{left:r,width:i,height:M6(a,e.height,o),top:QS(a)}},ZS=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{top:r,height:i,width:A6(e.left,e.width,a,n),left:k6(o)}},eC=(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:A6(e.left,e.width,i,n),top:QS(r),left:k6(a)}},tC=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{width:a,left:o,height:M6(r,e.height,i),top:QS(r)}},HY=function(){return JS(arguments.length<=0?void 0:arguments[0],ZS(...arguments))},WY=function(){return JS(arguments.length<=0?void 0:arguments[0],eC(...arguments))},UY=function(){return tC(arguments.length<=0?void 0:arguments[0],ZS(...arguments))},qY=function(){return tC(arguments.length<=0?void 0:arguments[0],eC(...arguments))},GY={n:JS,ne:HY,e:ZS,se:UY,s:tC,sw:qY,w:eC,nw:WY};function YY(e,t,n,r){const o=GY[e];return o?o(t,{...t,...n},r):n}function KY(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 XY(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 nC(e,t){return t==="horizontal"?N6(e):t==="vertical"?I6(e):e}function I6(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 N6(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 QY(e,t,n,r,o){e=e||[];const i=[];Sf.default.Children.forEach(t,s=>{if((s==null?void 0:s.key)==null)return;const l=KS(e,String(s.key)),c=s.props["data-grid"];l&&c==null?i.push(Hl(l)):c?(NY||L6([c],"ReactGridLayout.children"),i.push(Hl({...c,i:s.key}))):i.push(Hl({w:1,h:1,x:0,y:YS(i),i:String(s.key)}))});const a=T6(i,{cols:n});return o?a:$6(a,r,n)}function L6(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 JY(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const ZY=()=>{};Dt.noop=ZY;var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.calcGridColWidth=Pb;ea.calcGridItemPosition=eK;ea.calcGridItemWHPx=Tw;ea.calcWH=nK;ea.calcXY=tK;ea.clamp=Tl;function Pb(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 eK(e,t,n,r,o,i){const{margin:a,containerPadding:s,rowHeight:l}=e,c=Pb(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 tK(e,t,n,r,o){const{margin:i,cols:a,rowHeight:s,maxRows:l}=e,c=Pb(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 nK(e,t,n,r,o,i){const{margin:a,maxRows:s,cols:l,rowHeight:c}=e,u=Pb(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),b=Tl(h,0,s-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Tl(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=Tl(h,0,s)),{w:p,h:b}}function Tl(e,t,n){return Math.max(Math.min(e,n),t)}var $b={},Dw={exports:{}},o1,GP;function rC(){if(GP)return o1;GP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return o1=e,o1}var i1,YP;function rK(){if(YP)return i1;YP=1;var e=rC();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 Ag={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 KP;function oK(){return KP||(KP=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,b=e?Symbol.for("react.lazy"):60116,v=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===b||Z.$$typeof===p||Z.$$typeof===a||Z.$$typeof===s||Z.$$typeof===u||Z.$$typeof===x||Z.$$typeof===y||Z.$$typeof===_||Z.$$typeof===v)}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 b:case p:case a:return Oe;default:return ve}}case n:return ve}}}var E=l,$=c,D=s,T=a,A=t,L=u,F=r,z=b,X=p,G=n,M=i,U=o,V=d,Y=!1;function q(Z){return Y||(Y=!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 K(Z){return C(Z)===a}function I(Z){return typeof Z=="object"&&Z!==null&&Z.$$typeof===t}function oe(Z){return C(Z)===u}function ce(Z){return C(Z)===r}function de(Z){return C(Z)===b}function he(Z){return C(Z)===p}function ie(Z){return C(Z)===n}function ne(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=D,en.ContextProvider=T,en.Element=A,en.ForwardRef=L,en.Fragment=F,en.Lazy=z,en.Memo=X,en.Portal=G,en.Profiler=M,en.StrictMode=U,en.Suspense=V,en.isAsyncMode=q,en.isConcurrentMode=O,en.isContextConsumer=H,en.isContextProvider=K,en.isElement=I,en.isForwardRef=oe,en.isFragment=ce,en.isLazy=de,en.isMemo=he,en.isPortal=ie,en.isProfiler=ne,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 XP;function iK(){if(XP)return tn;XP=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,b=e?Symbol.for("react.lazy"):60116,v=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 b: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=b,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)===b},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===b||E.$$typeof===p||E.$$typeof===a||E.$$typeof===s||E.$$typeof===u||E.$$typeof===x||E.$$typeof===y||E.$$typeof===_||E.$$typeof===v)},tn.typeOf=S,tn}var QP;function F6(){return QP||(QP=1,process.env.NODE_ENV==="production"?Ag.exports=iK():Ag.exports=oK()),Ag.exports}/*
103
- object-assign
104
- (c) Sindre Sorhus
105
- @license MIT
106
- */var a1,JP;function aK(){if(JP)return a1;JP=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,ZP;function j6(){return ZP||(ZP=1,s1=Function.call.bind(Object.prototype.hasOwnProperty)),s1}var l1,e$;function sK(){if(e$)return l1;e$=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=rC(),n={},r=j6();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(b){d=b}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,t$;function lK(){if(t$)return c1;t$=1;var e=F6(),t=aK(),n=rC(),r=j6(),o=sK(),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:T,oneOf:D,oneOfType:A,shape:z,exact:X};function b(O,H){return O===H?O!==0||1/O===1/H:O!==O&&H!==H}function v(O,H){this.message=O,this.data=H&&typeof H=="object"?H:{},this.stack=""}v.prototype=Error.prototype;function x(O){if(process.env.NODE_ENV!=="production")var H={},K=0;function I(ce,de,he,ie,ne,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]&&K<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,K++)}}return de[he]==null?ce?de[he]===null?new v("The "+ne+" `"+le+"` is marked as required "+("in `"+ie+"`, but its value is `null`.")):new v("The "+ne+" `"+le+"` is marked as required in "+("`"+ie+"`, but its value is `undefined`.")):null:O(de,he,ie,ne,le)}var oe=I.bind(null,!1);return oe.isRequired=I.bind(null,!0),oe}function y(O){function H(K,I,oe,ce,de,he){var ie=K[I],ne=U(ie);if(ne!==O){var le=V(ie);return new v("Invalid "+ce+" `"+de+"` of type "+("`"+le+"` supplied to `"+oe+"`, expected ")+("`"+O+"`."),{expectedType:O})}return null}return x(H)}function _(){return x(a)}function S(O){function H(K,I,oe,ce,de){if(typeof O!="function")return new v("Property `"+de+"` of component `"+oe+"` has invalid PropType notation inside arrayOf.");var he=K[I];if(!Array.isArray(he)){var ie=U(he);return new v("Invalid "+ce+" `"+de+"` of type "+("`"+ie+"` supplied to `"+oe+"`, expected an array."))}for(var ne=0;ne<he.length;ne++){var le=O(he,ne,oe,ce,de+"["+ne+"]",n);if(le instanceof Error)return le}return null}return x(H)}function C(){function O(H,K,I,oe,ce){var de=H[K];if(!s(de)){var he=U(de);return new v("Invalid "+oe+" `"+ce+"` of type "+("`"+he+"` supplied to `"+I+"`, expected a single ReactElement."))}return null}return x(O)}function E(){function O(H,K,I,oe,ce){var de=H[K];if(!e.isValidElementType(de)){var he=U(de);return new v("Invalid "+oe+" `"+ce+"` of type "+("`"+he+"` supplied to `"+I+"`, expected a single ReactElement type."))}return null}return x(O)}function $(O){function H(K,I,oe,ce,de){if(!(K[I]instanceof O)){var he=O.name||h,ie=q(K[I]);return new v("Invalid "+ce+" `"+de+"` of type "+("`"+ie+"` supplied to `"+oe+"`, expected ")+("instance of `"+he+"`."))}return null}return x(H)}function D(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(K,I,oe,ce,de){for(var he=K[I],ie=0;ie<O.length;ie++)if(b(he,O[ie]))return null;var ne=JSON.stringify(O,function(xe,Z){var ve=V(Z);return ve==="symbol"?String(Z):Z});return new v("Invalid "+ce+" `"+de+"` of value `"+String(he)+"` "+("supplied to `"+oe+"`, expected one of "+ne+"."))}return x(H)}function T(O){function H(K,I,oe,ce,de){if(typeof O!="function")return new v("Property `"+de+"` of component `"+oe+"` has invalid PropType notation inside objectOf.");var he=K[I],ie=U(he);if(ie!=="object")return new v("Invalid "+ce+" `"+de+"` of type "+("`"+ie+"` supplied to `"+oe+"`, expected an object."));for(var ne in he)if(r(he,ne)){var le=O(he,ne,oe,ce,de+"."+ne,n);if(le instanceof Error)return le}return null}return x(H)}function A(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 K=O[H];if(typeof K!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Y(K)+" at index "+H+"."),a}function I(oe,ce,de,he,ie){for(var ne=[],le=0;le<O.length;le++){var xe=O[le],Z=xe(oe,ce,de,he,ie,n);if(Z==null)return null;Z.data&&r(Z.data,"expectedType")&&ne.push(Z.data.expectedType)}var ve=ne.length>0?", expected one of type ["+ne.join(", ")+"]":"";return new v("Invalid "+he+" `"+ie+"` supplied to "+("`"+de+"`"+ve+"."))}return x(I)}function L(){function O(H,K,I,oe,ce){return G(H[K])?null:new v("Invalid "+oe+" `"+ce+"` supplied to "+("`"+I+"`, expected a ReactNode."))}return x(O)}function F(O,H,K,I,oe){return new v((O||"React class")+": "+H+" type `"+K+"."+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+oe+"`.")}function z(O){function H(K,I,oe,ce,de){var he=K[I],ie=U(he);if(ie!=="object")return new v("Invalid "+ce+" `"+de+"` of type `"+ie+"` "+("supplied to `"+oe+"`, expected `object`."));for(var ne in O){var le=O[ne];if(typeof le!="function")return F(oe,ce,de,ne,V(le));var xe=le(he,ne,oe,ce,de+"."+ne,n);if(xe)return xe}return null}return x(H)}function X(O){function H(K,I,oe,ce,de){var he=K[I],ie=U(he);if(ie!=="object")return new v("Invalid "+ce+" `"+de+"` of type `"+ie+"` "+("supplied to `"+oe+"`, expected `object`."));var ne=t({},K[I],O);for(var le in ne){var xe=O[le];if(r(O,le)&&typeof xe!="function")return F(oe,ce,de,le,V(xe));if(!xe)return new v("Invalid "+ce+" `"+de+"` key `"+le+"` supplied to `"+oe+"`.\nBad object: "+JSON.stringify(K[I],null," ")+`
107
- Valid keys: `+JSON.stringify(Object.keys(O),null," "));var Z=xe(he,le,oe,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 K=H.call(O),I;if(H!==O.entries){for(;!(I=K.next()).done;)if(!G(I.value))return!1}else for(;!(I=K.next()).done;){var oe=I.value;if(oe&&!G(oe[1]))return!1}}else return!1;return!0;default:return!1}}function M(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":M(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 Y(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 cK=F6(),uK=!0;Dw.exports=lK()(cK.isElement,uK)}else Dw.exports=rK()();var Ks=Dw.exports,Ob={exports:{}},z6={};function B6(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=B6(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function n$(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=B6(e))&&(r&&(r+=" "),r+=t);return r}const dK=Object.freeze(Object.defineProperty({__proto__:null,clsx:n$,default:n$},Symbol.toStringTag,{value:"Module"})),fK=CS(dK);var Fn={},ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.dontSetMe=bK;ta.findInArray=hK;ta.int=mK;ta.isFunction=pK;ta.isNum=gK;function hK(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function pK(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function gK(e){return typeof e=="number"&&!isNaN(e)}function mK(e){return parseInt(e,10)}function bK(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=H6;yc.browserPrefixToStyle=vK;yc.default=void 0;yc.getPrefix=V6;const u1=["Moz","Webkit","O","ms"];function V6(){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(H6(t,u1[r])in n)return u1[r];return""}function H6(e,t){return t?"".concat(t).concat(yK(e)):e}function vK(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function yK(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=V6();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.addClassName=q6;Fn.addEvent=_K;Fn.addUserSelectStyles=MK;Fn.createCSSTransform=OK;Fn.createSVGTransform=TK;Fn.getTouch=DK;Fn.getTouchIdentifier=AK;Fn.getTranslation=oC;Fn.innerHeight=RK;Fn.innerWidth=PK;Fn.matchesSelector=U6;Fn.matchesSelectorAndParentsTo=wK;Fn.offsetXYFromParent=$K;Fn.outerHeight=CK;Fn.outerWidth=EK;Fn.removeClassName=G6;Fn.removeEvent=SK;Fn.removeUserSelectStyles=kK;var Eo=ta,r$=xK(yc);function W6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(W6=function(r){return r?n:t})(e)}function xK(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=W6(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 Mg="";function U6(e,t){return Mg||(Mg=(0,Eo.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Eo.isFunction)(e[n])})),(0,Eo.isFunction)(e[Mg])?e[Mg](t):!1}function wK(e,t,n){let r=e;do{if(U6(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function _K(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 SK(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 CK(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 EK(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 RK(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 PK(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 $K(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 OK(e,t){const n=oC(e,t,"px");return{[(0,r$.browserPrefixToKey)("transform",r$.default)]:n}}function TK(e,t){return oC(e,t,"")}function oC(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 DK(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 AK(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function MK(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&&q6(e.body,"react-draggable-transparent-selection")}function kK(e){if(e)try{if(e.body&&G6(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 q6(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function G6(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=LK;na.canDragY=FK;na.createCoreData=zK;na.createDraggableData=BK;na.getBoundPosition=IK;na.getControlPosition=jK;na.snapToGrid=NK;var ho=ta,du=Fn;function IK(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:VK(r);const o=iC(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 NK(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function LK(e){return e.props.axis==="both"||e.props.axis==="x"}function FK(e){return e.props.axis==="both"||e.props.axis==="y"}function jK(e,t,n){const r=typeof t=="number"?(0,du.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=iC(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,du.offsetXYFromParent)(r||e,i,n.props.scale)}function zK(e,t,n){const r=!(0,ho.isNum)(e.lastX),o=iC(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 BK(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 VK(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function iC(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Tb={},Db={};Object.defineProperty(Db,"__esModule",{value:!0});Db.default=HK;function HK(){}Object.defineProperty(Tb,"__esModule",{value:!0});Tb.default=void 0;var d1=UK(m),qr=aC(Ks),WK=aC(Er),vr=Fn,cs=na,f1=ta,Qd=aC(Db);function aC(e){return e&&e.__esModule?e:{default:e}}function Y6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Y6=function(r){return r?n:t})(e)}function UK(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Y6(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=qK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qK(e){var t=GK(e,"string");return typeof t=="symbol"?t:String(t)}function GK(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 ui={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let us=ui.mouse,Ab=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,Qd.default)("DraggableCore: handleDragStart: %j",l),(0,Qd.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,Qd.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,Qd.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,Qd.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=ui.mouse,this.handleDragStart(t))),Dr(this,"onMouseUp",t=>(us=ui.mouse,this.handleDragStop(t))),Dr(this,"onTouchStart",t=>(us=ui.touch,this.handleDragStart(t))),Dr(this,"onTouchEnd",t=>(us=ui.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,vr.addEvent)(t,ui.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,vr.removeEvent)(n,ui.mouse.move,this.handleDrag),(0,vr.removeEvent)(n,ui.touch.move,this.handleDrag),(0,vr.removeEvent)(n,ui.mouse.stop,this.handleDragStop),(0,vr.removeEvent)(n,ui.touch.stop,this.handleDragStop),(0,vr.removeEvent)(t,ui.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:WK.default.findDOMNode(this)}render(){return d1.cloneElement(d1.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Tb.default=Ab;Dr(Ab,"displayName","DraggableCore");Dr(Ab,"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(Ab,"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(fK),i=Fn,a=na,s=ta,l=u(Tb),c=u(Db);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 D in _)if(D!=="default"&&Object.prototype.hasOwnProperty.call(_,D)){var T=$?Object.getOwnPropertyDescriptor(_,D):null;T&&(T.get||T.set)?Object.defineProperty(E,D,T):E[D]=_[D]}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 b(_,S,C){return S=v(S),S in _?Object.defineProperty(_,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[S]=C,_}function v(_){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),b(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})}),b(this,"onDrag",(C,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const $=(0,a.createDraggableData)(this,E),D={x:$.x,y:$.y,slackX:0,slackY:0};if(this.props.bounds){const{x:A,y:L}=D;D.x+=this.state.slackX,D.y+=this.state.slackY;const[F,z]=(0,a.getBoundPosition)(this,D.x,D.y);D.x=F,D.y=z,D.slackX=this.state.slackX+(A-D.x),D.slackY=this.state.slackY+(L-D.y),$.x=D.x,$.y=D.y,$.deltaX=D.x-this.state.x,$.deltaY=D.y-this.state.y}if(this.props.onDrag(C,$)===!1)return!1;this.setState(D)}),b(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 D={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:A,y:L}=this.props.position;D.x=A,D.y=L}this.setState(D)}),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:D,defaultClassNameDragging:T,defaultClassNameDragged:A,position:L,positionOffset:F,scale:z,...X}=this.props;let G={},M=null;const V=!!!L||this.state.dragging,Y=L||$,q={x:(0,a.canDragX)(this)&&V?this.state.x:Y.x,y:(0,a.canDragY)(this)&&V?this.state.y:Y.y};this.state.isElementSVG?M=(0,i.createSVGTransform)(q,F):G=(0,i.createCSSTransform)(q,F);const O=(0,o.default)(E.props.className||"",D,{[T]:this.state.dragging,[A]: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:M}))}}e.default=y,b(y,"displayName","Draggable"),b(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}),b(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})})(z6);const{default:K6,DraggableCore:YK}=z6;Ob.exports=K6;Ob.exports.default=K6;Ob.exports.DraggableCore=YK;var X6=Ob.exports,Mb={exports:{}},up={},sC={};sC.__esModule=!0;sC.cloneElement=eX;var KK=XK(m);function XK(e){return e&&e.__esModule?e:{default:e}}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 i$(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){QK(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 QK(e,t,n){return t=JK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JK(e){var t=ZK(e,"string");return typeof t=="symbol"?t:String(t)}function ZK(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 eX(e,t){return t.style&&e.props.style&&(t.style=i$(i$({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),KK.default.cloneElement(e,t)}var dp={};dp.__esModule=!0;dp.resizableProps=void 0;var yt=tX(Ks);function tX(e){return e&&e.__esModule?e:{default:e}}var nX={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)}};dp.resizableProps=nX;up.__esModule=!0;up.default=void 0;var Jd=sX(m),rX=X6,oX=sC,iX=dp,aX=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Q6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Q6=function(o){return o?n:t})(e)}function sX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Q6(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 lX(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 a$(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?a$(Object(n),!0).forEach(function(r){cX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cX(e,t,n){return t=uX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uX(e){var t=dX(e,"string");return typeof t=="symbol"?t:String(t)}function dX(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 fX(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 lC=function(e){fX(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,b=i,v=this.slack||[0,0],x=v[0],y=v[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+(b-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 b=i[0],v=i[i.length-1],x=c.getBoundingClientRect();if(a.lastHandleRect!=null){if(v==="w"){var y=x.left-a.lastHandleRect.left;u+=y}if(b==="n"){var _=x.top-a.lastHandleRect.top;d+=_}}a.lastHandleRect=x,v==="w"&&(u=-u),b==="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,D=typeof a.props[o]=="function"?a.props[o]:null,T=o==="onResize"&&!$;D&&!T&&(s.persist==null||s.persist(),D(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 Jd.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 Jd.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=lX(i,aX);return(0,oX.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]=Jd.createRef();return Jd.createElement(rX.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}(Jd.Component);up.default=lC;lC.propTypes=iX.resizableProps;lC.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var kb={};kb.__esModule=!0;kb.default=void 0;var p1=bX(m),hX=J6(Ks),pX=J6(up),gX=dp,mX=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function J6(e){return e&&e.__esModule?e:{default:e}}function Z6(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Z6=function(o){return o?n:t})(e)}function bX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Z6(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 s$(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 g0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s$(Object(n),!0).forEach(function(r){vX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vX(e,t,n){return t=yX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yX(e){var t=xX(e,"string");return typeof t=="symbol"?t:String(t)}function xX(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 wX(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 _X(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 ek=function(e){_X(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 b=o.resizeHandles,v=o.style,x=o.transformScale,y=wX(o,mX);return p1.createElement(pX.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:b,transformScale:x,width:this.state.width},p1.createElement("div",kw({},y,{style:g0(g0({},v),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(p1.Component);kb.default=ek;ek.propTypes=g0(g0({},gX.resizableProps),{},{children:hX.default.element});Mb.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};Mb.exports.Resizable=up.default;Mb.exports.ResizableBox=kb.default;var SX=Mb.exports,Ia={};Object.defineProperty(Ia,"__esModule",{value:!0});Ia.resizeHandleType=Ia.resizeHandleAxesType=Ia.default=void 0;var Et=tk(Ks),CX=tk(m);function tk(e){return e&&e.__esModule?e:{default:e}}const nk=Et.default.arrayOf(Et.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));Ia.resizeHandleAxesType=nk;const rk=Et.default.oneOfType([Et.default.node,Et.default.func]);Ia.resizeHandleType=rk;var EX={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:nk,resizeHandle:rk,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={};CX.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=EX;Object.defineProperty($b,"__esModule",{value:!0});$b.default=void 0;var Uc=cC(m),Gt=cC(Ks),RX=X6,PX=SX,qc=Dt,sr=ea,l$=Ia,$X=cC(GS);function cC(e){return e&&e.__esModule?e:{default:e}}function Di(e,t,n){return t=OX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OX(e){var t=TX(e,"string");return typeof t=="symbol"?t:String(t)}function TX(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 uC 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:b,y:v}=(0,sr.calcXY)(this.getPositionParams(),a.top,a.left,this.props.w,this.props.h);return o.call(this,this.props.i,b,v,{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,b=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)(b),D=p-(0,sr.calcGridItemWHPx)(d,$,S[0]);l=(0,sr.clamp)(l,0,D)}}const v={top:s,left:l};this.setState({dragging:v});const{x,y}=(0,sr.calcXY)(b,s,l,d,h);return a.call(this,u,x,y,{e:t,node:r,newPosition:v})}),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(RX.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,b=(0,sr.calcGridItemPosition)(h,0,0,i,a),v=(0,sr.calcGridItemPosition)(h,0,0,s,l),x=[b.width,b.height],y=[Math.min(v.width,p),Math.min(v.height,1/0)];return Uc.default.createElement(PX.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:b}=this.props,{minW:v,maxW:x}=this.props;let y=a;i&&(y=(0,qc.resizeItemInDirection)(s,r,a,b),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(v,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,$X.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}}$b.default=uC;Di(uC,"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:l$.resizeHandleAxesType,resizeHandle:l$.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(uC,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(cp,"__esModule",{value:!0});cp.default=void 0;var ul=kX(m),g1=qS,DX=dC(GS),at=Dt,AX=ea,c$=dC($b),MX=dC(Ia);function dC(e){return e&&e.__esModule?e:{default:e}}function ok(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ok=function(r){return r?n:t})(e)}function kX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ok(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=IX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IX(e){var t=NX(e,"string");return typeof t=="symbol"?t:String(t)}function NX(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$="react-grid-layout";let ik=!1;try{ik=/firefox/i.test(navigator.userAgent)}catch{}class Ib 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},b=!0;l=(0,at.moveElement)(l,h,n,r,b,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 b=d?l:(0,at.compact)(l,(0,at.compactType)(this.props),c);this.props.onDragStop(b,s,h,null,i,a);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:b,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(b,v)}),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 b=!1,v,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),b=!0),h&&!p&&($=(0,at.getAllCollisions)(u,{...E,w:n,h:r,x,y}).filter(T=>T.i!==E.i).length>0,$&&(y=E.y,r=E.h,x=E.x,n=E.w,b=!1)),E.w=n,E.h=r,E});if(!S)return;v=_,b&&(v=(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(v,c,S,C,i,a),this.setState({layout:p?v:(0,at.compact)(v,(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(),ik&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(u$)))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:b}=this.state,{layerX:v,layerY:x}=t.nativeEvent,y={left:v/d,top:x/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=v||S!=x)&&this.setState({droppingPosition:y})}}else{const _={cols:a,margin:i,maxRows:l,rowHeight:s,containerWidth:c,containerPadding:u||i},S=(0,AX.calcXY)(_,x,v,p.w,p.h);this.setState({droppingDOMNode:ul.createElement("div",{key:p.i}),droppingPosition:y,layout:[...b,{...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(c$.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:b,draggableCancel:v,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,D=r.resizeHandles||y,T=E&&h&&r.isBounded!==!1;return ul.createElement(c$.default,{containerWidth:o,cols:i,margin:a,containerPadding:s||a,maxRows:c,rowHeight:l,cancel:v,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:$,isBounded:T,useCSSTransforms:p&&S,usePercentages:!S,transformScale:b,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:D,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,DX.default)(u$,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())}}cp.default=Ib;yr(Ib,"displayName","ReactGridLayout");yr(Ib,"propTypes",MX.default);yr(Ib,"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 Nb={},xc={};Object.defineProperty(xc,"__esModule",{value:!0});xc.findOrGenerateResponsiveLayout=jX;xc.getBreakpointFromWidth=LX;xc.getColsFromBreakpoint=FX;xc.sortBreakpoints=fC;var kg=Dt;function LX(e,t){const n=fC(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 FX(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function jX(e,t,n,r,o,i){if(e[n])return(0,kg.cloneLayout)(e[n]);let a=e[r];const s=fC(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,kg.cloneLayout)(a||[]),(0,kg.compact)((0,kg.correctBounds)(a,{cols:o}),i,o)}function fC(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Nb,"__esModule",{value:!0});Nb.default=void 0;var d$=BX(m),Gr=ak(Ks),m1=qS,wu=Dt,dl=xc,zX=ak(cp);function ak(e){return e&&e.__esModule?e:{default:e}}function sk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(sk=function(r){return r?n:t})(e)}function BX(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=sk(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 m0(e,t,n){return t=VX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VX(e){var t=HX(e,"string");return typeof t=="symbol"?t:String(t)}function HX(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 f$=e=>Object.prototype.toString.call(e);function Ig(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class hC extends d$.Component{constructor(){super(...arguments),m0(this,"state",this.generateInitialState()),m0(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,wu.cloneLayout)(this.state.layout));let h=(0,dl.findOrGenerateResponsiveLayout)(c,n,a,s,l,i);h=(0,wu.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=Ig(this.props.margin,a),d=Ig(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 d$.createElement(zX.default,Nw({},u,{margin:Ig(i,this.state.breakpoint),containerPadding:Ig(a,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Nb.default=hC;m0(hC,"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(f$(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+f$(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,wu.validateLayout)(e.layouts[n],"layouts."+n)})},width:Gr.default.number.isRequired,onBreakpointChange:Gr.default.func,onLayoutChange:Gr.default.func,onWidthChange:Gr.default.func});m0(hC,"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:wu.noop,onLayoutChange:wu.noop,onWidthChange:wu.noop});var pC={},lk=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,b0=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")()}(),WX=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(b0):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),UX=2;function qX(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){WX(i)}function s(){var l=Date.now();if(n){if(l-o<UX)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=l}return s}var GX=20,YX=["top","right","bottom","left","width","height","size","weight"],KX=typeof MutationObserver<"u",XX=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=qX(this.refresh.bind(this),GX)}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),KX?(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=YX.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}(),ck=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},Yu=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||b0},uk=Lb(0,0,0,0);function v0(e){return parseFloat(e)||0}function h$(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+v0(i)},0)}function QX(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]=v0(a)}return n}function JX(e){var t=e.getBBox();return Lb(0,0,t.width,t.height)}function ZX(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return uk;var r=Yu(e).getComputedStyle(e),o=QX(r),i=o.left+o.right,a=o.top+o.bottom,s=v0(r.width),l=v0(r.height);if(r.boxSizing==="border-box"&&(Math.round(s+i)!==t&&(s-=h$(r,"left","right")+i),Math.round(l+a)!==n&&(l-=h$(r,"top","bottom")+a)),!tQ(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 Lb(o.left,o.top,s,l)}var eQ=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Yu(e).SVGGraphicsElement}:function(e){return e instanceof Yu(e).SVGElement&&typeof e.getBBox=="function"}}();function tQ(e){return e===Yu(e).document.documentElement}function nQ(e){return Lw?eQ(e)?JX(e):ZX(e):uk}function rQ(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 ck(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function Lb(e,t,n,r){return{x:e,y:t,width:n,height:r}}var oQ=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Lb(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=nQ(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}(),iQ=function(){function e(t,n){var r=rQ(n);ck(this,{target:t,contentRect:r})}return e}(),aQ=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new lk,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 Yu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new oQ(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 Yu(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 iQ(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}(),dk=typeof WeakMap<"u"?new WeakMap:new lk,fk=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=XX.getInstance(),r=new aQ(t,n,this);dk.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){fk.prototype[e]=function(){var t;return(t=dk.get(this))[e].apply(t,arguments)}});var sQ=function(){return typeof b0.ResizeObserver<"u"?b0.ResizeObserver:fk}();const lQ=Object.freeze(Object.defineProperty({__proto__:null,default:sQ},Symbol.toStringTag,{value:"Module"})),cQ=CS(lQ);Object.defineProperty(pC,"__esModule",{value:!0});pC.default=bQ;var Ng=hQ(m),uQ=gC(Ks),dQ=gC(cQ),fQ=gC(GS);function gC(e){return e&&e.__esModule?e:{default:e}}function hk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(hk=function(r){return r?n:t})(e)}function hQ(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=hk(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=pQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pQ(e){var t=gQ(e,"string");return typeof t=="symbol"?t:String(t)}function gQ(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 mQ="react-grid-layout";function bQ(e){var t;return t=class extends Ng.Component{constructor(){super(...arguments),Gc(this,"state",{width:1280}),Gc(this,"elementRef",Ng.createRef()),Gc(this,"mounted",!1),Gc(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new dQ.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?Ng.createElement("div",{className:(0,fQ.default)(this.props.className,mQ),style:this.props.style,ref:this.elementRef}):Ng.createElement(e,Fw({innerRef:this.elementRef},o,this.state))}},Gc(t,"defaultProps",{measureBeforeMount:!1}),Gc(t,"propTypes",{measureBeforeMount:uQ.default.bool}),t}(function(e){e.exports=cp.default,e.exports.utils=Dt,e.exports.calculateUtils=ea,e.exports.Responsive=Nb.default,e.exports.Responsive.utils=xc,e.exports.WidthProvider=pC.default})(E6);var p$=E6.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 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:"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"}))}),xQ=["color"],pk=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:"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"}))}),wQ=["color"],_Q=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,wQ);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"}))}),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:"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"}))}),EQ=["color"],gk=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:"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"}))}),RQ=["color"],PQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,RQ);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}))}),$Q=["color"],OQ=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:"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"}))}),TQ=["color"],DQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,TQ);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"}))}),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:"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"}))}),kQ=["color"],mk=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:"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"}))}),IQ=["color"],NQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,IQ);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"}))}),LQ=["color"],FQ=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Br(e,LQ);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"}))}),jQ=["color"],zQ=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:"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"}))}),BQ=["color"],bk=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:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),VQ=["color"],vk=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:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Lg;const HQ=new Uint8Array(16);function WQ(){if(!Lg&&(Lg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Lg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Lg(HQ)}const lr=[];for(let e=0;e<256;++e)lr.push((e+256).toString(16).slice(1));function UQ(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 qQ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),g$={randomUUID:qQ};function Fs(e,t,n){if(g$.randomUUID&&!t&&!e)return g$.randomUUID();e=e||{};const r=e.random||(e.rng||WQ)();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 UQ(r)}const Ir=kM()(BM((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})}}}))),Fb=()=>Ir(e=>e.actions);function GQ(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 b=r==null?void 0:r.find(C=>C.idx===p),v=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]),...b,datalabels:{...b==null?void 0:b.datalabels,color:YQ((S=b==null?void 0:b.datalabels)==null?void 0:S.align,v)},backgroundColor:v,pointBackgroundColor:x,borderColor:y}})}function YQ(e,t){return Gu(e==="end"||e==="start"?ih():t)}function KQ(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 b=e.filter(v=>v[n==null?void 0:n[1]]===h);return{label:h,data:b.map(v=>({x:v[t[0]],y:v[t[1]],r:v[t[2]],label:v[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[p%i.length],borderColor:a==null?void 0:a[p%a.length]}})),r}function XQ(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,b)=>({label:p,data:e.filter(v=>(v==null?void 0:v[a])===p).map(v=>[v==null?void 0:v[n[0]],v==null?void 0:v[n[1]],v==null?void 0:v[n[2]]]),backgroundColor:o==null?void 0:o[b%o.length],borderColor:i==null?void 0:i[b%i.length],borderSkipped:!1}))}function QQ(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 JQ(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=JQ(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 Ef(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 ZQ(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 y0({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=ZQ(a,o)),a}function Go(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 eJ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),yk=(...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 tJ={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 xk=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,...tJ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yk("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(xk,{ref:i,iconNode:t,className:yk(`lucide-${eJ(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 wk=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 fp=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 jb=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 mC=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 zb=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 _k=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 bC=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 Sk=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 vC=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 Ck=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 Ek=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 Rk=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 Pk=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 yC=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 $k=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 Ok=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 xC=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 Tk=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 Dk=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 bd=jn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),nJ=({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(Sk,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function Ak({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),b=Ir(C=>C.actions.setSelectedDatabaseName),v=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),b("")),y!=null&&y.lastSelectedDatabase&&y.lastSelectedDatabase!=="none"&&(b(y==null?void 0:y.lastSelectedDatabase),p("")),y!=null&&y.lastSelectedSchema&&v(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(OQ,{onClick:()=>{a(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):R.jsx(DQ,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&R.jsx(gk,{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(nJ,{data:(y==null?void 0:y.data)||[],filename:y.title})]})})}function rJ(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 oJ=m.createContext(null),b1={didCatch:!1,error:null};class Bb 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&&iJ(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(oJ.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function iJ(){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 wC({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 aJ({error:e,frame:t}){return R.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[R.jsx(Ak,{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 sJ({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 Ku=1e3,Xu=Ku*60,Qu=Xu*60,ic=Qu*24,lJ=ic*7,cJ=ic*365.25,uJ=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return dJ(e);if(n==="number"&&isFinite(e))return t.long?hJ(e):fJ(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function dJ(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*cJ;case"weeks":case"week":case"w":return n*lJ;case"days":case"day":case"d":return n*ic;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Qu;case"minutes":case"minute":case"mins":case"min":case"m":return n*Xu;case"seconds":case"second":case"secs":case"sec":case"s":return n*Ku;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fJ(e){var t=Math.abs(e);return t>=ic?Math.round(e/ic)+"d":t>=Qu?Math.round(e/Qu)+"h":t>=Xu?Math.round(e/Xu)+"m":t>=Ku?Math.round(e/Ku)+"s":e+"ms"}function hJ(e){var t=Math.abs(e);return t>=ic?Fg(e,t,ic,"day"):t>=Qu?Fg(e,t,Qu,"hour"):t>=Xu?Fg(e,t,Xu,"minute"):t>=Ku?Fg(e,t,Ku,"second"):e+" ms"}function Fg(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const pJ=mc(uJ);function gJ(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=$q(e.sql,r);return{queryKey:["query",e.id,l,n||"",JSON.stringify(s)],sql:l,sheetFilterValues:s}}function Vb(e,t){const{authToken:n}=Mo(),r=we(d=>d.isVisualEditing),o=we(d=>d.authToken),i=pJ((e==null?void 0:e.refreshInterval)||"0"),{queryKey:a,sql:s,sheetFilterValues:l}=gJ(e);return{...lp({queryKey:a,queryFn:()=>pb("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===UM?"":e.python,active_filters:l,cache_config:kS()}),refetchInterval:i,placeholderData:bG,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 _C(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function Mk(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 kk(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return mJ(t)}function mJ(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,b=0;0<=o&&o<60?(h=c,p=u,b=0):60<=o&&o<120?(h=u,p=c,b=0):120<=o&&o<180?(h=0,p=c,b=u):180<=o&&o<240?(h=0,p=u,b=c):240<=o&&o<300?(h=u,p=0,b=c):300<=o&&o<360&&(h=c,p=0,b=u),h=Math.round((h+d)*255),p=Math.round((p+d)*255),b=Math.round((b+d)*255);const v=x=>{const y=x.toString(16);return y.length==1?"0"+y:y};return`#${v(h)}${v(p)}${v(b)}`}function fl({data:e,cfg:t,customCfg:n,preferences:r}){we.getState().themeStyle;const{dimensionKeys:o,metricKeys:i}=tr(e),a=GQ(i,e,r),s=Ef(a,n),l=o[0],c=jw(e,l);SC(r,t),Ik(r);const{options:u,plugins:d}=Lk({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 SC(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 Ik(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 Nk(e,t){var i,a,s,l,c,u,d,h,p,b,v,x;const n=SC(t,e),r=Ik(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:{...(b=e==null?void 0:e.options)==null?void 0:b.plugins,datalabels:{...(x=(v=e==null?void 0:e.options)==null?void 0:v.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 Lk({cfg:e,preferences:t,customCfg:n}){var h,p,b,v,x,y,_,S,C,E,$,D,T,A,L,F,z,X,G,M,U,V,Y,q,O,H,K,I,oe;const r=we.getState().themeStyle,o=Nk(e,t),i=Go((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),a=Go(o,i),s=Go(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:{...(b=(p=s==null?void 0:s.scales)==null?void 0:p.x)==null?void 0:b.grid,color:(S=(_=(y=(x=(v=r==null?void 0:r.chart)==null?void 0:v.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=(A=(T=(D=r==null?void 0:r.chart)==null?void 0:D.options)==null?void 0:T.scales)==null?void 0:A.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=(M=(G=(X=r==null?void 0:r.chart)==null?void 0:X.options)==null?void 0:G.plugins)==null?void 0:M.tooltip)==null?void 0:U.backgroundColor,bodyColor:(O=(q=(Y=(V=r==null?void 0:r.chart)==null?void 0:V.options)==null?void 0:Y.plugins)==null?void 0:q.tooltip)==null?void 0:O.bodyColor,titleColor:(oe=(I=(K=(H=r==null?void 0:r.chart)==null?void 0:H.options)==null?void 0:K.plugins)==null?void 0:I.tooltip)==null?void 0:oe.titleColor}}},{plugins:c,options:u}=Mk((t==null?void 0:t.customVisualCode)||"");return{options:Go(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 hp(e){return e+.5|0}const $s=(e,t,n)=>Math.max(Math.min(e,n),t);function Rf(e){return $s(hp(e*2.55),0,255)}function Is(e){return $s(hp(e*255),0,255)}function Pa(e){return $s(hp(e/2.55)/100,0,1)}function m$(e){return $s(hp(e*100),0,100)}const Wo={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"],bJ=e=>Bw[e&15],vJ=e=>Bw[(e&240)>>4]+Bw[e&15],jg=e=>(e&240)>>4===(e&15),yJ=e=>jg(e.r)&&jg(e.g)&&jg(e.b)&&jg(e.a);function xJ(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Wo[e[1]]*17,g:255&Wo[e[2]]*17,b:255&Wo[e[3]]*17,a:t===5?Wo[e[4]]*17:255}:(t===7||t===9)&&(n={r:Wo[e[1]]<<4|Wo[e[2]],g:Wo[e[3]]<<4|Wo[e[4]],b:Wo[e[5]]<<4|Wo[e[6]],a:t===9?Wo[e[7]]<<4|Wo[e[8]]:255})),n}const wJ=(e,t)=>e<255?t(e):"";function _J(e){var t=yJ(e)?bJ:vJ;return e?"#"+t(e.r)+t(e.g)+t(e.b)+wJ(e.a,t):void 0}const SJ=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Fk(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 CJ(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 EJ(e,t,n){const r=Fk(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 RJ(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 CC(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=RJ(n,r,o,u,i),l=l*60+.5),[l|0,c||0,s]}function EC(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Is)}function RC(e,t,n){return EC(Fk,e,t,n)}function PJ(e,t,n){return EC(EJ,e,t,n)}function $J(e,t,n){return EC(CJ,e,t,n)}function jk(e){return(e%360+360)%360}function OJ(e){const t=SJ.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Rf(+t[5]):Is(+t[5]));const o=jk(+t[2]),i=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?r=PJ(o,i,a):t[1]==="hsv"?r=$J(o,i,a):r=RC(o,i,a),{r:r[0],g:r[1],b:r[2],a:n}}function TJ(e,t){var n=CC(e);n[0]=jk(n[0]+t),n=RC(n),e.r=n[0],e.g=n[1],e.b=n[2]}function DJ(e){if(!e)return;const t=CC(e),n=t[0],r=m$(t[1]),o=m$(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Pa(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const b$={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"},v$={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 AJ(){const e={},t=Object.keys(v$),n=Object.keys(b$);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,b$[i]);i=parseInt(v$[a],16),e[s]=[i>>16&255,i>>8&255,i&255]}return e}let zg;function MJ(e){zg||(zg=AJ(),zg.transparent=[0,0,0,0]);const t=zg[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const kJ=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function IJ(e){const t=kJ.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const a=+t[7];n=t[8]?Rf(a):$s(a*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?Rf(r):$s(r,0,255)),o=255&(t[4]?Rf(o):$s(o,0,255)),i=255&(t[6]?Rf(i):$s(i,0,255)),{r,g:o,b:i,a:n}}}function NJ(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 LJ(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 Bg(e,t,n){if(e){let r=CC(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=RC(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function zk(e,t){return e&&Object.assign(t||{},e)}function y$(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=zk(e,{r:0,g:0,b:0,a:1}),t.a=Is(t.a)),t}function FJ(e){return e.charAt(0)==="r"?IJ(e):OJ(e)}let Bk=class Vw{constructor(t){if(t instanceof Vw)return t;const n=typeof t;let r;n==="object"?r=y$(t):n==="string"&&(r=xJ(t)||MJ(t)||FJ(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=zk(this._rgb);return t&&(t.a=Pa(t.a)),t}set rgb(t){this._rgb=y$(t)}rgbString(){return this._valid?NJ(this._rgb):void 0}hexString(){return this._valid?_J(this._rgb):void 0}hslString(){return this._valid?DJ(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=LJ(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=hp(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 Bg(this._rgb,2,t),this}darken(t){return Bg(this._rgb,2,-t),this}saturate(t){return Bg(this._rgb,1,t),this}desaturate(t){return Bg(this._rgb,1,-t),this}rotate(t){return TJ(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 jJ=(()=>{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 zJ=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Vk=(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 x0(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 w0(e){if(_n(e))return e.map(w0);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]]=w0(e[n[o]]);return t}return e}function Hk(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function BJ(e,t,n,r){if(!Hk(e))return;const o=t[e],i=n[e];kt(o)&&kt(i)?or(o,i,r):t[e]=w0(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||BJ;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 jf(e,t){return or(e,t,{merger:VJ})}function VJ(e,t,n){if(!Hk(e))return;const r=t[e],o=n[e];kt(r)&&kt(o)?jf(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=w0(o))}const x$={"":e=>e,x:e=>e.x,y:e=>e.y};function HJ(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 WJ(e){const t=HJ(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function js(e,t){return(x$[t]||(x$[t]=WJ(t)))(e)}function PC(e){return e.charAt(0).toUpperCase()+e.slice(1)}const lh=e=>typeof e<"u",zs=e=>typeof e=="function",w$=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function UJ(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Cn=Math.PI,Sn=2*Cn,qJ=Sn+Cn,_0=Number.POSITIVE_INFINITY,GJ=Cn/180,Wn=Cn/2,hl=Cn/4,_$=Cn*2/3,Os=Math.log10,Wi=Math.sign;function zf(e,t,n){return Math.abs(e-t)<n}function S$(e){const t=Math.round(e);e=zf(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 YJ(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 Ju(e){return!isNaN(parseFloat(e))&&isFinite(e)}function KJ(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Wk(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 bi(e){return e*(Cn/180)}function $C(e){return e*(180/Cn)}function C$(e){if(!Ln(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Uk(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 XJ(e,t){return(e-t+qJ)%Sn-Cn}function xo(e){return(e%Sn+Sn)%Sn}function ch(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 QJ(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 OC(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)=>OC(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),JJ=(e,t,n)=>OC(e,n,r=>e[r][t]>=n);function ZJ(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 qk=["push","pop","shift","splice","unshift"];function eZ(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),qk.forEach(n=>{const r="_onData"+PC(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 E$(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)&&(qk.forEach(i=>{delete e[i]}),delete e._chartjs)}function Gk(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Yk=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function Kk(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,Yk.call(window,()=>{r=!1,e.apply(t,n)}))}}function tZ(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const TC=e=>e==="start"?"left":e==="end"?"right":"center",wr=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,nZ=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function Xk(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 Qk(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 Vg=e=>e===0||e===1,R$=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Sn/n)),P$=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Sn/n)+1,Bf={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=>Vg(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=>Vg(e)?e:R$(e,.075,.3),easeOutElastic:e=>Vg(e)?e:P$(e,.075,.3),easeInOutElastic(e){return Vg(e)?e:e<.5?.5*R$(e*2,.1125,.45):.5+.5*P$(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-Bf.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?Bf.easeInBounce(e*2)*.5:Bf.easeOutBounce(e*2-1)*.5+.5};function DC(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function $$(e){return DC(e)?e:new Bk(e)}function y1(e){return DC(e)?e:new Bk(e).saturate(.5).darken(.1).hexString()}const rZ=["x","y","borderWidth","radius","tension"],oZ=["color","borderColor","backgroundColor"];function iZ(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:oZ},numbers:{type:"number",properties:rZ}}),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 aZ(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const O$=new Map;function sZ(e,t){t=t||{};const n=e+JSON.stringify(t);let r=O$.get(n);return r||(r=new Intl.NumberFormat(e,t),O$.set(n,r)),r}function pp(e,t,n){return sZ(t,n).format(e)}const Jk={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=lZ(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),pp(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?Jk.numeric.call(this,e,t,n):""}};function lZ(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 Hb={formatters:Jk};function cZ(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:Hb.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 Vf(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(Vf(e,t),n):or(Vf(e,""),t)}class uZ{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 Vf(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=Vf(this,t),a=Vf(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 uZ({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[iZ,aZ,cZ]);function dZ(e){return!e||Tt(e.size)||Tt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function S0(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 fZ(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=S0(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=S0(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 T$(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function C0(e,t,n,r){Zk(e,t,n,r,null)}function Zk(e,t,n,r,o){let i,a,s,l,c,u,d,h;const p=t.pointStyle,b=t.rotation,v=t.radius;let x=(b||0)*GJ;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(v)||v<=0)){switch(e.beginPath(),p){default:o?e.ellipse(n,r,o/2,v,0,0,Sn):e.arc(n,r,v,0,Sn),e.closePath();break;case"triangle":u=o?o/2:v,e.moveTo(n+Math.sin(x)*u,r-Math.cos(x)*v),x+=_$,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*v),x+=_$,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*v),e.closePath();break;case"rectRounded":c=v*.516,l=v-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(!b){l=Math.SQRT1_2*v,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:v),a=Math.cos(x)*v,s=Math.sin(x)*v,h=Math.sin(x)*(o?o/2:v),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:v),a=Math.cos(x)*v,s=Math.sin(x)*v,h=Math.sin(x)*(o?o/2:v),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:v),a=Math.cos(x)*v,s=Math.sin(x)*v,h=Math.sin(x)*(o?o/2:v),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:v),a=Math.cos(x)*v,s=Math.sin(x)*v,h=Math.sin(x)*(o?o/2:v),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)*v,s=Math.sin(x)*v,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:v),r+Math.sin(x)*v);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 hZ(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 pZ(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 gZ(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 mZ(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 bZ(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,gZ(e,i),l=0;l<a.length;++l)c=a[l],i.backdrop&&bZ(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),mZ(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function uh(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 vZ=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,yZ=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function xZ(e,t){const n=(""+e).match(vZ);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 wZ=e=>+e||0;function AC(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]=wZ(i(a));return n}function e3(e){return AC(e,{top:"y",right:"x",bottom:"y",left:"x"})}function ql(e){return AC(e,["topLeft","topRight","bottomLeft","bottomRight"])}function fr(e){const t=e3(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(yZ)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:st(e.family,t.family),lineHeight:xZ(st(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:st(e.weight,t.weight),string:""};return o.string=dZ(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 _Z(e,t,n){const{min:r,max:o}=e,i=Vk(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 MC(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=o3("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:s=>MC([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 n3(s,l,()=>TZ(l,t,e,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(s,l){return A$(s).includes(l)},ownKeys(s){return A$(s)},set(s,l,c){const u=s._storage||(s._storage=o());return s[l]=u[l]=c,delete s._keys,!0}})}function Zu(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:t3(e,r),setContext:i=>Zu(e,i,n,r),override:i=>Zu(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 n3(i,a,()=>CZ(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 t3(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 SZ=(e,t)=>e?e+PC(t):t,kC=(e,t)=>kt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function n3(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function CZ(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:a}=e;let s=r[t];return zs(s)&&a.isScriptable(t)&&(s=EZ(t,s,e,n)),_n(s)&&s.length&&(s=RZ(t,s,e,a.isIndexable)),kC(t,s)&&(s=Zu(s,o,i&&i[t],a)),s}function EZ(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),kC(e,l)&&(l=IC(o._scopes,o,e,l)),l}function RZ(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=IC(c,o,e,u);t.push(Zu(d,i,a&&a[e],s))}}return t}function r3(e,t,n){return zs(e)?e(t,n):e}const PZ=(e,t)=>e===!0?t:typeof e=="string"?js(t,e):void 0;function $Z(e,t,n,r,o){for(const i of t){const a=PZ(n,i);if(a){e.add(a);const s=r3(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 IC(e,t,n,r){const o=t._rootScopes,i=r3(t._fallback,n,r),a=[...e,...o],s=new Set;s.add(r);let l=D$(s,a,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=D$(s,a,i,l,r),l===null)?!1:MC(Array.from(s),[""],o,i,()=>OZ(t,n,r))}function D$(e,t,n,r,o){for(;n;)n=$Z(e,t,n,r,o);return n}function OZ(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return _n(o)&&kt(n)?n:o||{}}function TZ(e,t,n,r){let o;for(const i of t)if(o=o3(SZ(i,e),n),typeof o<"u")return kC(e,o)?IC(n,r,e,o):o}function o3(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function A$(e){let t=e._keys;return t||(t=e._keys=DZ(e._scopes)),t}function DZ(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 i3(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 AZ=Number.EPSILON||1e-14,ed=(e,t)=>t<e.length&&!e[t].skip&&e[t],a3=e=>e==="x"?"y":"x";function MZ(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 kZ(e,t,n){const r=e.length;let o,i,a,s,l,c=ed(e,0);for(let u=0;u<r-1;++u)if(l=c,c=ed(e,u+1),!(!l||!c)){if(zf(t[u],0,AZ)){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 IZ(e,t,n="x"){const r=a3(n),o=e.length;let i,a,s,l=ed(e,0);for(let c=0;c<o;++c){if(a=s,s=l,l=ed(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 NZ(e,t="x"){const n=a3(t),r=e.length,o=Array(r).fill(0),i=Array(r);let a,s,l,c=ed(e,0);for(a=0;a<r;++a)if(s=l,l=c,c=ed(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]}kZ(e,o,i),IZ(e,i,t)}function Hg(e,t,n){return Math.max(Math.min(e,n),t)}function LZ(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=Hg(o.cp1x,t.left,t.right),o.cp1y=Hg(o.cp1y,t.top,t.bottom)),s&&(o.cp2x=Hg(o.cp2x,t.left,t.right),o.cp2y=Hg(o.cp2y,t.top,t.bottom)))}function FZ(e,t,n,r,o){let i,a,s,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")NZ(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=MZ(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&&LZ(e,n)}function NC(){return typeof window<"u"&&typeof document<"u"}function LC(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function E0(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 Wb=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function jZ(e,t){return Wb(e).getPropertyValue(t)}const zZ=["top","right","bottom","left"];function Gl(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=zZ[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const BZ=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function VZ(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let a=!1,s,l;if(BZ(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=Wb(n),i=o.boxSizing==="border-box",a=Gl(o,"padding"),s=Gl(o,"border","width"),{x:l,y:c,box:u}=VZ(e,n),d=a.left+(u&&s.left),h=a.top+(u&&s.top);let{width:p,height:b}=t;return i&&(p-=a.width+s.width,b-=a.height+s.height),{x:Math.round((l-d)/p*n.width/r),y:Math.round((c-h)/b*n.height/r)}}function HZ(e,t,n){let r,o;if(t===void 0||n===void 0){const i=LC(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const a=i.getBoundingClientRect(),s=Wb(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=E0(s.maxWidth,i,"clientWidth"),o=E0(s.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||_0,maxHeight:o||_0}}const Wg=e=>Math.round(e*10)/10;function WZ(e,t,n,r){const o=Wb(e),i=Gl(o,"margin"),a=E0(o.maxWidth,e,"clientWidth")||_0,s=E0(o.maxHeight,e,"clientHeight")||_0,l=HZ(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=Wg(Math.min(c,a,l.maxWidth)),u=Wg(Math.min(u,s,l.maxHeight)),c&&!u&&(u=Wg(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Wg(Math.floor(u*r))),{width:c,height:u}}function M$(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 UZ=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};NC()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function k$(e,t){const n=jZ(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 qZ(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 GZ(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 YZ=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}}},KZ=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function _u(e,t,n){return e?YZ(t,n):KZ()}function s3(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 l3(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function c3(e){return e==="angle"?{between:ch,compare:XJ,normalize:xo}:{between:Da,compare:(t,n)=>t-n,normalize:t=>t}}function I$({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 XZ(e,t,n){const{property:r,start:o,end:i}=n,{between:a,normalize:s}=c3(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 u3(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,a=t.length,{compare:s,between:l,normalize:c}=c3(r),{start:u,end:d,loop:h,style:p}=XZ(e,t,n),b=[];let v=!1,x=null,y,_,S;const C=()=>l(o,S,y)&&s(o,S)!==0,E=()=>s(i,y)===0||l(i,S,y),$=()=>v||C(),D=()=>!v||E();for(let T=u,A=u;T<=d;++T)_=t[T%a],!_.skip&&(y=c(_[r]),y!==S&&(v=l(y,o,i),x===null&&$()&&(x=s(y,o)===0?T:A),x!==null&&D()&&(b.push(I$({start:x,end:T,loop:h,count:a,style:p})),x=null),A=T,S=y));return x!==null&&b.push(I$({start:x,end:d,loop:h,count:a,style:p})),b}function d3(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=u3(r[o],e.points,t);i.length&&n.push(...i)}return n}function QZ(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 JZ(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 ZZ(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:a,end:s}=QZ(n,o,i,r);if(r===!0)return N$(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 N$(e,JZ(n,a,l,c),n,t)}function N$(e,t,n,r){return!r||!r.setContext||!n?t:eee(e,t,n,r)}function eee(e,t,n,r){const o=e._chart.getContext(),i=L$(e.options),{_datasetIndex:a,options:{spanGaps:s}}=e,l=n.length,c=[];let u=i,d=t[0].start,h=d;function p(b,v,x,y){const _=s?-1:1;if(b!==v){for(b+=l;n[b%l].skip;)b-=_;for(;n[v%l].skip;)v+=_;b%l!==v%l&&(c.push({start:b%l,end:v%l,loop:x,style:y}),u=y,d=v%l)}}for(const b of t){d=s?d:b.start;let v=n[d%l],x;for(h=d+1;h<=b.end;h++){const y=n[h%l];x=L$(r.setContext(Xs(o,{type:"segment",p0:v,p1:y,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:a}))),tee(x,u)&&p(d,h-1,b.loop,u),v=y,u=x}d<h-1&&p(d,h-1,b.loop,u)}return c}function L$(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function tee(e,t){if(!t)return!1;const n=[],r=function(o,i){return DC(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 nee{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=Yk.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 nee;const F$="transparent",ree={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=$$(e||F$),o=r.valid&&$$(t||F$);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class oee{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||ree[t.type||typeof a],this._easing=Bf[t.easing]||Bf.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 f3{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=aee(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&iee(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 oee(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 iee(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 aee(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 j$(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 see(e,t,n){if(n===!1)return!1;const r=j$(e,n),o=j$(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function lee(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 h3(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 z$(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 cee(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 B$(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function uee(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function dee(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 fee(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function V$(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 H$(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=uee(i,a,r),d=t.length;let h;for(let p=0;p<d;++p){const b=t[p],{[l]:v,[c]:x}=b,y=b._stacks||(b._stacks={});h=y[c]=fee(o,u,v),h[s]=x,h._top=V$(h,a,!0,r.type),h._bottom=V$(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 hee(e,t){return Xs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function pee(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 Zd(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",W$=(e,t)=>t?e:Object.assign({},e),gee=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:h3(n,!0),values:null};class Qo{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=B$(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&&Zd(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(d,h,p,b)=>d==="x"?h:d==="r"?b: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&&E$(this._data,this),t._stacked&&Zd(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(kt(n))this._data=cee(n);else if(r!==n){if(r){E$(r,this);const o=this._cachedMeta;Zd(o),o._parsed=[]}n&&Object.isExtensible(n)&&eZ(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=B$(n.vScale,n),n.stack!==r.stack&&(o=!0,Zd(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&H$(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&&H$(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,b;for(h=0,p=o;h<p;++h)b=h+r,d[h]={[s]:u||i.parse(c[b],b),[l]:a.parse(n[b],b)};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:h3(o,!0),values:n._stacks[t.axis]._visualValues};return z$(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=z$(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=gee(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=dee(s);let h,p;function b(){p=o[h];const v=p[s.axis];return!Ln(p[t.axis])||u>v||d<v}for(h=0;h<a&&!(!b()&&(this.updateRangeFromParsed(c,t,p,l),i));++h);if(i){for(h=a-1;h>=0;--h)if(!b()){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=lee(st(this.options.clip,see(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=pee(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=hee(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&&lh(r);if(s)return W$(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]),b=()=>this.getContext(r,o,n),v=c.resolveNamedOptions(h,p,b,d);return v.$shared&&(v.$shared=l,i[a]=Object.freeze(W$(v,l))),v}_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 f3(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&&Zd(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(Qo,"defaults",{}),Ne(Qo,"datasetElementType",null),Ne(Qo,"dataElementType",null);function mee(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=Gk(r.sort((o,i)=>o-i))}return e._cache.$bar}function bee(e){const t=e.iScale,n=mee(t,e.type);let r=t._length,o,i,a,s;const l=()=>{a===32767||a===-32768||(lh(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 vee(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 yee(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 xee(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 p3(e,t,n,r){return _n(e)?xee(e,t,n,r):t[n.axis]=n.parse(e,r),t}function U$(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(p3(h,d,i,c));return l}function S1(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function wee(e,t,n){return e!==0?Wi(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function _ee(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 See(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}=_ee(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[q$(u,a,s,l)]=!0,o=c)),i[q$(o,a,s,l)]=!0,e.borderSkipped=i}function q$(e,t,n,r){return r?(e=Cee(e,t,n),e=G$(e,n,t)):e=G$(e,t,n),e}function Cee(e,t,n){return e===t?n:e===n?t:e}function G$(e,t,n){return e==="start"?t:e==="end"?n:e}function Eee(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Gm extends Qo{parsePrimitiveData(t,n,r,o){return U$(t,n,r,o)}parseArrayData(t,n,r,o){return U$(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,b,v;for(h=r,p=r+o;h<p;++h)v=n[h],b={},b[i.axis]=i.parse(js(v,c),h),d.push(p3(js(v,u),b,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 b=this.getParsed(p),v=i||Tt(b[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),x=this._calculateBarIndexPixels(p,u),y=(b._stacks||{})[s.axis],_={horizontal:c,base:v.base,enableBorderRadius:!y||S1(b._custom)||a===y._top||a===y._bottom,x:c?v.head:x.center,y:c?x.center:v.head,height:c?x.size:Math.abs(v.size),width:c?Math.abs(v.size):x.size};h&&(_.options=d||this.resolveDataElementOptions(p,t[p].active?"active":o));const S=_.options||t[p].options;See(_,S,y,a),Eee(_,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||bee(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,b,v;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)?b=n.getPixelForValue(h+p):b=y,v=b-y,Math.abs(v)<a){v=wee(v,n,s)*a,d===s&&(y-=v/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),b=y+v,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(b)-n.getValueForPixel(y))}if(y===n.getPixelForValue(s)){const _=Wi(v)*n.getLineWidthForValue(s)/2;y+=_,v-=_}return{size:v,base:y,head:b,center:b+v/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"?yee(t,n,o,c):vee(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(Gm,"id","bar"),Ne(Gm,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ne(Gm,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Ym extends Qo{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],b=!i&&this.getParsed(h),v={},x=v[u]=i?a.getPixelForDecimal(.5):a.getPixelForValue(b[u]),y=v[d]=i?s.getBasePixel():s.getPixelForValue(b[d]);v.skip=isNaN(x)||isNaN(y),c&&(v.options=l||this.resolveDataElementOptions(h,p.active?"active":o),i&&(v.options.radius=0)),this.updateElement(p,h,v,o)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return n!=="active"&&(o.radius=0),o.radius+=st(r&&r._custom,i),o}}Ne(Ym,"id","bubble"),Ne(Ym,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Ne(Ym,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Ree(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)=>ch(S,s,l,!0)?1:Math.max(C,C*n,E,E*n),b=(S,C,E)=>ch(S,s,l,!0)?-1:Math.min(C,C*n,E,E*n),v=p(0,c,d),x=p(Wn,u,h),y=b(Cn,c,d),_=b(Cn+Wn,u,h);r=(v-y)/2,o=(x-_)/2,i=-(v+y)/2,a=-(x+_)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:a}}class Dl extends Qo{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 bi(this.options.rotation-90)}_getCircumference(){return bi(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(zJ(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:p,offsetX:b,offsetY:v}=Ree(d,u,l),x=(r.width-a)/h,y=(r.height-a)/p,_=Math.max(Math.min(x,y)/2,0),S=Vk(this.options.radius,_),C=Math.max(S*l,0),E=(S-C)/this._getVisibleDatasetWeightTotal();this.offsetX=b*S,this.offsetY=v*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,b=h?0:this.outerRadius,{sharedOptions:v,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:b,innerRadius:p};x&&(E.options=v||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=pp(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 Km extends Qo{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}=Xk(n,o,a);this._drawStart=s,this._drawCount=l,Qk(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:b,segment:v}=this.options,x=Ju(b)?b: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],D=y?$:{};if(E<n||E>=_){D.skip=!0;continue}const T=this.getParsed(E),A=Tt(T[p]),L=D[h]=a.getPixelForValue(T[h],E),F=D[p]=i||A?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,T,l):T[p],E);D.skip=isNaN(L)||isNaN(F)||A,D.stop=E>0&&Math.abs(T[h]-C[h])>x,v&&(D.parsed=T,D.raw=c.data[E]),d&&(D.options=u||this.resolveDataElementOptions(E,$.active?"active":o)),y||this.updateElement($,E,D,o),C=T}}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(Km,"id","line"),Ne(Km,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ne(Km,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Hf extends Qo{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=pp(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return i3.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,b;const v=360/this.countVisibleElements();for(b=0;b<n;++b)p+=this._computeAngle(b,o,v);for(b=n;b<n+r;b++){const x=t[b];let y=p,_=p+this._computeAngle(b,o,v),S=a.getDataVisibility(b)?c.getDistanceFromCenterForValue(this.getParsed(b).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(b,x.active?"active":o)};this.updateElement(x,b,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)?bi(this.resolveDataElementOptions(t,n).angle||r):0}}Ne(Hf,"id","polarArea"),Ne(Hf,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Ne(Hf,"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 Xm extends Qo{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 i3.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(Xm,"id","radar"),Ne(Xm,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Ne(Xm,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Qm extends Qo{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}=Xk(n,r,o);if(this._drawStart=i,this._drawCount=a,Qk(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,b=s.axis,{spanGaps:v,segment:x}=this.options,y=Ju(v)?v: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),D=_?E:{},T=Tt($[b]),A=D[p]=a.getPixelForValue($[p],C),L=D[b]=i||T?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,$,l):$[b],C);D.skip=isNaN(A)||isNaN(L)||T,D.stop=C>0&&Math.abs($[p]-S[p])>y,x&&(D.parsed=$,D.raw=c.data[C]),h&&(D.options=d||this.resolveDataElementOptions(C,E.active?"active":o)),_||this.updateElement(E,C,D,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(Qm,"id","scatter"),Ne(Qm,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Ne(Qm,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Pee=Object.freeze({__proto__:null,BarController:Gm,BubbleController:Ym,DoughnutController:Dl,LineController:Km,PieController:Uw,PolarAreaController:Hf,RadarController:Xm,ScatterController:Qm});function gl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class FC{constructor(t){Ne(this,"options");this.options=t||{}}static override(t){Object.assign(FC.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 $ee={_date:FC};function Oee(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?JJ: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 gp(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}=Oee(i[s],t,a,o);for(let p=d;p<=h;++p){const b=u[p];b.skip||r(b,c,p)}}}function Tee(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)||gp(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 Dee(e,t,n,r){let o=[];function i(a,s,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],r),{angle:d}=Uk(a,{x:t.x,y:t.y});ch(d,c,u)&&o.push({element:a,datasetIndex:s,index:l})}return gp(e,n,t,i),o}function Aee(e,t,n,r,o,i){let a=[];const s=Tee(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 b=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(b))&&!p)return;const x=s(t,b);x<l?(a=[{element:u,datasetIndex:d,index:h}],l=x):x===l&&a.push({element:u,datasetIndex:d,index:h})}return gp(e,n,t,c),a}function E1(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?Dee(e,t,n,o):Aee(e,t,n,r,o,i)}function Y$(e,t,n,r,o){const i=[],a=n==="x"?"inXRange":"inYRange";let s=!1;return gp(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 Mee={evaluateInteractionItems:gp,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 Y$(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=yl(t,e);return Y$(e,o,"y",n.intersect,r)}}};const g3=["left","top","right","bottom"];function ef(e,t){return e.filter(n=>n.pos===t)}function K$(e,t){return e.filter(n=>g3.indexOf(n.pos)===-1&&n.box.axis===t)}function tf(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 kee(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 Iee(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!g3.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 Nee(e,t){const n=Iee(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 Lee(e){const t=kee(e),n=tf(t.filter(c=>c.box.fullSize),!0),r=tf(ef(t,"left"),!0),o=tf(ef(t,"right")),i=tf(ef(t,"top"),!0),a=tf(ef(t,"bottom")),s=K$(t,"x"),l=K$(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(a).concat(s),chartArea:ef(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(a).concat(s)}}function X$(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function m3(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 Fee(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&&m3(a,i.getPadding());const s=Math.max(0,t.outerWidth-X$(a,e,"left","right")),l=Math.max(0,t.outerHeight-X$(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 jee(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 zee(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 Pf(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,zee(s.horizontal,t));const{same:d,other:h}=Fee(t,n,s,r);c|=d&&o.length,u=u||h,l.fullSize||o.push(s)}return c&&Pf(o,t,n,r)||u}function Ug(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 Q$(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;lh(c.start)&&(a=c.start),l.fullSize?Ug(l,o.left,a,n.outerWidth-o.right-o.left,h):Ug(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;lh(c.start)&&(i=c.start),l.fullSize?Ug(l,i,o.top,h,n.outerHeight-o.bottom-o.top):Ug(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=Lee(e.boxes),l=s.vertical,c=s.horizontal;nn(e.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const u=l.reduce((v,x)=>x.box.options&&x.box.options.display===!1?v:v+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);m3(h,fr(r));const p=Object.assign({maxPadding:h,w:i,h:a,x:o.left,y:o.top},o),b=Nee(l.concat(c),d);Pf(s.fullSize,p,d,b),Pf(l,p,d,b),Pf(c,p,d,b)&&Pf(l,p,d,b),jee(p),Q$(s.leftAndTop,p,d,b),p.x+=p.w,p.y+=p.h,Q$(s.rightAndBottom,p,d,b),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,v=>{const x=v.box;Object.assign(x,e.chartArea),x.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class b3{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 Bee extends b3{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Jm="$chartjs",Vee={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},J$=e=>e===null||e==="";function Hee(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Jm]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",J$(o)){const i=k$(e,"width");i!==void 0&&(e.width=i)}if(J$(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=k$(e,"height");i!==void 0&&(e.height=i)}return e}const v3=UZ?{passive:!0}:!1;function Wee(e,t,n){e.addEventListener(t,n,v3)}function Uee(e,t,n){e.canvas.removeEventListener(t,n,v3)}function qee(e,t){const n=Vee[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 R0(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Gee(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let a=!1;for(const s of i)a=a||R0(s.addedNodes,r),a=a&&!R0(s.removedNodes,r);a&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function Yee(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let a=!1;for(const s of i)a=a||R0(s.removedNodes,r),a=a&&!R0(s.addedNodes,r);a&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const dh=new Map;let Z$=0;function y3(){const e=window.devicePixelRatio;e!==Z$&&(Z$=e,dh.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Kee(e,t){dh.size||window.addEventListener("resize",y3),dh.set(e,t)}function Xee(e){dh.delete(e),dh.size||window.removeEventListener("resize",y3)}function Qee(e,t,n){const r=e.canvas,o=r&&LC(r);if(!o)return;const i=Kk((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),Kee(e,i),a}function R1(e,t,n){n&&n.disconnect(),t==="resize"&&Xee(e)}function Jee(e,t,n){const r=e.canvas,o=Kk(i=>{e.ctx!==null&&n(qee(i,e))},e);return Wee(r,t,o),o}class Zee extends b3{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Hee(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Jm])return!1;const r=n[Jm].initial;["height","width"].forEach(i=>{const 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[Jm],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),a={attach:Gee,detach:Yee,resize:Qee}[n]||Jee;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]||Uee)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return WZ(t,n,r,o)}isAttached(t){const n=LC(t);return!!(n&&n.isConnected)}}function ete(e){return!NC()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Bee:Zee}var qm;let ra=(qm=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 Ju(this.x)&&Ju(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(qm,"defaults",{}),Ne(qm,"defaultRoutes"),qm);function tte(e,t){const n=e.options.ticks,r=nte(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?ote(t):[],a=i.length,s=i[0],l=i[a-1],c=[];if(a>o)return ite(t,c,i,a/o),c;const u=rte(i,t,o);if(a>0){let d,h;const p=a>1?Math.round((l-s)/(a-1)):null;for(qg(t,c,u,Tt(p)?0:s-p,s),d=0,h=a-1;d<h;d++)qg(t,c,u,i[d],i[d+1]);return qg(t,c,u,l,Tt(p)?t.length:l+p),c}return qg(t,c,u),c}function nte(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 rte(e,t,n){const r=ate(e),o=t.length/n;if(!r)return Math.max(o,1);const i=YJ(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 ote(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function ite(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 qg(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 ate(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 ste=e=>e==="left"?"right":e==="right"?"left":e,eO=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,tO=(e,t)=>Math.min(t||e,e);function nO(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 lte(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 cte(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 nf(e){return e.drawTicks?e.tickLength:0}function rO(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 ute(e,t){return Xs(e,{scale:t,type:"scale"})}function dte(e,t,n){return Xs(e,{tick:n,index:t,type:"tick"})}function fte(e,t,n){let r=TC(e);return(n&&t!=="right"||!n&&t==="right")&&(r=ste(r)),r}function hte(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,b;const v=a-o,x=s-i;if(e.isHorizontal()){if(p=wr(r,i,s),kt(n)){const y=Object.keys(n)[0],_=n[y];b=u[y].getPixelForValue(_)+v-t}else n==="center"?b=(c.bottom+c.top)/2+v-t:b=eO(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=eO(e,n,t);b=wr(r,a,o),d=n==="left"?-Wn:Wn}return{titleX:p,titleY:b,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=_Z(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?nO(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=tte(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=tO(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-nf(t.grid)-n.padding-rO(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),a=$C(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=rO(o,n.options.font);if(s?(t.width=this.maxWidth,t.height=nf(i)+l):(t.height=this.maxHeight,t.width=nf(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),p=r.padding*2,b=bi(this.labelRotation),v=Math.cos(b),x=Math.sin(b);if(s){const y=r.mirror?0:x*d.width+v*h.height;t.height=Math.min(this.maxHeight,t.height+y+p)}else{const y=r.mirror?0:v*d.width+x*h.height;t.width=Math.min(this.maxWidth,t.width+y+p)}this._calculatePadding(c,u,x,v)}}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=nO(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/tO(n,r));let c=0,u=0,d,h,p,b,v,x,y,_,S,C,E;for(d=0;d<n;d+=l){if(b=t[d].label,v=this._resolveTickFontOptions(d),o.font=x=v.string,y=i[x]=i[x]||{data:{},gc:[]},_=v.lineHeight,S=C=0,!Tt(b)&&!_n(b))S=S0(o,y.data,y.gc,S,b),C=_;else if(_n(b))for(h=0,p=b.length;h<p;++h)E=b[h],!Tt(E)&&!_n(E)&&(S=S0(o,y.data,y.gc,S,E),C+=_);a.push(S),s.push(C),c=Math.max(S,c),u=Math.max(C,u)}cte(i,n);const $=a.indexOf(c),D=s.indexOf(u),T=A=>({width:a[A]||0,height:s[A]||0});return{first:T(0),last:T(n-1),widest:T($),highest:T(D),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 QJ(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=dte(this.getContext(),t,r))}return this.$context||(this.$context=ute(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=bi(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=nf(i),p=[],b=s.setContext(this.getContext()),v=b.display?b.width:0,x=v/2,y=function(U){return pl(r,U,v)};let _,S,C,E,$,D,T,A,L,F,z,X;if(a==="top")_=y(this.bottom),D=this.bottom-h,A=_-x,F=y(t.top)+x,X=t.bottom;else if(a==="bottom")_=y(this.top),F=t.top,X=y(t.bottom)-x,D=_+x,A=this.top+h;else if(a==="left")_=y(this.right),$=this.right-h,T=_-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,T=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,D=_+x,A=D+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,T=$-h,L=t.left,z=t.right}const G=st(o.ticks.maxTicksLimit,d),M=Math.max(1,Math.ceil(d/G));for(S=0;S<d;S+=M){const U=this.getContext(S),V=i.setContext(U),Y=s.setContext(U),q=V.lineWidth,O=V.color,H=Y.dash||[],K=Y.dashOffset,I=V.tickWidth,oe=V.tickColor,ce=V.tickBorderDash||[],de=V.tickBorderDashOffset;C=lte(this,S,l),C!==void 0&&(E=pl(r,C,q),c?$=T=L=z=E:D=A=F=X=E,p.push({tx1:$,ty1:D,tx2:T,ty2:A,x1:L,y1:F,x2:z,y2:X,width:q,color:O,borderDash:H,borderDashOffset:K,tickWidth:I,tickColor:oe,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=nf(r.grid),p=h+u,b=d?-u:p,v=-bi(this.labelRotation),x=[];let y,_,S,C,E,$,D,T,A,L,F,z,X="middle";if(o==="top")$=this.bottom-b,D=this._getXAxisLabelAlignment();else if(o==="bottom")$=this.top+b,D=this._getXAxisLabelAlignment();else if(o==="left"){const M=this._getYAxisLabelAlignment(h);D=M.textAlign,E=M.x}else if(o==="right"){const M=this._getYAxisLabelAlignment(h);D=M.textAlign,E=M.x}else if(n==="x"){if(o==="center")$=(t.top+t.bottom)/2+p;else if(kt(o)){const M=Object.keys(o)[0],U=o[M];$=this.chart.scales[M].getPixelForValue(U)+p}D=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(t.left+t.right)/2-p;else if(kt(o)){const M=Object.keys(o)[0],U=o[M];E=this.chart.scales[M].getPixelForValue(U)}D=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 M=i.setContext(this.getContext(y));T=this.getPixelForTick(y)+i.labelOffset,A=this._resolveTickFontOptions(y),L=A.lineHeight,F=_n(C)?C.length:1;const U=F/2,V=M.color,Y=M.textStrokeColor,q=M.textStrokeWidth;let O=D;a?(E=T,D==="inner"&&(y===_-1?O=this.options.reverse?"left":"right":y===0?O=this.options.reverse?"right":"left":O="center"),o==="top"?c==="near"||v!==0?z=-F*L+L/2:c==="center"?z=-G.highest.height/2-U*L+L:z=-G.highest.height+L/2:c==="near"||v!==0?z=L/2:c==="center"?z=G.highest.height/2-U*L:z=G.highest.height-F*L,d&&(z*=-1),v!==0&&!M.showLabelBackdrop&&(E+=L/2*Math.sin(v))):($=T,z=(1-F)*L/2);let H;if(M.showLabelBackdrop){const K=fr(M.backdropPadding),I=G.heights[y],oe=G.widths[y];let ce=z-K.top,de=0-K.left;switch(X){case"middle":ce-=I/2;break;case"bottom":ce-=I;break}switch(D){case"center":de-=oe/2;break;case"right":de-=oe;break;case"inner":y===_-1?de-=oe:y>0&&(de-=oe/2);break}H={left:de,top:ce,width:oe+K.width,height:I+K.height,color:M.backdropColor}}x.push({label:C,font:A,textOffset:z,options:{rotation:v,color:V,strokeColor:Y,strokeWidth:q,textAlign:O,textBaseline:X,translation:[E,$],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-bi(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}=hte(this,l,n,s);sc(t,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:h,textAlign:fte(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 Gg{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;mte(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,pte(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 pte(e,t,n){const r=or(Object.create(null),[n?An.get(n):{},An.get(t),e.defaults]);An.set(t,r),e.defaultRoutes&&gte(t,e.defaultRoutes),e.descriptors&&An.describe(t,e.descriptors)}function gte(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 mte(e){return"id"in e&&"defaults"in e}class bte{constructor(){this.controllers=new Gg(Qo,"datasets",!0),this.elements=new Gg(ra,"elements"),this.plugins=new Gg(Object,"plugins"),this.scales=new Gg(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=PC(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 bte;class vte{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=yte(r);return o===!1&&!n?[]:wte(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 yte(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 xte(e,t){return!t&&e===!1?null:e===!0?{}:e}function wte(e,{plugins:t,localIds:n},r,o){const i=[],a=e.getContext();for(const s of t){const l=s.id,c=xte(r[l],o);c!==null&&i.push({plugin:s,options:_te(e.config,{plugin:s,local:n[l]},c,a)})}return i}function _te(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 Ste(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Cte(e,t){return e===t?"_index_":"_value_"}function oO(e){if(e==="x"||e==="y"||e==="r")return e}function Ete(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Gw(e,...t){if(oO(e))return e;for(const n of t){const r=n.axis||Ete(n.position)||e.length>1&&oO(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function iO(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Rte(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 iO(e,"x",n[0])||iO(e,"y",n[0])}return{}}function Pte(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,Rte(a,e),An.scales[s.type]),c=Cte(l,o),u=n.scales||{};i[a]=jf(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=Ste(d,l),p=a[h+"AxisID"]||h;i[p]=i[p]||Object.create(null),jf(i[p],[{axis:h},r[p],u[d]])})}),Object.keys(i).forEach(a=>{const s=i[a];jf(s,[An.scales[s.type],An.scale])}),i}function x3(e){const t=e.options||(e.options={});t.plugins=st(t.plugins,{}),t.scales=Pte(e,t)}function w3(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function $te(e){return e=e||{},e.data=w3(e.data),x3(e),e}const aO=new Map,_3=new Set;function Yg(e,t){let n=aO.get(e);return n||(n=t(),aO.set(e,n),_3.add(n)),n}const rf=(e,t,n)=>{const r=js(t,n);r!==void 0&&e.add(r)};class Ote{constructor(t){this._config=$te(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=w3(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(),x3(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Yg(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Yg(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Yg(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Yg(`${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=>rf(l,t,d))),u.forEach(d=>rf(l,o,d)),u.forEach(d=>rf(l,ac[i]||{},d)),u.forEach(d=>rf(l,An,d)),u.forEach(d=>rf(l,Ww,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),_3.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}=sO(this._resolverCache,t,o);let l=a;if(Dte(a,n)){i.$shared=!1,r=zs(r)?r():r;const c=this.createResolver(t,r,s);l=Zu(a,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=sO(this._resolverCache,t,r);return kt(n)?Zu(i,n,void 0,o):i}}function sO(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:MC(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(o,i)),i}const Tte=e=>kt(e)&&Object.getOwnPropertyNames(e).some(t=>zs(e[t]));function Dte(e,t){const{isScriptable:n,isIndexable:r}=t3(e);for(const o of t){const i=n(o),a=r(o),s=(a||i)&&e[o];if(i&&(zs(s)||Tte(s))||a&&_n(s))return!0}return!1}var Ate="4.4.1";const Mte=["top","bottom","left","right","chartArea"];function lO(e,t){return e==="top"||e==="bottom"||Mte.indexOf(e)===-1&&t==="x"}function cO(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function uO(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),cn(n&&n.onComplete,[e],t)}function kte(e){const t=e.chart,n=t.options.animation;cn(n&&n.onProgress,[e],t)}function S3(e){return NC()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Zm={},dO=e=>{const t=S3(e);return Object.values(Zm).filter(n=>n.canvas===t).pop()};function Ite(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 Nte(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Kg(e,t,n){return e.options.clip?e[n]:t[n]}function Lte(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Kg(n,t,"left"),right:Kg(n,t,"right"),top:Kg(r,t,"top"),bottom:Kg(r,t,"bottom")}:t}class Dn{static register(...t){Nr.add(...t),fO()}static unregister(...t){Nr.remove(...t),fO()}constructor(t,n){const r=this.config=new Ote(n),o=S3(t),i=dO(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||ete(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=jJ(),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 vte,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=tZ(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],Zm[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}_a.listen(this,"complete",uO),_a.listen(this,"progress",kte),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():M$(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return T$(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,M$(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||lO(s.position,c)!==lO(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(cO("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(cO("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);(!w$(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;Ite(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(!w$(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(),uO({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=Lte(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=Mee.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);lh(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$(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Zm[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}});!x0(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=UJ(t),c=Nte(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=!x0(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",Zm),Ne(Dn,"overrides",ac),Ne(Dn,"registry",Nr),Ne(Dn,"version",Ate),Ne(Dn,"getChart",dO);function fO(){return nn(Dn.instances,e=>e._plugins.invalidate())}function Fte(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 jte(e){return AC(e,["outerStart","outerEnd","innerStart","innerEnd"])}function zte(e,t,n,r){const o=jte(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 P0(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 b=o-l;if(r){const M=u>0?u-r:0,U=d>0?d-r:0,V=(M+U)/2,Y=V!==0?b*V/(V+r):b;p=(b-Y)/2}const v=Math.max(.001,b*d-n/Cn)/d,x=(b-v)/2,y=l+x+p,_=o-x-p,{outerStart:S,outerEnd:C,innerStart:E,innerEnd:$}=zte(t,h,d,_-y),D=d-S,T=d-C,A=y+S/D,L=_-C/T,F=h+E,z=h+$,X=y+E/F,G=_-$/z;if(e.beginPath(),i){const M=(A+L)/2;if(e.arc(a,s,d,A,M),e.arc(a,s,d,M,L),C>0){const q=Kc(T,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 Y=Kc(D,y,a,s);if(e.lineTo(Y.x,Y.y),S>0){const q=Kc(D,A,a,s);e.arc(q.x,q.y,S,y-Wn,A)}}else{e.moveTo(a,s);const M=Math.cos(A)*d+a,U=Math.sin(A)*d+s;e.lineTo(M,U);const V=Math.cos(L)*d+a,Y=Math.sin(L)*d+s;e.lineTo(V,Y)}e.closePath()}function Bte(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s}=t;let l=t.endAngle;if(i){P0(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(s)||(l=a+(s%Sn||Sn))}return P0(e,t,n,r,l,o),e.fill(),l}function Vte(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 b=t.endAngle;if(i){P0(e,t,n,r,b,o);for(let v=0;v<i;++v)e.stroke();isNaN(s)||(b=a+(s%Sn||Sn))}p&&Fte(e,t,b),i||(P0(e,t,n,r,b,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}=Uk(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,v=st(h,c-l)>=Sn||ch(a,l,c),x=Da(s,u+p,d+p);return v&&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,Bte(n,this,u,a,s),Vte(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 C3(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 Hte(e,t,n){e.lineTo(n.x,n.y)}function Wte(e){return e.stepped?hZ:e.tension||e.cubicInterpolationMode==="monotone"?pZ:Hte}function E3(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 Ute(e,t,n,r){const{points:o,options:i}=t,{count:a,start:s,loop:l,ilen:c}=E3(o,n,r),u=Wte(i);let{move:d=!0,reverse:h}=r||{},p,b,v;for(p=0;p<=c;++p)b=o[(s+(h?c-p:p))%a],!b.skip&&(d?(e.moveTo(b.x,b.y),d=!1):u(e,v,b,h,i.stepped),v=b);return l&&(b=o[(s+(h?c:0))%a],u(e,v,b,h,i.stepped)),!!l}function qte(e,t,n,r){const o=t.points,{count:i,start:a,ilen:s}=E3(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,h,p,b,v,x,y;const _=C=>(a+(c?s-C:C))%i,S=()=>{v!==x&&(e.lineTo(u,x),e.lineTo(u,v),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;$===b?(E<v?v=E:E>x&&(x=E),u=(d*u+C)/++d):(S(),e.lineTo(C,E),b=$,d=0,v=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?qte:Ute}function Gte(e){return e.stepped?qZ:e.tension||e.cubicInterpolationMode==="monotone"?GZ:xl}function Yte(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),C3(e,t.options),e.stroke(o)}function Kte(e,t,n,r){const{segments:o,options:i}=t,a=Yw(t);for(const s of o)C3(e,i,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Xte=typeof Path2D=="function";function Qte(e,t,n,r){Xte&&!t.options.segment?Yte(e,t,n,r):Kte(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;FZ(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=ZZ(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=d3(this,{property:n,start:o,end:o});if(!a.length)return;const s=[],l=Gte(r);let c,u;for(c=0,u=a.length;c<u;++c){const{start:d,end:h}=a[c],p=i[d],b=i[h];if(p===b){s.push(p);continue}const v=Math.abs((o-p[n])/(b[n]-p[n])),x=l(p,b,v,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(),Qte(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 hO(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 hO(this,n,"x",r)}inYRange(n,r){return hO(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,C0(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 R3(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 Jte(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=e3(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 Zte(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 ene(e){const t=R3(e),n=t.right-t.left,r=t.bottom-t.top,o=Jte(e,n/2,r/2),i=Zte(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)&&R3(e,r);return s&&(o||Da(t,s.left,s.right))&&(i||Da(n,s.top,s.bottom))}function tne(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function nne(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}=ene(this),s=tne(a.radius)?uh:nne;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 rne=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)"],pO=Kw.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function P3(e){return Kw[e%Kw.length]}function $3(e){return pO[e%pO.length]}function one(e,t){return e.borderColor=P3(t),e.backgroundColor=$3(t),++t}function ine(e,t){return e.backgroundColor=e.data.map(()=>P3(t++)),t}function ane(e,t){return e.backgroundColor=e.data.map(()=>$3(t++)),t}function sne(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof Dl?t=ine(n,t):o instanceof Hf?t=ane(n,t):o&&(t=one(n,t))}}function gO(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function lne(e){return e&&(e.borderColor||e.backgroundColor)}var cne={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&&(gO(r)||lne(o)||i&&gO(i)))return;const a=sne(e);r.forEach(a)}};function une(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,b,v;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,D=Math.min(Math.floor((d+1)*s)+1,n)+t,{x:T,y:A}=e[u];for(p=b=-1,_=$;_<D;_++)b=.5*Math.abs((T-x)*(e[_].y-A)-(T-e[_].x)*(y-A)),b>p&&(p=b,h=e[_],v=_);a[l++]=h,u=v}return a[l++]=e[c],a}function dne(e,t,n,r){let o=0,i=0,a,s,l,c,u,d,h,p,b,v;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<b?(b=c,d=a):c>v&&(v=c,h=a),o=(i*o+s.x)/++i;else{const $=a-1;if(!Tt(d)&&!Tt(h)){const D=Math.min(d,h),T=Math.max(d,h);D!==p&&D!==$&&x.push({...e[D],x:o}),T!==p&&T!==$&&x.push({...e[T],x:o})}a>0&&$!==p&&x.push(e[$]),x.push(s),u=E,i=0,b=v=c,d=h=p=a}}return x}function O3(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 mO(e){e.data.datasets.forEach(t=>{O3(t)})}function fne(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 hne={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){mO(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}=fne(l,c);const p=n.threshold||4*r;if(h<=p){O3(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(v){this._data=v}}));let b;switch(n.algorithm){case"lttb":b=une(c,d,h,r,n);break;case"min-max":b=dne(c,d,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=b})},destroy(e){mO(e)}};function pne(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=jC(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=d3(t,u);for(const h of d){const p=Xw(n,i[h.start],i[h.end],h.loop),b=u3(s,o,p);for(const v of b)a.push({source:v,target:h,start:{[n]:bO(u,p,"start",Math.max)},end:{[n]:bO(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 gne(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:a,end:s})=>{s=jC(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 jC(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function bO(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function T3(e,t){let n=[],r=!1;return _n(e)?(r=!0,n=e):n=gne(e,t),n.length?new Ts({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function vO(e){return e&&e.fill!==!1}function mne(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 bne(e,t,n){const r=wne(e);if(kt(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Ln(o)&&Math.floor(o)===o?vne(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function vne(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function yne(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 xne(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 wne(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 _ne(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,a=r.points,s=Sne(t,n);s.push(T3({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++)Cne(o,a[u],s)}return new Ts({points:o,options:{}})}function Sne(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 Cne(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:a,last:s,point:l}=Ene(i,t,"x");if(!(!l||a&&s)){if(a)r.unshift(l);else if(e.push(l),!s)break}}e.push(...r)}function Ene(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 D3{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 Rne(e){const{chart:t,fill:n,line:r}=e;if(Ln(n))return Pne(t,n);if(n==="stack")return _ne(e);if(n==="shape")return!0;const o=$ne(e);return o instanceof D3?o:T3(o,r)}function Pne(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function $ne(e){return(e.scale||{}).getPointPositionForValue?Tne(e):One(e)}function One(e){const{scale:t={},fill:n}=e,r=yne(n,t);if(Ln(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function Tne(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,a=xne(n,t,i),s=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new D3({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=Rne(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),Dne(e,{line:o,target:r,above:u,below:d,area:n,scale:i,axis:a}),Ul(e))}function Dne(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&&(yO(e,r,a.top),xO(e,{line:n,target:r,color:o,scale:s,property:l}),e.restore(),e.save(),yO(e,r,a.bottom)),xO(e,{line:n,target:r,color:i,scale:s,property:l}),e.restore()}function yO(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[jC(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 xO(e,t){const{line:n,target:r,property:o,color:i,scale:a}=t,s=pne(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,Ane(e,a,p&&Xw(o,u,d)),e.beginPath();const b=!!n.pathSegment(e,l);let v;if(p){b?e.closePath():wO(e,r,d,o);const x=!!r.pathSegment(e,c,{move:b,reverse:!0});v=b&&x,v||wO(e,r,u,o)}e.closePath(),e.fill(v?"evenodd":"nonzero"),e.restore()}}function Ane(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 wO(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var Mne={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:bne(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=mne(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;vO(i)&&O1(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!vO(r)||n.drawTime!=="beforeDatasetDraw"||O1(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const _O=(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)}},kne=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class SO 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}=_O(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((b,v)=>{const x=r+n/2+i.measureText(b.text).width;(v===0||c[c.length-1]+x+2*s>a)&&(d+=u,c[c.length-(v>0?0:1)]=0,p+=u,h++),l[v]={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,b=0,v=0;return this.legendItems.forEach((x,y)=>{const{itemWidth:_,itemHeight:S}=Ine(r,n,i,x,o);y>0&&p+S+2*s>u&&(d+=h+s,c.push({width:h,height:p}),b+=h+s,v++,h=p=0),l[y]={left:b,top:p,col:v,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=_u(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=_u(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:b,boxHeight:v,itemHeight:x}=_O(a,d),y=function($,D,T){if(isNaN(b)||b<=0||isNaN(v)||v<0)return;o.save();const A=st(T.lineWidth,1);if(o.fillStyle=st(T.fillStyle,s),o.lineCap=st(T.lineCap,"butt"),o.lineDashOffset=st(T.lineDashOffset,0),o.lineJoin=st(T.lineJoin,"miter"),o.lineWidth=A,o.strokeStyle=st(T.strokeStyle,s),o.setLineDash(st(T.lineDash,[])),a.usePointStyle){const L={radius:v*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:A},F=l.xPlus($,b/2),z=D+h;Zk(o,L,F,z,a.pointStyleWidth&&b)}else{const L=D+Math.max((d-v)/2,0),F=l.leftForLtr($,b),z=ql(T.borderRadius);o.beginPath(),Object.values(z).some(X=>X!==0)?uh(o,{x:F,y:L,w:b,h:v,radius:z}):o.rect(F,L,b,v),o.fill(),A!==0&&o.stroke()}o.restore()},_=function($,D,T){sc(o,T.text,$,D+x/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.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},s3(this.ctx,t.textDirection);const E=x+u;this.legendItems.forEach(($,D)=>{o.strokeStyle=$.fontColor,o.fillStyle=$.fontColor;const T=o.measureText($.text).width,A=l.textAlign($.textAlign||($.textAlign=a.textAlign)),L=b+h+T;let F=p.x,z=p.y;l.setWidth(this.width),S?D>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])):D>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=nZ(A,F+b+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+=A3($,G)+u}else p.y+=E}),l3(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=_u(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 b=this.columnSizes.reduce((v,x)=>Math.max(v,x.height),0);u=c+wr(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}const p=wr(s,d,d+h);a.textAlign=i.textAlign(TC(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(!Fne(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=kne(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 Ine(e,t,n,r,o){const i=Nne(r,e,t,n),a=Lne(o,r,t.lineHeight);return{itemWidth:i,itemHeight:a}}function Nne(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 Lne(e,t,n){let r=e;return typeof t.text!="string"&&(r=A3(t,n)),r}function A3(e,t){const n=e.text?e.text.length:0;return t*n}function Fne(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var jne={id:"legend",_element:SO,start(e,t,n){const r=e.legend=new SO({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 zC=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:TC(n.align),textBaseline:"middle",translation:[a,s]})}};function zne(e,t){const n=new zC({ctx:e.ctx,options:t,chart:e});_r.configure(e,n,t),_r.addBox(e,n),e.titleBlock=n}var Bne={id:"title",_element:zC,start(e,t,n){zne(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 Xg=new WeakMap;var Vne={id:"subtitle",start(e,t,n){const r=new zC({ctx:e.ctx,options:n,chart:e});_r.configure(e,r,n),_r.addBox(e,r),Xg.set(e,r)},stop(e){_r.removeBox(e,Xg.get(e)),Xg.delete(e)},beforeUpdate(e,t,n){const r=Xg.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 $f={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 Hne(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 CO(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,b=fr(t.padding);let v=b.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&&(v+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const C=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;v+=p*C+(y-p)*l.lineHeight+(y-1)*t.bodySpacing}h&&(v+=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+=b.width,{width:x,height:v}}function Wne(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Une(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 qne(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"),Une(c,e,t,n)&&(c="center"),c}function EO(e,t,n){const r=n.yAlign||t.yAlign||Wne(e,n);return{xAlign:n.xAlign||t.xAlign||qne(e,t,n,r),yAlign:r}}function Gne(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Yne(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function RO(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 b=Gne(t,s);const v=Yne(t,l,c);return l==="center"?s==="left"?b+=c:s==="right"&&(b-=c):s==="left"?b-=Math.max(u,h)+o:s==="right"&&(b+=Math.max(d,p)+o),{x:rr(b,0,r.width-t.width),y:rr(v,0,r.height-t.height)}}function Qg(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 PO(e){return Ti([],Sa(e))}function Kne(e,t,n){return Xs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function $O(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const M3={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"?M3[t].call(n,r):o}var Xx;let OO=(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 f3(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=Kne(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 PO(Yr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return nn(t,i=>{const a={before:[],lines:[],after:[]},s=$O(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 PO(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(Hne(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=$O(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=$f[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=CO(this,r),c=Object.assign({},s,l),u=EO(this.chart,r,c),d=RO(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:b,height:v}=n;let x,y,_,S,C,E;return i==="center"?(C=p+v/2,o==="left"?(x=h,y=x-a,S=C+a,E=C-a):(x=h+b,y=x+a,S=C-a,E=C+a),_=x):(o==="left"?y=h+Math.max(l,u)+a:o==="right"?y=h+b-Math.max(c,d)-a:y=this.caretX,i==="top"?(S=p,C=S-a,x=y-a,_=y+a):(S=p+v,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=_u(r.rtl,this.x,this.width);for(t.x=Qg(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=Qg(this,"left",i),h=o.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,b=n.y+p;if(i.usePointStyle){const v={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},x=o.leftForLtr(h,c)+c/2,y=b+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,C0(t,v,x,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,C0(t,v,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 v=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,uh(t,{x:v,y:b,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),uh(t,{x,y:b+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(v,b,c,l),t.strokeRect(v,b,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,b+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 b=_u(r.rtl,this.x,this.width),v=function(T){n.fillText(T,b.x(t.x+p),t.y+h/2),t.y+=h+i},x=b.textAlign(a);let y,_,S,C,E,$,D;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Qg(this,x,r),n.fillStyle=r.bodyColor,nn(this.beforeBody,v),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,v),S=y.lines,s&&S.length&&(this._drawColorBox(n,t,C,b,r),h=Math.max(d.lineHeight,l)),E=0,D=S.length;E<D;++E)v(S[E]),h=d.lineHeight;nn(y.after,v)}p=0,h=d.lineHeight,nn(this.afterBody,v),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let a,s;if(i){const l=_u(r.rtl,this.x,this.width);for(t.x=Qg(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:b}=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-b),n.quadraticCurveTo(s+c,l+u,s+c-b,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=$f[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=CO(this,t),l=Object.assign({},a,this._size),c=EO(n,t,l),u=RO(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),s3(t,n.textDirection),i.y+=a.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),l3(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=!x0(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||!x0(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=$f[i.position].call(this,t,n);return a!==!1&&(r!==a.x||o!==a.y)}},Ne(Xx,"positioners",$f),Xx);var k3={id:"tooltip",_element:OO,positioners:$f,afterInit(e,t,n){n&&(e.tooltip=new OO({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:M3},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"]},Xne=Object.freeze({__proto__:null,Colors:cne,Decimation:hne,Filler:Mne,Legend:jne,SubTitle:Vne,Title:Bne,Tooltip:k3});const Qne=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Jne(e,t,n,r){const o=e.indexOf(t);if(o===-1)return Qne(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const Zne=(e,t)=>e===null?null:rr(Math.round(e),0,t);function TO(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class $0 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:Jne(r,t,st(n,t),this._addedLabels),Zne(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 TO.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($0,"id","category"),Ne($0,"defaults",{ticks:{callback:TO}});function ere(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,b=u-1,{min:v,max:x}=t,y=!Tt(a),_=!Tt(s),S=!Tt(c),C=(x-v)/(d+1);let E=S$((x-v)/b/p)*p,$,D,T,A;if(E<1e-14&&!y&&!_)return[{value:v},{value:x}];A=Math.ceil(x/E)-Math.floor(v/E),A>b&&(E=S$(A*E/b/p)*p),Tt(l)||($=Math.pow(10,l),E=Math.ceil(E*$)/$),o==="ticks"?(D=Math.floor(v/E)*E,T=Math.ceil(x/E)*E):(D=v,T=x),y&&_&&i&&KJ((s-a)/i,E/1e3)?(A=Math.round(Math.min((s-a)/E,u)),E=(s-a)/A,D=a,T=s):S?(D=y?a:D,T=_?s:T,A=c-1,E=(T-D)/A):(A=(T-D)/E,zf(A,Math.round(A),E/1e3)?A=Math.round(A):A=Math.ceil(A));const L=Math.max(C$(E),C$(D));$=Math.pow(10,Tt(l)?L:l),D=Math.round(D*$)/$,T=Math.round(T*$)/$;let F=0;for(y&&(h&&D!==a?(n.push({value:a}),D<a&&F++,zf(Math.round((D+F*E)*$)/$,a,DO(a,C,e))&&F++):D<a&&F++);F<A;++F){const z=Math.round((D+F*E)*$)/$;if(_&&z>s)break;n.push({value:z})}return _&&h&&T!==s?n.length&&zf(n[n.length-1].value,s,DO(s,C,e))?n[n.length-1].value=s:n.push({value:s}):(!_||T===s)&&n.push({value:T}),n}function DO(e,t,{horizontal:n,minRotation:r}){const o=bi(r),i=(n?Math.sin(o):Math.cos(o))||.001,a=.75*t*(""+e).length;return Math.min(t/i,a)}class O0 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=ere(o,i);return t.bounds==="ticks"&&Wk(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 pp(t,this.chart.options.locale,this.options.ticks.format)}}class td extends O0{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=bi(this.options.ticks.minRotation),o=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Ne(td,"id","linear"),Ne(td,"defaults",{ticks:{callback:Hb.formatters.numeric}});const fh=e=>Math.floor(Os(e)),ml=(e,t)=>Math.pow(10,fh(e)+t);function AO(e){return e/Math.pow(10,fh(e))===1}function MO(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function tre(e,t){const n=t-e;let r=fh(n);for(;MO(e,t,r)>10;)r++;for(;MO(e,t,r)<10;)r--;return Math.min(r,fh(e))}function nre(e,{min:t,max:n}){t=mo(e.min,t);const r=[],o=fh(t);let i=tre(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:AO(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:AO(p),significand:d}),r}class nd 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=O0.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=nre(n,this);return t.bounds==="ticks"&&Wk(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":pp(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(nd,"id","logarithmic"),Ne(nd,"defaults",{ticks:{callback:Hb.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 rre(e,t,n){return n=_n(n)?n:[n],{w:fZ(e,t.string,n),h:n.length*t.lineHeight}}function kO(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 ore(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=rre(e.ctx,d,e._pointLabels[l]);r[l]=h;const p=xo(e.getIndexAngle(l)+s),b=Math.round($C(p)),v=kO(b,u.x,h.w,0,180),x=kO(b,u.y,h.h,90,270);ire(n,t,p,v,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=lre(e,r,o)}function ire(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 are(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($C(xo(l.angle+Wn))),u=dre(l.y,s.h,c),d=cre(c),h=ure(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 sre(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 lre(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=are(e,u,l);r.push(d),s==="auto"&&(d.visible=sre(d,c),d.visible&&(c=d))}return r}function cre(e){return e===0||e===180?"center":e<180?"left":"right"}function ure(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function dre(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function fre(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(b=>b!==0)?(e.beginPath(),uh(e,{x:u,y:d,w:h,h:p,radius:l}),e.fill()):e.fillRect(u,d,h,p)}}function hre(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));fre(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 I3(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 pre(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(),I3(e,n,a,r),i.closePath(),i.stroke(),i.restore())}function gre(e,t,n){return Xs(e,{label:n,index:t,type:"pointLabel"})}class Of extends O0{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){O0.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?ore(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+bi(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 gre(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(),I3(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&&hre(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),b=i.setContext(h);pre(this,p,l,a,b)}}),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(Of,"id","radialLinear"),Ne(Of,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Hb.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ne(Of,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ne(Of,"descriptors",{angleLines:{_fallback:"grid"}});const Ub={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(Ub);function IO(e,t){return e-t}function NO(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"&&(Ju(i)||i===!0)?n.startOf(a,"isoWeek",i):n.startOf(a,o)),+a)}function LO(e,t,n,r){const o=eo.length;for(let i=eo.indexOf(e);i<o-1;++i){const a=Ub[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 mre(e,t,n,r,o){for(let i=eo.length-1;i>=eo.indexOf(n);i--){const a=eo[i];if(Ub[a].common&&e._adapter.diff(o,r,a)>=t-1)return a}return eo[n?eo.indexOf(n):0]}function bre(e){for(let t=eo.indexOf(e)+1,n=eo.length;t<n;++t)if(Ub[eo[t]].common)return eo[t]}function FO(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=OC(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function vre(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 jO(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:vre(e,r,o,n)}class hh 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 $ee._date(t.adapters.date);o.init(n),jf(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:NO(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=ZJ(o,i,a);return this._unit=n.unit||(r.autoSkip?LO(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):mre(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:bre(this._unit),this.initOffsets(o),t.reverse&&s.reverse(),jO(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||LO(i.minUnit,n,r,this._getLabelCapacity(n)),s=st(o.ticks.stepSize,1),l=a==="week"?i.isoWeekday:!1,c=Ju(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 b=o.ticks.source==="data"&&this.getDataTimestamps();for(h=d,p=0;h<r;h=+t.add(h,s,a),p++)FO(u,h,b);return(h===r||o.bounds==="ticks"||p===1)&&FO(u,h,b),Object.keys(u).sort(IO).map(v=>+v)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const o=this.options.time.displayFormats,i=this._unit,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=bi(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,jO(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(NO(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Gk(t.sort(IO))}}Ne(hh,"id","time"),Ne(hh,"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 Jg(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 hh{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=Jg(n,this.min),this._tableRange=Jg(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(Jg(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Jg(this._table,r*this._tableRange+this._minPos,!0)}}Ne(Jw,"id","timeseries"),Ne(Jw,"defaults",hh.defaults);var yre=Object.freeze({__proto__:null,CategoryScale:$0,LinearScale:td,LogarithmicScale:nd,RadialLinearScale:Of,TimeScale:hh,TimeSeriesScale:Jw});const xre=[Pee,rne,Xne,yre];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*wre(e){for(const t of e)yield*t}function N3(e){return Array.from(wre(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,BC=1e-12,Ot=Math.PI,In=Ot/2,zO=Ot/4,Oo=Ot*2,kr=180/Ot,un=Ot/180,Vt=Math.abs,vd=Math.atan,Ki=Math.atan2,gt=Math.cos,Zg=Math.ceil,L3=Math.exp,T0=Math.log,T1=Math.pow,ut=Math.sin,Xo=Math.sign||function(e){return e>0?1:e<0?-1:0},jr=Math.sqrt,VC=Math.tan;function F3(e){return e>1?0:e<-1?Ot:Math.acos(e)}function Jo(e){return e>1?In:e<-1?-In:Math.asin(e)}function nr(){}function D0(e,t){e&&VO.hasOwnProperty(e.type)&&VO[e.type](e,t)}var BO={Feature:function(e,t){D0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)D0(n[r].geometry,t)}},VO={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){HO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)HO(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)D0(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 HO(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&&BO.hasOwnProperty(e.type)?BO[e.type](e,t):D0(e,t)}function e_(e){return[Ki(e[1],e[0]),Jo(e[2])]}function rd(e){var t=e[0],n=e[1],r=gt(n);return[r*gt(t),r*ut(t),ut(n)]}function em(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function A0(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 tm(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 j3(e,t,n){return(e%=Oo)?t||n?n_(UO(e),qO(t,n)):UO(e):t||n?qO(t,n):r_}function WO(e){return function(t,n){return t+=e,Vt(t)>Ot&&(t-=Math.round(t/Oo)*Oo),[t,n]}}function UO(e){var t=WO(e);return t.invert=WO(-e),t}function qO(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),Jo(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),Jo(p*n-u*r)]},a}function _re(e){e=j3(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 Sre(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=GO(a,o),i=GO(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 GO(e,t){t=rd(t),t[0]-=e,t_(t);var n=F3(-t[1]);return((-t[2]<0?-n:n)+Oo-nt)%Oo}function z3(){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 e0(e,t){return Vt(e[0]-t[0])<nt&&Vt(e[1]-t[1])<nt}function nm(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 B3(e,t,n,r,o){var i=[],a=[],s,l;if(e.forEach(function(b){if(!((v=b.length-1)<=0)){var v,x=b[0],y=b[v],_;if(e0(x,y)){if(!x[2]&&!y[2]){for(o.lineStart(),s=0;s<v;++s)o.point((x=b[s])[0],x[1]);o.lineEnd();return}y[0]+=2*nt}i.push(_=new nm(x,b,null,!0)),a.push(_.o=new nm(x,null,_,!1)),i.push(_=new nm(y,b,null,!1)),a.push(_.o=new nm(y,null,_,!0))}}),!!i.length){for(a.sort(t),YO(i),YO(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 YO(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]:Xo(e[0])*((Vt(e[0])+Ot)%Oo-Ot)}function V3(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],b=A1(p),v=p[1]/2+zO,x=ut(v),y=gt(v),_=0;_<h;++_,b=C,x=$,y=D,p=S){var S=d[_],C=A1(S),E=S[1]/2+zO,$=ut(E),D=gt(E),T=C-b,A=T>=0?1:-1,L=A*T,F=L>Ot,z=x*$;if(l.add(Ki(z*A*ut(L),y*D+z*gt(L))),a+=F?T+A*Oo:T,F^b>=n^C>=n){var X=A0(rd(p),rd(S));t_(X);var G=A0(i,X);t_(G);var M=(F^T>=0?-1:1)*Jo(G[2]);(r>M||r===M&&(X[0]||X[1]))&&(s+=F^T>=0?1:-1)}}return(a<-nt||a<nt&&l<-BC)^s&1}function H3(e,t,n,r){return function(o){var i=t(o),a=z3(),s=t(a),l=!1,c,u,d,h={point:p,lineStart:v,lineEnd:x,polygonStart:function(){h.point=y,h.lineStart=_,h.lineEnd=S,u=[],c=[]},polygonEnd:function(){h.point=p,h.lineStart=v,h.lineEnd=x,u=N3(u);var C=V3(c,r);u.length?(l||(o.polygonStart(),l=!0),B3(u,Ere,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 b(C,E){i.point(C,E)}function v(){h.point=b,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(),$,D=E.length,T,A,L;if(d.pop(),c.push(d),d=null,!!D){if(C&1){if(A=E[0],(T=A.length-1)>0){for(l||(o.polygonStart(),l=!0),o.lineStart(),$=0;$<T;++$)o.point((L=A[$])[0],L[1]);o.lineEnd()}return}D>1&&C&2&&E.push(E.pop().concat(E.shift())),u.push(E.filter(Cre))}}return h}}function Cre(e){return e.length>1}function Ere(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 KO=H3(function(){return!0},Rre,$re,[-Ot,-In]);function Rre(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=Pre(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 Pre(e,t,n,r){var o,i,a=ut(e-n);return Vt(a)>nt?vd((ut(t)*(i=gt(r))*ut(n)-ut(r)*(o=gt(t))*ut(e))/(o*i*a)):(t+r)/2}function $re(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 Ore(e){var t=gt(e),n=2*un,r=t>0,o=Vt(t)>nt;function i(u,d,h,p){Sre(p,e,n,h,u,d)}function a(u,d){return gt(u)*gt(d)>t}function s(u){var d,h,p,b,v;return{lineStart:function(){b=p=!1,v=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&&(b=p=C)&&u.lineStart(),C!==p&&(S=l(d,_),(!S||e0(d,S)||e0(_,S))&&(_[2]=1)),C!==p)v=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))&&(v=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||!e0(d,_))&&u.point(_[0],_[1]),d=_,p=C,h=E},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return v|(b&&p)<<1}}}function l(u,d,h){var p=rd(u),b=rd(d),v=[1,0,0],x=A0(p,b),y=em(x,x),_=x[0],S=y-_*_;if(!S)return!h&&u;var C=t*y/S,E=-t*_/S,$=A0(v,x),D=tm(v,C),T=tm(x,E);D1(D,T);var A=$,L=em(D,A),F=em(A,A),z=L*L-F*(em(D,D)-1);if(!(z<0)){var X=jr(z),G=tm(A,(-L-X)/F);if(D1(G,D),G=e_(G),!h)return G;var M=u[0],U=d[0],V=u[1],Y=d[1],q;U<M&&(q=M,M=U,U=q);var O=U-M,H=Vt(O-Ot)<nt,K=H||O<nt;if(!H&&Y<V&&(q=V,V=Y,Y=q),K?H?V+Y>0^G[1]<(Vt(G[0]-M)<nt?V:Y):V<=G[1]&&G[1]<=Y:O>Ot^(M<=G[0]&&G[0]<=U)){var I=tm(A,(-L+X)/F);return D1(I,D),[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 H3(a,s,i,r?[0,-e]:[-Ot,e-Ot])}function Tre(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,b;if(b=n-a,!(!h&&b>0)){if(b/=h,h<0){if(b<u)return;b<d&&(d=b)}else if(h>0){if(b>d)return;b>u&&(u=b)}if(b=o-a,!(!h&&b<0)){if(b/=h,h<0){if(b>d)return;b>u&&(u=b)}else if(h>0){if(b<u)return;b<d&&(d=b)}if(b=r-s,!(!p&&b>0)){if(b/=p,p<0){if(b<u)return;b<d&&(d=b)}else if(p>0){if(b>d)return;b>u&&(u=b)}if(b=i-s,!(!p&&b<0)){if(b/=p,p<0){if(b>d)return;b>u&&(u=b)}else if(p>0){if(b<u)return;b<d&&(d=b)}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 Tf=1e9,rm=-Tf;function Dre(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,b=0;if(c==null||(p=a(c,d))!==(b=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)!==b);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=z3(),h,p,b,v,x,y,_,S,C,E,$,D={point:T,lineStart:z,lineEnd:X,polygonStart:L,polygonEnd:F};function T(M,U){o(M,U)&&u.point(M,U)}function A(){for(var M=0,U=0,V=p.length;U<V;++U)for(var Y=p[U],q=1,O=Y.length,H=Y[0],K,I,oe=H[0],ce=H[1];q<O;++q)K=oe,I=ce,H=Y[q],oe=H[0],ce=H[1],I<=r?ce>r&&(oe-K)*(r-I)>(ce-I)*(e-K)&&++M:ce<=r&&(oe-K)*(r-I)<(ce-I)*(e-K)&&--M;return M}function L(){u=d,h=[],p=[],$=!0}function F(){var M=A(),U=$&&M,V=(h=N3(h)).length;(U||V)&&(c.polygonStart(),U&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),V&&B3(h,s,M,i,c),c.polygonEnd()),u=c,h=p=b=null}function z(){D.point=G,p&&p.push(b=[]),E=!0,C=!1,_=S=NaN}function X(){h&&(G(v,x),y&&C&&d.rejoin(),h.push(d.result())),D.point=T,C&&u.lineEnd()}function G(M,U){var V=o(M,U);if(p&&b.push([M,U]),E)v=M,x=U,y=V,E=!1,V&&(u.lineStart(),u.point(M,U));else if(V&&C)u.point(M,U);else{var Y=[_=Math.max(rm,Math.min(Tf,_)),S=Math.max(rm,Math.min(Tf,S))],q=[M=Math.max(rm,Math.min(Tf,M)),U=Math.max(rm,Math.min(Tf,U))];Tre(Y,q,e,t,n,r)?(C||(u.lineStart(),u.point(Y[0],Y[1])),u.point(q[0],q[1]),V||u.lineEnd(),$=!1):V&&(u.lineStart(),u.point(M,U),$=!1)}_=M,S=U,C=V}return D}}var o_,i_,t0,n0,od={sphere:nr,point:nr,lineStart:Are,lineEnd:nr,polygonStart:nr,polygonEnd:nr};function Are(){od.point=kre,od.lineEnd=Mre}function Mre(){od.point=od.lineEnd=nr}function kre(e,t){e*=un,t*=un,i_=e,t0=ut(t),n0=gt(t),od.point=Ire}function Ire(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=n0*n-t0*r*i,c=t0*n+n0*r*i;o_.add(Ki(jr(s*s+l*l),c)),i_=e,t0=n,n0=r}function Nre(e){return o_=new Bs,Cl(e,od),+o_}var a_=[null,null],Lre={type:"LineString",coordinates:a_};function s_(e,t){return a_[0]=e,a_[1]=t,Nre(Lre)}var XO={Feature:function(e,t){return M0(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)if(M0(n[r].geometry,t))return!0;return!1}},QO={Sphere:function(){return!0},Point:function(e,t){return JO(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(JO(n[r],t))return!0;return!1},LineString:function(e,t){return ZO(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(ZO(n[r],t))return!0;return!1},Polygon:function(e,t){return eT(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(eT(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)if(M0(n[r],t))return!0;return!1}};function M0(e,t){return e&&QO.hasOwnProperty(e.type)?QO[e.type](e,t):!1}function JO(e,t){return s_(e,t)===0}function ZO(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))<BC*o))return!0;n=r}return!1}function eT(e,t){return!!V3(e.map(Fre),W3(t))}function Fre(e){return e=e.map(W3),e.pop(),e}function W3(e){return[e[0]*un,e[1]*un]}function jre(e,t){return(e&&XO.hasOwnProperty(e.type)?XO[e.type]:M0)(e,t)}function tT(e,t,n){var r=hu(e,t-nt,n).concat(t);return function(o){return r.map(function(i){return[o,i]})}}function nT(e,t,n){var r=hu(e,t-nt,n).concat(t);return function(o){return r.map(function(i){return[i,o]})}}function U3(){var e,t,n,r,o,i,a,s,l=10,c=l,u=90,d=360,h,p,b,v,x=2.5;function y(){return{type:"MultiLineString",coordinates:_()}}function _(){return hu(Zg(r/u)*u,n,u).map(b).concat(hu(Zg(s/d)*d,a,d).map(v)).concat(hu(Zg(t/l)*l,e,l).filter(function(S){return Vt(S%u)>nt}).map(h)).concat(hu(Zg(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:[b(r).concat(v(a).slice(1),b(n).reverse().slice(1),v(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=tT(i,o,90),p=nT(t,e,x),b=tT(s,a,90),v=nT(r,n,x),y):x},y.extentMajor([[-180,-90+nt],[180,90-nt]]).extentMinor([[-180,-80-nt],[180,80+nt]])}function zre(){return U3()()}const l_=e=>e;var M1=new Bs,c_=new Bs,q3,G3,u_,d_,xs={point:nr,lineStart:nr,lineEnd:nr,polygonStart:function(){xs.lineStart=Bre,xs.lineEnd=Hre},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 Bre(){xs.point=Vre}function Vre(e,t){xs.point=Y3,q3=u_=e,G3=d_=t}function Y3(e,t){c_.add(d_*e-u_*t),u_=e,d_=t}function Hre(){Y3(q3,G3)}const rT=xs;var id=1/0,k0=id,ph=-id,I0=ph,Wre={point:Ure,lineStart:nr,lineEnd:nr,polygonStart:nr,polygonEnd:nr,result:function(){var e=[[id,k0],[ph,I0]];return ph=I0=-(k0=id=1/0),e}};function Ure(e,t){e<id&&(id=e),e>ph&&(ph=e),t<k0&&(k0=t),t>I0&&(I0=t)}const N0=Wre;var f_=0,h_=0,Df=0,L0=0,F0=0,pu=0,p_=0,g_=0,Af=0,K3,X3,ji,zi,gi={point:lc,lineStart:oT,lineEnd:iT,polygonStart:function(){gi.lineStart=Yre,gi.lineEnd=Kre},polygonEnd:function(){gi.point=lc,gi.lineStart=oT,gi.lineEnd=iT},result:function(){var e=Af?[p_/Af,g_/Af]:pu?[L0/pu,F0/pu]:Df?[f_/Df,h_/Df]:[NaN,NaN];return f_=h_=Df=L0=F0=pu=p_=g_=Af=0,e}};function lc(e,t){f_+=e,h_+=t,++Df}function oT(){gi.point=qre}function qre(e,t){gi.point=Gre,lc(ji=e,zi=t)}function Gre(e,t){var n=e-ji,r=t-zi,o=jr(n*n+r*r);L0+=o*(ji+e)/2,F0+=o*(zi+t)/2,pu+=o,lc(ji=e,zi=t)}function iT(){gi.point=lc}function Yre(){gi.point=Xre}function Kre(){Q3(K3,X3)}function Xre(e,t){gi.point=Q3,lc(K3=ji=e,X3=zi=t)}function Q3(e,t){var n=e-ji,r=t-zi,o=jr(n*n+r*r);L0+=o*(ji+e)/2,F0+=o*(zi+t)/2,pu+=o,o=zi*e-ji*t,p_+=o*(ji+e),g_+=o*(zi+t),Af+=o*3,lc(ji=e,zi=t)}const aT=gi;function J3(e){this._context=e}J3.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,Z3,e7,Mf,kf,j0={point:nr,lineStart:function(){j0.point=Qre},lineEnd:function(){k1&&t7(Z3,e7),j0.point=nr},polygonStart:function(){k1=!0},polygonEnd:function(){k1=null},result:function(){var e=+m_;return m_=new Bs,e}};function Qre(e,t){j0.point=t7,Z3=Mf=e,e7=kf=t}function t7(e,t){Mf-=e,kf-=t,m_.add(jr(Mf*Mf+kf*kf)),Mf=e,kf=t}const sT=j0;let lT,z0,cT,uT;class dT{constructor(t){this._append=t==null?n7:Jre(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!==cT||this._append!==z0){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`,cT=r,z0=this._append,uT=this._,this._=o}this._+=uT;break}}}result(){const t=this._;return this._="",t.length?t:null}}function n7(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Jre(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return n7;if(t!==lT){const n=10**t;lT=t,z0=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 z0}function fT(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(rT)),rT.result()},a.measure=function(s){return Cl(s,o(sT)),sT.result()},a.bounds=function(s){return Cl(s,o(N0)),N0.result()},a.centroid=function(s){return Cl(s,o(aT)),aT.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 dT(n)):new J3(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 dT(n)),a},a.projection(e).digits(n).context(t)}function HC(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 WC(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(N0)),t(N0.result()),r!=null&&e.clipExtent(r),e}function UC(e,t,n){return WC(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 r7(e,t,n){return UC(e,[[0,0],t],n)}function o7(e,t,n){return WC(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 i7(e,t,n){return WC(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 hT=16,Zre=gt(30*un);function pT(e,t){return+t?toe(e,t):eoe(e)}function eoe(e){return HC({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function toe(e,t){function n(r,o,i,a,s,l,c,u,d,h,p,b,v,x){var y=c-r,_=u-o,S=y*y+_*_;if(S>4*t&&v--){var C=a+h,E=s+p,$=l+b,D=jr(C*C+E*E+$*$),T=Jo($/=D),A=Vt(Vt($)-1)<nt||Vt(i-d)<nt?(i+d)/2:Ki(E,C),L=e(A,T),F=L[0],z=L[1],X=F-r,G=z-o,M=_*X-y*G;(M*M/S>t||Vt((y*X+_*G)/S-.5)>.3||a*h+s*p+l*b<Zre)&&(n(r,o,i,a,s,l,F,z,A,C/=D,E/=D,$,v,x),x.point(F,z),n(F,z,A,C,E,$,c,u,d,h,p,b,v,x))}}return function(r){var o,i,a,s,l,c,u,d,h,p,b,v,x={point:y,lineStart:_,lineEnd:C,polygonStart:function(){r.polygonStart(),x.lineStart=E},polygonEnd:function(){r.polygonEnd(),x.lineStart=_}};function y(T,A){T=e(T,A),r.point(T[0],T[1])}function _(){d=NaN,x.point=S,r.lineStart()}function S(T,A){var L=rd([T,A]),F=e(T,A);n(d,h,u,p,b,v,d=F[0],h=F[1],u=T,p=L[0],b=L[1],v=L[2],hT,r),r.point(d,h)}function C(){x.point=y,r.lineEnd()}function E(){_(),x.point=$,x.lineEnd=D}function $(T,A){S(o=T,A),i=d,a=h,s=p,l=b,c=v,x.point=S}function D(){n(d,h,u,p,b,v,i,a,o,s,l,c,hT,r),x.lineEnd=C,C()}return x}}var noe=HC({point:function(e,t){this.stream.point(e*un,t*un)}});function roe(e){return HC({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function ooe(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 gT(e,t,n,r,o,i){if(!i)return ooe(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 b(v,x){return v*=r,x*=o,[l*v-c*x+t,n-c*v-l*x]}return b.invert=function(v,x){return[r*(u*v-d*x+h),o*(p-d*v-u*x)]},b}function Va(e){return a7(function(){return e})()}function a7(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,b=null,v=KO,x=null,y,_,S,C=l_,E=.5,$,D,T,A,L;function F(M){return T(M[0]*un,M[1]*un)}function z(M){return M=T.invert(M[0],M[1]),M&&[M[0]*kr,M[1]*kr]}F.stream=function(M){return A&&L===M?A:A=noe(roe(u)(v($(C(L=M)))))},F.preclip=function(M){return arguments.length?(v=M,b=void 0,G()):v},F.postclip=function(M){return arguments.length?(C=M,x=y=_=S=null,G()):C},F.clipAngle=function(M){return arguments.length?(v=+M?Ore(b=M*un):(b=null,KO),G()):b*kr},F.clipExtent=function(M){return arguments.length?(C=M==null?(x=y=_=S=null,l_):Dre(x=+M[0][0],y=+M[0][1],_=+M[1][0],S=+M[1][1]),G()):x==null?null:[[x,y],[_,S]]},F.scale=function(M){return arguments.length?(n=+M,X()):n},F.translate=function(M){return arguments.length?(r=+M[0],o=+M[1],X()):[r,o]},F.center=function(M){return arguments.length?(i=M[0]%360*un,a=M[1]%360*un,X()):[i*kr,a*kr]},F.rotate=function(M){return arguments.length?(s=M[0]%360*un,l=M[1]%360*un,c=M.length>2?M[2]%360*un:0,X()):[s*kr,l*kr,c*kr]},F.angle=function(M){return arguments.length?(d=M%360*un,X()):d*kr},F.reflectX=function(M){return arguments.length?(h=M?-1:1,X()):h<0},F.reflectY=function(M){return arguments.length?(p=M?-1:1,X()):p<0},F.precision=function(M){return arguments.length?($=pT(D,E=M*M),G()):jr(E)},F.fitExtent=function(M,U){return UC(F,M,U)},F.fitSize=function(M,U){return r7(F,M,U)},F.fitWidth=function(M,U){return o7(F,M,U)},F.fitHeight=function(M,U){return i7(F,M,U)};function X(){var M=gT(n,0,0,h,p,d).apply(null,t(i,a)),U=gT(n,r-M[0],o-M[1],h,p,d);return u=j3(s,l,c),D=n_(t,U),T=n_(u,D),$=pT(D,E),G()}function G(){return A=L=null,F}return function(){return t=e.apply(this,arguments),F.invert=t.invert&&z,X()}}function qC(e){var t=0,n=Ot/3,r=a7(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 ioe(e){var t=gt(e);function n(r,o){return[r*t,ut(o)/t]}return n.invert=function(r,o){return[r/t,Jo(o*t)]},n}function aoe(e,t){var n=ut(e),r=(n+ut(t))/2;if(Vt(r)<nt)return ioe(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))*Xo(c);return c*r<0&&(u-=Ot*Xo(s)*Xo(c)),[u/r,Jo((o-(s*s+c*c)*r*r)/(2*r))]},a}function B0(){return qC(aoe).scale(155.424).center([0,33.6442])}function s7(){return B0().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function soe(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 loe(){var e,t,n=s7(),r,o=B0().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,a=B0().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],b=h[1];return l=null,r.point(p,b),l||(i.point(p,b),l)||(s.point(p,b),l)}u.invert=function(h){var p=n.scale(),b=n.translate(),v=(h[0]-b[0])/p,x=(h[1]-b[1])/p;return(x>=.12&&x<.234&&v>=-.425&&v<-.214?o:x>=.166&&x<.234&&v>=-.214&&v<-.115?a:n).invert(h)},u.stream=function(h){return e&&t===h?e:e=soe([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(),b=+h[0],v=+h[1];return r=n.translate(h).clipExtent([[b-.455*p,v-.238*p],[b+.455*p,v+.238*p]]).stream(c),i=o.translate([b-.307*p,v+.201*p]).clipExtent([[b-.425*p+nt,v+.12*p+nt],[b-.214*p-nt,v+.234*p-nt]]).stream(c),s=a.translate([b-.205*p,v+.212*p]).clipExtent([[b-.214*p+nt,v+.166*p+nt],[b-.115*p-nt,v+.234*p-nt]]).stream(c),d()},u.fitExtent=function(h,p){return UC(u,h,p)},u.fitSize=function(h,p){return r7(u,h,p)},u.fitWidth=function(h,p){return o7(u,h,p)},u.fitHeight=function(h,p){return i7(u,h,p)};function d(){return e=t=null,u}return u.scale(1070)}function l7(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 mp(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),Jo(r&&n*i/r)]}}var c7=l7(function(e){return jr(2/(1+e))});c7.invert=mp(function(e){return 2*Jo(e/2)});function coe(){return Va(c7).scale(124.75).clipAngle(180-.001)}var u7=l7(function(e){return(e=F3(e))&&e/ut(e)});u7.invert=mp(function(e){return e});function uoe(){return Va(u7).scale(79.4188).clipAngle(180-.001)}function qb(e,t){return[e,T0(VC((In+t)/2))]}qb.invert=function(e,t){return[e,2*vd(L3(t))-In]};function doe(){return d7(qb).scale(961/Oo)}function d7(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(_re(t.rotate()).invert([0,0]));return i(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===qb?[[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 om(e){return VC((In+e)/2)}function foe(e,t){var n=gt(e),r=e===t?ut(e):T0(n/gt(t))/T0(om(t)/om(e)),o=n*T1(om(e),r)/r;if(!r)return qb;function i(a,s){o>0?s<-In+nt&&(s=-In+nt):s>In-nt&&(s=In-nt);var l=o/T1(om(s),r);return[l*ut(r*a),o-l*gt(r*a)]}return i.invert=function(a,s){var l=o-s,c=Xo(r)*jr(a*a+l*l),u=Ki(a,Vt(l))*Xo(l);return l*r<0&&(u-=Ot*Xo(a)*Xo(l)),[u/r,2*vd(T1(o/c,1/r))-In]},i}function hoe(){return qC(foe).scale(109.5).parallels([30,30])}function V0(e,t){return[e,t]}V0.invert=V0;function poe(){return Va(V0).scale(152.63)}function goe(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 V0;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))*Xo(l);return l*r<0&&(c-=Ot*Xo(a)*Xo(l)),[c/r,o-Xo(r)*jr(a*a+l*l)]},i}function moe(){return qC(goe).scale(131.154).center([0,13.9389])}var Wf=1.340264,Uf=-.081106,qf=893e-6,Gf=.003796,H0=jr(3)/2,boe=12;function f7(e,t){var n=Jo(H0*ut(t)),r=n*n,o=r*r*r;return[e*gt(n)/(H0*(Wf+3*Uf*r+o*(7*qf+9*Gf*r))),n*(Wf+Uf*r+o*(qf+Gf*r))]}f7.invert=function(e,t){for(var n=t,r=n*n,o=r*r*r,i=0,a,s,l;i<boe&&(s=n*(Wf+Uf*r+o*(qf+Gf*r))-t,l=Wf+3*Uf*r+o*(7*qf+9*Gf*r),n-=a=s/l,r=n*n,o=r*r*r,!(Vt(a)<BC));++i);return[H0*e*(Wf+3*Uf*r+o*(7*qf+9*Gf*r))/gt(n),Jo(ut(n)/H0)]};function voe(){return Va(f7).scale(177.158)}function h7(e,t){var n=gt(t),r=gt(e)*n;return[n*ut(e)/r,ut(t)/r]}h7.invert=mp(vd);function yoe(){return Va(h7).scale(144.049).clipAngle(60)}function p7(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)))]}p7.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 xoe(){return Va(p7).scale(175.295)}function g7(e,t){return[gt(t)*ut(e),ut(t)]}g7.invert=mp(Jo);function woe(){return Va(g7).scale(249.5).clipAngle(90+nt)}function m7(e,t){var n=gt(t),r=1+gt(e)*n;return[n*ut(e)/r,ut(t)/r]}m7.invert=mp(function(e){return 2*vd(e)});function _oe(){return Va(m7).scale(250).clipAngle(142)}function b7(e,t){return[T0(VC((In+t)/2)),-e]}b7.invert=function(e,t){return[-t,2*vd(L3(e))-In]};function Soe(){var e=d7(b7),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 Gb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function GC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function yd(){}var cc=.7,ad=1/cc,Su="\\s*([+-]?\\d+)\\s*",gh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Coe=/^#([0-9a-f]{3,8})$/,Eoe=new RegExp(`^rgb\\(${Su},${Su},${Su}\\)$`),Roe=new RegExp(`^rgb\\(${Ui},${Ui},${Ui}\\)$`),Poe=new RegExp(`^rgba\\(${Su},${Su},${Su},${gh}\\)$`),$oe=new RegExp(`^rgba\\(${Ui},${Ui},${Ui},${gh}\\)$`),Ooe=new RegExp(`^hsl\\(${gh},${Ui},${Ui}\\)$`),Toe=new RegExp(`^hsla\\(${gh},${Ui},${Ui},${gh}\\)$`),mT={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};Gb(yd,YC,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:bT,formatHex:bT,formatHex8:Doe,formatHsl:Aoe,formatRgb:vT,toString:vT});function bT(){return this.rgb().formatHex()}function Doe(){return this.rgb().formatHex8()}function Aoe(){return y7(this).formatHsl()}function vT(){return this.rgb().formatRgb()}function YC(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Coe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?yT(t):n===3?new Sr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?im(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?im(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=Eoe.exec(e))?new Sr(t[1],t[2],t[3],1):(t=Roe.exec(e))?new Sr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Poe.exec(e))?im(t[1],t[2],t[3],t[4]):(t=$oe.exec(e))?im(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ooe.exec(e))?_T(t[1],t[2]/100,t[3]/100,1):(t=Toe.exec(e))?_T(t[1],t[2]/100,t[3]/100,t[4]):mT.hasOwnProperty(e)?yT(mT[e]):e==="transparent"?new Sr(NaN,NaN,NaN,0):null}function yT(e){return new Sr(e>>16&255,e>>8&255,e&255,1)}function im(e,t,n,r){return r<=0&&(e=t=n=NaN),new Sr(e,t,n,r)}function v7(e){return e instanceof yd||(e=YC(e)),e?(e=e.rgb(),new Sr(e.r,e.g,e.b,e.opacity)):new Sr}function mh(e,t,n,r){return arguments.length===1?v7(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}Gb(Sr,mh,GC(yd,{brighter(e){return e=e==null?ad:Math.pow(ad,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),W0(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:xT,formatHex:xT,formatHex8:Moe,formatRgb:wT,toString:wT}));function xT(){return`#${Al(this.r)}${Al(this.g)}${Al(this.b)}`}function Moe(){return`#${Al(this.r)}${Al(this.g)}${Al(this.b)}${Al((isNaN(this.opacity)?1:this.opacity)*255)}`}function wT(){const e=W0(this.opacity);return`${e===1?"rgb(":"rgba("}${Xl(this.r)}, ${Xl(this.g)}, ${Xl(this.b)}${e===1?")":`, ${e})`}`}function W0(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 _T(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new mi(e,t,n,r)}function y7(e){if(e instanceof mi)return new mi(e.h,e.s,e.l,e.opacity);if(e instanceof yd||(e=YC(e)),!e)return new mi;if(e instanceof mi)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 mi(a,s,l,e.opacity)}function koe(e,t,n,r){return arguments.length===1?y7(e):new mi(e,t,n,r??1)}function mi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Gb(mi,koe,GC(yd,{brighter(e){return e=e==null?ad:Math.pow(ad,e),new mi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cc:Math.pow(cc,e),new mi(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 mi(ST(this.h),am(this.s),am(this.l),W0(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=W0(this.opacity);return`${e===1?"hsl(":"hsla("}${ST(this.h)}, ${am(this.s)*100}%, ${am(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ST(e){return e=(e||0)%360,e<0?e+360:e}function am(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 Ioe=Math.PI/180,Noe=180/Math.PI;var x7=-.14861,KC=1.78277,XC=-.29227,Yb=-.90649,bh=1.97294,CT=bh*Yb,ET=bh*KC,RT=KC*XC-Yb*x7;function Loe(e){if(e instanceof Ql)return new Ql(e.h,e.s,e.l,e.opacity);e instanceof Sr||(e=v7(e));var t=e.r/255,n=e.g/255,r=e.b/255,o=(RT*r+CT*t-ET*n)/(RT+CT-ET),i=r-o,a=(bh*(n-o)-XC*i)/Yb,s=Math.sqrt(a*a+i*i)/(bh*o*(1-o)),l=s?Math.atan2(a,i)*Noe-120:NaN;return new Ql(l<0?l+360:l,s,o,e.opacity)}function Xi(e,t,n,r){return arguments.length===1?Loe(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}Gb(Ql,Xi,GC(yd,{brighter(e){return e=e==null?ad:Math.pow(ad,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)*Ioe,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*(x7*r+KC*o)),255*(t+n*(XC*r+Yb*o)),255*(t+n*(bh*r)),this.opacity)}}));function Foe(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 joe(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 Foe((n-r/t)*t,a,o,i,s)}}const QC=e=>()=>e;function w7(e,t){return function(n){return e+n*t}}function zoe(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 Boe(e,t){var n=t-e;return n?w7(e,n>180||n<-180?n-360*Math.round(n/360):n):QC(isNaN(e)?t:e)}function Voe(e){return(e=+e)==1?Cu:function(t,n){return n-t?zoe(t,n,e):QC(isNaN(t)?n:t)}}function Cu(e,t){var n=t-e;return n?w7(e,n):QC(isNaN(e)?t:e)}(function e(t){var n=Voe(t);function r(o,i){var a=n((o=mh(o)).r,(i=mh(i)).r),s=n(o.g,i.g),l=n(o.b,i.b),c=Cu(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 Hoe(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=mh(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 Woe=Hoe(joe);function _7(e){return function t(n){n=+n;function r(o,i){var a=e((o=Xi(o)).h,(i=Xi(i)).h),s=Cu(o.s,i.s),l=Cu(o.l,i.l),c=Cu(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)}_7(Boe);var JC=_7(Cu);const hn=e=>Woe(e[e.length-1]);var Uoe=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Xt);const qoe=hn(Uoe);var Goe=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Xt);const Yoe=hn(Goe);var Koe=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Xt);const Xoe=hn(Koe);var Qoe=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Xt);const Joe=hn(Qoe);var Zoe=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Xt);const eie=hn(Zoe);var tie=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Xt);const nie=hn(tie);var rie=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Xt);const oie=hn(rie);var iie=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Xt);const aie=hn(iie);var sie=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Xt);const lie=hn(sie);var cie=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Xt);const uie=hn(cie);var die=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Xt);const fie=hn(die);var hie=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Xt);const pie=hn(hie);var gie=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Xt);const mie=hn(gie);var bie=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Xt);const vie=hn(bie);var yie=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Xt);const xie=hn(yie);var wie=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Xt);const _ie=hn(wie);var Sie=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Xt);const Cie=hn(Sie);var Eie=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Xt);const Rie=hn(Eie);var Pie=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Xt);const $ie=hn(Pie);var Oie=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Xt);const Tie=hn(Oie);var Die=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Xt);const Aie=hn(Die);var Mie=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Xt);const kie=hn(Mie);var Iie=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Xt);const Nie=hn(Iie);var Lie=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Xt);const Fie=hn(Lie);var jie=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Xt);const zie=hn(jie);var Bie=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Xt);const Vie=hn(Bie);var Hie=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Xt);const Wie=hn(Hie);function Uie(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 qie=JC(Xi(300,.5,0),Xi(-240,.5,1));var Gie=JC(Xi(-100,.75,.35),Xi(80,1.5,.8)),Yie=JC(Xi(260,.75,.35),Xi(80,1.5,.8)),sm=Xi();function Kie(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return sm.h=360*e-100,sm.s=1.5-1.5*t,sm.l=.8-.9*t,sm+""}var lm=mh(),Xie=Math.PI/3,Qie=Math.PI*2/3;function Jie(e){var t;return e=(.5-e)*Math.PI,lm.r=255*(t=Math.sin(e))*t,lm.g=255*(t=Math.sin(e+Xie))*t,lm.b=255*(t=Math.sin(e+Qie))*t,lm+""}function Zie(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 Kb(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const eae=Kb(Xt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var tae=Kb(Xt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),nae=Kb(Xt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),rae=Kb(Xt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function oae(e){return e}function iae(e){if(e==null)return oae;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 aae(e,t){for(var n,r=e.length,o=r-t;o<--r;)n=e[o],e[o++]=e[r],e[r]=n}function sae(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return PT(e,n)})}:PT(e,t)}function PT(e,t){var n=t.id,r=t.bbox,o=t.properties==null?{}:t.properties,i=lae(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 lae(e,t){var n=iae(e.transform),r=e.arcs;function o(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],p=0,b=h.length;p<b;++p)d.push(n(h[p],p));u<0&&aae(d,b)}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 Yf={geoAzimuthalEqualArea:coe,geoAzimuthalEquidistant:uoe,geoGnomonic:yoe,geoOrthographic:woe,geoStereographic:_oe,geoEqualEarth:voe,geoAlbers:s7,geoAlbersUsa:loe,geoConicConformal:hoe,geoConicEqualArea:B0,geoConicEquidistant:moe,geoEquirectangular:poe,geoMercator:doe,geoTransverseMercator:Soe,geoNaturalEarth1:xoe};Object.keys(Yf).forEach(e=>{Yf[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=Yf[e]});class wc extends Qs{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=fT()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(Yf[t.projection]||Yf.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=fT(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,b=(l-h)*.5+t.left+i,v=(c-p)*.5+t.top+o,x=this.options;return this.projection.scale(n.refScale*d*x.projectionScale).translate([d*n.refX+b+x.projectionOffset[0],d*n.refY+v+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 Xb={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 cae(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 uae(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=cae(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 td{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){t.position="chartArea",super.init(t),this.axis="r"}parse(t,n){return t&&typeof t[this.options.property]=="number"?t[this.options.property]:super.parse(t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(t-this._startValue)/this._valueRange}update(t,n,r){const o=Math.min(n,this.bottom==null?Number.POSITIVE_INFINITY:this.bottom),i=Math.min(t,this.right==null?Number.POSITIVE_INFINITY:this.right),a=this.options.legend,s=this.isHorizontal(),l=(p,b)=>p<1?b*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=uae(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 S7 extends nd{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:kie,interpolateBrBG:qoe,interpolateBuGn:uie,interpolateBuPu:fie,interpolateCividis:Uie,interpolateCool:Yie,interpolateCubehelixDefault:qie,interpolateGnBu:pie,interpolateGreens:Nie,interpolateGreys:Fie,interpolateInferno:nae,interpolateMagma:tae,interpolateOrRd:mie,interpolateOranges:Wie,interpolatePRGn:Yoe,interpolatePiYG:Xoe,interpolatePlasma:rae,interpolatePuBu:xie,interpolatePuBuGn:vie,interpolatePuOr:Joe,interpolatePuRd:_ie,interpolatePurples:zie,interpolateRainbow:Kie,interpolateRdBu:eie,interpolateRdGy:nie,interpolateRdPu:Cie,interpolateRdYlBu:oie,interpolateRdYlGn:aie,interpolateReds:Vie,interpolateSinebow:Jie,interpolateSpectral:lie,interpolateTurbo:Zie,interpolateViridis:eae,interpolateWarm:Gie,interpolateYlGn:$ie,interpolateYlGnBu:Rie,interpolateYlOrBr:Tie,interpolateYlOrRd:Aie};Object.keys(Oa).forEach(e=>{Oa[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=Oa[e],Oa[e.slice(11)]=Oa[e]});function C7(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 E7={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=C7(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({},[td.defaults,Xb,E7]);Vs.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class ZC extends S7{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=C7(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return Vs.prototype._drawIndicator.call(this)}}ZC.id="colorLogarithmic";ZC.defaults=or({},[nd.defaults,Xb,E7]);ZC.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const R7={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};C0(t,p,d,h)})}}Hs.id="size";Hs.defaults=or({},[td.defaults,Xb,R7]);Hs.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class P7 extends S7{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)}}P7.id="sizeLogarithmic";P7.defaults=or({},[nd.defaults,Xb,R7]);function dae(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&&jre(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=dae(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 $7={showOutline:!1,showGraticule:!1,clipMap:!0},O7={scales:{projection:{axis:"x",type:wc.id,position:"chartArea",display:!1}}};function $T(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 T7 extends Qo{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=$T(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=$T(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(zre());else{const a=U3();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 D7(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 xd extends T7{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])}}xd.id="choropleth";xd.defaults=or({},[$7,{datasetElementType:La.id,dataElementType:La.id}]);xd.overrides=or({},[O7,{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 fae extends Dn{constructor(t,n){super(t,D7("choropleth",n,xd,La,[Vs,wc]))}}fae.id=xd.id;class wd extends T7{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]),b={x:p?p[0]:0,y:p?p[1]:0,skip:Number.isNaN(h.x)||Number.isNaN(h.y)};l&&(b.options=s||this.resolveDataElementOptions(u,o),i&&(b.options.radius=0)),this.updateElement(d,u,b,o)}}indexToRadius(t){const n=this.getMeta().rScale;return n.getSizeForValue(this.getParsed(t)[n.axis])}}wd.id="bubbleMap";wd.defaults=or({},[$7,{dataElementType:Yl.id,datasetElementType:La.id,showOutline:!0,clipMap:"outline+graticule"}]);wd.overrides=or({},[O7,{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 hae extends Dn{constructor(t,n){super(t,D7("bubbleMap",n,wd,La,[Hs,wc]))}}hae.id=wd.id;function pae(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 gae(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 mae(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 bae(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 vae(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 yae(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 xae(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 wae(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 eE({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,b,v,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=sae(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],M=(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:M}}),T=Ef([{label:_,data:$,borderColor:"lightgray"}],r),A={type:"choropleth",data:{labels:S.map(z=>z.properties.NAME||z.properties.name),datasets:T},options:C},{options:L}=Lk({cfg:A,preferences:a,customCfg:r});return{...A,options:L}}if(t==="bar"){const _=mae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="horizontalBar"){const _=pae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="pyramid"){const _=gae(n),{dimensionKeys:S,metricKeys:C}=tr(e),E=y0({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}),D="x2";return{...$,data:{...$.data,datasets:$.data.datasets.map((A,L)=>L===1?{...A,xAxisID:D}:A)},options:{...$.options,scales:{...(b=$==null?void 0:$.options)==null?void 0:b.scales,[D]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const _=vae(n,t),{dimensionKeys:S,metricKeys:C}=tr(e),E=y0({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 _=yae(n);return fl({data:e,cfg:_,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:a})}if(t==="range"){const _=bae(n),S=XQ(e),C=Ef(S,r),{plugins:E,options:$}=Mk((a==null?void 0:a.customVisualCode)||""),D=Go((_==null?void 0:_.options)||{},(n==null?void 0:n.options)||{}),T=Go(D,(a==null?void 0:a.chartOptions)||{}),A=Go(T,(r==null?void 0:r.options)||{}),L=Go(A,$),F=Nk(n,a),z=Go(L,F),X={...z,plugins:{...z==null?void 0:z.plugins,datalabels:{...(v=z==null?void 0:z.plugins)==null?void 0:v.datalabels,formatter:(Y,q)=>Y.map(H=>{var K,I,oe,ce;return Na({number:Number(H),decimalPlaces:((K=a==null?void 0:a.numberAxisFormat)==null?void 0:K.decimalPlaces)||0,useSuffix:!!((I=a==null?void 0:a.numberAxisFormat)!=null&&I.suffix),customSuffix:"",locale:((oe=a==null?void 0:a.numberAxisFormat)==null?void 0:oe.locale)||"",currency:((ce=a==null?void 0:a.numberAxisFormat)==null?void 0:ce.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:G}=tr(e),M=G[0];return{type:"bar",data:{labels:[...new Set(jw(e,M))],datasets:C},options:X,plugins:[...E]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const _=xae(t,n),{dimensionKeys:S,metricKeys:C}=tr(e),E=QQ(C,e),$=Ef(E,r),D=S[0],T=jw(e,D),A=Go((_==null?void 0:_.options)||{},(r==null?void 0:r.options)||{}),L=Go(A,(a==null?void 0:a.chartOptions)||{}),F={...L,plugins:{...L.plugins,datalabels:{...(x=L.plugins)==null?void 0:x.datalabels,formatter:(G,M)=>{var U,V,Y,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:((Y=a==null?void 0:a.numberAxisFormat)==null?void 0:Y.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 M=G.dataset.label||"";M&&(M+=": ");const V=G.dataset.data.reduce((O,H)=>O+H,0),q=(G.parsed/V*100).toFixed(2);return M+=q+"%",M+` (${G.formattedValue})`}}}}};return{type:t,data:{labels:T,datasets:$},options:F,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(G,M,U){var ce,de,he,ie;const{ctx:V,data:Y}=G;V.save();const q=G.getDatasetMeta(0).data[0].x,O=G.getDatasetMeta(0).data[0].y,H=Gu(ih()),K=window.getComputedStyle(V.canvas).fontFamily;V.font=`1em ${K}`,V.fontWeight="bolder",V.fillStyle=H,V.textAlign="center",V.textBaseline="middle";const I=Y.datasets[0].data.reduce((ne,le)=>ne+le,0),oe=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(oe,q,O)}}:""]}}if(t==="radar"){const _=wae(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=KQ(e),C=Ef(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}}}},$=Go(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 _ae({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)&&Cae(e,t,o,i,s),["pie","doughnut","polarArea"].includes(r)&&Eae(e,t,o,i,s),["stackedBar","pyramid"].includes(r)&&Sae({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:s})}function Sae(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,b;typeof d.backgroundColor=="string"&&(d.backgroundColor=new Array(d.data.length).fill(d.backgroundColor),d.borderColor=new Array(d.data.length).fill(d.borderColor)),d.backgroundColor=(p=d==null?void 0:d.backgroundColor)==null?void 0:p.map((v,x)=>x===n&&h===r?v:a),d.borderColor=(b=d==null?void 0:d.borderColor)==null?void 0:b.map((v,x)=>x===n&&h===r?v:a)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((d,h)=>{var p,b,v,x,y,_;d.backgroundColor=new Array(d.data.length).fill((v=(b=(p=o==null?void 0:o.data)==null?void 0:p.datasets)==null?void 0:b[h])==null?void 0:v.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 Cae(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,b,v,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=(v=(b=n==null?void 0:n.data)==null?void 0:b.datasets)==null?void 0:v[u])==null?void 0:x.borderColor)}),e==null||e.update()}function Eae(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,b,v,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=(v=(b=n==null?void 0:n.data)==null?void 0:b.datasets)==null?void 0:v[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 Rae({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 b=d[0],v=((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:b,columnValue:v}]}if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const b=h[0],v=(c=t[r])==null?void 0:c[b];return[{columnName:b,columnValue:v,metric:p[n],value:o}]}if(["stackedBar","pyramid"].includes(e.type)){const b=y0({dataArray:t,groupKey:h[0],pivotKey:h[1],valueKey:p[0]}),v=h[0],x=(u=b[r])==null?void 0:u[v],y=h[1],{metricKeys:_}=tr(b),S=_[n];return[{columnName:v,columnValue:x,metric:p[0],value:o},{columnName:y,columnValue:S,metric:p[0],value:o}]}if(e.type==="bubble"||e.type==="scatter"){const b=h[0],v=o.label;return[{columnName:b,columnValue:v,metric1:p[0],value1:o.x,metric2:p[1],value2:o.y,metric3:p==null?void 0:p[2],value3:o==null?void 0:o.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function A7(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}=lp({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 Pae(e){var a,s;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=dr(),r=n(e),o=tE(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 tE(e){var X,G,M,U;const{onChartElementClicked:t}=Mo(),[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=(M=e==null?void 0:e.preferences)==null?void 0:M.onClickFilter,{addFilteringCard:d,getCardFrame:h,addOrUpdateFilterValues:p,removeFilterValue:b,removeFilteringCard:v}=dr(),{data:x,isLoading:y,isFetching:_,isError:S,queryKey:C}=Vb(e),{data:E}=A7(e),$=i==null?void 0:i.find(V=>V.id===e.id),D=h(e.id),T=(D==null?void 0:D.cards)||[],A=(T==null?void 0:T.length)==1;let L;x&&x.records&&((U=x.records)==null?void 0:U.length)>0&&e.type!=="custom"&&(L=eE({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||_||$&&A||o||r(V=>V+1)},[x==null?void 0:x.records,y,_,$,A,o]),m.useEffect(()=>{e.connectionId&&!$&&(c.current=l)},[l,s,e.connectionId,$]),m.useEffect(()=>{var Y;$&&(F.current.filteringCards=[...i||[]]),!$&&((Y=F.current.filteringCards)==null?void 0:Y.find(q=>q.id===e.id))&&A&&r(q=>q+1)},[$,A,e.id,i]);function z(V,Y,q,O){var I;let H=!1;if(!(x!=null&&x.records))return;const K=Rae({card:e,data:x==null?void 0:x.records,datasetIndex:Y,clickIndex:q,value:O});if(console.log("fieldValues",K),t==null||t(e,K),!!(((I=e==null?void 0:e.preferences)==null?void 0:I.onClickFilter)??[]).length){if($){const oe=e.id;b(oe),v(e)}else{if(H=!0,!K)return;const oe=[];K.forEach((ce,de)=>{const he=u==null?void 0:u.find(ne=>ne.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:xb(K[he.columnIndex].columnValue),operation:"=",values:[K[he.columnIndex].columnValue]};oe.push(ie)}),p(oe),d(e)}_ae({chart:V,elementIndex:q,datasetIndex:Y,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 M7(e){const{authToken:t}=Mo(),n=Rq(t==null?void 0:t.accessToken);function r(){var i,a,s,l,c,u;if((a=(i=e.preferences)==null?void 0:i.formatNumber)!=null&&a.currency&&((l=(s=e.preferences)==null?void 0:s.formatNumber)==null?void 0:l.currency)!=="none")return n!=null&&n.currency?n==null?void 0:n.currency:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.currency}function o(){var i,a,s,l,c,u;if((a=(i=e.preferences)==null?void 0:i.formatNumber)!=null&&a.locale&&((l=(s=e.preferences)==null?void 0:s.formatNumber)==null?void 0:l.locale)!=="none")return n!=null&&n.locale?n==null?void 0:n.locale:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.locale}return{getCurrency:r,getLocale:o}}function k7({card:e,data:t}){var _,S,C,E,$,D,T,A,L,F,z,X,G,M,U,V;const n=we(Y=>Y.actions.setCardTitle),r=we(Y=>Y.actions.setCardDescription),o=we(Y=>Y.isVisualEditing),i=Ir(Y=>Y.card),a=Ir(Y=>Y.actions.setCard);Ir(Y=>Y.actions.setNumberFormat);const{getCurrency:s,getLocale:l}=M7(e),c=we(Y=>Y.selectedSheetId),u=(S=(_=e.preferences)==null?void 0:_.formatNumber)==null?void 0:S.colorRanges,{metricKeys:d}=tr(t),h=(C=t==null?void 0:t[0])==null?void 0:C[d==null?void 0:d[0]],p=(E=t==null?void 0:t[0])==null?void 0:E[d==null?void 0:d[1]],b=t&&t.length>0;function v(Y){o?a({...i,title:Y}):n(c,e.id,Y)}function x(Y){o?a({...i,description:Y}):r(c,e.id,Y)}const y=p&&p-h!==0?(h-p)/p:null;return R.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[R.jsxs(wb,{className:"grow pb-3",children:[R.jsx(qi,{text:o?i.title:e.title,onSave:v,children:R.jsx("div",{className:"flex items-center gap-2",children:R.jsx(gd,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),b&&R.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[R.jsx("p",{style:{color:_C(h,u)},className:"text-3xl font-semibold",children:Na({number:h,decimalPlaces:((D=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:D.decimalPlaces)||0,useSuffix:!!((A=(T=e.preferences)==null?void 0:T.formatNumber)!=null&&A.suffix),customSuffix:((F=(L=e.preferences)==null?void 0:L.formatNumber)==null?void 0:F.suffix)||"",locale:l()||"",currency:s()||""})}),p&&R.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",Na({number:p,decimalPlaces:((X=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:X.decimalPlaces)||0,useSuffix:!!((M=(G=e.preferences)==null?void 0:G.formatNumber)!=null&&M.suffix),customSuffix:((V=(U=e.preferences)==null?void 0:U.formatNumber)==null?void 0:V.suffix)||"",locale:l()||"",currency:s()||""})]})]})]}),y&&R.jsxs(_b,{className:"grow items-start gap-1 pb-4 text-sm",children:[R.jsx(I7,{children:y}),R.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[y>0?"up ":"down ",R.jsx(qi,{text:e.description||"",onSave:x,children:e.description})]})]})]})}function I7({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 $ae=["top","right","bottom","left"],Ws=Math.min,_o=Math.max,U0=Math.round,cm=Math.floor,Us=e=>({x:e,y:e}),Oae={left:"right",right:"left",bottom:"top",top:"bottom"},Tae={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 _d(e){return e.split("-")[1]}function nE(e){return e==="x"?"y":"x"}function rE(e){return e==="y"?"height":"width"}function Sd(e){return["top","bottom"].includes(ja(e))?"y":"x"}function oE(e){return nE(Sd(e))}function Dae(e,t,n){n===void 0&&(n=!1);const r=_d(e),o=oE(e),i=rE(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=q0(a)),[a,q0(a)]}function Aae(e){const t=q0(e);return[y_(e),t,y_(t)]}function y_(e){return e.replace(/start|end/g,t=>Tae[t])}function Mae(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 kae(e,t,n,r){const o=_d(e);let i=Mae(ja(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(y_)))),i}function q0(e){return e.replace(/left|right|bottom|top/g,t=>Oae[t])}function Iae(e){return{top:0,right:0,bottom:0,left:0,...e}}function N7(e){return typeof e!="number"?Iae(e):{top:e,right:e,bottom:e,left:e}}function G0(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function OT(e,t,n){let{reference:r,floating:o}=e;const i=Sd(t),a=oE(t),s=rE(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(_d(t)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1);break}return p}const Nae=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}=OT(c,r,l),h=r,p={},b=0;for(let v=0;v<s.length;v++){const{name:x,fn:y}=s[v],{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&&b<=50){b++,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}=OT(c,h,l)),v=-1;continue}}return{x:u,y:d,placement:h,strategy:o,middlewareData:p}};async function vh(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),b=N7(p),x=s[h?d==="floating"?"reference":"floating":d],y=G0(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=G0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(y.top-E.top+b.top)/C.y,bottom:(E.bottom-y.bottom+b.bottom)/C.y,left:(y.left-E.left+b.left)/C.x,right:(E.right-y.right+b.right)/C.x}}const TT=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=N7(u),h={x:n,y:r},p=oE(o),b=rE(p),v=await a.getDimensions(c),x=p==="y",y=x?"top":"left",_=x?"bottom":"right",S=x?"clientHeight":"clientWidth",C=i.reference[b]+i.reference[p]-h[p]-i.floating[b],E=h[p]-i.reference[p],$=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let D=$?$[S]:0;(!D||!await(a.isElement==null?void 0:a.isElement($)))&&(D=s.floating[S]||i.floating[b]);const T=C/2-E/2,A=D/2-v[b]/2-1,L=Ws(d[y],A),F=Ws(d[_],A),z=L,X=D-v[b]-F,G=D/2-v[b]/2+T,M=v_(z,G,X),U=!l.arrow&&_d(o)!=null&&G!=M&&i.reference[b]/2-(G<z?L:F)-v[b]/2<0,V=U?G<z?G-z:G-X:0;return{[p]:h[p]+V,data:{[p]:M,centerOffset:G-M-V,...U&&{alignmentOffset:V}},reset:U}}}),Lae=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:b="none",flipAlignment:v=!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||(_||!v?[q0(s)]:Aae(s));!h&&b!=="none"&&C.push(...kae(s,v,b,S));const E=[s,...C],$=await vh(t,x),D=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&D.push($[y]),d){const z=Dae(o,a,S);D.push($[z[0]],$[z[1]])}if(T=[...T,{placement:o,overflows:D}],!D.every(z=>z<=0)){var A,L;const z=(((A=i.flip)==null?void 0:A.index)||0)+1,X=E[z];if(X)return{data:{index:z,overflows:T},reset:{placement:X}};let G=(L=T.filter(M=>M.overflows[0]<=0).sort((M,U)=>M.overflows[1]-U.overflows[1])[0])==null?void 0:L.placement;if(!G)switch(p){case"bestFit":{var F;const M=(F=T.map(U=>[U.placement,U.overflows.filter(V=>V>0).reduce((V,Y)=>V+Y,0)]).sort((U,V)=>U[1]-V[1])[0])==null?void 0:F[0];M&&(G=M);break}case"initialPlacement":G=s;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function DT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function AT(e){return $ae.some(t=>e[t]>=0)}const Fae=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 vh(t,{...o,elementContext:"reference"}),a=DT(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:AT(a)}}}case"escaped":{const i=await vh(t,{...o,altBoundary:!0}),a=DT(i,n.floating);return{data:{escapedOffsets:a,escaped:AT(a)}}}default:return{}}}}};async function jae(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=_d(n),l=Sd(n)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=Fa(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof b=="number"&&(p=s==="end"?b*-1:b),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}const zae=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 jae(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}}}}},Bae=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 vh(t,l),d=Sd(ja(o)),h=nE(d);let p=c[h],b=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",_=b+u[x],S=b-u[y];b=v_(_,b,S)}const v=s.fn({...t,[h]:p,[d]:b});return{...v,data:{x:v.x-n,y:v.y-r}}}}},Vae=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=Sd(o),h=nE(d);let p=u[h],b=u[d];const v=Fa(s,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};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);b<E?b=E:b>$&&(b=$)}return{[h]:p,[d]:b}}}},Hae=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 vh(t,s),c=ja(n),u=_d(n),d=Sd(n)==="y",{width:h,height:p}=r.floating;let b,v;c==="top"||c==="bottom"?(b=c,v=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(v=c,b=u==="end"?"top":"bottom");const x=p-l[b],y=h-l[v],_=!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),D=_o(l.right,0),T=_o(l.top,0),A=_o(l.bottom,0);d?C=h-2*($!==0||D!==0?$+D:_o(l.left,l.right)):S=p-2*(T!==0||A!==0?T+A:_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 L7(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=(L7(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function L7(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 MT(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ro(e).ShadowRoot}function bp(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Zo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Wae(e){return["table","td","th"].includes(qs(e))}function iE(e){const t=aE(),n=Zo(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 Uae(e){let t=sd(e);for(;Qi(t)&&!Qb(t);){if(iE(t))return t;t=sd(t)}return null}function aE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Qb(e){return["html","body","#document"].includes(qs(e))}function Zo(e){return Ro(e).getComputedStyle(e)}function Jb(e){return za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function sd(e){if(qs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||MT(e)&&e.host||Ha(e);return MT(t)?t.host:t}function F7(e){const t=sd(e);return Qb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qi(t)&&bp(t)?t:F7(t)}function yh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=F7(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Ro(o);return i?t.concat(a,a.visualViewport||[],bp(o)?o:[],a.frameElement&&n?yh(a.frameElement):[]):t.concat(o,yh(o,[],n))}function j7(e){const t=Zo(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=U0(n)!==i||U0(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function sE(e){return za(e)?e:e.contextElement}function Eu(e){const t=sE(e);if(!Qi(t))return Us(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=j7(t);let a=(i?U0(n.width):n.width)/r,s=(i?U0(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const qae=Us(0);function z7(e){const t=Ro(e);return!aE()||!t.visualViewport?qae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gae(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=sE(e);let a=Us(1);t&&(r?za(r)&&(a=Eu(r)):a=Eu(e));const s=Gae(i,n,r)?z7(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 b=h.frameElement;for(;b&&r&&p!==h;){const v=Eu(b),x=b.getBoundingClientRect(),y=Zo(b),_=x.left+(b.clientLeft+parseFloat(y.paddingLeft))*v.x,S=x.top+(b.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=_,c+=S,b=Ro(b).frameElement}}return G0({width:u,height:d,x:l,y:c})}function Yae(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"||bp(i))&&(a=Jb(n)),Qi(n))){const c=uc(n);s=Eu(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 Kae(e){return Array.from(e.getClientRects())}function B7(e){return uc(Ha(e)).left+Jb(e).scrollLeft}function Xae(e){const t=Ha(e),n=Jb(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+B7(e);const s=-n.scrollTop;return Zo(r).direction==="rtl"&&(a+=_o(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function Qae(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=aE();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function Jae(e,t){const n=uc(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Qi(e)?Eu(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 kT(e,t,n){let r;if(t==="viewport")r=Qae(e,n);else if(t==="document")r=Xae(Ha(e));else if(za(t))r=Jae(t,n);else{const o=z7(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return G0(r)}function V7(e,t){const n=sd(e);return n===t||!za(n)||Qb(n)?!1:Zo(n).position==="fixed"||V7(n,t)}function Zae(e,t){const n=t.get(e);if(n)return n;let r=yh(e,[],!1).filter(s=>za(s)&&qs(s)!=="body"),o=null;const i=Zo(e).position==="fixed";let a=i?sd(e):e;for(;za(a)&&!Qb(a);){const s=Zo(a),l=iE(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||bp(a)&&!l&&V7(e,a))?r=r.filter(u=>u!==a):o=s,a=sd(a)}return t.set(e,r),r}function ese(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Zae(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=kT(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},kT(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function tse(e){return j7(e)}function nse(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"||bp(o))&&(s=Jb(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=B7(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function IT(e,t){return!Qi(e)||Zo(e).position==="fixed"?null:t?t(e):e.offsetParent}function H7(e,t){const n=Ro(e);if(!Qi(e))return n;let r=IT(e,t);for(;r&&Wae(r)&&Zo(r).position==="static";)r=IT(r,t);return r&&(qs(r)==="html"||qs(r)==="body"&&Zo(r).position==="static"&&!iE(r))?n:r||Uae(e)||n}const rse=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||H7,i=this.getDimensions;return{reference:nse(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function ose(e){return Zo(e).direction==="rtl"}const ise={convertOffsetParentRelativeRectToViewportRelativeRect:Yae,getDocumentElement:Ha,getClippingRect:ese,getOffsetParent:H7,getElementRects:rse,getClientRects:Kae,getDimensions:tse,getScale:Eu,isElement:za,isRTL:ose};function ase(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=cm(u),b=cm(o.clientWidth-(c+d)),v=cm(o.clientHeight-(u+h)),x=cm(c),_={rootMargin:-p+"px "+-b+"px "+-v+"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 sse(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=sE(e),u=o||i?[...c?yh(c):[],...yh(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=c&&s?ase(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 b,v=l?uc(e):null;l&&x();function x(){const y=uc(e);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&n(),v=y,b=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(b)}}const lse=(e,t,n)=>{const r=new Map,o={platform:ise,...n},i={...o.platform,_c:r};return Nae(e,t,{...o,platform:i})},cse=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?TT({element:r.current,padding:o}).fn(n):{}:r?TT({element:r,padding:o}).fn(n):{}}}};var r0=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Y0(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(!Y0(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)&&!Y0(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function W7(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function NT(e,t){const n=W7(e);return Math.round(t*n)/n}function LT(e){const t=j.useRef(e);return r0(()=>{t.current=e}),t}function use(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);Y0(h,r)||p(r);const[b,v]=j.useState(null),[x,y]=j.useState(null),_=j.useCallback(U=>{U!=$.current&&($.current=U,v(U))},[v]),S=j.useCallback(U=>{U!==D.current&&(D.current=U,y(U))},[y]),C=i||b,E=a||x,$=j.useRef(null),D=j.useRef(null),T=j.useRef(u),A=LT(l),L=LT(o),F=j.useCallback(()=>{if(!$.current||!D.current)return;const U={placement:t,strategy:n,middleware:h};L.current&&(U.platform=L.current),lse($.current,D.current,U).then(V=>{const Y={...V,isPositioned:!0};z.current&&!Y0(T.current,Y)&&(T.current=Y,SS.flushSync(()=>{d(Y)}))})},[h,t,n,L]);r0(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(U=>({...U,isPositioned:!1})))},[c]);const z=j.useRef(!1);r0(()=>(z.current=!0,()=>{z.current=!1}),[]),r0(()=>{if(C&&($.current=C),E&&(D.current=E),C&&E){if(A.current)return A.current(C,E,F);F()}},[C,E,F,A]);const X=j.useMemo(()=>({reference:$,floating:D,setReference:_,setFloating:S}),[_,S]),G=j.useMemo(()=>({reference:C,floating:E}),[C,E]),M=j.useMemo(()=>{const U={position:n,left:0,top:0};if(!G.floating)return U;const V=NT(G.floating,u.x),Y=NT(G.floating,u.y);return s?{...U,transform:"translate("+V+"px, "+Y+"px)",...W7(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:Y}},[n,s,G.floating,u.x,u.y]);return j.useMemo(()=>({...u,update:F,refs:X,elements:G,floatingStyles:M}),[u,F,X,G,M])}function Zb(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 U7="Popper",[q7,oa]=hr(U7),[dse,G7]=q7(U7),fse=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(dse,{scope:t,anchor:r,onAnchorChange:o},n)},hse="PopperAnchor",pse=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=G7(hse,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}))}),Y7="PopperContent",[gse,o5e]=q7(Y7),mse=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:b=0,arrowPadding:v=0,avoidCollisions:x=!0,collisionBoundary:y=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:$,...D}=e,T=G7(Y7,u),[A,L]=m.useState(null),F=Rt(t,Oe=>L(Oe)),[z,X]=m.useState(null),G=Zb(z),M=(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:""),Y=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},q=Array.isArray(y)?y:[y],O=q.length>0,H={padding:Y,boundary:q.filter(bse),altBoundary:O},{refs:K,floatingStyles:I,placement:oe,isPositioned:ce,middlewareData:de}=use({strategy:"fixed",placement:V,whileElementsMounted:(...Oe)=>sse(...Oe,{animationFrame:E==="always"}),elements:{reference:T.anchor},middleware:[zae({mainAxis:h+U,alignmentAxis:b}),x&&Bae({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?Vae():void 0,...H}),x&&Lae({...H}),Hae({...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&&cse({element:z,padding:v}),vse({arrowWidth:M,arrowHeight:U}),C&&Fae({strategy:"referenceHidden",...H})]}),[he,ie]=K7(oe),ne=Xn($);Cr(()=>{ce&&(ne==null||ne())},[ce,ne]);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(()=>{A&&Ce(window.getComputedStyle(A).zIndex)},[A]),m.createElement("div",{ref:K.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(gse,{scope:u,placedSide:he,onArrowChange:X,arrowX:le,arrowY:xe,shouldHideArrow:Z},m.createElement(Qe.div,ue({"data-side":he,"data-align":ie},D,{ref:F,style:{...D.style,animation:ce?void 0:"none",opacity:(c=de.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function bse(e){return e!==null}const vse=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,[b,v]=K7(s),x={start:"0%",center:"50%",end:"100%"}[v],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 b==="bottom"?(S=d?x:`${y}px`,C=`${-p}px`):b==="top"?(S=d?x:`${y}px`,C=`${l.floating.height+p}px`):b==="right"?(S=`${-p}px`,C=d?x:`${_}px`):b==="left"&&(S=`${l.floating.width+p}px`,C=d?x:`${_}px`),{data:{x:S,y:C}}}});function K7(e){const[t,n="center"]=e.split("-");return[t,n]}const vp=fse,yp=pse,xp=mse,lE=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 yse(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",xse="dismissableLayer.pointerDownOutside",wse="dismissableLayer.focusOutside";let FT;const _se=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wp=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(_se),[d,h]=m.useState(null),p=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=m.useState({}),v=Rt(t,T=>h(T)),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>=_,$=Sse(T=>{const A=T.target,L=[...u.branches].some(F=>F.contains(A));!E||L||(i==null||i(T),s==null||s(T),T.defaultPrevented||l==null||l())},p),D=Cse(T=>{const A=T.target;[...u.branches].some(F=>F.contains(A))||(a==null||a(T),s==null||s(T),T.defaultPrevented||l==null||l())},p);return yse(T=>{S===u.layers.size-1&&(o==null||o(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},p),m.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(FT=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),jT(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=FT)}},[d,p,r,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),jT())},[d,u]),m.useEffect(()=>{const T=()=>b({});return document.addEventListener(x_,T),()=>document.removeEventListener(x_,T)},[]),m.createElement(Qe.div,ue({},c,{ref:v,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,D.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,$.onPointerDownCapture)}))});function Sse(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(){X7(xse,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 Cse(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&&X7(wse,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 jT(){const e=new CustomEvent(x_);document.dispatchEvent(e)}function X7(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?g6(o,i):o.dispatchEvent(i)}let N1;const Q7="HoverCard",[J7,i5e]=hr(Q7,[oa]),cE=oa(),[Ese,uE]=J7(Q7),Rse=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:a=700,closeDelay:s=300}=e,l=cE(t),c=m.useRef(0),u=m.useRef(0),d=m.useRef(!1),h=m.useRef(!1),[p=!1,b]=Fr({prop:r,defaultProp:o,onChange:i}),v=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>b(!0),a)},[a,b]),x=m.useCallback(()=>{clearTimeout(c.current),!d.current&&!h.current&&(u.current=window.setTimeout(()=>b(!1),s))},[s,b]),y=m.useCallback(()=>b(!1),[b]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(Ese,{scope:t,open:p,onOpenChange:b,onOpen:v,onClose:x,onDismiss:y,hasSelectionRef:d,isPointerDownOnContentRef:h},m.createElement(vp,l,n))},Pse="HoverCardTrigger",$se=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=uE(Pse,n),i=cE(n);return m.createElement(yp,ue({asChild:!0},i),m.createElement(Qe.a,ue({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:ke(e.onPointerEnter,K0(o.onOpen)),onPointerLeave:ke(e.onPointerLeave,K0(o.onClose)),onFocus:ke(e.onFocus,o.onOpen),onBlur:ke(e.onBlur,o.onClose),onTouchStart:ke(e.onTouchStart,a=>a.preventDefault())})))}),Ose="HoverCardPortal",[a5e,Tse]=J7(Ose,{forceMount:void 0}),w_="HoverCardContent",Dse=m.forwardRef((e,t)=>{const n=Tse(w_,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=uE(w_,e.__scopeHoverCard);return m.createElement(pr,{present:r||i.open},m.createElement(Ase,ue({"data-state":i.open?"open":"closed"},o,{onPointerEnter:ke(e.onPointerEnter,K0(i.onOpen)),onPointerLeave:ke(e.onPointerLeave,K0(i.onClose)),ref:t})))}),Ase=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,...s}=e,l=uE(w_,n),c=cE(n),u=m.useRef(null),d=Rt(t,u),[h,p]=m.useState(!1);return m.useEffect(()=>{if(h){const b=document.body;return N1=b.style.userSelect||b.style.webkitUserSelect,b.style.userSelect="none",b.style.webkitUserSelect="none",()=>{b.style.userSelect=N1,b.style.webkitUserSelect=N1}}},[h]),m.useEffect(()=>{if(u.current){const b=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())===null||v===void 0?void 0:v.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",b),()=>{document.removeEventListener("pointerup",b),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{u.current&&Mse(u.current).forEach(v=>v.setAttribute("tabindex","-1"))}),m.createElement(wp,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:ke(i,b=>{b.preventDefault()}),onDismiss:l.onDismiss},m.createElement(xp,ue({},c,s,{onPointerDown:ke(s.onPointerDown,b=>{b.currentTarget.contains(b.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 K0(e){return t=>t.pointerType==="touch"?void 0:e()}function Mse(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 kse=Rse,Ise=$se,Z7=Dse,ev=kse,tv=Ise,_p=j.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>R.jsx(Z7,{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}));_p.displayName=Z7.displayName;function eI({card:e}){const{setCardInfo:t}=dr();return R.jsxs(ev,{openDelay:0,children:[R.jsx(tv,{children:R.jsx(Rk,{className:"size-4 text-muted-foreground/40"})}),R.jsx(_p,{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 Nse({card:e,renderFilterInfo:t}){var b,v,x,y,_,S,C,E,$,D,T,A,L,F,z,X;we(G=>G.themeStyle);const{data:n,isLoading:r}=Vb(e),o=(n==null?void 0:n.records)||[],i=we(G=>G.isDashboardEditing),{getCurrency:a,getLocale:s}=M7(e),l=(v=(b=e.preferences)==null?void 0:b.formatNumber)==null?void 0:v.colorRanges,{metricKeys:c}=tr(o||[]),u=(x=o==null?void 0:o[0])==null?void 0:x[c==null?void 0:c[0]],d=(y=o==null?void 0:o[0])==null?void 0:y[c==null?void 0:c[1]],h=(o==null?void 0:o.length)>0,p=d&&d-u!==0?(u-d)/d:null;return R.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:R.jsxs("div",{className:"grow",children:[h?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:_C(u,l)},className:"text-3xl font-semibold",children:Na({number:u,decimalPlaces:((S=(_=e.preferences)==null?void 0:_.formatNumber)==null?void 0:S.decimalPlaces)||0,useSuffix:!!((E=(C=e.preferences)==null?void 0:C.formatNumber)!=null&&E.suffix),customSuffix:((D=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:D.suffix)||"",locale:s()||"",currency:a()||""})}),p&&R.jsxs("div",{className:"flex items-end gap-1",children:[R.jsx(I7,{className:"",children:p}),d&&R.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${Na({number:d,decimalPlaces:((A=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:A.decimalPlaces)||0,useSuffix:!!((F=(L=e.preferences)==null?void 0:L.formatNumber)!=null&&F.suffix),customSuffix:((X=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:X.suffix)||"",locale:s()||"",currency:a()||""})}`})]})]})}):R.jsx("div",{className:"flex h-9 items-center justify-center"}),R.jsxs("div",{className:"flex items-center gap-3",children:[R.jsxs(gd,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(i||e.info)&&R.jsx(eI,{card:e})]}),t==null?void 0:t()]})]})})}const Lse=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Fse);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)});Lse.displayName="Slot";const __=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...jse(r,n.props),ref:t?Ba(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});__.displayName="SlotClone";const tI=({children:e})=>m.createElement(m.Fragment,null,e);function Fse(e){return m.isValidElement(e)&&e.type===tI}function jse(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 nI=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}}))),zse=nI,[nv,s5e]=hr("Tooltip",[oa]),dE=oa(),Bse="TooltipProvider",Vse=700,S_="tooltip.open",[Hse,fE]=nv(Bse),Wse=e=>{const{__scopeTooltip:t,delayDuration:n=Vse,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(Hse,{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)},hE="Tooltip",[Use,rv]=nv(hE),qse=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=fE(hE,e.__scopeTooltip),c=dE(t),[u,d]=m.useState(null),h=xi(),p=m.useRef(0),b=a??l.disableHoverableContent,v=s??l.delayDuration,x=m.useRef(!1),[y=!1,_]=Fr({prop:r,defaultProp:o,onChange:D=>{D?(l.onOpen(),document.dispatchEvent(new CustomEvent(S_))):l.onClose(),i==null||i(D)}}),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)},v)},[v,_]);return m.useEffect(()=>()=>window.clearTimeout(p.current),[]),m.createElement(vp,c,m.createElement(Use,{scope:t,contentId:h,open:y,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?$():C()},[l.isOpenDelayed,$,C]),onTriggerLeave:m.useCallback(()=>{b?E():window.clearTimeout(p.current)},[E,b]),onOpen:C,onClose:E,disableHoverableContent:b},n))},zT="TooltipTrigger",rI=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=rv(zT,n),i=fE(zT,n),a=dE(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(yp,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)})))}),Gse="TooltipPortal",[l5e,Yse]=nv(Gse,{forceMount:void 0}),xh="TooltipContent",Kse=m.forwardRef((e,t)=>{const n=Yse(xh,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=rv(xh,e.__scopeTooltip);return m.createElement(pr,{present:r||a.open},a.disableHoverableContent?m.createElement(oI,ue({side:o},i,{ref:t})):m.createElement(Xse,ue({side:o},i,{ref:t})))}),Xse=m.forwardRef((e,t)=>{const n=rv(xh,e.__scopeTooltip),r=fE(xh,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((b,v)=>{const x=b.currentTarget,y={x:b.clientX,y:b.clientY},_=Jse(y,x.getBoundingClientRect()),S=Zse(y,_),C=ele(v.getBoundingClientRect()),E=nle([...S,...C]);s(E),d(!0)},[d]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(l&&u){const b=x=>p(x,u),v=x=>p(x,l);return l.addEventListener("pointerleave",b),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",v)}}},[l,u,p,h]),m.useEffect(()=>{if(a){const b=v=>{const x=v.target,y={x:v.clientX,y:v.clientY},_=(l==null?void 0:l.contains(x))||(u==null?void 0:u.contains(x)),S=!tle(y,a);_?h():S&&(h(),c())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,u,a,c,h]),m.createElement(oI,ue({},e,{ref:i}))}),[Qse,c5e]=nv(hE,{isInside:!1}),oI=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=rv(xh,n),c=dE(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(wp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u},m.createElement(xp,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(tI,null,r),m.createElement(Qse,{scope:n,isInside:!0},m.createElement(zse,{id:l.contentId,role:"tooltip"},o||r))))});function Jse(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 Zse(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 ele(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 tle(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 nle(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),rle(t)}function rle(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 ole=Wse,ile=qse,ale=rI,iI=Kse,sle=ole,aI=ile,sI=ale,pE=j.forwardRef(({className:e,sideOffset:t=4,...n},r)=>R.jsx(iI,{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}));pE.displayName=iI.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:lI,setPrototypeOf:BT,isFrozen:lle,getPrototypeOf:cle,getOwnPropertyDescriptor:ule}=Object;let{freeze:zr,seal:ei,create:cI}=Object,{apply:C_,construct:E_}=typeof Reflect<"u"&&Reflect;zr||(zr=function(t){return t});ei||(ei=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 um=To(Array.prototype.forEach),VT=To(Array.prototype.pop),of=To(Array.prototype.push),o0=To(String.prototype.toLowerCase),L1=To(String.prototype.toString),HT=To(String.prototype.match),af=To(String.prototype.replace),dle=To(String.prototype.indexOf),fle=To(String.prototype.trim),di=To(Object.prototype.hasOwnProperty),Tr=To(RegExp.prototype.test),sf=hle(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 hle(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]:o0;BT&&BT(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(lle(t)||(t[r]=i),o=i)}e[o]=!0}return e}function ple(e){for(let t=0;t<e.length;t++)di(e,t)||(e[t]=null);return e}function wl(e){const t=cI(null);for(const[n,r]of lI(e))di(e,n)&&(Array.isArray(r)?t[n]=ple(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=wl(r):t[n]=r);return t}function lf(e,t){for(;e!==null;){const r=ule(e,t);if(r){if(r.get)return To(r.get);if(typeof r.value=="function")return To(r.value)}e=cle(e)}function n(){return null}return n}const WT=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"]),gle=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"]),mle=zr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),UT=zr(["#text"]),qT=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"]),GT=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"]),dm=zr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ble=ei(/\{\{[\w\W]*|[\w\W]*\}\}/gm),vle=ei(/<%[\w\W]*|[\w\W]*%>/gm),yle=ei(/\${[\w\W]*}/gm),xle=ei(/^data-[\-\w.\u00B7-\uFFFF]/),wle=ei(/^aria-[\-\w]+$/),uI=ei(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_le=ei(/^(?:\w+script|data):/i),Sle=ei(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dI=ei(/^html$/i),Cle=ei(/^[a-z][.\w]*(-[.\w]+)+$/i);var YT=Object.freeze({__proto__:null,MUSTACHE_EXPR:ble,ERB_EXPR:vle,TMPLIT_EXPR:yle,DATA_ATTR:xle,ARIA_ATTR:wle,IS_ALLOWED_URI:uI,IS_SCRIPT_OR_DATA:_le,ATTR_WHITESPACE:Sle,DOCTYPE_NAME:dI,CUSTOM_ELEMENT:Cle});const cf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ele=function(){return typeof window>"u"?null:window},Rle=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 fI(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ele();const t=Ae=>fI(Ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==cf.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,b=l.prototype,v=lf(b,"cloneNode"),x=lf(b,"remove"),y=lf(b,"nextSibling"),_=lf(b,"childNodes"),S=lf(b,"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:D,createDocumentFragment:T,getElementsByTagName:A}=n,{importNode:L}=r;let F={};t.isSupported=typeof lI=="function"&&typeof S=="function"&&$&&$.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:X,TMPLIT_EXPR:G,DATA_ATTR:M,ARIA_ATTR:U,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:q}=YT;let{IS_ALLOWED_URI:O}=YT,H=null;const K=Mt({},[...WT,...F1,...j1,...z1,...UT]);let I=null;const oe=Mt({},[...qT,...B1,...GT,...dm]);let ce=Object.seal(cI(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,ne=!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 ri=n.createElement("form"),Ya=function(J){return J instanceof RegExp||J instanceof Function},oi=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:o0,H=di(J,"ALLOWED_TAGS")?Mt({},J.ALLOWED_TAGS,_t):K,I=di(J,"ALLOWED_ATTR")?Mt({},J.ALLOWED_ATTR,_t):oe,$n=di(J,"ALLOWED_NAMESPACES")?Mt({},J.ALLOWED_NAMESPACES,L1):rt,Jt=di(J,"ADD_URI_SAFE_ATTR")?Mt(wl(ln),J.ADD_URI_SAFE_ATTR,_t):ln,Ge=di(J,"ADD_DATA_URI_TAGS")?Mt(wl(Ze),J.ADD_DATA_URI_TAGS,_t):Ze,Re=di(J,"FORBID_CONTENTS")?Mt({},J.FORBID_CONTENTS,_t):Le,de=di(J,"FORBID_TAGS")?Mt({},J.FORBID_TAGS,_t):{},he=di(J,"FORBID_ATTR")?Mt({},J.FORBID_ATTR,_t):{},pe=di(J,"USE_PROFILES")?J.USE_PROFILES:!1,ie=J.ALLOW_ARIA_ATTR!==!1,ne=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||uI,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&&(ne=!1),Be&&(We=!0),pe&&(H=Mt({},UT),I=[],pe.html===!0&&(Mt(H,WT),Mt(I,qT)),pe.svg===!0&&(Mt(H,F1),Mt(I,B1),Mt(I,dm)),pe.svgFilters===!0&&(Mt(H,j1),Mt(I,B1),Mt(I,dm)),pe.mathMl===!0&&(Mt(H,z1),Mt(I,GT),Mt(I,dm))),J.ADD_TAGS&&(H===K&&(H=wl(H)),Mt(H,J.ADD_TAGS,_t)),J.ADD_ATTR&&(I===oe&&(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 sf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof J.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw sf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=J.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=Rle(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,...gle]),Ei=Mt({},[...z1,...mle]),la=function(J){let me=S(J);(!me||!me.tagName)&&(me={namespaceURI:Wt,tagName:"template"});const Me=o0(J.tagName),lt=o0(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){of(t.removed,{element:J});try{S(J).removeChild(J)}catch{x(J)}},Ri=function(J,me){try{of(t.removed,{attribute:me.getAttributeNode(J),from:me})}catch{of(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=HT(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?A.call(me,Ce?"html":"body")[0]:Ce?me.documentElement:Rn},Qa=function(J){return D.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")},te=function(J){return typeof s=="function"&&J instanceof s},fe=function(J,me,Me){F[J]&&um(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()&&!te(J.firstElementChild)&&Tr(/<[/\w]/g,J.innerHTML)&&Tr(/<[/\w]/g,J.textContent)||J.nodeType===cf.progressingInstruction||ve&&J.nodeType===cf.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 Io=v(Rn[gr],!0);Io.__removalCount=(J.__removalCount||0)+1,lt.insertBefore(Io,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===cf.text&&(me=J.textContent,um([z,X,G],lt=>{me=af(me,lt," ")}),J.textContent!==me&&(of(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 ri))return!1;if(!(ne&&!he[me]&&Tr(M,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,af(Me,Y,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&J!=="script"&&dle(Me,"data:")===0&&Ge[J])){if(!(le&&!Tr(V,af(Me,Y,"")))){if(Me)return!1}}}}}}return!0},qe=function(J){return J!=="annotation-xml"&&HT(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:Io}=Rn,el=_t(pt);let Zn=pt==="value"?Io:fle(Io);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&&um([z,X,G],Dd=>{Zn=af(Zn,Dd," ")});const Td=_t(J.nodeName);if(Ve(Td,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(Td,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):VT(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"&&!te(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw sf("dirty is not a string, aborting")}else throw sf("toString is not a function");if(!t.isSupported)return Ae;if(Oe||oi(J),t.removed=[],typeof Ae=="string"&&(Qt=!1),Qt){if(Ae.nodeName){const Io=_t(Ae.nodeName);if(!H[Io]||de[Io])throw sf("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===cf.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=T.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(dI,me.ownerDocument.doctype.name)&&(gr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
253
- `+gr),Z&&um([z,X,G],Io=>{gr=af(gr,Io," ")}),C&&Ie?C.createHTML(gr):gr},t.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};oi(Ae),Oe=!0},t.clearConfig=function(){zn=null,Oe=!1},t.isValidAttribute=function(Ae,J,me){zn||oi({});const Me=_t(Ae),lt=_t(J);return Ve(Me,lt,me)},t.addHook=function(Ae,J){typeof J=="function"&&(F[Ae]=F[Ae]||[],of(F[Ae],J))},t.removeHook=function(Ae){if(F[Ae])return VT(F[Ae])},t.removeHooks=function(Ae){F[Ae]&&(F[Ae]=[])},t.removeAllHooks=function(){F={}},t}var KT=fI();function R_({card:e,isLoading:t,data:n}){var h,p;const r=n||[],{keys:o}=tr(r),i=we(b=>b.selectedSheetId),a=we(b=>b.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}=Fb();function u(){var y;if(t)return R.jsxs("div",{className:"space-y-2",children:[R.jsx(xu,{className:"h-3 w-full animate-pulse bg-muted"}),R.jsx(xu,{className:"h-3 w-3/4 animate-pulse bg-muted"}),R.jsx(xu,{className:"h-3 w-1/2 animate-pulse bg-muted"})]});const b=(y=r==null?void 0:r[0])==null?void 0:y[o[0]],v=KT.sanitize(b),x=R.jsx("div",{dangerouslySetInnerHTML:{__html:v}});return R.jsx("div",{className:"text-sm hover:cursor-text",onMouseDown:_=>_.stopPropagation(),children:x})}function d(){return R.jsx("div",{onMouseDown:b=>b.stopPropagation(),children:R.jsx(qi,{type:"textarea",className:"w-full",text:(e==null?void 0:e.description)||"Double click to add description",onSave:b=>{a===!1&&l(i,e.id,b),a===!0&&c({...e,description:b})},children:R.jsx("div",{dangerouslySetInnerHTML:{__html:KT.sanitize((e==null?void 0:e.description)||"")}})})})}return R.jsxs(R.Fragment,{children:[!s&&d(),s===!0&&u()]})}function Ple(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function $le(...e){return t=>e.forEach(n=>Ple(n,t))}var ov=j.forwardRef((e,t)=>{const{children:n,...r}=e,o=j.Children.toArray(n),i=o.find(Ole);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(P_,{...r,ref:t,children:j.isValidElement(a)?j.cloneElement(a,void 0,s):null})}return R.jsx(P_,{...r,ref:t,children:n})});ov.displayName="Slot";var P_=j.forwardRef((e,t)=>{const{children:n,...r}=e;if(j.isValidElement(n)){const o=Dle(n);return j.cloneElement(n,{...Tle(r,n.props),ref:t?$le(t,o):o})}return j.Children.count(n)>1?j.Children.only(null):null});P_.displayName="SlotClone";var hI=({children:e})=>R.jsx(R.Fragment,{children:e});function Ole(e){return j.isValidElement(e)&&e.type===hI}function Tle(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 Dle(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 XT=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,QT=l0,gE=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return QT(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=XT(u)||XT(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(b=>{let[v,x]=b;return Array.isArray(x)?x.includes({...i,...s}[v]):{...i,...s}[v]===x})?[...c,d,h]:c},[]);return QT(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},wh=gE("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?ov:"button";return R.jsx(a,{className:ye(wh({variant:t,size:n,className:e})),ref:i,...o})});no.displayName="Button";const $_="horizontal",Ale=["horizontal","vertical"],pI=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=$_,...o}=e,i=gI(r)?r:$_,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}))});pI.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!gI(r)?new Error(Mle(o,n)):null}};function Mle(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
254
- - horizontal
255
- - vertical
256
-
257
- Defaulting to \`${$_}\`.`}function gI(e){return Ale.includes(e)}const mI=pI,Sp=j.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>R.jsx(mI,{ref:o,decorative:n,orientation:t,className:ye("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Sp.displayName=mI.displayName;function kle(){var v,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 b(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(bd,{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(ev,{openDelay:100,children:[R.jsx(tv,{children:R.jsx(Ck,{className:"z-100 size-3.5 text-muted-foreground/40"})}),R.jsxs(_p,{style:{borderRadius:(x=(v=e==null?void 0:e.chart)==null?void 0:v.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(vC,{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:[b(y),R.jsx(Sp,{className:"my-2"})]},y.name))})]})]})}const mE=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})}));mE.displayName="Table";const bE=j.forwardRef(({className:e,...t},n)=>R.jsx("thead",{ref:n,className:ye("[&_tr]:border-b",e),...t}));bE.displayName="TableHeader";const vE=j.forwardRef(({className:e,...t},n)=>R.jsx("tbody",{ref:n,className:ye("[&_tr:last-child]:border-0",e),...t}));vE.displayName="TableBody";const Ile=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}));Ile.displayName="TableFooter";const Kf=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}));Kf.displayName="TableRow";const yE=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}));yE.displayName="TableHead";const xE=j.forwardRef(({className:e,...t},n)=>R.jsx("td",{ref:n,className:ye("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));xE.displayName="TableCell";const Nle=j.forwardRef(({className:e,...t},n)=>R.jsx("caption",{ref:n,className:ye("mt-4 text-sm text-muted-foreground",e),...t}));Nle.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 X0(e){return e instanceof Function}function Lle(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Fle(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,b)=>{for(p=String(p);p.length<b;)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 jle(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 v of l.split(".")){var b;p=(b=p)==null?void 0:b[v],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${v}" 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 b=d.columns.flatMap(v=>v.getLeafColumns());return h(b)}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 JT(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 zle={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 fm(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))),fm(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 fm(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 fm(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 fm(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(b=>b.getIsVisible()).forEach(b=>{var v;(v=b.columns)!=null&&v.length&&s(b.columns,p+1)},0)};s(e);let l=[];const c=(h,p)=>{const b={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},v=[];h.forEach(x=>{const y=[...v].reverse()[0],_=x.column.depth===b.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=JT(n,S,{id:[r,p,S.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${v.filter($=>$.column===S).length}`:void 0,depth:p,index:v.length});E.subHeaders.push(x),v.push(E)}b.headers.push(x),x.headerGroup=b}),l.push(b),p>0&&c(v,p-1)},u=t.map((h,p)=>JT(n,h,{depth:a,index:p}));c(u,a-1),l.reverse();const d=h=>h.filter(b=>b.column.getIsVisible()).map(b=>{let v=0,x=0,y=[0];b.subHeaders&&b.subHeaders.length?(y=[],d(b.subHeaders).forEach(S=>{let{colSpan:C,rowSpan:E}=S;v+=C,y.push(E)})):v=1;const _=Math.min(...y);return x=x+_,b.colSpan=v,b.rowSpan=x,{colSpan:v,rowSpan:x}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const hm={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},V1=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Ble={getDefaultColumnDef:()=>hm,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:hm.minSize,(r=i??e.columnDef.size)!=null?r:hm.size),(o=e.columnDef.maxSize)!=null?o:hm.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,D=(_-((C=S==null?void 0:S.startOffset)!=null?C:0))*$,T=Math.max(D/((E=S==null?void 0:S.startSize)!=null?E:0),-.999999);return S.columnSizingStart.forEach(A=>{let[L,F]=A;c[L]=Math.round(Math.max(F+F*T,0)*100)/100}),{...S,deltaOffset:D,deltaPercentage:T}}),(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,b={moveHandler:y=>d(y.clientX),upHandler:y=>{p==null||p.removeEventListener("mousemove",b.moveHandler),p==null||p.removeEventListener("mouseup",b.upHandler),h(y.clientX)}},v={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),d(y.touches[0].clientX),!1),upHandler:y=>{var _;p==null||p.removeEventListener("touchmove",v.moveHandler),p==null||p.removeEventListener("touchend",v.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),h((_=y.touches[0])==null?void 0:_.clientX)}},x=Vle()?{passive:!1}:!1;H1(i)?(p==null||p.addEventListener("touchmove",v.moveHandler,x),p==null||p.addEventListener("touchend",v.upHandler,x)):(p==null||p.addEventListener("mousemove",b.moveHandler,x),p==null||p.addEventListener("mouseup",b.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 pm=null;function Vle(){if(typeof pm=="boolean")return pm;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 pm=e,pm}function H1(e){return e.type==="touchstart"}const Hle={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()}}}},bI=(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))};bI.autoRemove=e=>vi(e);const vI=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};vI.autoRemove=e=>vi(e);const yI=(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())};yI.autoRemove=e=>vi(e);const xI=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};xI.autoRemove=e=>vi(e)||!(e!=null&&e.length);const wI=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});wI.autoRemove=e=>vi(e)||!(e!=null&&e.length);const _I=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});_I.autoRemove=e=>vi(e)||!(e!=null&&e.length);const SI=(e,t,n)=>e.getValue(t)===n;SI.autoRemove=e=>vi(e);const CI=(e,t,n)=>e.getValue(t)==n;CI.autoRemove=e=>vi(e);const wE=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};wE.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]};wE.autoRemove=e=>vi(e)||vi(e[0])&&vi(e[1]);const ya={includesString:bI,includesStringSensitive:vI,equalsString:yI,arrIncludes:xI,arrIncludesAll:wI,arrIncludesSome:_I,equals:SI,weakEquals:CI,inNumberRange:wE};function vi(e){return e==null||e===""}const Wle={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 X0(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(ZT(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 X0(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(ZT(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 ZT(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Ule=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),qle=(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},Gle=(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},Yle=(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]},Kle=(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},Xle=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Lle(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},Qle=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Jle=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Zle=(e,t)=>t.length,W1={sum:Ule,min:qle,max:Gle,extent:Yle,mean:Kle,median:Xle,unique:Qle,uniqueCount:Jle,count:Zle},ece={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 X0(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 tce(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 nce={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 tce(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},O_=0,T_=10,U1=()=>({pageIndex:O_,pageSize:T_}),rce={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?O_:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:O_)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?T_:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:T_)},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:[]}),oce={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(v=>!(s!=null&&s.has(v))),bottom:[...((h=l==null?void 0:l.bottom)!=null?h:[]).filter(v=>!(s!=null&&s.has(v))),...Array.from(s)]}}if(n==="top"){var p,b;return{top:[...((p=l==null?void 0:l.top)!=null?p:[]).filter(v=>!(s!=null&&s.has(v))),...Array.from(s)],bottom:((b=l==null?void 0:l.bottom)!=null?b:[]).filter(v=>!(s!=null&&s.has(v)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(v=>!(s!=null&&s.has(v))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(v=>!(s!=null&&s.has(v)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(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}})}},ice={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=>{D_(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 D_(s,e.id,n,(a=r==null?void 0:r.selectChildren)!=null?a:!0,t),s})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return _E(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return A_(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return A_(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)}}}},D_=(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=>D_(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=_E(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 _E(e,t){var n;return(n=t[e.id])!=null?n:!1}function A_(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()&&(_E(a,t)?i=!0:o=!1),a.subRows&&a.subRows.length)){const s=A_(a,t);s==="all"?i=!0:(s==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const M_=/([0-9]+)/gm,ace=(e,t,n)=>EI(Gs(e.getValue(n)).toLowerCase(),Gs(t.getValue(n)).toLowerCase()),sce=(e,t,n)=>EI(Gs(e.getValue(n)),Gs(t.getValue(n))),lce=(e,t,n)=>SE(Gs(e.getValue(n)).toLowerCase(),Gs(t.getValue(n)).toLowerCase()),cce=(e,t,n)=>SE(Gs(e.getValue(n)),Gs(t.getValue(n))),uce=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},dce=(e,t,n)=>SE(e.getValue(n),t.getValue(n));function SE(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 EI(e,t){const n=e.split(M_).filter(Boolean),r=t.split(M_).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 uf={alphanumeric:ace,alphanumericCaseSensitive:sce,text:lce,textCaseSensitive:cce,datetime:uce,basic:dce},fce={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 uf.datetime;if(typeof i=="string"&&(r=!0,i.split(M_).length>1))return uf.alphanumeric}return r?uf.text:uf.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 X0(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:uf[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())}},hce={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)}}},eD=[zle,hce,nce,oce,Wle,fce,ece,Hle,rce,ice,Ble];function pce(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:eD};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:eD,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,b;return(p=(b=h.renderValue())==null||b.toString==null?void 0:b.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,b){return b===void 0&&(b=0),h.map(v=>{const x=jle(n,v,b,p),y=v;return x.columns=y.columns?d(y.columns,x,b+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 gce(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 mce=(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:()=>Fle(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=>gce(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 RI(){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=mce(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 PI(){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 b=i[p],v=a[b.id],x=(h=b==null?void 0:b.desc)!=null?h:!1;let y=0;if(v.sortUndefined){const _=u.getValue(b.id),S=d.getValue(b.id),C=_===void 0,E=S===void 0;(C||E)&&(y=C&&E?0:C?v.sortUndefined:-v.sortUndefined)}if(y===0&&(y=v.sortingFn(u,d,b.id)),y!==0)return x&&(y*=-1),v.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 bce(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 $I(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=bce({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 k_(e,t){return e?vce(e)?j.createElement(e,t):e:null}function vce(e){return yce(e)||typeof e=="function"||xce(e)}function yce(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function xce(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function OI(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=j.useState(()=>({current:pce(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}function I_(e,[t,n]){return Math.min(n,Math.max(t,e))}let K1=0;function CE(){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:tD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:tD()),K1++,()=>{K1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),K1--}},[])}function tD(){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",nD={bubbles:!1,cancelable:!0},EE=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,v=>l(v)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=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",v),document.addEventListener("focusout",x);const _=new MutationObserver(y);return s&&_.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),_.disconnect()}}},[r,s,p.paused]),m.useEffect(()=>{if(s){oD.add(p);const v=document.activeElement;if(!s.contains(v)){const y=new CustomEvent(X1,nD);s.addEventListener(X1,c),s.dispatchEvent(y),y.defaultPrevented||(wce(Rce(TI(s)),{select:!0}),document.activeElement===v&&ms(s))}return()=>{s.removeEventListener(X1,c),setTimeout(()=>{const y=new CustomEvent(Q1,nD);s.addEventListener(Q1,u),s.dispatchEvent(y),y.defaultPrevented||ms(v??document.body,{select:!0}),s.removeEventListener(Q1,u),oD.remove(p)},0)}}},[s,c,u,p]);const b=m.useCallback(v=>{if(!n&&!r||p.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(x&&y){const _=v.currentTarget,[S,C]=_ce(_);S&&C?!v.shiftKey&&y===C?(v.preventDefault(),n&&ms(S,{select:!0})):v.shiftKey&&y===S&&(v.preventDefault(),n&&ms(C,{select:!0})):y===_&&v.preventDefault()}},[n,r,p.paused]);return m.createElement(Qe.div,ue({tabIndex:-1},a,{ref:h,onKeyDown:b}))});function wce(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ms(r,{select:t}),document.activeElement!==n)return}function _ce(e){const t=TI(e),n=rD(t,e),r=rD(t.reverse(),e);return[n,r]}function TI(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 rD(e,t){for(const n of e)if(!Sce(n,{upTo:t}))return n}function Sce(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 Cce(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&&Cce(e)&&t&&e.select()}}const oD=Ece();function Ece(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=iD(e,t),e.unshift(t)},remove(t){var n;e=iD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function iD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Rce(e){return e.filter(t=>t.tagName!=="A")}const DI=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find($ce);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)});DI.displayName="Slot";const N_=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Oce(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 Pce=({children:e})=>m.createElement(m.Fragment,null,e);function $ce(e){return m.isValidElement(e)&&e.type===Pce}function Oce(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 iv(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 Tce=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xc=new WeakMap,gm=new WeakMap,mm={},J1=0,AI=function(e){return e&&(e.host||AI(e.parentNode))},Dce=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=AI(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})},Ace=function(e,t,n,r){var o=Dce(t,Array.isArray(e)?e:[e]);mm[n]||(mm[n]=new WeakMap);var i=mm[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),b=p!==null&&p!=="false",v=(Xc.get(h)||0)+1,x=(i.get(h)||0)+1;Xc.set(h,v),i.set(h,x),a.push(h),v===1&&b&&gm.set(h,!0),x===1&&h.setAttribute(n,"true"),b||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||(gm.has(d)||d.removeAttribute(r),gm.delete(d)),p||d.removeAttribute(n)}),J1--,J1||(Xc=new WeakMap,Xc=new WeakMap,gm=new WeakMap,mm={})}},Cp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Tce(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Ace(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 av(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 RE(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 Ru="right-scroll-bar-position",Pu="width-before-scroll-bar",Mce="with-scroll-bars-hidden",kce="--removed-body-scroll-bar-size";function Ice(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Nce(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 PE(e,t){return Nce(t||null,function(n){return e.forEach(function(r){return Ice(r,n)})})}function Lce(e){return e}function Fce(e,t){t===void 0&&(t=Lce);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 $E(e){e===void 0&&(e={});var t=Fce(null);return t.options=Nn({async:!0,ssr:!1},e),t}var MI=function(e){var t=e.sideCar,n=av(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))};MI.isSideCarExport=!0;function OE(e,t){return e.useMedium(t),MI}var kI=$E(),Z1=function(){},sv=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,b=e.inert,v=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,_=av(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=h,C=PE([n,t]),E=Nn(Nn({},_),o);return j.createElement(j.Fragment,null,u&&j.createElement(S,{sideCar:kI,removeScrollBar:c,shards:d,noIsolation:p,inert:b,setCallbacks:i,allowPinchZoom:!!v,lockRef:n}),a?j.cloneElement(j.Children.only(s),Nn(Nn({},E),{ref:C})):j.createElement(y,Nn({},E,{className:l,ref:C}),s))});sv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sv.classNames={fullWidth:Pu,zeroRight:Ru};var aD,jce=function(){if(aD)return aD;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zce(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=jce();return t&&e.setAttribute("nonce",t),e}function Bce(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Vce(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Hce=function(){var e=0,t=null;return{add:function(n){e==0&&(t=zce())&&(Bce(t,n),Vce(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wce=function(){var e=Hce();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lv=function(){var e=Wce(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Uce={left:0,top:0,right:0,gap:0},ex=function(e){return parseInt(e||"",10)||0},qce=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)]},Gce=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Uce;var t=qce(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])}},Yce=lv(),Kce=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(Mce,` {
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(Ru,` {
297
- right: `).concat(s,"px ").concat(r,`;
298
- }
299
-
300
- .`).concat(Pu,` {
301
- margin-right: `).concat(s,"px ").concat(r,`;
302
- }
303
-
304
- .`).concat(Ru," .").concat(Ru,` {
305
- right: 0 `).concat(r,`;
306
- }
307
-
308
- .`).concat(Pu," .").concat(Pu,` {
309
- margin-right: 0 `).concat(r,`;
310
- }
311
-
312
- body {
313
- `).concat(kce,": ").concat(s,`px;
314
- }
315
- `)},TE=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=j.useMemo(function(){return Gce(o)},[o]);return j.createElement(Yce,{styles:Kce(i,!t,o,n?"":"!important")})},L_=!1;if(typeof window<"u")try{var bm=Object.defineProperty({},"passive",{get:function(){return L_=!0,!0}});window.addEventListener("test",bm,bm),window.removeEventListener("test",bm,bm)}catch{L_=!1}var Qc=L_?{passive:!1}:!1,Xce=function(e){return e.tagName==="TEXTAREA"},II=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Xce(e)&&n[t]==="visible")},Qce=function(e){return II(e,"overflowY")},Jce=function(e){return II(e,"overflowX")},sD=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=NI(e,n);if(r){var o=LI(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Zce=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eue=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},NI=function(e,t){return e==="v"?Qce(t):Jce(t)},LI=function(e,t){return e==="v"?Zce(t):eue(t)},tue=function(e,t){return e==="h"&&t==="rtl"?-1:1},nue=function(e,t,n,r,o){var i=tue(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=LI(e,s),b=p[0],v=p[1],x=p[2],y=v-x-i*b;(b||y)&&NI(e,s)&&(d+=y,h+=b),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},vm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},lD=function(e){return[e.deltaX,e.deltaY]},cD=function(e){return e&&"current"in e?e.current:e},rue=function(e,t){return e[0]===t[0]&&e[1]===t[1]},oue=function(e){return`
316
- .block-interactivity-`.concat(e,` {pointer-events: none;}
317
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
318
- `)},iue=0,Jc=[];function aue(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),o=j.useState(iue++)[0],i=j.useState(function(){return lv()})[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 v=RE([e.lockRef.current],(e.shards||[]).map(cD),!0).filter(Boolean);return v.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=j.useCallback(function(v,x){if("touches"in v&&v.touches.length===2)return!a.current.allowPinchZoom;var y=vm(v),_=n.current,S="deltaX"in v?v.deltaX:_[0]-y[0],C="deltaY"in v?v.deltaY:_[1]-y[1],E,$=v.target,D=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in v&&D==="h"&&$.type==="range")return!1;var T=sD(D,$);if(!T)return!0;if(T?E=D:(E=D==="v"?"h":"v",T=sD(D,$)),!T)return!1;if(!r.current&&"changedTouches"in v&&(S||C)&&(r.current=E),!E)return!0;var A=r.current||E;return nue(A,x,v,A==="h"?S:C,!0)},[]),l=j.useCallback(function(v){var x=v;if(!(!Jc.length||Jc[Jc.length-1]!==i)){var y="deltaY"in x?lD(x):vm(x),_=t.current.filter(function(E){return E.name===x.type&&E.target===x.target&&rue(E.delta,y)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var S=(a.current.shards||[]).map(cD).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(v,x,y,_){var S={name:v,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(v){n.current=vm(v),r.current=void 0},[]),d=j.useCallback(function(v){c(v.type,lD(v),v.target,s(v,e.lockRef.current))},[]),h=j.useCallback(function(v){c(v.type,vm(v),v.target,s(v,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(v){return v!==i}),document.removeEventListener("wheel",l,Qc),document.removeEventListener("touchmove",l,Qc),document.removeEventListener("touchstart",u,Qc)}},[]);var p=e.removeScrollBar,b=e.inert;return j.createElement(j.Fragment,null,b?j.createElement(i,{styles:oue(o)}):null,p?j.createElement(TE,{gapMode:"margin"}):null)}const sue=OE(kI,aue);var FI=j.forwardRef(function(e,t){return j.createElement(sv,Nn({},e,{ref:t,sideCar:sue}))});FI.classNames=sv.classNames;const DE=FI,lue=[" ","Enter","ArrowUp","ArrowDown"],cue=[" ","Enter"],cv="Select",[uv,dv,uue]=Sb(cv),[Cd,u5e]=hr(cv,[uue,oa]),AE=oa(),[due,_c]=Cd(cv),[fue,hue]=Cd(cv),pue=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,b=AE(t),[v,x]=m.useState(null),[y,_]=m.useState(null),[S,C]=m.useState(!1),E=vc(c),[$=!1,D]=Fr({prop:r,defaultProp:o,onChange:i}),[T,A]=Fr({prop:a,defaultProp:s,onChange:l}),L=m.useRef(null),F=v?!!v.closest("form"):!0,[z,X]=m.useState(new Set),G=Array.from(z).map(M=>M.props.value).join(";");return m.createElement(vp,b,m.createElement(due,{required:p,scope:t,trigger:v,onTriggerChange:x,valueNode:y,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:xi(),value:T,onValueChange:A,open:$,onOpenChange:D,dir:E,triggerPointerDownPosRef:L,disabled:h},m.createElement(uv.Provider,{scope:t},m.createElement(fue,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(M=>{X(U=>new Set(U).add(M))},[]),onNativeOptionRemove:m.useCallback(M=>{X(U=>{const V=new Set(U);return V.delete(M),V})},[])},n)),F?m.createElement(HI,{key:G,"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:M=>A(M.target.value),disabled:h},T===void 0?m.createElement("option",{value:""}):null,Array.from(z)):null))},gue="SelectTrigger",mue=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=AE(n),a=_c(gue,n),s=a.disabled||r,l=Rt(t,a.onTriggerChange),c=dv(n),[u,d,h]=WI(b=>{const v=c().filter(_=>!_.disabled),x=v.find(_=>_.value===a.value),y=UI(v,b,x);y!==void 0&&a.onValueChange(y.value)}),p=()=>{s||(a.onOpenChange(!0),h())};return m.createElement(yp,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":VI(a.value)?"":void 0},o,{ref:l,onClick:ke(o.onClick,b=>{b.currentTarget.focus()}),onPointerDown:ke(o.onPointerDown,b=>{const v=b.target;v.hasPointerCapture(b.pointerId)&&v.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&(p(),a.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)},b.preventDefault())}),onKeyDown:ke(o.onKeyDown,b=>{const v=u.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&d(b.key),!(v&&b.key===" ")&&lue.includes(b.key)&&(p(),b.preventDefault())})})))}),bue="SelectValue",vue=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=_c(bue,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"}}),VI(l.value)?m.createElement(m.Fragment,null,a):i)}),yue=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Qe.span,ue({"aria-hidden":!0},o,{ref:t}),r||"▼")}),xue=e=>m.createElement(lE,ue({asChild:!0},e)),ld="SelectContent",wue=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(jI,{scope:e.__scopeSelect},m.createElement(uv.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(_ue,ue({},e,{ref:t}))}),Ca=10,[jI,Sc]=Cd(ld),_ue=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:b,hideWhenDetached:v,avoidCollisions:x,...y}=e,_=_c(ld,n),[S,C]=m.useState(null),[E,$]=m.useState(null),D=Rt(t,he=>C(he)),[T,A]=m.useState(null),[L,F]=m.useState(null),z=dv(n),[X,G]=m.useState(!1),M=m.useRef(!1);m.useEffect(()=>{if(S)return Cp(S)},[S]),CE();const U=m.useCallback(he=>{const[ie,...ne]=z().map(Z=>Z.ref.current),[le]=ne.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([T,S]),[U,T,S]);m.useEffect(()=>{X&&V()},[X,V]);const{onOpenChange:Y,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))}},ne=le=>{he.x<=10&&he.y<=10?le.preventDefault():S.contains(le.target)||Y(!1),document.removeEventListener("pointermove",ie),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ne,{capture:!0})}}},[S,Y,q]),m.useEffect(()=>{const he=()=>Y(!1);return window.addEventListener("blur",he),window.addEventListener("resize",he),()=>{window.removeEventListener("blur",he),window.removeEventListener("resize",he)}},[Y]);const[O,H]=WI(he=>{const ie=z().filter(xe=>!xe.disabled),ne=ie.find(xe=>xe.ref.current===document.activeElement),le=UI(ie,he,ne);le&&setTimeout(()=>le.ref.current.focus())}),K=m.useCallback((he,ie,ne)=>{const le=!M.current&&!ne;(_.value!==void 0&&_.value===ie||le)&&(A(he),le&&(M.current=!0))},[_.value]),I=m.useCallback(()=>S==null?void 0:S.focus(),[S]),oe=m.useCallback((he,ie,ne)=>{const le=!M.current&&!ne;(_.value!==void 0&&_.value===ie||le)&&F(he)},[_.value]),ce=r==="popper"?uD:Sue,de=ce===uD?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:b,hideWhenDetached:v,avoidCollisions:x}:{};return m.createElement(jI,{scope:n,content:S,viewport:E,onViewportChange:$,itemRefCallback:K,selectedItem:T,onItemLeave:I,itemTextRefCallback:oe,focusSelectedItem:V,selectedItemText:L,position:r,isPositioned:X,searchRef:O},m.createElement(DE,{as:DI,allowPinchZoom:!0},m.createElement(EE,{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(wp,{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:D,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()}})}))))))}),Sue=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,D=>u(D)),h=dv(n),p=m.useRef(!1),b=m.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:y,focusSelectedItem:_}=a,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&c&&v&&x&&y){const D=i.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),A=i.valueNode.getBoundingClientRect(),L=y.getBoundingClientRect();if(i.dir!=="rtl"){const xe=L.left-T.left,Z=A.left-xe,ve=D.left-Z,Ce=D.width+ve,Oe=Math.max(Ce,T.width),Te=window.innerWidth-Ca,We=I_(Z,[Ca,Te-Oe]);s.style.minWidth=Ce+"px",s.style.left=We+"px"}else{const xe=T.right-L.right,Z=window.innerWidth-A.right-xe,ve=window.innerWidth-D.right-Z,Ce=D.width+ve,Oe=Math.max(Ce,T.width),Te=window.innerWidth-Ca,We=I_(Z,[Ca,Te-Oe]);s.style.minWidth=Ce+"px",s.style.right=We+"px"}const F=h(),z=window.innerHeight-Ca*2,X=v.scrollHeight,G=window.getComputedStyle(c),M=parseInt(G.borderTopWidth,10),U=parseInt(G.paddingTop,10),V=parseInt(G.borderBottomWidth,10),Y=parseInt(G.paddingBottom,10),q=M+U+X+Y+V,O=Math.min(x.offsetHeight*5,q),H=window.getComputedStyle(v),K=parseInt(H.paddingTop,10),I=parseInt(H.paddingBottom,10),oe=D.top+D.height/2-Ca,ce=z-oe,de=x.offsetHeight/2,he=x.offsetTop+de,ie=M+U+he,ne=q-ie;if(ie<=oe){const xe=x===F[F.length-1].ref.current;s.style.bottom="0px";const Z=c.clientHeight-v.offsetTop-v.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(oe,M+v.offsetTop+(xe?K:0)+de)+ne;s.style.height=ve+"px",v.scrollTop=ie-oe+v.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,v,x,y,i.dir,r]);Cr(()=>S(),[S]);const[C,E]=m.useState();Cr(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const $=m.useCallback(D=>{D&&b.current===!0&&(S(),_==null||_(),b.current=!1)},[S,_]);return m.createElement(Cue,{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}}))))}),uD=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ca,...i}=e,a=AE(n);return m.createElement(xp,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)"}}))}),[Cue,ME]=Cd(ld,{}),dD="SelectViewport",Eue=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Sc(dD,n),i=ME(dD,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(uv.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,b=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),x=Math.max(b,v);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})}))))}),Rue="SelectGroup",[Pue,$ue]=Cd(Rue),Oue=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xi();return m.createElement(Pue,{scope:n,id:o},m.createElement(Qe.div,ue({role:"group","aria-labelledby":o},r,{ref:t})))}),Tue="SelectLabel",Due=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=$ue(Tue,n);return m.createElement(Qe.div,ue({id:o.id},r,{ref:t}))}),F_="SelectItem",[Aue,zI]=Cd(F_),Mue=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),b=Rt(t,y=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,y,r,o)}),v=xi(),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(Aue,{scope:n,value:r,disabled:o,textId:v,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(uv.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(Qe.div,ue({role:"option","aria-labelledby":v,"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:b,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===" "||(cue.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})}))))}),ym="SelectItemText",kue=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=_c(ym,n),s=Sc(ym,n),l=zI(ym,n),c=hue(ym,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,b=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:x}=c;return Cr(()=>(v(b),()=>x(b)),[v,x,b]),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)}),Iue="SelectItemIndicator",Nue=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return zI(Iue,n).isSelected?m.createElement(Qe.span,ue({"aria-hidden":!0},r,{ref:t})):null}),fD="SelectScrollUpButton",Lue=m.forwardRef((e,t)=>{const n=Sc(fD,e.__scopeSelect),r=ME(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.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(BI,ue({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}})):null}),hD="SelectScrollDownButton",Fue=m.forwardRef((e,t)=>{const n=Sc(hD,e.__scopeSelect),r=ME(hD,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(BI,ue({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}})):null}),BI=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Sc("SelectScrollButton",n),a=m.useRef(null),s=dv(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()})}))}),jue=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Qe.div,ue({"aria-hidden":!0},r,{ref:t}))});function VI(e){return e===""||e===void 0}const HI=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=Rt(t,o),a=iv(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(nI,{asChild:!0},m.createElement("select",ue({},r,{ref:i,defaultValue:n})))});HI.displayName="BubbleSelect";function WI(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 UI(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=zue(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 zue(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Bue=pue,qI=mue,Vue=vue,Hue=yue,Wue=xue,GI=wue,Uue=Eue,que=Oue,YI=Due,KI=Mue,Gue=kue,Yue=Nue,XI=Lue,QI=Fue,JI=jue,Ea=Bue,lu=que,Ra=Vue,Mi=j.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(qI,{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(Hue,{asChild:!0,children:R.jsx(jb,{className:"h-4 w-4 opacity-50"})})]}));Mi.displayName=qI.displayName;const ZI=j.forwardRef(({className:e,...t},n)=>R.jsx(XI,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:R.jsx(_k,{className:"h-4 w-4"})}));ZI.displayName=XI.displayName;const e8=j.forwardRef(({className:e,...t},n)=>R.jsx(QI,{ref:n,className:ye("flex cursor-default items-center justify-center py-1",e),...t,children:R.jsx(jb,{className:"h-4 w-4"})}));e8.displayName=QI.displayName;const ki=j.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>R.jsx(Wue,{children:R.jsx(bc,{children:R.jsxs(GI,{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(ZI,{}),R.jsx(Uue,{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(e8,{})]})})}));ki.displayName=GI.displayName;const El=j.forwardRef(({className:e,...t},n)=>R.jsx(YI,{ref:n,className:ye("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));El.displayName=YI.displayName;const Hn=j.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(KI,{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(Yue,{children:R.jsx(fp,{className:"h-4 w-4"})})}),R.jsx(Gue,{children:t})]}));Hn.displayName=KI.displayName;const Xf=j.forwardRef(({className:e,...t},n)=>R.jsx(JI,{ref:n,className:ye("-mx-1 my-1 h-px bg-muted",e),...t}));Xf.displayName=JI.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 Kue=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()}}))),t8=Kue,Xue=gE("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Tn=j.forwardRef(({className:e,...t},n)=>R.jsx(t8,{ref:n,className:ye(Xue(),e),...t}));Tn.displayName=t8.displayName;const n8=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Jue);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)});n8.displayName="Slot";const j_=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Zue(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 Que=({children:e})=>m.createElement(m.Fragment,null,e);function Jue(e){return m.isValidElement(e)&&e.type===Que}function Zue(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 r8="Popover",[o8,d5e]=hr(r8,[oa]),kE=oa(),[ede,Ed]=o8(r8),tde=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=kE(t),l=m.useRef(null),[c,u]=m.useState(!1),[d=!1,h]=Fr({prop:r,defaultProp:o,onChange:i});return m.createElement(vp,s,m.createElement(ede,{scope:t,contentId:xi(),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))},nde="PopoverTrigger",rde=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ed(nde,n),i=kE(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":s8(o.open)},r,{ref:a,onClick:ke(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?s:m.createElement(yp,ue({asChild:!0},i),s)}),i8="PopoverPortal",[ode,ide]=o8(i8,{forceMount:void 0}),ade=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Ed(i8,t);return m.createElement(ode,{scope:t,forceMount:n},m.createElement(pr,{present:n||i.open},m.createElement(lE,{asChild:!0,container:o},r)))},_h="PopoverContent",sde=m.forwardRef((e,t)=>{const n=ide(_h,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Ed(_h,e.__scopePopover);return m.createElement(pr,{present:r||i.open},i.modal?m.createElement(lde,ue({},o,{ref:t})):m.createElement(cde,ue({},o,{ref:t})))}),lde=m.forwardRef((e,t)=>{const n=Ed(_h,e.__scopePopover),r=m.useRef(null),o=Rt(t,r),i=m.useRef(!1);return m.useEffect(()=>{const a=r.current;if(a)return Cp(a)},[]),m.createElement(DE,{as:n8,allowPinchZoom:!0},m.createElement(a8,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})})))}),cde=m.forwardRef((e,t)=>{const n=Ed(_h,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(a8,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()}}))}),a8=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=Ed(_h,n),p=kE(n);return CE(),m.createElement(EE,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(wp,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1)},m.createElement(xp,ue({"data-state":s8(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 s8(e){return e?"open":"closed"}const ude=tde,dde=rde,fde=ade,l8=sde,fv=ude,hv=dde,Ep=j.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>R.jsx(fde,{children:R.jsx(bc,{children:R.jsx(l8,{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})})}));Ep.displayName=l8.displayName;function hde(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 c8({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(yC,{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 ${Ff}`)}),R.jsx("span",{children:"-"}),R.jsx(Jl,{value:a.end,onChange:l=>r(s,"end",l.target.value),className:ye(`h-7 ${Ff}`)}),R.jsx(Jl,{onChange:l=>r(s,"color",l.target.value),value:a.color,className:ye(`h-7 min-w-14 p-0 ${Ff}`),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(bd,{className:"size-3"})})]},s))]})}const pde=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)})}))}),u8=pde,gde=gE("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"}}),IE=j.forwardRef(({className:e,variant:t,size:n,...r},o)=>R.jsx(u8,{ref:o,className:ye(gde({variant:t,size:n,className:e})),...r}));IE.displayName=u8.displayName;function mde(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 bde(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 vde(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 yde(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 xde(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 wde(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 _de(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 Sde(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 Cde(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 Ede({columnIndex:e,columnName:t}){const[n,r]=m.useState(!1),o=Ir(G=>{var M;return(M=G.card)==null?void 0:M.preferences}),[i,a]=m.useState(mde(o,e)),[s,l]=m.useState(Sde(o,e)),[c,u]=m.useState(Cde(o,e)),[d,h]=m.useState(wde(o,e)),[p,b]=m.useState(bde(o,e)),[v,x]=m.useState(vde(o,e)),[y,_]=m.useState(yde(o,e)),[S,C]=m.useState(xde(o,e).toString()),[E,$]=m.useState(_de(o,e));m.useState("");const D=Ir(G=>G.actions.setCardPreferences);function T(){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 A(){const G=[...new Set(sw.map(M=>M.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:M=>b(M),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(M=>R.jsx(Hn,{value:M.locale,children:M.locale},M.locale))]})})]}),R.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),R.jsxs(Ea,{value:y||"none",onValueChange:M=>_(M==="none"?void 0:M),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(M=>R.jsx(Hn,{value:M,children:M},M))]})})]}),R.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),R.jsxs(Ea,{value:S,onValueChange:M=>C(M),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(M=>R.jsx(Hn,{value:M,children:M},M))})]}),!y&&R.jsx(IE,{onPressedChange:M=>$(M),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:R.jsx(Pk,{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=>b(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:iG.map(G=>R.jsxs(lu,{children:[R.jsx(El,{children:G.label}),G.locales.map(M=>R.jsx(Hn,{value:M.code,children:M.name},M.code))]},G.label))})]}),R.jsx(Tn,{className:"col-span-3",htmlFor:"format",children:"Format"}),R.jsxs(Ea,{defaultValue:"short-date-time",value:v,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(){D({...o,columnSettings:[]})}function z(){var G;D({...o,columnSettings:[...((G=o==null?void 0:o.columnSettings)==null?void 0:G.filter(M=>M.columnIdx!==e))||[]]})}function X(){var G,M,U;if(i==="date"){const V=hde(p,v),Y={columnIdx:e,type:i,options:V};D({...o,columnSettings:[...((G=o==null?void 0:o.columnSettings)==null?void 0:G.filter(q=>q.columnIdx!==e))||[],Y]})}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 Y={columnIdx:e,type:i,textAlign:s,width:c,options:V};D({...o,columnSettings:[...((M=o==null?void 0:o.columnSettings)==null?void 0:M.filter(q=>q.columnIdx!==e))||[],Y]})}else{const V={columnIdx:e,type:"none",textAlign:s,width:c,options:{}};D({...o,columnSettings:[...((U=o==null?void 0:o.columnSettings)==null?void 0:U.filter(Y=>Y.columnIdx!==e))||[],V]})}}return R.jsxs(fv,{onOpenChange:G=>r(G),children:[R.jsx(hv,{asChild:!0,children:R.jsx(xC,{className:"size-3.5 cursor-pointer text-muted"})}),R.jsx(Ep,{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"})]})})]})]}),T(),R.jsx(Xf,{}),i==="number"&&A(),i==="date"&&L(),i==="number"&&R.jsxs(R.Fragment,{children:[R.jsx(Xf,{}),R.jsx(c8,{colorRanges:d,setColorRanges:h})]}),R.jsx(Xf,{}),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 Rde(e){const t=new Date(e);return!isNaN(t.getTime())}function d8({data:e,card:t}){var C,E,$,D;const[n,r]=m.useState([]),{keys:o}=tr(e),i=we(T=>T.filteringCards),a=we(T=>T.themeStyle),s=we(T=>T.isVisualEditing),l=i==null?void 0:i.find(T=>T.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(),b=t==null?void 0:t.preferences;function v(T,A){if((A==null?void 0:A.type)==="date"&&Rde(T)){const{locale:L,options:F}=A.options,z=new Date(T);return new Date(z.getTime()).toLocaleDateString(L,F)}if((A==null?void 0:A.type)==="number"){const{locale:L,currency:F,options:z}=A.options;return F?new Intl.NumberFormat(L,{style:"currency",currency:F,...z}).format(T):new Intl.NumberFormat(L,z).format(T)}return T}const x=o.map((T,A)=>({accessorKey:T,header:({column:L})=>{var V;const F=L.getIsSorted(),z=A,X=(V=b==null?void 0:b.columnSettings)==null?void 0:V.find(Y=>Y.columnIdx===z),G=X==null?void 0:X.textAlign,M=X==null?void 0:X.width,U=M?{width:M}:{};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:[T,F==="asc"?R.jsx(vk,{className:"ml-2 h-5 w-5"}):F==="desc"?R.jsx(bk,{className:"ml-2 h-5 w-5"}):null]}),s&&R.jsx(Ede,{columnName:L.id,columnIndex:A})]})},cell:({cell:L})=>{var U,V;const F=L.getValue(),z=(U=b==null?void 0:b.columnSettings)==null?void 0:U.find(Y=>Y.columnIdx===A),X=v(F,z),G=_C(F,(V=z==null?void 0:z.options)==null?void 0:V.colorRanges),M=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":M==="center","text-right":M==="right","text-left":M==="left"}),style:{backgroundColor:G},children:X})}})),y=OI({data:e,columns:x,getCoreRowModel:RI(),getPaginationRowModel:$I(),onSortingChange:r,getSortedRowModel:PI(),manualPagination:!0,state:{sorting:n}}),_=y.getSelectedRowModel().rows;m.useEffect(()=>{if(_.length===0){if(l){const T=t.id;h(T),p(t)}return}if(c){const{dimensionKeys:T}=tr(e),A=c.map(L=>{const F=T==null?void 0:T[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:xb(z[0]===void 0?"":z[0]),operation:"in",values:z}});u(A),d(t)}},[d,u,t,e,l,c,h,p,_]);function S(T){T.toggleSelected()}return R.jsxs(mE,{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:T=>T.stopPropagation(),children:[R.jsx(bE,{children:y.getHeaderGroups().map(T=>R.jsx(Kf,{children:T.headers.map((A,L)=>{var F,z,X,G,M,U,V;return R.jsx(yE,{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:Gu((U=(M=(G=a==null?void 0:a.chart)==null?void 0:G.dataset)==null?void 0:M.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<T.headers.length-1,"border-l":L===1&&T.headers.length==2},(V=a==null?void 0:a.table)==null?void 0:V.tableHeaderColor),children:A.isPlaceholder?null:k_(A.column.columnDef.header,A.getContext())},A.id)})},T.id))}),R.jsx(vE,{children:(D=y.getRowModel().rows)!=null&&D.length?y.getRowModel().rows.map((T,A)=>R.jsx(Kf,{onClick:()=>S(T),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":T.getIsSelected()&&"selected",children:T.getVisibleCells().map((L,F)=>{var M,U;const z=(M=b==null?void 0:b.columnSettings)==null?void 0:M.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 Y=((q=window==null?void 0:window.getSelection())==null?void 0:q.toString())||"";(Y==null?void 0:Y.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":A===((U=y.getRowModel().rows)==null?void 0:U.length)-1}),children:k_(L.column.columnDef.cell,L.getContext())},L.id)})},T.id)):R.jsx(Kf,{children:R.jsx(xE,{colSpan:x.length,className:"p-1 text-center",children:"No results."})})})]})}async function Pde(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 $de(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 f8(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 h8=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&&f8(e).then(c=>{n(c.visuals),a(c)}).catch(()=>{$de(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(()=>Pde(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 Ode({onLoadingStatus:e,card:t}){const{isFetching:n,isLoading:r}=tE(t);return m.useEffect(()=>{e==null||e(r)},[n,r,e]),R.jsx(R.Fragment,{})}function Tde({card:e,frame:t}){var x,y,_,S,C,E,$,D,T;const{authToken:n}=Mo(),r=AM(n==null?void 0:n.accessToken),o=we(A=>A.themeStyle),i={colors:((y=(x=o==null?void 0:o.chart)==null?void 0:x.dataset)==null?void 0:y.backgroundColor)||[]},[a,s]=m.useState(!1),{getCard:l}=h8(((_=e.customCardPreferences)==null?void 0:_.url)||""),c=((S=e.customCardPreferences)==null?void 0:S.visualType)||"single",u=(C=e.customCardPreferences)==null?void 0:C.componentName,{data:d}=Vb(e);if(!u)return null;const h=l(u),p=A=>{console.log("data",A),e.customCardPreferences},b=Object.keys(((E=e.customCardPreferences)==null?void 0:E.dataInputCardIds)||{}).map(A=>{var z,X,G;const L=(X=(z=e.customCardPreferences)==null?void 0:z.dataInputCardIds)==null?void 0:X[A].cardId,F=(G=t==null?void 0:t.cards)==null?void 0:G.find(M=>M.id===L);return F||null});function v(A){s(A)}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:[h&&c==="single"&&R.jsx(h,{params:r,theme:i,settings:($=e.customCardPreferences)==null?void 0:$.settings,onDataChange:p,data:(d==null?void 0:d.records)||[]}),h&&c==="multiple"&&R.jsxs(R.Fragment,{children:[Object.keys(((D=e.customCardPreferences)==null?void 0:D.dataInputCardIds)||{}).map(A=>{var z,X,G;const L=(X=(z=e.customCardPreferences)==null?void 0:z.dataInputCardIds)==null?void 0:X[A].cardId,F=(G=t==null?void 0:t.cards)==null?void 0:G.find(M=>M.id===L);return F?R.jsx(Ode,{onLoadingStatus:v,onDataChange:p,dataInputIndex:A,card:F},F.id):null}),c==="multiple"&&R.jsx("div",{className:ye("flex flex-col gap-2",{"opacity-50":a}),children:R.jsx(h,{params:r,theme:i,onDataChange:p,settings:b.map(A=>{var L;return(L=A==null?void 0:A.customCardPreferences)==null?void 0:L.settings}),data:b.map(A=>(A==null?void 0:A.data)||[])})})]})]},(T=e.customCardPreferences)==null?void 0:T.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 pD=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}(),Qf={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*pD)/pD}};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 Dde(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 Ade=0,p8=1,g8=2,m8=4,b8=8;function xm(e,t,n){var r=Ade;return e<n.left?r|=p8:e>n.right&&(r|=g8),t<n.top?r|=b8:t>n.bottom&&(r|=m8),r}function Mde(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,a=xm(n,r,t),s=xm(o,i,t),l,c,u;!(!(a|s)||a&s);)l=a||s,l&b8?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&m8?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&g8?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&p8&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===a?(n=c,r=u,a=xm(n,r,t)):(o=c,i=u,s=xm(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function wm(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=Mde(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),Dde(o,i,e.vx,e.vy,t.align)}var _m={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 wm({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 wm({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)),wm({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 wm({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=Qf.rasterize;function kde(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 Ide(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 Nde(e){return e instanceof fu?_m.arc:e instanceof Yl?_m.point:e instanceof Kl?_m.bar:_m.fallback}function Lde(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 Fde(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),Lde(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 jde(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 zde(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 Bde(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=jde(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)zde(e,t[h],{stroked:d,filled:a,w:n.w,x:n.x,y:n.y+n.h*h})}var v8=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(v8.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:Ide(o._el,r),padding:fr(wn([n.padding,4],r,i)),positioner:Nde(o._el),rotation:wn([n.rotation,0],r,i)*(Math.PI/180),size:Qf.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)?[]:Qf.toTextLines(s),l.length&&(n=t._modelize(c,l,i,e),r=kde(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=Qf.bound(0,o.opacity,1),r.translate(ka(t.x),ka(t.y)),r.rotate(o.rotation),Fde(r,i.frame,o),Bde(r,o.lines,i.text,o),r.restore())}});var Vde=Number.MIN_SAFE_INTEGER||-9007199254740991,Hde=Number.MAX_SAFE_INTEGER||9007199254740991;function df(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 gD(e,t){var n=Hde,r=Vde,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 Sm(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 y8=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};or(y8.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=df(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=[Sm(t[0],t[1]),Sm(t[0],t[3])],o,i,a;for(this._rotation!==e._rotation&&r.push(Sm(n[0],n[1]),Sm(n[0],n[3])),o=0;o<r.length;++o)if(i=gD(t,r[o]),a=gD(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[df({x:t.x,y:t.y},r,n),df({x:t.x+t.w,y:t.y},r,n),df({x:t.x+t.w,y:t.y+t.h},r,n),df({x:t.x,y:t.y+t.h},r,n)]}});function x8(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 Wde(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 Ude(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=x8(s,r.model(),i),o._box.update(a,i,r.rotation()));return Wde(e,function(l,c){var u=l._hidable,d=c._hidable;u&&d||d?c._visible=!1:u&&(l._visible=!1)})}var Jf={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 y8,_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&&Ude(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=x8(o._el,o.model(),a),i._box.update(s,a,o.rotation()),o.draw(e,s))}},qde=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},Gde={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:qde,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",w8="$default";function Yde(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||w8]=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 Kde(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 Xde(e,t){var n=e[Xr],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=Jf.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,Kde(e,r,o,i,t)}}function Qde(e,t){var n=e[Xr],r=n._listeners.click,o=r&&Jf.lookup(n._labels,t);o&&z_(e,r,o,t)}var Jde={id:"datalabels",defaults:Gde,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=Yde(s,n),c=t.meta.data||[],u=e.ctx,d,h,p,b,v,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,b=l.labels.length;h<b;++h)v=l.labels[h],x=v._key,_=new v8(v,u,y,d),_.$groups={_set:r,_key:x||w8},_.$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=Jf.prepare(e[Xr]._datasets)},afterDatasetsDraw:function(e){Jf.draw(e,e[Xr]._labels)},beforeEvent:function(e,t){if(e[Xr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":Xde(e,n);break;case"click":Qde(e,n);break}}},afterEvent:function(e){var t=e[Xr],n=t._actives,r=t._actives=e.getActiveElements(),o=Qf.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)&&(Jf.update(t._labels),e.render()),delete t._dirty}};Dn.register(...xre);Dn.register(Jde);Dn.register(Yl);Dn.register(xd);Dn.register(wd);Dn.register(La);Dn.register(wc);Dn.register(Vs);Dn.register(Hs);Dn.register($0);Dn.register(k3);function NE({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 v,x;if((((v=h.data.datasets)==null?void 0:v.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,kk("--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 b,v,x,y;if(!n)return;(v=(b=l==null?void 0:l.chart)==null?void 0:b.font)!=null&&v.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 b,v;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,_=(v=(b=p[0].element)==null?void 0:b.$context)==null?void 0:v.raw;t==null||t(a,x,y,_)}}return R.jsx("div",{onClick:u,className:"relative h-[99%]",children:R.jsx("canvas",{ref:i})})}function Zde(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const _8="ScrollArea",[S8,f5e]=hr(_8),[efe,ti]=S8(_8),C8=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,b]=m.useState(null),[v,x]=m.useState(null),[y,_]=m.useState(0),[S,C]=m.useState(0),[E,$]=m.useState(!1),[D,T]=m.useState(!1),A=Rt(t,F=>l(F)),L=vc(o);return m.createElement(efe,{scope:n,type:r,dir:L,scrollHideDelay:i,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:h,scrollbarX:p,onScrollbarXChange:b,scrollbarXEnabled:E,onScrollbarXEnabledChange:$,scrollbarY:v,onScrollbarYChange:x,scrollbarYEnabled:D,onScrollbarYEnabledChange:T,onCornerWidthChange:_,onCornerHeightChange:C},m.createElement(Qe.div,ue({dir:L},a,{ref:A,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})))}),tfe="ScrollAreaViewport",nfe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=ti(tfe,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",E8=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ti(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(rfe,ue({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(ofe,ue({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(R8,ue({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(LE,ue({},r,{ref:t})):null}),rfe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ti(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(R8,ue({"data-state":i?"visible":"hidden"},r,{ref:t})))}),ofe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ti(Wa,e.__scopeScrollArea),i=e.orientation==="horizontal",a=gv(()=>l("SCROLL_END"),100),[s,l]=Zde("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(LE,ue({"data-state":s==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:ke(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),R8=m.forwardRef((e,t)=>{const n=ti(Wa,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,a]=m.useState(!1),s=e.orientation==="horizontal",l=gv(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?c:u)}},10);return cd(n.viewport,l),cd(n.content,l),m.createElement(pr,{present:r||i},m.createElement(LE,ue({"data-state":i?"visible":"hidden"},o,{ref:t})))}),LE=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ti(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=T8(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 ffe(h,a.current,s,p)}return n==="horizontal"?m.createElement(ife,ue({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollLeft,p=mD(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(afe,ue({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollTop,p=mD(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}),ife=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ti(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($8,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":pv(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),A8(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:Q0(a.paddingLeft),paddingEnd:Q0(a.paddingRight)}})}}))}),afe=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ti(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($8,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":pv(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),A8(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:Q0(a.paddingTop),paddingEnd:Q0(a.paddingBottom)}})}}))}),[sfe,P8]=S8(Wa),$8=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=ti(Wa,n),[b,v]=m.useState(null),x=Rt(t,A=>v(A)),y=m.useRef(null),_=m.useRef(""),S=p.viewport,C=r.content-r.viewport,E=Xn(u),$=Xn(l),D=gv(d,10);function T(A){if(y.current){const L=A.clientX-y.current.left,F=A.clientY-y.current.top;c({x:L,y:F})}}return m.useEffect(()=>{const A=L=>{const F=L.target;(b==null?void 0:b.contains(F))&&E(L,C)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[S,b,C,E]),m.useEffect($,[r,$]),cd(b,D),cd(p.content,D),m.createElement(sfe,{scope:n,scrollbar:b,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,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),y.current=b.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),T(A))}),onPointerMove:ke(e.onPointerMove,T),onPointerUp:ke(e.onPointerUp,A=>{const L=A.target;L.hasPointerCapture(A.pointerId)&&L.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=_.current,p.viewport&&(p.viewport.style.scrollBehavior=""),y.current=null})})))}),B_="ScrollAreaThumb",lfe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=P8(B_,e.__scopeScrollArea);return m.createElement(pr,{present:n||o.hasThumb},m.createElement(cfe,ue({ref:t},r)))}),cfe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ti(B_,n),a=P8(B_,n),{onThumbPositionChange:s}=a,l=Rt(t,d=>a.onThumbChange(d)),c=m.useRef(),u=gv(()=>{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=hfe(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(),b=d.clientX-p.left,v=d.clientY-p.top;a.onThumbPointerDown({x:b,y:v})}),onPointerUp:ke(e.onPointerUp,a.onThumbPointerUp)}))}),O8="ScrollAreaCorner",ufe=m.forwardRef((e,t)=>{const n=ti(O8,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(dfe,ue({},e,{ref:t})):null}),dfe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ti(O8,n),[i,a]=m.useState(0),[s,l]=m.useState(0),c=!!(i&&s);return cd(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),cd(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 Q0(e){return e?parseInt(e,10):0}function T8(e,t){const n=e/t;return isNaN(n)?0:n}function pv(e){const t=T8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ffe(e,t,n,r="ltr"){const o=pv(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 D8([l,c],d)(e)}function mD(e,t,n="ltr"){const r=pv(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=I_(e,l);return D8([0,a],[0,s])(c)}function D8(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 A8(e,t){return e>0&&e<t}const hfe=(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 gv(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 cd(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 M8=C8,pfe=nfe,gfe=ufe,Sh=j.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(M8,{ref:r,className:ye("relative overflow-hidden",e),...n,children:[R.jsx(pfe,{className:"h-full w-full rounded-[inherit]",children:t}),R.jsx(mv,{}),R.jsx(gfe,{})]}));Sh.displayName=M8.displayName;const mv=j.forwardRef(({className:e,orientation:t="vertical",...n},r)=>R.jsx(E8,{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(lfe,{className:"relative flex-1 rounded-full bg-border"})}));mv.displayName=E8.displayName;function mfe({card:e,frame:t}){var X,G,M;const{customCards:n}=Mo();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(),b=((X=e.customCardPreferences)==null?void 0:X.showCardHeader)??!0,{isError:v,isLoading:x,isFetching:y,cfg:_,visualKey:S,data:C,handleDatapointClick:E}=tE(e);function $(){var U;if(n&&n.length>0){const V=n.find(Y=>Y.cardId===e.id);if(V&&V.replaceDefault){const Y=V.content;if(Y)return R.jsx(Y,{card:e})}}return e.type==="kpi"?R.jsx(k7,{card:e,data:(C==null?void 0:C.records)||[]}):e.type==="text"&&((U=t==null?void 0:t.cards)==null?void 0:U.length)===1?R.jsx(Sh,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:R.jsx(R_,{isLoading:x||y,card:e,data:(C==null?void 0:C.records)||[]})}):z}function D(){return["{{ filters | where }}","{{ filters | and }}"].some(V=>{var Y;return(Y=e.sql)==null?void 0:Y.includes(V)})?R.jsx(kle,{}):null}function T(){if(v)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(d8,{card:e,data:(C==null?void 0:C.records)||[]})});if(e.type==="text")return R.jsx(Sh,{className:"overflow-y-auto break-words pr-2",children:R.jsx(R_,{isLoading:x||y,card:e,data:(C==null?void 0:C.records)||[]})});if(e.type==="custom")return R.jsx(Tde,{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(NE,{cfg:_,onDatapointClick:E},`${S}-${a}`)}function A(){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,Y;return R.jsx(WS,{value:t.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:q=>{const O={...t,activeCardId:q};p(o,O)},children:R.jsx(Cb,{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:(Y=t.cards.filter(q=>{var O;return!((O=q.tabTitle)!=null&&O.endsWith("__Header"))&&(q.displayTab===!0||q.displayTab===void 0)}))==null?void 0:Y.map(q=>{var O,H;return R.jsx(Eb,{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(Nse,{renderFilterInfo:D,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(gd,{className:ye("text-base",{}),children:e.title})}),(i||e.info)&&R.jsx(eI,{card:e}),e.refreshInterval&&R.jsxs(aI,{children:[R.jsx(sI,{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(pE,{side:"right",align:"center",children:R.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),D()]}),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(jS,{className:ye("",{}),children:[" ",e.description]})})})]})}if(!e.id)return null;const z=R.jsxs(R.Fragment,{children:[b?R.jsx(wb,{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:(M=(G=r==null?void 0:r.chart)==null?void 0:G.options)==null?void 0:M.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[!pd.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})}),a2(l)]})})]})]})}):R.jsx("div",{className:"h-8"}),R.jsx(_b,{className:"relative flex min-h-0 grow flex-col",children:T()}),R.jsx(f6,{children:A()})]});return R.jsx("div",{className:ye("flex h-full flex-col",{"animate-pulse":x||y}),children:$()})}function bfe({frame:e,footer:t,className:n,...r}){var v,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}=Fb(),p=e.cards.find(y=>y.id===e.activeCardId);rJ(e,o);function b(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(Bb,{FallbackComponent:wC,children:R.jsxs("div",{tabIndex:-1,ref:o,role:"card-frame",onClick:b,style:{borderRadius:(x=(v=i==null?void 0:i.chart)==null?void 0:v.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(Ak,{frame:e}),R.jsx(mfe,{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 wi(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 FE=6048e5,vfe=864e5;let yfe={};function Rp(){return yfe}function Ji(e,t){var s,l,c,u;const n=Rp(),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 k8(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 ud(e){const t=Ht(e);return t.setHours(0,0,0,0),t}function J0(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=ud(e),r=ud(t),o=+n-J0(n),i=+r-J0(r);return Math.round((o-i)/vfe)}function xfe(e){const t=k8(e),n=Ao(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),dc(n)}function V_(e,t){const n=t*7;return Lr(e,n)}function wfe(e,t){return wi(e,t*12)}function _fe(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 Sfe(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=ud(e),r=ud(t);return+n==+r}function jE(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Cfe(e){if(!jE(e)&&typeof e!="number")return!1;const t=Ht(e);return!isNaN(Number(t))}function Ch(e,t){const n=Ht(e),r=Ht(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function Efe(e,t,n){const r=Ji(e,n),o=Ji(t,n),i=+r-J0(r),a=+o-J0(o);return Math.round((i-a)/FE)}function zE(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 I8(e){const t=Ht(e),n=Ao(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function BE(e,t){var s,l,c,u;const n=Rp(),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 N8(e){return BE(e,{weekStartsOn:1})}const Rfe={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"}},Pfe=(e,t,n)=>{let r;const o=Rfe[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 $fe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ofe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Tfe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Dfe={date:nx({formats:$fe,defaultWidth:"full"}),time:nx({formats:Ofe,defaultWidth:"full"}),dateTime:nx({formats:Tfe,defaultWidth:"full"})},Afe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Mfe=(e,t,n,r)=>Afe[e];function ff(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 kfe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ife={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Nfe={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"]},Lfe={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"]},Ffe={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"}},jfe={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"}},zfe=(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"},Bfe={ordinalNumber:zfe,era:ff({values:kfe,defaultWidth:"wide"}),quarter:ff({values:Ife,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ff({values:Nfe,defaultWidth:"wide"}),day:ff({values:Lfe,defaultWidth:"wide"}),dayPeriod:ff({values:Ffe,defaultWidth:"wide",formattingValues:jfe,defaultFormattingWidth:"wide"})};function hf(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)?Hfe(s,d=>d.test(a)):Vfe(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 Vfe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Hfe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Wfe(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 Ufe=/^(\d+)(th|st|nd|rd)?/i,qfe=/\d+/i,Gfe={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},Yfe={any:[/^b/i,/^(a|c)/i]},Kfe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Xfe={any:[/1/i,/2/i,/3/i,/4/i]},Qfe={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},Jfe={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]},Zfe={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},ehe={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]},the={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},nhe={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}},rhe={ordinalNumber:Wfe({matchPattern:Ufe,parsePattern:qfe,valueCallback:e=>parseInt(e,10)}),era:hf({matchPatterns:Gfe,defaultMatchWidth:"wide",parsePatterns:Yfe,defaultParseWidth:"any"}),quarter:hf({matchPatterns:Kfe,defaultMatchWidth:"wide",parsePatterns:Xfe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:hf({matchPatterns:Qfe,defaultMatchWidth:"wide",parsePatterns:Jfe,defaultParseWidth:"any"}),day:hf({matchPatterns:Zfe,defaultMatchWidth:"wide",parsePatterns:ehe,defaultParseWidth:"any"}),dayPeriod:hf({matchPatterns:the,defaultMatchWidth:"any",parsePatterns:nhe,defaultParseWidth:"any"})},L8={code:"en-US",formatDistance:Pfe,formatLong:Dfe,formatRelative:Mfe,localize:Bfe,match:rhe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ohe(e){const t=Ht(e);return Hi(t,I8(t))+1}function F8(e){const t=Ht(e),n=+dc(t)-+xfe(t);return Math.round(n/FE)+1}function j8(e,t){var u,d,h,p;const n=Ht(e),r=n.getFullYear(),o=Rp(),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 ihe(e,t){var s,l,c,u;const n=Rp(),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=j8(e,t),i=Ao(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Ji(i,t)}function z8(e,t){const n=Ht(e),r=+Ji(n,t)-+ihe(n,t);return Math.round(r/FE)+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"},bD={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=j8(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=k8(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=z8(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):sn(o,t.length)},I:function(e,t,n){const r=F8(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=ohe(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 yD(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 yD(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"+vD(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"+vD(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 vD(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 yD(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 xD=(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"})}},B8=(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"})}},ahe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return xD(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}}",xD(r,t)).replace("{{time}}",B8(o,t))},she={p:B8,P:ahe},lhe=/^D+$/,che=/^Y+$/,uhe=["D","DD","YY","YYYY"];function dhe(e){return lhe.test(e)}function fhe(e){return che.test(e)}function hhe(e,t,n){const r=phe(e,t,n);if(console.warn(r),uhe.includes(e))throw new RangeError(r)}function phe(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 ghe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mhe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bhe=/^'([^]*?)'?$/,vhe=/''/g,yhe=/[a-zA-Z]/;function Gi(e,t,n){var u,d,h,p,b,v,x,y;const r=Rp(),o=(n==null?void 0:n.locale)??r.locale??L8,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)??((v=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((y=(x=r.locale)==null?void 0:x.options)==null?void 0:y.weekStartsOn)??0,s=Ht(e);if(!Cfe(s))throw new RangeError("Invalid time value");let l=t.match(mhe).map(_=>{const S=_[0];if(S==="p"||S==="P"){const C=she[S];return C(_,o.formatLong)}return _}).join("").match(ghe).map(_=>{if(_==="''")return{isToken:!1,value:"'"};const S=_[0];if(S==="'")return{isToken:!1,value:xhe(_)};if(bD[S])return{isToken:!0,value:_};if(S.match(yhe))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)&&fhe(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&dhe(S))&&hhe(S,t,String(e));const C=bD[S[0]];return C(s,S,o.localize,c)}).join("")}function xhe(e){const t=e.match(bhe);return t?t[1].replace(vhe,"'"):e}function whe(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 _he(e){return Math.trunc(+Ht(e)/1e3)}function She(e){const t=Ht(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function Che(e,t){return Efe(She(e),ro(e),t)+1}function H_(e,t){const n=Ht(e),r=Ht(t);return n.getTime()>r.getTime()}function V8(e,t){const n=Ht(e),r=Ht(t);return+n<+r}function VE(e,t){const n=Ht(e),r=Ht(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Ehe(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=whe(i);return n.setMonth(t,Math.min(o,a)),n}function wD(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 Rhe(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 H8(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 W_={exports:{}},pf={};/**
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 _D;function Phe(){return _D||(_D=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"),b=Symbol.iterator,v="@@iterator";function x(k){if(k===null||typeof k!="object")return null;var te=b&&k[b]||k[v];return typeof te=="function"?te:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(k){{for(var te=arguments.length,fe=new Array(te>1?te-1:0),$e=1;$e<te;$e++)fe[$e-1]=arguments[$e];S("error",k,fe)}}function S(k,te,fe){{var $e=y.ReactDebugCurrentFrame,Ve=$e.getStackAddendum();Ve!==""&&(te+="%s",fe=fe.concat([Ve]));var qe=fe.map(function(ze){return String(ze)});qe.unshift("Warning: "+te),Function.prototype.apply.call(console[k],console,qe)}}var C=!1,E=!1,$=!1,D=!1,T=!1,A;A=Symbol.for("react.module.reference");function L(k){return!!(typeof k=="string"||typeof k=="function"||k===r||k===i||T||k===o||k===c||k===u||D||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===A||k.getModuleId!==void 0))}function F(k,te,fe){var $e=k.displayName;if($e)return $e;var Ve=te.displayName||te.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 te=k;return z(te)+".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,M=0,U,V,Y,q,O,H,K;function I(){}I.__reactDisabledLog=!0;function oe(){{if(M===0){U=console.log,V=console.info,Y=console.warn,q=console.error,O=console.group,H=console.groupCollapsed,K=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})}M++}}function ce(){{if(M--,M===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:Y}),error:G({},k,{value:q}),group:G({},k,{value:O}),groupCollapsed:G({},k,{value:H}),groupEnd:G({},k,{value:K})})}M<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=y.ReactCurrentDispatcher,he;function ie(k,te,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 ne=!1,le;{var xe=typeof WeakMap=="function"?WeakMap:Map;le=new xe}function Z(k,te){if(!k||ne)return"";{var fe=le.get(k);if(fe!==void 0)return fe}var $e;ne=!0;var Ve=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var qe;qe=de.current,de.current=null,oe();try{if(te){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{ne=!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,te,fe){return Z(k,!1)}function Ce(k){var te=k.prototype;return!!(te&&te.isReactComponent)}function Oe(k,te,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,te,fe);case h:{var $e=k,Ve=$e._payload,qe=$e._init;try{return Oe(qe(Ve),te,fe)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,We={},Be=y.ReactDebugCurrentFrame;function Ie(k){if(k){var te=k._owner,fe=Oe(k.type,k._source,te?te.type:null);Be.setExtraStackFrame(fe)}else Be.setExtraStackFrame(null)}function Ke(k,te,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](te,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 te=typeof Symbol=="function"&&Symbol.toStringTag,fe=te&&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 te=Object.getOwnPropertyDescriptor(k,"ref").get;if(te&&te.isReactWarning)return!1}return k.ref!==void 0}function En(k){if(Te.call(k,"key")){var te=Object.getOwnPropertyDescriptor(k,"key").get;if(te&&te.isReactWarning)return!1}return k.key!==void 0}function vn(k,te){if(typeof k.ref=="string"&&Le.current&&te&&Le.current.stateNode!==te){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,te){{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)",te))};fe.isReactWarning=!0,Object.defineProperty(k,"key",{get:fe,configurable:!0})}}function dn(k,te){{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)",te))};fe.isReactWarning=!0,Object.defineProperty(k,"ref",{get:fe,configurable:!0})}}var $n=function(k,te,fe,$e,Ve,qe,ze){var Fe={$$typeof:t,type:k,key:te,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,te,fe,$e,Ve){{var qe,ze={},Fe=null,Ae=null;fe!==void 0&&(Re(fe),Fe=""+fe),En(te)&&(Re(te.key),Fe=""+te.key),rn(te)&&(Ae=te.ref,vn(te,Ve));for(qe in te)Te.call(te,qe)&&!Ge.hasOwnProperty(qe)&&(ze[qe]=te[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 te=k._owner,fe=Oe(k.type,k._source,te?te.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 ri(){{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 te=k.fileName.replace(/^.*[\\\/]/,""),fe=k.lineNumber;return`
339
-
340
- Check your code at `+te+":"+fe+"."}return""}}var oi={};function aa(k){{var te=ri();if(!te){var fe=typeof k=="string"?k:k.displayName||k.name;fe&&(te=`
341
-
342
- Check the top-level render call using <`+fe+">.")}return te}}function Ci(k,te){{if(!k._store||k._store.validated||k.key!=null)return;k._store.validated=!0;var fe=aa(te);if(oi[fe])return;oi[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,te){{if(typeof k!="object")return;if(Bt(k))for(var fe=0;fe<k.length;fe++){var $e=k[fe];zn($e)&&Ci($e,te)}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,te)}}}function Ka(k){{var te=k.type;if(te==null||typeof te=="string")return;var fe;if(typeof te=="function")fe=te.propTypes;else if(typeof te=="object"&&(te.$$typeof===l||te.$$typeof===d))fe=te.propTypes;else return;if(fe){var $e=X(te);Ke(fe,k.props,"prop",$e,k)}else if(te.PropTypes!==void 0&&!_t){_t=!0;var Ve=X(te);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ve||"Unknown")}typeof te.getDefaultProps=="function"&&!te.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ei(k){{for(var te=Object.keys(k.props),fe=0;fe<te.length;fe++){var $e=te[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,te,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+=ri();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,te,fe,Ve,qe);if(me==null)return me;if(ze){var Me=te.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,te,fe){return la(k,te,fe,!0)}function Ri(k,te,fe){return la(k,te,fe,!1)}var Xa=Ri,Qa=Jn;pf.Fragment=r,pf.jsx=Xa,pf.jsxs=Qa}()),pf}var gf={};/**
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 SD;function $he(){if(SD)return gf;SD=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 gf.Fragment=n,gf.jsx=a,gf.jsxs=a,gf}process.env.NODE_ENV==="production"?W_.exports=$he():W_.exports=Phe();var Ee=W_.exports;function Pp(e){return e.mode==="multiple"}function $p(e){return e.mode==="range"}function bv(e){return e.mode==="single"}var Ohe={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 The(e,t){return Gi(e,"LLLL y",t)}function Dhe(e,t){return Gi(e,"d",t)}function Ahe(e,t){return Gi(e,"LLLL",t)}function Mhe(e){return"".concat(e)}function khe(e,t){return Gi(e,"cccccc",t)}function Ihe(e,t){return Gi(e,"yyyy",t)}var Nhe=Object.freeze({__proto__:null,formatCaption:The,formatDay:Dhe,formatMonthCaption:Ahe,formatWeekNumber:Mhe,formatWeekdayName:khe,formatYearCaption:Ihe}),Lhe=function(e,t,n){return Gi(e,"do MMMM (EEEE)",n)},Fhe=function(){return"Month: "},jhe=function(){return"Go to next month"},zhe=function(){return"Go to previous month"},Bhe=function(e,t){return Gi(e,"cccc",t)},Vhe=function(e){return"Week n. ".concat(e)},Hhe=function(){return"Year: "},Whe=Object.freeze({__proto__:null,labelDay:Lhe,labelMonthDropdown:Fhe,labelNext:jhe,labelPrevious:zhe,labelWeekNumber:Vhe,labelWeekday:Bhe,labelYearDropdown:Hhe});function Uhe(){var e="buttons",t=Ohe,n=L8,r={},o={},i=1,a={},s=new Date;return{captionLayout:e,classNames:t,formatters:Nhe,labels:Whe,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:a,today:s,mode:"default"}}function qhe(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=zE(o):n&&(a=new Date(n,11,31)),{fromDate:i?ud(i):void 0,toDate:a?ud(a):void 0}}var W8=m.createContext(void 0);function Ghe(e){var t,n=e.initialProps,r=Uhe(),o=qhe(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)||Pp(n)||$p(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(W8.Provider,{value:c,children:e.children})}function bn(){var e=m.useContext(W8);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function U8(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 Yhe(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 q8(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:Yhe;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 Khe(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(Ehe(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 b=function(x){var y=Number(x.target.value),_=ox(ro(e.displayMonth),y);e.onChange(_)},v=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:q8;return Ee.jsx(v,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:b,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 Xhe(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(),b=i.getFullYear(),v=p;v<=b;v++)h.push(wD(I8(new Date),v));var x=function(_){var S=wD(ro(n),Number(_.target.value));e.onChange(S)},y=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:q8;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 Qhe(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function Jhe(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&&Ch(i,o)<0){var c=-1*(l-1);o=wi(i,c)}return a&&Ch(o,a)<0&&(o=a),ro(o)}function Zhe(){var e=bn(),t=Jhe(e),n=Qhe(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 epe(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=ro(e),i=ro(wi(o,r)),a=Ch(i,o),s=[],l=0;l<a;l++){var c=wi(o,l);s.push(c)}return n&&(s=s.reverse()),s}function tpe(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 wi(s,a);var l=Ch(n,e);if(!(l<i))return wi(s,a)}}function npe(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 wi(s,-a);var l=Ch(s,n);if(!(l<=0))return wi(s,-a)}}var G8=m.createContext(void 0);function rpe(e){var t=bn(),n=Zhe(),r=n[0],o=n[1],i=epe(r,t),a=tpe(r,t),s=npe(r,t),l=function(d){return i.some(function(h){return VE(d,h)})},c=function(d,h){l(d)||(h&&V8(d,h)?o(wi(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(G8.Provider,{value:u,children:e.children})}function Op(){var e=m.useContext(G8);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function CD(e){var t,n=bn(),r=n.classNames,o=n.styles,i=n.components,a=Op().goToMonth,s=function(u){a(wi(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:U8,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(Khe,{onChange:s,displayMonth:e.displayMonth}),Ee.jsx(Xhe,{onChange:s,displayMonth:e.displayMonth})]})}function ope(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 ipe(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 Z0=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 ape(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(" "),b=u(e.nextMonth,{locale:i}),v=[a.nav_button,a.nav_button_next].join(" "),x=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:ipe,y=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:ope;return Ee.jsxs("div",{className:a.nav,style:s.nav,children:[!e.hidePrevious&&Ee.jsx(Z0,{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(Z0,{name:"next-month","aria-label":b,className:v,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 ED(e){var t=bn().numberOfMonths,n=Op(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,a=n.displayMonths,s=a.findIndex(function(b){return VE(e.displayMonth,b)}),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(ape,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:r,onPreviousClick:h,onNextClick:p})}function spe(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:U8,c;return o?c=Ee.jsx(l,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?c=Ee.jsx(CD,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?c=Ee.jsxs(Ee.Fragment,{children:[Ee.jsx(CD,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),Ee.jsx(ED,{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(ED,{displayMonth:e.displayMonth,id:e.id})]}),Ee.jsx("div",{className:r.caption,style:i.caption,children:c})}function lpe(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 cpe(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 upe(){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=cpe(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 dpe(){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:upe;return Ee.jsx("thead",{style:r.head,className:n.head,children:Ee.jsx(i,{})})}function fpe(e){var t=bn(),n=t.locale,r=t.formatters.formatDay;return Ee.jsx(Ee.Fragment,{children:r(e.date,{locale:n})})}var HE=m.createContext(void 0);function hpe(e){if(!Pp(e.initialProps)){var t={selected:void 0,modifiers:{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=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 b=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!b){var v=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!v){var x=r?H8([],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(HE.Provider,{value:l,children:n})}function WE(){var e=m.useContext(HE);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function gpe(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:H_(r,e)?{from:e,to:o}:{from:r,to:e}:o?H_(e,o)?{from:o,to:e}:{from:e,to:o}:r?V8(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var UE=m.createContext(void 0);function mpe(e){if(!$p(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return Ee.jsx(UE.Provider,{value:t,children:e.children})}return Ee.jsx(bpe,{initialProps:e.initialProps,children:e.children})}function bpe(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,b,v){var x,y;(x=t.onDayClick)===null||x===void 0||x.call(t,p,b,v);var _=gpe(p,r);(y=t.onSelect)===null||y===void 0||y.call(t,_,p,b,v)},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(UE.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function qE(){var e=m.useContext(UE);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function i0(e){return Array.isArray(e)?H8([],e,!0):e!==void 0?[e]:[]}function vpe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=i0(o)}),t}var _i;(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"})(_i||(_i={}));var ype=_i.Selected,xa=_i.Disabled,xpe=_i.Hidden,wpe=_i.Today,ix=_i.RangeEnd,ax=_i.RangeMiddle,sx=_i.RangeStart,_pe=_i.Outside;function Spe(e,t,n){var r,o=(r={},r[ype]=i0(e.selected),r[xa]=i0(e.disabled),r[xpe]=i0(e.hidden),r[wpe]=[e.today],r[ix]=[],r[ax]=[],r[sx]=[],r[_pe]=[],r);return e.fromDate&&o[xa].push({before:e.fromDate}),e.toDate&&o[xa].push({after:e.toDate}),Pp(e)?o[xa]=o[xa].concat(t.modifiers[xa]):$p(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 Y8=m.createContext(void 0);function Cpe(e){var t=bn(),n=WE(),r=qE(),o=Spe(t,n,r),i=vpe(t.modifiers),a=ot(ot({},o),i);return Ee.jsx(Y8.Provider,{value:a,children:e.children})}function K8(){var e=m.useContext(Y8);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Epe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Rpe(e){return!!(e&&typeof e=="object"&&"from"in e)}function Ppe(e){return!!(e&&typeof e=="object"&&"after"in e)}function $pe(e){return!!(e&&typeof e=="object"&&"before"in e)}function Ope(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Tpe(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 Dpe(e){return jE(e)}function Ape(e){return Array.isArray(e)&&e.every(jE)}function Mpe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Dpe(n))return to(e,n);if(Ape(n))return n.includes(e);if(Rpe(n))return Tpe(e,n);if(Ope(n))return n.dayOfWeek.includes(e.getDay());if(Epe(n)){var r=Hi(n.before,e),o=Hi(n.after,e),i=r>0,a=o<0,s=H_(n.before,n.after);return s?a&&i:i||a}return Ppe(n)?Hi(e,n.after)>0:$pe(n)?Hi(n.before,e)>0:typeof n=="function"?n(e):!1})}function GE(e,t,n){var r=Object.keys(t).reduce(function(i,a){var s=t[a];return Mpe(e,s)&&i.push(a),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!VE(e,n)&&(o.outside=!0),o}function kpe(e,t){for(var n=ro(e[0]),r=zE(e[e.length-1]),o,i,a=n;a<=r;){var s=GE(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 Ipe=365;function X8(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:V_,month:wi,year:wfe,startOfWeek:function(x){return o.ISOWeek?dc(x):Ji(x,{locale:d,weekStartsOn:l})},endOfWeek:function(x){return o.ISOWeek?N8(x):BE(x,{locale:d,weekStartsOn:l})}},p=h[n](e,r==="after"?1:-1);r==="before"&&c?p=_fe([c,p]):r==="after"&&u&&(p=Sfe([u,p]));var b=!0;if(i){var v=GE(p,i);b=!v.disabled&&!v.hidden}return b?p:s.count>Ipe?s.lastFocused:X8(p,{moveBy:n,direction:r,context:o,modifiers:i,retry:ot(ot({},s),{count:s.count+1})})}var Q8=m.createContext(void 0);function Npe(e){var t=Op(),n=K8(),r=m.useState(),o=r[0],i=r[1],a=m.useState(),s=a[0],l=a[1],c=kpe(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(),b=function(x,y){if(o){var _=X8(o,{moveBy:x,direction:y,context:p,modifiers:n});to(o,_)||(t.goToDate(_,o),h(_))}},v={focusedDay:o,focusTarget:u,blur:d,focus:h,focusDayAfter:function(){return b("day","after")},focusDayBefore:function(){return b("day","before")},focusWeekAfter:function(){return b("week","after")},focusWeekBefore:function(){return b("week","before")},focusMonthBefore:function(){return b("month","before")},focusMonthAfter:function(){return b("month","after")},focusYearBefore:function(){return b("year","before")},focusYearAfter:function(){return b("year","after")},focusStartOfWeek:function(){return b("startOfWeek","before")},focusEndOfWeek:function(){return b("endOfWeek","after")}};return Ee.jsx(Q8.Provider,{value:v,children:e.children})}function YE(){var e=m.useContext(Q8);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Lpe(e,t){var n=K8(),r=GE(e,n,t);return r}var KE=m.createContext(void 0);function Fpe(e){if(!bv(e.initialProps)){var t={selected:void 0};return Ee.jsx(KE.Provider,{value:t,children:e.children})}return Ee.jsx(jpe,{initialProps:e.initialProps,children:e.children})}function jpe(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(KE.Provider,{value:o,children:n})}function J8(){var e=m.useContext(KE);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function zpe(e,t){var n=bn(),r=J8(),o=WE(),i=qE(),a=YE(),s=a.focusDayAfter,l=a.focusDayBefore,c=a.focusWeekAfter,u=a.focusWeekBefore,d=a.blur,h=a.focus,p=a.focusMonthBefore,b=a.focusMonthAfter,v=a.focusYearBefore,x=a.focusYearAfter,y=a.focusStartOfWeek,_=a.focusEndOfWeek,S=function(V){var Y,q,O,H;bv(n)?(Y=r.onDayClick)===null||Y===void 0||Y.call(r,e,t,V):Pp(n)?(q=o.onDayClick)===null||q===void 0||q.call(o,e,t,V):$p(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 Y;h(e),(Y=n.onDayFocus)===null||Y===void 0||Y.call(n,e,t,V)},E=function(V){var Y;d(),(Y=n.onDayBlur)===null||Y===void 0||Y.call(n,e,t,V)},$=function(V){var Y;(Y=n.onDayMouseEnter)===null||Y===void 0||Y.call(n,e,t,V)},D=function(V){var Y;(Y=n.onDayMouseLeave)===null||Y===void 0||Y.call(n,e,t,V)},T=function(V){var Y;(Y=n.onDayPointerEnter)===null||Y===void 0||Y.call(n,e,t,V)},A=function(V){var Y;(Y=n.onDayPointerLeave)===null||Y===void 0||Y.call(n,e,t,V)},L=function(V){var Y;(Y=n.onDayTouchCancel)===null||Y===void 0||Y.call(n,e,t,V)},F=function(V){var Y;(Y=n.onDayTouchEnd)===null||Y===void 0||Y.call(n,e,t,V)},z=function(V){var Y;(Y=n.onDayTouchMove)===null||Y===void 0||Y.call(n,e,t,V)},X=function(V){var Y;(Y=n.onDayTouchStart)===null||Y===void 0||Y.call(n,e,t,V)},G=function(V){var Y;(Y=n.onDayKeyUp)===null||Y===void 0||Y.call(n,e,t,V)},M=function(V){var Y;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?v():p();break;case"PageDown":V.preventDefault(),V.stopPropagation(),V.shiftKey?x():b();break;case"Home":V.preventDefault(),V.stopPropagation(),y();break;case"End":V.preventDefault(),V.stopPropagation(),_();break}(Y=n.onDayKeyDown)===null||Y===void 0||Y.call(n,e,t,V)},U={onClick:S,onFocus:C,onBlur:E,onKeyDown:M,onKeyUp:G,onMouseEnter:$,onMouseLeave:D,onPointerEnter:T,onPointerLeave:A,onTouchCancel:L,onTouchEnd:F,onTouchMove:z,onTouchStart:X};return U}function Bpe(){var e=bn(),t=J8(),n=WE(),r=qE(),o=bv(e)?t.selected:Pp(e)?n.selected:$p(e)?r.selected:void 0;return o}function Vpe(e){return Object.values(_i).includes(e)}function Hpe(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(Vpe(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Wpe(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 Upe(e,t,n){var r,o,i,a=bn(),s=YE(),l=Lpe(e,t),c=zpe(e,l),u=Bpe(),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=Hpe(a,l).join(" "),p=Wpe(a,l),b=!!(l.outside&&!a.showOutsideDays||l.hidden),v=(i=(o=a.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:fpe,x=Ee.jsx(v,{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:b,activeModifiers:l,selectedDays:u,buttonProps:C,divProps:y};return E}function qpe(e){var t=m.useRef(null),n=Upe(e.date,e.displayMonth,t);return n.isHidden?Ee.jsx("div",{role:"gridcell"}):n.isButton?Ee.jsx(Z0,ot({name:"day",ref:t},n.buttonProps)):Ee.jsx("div",ot({},n.divProps))}function Gpe(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(Z0,{name:"week-number","aria-label":d,className:a.weeknumber,style:i.weeknumber,onClick:h,children:u})}function Ype(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:qpe,c=(n=s==null?void 0:s.WeekNumber)!==null&&n!==void 0?n:Gpe,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})},_he(d))})]})}function RD(e,t,n){for(var r=n!=null&&n.ISOWeek?N8(t):BE(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?F8(u):z8(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 Kpe(e,t){var n=RD(ro(e),zE(e),t);if(t!=null&&t.useFixedWeeks){var r=Che(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],a=V_(i,6-r),s=RD(V_(i,1),a,t);n.push.apply(n,s)}}return n}function Xpe(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,b=Kpe(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:i,weekStartsOn:d,firstWeekContainsDate:h}),v=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:dpe,x=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:Ype,y=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:lpe;return Ee.jsxs("table",{id:e.id,className:a.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&Ee.jsx(v,{}),Ee.jsx("tbody",{className:a.tbody,style:s.tbody,children:b.map(function(_){return Ee.jsx(x,{displayMonth:e.displayMonth,dates:_.dates,weekNumber:_.weekNumber},_.weekNumber)})}),Ee.jsx(y,{displayMonth:e.displayMonth})]})}function Qpe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Jpe=Qpe()?m.useLayoutEffect:m.useEffect,lx=!1,Zpe=0;function PD(){return"react-day-picker-".concat(++Zpe)}function ege(e){var t,n=e??(lx?PD():null),r=m.useState(n),o=r[0],i=r[1];return Jpe(function(){o===null&&i(PD())},[]),m.useEffect(function(){lx===!1&&(lx=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function tge(e){var t,n,r=bn(),o=r.dir,i=r.classNames,a=r.styles,s=r.components,l=Op().displayMonths,c=ege(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,b=e.displayIndex===l.length-1,v=!p&&!b;o==="rtl"&&(t=[p,b],b=t[0],p=t[1]),p&&(d.push(i.caption_start),h=ot(ot({},h),a.caption_start)),b&&(d.push(i.caption_end),h=ot(ot({},h),a.caption_end)),v&&(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:spe;return Ee.jsxs("div",{className:d.join(" "),style:h,children:[Ee.jsx(x,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Ee.jsx(Xpe,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function nge(e){var t=bn(),n=t.classNames,r=t.styles;return Ee.jsx("div",{className:n.months,style:r.months,children:e.children})}function rge(e){var t,n,r=e.initialProps,o=bn(),i=YE(),a=Op(),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(b){return b.startsWith("data-")}).reduce(function(b,v){var x;return ot(ot({},b),(x={},x[v]=r[v],x))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:nge;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(b,v){return Ee.jsx(tge,{displayIndex:v,displayMonth:b},v)})})}))}function oge(e){var t=e.children,n=Rhe(e,["children"]);return Ee.jsx(Ghe,{initialProps:n,children:Ee.jsx(rpe,{children:Ee.jsx(Fpe,{initialProps:n,children:Ee.jsx(hpe,{initialProps:n,children:Ee.jsx(mpe,{initialProps:n,children:Ee.jsx(Cpe,{children:Ee.jsx(Npe,{children:t})})})})})})})}function ige(e){return Ee.jsx(oge,ot({},e,{children:Ee.jsx(rge,{initialProps:e})}))}function Z8({className:e,classNames:t,showOutsideDays:n=!0,...r}){return R.jsx(ige,{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(wh({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(wh({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(mC,{...o,className:"h-4 w-4"}),IconRight:({...o})=>R.jsx(zb,{...o,className:"h-4 w-4"})},...r})}Z8.displayName="Calendar";function e4(e){const{authToken:t}=Mo(),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:b,isError:v,refetch:x,isSuccess:y}=lp({queryKey:["filter",e.id,e.sql,JSON.stringify(d)],queryFn:()=>pb("https://semaphor.cloud/api/v1/query",(t==null?void 0:t.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:d,cache_config:kS()}),enabled:!!e.sql&&!!e.connectionId&&u,placeholderData:_=>_});return m.useEffect(()=>{y&&i&&a(!1)},[y,i]),{data:h,isLoading:p,isFetching:b,isError:v,refetch:x}}function age({filter:e,className:t}){var S,C,E,$,D,T,A,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);Mo();const u=we(F=>F.actions.addOrUpdateFilterValue),d=we(F=>F.actions.removeFilterValue),{data:h,isLoading:p,isFetching:b,isError:v,refetch:x}=e4(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(xu,{className:"h-8 w-full bg-foreground/10"})}):v?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(fv,{open:r,onOpenChange:o,children:[R.jsx(hv,{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(wk,{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(Ep,{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(Z8,{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:(T=(D=n==null?void 0:n.chart)==null?void 0:D.options)==null?void 0:T.borderRadius},size:"sm",variant:"outline",onClick:_,children:"Apply"}),R.jsx(no,{style:{borderRadius:(L=(A=n==null?void 0:n.chart)==null?void 0:A.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 eb(){return eb=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},eb.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 tb(){return tb=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},tb.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(b,v){return o[v]!==b});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(v,x){for(v=String(v);v.length<x;)v=" "+v;return v};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 sge=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 lge=function(t){return t},cge=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},uge=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)}}},dge=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)}}},fge=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"])},hge=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))},pge=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=tb({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:lge,rangeExtractor:cge,onChange:function(){},measureElement:fge,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),b=p?p.end:a+s,v=o.get(h),x=typeof v=="number"?v:n.options.estimateSize(d),y=b+x,_=p?p.lane:d%n.options.lanes;u[d]={index:d,start:b,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?gge({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(tb({},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[t4(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),b=p[0];sge(b,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()},t4=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 gge(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,o=t.length-1,i=function(c){return t[c].start},a=t4(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 mge=typeof document<"u"?j.useLayoutEffect:j.useEffect;function bge(e){var t=j.useReducer(function(){return{}},{})[1],n=eb({},e,{onChange:function(a,s){s?Er.flushSync(t):t(),e.onChange==null||e.onChange(a,s)}}),r=j.useState(function(){return new pge(n)}),o=r[0];return o.setOptions(n),j.useEffect(function(){return o._didMount()},[]),mge(function(){return o._willUpdate()}),o}function vge(e){return bge(eb({observeElementRect:uge,observeElementOffset:dge,scrollToFn:hge},e))}var yge=Object.defineProperty,xge=(e,t,n)=>t in e?yge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ux=(e,t,n)=>(xge(e,typeof t!="symbol"?t+"":t,n),n);let wge=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 wge,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 XE(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 _ge(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 Sge(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 Sge(()=>{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 Tp(){let[e]=m.useState(fc);return m.useEffect(()=>()=>e.dispose(),[e]),e}function Cge(){let e=typeof document>"u";return"useSyncExternalStore"in j?(t=>t.useSyncExternalStore)(j)(()=>()=>{},()=>!1,()=>!e):!1}function QE(){let e=Cge(),[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 $D;let Dp=($D=m.useId)!=null?$D:function(){let e=QE(),[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 JE(e){return Zl.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let OD=["[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 Ege=(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))(Ege||{}),Rge=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Rge||{}),Pge=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Pge||{}),n4=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(n4||{});function $ge(e,t=0){var n;return e===((n=JE(e))==null?void 0:n.body)?!1:ur(t,{0(){return e.matches(OD)},1(){let r=e;for(;r!==null;){if(r.matches(OD))return!0;r=r.parentElement}return!1}})}var Oge=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Oge||{});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 Tge(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 Dge(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Age(){return/Android/gi.test(window.navigator.userAgent)}function r4(){return Dge()||Age()}function Cm(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 Mge(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 kge(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!$ge(l,n4.Loose)&&l.tabIndex!==-1&&a.preventDefault(),t(a,l)}let i=m.useRef(null);Cm("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),Cm("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),Cm("click",a=>{r4()||i.current&&(o(a,()=>i.current),i.current=null)},!0),Cm("touchend",a=>o(a,()=>a.target instanceof HTMLElement?a.target:null),!0),Mge("blur",a=>o(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Ige(...e){return m.useMemo(()=>JE(...e),[...e])}function TD(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 Nge(e,t){let[n,r]=m.useState(()=>TD(e));return Qn(()=>{r(TD(e))},[e.type,e.as]),Qn(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let Lge=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[Lge]))?void 0:n}function DD(e){return[e.screenX,e.screenY]}function Fge(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=DD(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=DD(t)}}}function jge({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=JE(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 AD(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 nb(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var rb=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(rb||{}),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??zge;let l=o4(t,e);if(i)return Em(l,n,r,a,s);let c=o??0;if(c&2){let{static:u=!1,...d}=l;if(u)return Em(d,n,r,a,s)}if(c&1){let{unmount:u=!0,...d}=l;return ur(u?0:1,{0(){return null},1(){return Em({...d,hidden:!0,style:{display:"none"}},n,r,a,s)}})}return Em(l,n,r,a,s)}function Em(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[b,v]of Object.entries(t))typeof v=="boolean"&&(h=!0),v===!0&&p.push(b);h&&(d["data-headlessui-state"]=p.join(" "))}if(i===m.Fragment&&Object.keys(U_(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(v=>` - ${v}`).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(v=>` - ${v}`).join(`
400
- `)].join(`
401
- `));let h=u.props,p=typeof(h==null?void 0:h.className)=="function"?(...v)=>nb(h==null?void 0:h.className(...v),l.className):nb(h==null?void 0:h.className,l.className),b=p?{className:p}:{};return m.cloneElement(u,Object.assign({},o4(u.props,U_(dx(l,["ref"]))),d,c,{ref:o(u.ref,c.ref)},b))}return m.createElement(i,Object.assign({},dx(l,["ref"]),i!==m.Fragment&&c,i!==m.Fragment&&d),u)}function zge(...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 o4(...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 U_(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 Bge="div";var i4=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(i4||{});function Vge(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:Bge,name:"Hidden"})}let Hge=ia(Vge),ZE=m.createContext(null);ZE.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 e2(){return m.useContext(ZE)}function a4({value:e,children:t}){return m.createElement(ZE.Provider,{value:e},t)}function Wge(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Rl=[];Wge(()=>{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 Uge(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&&qge(n)?!1:r}function qge(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function Gge(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 MD(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:Gge(e)}}function s4(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))c4(n,l4(t,r),o);return n}function l4(e,t){return e?e+"["+t+"]":t}function c4(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())c4(e,l4(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,""]):s4(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||{}),Yge=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Yge||{}),Kge=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Kge||{}),Xge=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Xge||{}),Qge=(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))(Qge||{});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):Tge(r,a=>a.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let Jge={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:MD(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var h,p;return(p=(h=e.activeOptionIndex)!=null?h:e.virtual.options.findIndex(b=>!e.virtual.disabled(b)))!=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:MD(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})}}},t2=m.createContext(null);t2.displayName="ComboboxActionsContext";function Ap(e){let t=m.useContext(t2);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ap),n}return t}let u4=m.createContext(null);function Zge(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=vge({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(u4.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 n2=m.createContext(null);n2.displayName="ComboboxDataContext";function Ec(e){let t=m.useContext(n2);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 eme(e,t){return ur(t.type,Jge,e,t)}let tme=m.Fragment;function nme(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,...b}=e,v=!1,x=null,[y=d?[]:void 0,_]=_ge(n,o,r),[S,C]=m.useReducer(eme,{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}),D=m.useRef(null),T=m.useRef(null),A=m.useRef(null),L=m.useRef(null),F=$t(typeof s=="string"?(ne,le)=>{let xe=s;return(ne==null?void 0:ne[xe])===(le==null?void 0:le[xe])}:s??((ne,le)=>ne===le)),z=$t(ne=>S.options.findIndex(le=>F(le.dataRef.current.value,ne))),X=m.useCallback(ne=>ur(M.mode,{1:()=>y.some(le=>F(le,ne)),0:()=>F(y,ne)}),[y]),G=$t(ne=>S.activeOptionIndex===z(ne)),M=m.useMemo(()=>({...S,immediate:v,optionsPropsRef:$,labelRef:D,inputRef:T,buttonRef:A,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 ne=S.options.findIndex(le=>!le.dataRef.current.disabled);if(ne!==-1)return ne}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=M},[M]),kge([M.buttonRef,M.inputRef,M.optionsRef],()=>ce.closeCombobox(),M.comboboxState===0);let U=m.useMemo(()=>{var ne,le,xe;return{open:M.comboboxState===0,disabled:l,activeIndex:M.activeOptionIndex,activeOption:M.activeOptionIndex===null?null:M.virtual?M.virtual.options[(ne=M.activeOptionIndex)!=null?ne:0]:(xe=(le=M.options[M.activeOptionIndex])==null?void 0:le.dataRef.current.value)!=null?xe:null,value:y}},[M,l,y]),V=$t(()=>{if(M.activeOptionIndex!==null){if(M.virtual)I(M.virtual.options[M.activeOptionIndex]);else{let{dataRef:ne}=M.options[M.activeOptionIndex];I(ne.current.value)}ce.goToOption(Kn.Specific,M.activeOptionIndex)}}),Y=$t(()=>{C({type:0}),E.current=!0}),q=$t(()=>{C({type:1}),E.current=!1}),O=$t((ne,le,xe)=>(E.current=!1,ne===Kn.Specific?C({type:2,focus:Kn.Specific,idx:le,trigger:xe}):C({type:2,focus:ne,trigger:xe}))),H=$t((ne,le)=>(C({type:3,payload:{id:ne,dataRef:le}}),()=>{M.isActive(le.current.value)&&(E.current=!0),C({type:4,id:ne})})),K=$t(ne=>(C({type:5,id:ne}),()=>C({type:5,id:null}))),I=$t(ne=>ur(M.mode,{0(){return _==null?void 0:_(ne)},1(){let le=M.value.slice(),xe=le.findIndex(Z=>F(Z,ne));return xe===-1?le.push(ne):le.splice(xe,1),_==null?void 0:_(le)}})),oe=$t(ne=>{C({type:6,trigger:ne})}),ce=m.useMemo(()=>({onChange:I,registerOption:H,registerLabel:K,goToOption:O,closeCombobox:q,openCombobox:Y,setActivationTrigger:oe,selectActiveOption:V}),[]),de=t===null?{}:{ref:t},he=m.useRef(null),ie=Tp();return m.useEffect(()=>{he.current&&r!==void 0&&ie.addEventListener(he.current,"reset",()=>{_==null||_(r)})},[he,_]),m.createElement(t2.Provider,{value:ce},m.createElement(n2.Provider,{value:M},m.createElement(a4,{value:ur(M.comboboxState,{0:So.Open,1:So.Closed})},a!=null&&y!=null&&s4({[a]:y}).map(([ne,le],xe)=>m.createElement(Hge,{features:i4.Hidden,ref:xe===0?Z=>{var ve;he.current=(ve=Z==null?void 0:Z.closest("form"))!=null?ve:null}:void 0,...U_({key:ne,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:ne,value:le})})),Ua({ourProps:de,theirProps:b,slot:U,defaultTag:tme,name:"Combobox"}))))}let rme="input";function ome(e,t){var n,r,o,i,a;let s=Dp(),{id:l=`headlessui-combobox-input-${s}`,onChange:c,displayValue:u,type:d="text",...h}=e,p=Ec("Combobox.Input"),b=Ap("Combobox.Input"),v=Cc(p.inputRef,t),x=Ige(p.inputRef),y=m.useRef(!1),_=Tp(),S=$t(()=>{b.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),b.goToOption(Kn.Nothing)}),C=function(){var M;return typeof u=="function"&&p.value!==void 0?(M=u(p.value))!=null?M:"":typeof p.value=="string"?p.value:""}();AD(([M,U],[V,Y])=>{if(y.current)return;let q=p.inputRef.current;q&&((Y===0&&U===1||M!==V)&&(q.value=M),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]),AD(([M],[U])=>{if(M===0&&U===1){if(y.current)return;let V=p.inputRef.current;if(!V)return;let Y=V.value,{selectionStart:q,selectionEnd:O,selectionDirection:H}=V;V.value="",V.value=Y,H!==null?V.setSelectionRange(q,O,H):V.setSelectionRange(q,O)}},[p.comboboxState]);let E=m.useRef(!1),$=$t(()=>{E.current=!0}),D=$t(()=>{_.nextFrame(()=>{E.current=!1})}),T=$t(M=>{switch(y.current=!0,M.key){case bo.Enter:if(y.current=!1,p.comboboxState!==0||E.current)return;if(M.preventDefault(),M.stopPropagation(),p.activeOptionIndex===null){b.closeCombobox();return}b.selectActiveOption(),p.mode===0&&b.closeCombobox();break;case bo.ArrowDown:return y.current=!1,M.preventDefault(),M.stopPropagation(),ur(p.comboboxState,{0:()=>b.goToOption(Kn.Next),1:()=>b.openCombobox()});case bo.ArrowUp:return y.current=!1,M.preventDefault(),M.stopPropagation(),ur(p.comboboxState,{0:()=>b.goToOption(Kn.Previous),1:()=>{b.openCombobox(),_.nextFrame(()=>{p.value||b.goToOption(Kn.Last)})}});case bo.Home:if(M.shiftKey)break;return y.current=!1,M.preventDefault(),M.stopPropagation(),b.goToOption(Kn.First);case bo.PageUp:return y.current=!1,M.preventDefault(),M.stopPropagation(),b.goToOption(Kn.First);case bo.End:if(M.shiftKey)break;return y.current=!1,M.preventDefault(),M.stopPropagation(),b.goToOption(Kn.Last);case bo.PageDown:return y.current=!1,M.preventDefault(),M.stopPropagation(),b.goToOption(Kn.Last);case bo.Escape:return y.current=!1,p.comboboxState!==0?void 0:(M.preventDefault(),p.optionsRef.current&&!p.optionsPropsRef.current.static&&M.stopPropagation(),p.nullable&&p.mode===0&&p.value===null&&S(),b.closeCombobox());case bo.Tab:if(y.current=!1,p.comboboxState!==0)return;p.mode===0&&p.activationTrigger!==1&&b.selectActiveOption(),b.closeCombobox();break}}),A=$t(M=>{c==null||c(M),p.nullable&&p.mode===0&&M.target.value===""&&S(),b.openCombobox()}),L=$t(M=>{var U,V,Y;let q=(U=M.relatedTarget)!=null?U:Rl.find(O=>O!==M.currentTarget);if(y.current=!1,!((V=p.optionsRef.current)!=null&&V.contains(q))&&!((Y=p.buttonRef.current)!=null&&Y.contains(q))&&p.comboboxState===0)return M.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?S():p.activationTrigger!==1&&b.selectActiveOption()),b.closeCombobox()}),F=$t(M=>{var U,V,Y;let q=(U=M.relatedTarget)!=null?U:Rl.find(O=>O!==M.currentTarget);(V=p.buttonRef.current)!=null&&V.contains(q)||(Y=p.optionsRef.current)!=null&&Y.contains(q)||p.disabled||p.immediate&&p.comboboxState!==0&&(b.openCombobox(),_.nextFrame(()=>{b.setActivationTrigger(1)}))}),z=XE(()=>{if(p.labelId)return[p.labelId].join(" ")},[p.labelId]),X=m.useMemo(()=>({open:p.comboboxState===0,disabled:p.disabled}),[p]),G={ref:v,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(M=>{var U;return!((U=p.virtual)!=null&&U.disabled(M.dataRef.current.value))&&p.compare(M.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:D,onKeyDown:T,onChange:A,onFocus:F,onBlur:L};return Ua({ourProps:G,theirProps:h,slot:X,defaultTag:rme,name:"Combobox.Input"})}let ime="button";function ame(e,t){var n;let r=Ec("Combobox.Button"),o=Ap("Combobox.Button"),i=Cc(r.buttonRef,t),a=Dp(),{id:s=`headlessui-combobox-button-${a}`,...l}=e,c=Tp(),u=$t(v=>{switch(v.key){case bo.ArrowDown:return v.preventDefault(),v.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 v.preventDefault(),v.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:(v.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&v.stopPropagation(),o.closeCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})}));default:return}}),d=$t(v=>{if(Uge(v.currentTarget))return v.preventDefault();r.comboboxState===0?o.closeCombobox():(v.preventDefault(),o.openCombobox()),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),h=XE(()=>{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]),b={ref:i,id:s,type:Nge(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:b,theirProps:l,slot:p,defaultTag:ime,name:"Combobox.Button"})}let sme="label";function lme(e,t){let n=Dp(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=Ec("Combobox.Label"),a=Ap("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:sme,name:"Combobox.Label"})}let cme="ul",ume=rb.RenderStrategy|rb.Static;function dme(e,t){let n=Dp(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,a=Ec("Combobox.Options"),s=Cc(a.optionsRef,t),l=e2(),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]),jge({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=XE(()=>{var p,b;return(b=a.labelId)!=null?b:(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(Zge,null,i.children)}),Ua({ourProps:h,theirProps:i,slot:d,defaultTag:cme,features:ume,visible:c,name:"Combobox.Options"})}let fme="li";function hme(e,t){var n;let r=Dp(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:a,order:s=null,...l}=e,c=Ec("Combobox.Option"),u=Ap("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),b=Yi({disabled:i,value:a,domRef:p,order:s}),v=m.useContext(u4),x=Cc(t,p,v?v.measureElement:null),y=$t(()=>u.onChange(a));Qn(()=>u.registerOption(o,b),[b,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(),r4()||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=Fge(),$=$t(L=>E.update(L)),D=$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)}),T=$t(L=>{var F;E.wasMoved(L)&&(i||(F=c.virtual)!=null&&F.disabled(a)||d&&(c.optionsPropsRef.current.hold||u.goToOption(Kn.Nothing)))}),A=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:D,onMouseMove:D,onPointerLeave:T,onMouseLeave:T},theirProps:l,slot:A,defaultTag:fme,name:"Combobox.Option"})}let pme=ia(nme),gme=ia(ame),mme=ia(ome),bme=ia(lme),vme=ia(dme),yme=ia(hme),mf=Object.assign(pme,{Input:mme,Button:gme,Label:bme,Options:vme,Option:yme});function r2(){let e=m.useRef(!1);return Qn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function xme(e=0){let[t,n]=m.useState(e),r=r2(),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 wme(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 _me(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 Sme(e,t,n,r){let o=n?"enter":"leave",i=fc(),a=r!==void 0?wme(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),_me(e,()=>(px(e,...t.base,...s),hx(e,...t.base,...t.entered),a()))}),i.dispose}function Cme({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let a=r2(),s=Tp(),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(Sme(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 Eme=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Eme||{});function Rme(){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 Pme(){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 d4(e,t){let n=Yi(e),r=m.useRef([]),o=r2(),i=Tp(),a=$t((p,b=Ms.Hidden)=>{let v=r.current.findIndex(({el:x})=>x===p);v!==-1&&(ur(b,{[Ms.Unmount](){r.current.splice(v,1)},[Ms.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var x;!xv(r)&&o.current&&((x=n.current)==null||x.call(n))}))}),s=$t(p=>{let b=r.current.find(({el:v})=>v===p);return b?b.state!=="visible"&&(b.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,b,v)=>{l.current.splice(0),t&&(t.chains.current[b]=t.chains.current[b].filter(([x])=>x!==p)),t==null||t.chains.current[b].push([p,new Promise(x=>{l.current.push(x)})]),t==null||t.chains.current[b].push([p,new Promise(x=>{Promise.all(u.current[b].map(([y,_])=>_)).then(()=>x())})]),b==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(b)):v(b)}),h=$t((p,b,v)=>{Promise.all(u.current[b].splice(0).map(([x,y])=>y)).then(()=>{var x;(x=l.current.shift())==null||x()}).then(()=>v(b))});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 $me(){}let Ome=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function kD(e){var t;let n={};for(let r of Ome)n[r]=(t=e[r])!=null?t:$me;return n}function Tme(e){let t=m.useRef(kD(e));return m.useEffect(()=>{t.current=kD(e)},[e]),t}let Dme="div",f4=rb.RenderStrategy;function Ame(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:b,...v}=e,x=m.useRef(null),y=Cc(x,t),_=(n=v.unmount)==null||n?Ms.Unmount:Ms.Hidden,{show:S,appear:C,initial:E}=Rme(),[$,D]=m.useState(S?"visible":"hidden"),T=Pme(),{register:A,unregister:L}=T;m.useEffect(()=>A(x),[A,x]),m.useEffect(()=>{if(_===Ms.Hidden&&x.current){if(S&&$!=="visible"){D("visible");return}return ur($,{hidden:()=>L(x),visible:()=>A(x)})}},[$,x,A,L,S,_]);let F=Yi({base:fs(v.className),enter:fs(l),enterFrom:fs(c),enterTo:fs(u),entered:fs(d),leave:fs(h),leaveFrom:fs(p),leaveTo:fs(b)}),z=Tme({beforeEnter:o,afterEnter:i,beforeLeave:a,afterLeave:s}),X=QE();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,M=C&&S&&E,U=!X||G?"idle":S?"enter":"leave",V=xme(0),Y=$t(oe=>ur(oe,{enter:()=>{V.addFlag(So.Opening),z.current.beforeEnter()},leave:()=>{V.addFlag(So.Closing),z.current.beforeLeave()},idle:()=>{}})),q=$t(oe=>ur(oe,{enter:()=>{V.removeFlag(So.Opening),z.current.afterEnter()},leave:()=>{V.removeFlag(So.Closing),z.current.afterLeave()},idle:()=>{}})),O=d4(()=>{D("hidden"),L(x)},T),H=m.useRef(!1);Cme({immediate:M,container:x,classes:F,direction:U,onStart:Yi(oe=>{H.current=!0,O.onStart(x,oe,Y)}),onStop:Yi(oe=>{H.current=!1,O.onStop(x,oe,q),oe==="leave"&&!xv(O)&&(D("hidden"),L(x))})});let K=v,I={ref:y};return M?K={...K,className:nb(v.className,...F.current.enter,...F.current.enterFrom)}:H.current&&(K.className=nb(v.className,(r=x.current)==null?void 0:r.className),K.className===""&&delete K.className),m.createElement(yv.Provider,{value:O},m.createElement(a4,{value:ur($,{visible:So.Open,hidden:So.Closed})|V.flags},Ua({ourProps:I,theirProps:K,defaultTag:Dme,features:f4,visible:$==="visible",name:"Transition.Child"})))}function Mme(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,a=m.useRef(null),s=Cc(a,t);QE();let l=e2();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=d4(()=>{u("hidden")}),[h,p]=m.useState(!0),b=m.useRef([n]);Qn(()=>{h!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),p(!1))},[b,n]);let v=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:v},Ua({ourProps:{...x,as:m.Fragment,children:m.createElement(h4,{ref:s,...x,...i,beforeEnter:y,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:f4,visible:c==="visible",name:"Transition"})))}function kme(e,t){let n=m.useContext(vv)!==null,r=e2()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(q_,{ref:t,...e}):m.createElement(h4,{ref:t,...e}))}let q_=ia(Mme),h4=ia(Ame),Ime=ia(kme),Nme=Object.assign(q_,{Child:Ime,Root:q_});function Lme(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 Fme(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 pd.includes(e)?o:r}const p4="Checkbox",[jme,p5e]=hr(p4),[zme,Bme]=jme(p4),Vme=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)),b=m.useRef(!1),v=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(zme,{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":g4(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),v&&(b.current=S.isPropagationStopped(),b.current||S.stopPropagation())})})),v&&m.createElement(Ume,{control:d,bubbles:!b.current,name:r,value:l,checked:x,required:a,disabled:s,style:{transform:"translateX(-100%)"}}))}),Hme="CheckboxIndicator",Wme=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Bme(Hme,n);return m.createElement(pr,{present:r||ec(i.state)||i.state===!0},m.createElement(Qe.span,ue({"data-state":g4(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Ume=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),a=iv(n),s=Zb(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 g4(e){return ec(e)?"indeterminate":e?"checked":"unchecked"}const m4=Vme,qme=Wme,wv=j.forwardRef(({className:e,...t},n)=>R.jsx(m4,{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(qme,{className:ye("flex items-center justify-center text-current"),children:R.jsx(fp,{className:"h-4 w-4"})})}));wv.displayName=m4.displayName;function Gme({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,a]=m.useState(""),s=m.useRef(null);Mo();const l=we(T=>T.filterValues),c=we(T=>T.selectedSheetId),u=we(T=>T.actions.addOrUpdateFilterValue),d=we(T=>T.actions.removeFilterValue),{data:h,isLoading:p,isFetching:b,isError:v,refetch:x}=e4(e),y=m.useMemo(()=>{var T;return(T=h==null?void 0:h.records)==null?void 0:T.map(A=>{let L=e.column.split(".").slice(-1)[0].replace(/"/g,"");return A[L]===void 0&&(L=L.toLowerCase()),{id:A[L],value:A[L]}})},[h,e.column]);m.useEffect(()=>{if(l){const T=l.find(A=>A.filterId===e.id);if(!T){n([]);return}if(T.operation==="in"){const A=y==null?void 0:y.filter(L=>T.values.includes(L.value));A&&n(A)}else o(`${T.operation} ${T.values[0]}`)}},[h,c,l]),m.useEffect(()=>{if(l&&!l.find(A=>A.filterId===e.id)){n([]);return}},[l,e.id]);function _(T){const A=Lme(T[0].toString());if(!(A!=null&&A.value)||!(A!=null&&A.operation))return;const L={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:vu(e),name:e.column,operation:A.operation,values:[Number(A.value)]};u(L)}function S(T){if(Array.isArray(T)||(T=[T]),console.log("onComboBoxChange",T),T.length===1&&y.find(L=>L.value===T[0].value)===void 0){_(T);return}if(n(T),T.length===0){d(e.id);return}const A={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:vu(e),operation:e.operation,values:T.map(L=>L.value)};u(A)}function C(T){if(T){n(y);const A={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(A)}else n([]),d(e.id)}const E=t.length===(y==null?void 0:y.length);if(p)return R.jsx("div",{children:R.jsx(xu,{className:"h-8 w-full bg-foreground/10"})});if(v)return R.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let $=[];ap.includes(e.dataType)?$=y:$=i===""?y:y==null?void 0:y.filter(T=>T.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,"")));const D=e.type==="single";return R.jsx("div",{className:"w-full",children:R.jsx(mf,{value:t,multiple:!D,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(mf.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:T=>T.map(L=>L.value).join(", ")||r,onChange:T=>{o(T.target.value),a(T.target.value)}}),R.jsx(mf.Button,{ref:s,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:R.jsx(_Q,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),R.jsx(Nme,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>a(""),children:R.jsxs(mf.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(T=>R.jsx(mf.Option,{className:({active:A})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${A?"bg-muted":"text-foreground-900"}`,value:T,children:({selected:A,active:L})=>R.jsxs("div",{className:"",children:[R.jsx("span",{className:`block ${A?"font-medium":"font-normal"}`,children:typeof T.value=="boolean"?T.value?"True":"False":T.value}),A?R.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:R.jsx(pk,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},T.value))]})})]})})})}const o2=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}));o2.displayName="Textarea";const b4="Radio",[Yme,v4]=hr(b4),[Kme,Xme]=Yme(b4),Qme=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,v=>d(v)),p=m.useRef(!1),b=u?!!u.closest("form"):!0;return m.createElement(Kme,{scope:n,checked:o,disabled:a},m.createElement(Qe.button,ue({type:"button",role:"radio","aria-checked":o,"data-state":y4(o),"data-disabled":a?"":void 0,disabled:a,value:s},c,{ref:h,onClick:ke(e.onClick,v=>{o||l==null||l(),b&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})})),b&&m.createElement(e0e,{control:u,bubbles:!p.current,name:r,value:s,checked:o,required:i,disabled:a,style:{transform:"translateX(-100%)"}}))}),Jme="RadioIndicator",Zme=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=Xme(Jme,n);return m.createElement(pr,{present:r||i.checked},m.createElement(Qe.span,ue({"data-state":y4(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),e0e=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),a=iv(n),s=Zb(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 y4(e){return e?"checked":"unchecked"}const t0e=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],x4="RadioGroup",[n0e,g5e]=hr(x4,[md,v4]),w4=md(),_4=v4(),[r0e,o0e]=n0e(x4),i0e=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=w4(n),b=vc(c),[v,x]=Fr({prop:i,defaultProp:o,onChange:d});return m.createElement(r0e,{scope:n,name:r,required:a,disabled:s,value:v,onValueChange:x},m.createElement(BS,ue({asChild:!0},p,{orientation:l,dir:b,loop:u}),m.createElement(Qe.div,ue({role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:b},h,{ref:t}))))}),a0e="RadioGroupItem",s0e=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=o0e(a0e,n),a=i.disabled||r,s=w4(n),l=_4(n),c=m.useRef(null),u=Rt(t,c),d=i.value===o.value,h=m.useRef(!1);return m.useEffect(()=>{const p=v=>{t0e.includes(v.key)&&(h.current=!0)},b=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",b)}},[]),m.createElement(VS,ue({asChild:!0},s,{focusable:!a,active:d}),m.createElement(Qme,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())})})))}),l0e=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=_4(n);return m.createElement(Zme,ue({},o,r,{ref:t}))}),S4=i0e,C4=s0e,c0e=l0e,i2=j.forwardRef(({className:e,...t},n)=>R.jsx(S4,{className:ye("grid gap-2",e),...t,ref:n}));i2.displayName=S4.displayName;const ob=j.forwardRef(({className:e,...t},n)=>R.jsx(C4,{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(c0e,{className:"flex items-center justify-center",children:R.jsx(bC,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ob.displayName=C4.displayName;function u0e({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 d0e({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(fv,{open:r,onOpenChange:o,children:[R.jsx(hv,{children:R.jsx(xC,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),R.jsxs(Ep,{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(Sp,{}),R.jsxs("div",{className:"space-y-2",children:[R.jsx(Tn,{children:"Type"}),R.jsxs(i2,{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(ob,{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(ob,{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(f0e,{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(o2,{onKeyDown:d=>{d.stopPropagation()},value:t,onChange:d=>n(d.target.value),className:`min-w-full grow resize font-mono text-xs ${Ff}`})]}),R.jsx("div",{children:R.jsx(u0e,{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(fp,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function f0e({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 E4({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(d0e,{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(vC,{className:"size-3.5"})}),t&&R.jsx(bd,{onClick:()=>{o(e.id),i(e.id)},className:"size-3.5 cursor-pointer text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})]})]})})}var h0e=e=>{switch(e){case"success":return m0e;case"info":return v0e;case"warning":return b0e;case"error":return y0e;default:return null}},p0e=Array(12).fill(0),g0e=({visible:e})=>m.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},m.createElement("div",{className:"sonner-spinner"},p0e.map((t,n)=>m.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),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:"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"})),b0e=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"})),v0e=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"})),y0e=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"})),x0e=()=>{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},G_=1,w0e=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:G_++,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(S0e(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)||G_++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},vo=new w0e,_0e=(e,t)=>{let n=(t==null?void 0:t.id)||G_++;return vo.addToast({title:e,...t,id:n}),n},S0e=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",C0e=_0e,E0e=()=>vo.toasts,R4=Object.assign(C0e,{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:E0e});function R0e(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))}R0e(`: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 Rm(e){return e.label!==void 0}var P0e=3,$0e="32px",O0e=4e3,T0e=356,D0e=14,A0e=20,M0e=200;function k0e(...e){return e.filter(Boolean).join(" ")}var I0e=e=>{var t,n,r,o,i,a,s,l,c,u;let{invert:d,toast:h,unstyled:p,interacting:b,setHeights:v,visibleToasts:x,heights:y,index:_,toasts:S,expanded:C,removeToast:E,defaultRichColors:$,closeButton:D,style:T,cancelButtonStyle:A,actionButtonStyle:L,className:F="",descriptionClassName:z="",duration:X,position:G,gap:M,loadingIcon:U,expandByDefault:V,classNames:Y,icons:q,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:H,cn:K}=e,[I,oe]=m.useState(!1),[ce,de]=m.useState(!1),[he,ie]=m.useState(!1),[ne,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:D},[h.closeButton,D]),pe=m.useMemo(()=>h.duration||X||O0e,[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=x0e(),vn=h.invert||d,Wt=Ie==="loading";Le.current=m.useMemo(()=>It*M+rn,[It,rn]),m.useEffect(()=>{oe(!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),v(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,v,h.id]);let dn=m.useCallback(()=>{de(!0),Z(Le.current),v(rt=>rt.filter(mt=>mt.toastId!==h.id)),setTimeout(()=>{E(h)},M0e)},[h,E,v,Le]);m.useEffect(()=>{if(h.promise&&Ie==="loading"||h.duration===1/0||h.type==="loading")return;let rt,mt=pe;return C||b||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,b,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),v(Nt=>[{toastId:h.id,height:mt,position:h.position},...Nt]),()=>v(Nt=>Nt.filter(on=>on.toastId!==h.id))}},[v,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(g0e,{visible:Ie==="loading"})}return m.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Te,className:K(F,dt,Y==null?void 0:Y.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,Y==null?void 0:Y.default,Y==null?void 0:Y[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":ne,"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`,...T,...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(ne||!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()),ri=Math.abs(_t)/zn;if(Math.abs(_t)>=A0e||ri>.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:K(Y==null?void 0:Y.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:K(Y==null?void 0:Y.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])||h0e(Ie):null):null,m.createElement("div",{"data-content":"",className:K(Y==null?void 0:Y.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},m.createElement("div",{"data-title":"",className:K(Y==null?void 0:Y.title,(s=h==null?void 0:h.classNames)==null?void 0:s.title)},h.title),h.description?m.createElement("div",{"data-description":"",className:K(z,Bt,Y==null?void 0:Y.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},h.description):null),m.isValidElement(h.cancel)?h.cancel:h.cancel&&Rm(h.cancel)?m.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||A,onClick:rt=>{var mt,Nt;Rm(h.cancel)&&Ke&&((Nt=(mt=h.cancel).onClick)==null||Nt.call(mt,rt),dn())},className:K(Y==null?void 0:Y.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&&Rm(h.action)?m.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:rt=>{var mt,Nt;Rm(h.action)&&(rt.defaultPrevented||((Nt=(mt=h.action).onClick)==null||Nt.call(mt,rt),dn()))},className:K(Y==null?void 0:Y.actionButton,(u=h==null?void 0:h.classNames)==null?void 0:u.actionButton)},h.action.label):null))};function ID(){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 N0e=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=P0e,toastOptions:p,dir:b=ID(),gap:v=D0e,loadingIcon:x,icons:y,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S,cn:C=k0e}=e,[E,$]=m.useState([]),D=m.useMemo(()=>Array.from(new Set([n].concat(E.filter(H=>H.position).map(H=>H.position)))),[E,n]),[T,A]=m.useState([]),[L,F]=m.useState(!1),[z,X]=m.useState(!1),[G,M]=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,""),Y=m.useRef(null),q=m.useRef(!1),O=m.useCallback(H=>{var K;(K=E.find(I=>I.id===H.id))!=null&&K.delete||vo.dismiss(H.id),$(I=>I.filter(({id:oe})=>oe!==H.id))},[E]);return m.useEffect(()=>vo.subscribe(H=>{if(H.dismiss){$(K=>K.map(I=>I.id===H.id?{...I,delete:!0}:I));return}setTimeout(()=>{Er.flushSync(()=>{$(K=>{let I=K.findIndex(oe=>oe.id===H.id);return I!==-1?[...K.slice(0,I),{...K[I],...H},...K.slice(I+1)]:[H,...K]})})})}),[]),m.useEffect(()=>{if(l!=="system"){M(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:H})=>{M(H?"dark":"light")})},[l]),m.useEffect(()=>{E.length<=1&&F(!1)},[E]),m.useEffect(()=>{let H=K=>{var I,oe;r.every(ce=>K[ce]||K.code===ce)&&(F(!0),(I=U.current)==null||I.focus()),K.code==="Escape"&&(document.activeElement===U.current||(oe=U.current)!=null&&oe.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[r]),m.useEffect(()=>{if(U.current)return()=>{Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null,q.current=!1)}},[U.current]),E.length?m.createElement("section",{"aria-label":`${_} ${V}`,tabIndex:-1},D.map((H,K)=>{var I;let[oe,ce]=H.split("-");return m.createElement("ol",{key:H,dir:b==="auto"?ID():b,tabIndex:-1,ref:U,className:a,"data-sonner-toaster":!0,"data-theme":G,"data-y-position":oe,"data-x-position":ce,style:{"--front-toast-height":`${((I=T[0])==null?void 0:I.height)||0}px`,"--offset":typeof s=="number"?`${s}px`:s||$0e,"--width":`${T0e}px`,"--gap":`${v}px`,...d},onBlur:de=>{q.current&&!de.currentTarget.contains(de.relatedTarget)&&(q.current=!1,Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null))},onFocus:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||q.current||(q.current=!0,Y.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&&K===0||de.position===H).map((de,he)=>{var ie,ne;return m.createElement(I0e,{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:(ne=p==null?void 0:p.closeButton)!=null?ne: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:T.filter(le=>le.position==de.position),setHeights:A,expandByDefault:o,gap:v,loadingIcon:x,expanded:L,pauseWhenPageIsHidden:S,cn:C})}))})):null};function L0e(){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(),R4.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(b=>{const v=b.id;b.id=Fs(),v===p&&(h.activeCardId=b.id,b.title=`${b.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 F0e=p$.WidthProvider(p$.Responsive),a2=e=>pd.includes(e.dataType)?R.jsx(age,{filter:e}):R.jsx(Gme,{filter:e});function j0e({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();L0e();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(P4,{className:"after:content-none",ref:_,handleAxis:y});function b(){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(E4,{filter:_}),a2(_)]},_.id)})}function v(){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(Bb,{FallbackComponent:({error:_,resetErrorBoundary:S})=>R.jsx(aJ,{error:_,resetErrorBoundary:S,frame:y}),children:R.jsx(bfe,{frame:y})})},y.id))}return R.jsx(R.Fragment,{children:R.jsxs(F0e,{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:[b(),v()]})})}const P4=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})));P4.displayName="ResizeHandle";let z0e=(e,t=21)=>(n=t)=>{let r="",o=n;for(;o--;)r+=e[Math.random()*e.length|0];return r};var Rd={exports:{}};const B0e=typeof Buffer<"u",ND=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,LD=/"(?: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 $4(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),B0e&&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(ND.test(e)===!1&&LD.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(ND.test(e)===!1)return r}else if(LD.test(e)===!1)return r;return O4(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function O4(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 s2(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return $4(e,t,n)}finally{Error.stackTraceLimit=r}}function V0e(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return $4(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Rd.exports=s2;Rd.exports.default=s2;Rd.exports.parse=s2;Rd.exports.safeParse=V0e;Rd.exports.scan=O4;var H0e=Rd.exports;const FD=mc(H0e);var T4=z0e("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);function W0e(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 U0e(e){if(e!=null)try{return FD.parse(e)}catch{try{const n=W0e(e);return FD.parse(n)}catch{}}}var Eh={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Rh={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}}},Ph={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},$h={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Oh={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}}},Th={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}}}},Dh={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}}},Ah={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}}},Mh={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}}},kh={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}}},Ih={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}}},Nh={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}}},Lh={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}}},Fh={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}}},q0e=[Eh,Rh,Ph,$h,Oh,Th,Dh,Ah,Mh,kh,Ih,Nh,Lh,Fh],G0e={[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,[Lh.code]:Lh,[Fh.code]:Fh};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,Lh.name+"",Lh.code,Fh.name+"",Fh.code;var Y0e=q0e.map(e=>e.code),D4=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(!Y0e.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 G0e[r].parse(i)},K0e=10;function X0e(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*Q0e(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]!==K0e))continue;if(r.length===0)break;const a=X0e(r,o);o=0;const s=n.decode(a,{stream:!0}).split(`
403
- `).filter(l=>l!=="").map(D4);for(const l of s)yield l;if(t!=null&&t()){e.cancel();break}}}function Pm(e,t){return!e||!t||!t.length?e:{...e,annotations:[...t]}}async function J0e({reader:e,abortControllerRef:t,update:n,onToolCall:r,onFinish:o,generateId:i=T4,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:b,value:v}of Q0e(e,{isAborted:()=>(t==null?void 0:t.current)===null})){if(b==="text"&&(c.text?c.text={...c.text,content:(c.text.content||"")+v}:c.text={id:i(),role:"assistant",content:v,createdAt:l}),b==="finish_message"){const{completionTokens:C,promptTokens:E}=v.usage;p=v.finishReason,h={completionTokens:C,promptTokens:E,totalTokens:C+E}}if(b==="tool_call_streaming_start")c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),d[v.toolCallId]={text:"",toolName:v.toolName,prefixMapIndex:c.text.toolInvocations.length},c.text.toolInvocations.push({state:"partial-call",toolCallId:v.toolCallId,toolName:v.toolName,args:void 0});else if(b==="tool_call_delta"){const C=d[v.toolCallId];C.text+=v.argsTextDelta,c.text.toolInvocations[C.prefixMapIndex]={state:"partial-call",toolCallId:v.toolCallId,toolName:C.toolName,args:U0e(C.text)},c.text.internalUpdateId=i()}else if(b==="tool_call"){if(d[v.toolCallId]!=null?c.text.toolInvocations[d[v.toolCallId].prefixMapIndex]={state:"call",...v}:(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",...v})),c.text.internalUpdateId=i(),r){const C=await r({toolCall:v});C!=null&&(c.text.toolInvocations[c.text.toolInvocations.length-1]={state:"result",...v,result:C})}}else if(b==="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===v.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",...v}}let x=null;b==="function_call"&&(c.function_call={id:i(),role:"assistant",content:"",function_call:v.function_call,name:v.function_call.name,createdAt:l},x=c.function_call);let y=null;b==="tool_calls"&&(c.tool_calls={id:i(),role:"assistant",content:"",tool_calls:v.tool_calls,createdAt:l},y=c.tool_calls),b==="data"&&c.data.push(...v);let _=c.text;b==="message_annotations"&&(u?u.push(...v):u=[...v],x=Pm(c.function_call,u),y=Pm(c.tool_calls,u),_=Pm(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=>({...Pm(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 Z0e=()=>fetch;async function ebe({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=Z0e()}){var p,b;const v=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(v)}catch(y){throw y}if(!v.ok)throw a(),new Error((b=await v.text())!=null?b:"Failed to fetch the chat response.");if(!v.body)throw new Error("The response body is empty.");const x=v.body.getReader();switch(n){case"text":{const y=tbe(),_={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 J0e({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 tbe(e){const t=new TextDecoder;return e?function(n){return t.decode(n,{stream:!0}).split(`
404
- `).filter(o=>o!=="").map(D4).filter(Boolean)}:function(n){return n?t.decode(n,{stream:!0}):""}}async function nbe({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 rbe=PS();const ks=()=>{},Jr=ks(),gx=Object,Ut=e=>e===Jr,Bi=e=>typeof e=="function",Ys=(e,t)=>({...e,...t}),obe=e=>Bi(e.then),$m=new WeakMap;let ibe=0;const jh=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(gx(e)===e&&!r&&n!=RegExp){if(o=$m.get(e),o)return o;if(o=++ibe+"~",$m.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=jh(e[i])+",";$m.set(e,o)}if(n==gx){o="#";const a=gx.keys(e).sort();for(;!Ut(i=a.pop());)Ut(e[i])||(o+=i+":"+jh(e[i])+",");$m.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Ta=new WeakMap,mx={},Om={},l2="undefined",_v=typeof window!=l2,Y_=typeof document!=l2,abe=()=>_v&&typeof window.requestAnimationFrame!=l2,A4=(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 Om||(Om[t]=o),n[5](t,Ys(o,r),o||mx)}},n[6],()=>!Ut(t)&&t in Om?Om[t]:!Ut(t)&&e.get(t)||mx]};let K_=!0;const sbe=()=>K_,[X_,Q_]=_v&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ks,ks],lbe=()=>{const e=Y_&&document.visibilityState;return Ut(e)||e!=="hidden"},cbe=e=>(Y_&&document.addEventListener("visibilitychange",e),X_("focus",e),()=>{Y_&&document.removeEventListener("visibilitychange",e),Q_("focus",e)}),ube=e=>{const t=()=>{K_=!0,e()},n=()=>{K_=!1};return X_("online",t),X_("offline",n),()=>{Q_("online",t),Q_("offline",n)}},dbe={isOnline:sbe,isVisible:lbe},fbe={initFocus:cbe,initReconnect:ube},jD=!m.useId,zh=!_v||"Deno"in window,hbe=e=>abe()?window.requestAnimationFrame(e):setTimeout(e,1),bx=zh?m.useEffect:m.useLayoutEffect,vx=typeof navigator<"u"&&navigator.connection,zD=!zh&&vx&&(["slow-2g","2g"].includes(vx.effectiveType)||vx.saveData),c2=e=>{if(Bi(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?jh(e):"",[e,t]};let pbe=0;const J_=()=>++pbe,M4=0,k4=1,I4=2,gbe=3;var bf={__proto__:null,ERROR_REVALIDATE_EVENT:gbe,FOCUS_EVENT:M4,MUTATE_EVENT:I4,RECONNECT_EVENT:k4};async function N4(...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=[],b=t.keys();for(const v of b)!/^\$(inf|sub)\$/.test(v)&&h(t.get(v)._k)&&p.push(v);return Promise.all(p.map(d))}return d(n);async function d(h){const[p]=c2(h);if(!p)return;const[b,v]=A4(t,p),[x,y,_,S]=Ta.get(t),C=()=>{const X=x[p];return(Bi(i.revalidate)?i.revalidate(b().data,h):i.revalidate!==!1)&&(delete _[p],delete S[p],X&&X[0])?X[0](I4).then(()=>b().data):b().data};if(e.length<3)return C();let E=r,$;const D=J_();y[p]=[D,0];const T=!Ut(l),A=b(),L=A.data,F=A._c,z=Ut(F)?L:F;if(T&&(l=Bi(l)?l(z,L):l,v({data:l,_c:z})),Bi(E))try{E=E(z)}catch(X){$=X}if(E&&obe(E))if(E=await E.catch(X=>{$=X}),D!==y[p][0]){if($)throw $;return E}else $&&T&&c($)&&(a=!0,v({data:z,_c:Jr}));if(a&&!$)if(Bi(a)){const X=a(E,z);v({data:X,error:Jr,_c:Jr})}else v({data:E,error:Jr,_c:Jr});if(y[p][1]=J_(),Promise.resolve(C()).then(()=>{v({_c:Jr})}),$){if(u)throw $;return}return E}}const BD=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},mbe=(e,t)=>{if(!Ta.has(e)){const n=Ys(fbe,t),r={},o=N4.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 b of p)b(d,h)},c=()=>{if(!Ta.has(e)&&(Ta.set(e,[r,{},{},{},o,l,s]),!zh)){const u=n.initFocus(setTimeout.bind(Jr,BD.bind(Jr,r,M4))),d=n.initReconnect(setTimeout.bind(Jr,BD.bind(Jr,r,k4)));i=()=>{u&&u(),d&&d(),Ta.delete(e)}}};return c(),[e,o,c,i]}return[e,Ta.get(e)[4]]},bbe=(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)},vbe=(e,t)=>jh(e)==jh(t),[L4,ybe]=mbe(new Map),xbe=Ys({onLoadingSlow:ks,onSuccess:ks,onError:ks,onErrorRetry:bbe,onDiscarded:ks,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:zD?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:zD?5e3:3e3,compare:vbe,isPaused:()=>!1,cache:L4,mutate:ybe,fallback:{}},dbe),wbe=(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},_be=m.createContext({}),Sbe="$inf$",F4=_v&&window.__SWR_DEVTOOLS_USE__,Cbe=F4?window.__SWR_DEVTOOLS_USE__:[],Ebe=()=>{F4&&(window.__SWR_DEVTOOLS_REACT__=m)},Rbe=e=>Bi(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Pbe=()=>Ys(xbe,m.useContext(_be)),$be=e=>(t,n,r)=>e(t,n&&((...i)=>{const[a]=c2(t),[,,,s]=Ta.get(L4);if(a.startsWith(Sbe))return n(...i);const l=s[a];return Ut(l)?n(...i):(delete s[a],l)}),r),Obe=Cbe.concat($be),Tbe=e=>function(...n){const r=Pbe(),[o,i,a]=Rbe(n),s=wbe(r,a);let l=e;const{use:c}=s,u=(c||[]).concat(Obe);for(let d=u.length;d--;)l=u[d](l);return l(o,i||s.fetcher||null,s)},Dbe=(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())}};Ebe();const VD=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},Abe=(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,b,v,x]=Ta.get(r),[y,_]=c2(e),S=m.useRef(!1),C=m.useRef(!1),E=m.useRef(y),$=m.useRef(t),D=m.useRef(n),T=()=>D.current,A=()=>T().isVisible()&&T().isOnline(),[L,F,z,X]=A4(r,y),G=m.useRef({}).current,M=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)?T().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]),Y=rbe.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=Y.data,K=Ut(H)?M:H,I=Y.error,oe=m.useRef(K),ce=h?Ut(H)?oe.current:H:K,de=O&&!Ut(I)?!1:q&&!Ut(s)?s:T().isPaused()?!1:i?Ut(K)?!1:l:Ut(K)||l,he=!!(y&&t&&q&&de),ie=Ut(Y.isValidating)?he:Y.isValidating,ne=Ut(Y.isLoading)?he:Y.isLoading,le=m.useCallback(async Z=>{const ve=$.current;if(!y||!ve||C.current||T().isPaused())return!1;let Ce,Oe,Te=!0;const We=Z||{},Be=!v[y]||!We.dedupe,Ie=()=>jD?!C.current&&y===E.current&&S.current:y===E.current,Ke={isValidating:!1,isLoading:!1},dt=()=>{F(Ke)},Bt=()=>{const Qt=v[y];Qt&&Qt[1]===Oe&&delete v[y]},It={isValidating:!0};Ut(L().data)&&(It.isLoading=!0);try{if(Be&&(F(It),n.loadingTimeout&&Ut(L().data)&&setTimeout(()=>{Te&&Ie()&&T().onLoadingSlow(y,n)},n.loadingTimeout),v[y]=[ve(_),J_()]),[Ce,Oe]=v[y],Ce=await Ce,Be&&setTimeout(Bt,n.dedupingInterval),!v[y]||v[y][1]!==Oe)return Be&&Ie()&&T().onDiscarded(y),!1;Ke.error=Jr;const Qt=b[y];if(!Ut(Qt)&&(Oe<=Qt[0]||Oe<=Qt[1]||Qt[1]===0))return dt(),Be&&Ie()&&T().onDiscarded(y),!1;const pe=L().data;Ke.data=o(pe,Ce)?pe:Ce,Be&&Ie()&&T().onSuccess(Ce,y,n)}catch(Qt){Bt();const pe=T(),{shouldRetryOnError:Re}=pe;pe.isPaused()||(Ke.error=Qt,Be&&Ie()&&(pe.onError(Qt,y,pe),(Re===!0||Bi(Re)&&Re(Qt))&&(!T().revalidateOnFocus||!T().revalidateOnReconnect||A())&&pe.onErrorRetry(Qt,y,pe,Le=>{const Ge=p[y];Ge&&Ge[0]&&Ge[0](bf.ERROR_REVALIDATE_EVENT,Le)},{retryCount:(We.retryCount||0)+1,dedupe:!0})))}return Te=!1,dt(),!0},[y,r]),xe=m.useCallback((...Z)=>N4(r,E.current,...Z),[]);if(bx(()=>{$.current=t,D.current=n,Ut(H)||(oe.current=H)}),bx(()=>{if(!y)return;const Z=le.bind(Jr,yx);let ve=0;const Oe=Dbe(y,p,(Te,We={})=>{if(Te==bf.FOCUS_EVENT){const Be=Date.now();T().revalidateOnFocus&&Be>ve&&A()&&(ve=Be+T().focusThrottleInterval,Z())}else if(Te==bf.RECONNECT_EVENT)T().revalidateOnReconnect&&A()&&Z();else{if(Te==bf.MUTATE_EVENT)return le();if(Te==bf.ERROR_REVALIDATE_EVENT)return le(We)}});return C.current=!1,E.current=y,S.current=!0,F({_k:_}),de&&(Ut(K)||zh?Z():hbe(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||T().isVisible())&&(d||T().isOnline())?le(yx).then(ve):ve()}return ve(),()=>{Z&&(clearTimeout(Z),Z=-1)}},[c,u,d,y]),m.useDebugValue(ce),i&&Ut(K)&&y){if(!jD&&zh)throw new Error("Fallback data is required when using suspense in SSR.");$.current=t,D.current=n,C.current=!1;const Z=x[y];if(!Ut(Z)){const ve=xe(Z);VD(ve)}if(Ut(I)){const ve=le(yx);Ut(ce)||(ve.status="fulfilled",ve.value=!0),VD(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,ne}}},Tm=Tbe(Abe);var Mbe=async(e,t,n,r,o,i,a,s,l,c,u,d,h,p,b,v,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:D,data:T,annotations:A,toolInvocations:L,function_call:F,tool_calls:z,tool_call_id:X})=>({role:C,content:E,...$!==void 0&&{experimental_attachments:$},...D!==void 0&&{name:D},...T!==void 0&&{data:T},...A!==void 0&&{annotations:A},...L!==void 0&&{toolInvocations:L},tool_call_id:X,...F!==void 0&&{function_call:F},...z!==void 0&&{tool_calls:z}}));return await ebe({api:e,body:(y=b==null?void 0:b({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:v})};function kbe({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:b,onFinish:v,onError:x,credentials:y,headers:_,body:S,generateId:C=T4,fetch:E,keepLastMessageOnError:$=!1}={}){h&&(p??(p=h==="text"?"text":void 0));const D=m.useId(),T=t??D,A=typeof e=="string"?[e,T]:T,[L]=m.useState([]),{data:F,mutate:z}=Tm([A,"messages"],null,{fallbackData:n??L}),{data:X=!1,mutate:G}=Tm([A,"loading"],null),{data:M,mutate:U}=Tm([A,"streamData"],null),{data:V=void 0,mutate:Y}=Tm([A,"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 K=m.useCallback(async Z=>{const ve=q.current.length;try{G(!0),Y(void 0);const Te=new AbortController;O.current=Te,await nbe({getStreamedResponse:()=>Mbe(e,Z,z,U,M,H,q,O,C,p,v,b,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),Y(Te)}finally{G(!1)}const Ce=q.current,Oe=Ce[Ce.length-1];Ce.length>ve&&Oe!=null&&d>0&&HD(Oe)&&Ibe(Ce)<=d&&await K({messages:Ce})},[z,G,e,H,b,v,x,Y,U,M,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 K(Bt)},[K,C]),oe=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 K(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 K(Bt)},[K]),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),ne=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};K(Qt),ie("")},[he,C,K]),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];HD(Oe)&&K({messages:Ce})};return{messages:F||[],error:V,append:I,reload:oe,stop:ce,setMessages:de,input:he,setInput:ie,handleInputChange:le,handleSubmit:ne,isLoading:X,data:M,addToolResult:xe,experimental_addToolResult:xe}}function HD(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function Ibe(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}const j4="Switch",[Nbe,m5e]=hr(j4),[Lbe,Fbe]=Nbe(j4),jbe=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(_)),b=m.useRef(!1),v=d?!!d.closest("form"):!0,[x=!1,y]=Fr({prop:o,defaultProp:i,onChange:c});return m.createElement(Lbe,{scope:n,checked:x,disabled:s},m.createElement(Qe.button,ue({type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":z4(x),"data-disabled":s?"":void 0,disabled:s,value:l},u,{ref:p,onClick:ke(e.onClick,_=>{y(S=>!S),v&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})})),v&&m.createElement(Vbe,{control:d,bubbles:!b.current,name:r,value:l,checked:x,required:a,disabled:s,style:{transform:"translateX(-100%)"}}))}),zbe="SwitchThumb",Bbe=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Fbe(zbe,n);return m.createElement(Qe.span,ue({"data-state":z4(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),Vbe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),a=iv(n),s=Zb(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 z4(e){return e?"checked":"unchecked"}const Sv=jbe,B4=Bbe,V4=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(B4,{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")})}));V4.displayName=Sv.displayName;const Hbe=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(B4,{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")})}));Hbe.displayName=Sv.displayName;function Wbe(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ube=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qbe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gbe={};function WD(e,t){return((t||Gbe).jsx?qbe:Ube).test(e)}const Ybe=/[ \t\n\f\r]/g;function Kbe(e){return typeof e=="object"?e.type==="text"?UD(e.value):!1:UD(e)}function UD(e){return e.replace(Ybe,"")===""}class Mp{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Mp.prototype.property={};Mp.prototype.normal={};Mp.prototype.space=null;function H4(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 Mp(n,r,t)}function Z_(e){return e.toLowerCase()}class ni{constructor(t,n){this.property=t,this.attribute=n}}ni.prototype.space=null;ni.prototype.boolean=!1;ni.prototype.booleanish=!1;ni.prototype.overloadedBoolean=!1;ni.prototype.number=!1;ni.prototype.commaSeparated=!1;ni.prototype.spaceSeparated=!1;ni.prototype.commaOrSpaceSeparated=!1;ni.prototype.mustUseProperty=!1;ni.prototype.defined=!1;let Xbe=0;const xt=Rc(),Un=Rc(),W4=Rc(),De=Rc(),gn=Rc(),$u=Rc(),po=Rc();function Rc(){return 2**++Xbe}const eS=Object.freeze(Object.defineProperty({__proto__:null,boolean:xt,booleanish:Un,commaOrSpaceSeparated:po,commaSeparated:$u,number:De,overloadedBoolean:W4,spaceSeparated:gn},Symbol.toStringTag,{value:"Module"})),xx=Object.keys(eS);class u2 extends ni{constructor(t,n,r,o){let i=-1;if(super(t,n),qD(this,"space",o),typeof r=="number")for(;++i<xx.length;){const a=xx[i];qD(this,xx[i],(r&eS[a])===eS[a])}}}u2.prototype.defined=!0;function qD(e,t,n){n&&(e[t]=n)}const Qbe={}.hasOwnProperty;function Pd(e){const t={},n={};let r;for(r in e.properties)if(Qbe.call(e.properties,r)){const o=e.properties[r],i=new u2(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Z_(r)]=r,n[Z_(i.attribute)]=r}return new Mp(t,n,e.space)}const U4=Pd({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}}),q4=Pd({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function G4(e,t){return t in e?e[t]:t}function Y4(e,t){return G4(e,t.toLowerCase())}const K4=Pd({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Y4,properties:{xmlns:null,xmlnsXLink:null}}),X4=Pd({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}}),Jbe=Pd({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Y4,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$u,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|$u,crossOrigin:null,data:null,dateTime:null,decoding:null,default:xt,defer:xt,dir:null,dirName:null,disabled:xt,download:W4,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}}),Zbe=Pd({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:G4,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:$u,g2:$u,glyphName:$u,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}}),eve=/^data[-\w.:]+$/i,GD=/-[a-z]/g,tve=/[A-Z]/g;function nve(e,t){const n=Z_(t);let r=t,o=ni;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&eve.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(GD,ove);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!GD.test(i)){let a=i.replace(tve,rve);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=u2}return new o(r,t)}function rve(e){return"-"+e.toLowerCase()}function ove(e){return e.charAt(1).toUpperCase()}const ive={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"},ave=H4([q4,U4,K4,X4,Jbe],"html"),d2=H4([q4,U4,K4,X4,Zbe],"svg");function sve(e){return e.join(" ").trim()}var Q4={},YD=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,lve=/\n/g,cve=/^\s*/,uve=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,dve=/^:\s*/,fve=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,hve=/^[;\s]*/,pve=/^\s+|\s+$/g,gve=`
405
- `,KD="/",XD="*",Pl="",mve="comment",bve="declaration",vve=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(b){var v=b.match(lve);v&&(n+=v.length);var x=b.lastIndexOf(gve);r=~x?b.length-x:r+b.length}function i(){var b={line:n,column:r};return function(v){return v.position=new a(b),c(),v}}function a(b){this.start=b,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(b){var v=new Error(t.source+":"+n+":"+r+": "+b);if(v.reason=b,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function l(b){var v=b.exec(e);if(v){var x=v[0];return o(x),e=e.slice(x.length),v}}function c(){l(cve)}function u(b){var v;for(b=b||[];v=d();)v!==!1&&b.push(v);return b}function d(){var b=i();if(!(KD!=e.charAt(0)||XD!=e.charAt(1))){for(var v=2;Pl!=e.charAt(v)&&(XD!=e.charAt(v)||KD!=e.charAt(v+1));)++v;if(v+=2,Pl===e.charAt(v-1))return s("End of comment missing");var x=e.slice(2,v-2);return r+=2,o(x),e=e.slice(v),r+=2,b({type:mve,comment:x})}}function h(){var b=i(),v=l(uve);if(v){if(d(),!l(dve))return s("property missing ':'");var x=l(fve),y=b({type:bve,property:QD(v[0].replace(YD,Pl)),value:x?QD(x[0].replace(YD,Pl)):Pl});return l(hve),y}}function p(){var b=[];u(b);for(var v;v=h();)v!==!1&&(b.push(v),u(b));return b}return c(),p()};function QD(e){return e?e.replace(pve,Pl):Pl}var yve=ys&&ys.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q4,"__esModule",{value:!0});var xve=yve(vve);function wve(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,xve.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 JD=Q4.default=wve;const _ve=JD.default||JD,J4=Z4("end"),f2=Z4("start");function Z4(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 Sve(e){const t=f2(e),n=J4(e);if(t&&n)return{start:t,end:n}}function Zf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ZD(e.position):"start"in e||"end"in e?ZD(e):"line"in e||"column"in e?tS(e):""}function tS(e){return eA(e&&e.line)+":"+eA(e&&e.column)}function ZD(e){return tS(e&&e.start)+"-"+tS(e&&e.end)}function eA(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=Zf(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 h2={}.hasOwnProperty,Cve=new Map,Eve=/[A-Z]/g,Rve=/-([a-z])/g,Pve=new Set(["table","tbody","thead","tfoot","tr"]),$ve=new Set(["td","th"]),e9="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ove(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=Lve(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=Nve(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"?d2:ave,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=t9(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function t9(e,t,n){if(t.type==="element")return Tve(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Dve(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Mve(e,t,n);if(t.type==="mdxjsEsm")return Ave(e,t);if(t.type==="root")return kve(e,t,n);if(t.type==="text")return Ive(e,t)}function Tve(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=d2,e.schema=o),e.ancestors.push(t);const i=r9(e,t.tagName,!1),a=Fve(e,t);let s=g2(e,t);return Pve.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Kbe(l):!0})),n9(e,a,i,t),p2(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function Dve(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)}Bh(e,t.position)}function Ave(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bh(e,t.position)}function Mve(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=d2,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:r9(e,t.name,!0),a=jve(e,t),s=g2(e,t);return n9(e,a,i,t),p2(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function kve(e,t,n){const r={};return p2(r,g2(e,t)),e.create(t,e.Fragment,r,n)}function Ive(e,t){return t.value}function n9(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function p2(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Nve(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 Lve(e,t){return n;function n(r,o,i,a){const s=Array.isArray(i.children),l=f2(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 Fve(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&h2.call(t.properties,o)){const i=zve(e,o,t.properties[o]);if(i){const[a,s]=i;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&$ve.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 jve(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 Bh(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 Bh(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function g2(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Cve;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=t9(e,i,a);s!==void 0&&n.push(s)}return n}function zve(e,t,n){const r=nve(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Wbe(n):sve(n)),r.property==="style"){let o=typeof n=="object"?n:Bve(e,String(n));return e.stylePropertyNameCase==="css"&&(o=Vve(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?ive[r.property]||r.property:r.attribute,n]}}function Bve(e,t){const n={};try{_ve(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=e9+"#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(Rve,Wve)),n[a]=i}}function r9(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=WD(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=WD(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return h2.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Bh(e)}function Bh(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=e9+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Vve(e){const t={};let n;for(n in e)h2.call(e,n)&&(t[Hve(n)]=e[n]);return t}function Hve(e){let t=e.replace(Eve,Uve);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Wve(e,t){return t.toUpperCase()}function Uve(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"]},qve={};function Gve(e,t){const n=t||qve,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return o9(e,r,o)}function o9(e,t,n){if(Yve(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 tA(e.children,t,n)}return Array.isArray(e)?tA(e,t,n):""}function tA(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=o9(e[o],t,n);return r.join("")}function Yve(e){return!!(e&&typeof e=="object")}const nA=document.createElement("i");function m2(e){const t="&"+e+";";nA.innerHTML=t;const n=nA.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 Yo(e,t){return e.length>0?(Zi(e,e.length,0,t),e):t}const rA={}.hasOwnProperty;function Kve(e){const t={};let n=-1;for(;++n<e.length;)Xve(t,e[n]);return t}function Xve(e,t){let n;for(n in t){const o=(rA.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){rA.call(o,a)||(o[a]=[]);const s=i[a];Qve(o[a],Array.isArray(s)?s:s?[s]:[])}}}function Qve(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 i9(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 Ou(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jve=Js(new RegExp("\\p{P}","u")),Vi=Js(/[A-Za-z]/),Co=Js(/[\dA-Za-z]/),Zve=Js(/[#-'*+\--9=?A-Z^-~]/);function nS(e){return e!==null&&(e<32||e===127)}const rS=Js(/\d/),eye=Js(/[\dA-Fa-f]/),a9=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 tye(e){return a9(e)||Jve(e)}const nye=Js(/\s/);function Js(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function $d(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 rye={tokenize:oye};function oye(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 iye={tokenize:aye},oA={tokenize:sye};function aye(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 D=C;for(;D<t.events.length;)t.events[D][1].end=Object.assign({},$),D++;return Zi(t.events,E+1,0,t.events.slice(C)),t.events.length=D,c(S)}return s(S)}function c(S){if(r===n.length){if(!o)return h(S);if(o.currentConstruct&&o.currentConstruct.concrete)return b(S);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(oA,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,b(S)}function h(S){return t.containerState={},e.attempt(oA,p,b)(S)}function p(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function b(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}),v(S)}function v(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),v)}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 D=t.events.length;let T=D,A,L;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(A){L=t.events[T][1].end;break}A=!0}for(y(r),$=D;$<t.events.length;)t.events[$][1].end=Object.assign({},L),$++;Zi(t.events,T+1,0,t.events.slice(D)),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 sye(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 iA(e){if(e===null||oo(e)||nye(e))return 1;if(tye(e))return 2}function b2(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 oS={name:"attention",tokenize:cye,resolveAll:lye};function lye(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);aA(d,-l),aA(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=Yo(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Yo(c,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",i,t]]),c=Yo(c,b2(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Yo(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=Yo(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 cye(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=iA(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=iA(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 aA(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const uye={name:"autolink",tokenize:dye};function dye(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||nS(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):Zve(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 b=p===45?h:d;return e.consume(p),b}return n(p)}}const Cv={tokenize:fye,partial:!0};function fye(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 s9={name:"blockQuote",tokenize:hye,continuation:{tokenize:pye},exit:gye};function hye(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 pye(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(s9,t,n)(a)}}function gye(e){e.exit("blockQuote")}const l9={name:"characterEscape",tokenize:mye};function mye(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 a9(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const c9={name:"characterReference",tokenize:bye};function bye(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=eye,u):(e.enter("characterReferenceValue"),i=7,a=rS,u(d))}function u(d){if(d===59&&o){const h=e.exit("characterReferenceValue");return a===Co&&!m2(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 sA={tokenize:yye,partial:!0},lA={name:"codeFenced",tokenize:vye,concrete:!0};function vye(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 D=r.events[r.events.length-1];return i=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[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(sA,v,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"}),b($))}function b($){return $===null||it($)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d($)):$===96&&$===s?n($):(e.consume($),b)}function v($){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(sA,v,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($,D,T){let A=0;return L;function L(M){return $.enter("lineEnding"),$.consume(M),$.exit("lineEnding"),F}function F(M){return $.enter("codeFencedFence"),Kt(M)?mn($,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):z(M)}function z(M){return M===s?($.enter("codeFencedFenceSequence"),X(M)):T(M)}function X(M){return M===s?(A++,$.consume(M),X):A>=a?($.exit("codeFencedFenceSequence"),Kt(M)?mn($,G,"whitespace")(M):G(M)):T(M)}function G(M){return M===null||it(M)?($.exit("codeFencedFence"),D(M)):T(M)}}}function yye(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:wye},xye={tokenize:_ye,partial:!0};function wye(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(xye,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 _ye(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 Sye={name:"codeText",tokenize:Rye,resolve:Cye,previous:Eye};function Cye(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 Eye(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Rye(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 u9(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,Pye(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 Pye(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,b=0,v=0;const x=[v];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&&(v=h+1,x.push(v),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[b+l[h][0]]=b+l[h][1],b+=l[h][1]-l[h][0]-1;return c}const $ye={tokenize:Dye,resolve:Tye},Oye={tokenize:Aye,partial:!0};function Tye(e){return u9(e),e}function Dye(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(Oye,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 Aye(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 d9(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||nS(y)?n(y):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(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?b:p)}function b(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function v(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++,v):y===41?(e.consume(y),u--,v):y===null||y===32||y===40||nS(y)?n(y):(e.consume(y),y===92?x:v)}function x(y){return y===40||y===41||y===92?(e.consume(y),v):v(y)}}function f9(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 h9(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 eh(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 Mye={name:"definition",tokenize:Iye},kye={tokenize:Nye,partial:!0};function Iye(e,t,n){const r=this;let o;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return f9.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return o=Ou(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)?eh(e,c)(p):c(p)}function c(p){return d9(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(kye,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 Nye(e,t,n){return r;function r(s){return oo(s)?eh(e,o)(s):n(s)}function o(s){return h9(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 Lye={name:"hardBreakEscape",tokenize:Fye};function Fye(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 jye={name:"headingAtx",tokenize:Bye,resolve:zye};function zye(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 Bye(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 Vye=["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"],cA=["pre","script","style","textarea"],Hye={name:"htmlFlow",tokenize:Gye,resolveTo:qye,concrete:!0},Wye={tokenize:Kye,partial:!0},Uye={tokenize:Yye,partial:!0};function qye(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 Gye(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,v):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,b):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 b(I){const oe="CDATA[";return I===oe.charCodeAt(s++)?(e.consume(I),s===oe.length?r.interrupt?t:z:b):n(I)}function v(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 oe=I===47,ce=a.toLowerCase();return!oe&&!i&&cA.includes(ce)?(o=1,r.interrupt?t(I):z(I)):Vye.includes(a.toLowerCase())?(o=6,oe?(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,D):Kt(I)?(e.consume(I),$):T(I)}function D(I){return I===l?(e.consume(I),l=null,A):I===null||it(I)?n(I):(e.consume(I),D)}function T(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),T)}function A(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(Wye,K,X)(I)):I===null||it(I)?(e.exit("htmlFlowData"),X(I)):(e.consume(I),z)}function X(I){return e.check(Uye,G,K)(I)}function G(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),M}function M(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="",Y):z(I)}function Y(I){if(I===62){const oe=a.toLowerCase();return cA.includes(oe)?(e.consume(I),H):z(I)}return Vi(I)&&a.length<8?(e.consume(I),a+=String.fromCharCode(I),Y):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"),K(I)):(e.consume(I),H)}function K(I){return e.exit("htmlFlow"),t(I)}}function Yye(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 Kye(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Cv,t,n)}}const Xye={name:"htmlText",tokenize:Qye};function Qye(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),T):n(O)}function c(O){return O===45?(e.consume(O),u):O===91?(e.consume(O),i=0,b):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 b(O){const H="CDATA[";return O===H.charCodeAt(i++)?(e.consume(O),i===H.length?v:b):n(O)}function v(O){return O===null?n(O):O===93?(e.consume(O),x):it(O)?(a=v,V(O)):(e.consume(O),v)}function x(O){return O===93?(e.consume(O),y):v(O)}function y(O){return O===62?U(O):O===93?(e.consume(O),y):v(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),$):D(O)}function D(O){return it(O)?(a=D,V(O)):Kt(O)?(e.consume(O),D):U(O)}function T(O){return O===45||Co(O)?(e.consume(O),T):O===47||O===62||oo(O)?A(O):n(O)}function A(O){return O===47?(e.consume(O),U):O===58||O===95||Vi(O)?(e.consume(O),L):it(O)?(a=A,V(O)):Kt(O)?(e.consume(O),A):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):A(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,M):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)?A(O):(e.consume(O),G)}function M(O){return O===47||O===62||oo(O)?A(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"),Y}function Y(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 v2={name:"labelEnd",tokenize:r1e,resolveTo:n1e,resolveAll:t1e},Jye={tokenize:o1e},Zye={tokenize:i1e},e1e={tokenize:a1e};function t1e(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 n1e(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=Yo(s,e.slice(i+1,i+r+3)),s=Yo(s,[["enter",u,t]]),s=Yo(s,b2(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),s=Yo(s,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),s=Yo(s,e.slice(a+1)),s=Yo(s,[["exit",l,t]]),Zi(e,i,e.length,s),e}function r1e(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(Ou(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(Jye,u,a?u:d)(h):h===91?e.attempt(Zye,u,a?c:d)(h):a?u(h):d(h)}function c(h){return e.attempt(e1e,u,d)(h)}function u(h){return t(h)}function d(h){return i._balanced=!0,n(h)}}function o1e(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)?eh(e,i)(d):i(d)}function i(d){return d===41?u(d):d9(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return oo(d)?eh(e,l)(d):u(d)}function s(d){return n(d)}function l(d){return d===34||d===39||d===40?h9(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return oo(d)?eh(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 i1e(e,t,n){const r=this;return o;function o(s){return f9.call(r,e,i,a,"reference","referenceMarker","referenceString")(s)}function i(s){return r.parser.defined.includes(Ou(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function a1e(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 s1e={name:"labelStartImage",tokenize:l1e,resolveAll:v2.resolveAll};function l1e(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 c1e={name:"labelStartLink",tokenize:u1e,resolveAll:v2.resolveAll};function u1e(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:d1e};function d1e(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),mn(e,t,"linePrefix")}}const a0={name:"thematicBreak",tokenize:f1e};function f1e(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:g1e,continuation:{tokenize:m1e},exit:v1e},h1e={tokenize:y1e,partial:!0},p1e={tokenize:b1e,partial:!0};function g1e(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 b=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:rS(p)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(a0,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 rS(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(h1e,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 m1e(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(p1e,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 b1e(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 v1e(e){e.exit(this.containerState.type)}function y1e(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 uA={name:"setextUnderline",tokenize:w1e,resolveTo:x1e};function x1e(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 w1e(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 _1e={tokenize:S1e};function S1e(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($ye,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 C1e={resolveAll:g9()},E1e=p9("string"),R1e=p9("text");function p9(e){return{tokenize:t,resolveAll:g9(e==="text"?P1e: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 g9(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 P1e(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 $1e(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:D(E),check:D($),interrupt:D($,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:h,now:b,defineSkip:v,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(F){return a=Yo(a,F),x(),a[a.length-1]!==null?[]:(T(t,0),c.events=b2(i,c.events,c),c.events)}function h(F,z){return T1e(p(F),z)}function p(F){return O1e(a,F)}function b(){const{line:F,column:z,offset:X,_index:G,_bufferIndex:M}=r;return{line:F,column:z,offset:X,_index:G,_bufferIndex:M}}function v(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=b(),c.events.push(["enter",X,c]),s.push(X),X}function C(F){const z=s.pop();return z.end=b(),c.events.push(["exit",z,c]),z}function E(F,z){T(F,z.from)}function $(F,z){z.restore()}function D(F,z){return X;function X(G,M,U){let V,Y,q,O;return Array.isArray(G)?K(G):"tokenize"in G?K([G]):H(G);function H(de){return he;function he(ie){const ne=ie!==null&&de[ie],le=ie!==null&&de.null,xe=[...Array.isArray(ne)?ne:ne?[ne]:[],...Array.isArray(le)?le:le?[le]:[]];return K(xe)(ie)}}function K(de){return V=de,Y=0,de.length===0?U:I(de[Y])}function I(de){return he;function he(ie){return O=A(),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,oe,ce)(ie)}}function oe(de){return F(q,O),M}function ce(de){return O.restore(),++Y<V.length?I(V[Y]):U}}}function T(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 A(){const F=b(),z=c.previous,X=c.currentConstruct,G=c.events.length,M=Array.from(s);return{restore:U,from:G};function U(){r=F,c.previous=z,c.currentConstruct=X,c.events.length=G,s=M,L()}}function L(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function O1e(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 T1e(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 D1e={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:s9},A1e={91:Mye},M1e={[-2]:_x,[-1]:_x,32:_x},k1e={35:jye,42:a0,45:[uA,a0],60:Hye,61:uA,95:a0,96:lA,126:lA},I1e={38:c9,92:l9},N1e={[-5]:Sx,[-4]:Sx,[-3]:Sx,33:s1e,38:c9,42:oS,60:[uye,Xye],91:c1e,92:[Lye,l9],93:v2,95:oS,96:Sye},L1e={null:[oS,C1e]},F1e={null:[42,95]},j1e={null:[]},z1e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:F1e,contentInitial:A1e,disable:j1e,document:D1e,flow:k1e,flowInitial:M1e,insideSpan:L1e,string:I1e,text:N1e},Symbol.toStringTag,{value:"Module"}));function B1e(e){const n=Kve([z1e,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(rye),document:o(iye),flow:o(_1e),string:o(E1e),text:o(R1e)};return r;function o(i){return a;function a(s){return $1e(r,i,s)}}}function V1e(e){for(;!u9(e););return e}const dA=/[\0\t\n\r]/g;function H1e(){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(dA.lastIndex=d,c=dA.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 W1e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function U1e(e){return e.replace(W1e,q1e)}function q1e(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return i9(n.slice(i?2:1),i?16:10)}return m2(n)||e}const m9={}.hasOwnProperty;function G1e(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Y1e(n)(V1e(B1e(n).document().write(H1e()(e,t,!0))))}function Y1e(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Be),autolinkProtocol:A,autolinkEmail:A,atxHeading:i(Ce),blockQuote:i(ne),characterEscape:A,characterReference:A,codeFenced:i(le),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(le,a),codeText:i(xe,a),codeTextData:A,data:A,codeFlowValue:A,definition:i(Z),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(ve),hardBreakEscape:i(Oe),hardBreakTrailing:i(Oe),htmlFlow:i(Te,a),htmlFlowData:A,htmlText:i(Te,a),htmlTextData:A,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:v,codeFencedFenceInfo:p,codeFencedFenceMeta:b,codeFlowValue:L,codeIndented:l(y),codeText:l(M),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:Y,lineEnding:F,link:l(U),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:oe,resourceDestinationString:O,resourceTitleString:H,resource:K,setextHeading:l(T),setextHeadingLineSequence:D,setextHeadingText:$,strong:l(),thematicBreak:l()}};b9(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]];m9.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]||fA).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]||fA).call(this,pe,Ge[0]));else throw new Error("Cannot close `"+pe.type+"` ("+Zf({start:pe.start,end:pe.end})+"): it’s not open");Le.position.end=hs(pe.end)}function u(){return Gve(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 b(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.meta=pe}function v(){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=Ou(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 D(pe){const Re=this.stack[this.stack.length-1];Re.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function A(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)&&(A.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 M(){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 Y(pe){const Re=this.sliceSerialize(pe),Le=this.stack[this.stack.length-2];Le.label=U1e(Re),Le.identifier=Ou(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 K(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function oe(pe){const Re=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Re,Le.identifier=Ou(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=i9(Re,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=m2(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 ne(){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 b9(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?b9(e,r):K1e(e,r)}}function K1e(e,t){let n;for(n in t)if(m9.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 fA(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Zf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Zf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Zf({start:t.start,end:t.end})+") is still open")}function X1e(e){const t=this;t.parser=n;function n(r){return G1e(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Q1e(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 J1e(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
408
- `}]}function Z1e(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 exe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function txe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nxe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=$d(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 rxe(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 oxe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function v9(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 ixe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return v9(e,t);const o={src:$d(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 axe(e,t){const n={src:$d(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 sxe(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 lxe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return v9(e,t);const o={href:$d(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 cxe(e,t){const n={href:$d(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 uxe(e,t,n){const r=e.all(t),o=n?dxe(n):y9(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 dxe(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=y9(n[r])}return t}function y9(e){const t=e.spread;return t??e.children.length>1}function fxe(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 hxe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pxe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function gxe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mxe(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=f2(t.children[1]),l=J4(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 bxe(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 b={type:"element",tagName:i,properties:h,children:[]};d&&(b.children=e.all(d),e.patch(d,b),b=e.applyData(d,b)),c.push(b)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function vxe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const hA=9,pA=32;function yxe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(gA(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(gA(t.slice(o),o>0,!1)),i.join("")}function gA(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===hA||i===pA;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===hA||i===pA;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function xxe(e,t){const n={type:"text",value:yxe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function wxe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _xe={blockquote:Q1e,break:J1e,code:Z1e,delete:exe,emphasis:txe,footnoteReference:nxe,heading:rxe,html:oxe,imageReference:ixe,image:axe,inlineCode:sxe,linkReference:lxe,link:cxe,listItem:uxe,list:fxe,paragraph:hxe,root:pxe,strong:gxe,table:mxe,tableCell:vxe,tableRow:bxe,text:xxe,thematicBreak:wxe,toml:Dm,yaml:Dm,definition:Dm,footnoteDefinition:Dm};function Dm(){}const x9=-1,Ev=0,ib=1,ab=2,y2=3,x2=4,w2=5,_2=6,w9=7,_9=8,mA=typeof self=="object"?self:globalThis,Sxe=(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 x9:return n(a,o);case ib:{const s=n([],o);for(const l of a)s.push(r(l));return s}case ab:{const s=n({},o);for(const[l,c]of a)s[r(l)]=r(c);return s}case y2:return n(new Date(a),o);case x2:{const{source:s,flags:l}=a;return n(new RegExp(s,l),o)}case w2:{const s=n(new Map,o);for(const[l,c]of a)s.set(r(l),r(c));return s}case _2:{const s=n(new Set,o);for(const l of a)s.add(r(l));return s}case w9:{const{name:s,message:l}=a;return n(new mA[s](l),o)}case _9:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o)}return n(new mA[i](a),o)};return r},bA=e=>Sxe(new Map,e)(0),tu="",{toString:Cxe}={},{keys:Exe}=Object,vf=e=>{const t=typeof e;if(t!=="object"||!e)return[Ev,t];const n=Cxe.call(e).slice(8,-1);switch(n){case"Array":return[ib,tu];case"Object":return[ab,tu];case"Date":return[y2,tu];case"RegExp":return[x2,tu];case"Map":return[w2,tu];case"Set":return[_2,tu]}return n.includes("Array")?[ib,n]:n.includes("Error")?[w9,n]:[ab,n]},Am=([e,t])=>e===Ev&&(t==="function"||t==="symbol"),Rxe=(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]=vf(a);switch(s){case Ev:{let u=a;switch(l){case"bigint":s=_9,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([x9],a)}return o([s,u],a)}case ib:{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 ab:{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 Exe(a))(e||!Am(vf(a[h])))&&u.push([i(h),i(a[h])]);return d}case y2:return o([s,a.toISOString()],a);case x2:{const{source:u,flags:d}=a;return o([s,{source:u,flags:d}],a)}case w2:{const u=[],d=o([s,u],a);for(const[h,p]of a)(e||!(Am(vf(h))||Am(vf(p))))&&u.push([i(h),i(p)]);return d}case _2:{const u=[],d=o([s,u],a);for(const h of a)(e||!Am(vf(h)))&&u.push(i(h));return d}}const{message:c}=a;return o([s,{name:l,message:c}],a)};return i},vA=(e,{json:t,lossy:n}={})=>{const r=[];return Rxe(!(t||n),!!t,new Map,r)(e),r},sb=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?bA(vA(e,t)):structuredClone(e):(e,t)=>bA(vA(e,t));function Pxe(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 $xe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Oxe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Pxe,r=e.options.footnoteBackLabel||$xe,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=$d(d.toLowerCase());let p=0;const b=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++p<=v;){b.length>0&&b.push({type:"text",value:" "});let _=typeof n=="string"?n:n(l,p);typeof _=="string"&&(_={type:"text",value:_}),b.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(...b)}else u.push(...b);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:{...sb(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 S9=function(e){if(e==null)return Mxe;if(typeof e=="function")return Rv(e);if(typeof e=="object")return Array.isArray(e)?Txe(e):Dxe(e);if(typeof e=="string")return Axe(e);throw new Error("Expected function, string, or object as test")};function Txe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=S9(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 Dxe(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 Axe(e){return Rv(t);function t(n){return n&&n.type===e}}function Rv(e){return t;function t(n,r,o){return!!(kxe(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function Mxe(){return!0}function kxe(e){return e!==null&&typeof e=="object"&&"type"in e}const C9=[],Ixe=!0,yA=!1,Nxe="skip";function Lxe(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=S9(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=C9,b,v,x;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=Fxe(n(l,u)),p[0]===yA))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==Nxe)for(v=(r?y.children.length:-1)+a,x=u.concat(y);v>-1&&v<y.children.length;){const _=y.children[v];if(b=s(_,v,x)(),b[0]===yA)return b;v=typeof b[1]=="number"?b[1]:v+a}}return p}}}function Fxe(e){return Array.isArray(e)?e:typeof e=="number"?[Ixe,e]:e==null?C9:[e]}function E9(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),Lxe(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 iS={}.hasOwnProperty,jxe={};function zxe(e,t){const n=t||jxe,r=new Map,o=new Map,i=new Map,a={..._xe,...n.handlers},s={all:c,applyData:Vxe,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:l,options:n,patch:Bxe,wrap:Wxe};return E9(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(iS.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:v,...x}=u,y=sb(x);return y.children=s.all(u),y}return sb(u)}return(s.options.unknownHandler||Hxe)(s,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const b=s.one(h[p],u);if(b){if(p&&h[p-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=xA(b.value)),!Array.isArray(b)&&b.type==="element")){const v=b.children[0];v&&v.type==="text"&&(v.value=xA(v.value))}Array.isArray(b)?d.push(...b):d.push(b)}}}return d}}function Bxe(e,t){e.position&&(t.position=Sve(e))}function Vxe(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,sb(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function Hxe(e,t){const n=t.data||{},r="value"in t&&!(iS.call(n,"hProperties")||iS.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 Wxe(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 xA(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function wA(e,t){const n=zxe(e,t),r=n.one(e,void 0),o=Oxe(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 Uxe(e,t){return e&&"run"in e?async function(n,r){const o=wA(n,{file:r,...t});await e.run(o,r)}:function(n,r){return wA(n,{file:r,...t||e})}}function _A(e){if(e)throw e}var s0=Object.prototype.hasOwnProperty,R9=Object.prototype.toString,SA=Object.defineProperty,CA=Object.getOwnPropertyDescriptor,EA=function(t){return typeof Array.isArray=="function"?Array.isArray(t):R9.call(t)==="[object Array]"},RA=function(t){if(!t||R9.call(t)!=="[object Object]")return!1;var n=s0.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&s0.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||s0.call(t,o)},PA=function(t,n){SA&&n.name==="__proto__"?SA(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},$A=function(t,n){if(n==="__proto__")if(s0.call(t,n)){if(CA)return CA(t,n).value}else return;return t[n]},qxe=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=$A(s,n),o=$A(t,n),s!==o&&(u&&o&&(RA(o)||(i=EA(o)))?(i?(i=!1,a=r&&EA(r)?r:[]):a=r&&RA(r)?r:{},PA(s,{name:n,newValue:e(u,a,o)})):typeof o<"u"&&PA(s,{name:n,newValue:o}));return s};const Cx=mc(qxe);function aS(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 Gxe(){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?Yxe(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 Yxe(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:Kxe,dirname:Xxe,extname:Qxe,join:Jxe,sep:"/"};function Kxe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');kp(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 Xxe(e){if(kp(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 Qxe(e){kp(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 Jxe(...e){let t=-1,n;for(;++t<e.length;)kp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Zxe(n)}function Zxe(e){kp(e);const t=e.codePointAt(0)===47;let n=ewe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ewe(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 kp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const twe={cwd:nwe};function nwe(){return"/"}function sS(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function rwe(e){if(typeof e=="string")e=new URL(e);else if(!sS(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 owe(e)}function owe(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 P9{constructor(t){let n;t?sS(t)?n={path:t}:typeof t=="string"||iwe(t)?n={value:t}:n=t:n={},this.cwd=twe.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){OA(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"),OA(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){sS(t)&&(t=rwe(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 OA(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function iwe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const awe=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},swe={}.hasOwnProperty;class S2 extends awe{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=Gxe()}copy(){const t=new S2;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):swe.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=Mm(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=Mm(t),l=r.parse(s);r.run(l,s,function(u,d,h){if(u||!d||!h)return c(u);const p=d,b=r.stringify(p,h);uwe(b)?h.value=b:h.result=b,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),DA("processSync","process",n),r;function o(i,a){n=!0,_A(i),r=a}}run(t,n,r){TA(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=Mm(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),DA("runSync","run",r),o;function i(a,s){_A(a),o=s,r=!0}}stringify(t,n){this.freeze();const r=Mm(n),o=this.compiler||this.Compiler;return Ox("stringify",o),TA(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,...b]=u;const v=r[h][1];aS(v)&&aS(p)&&(p=Cx(!0,v,p)),r[h]=[c,p,...b]}}}}const lwe=new S2().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 TA(e){if(!aS(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function DA(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Mm(e){return cwe(e)?e:new P9(e)}function cwe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function uwe(e){return typeof e=="string"||dwe(e)}function dwe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fwe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",AA=[],MA={allowDangerousHtml:!0},hwe=/^(https?|ircs?|mailto|xmpp)$/i,pwe=[{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 $9(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,a=e.disallowedElements,s=e.rehypePlugins||AA,l=e.remarkPlugins||AA,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...MA}:MA,u=e.skipHtml,d=e.unwrapDisallowed,h=e.urlTransform||gwe,p=lwe().use(X1e).use(l).use(Uxe,c).use(s),b=new P9;typeof r=="string"&&(b.value=r);for(const _ of pwe)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+fwe+_.id,void 0);const v=p.parse(b);let x=p.runSync(v,b);return o&&(x={type:"element",tagName:"div",properties:{className:o},children:x.type==="root"?x.children:[x]}),E9(x,y),Ove(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],D=wx[E];(D===null||D.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 gwe(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||hwe.test(e.slice(0,t))?e:""}function mwe(){const e=m.useRef(null),[t,n]=m.useState(""),[r,o]=m.useState(!1),i=we(A=>A.dashboard.aiScopeTables);Fb();const a=we(A=>A.selectedSheetId),{addFrame:s,setSelectedFrameId:l,setIsDashboardEditing:c}=dr(),{authToken:u}=Mo(),d=FS(),{messages:h,input:p,handleInputChange:b,handleSubmit:v,addToolResult:x,stop:y,isLoading:_}=kbe({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},maxToolRoundtrips:5,async onToolCall({toolCall:A}){if(C(A.toolName),A.toolName==="getLocation"){const L=["New York","Los Angeles","Chicago","San Francisco"];return L[Math.floor(Math.random()*L.length)]}if(A.toolName==="getTables")return JSON.stringify(i||[]);if(A.toolName==="getData"){console.log(A.args);const L=A.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:()=>pb("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:kS()})});return n("Summarizing"),JSON.stringify(F)}},onFinish(A,L){console.log("onFinish",A,L),A.content&&n("")}}),S=()=>{var A;(A=e.current)==null||A.scrollIntoView({behavior:"smooth"})};m.useEffect(()=>{S()},[h]);function C(A){A==="getTables"&&n("Initializing"),A==="getSchemas"&&n("Analyzing"),A==="getData"&&n("Fetching")}function E(A){const L=A.toolInvocations||[];return L.length===0||L.find(z=>z.toolName==="getData"&&"result"in z)?!0:r}function $(A){return A==null?void 0:A.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(Dk,{className:"size-5 shrink-0"}):R.jsx(zw,{className:"size-5 shrink-0"})}),R.jsx("div",{children:R.jsx($9,{components:bwe,children:L.content})})]})}),(z=L.toolInvocations)==null?void 0:z.map(X=>{const G=X.toolCallId;return"result"in X?R.jsx("div",{children:D(X)},G):R.jsxs("div",{children:["Calling ",X.toolName,"..."]},G)})]},L.id):null})}function D(A){if("result"in A){let L;try{const F=JSON.parse(A.result);if(L=R.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(F,null,2)}),A.toolName==="getData"){const z=eE({cardType:A.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"})," ",`${A.toolName}: `,L]}),R.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[R.jsx(no,{onClick:()=>{const X=A.args.chartTitle,G=A.args.connectionId;T({sql:A.args.sql,data:F.records,cardType:A.args.chartType,cardCfg:z,cardTitle:X,connectionId:G})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),z&&R.jsx(NE,{cfg:z})]})]})}}catch{L=R.jsx("span",{children:A.result})}return R.jsxs("div",{children:[R.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${A.toolName}: `,L]})}return`Calling ${A.toolName}...`}function T({sql:A,data:L,cardCfg:F,cardTitle:z,connectionId:X,cardType:G}){if(!a)return;const M={id:Fs(),title:z||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:G==="horizontalBar"?"y":"x"}},type:F.type,cfg:F,sql:A,data:L,connectionId:X},U={id:Fs(),cards:[M],activeCardId:M.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(ev,{openDelay:700,children:[R.jsx(tv,{children:R.jsx($k,{className:"size-4 text-muted-foreground"})}),R.jsx(_p,{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((A,L)=>R.jsxs("div",{className:"flex gap-2 text-xs",children:[R.jsx(Tk,{className:"size-4 opacity-70"}),R.jsx("span",{children:A.tableName})]},L))})]})]})})]}),!1]}),R.jsx(Sp,{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:v,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:b}),R.jsx("button",{className:"mr-3",children:R.jsx(mk,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),_&&R.jsx(no,{size:"sm",className:"rounded-full",onClick:()=>y(),children:R.jsx(zQ,{className:"size-2.5 bg-background"})})]})}),R.jsxs(Sh,{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(PQ,{className:"size-10 animate-pulse"}),t]}),R.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:$(h)}),R.jsx(mv,{orientation:"vertical"})]})]})}const bwe={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:dd,createContext:vwe,createRef:b5e,forwardRef:O9,useCallback:go,useContext:T9,useEffect:tc,useImperativeHandle:D9,useLayoutEffect:ywe,useMemo:xwe,useRef:Ko,useState:lb}=j,kA=j.useId,Pv=vwe(null);Pv.displayName="PanelGroupContext";const Vh=ywe,wwe=typeof kA=="function"?kA:()=>null;let _we=0;function C2(e=null){const t=wwe(),n=Ko(e||t||null);return n.current===null&&(n.current=""+_we++),e??n.current}function A9({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:b="div",...v}){const x=T9(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:D,resizePanel:T,unregisterPanel:A}=x,L=C2(a),F=Ko({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});Ko({didLogMissingDefaultSizeWarning:!1}),Vh(()=>{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}),Vh(()=>{const X=F.current;return D(X),()=>{A(X)}},[h,L,D,A]),D9(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=>{T(F.current,X)}}),[y,_,S,$,L,T]);const z=C(F.current,o);return dd(b,{...v,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 M9=O9((e,t)=>dd(A9,{...e,forwardedRef:t}));A9.displayName="Panel";M9.displayName="forwardRef(Panel)";function wt(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const k9=10;function Hh(e,t,n=k9){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 Hh(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(Hh(n,s)<0)if(i){const l=(o+s)/2;Hh(n,l)<0?n=o:n=s}else n=s;return n=Math.min(a,n),n=parseFloat(n.toFixed(k9)),n}function If({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:b=0,minSize:v=0}=p;if(yo(h,b)){const x=v-h;Hh(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 b=n[u];wt(b);const{collapsedSize:v=0,minSize:x=0}=b;if(yo(p,x)){const y=p-v;Hh(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 b=t[d];wt(b!=null);const x=mu({panelConstraints:n,panelIndex:d,size:100})-b;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 b=p-h,v=mu({panelConstraints:n,panelIndex:d,size:b});if(!yo(p,v)&&(l+=p-v,i[d]=v,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 b=h-p,x=e<0?s:a;for(;x>=0&&x<n.length;){const y=i[x];wt(y!=null);const _=y+b,S=mu({panelConstraints:n,panelIndex:x,size:_});if(yo(y,S)||(b-=S-y,i[x]=S),yo(b,0))break;e>0?x--:x++}}}const c=i.reduce((u,d)=>d+u,0);return yo(c,100)?i:t}function Swe({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:b=100,minSize:v=0}=p;h===s?(r=v,o=b):(i+=v,a+=b)});const l=Math.min(o,100-i),c=Math.max(r,100-a),u=e[s];return{valueMax:l,valueMin:c,valueNow:u}}function Wh(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function I9(e,t){const r=Wh(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function N9(e,t){const n=I9(e,t);return n!=null?[n,n+1]:[-1,-1]}function L9(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 Cwe(e,t,n){var r,o,i,a;const s=$v(t),l=Wh(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 Ewe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){Ko({didWarnAboutMissingResizeHandle:!1}),Vh(()=>{const a=Wh(n);for(let s=0;s<o.length-1;s++){const{valueMax:l,valueMin:c,valueNow:u}=Swe({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=L9(n);wt(l!=null,`No group found for id "${n}"`);const c=Wh(n);wt(c);const u=c.map(d=>{const h=d.getAttribute("data-panel-resize-handle-id");wt(h);const[p,b]=Cwe(n,h,s);if(p==null||b==null)return()=>{};const v=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 D=If({delta:yo(S,C)?$-C:C-S,layout:r,panelConstraints:s.map(T=>T.constraints),pivotIndices:N9(n,h),trigger:"keyboard"});r!==D&&i(D)}}break}}};return d.addEventListener("keydown",v),()=>{d.removeEventListener("keydown",v)}});return()=>{u.forEach(d=>d())}},[e,t,n,r,o,i])}function IA(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 F9(e){return e.type==="keydown"}function j9(e){return e.type.startsWith("mouse")}function z9(e){return e.type.startsWith("touch")}function B9(e,t){const n=e==="horizontal";if(j9(t))return n?t.clientX:t.clientY;if(z9(t)){const r=t.touches[0];return wt(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function Rwe(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=B9(n,e),c=L9(a);wt(c);const u=c.getBoundingClientRect(),d=o?u.width:u.height;return(l-s)/d*100}function Pwe(e,t,n,r,o){if(F9(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:Rwe(e,t,n,r)}function $we({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:b}=a;b&&b(r,d),u&&(h||p)&&(p&&(d==null||d===c)&&r!==c&&p(),h&&(d==null||d!==c)&&r===c&&h())}})}function km(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 Owe({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 lS=null,Ml=null;function V9(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 Twe(){Ml!==null&&(document.head.removeChild(Ml),lS=null,Ml=null)}function Dx(e){if(lS===e)return;lS=e;const t=V9(e);Ml===null&&(Ml=document.createElement("style"),document.head.appendChild(Ml)),Ml.innerHTML=`*{cursor: ${t}!important;}`}function Dwe(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function NA(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 H9(e){return`react-resizable-panels:${e}`}function W9(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 U9(e,t){try{const n=H9(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Awe(e,t,n){var r,o;const i=(r=U9(e,n))!==null&&r!==void 0?r:{},a=W9(t);return(o=i[a])!==null&&o!==void 0?o:null}function Mwe(e,t,n,r,o){var i;const a=H9(e),s=W9(t),l=(i=U9(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 LA({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 kwe=100,Nf={getItem:e=>(NA(Nf),Nf.getItem(e)),setItem:(e,t)=>{NA(Nf),Nf.setItem(e,t)}},FA={};function q9({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:a=null,keyboardResizeBy:s=null,storage:l=Nf,style:c,tagName:u="div",...d}){const h=C2(i),[p,b]=lb(null),[v,x]=lb([]),y=Ko({}),_=Ko(new Map),S=Ko(0),C=Ko({autoSaveId:e,direction:r,dragState:p,id:h,keyboardResizeBy:s,onLayout:a,storage:l}),E=Ko({layout:v,panelDataArray:[],panelDataArrayChanged:!1});Ko({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),D9(o,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:O}=E.current;return O},setLayout:O=>{const{onLayout:H}=C.current,{layout:K,panelDataArray:I}=E.current,oe=LA({layout:O,panelConstraints:I.map(ce=>ce.constraints)});IA(K,oe)||(x(oe),E.current.layout=oe,H&&H(oe),nu(I,oe,y.current))}}),[]),Vh(()=>{C.current.autoSaveId=e,C.current.direction=r,C.current.dragState=p,C.current.id=h,C.current.onLayout=a,C.current.storage=l}),Ewe({committedValuesRef:C,eagerValuesRef:E,groupId:h,layout:v,panelDataArray:E.current.panelDataArray,setLayout:x}),tc(()=>{const{panelDataArray:O}=E.current;if(e){if(v.length===0||v.length!==O.length)return;let H=FA[e];H==null&&(H=Dwe(Mwe,kwe),FA[e]=H);const K=[...O],I=new Map(_.current);H(e,K,I,v,l)}},[e,v,l]),tc(()=>{});const $=go(O=>{const{onLayout:H}=C.current,{layout:K,panelDataArray:I}=E.current;if(O.constraints.collapsible){const oe=I.map(ie=>ie.constraints),{collapsedSize:ce=0,panelSize:de,pivotIndices:he}=ru(I,O,K);if(wt(de!=null),de!==ce){_.current.set(O.id,de);const ne=cu(I,O)===I.length-1?de-ce:ce-de,le=If({delta:ne,layout:K,panelConstraints:oe,pivotIndices:he,trigger:"imperative-api"});km(K,le)||(x(le),E.current.layout=le,H&&H(le),nu(I,le,y.current))}}},[]),D=go(O=>{const{onLayout:H}=C.current,{layout:K,panelDataArray:I}=E.current;if(O.constraints.collapsible){const oe=I.map(ne=>ne.constraints),{collapsedSize:ce=0,panelSize:de,minSize:he=0,pivotIndices:ie}=ru(I,O,K);if(de===ce){const ne=_.current.get(O.id),le=ne!=null&&ne>=he?ne:he,Z=cu(I,O)===I.length-1?de-le:le-de,ve=If({delta:Z,layout:K,panelConstraints:oe,pivotIndices:ie,trigger:"imperative-api"});km(K,ve)||(x(ve),E.current.layout=ve,H&&H(ve),nu(I,ve,y.current))}}},[]),T=go(O=>{const{layout:H,panelDataArray:K}=E.current,{panelSize:I}=ru(K,O,H);return wt(I!=null),I},[]),A=go((O,H)=>{const{panelDataArray:K}=E.current,I=cu(K,O);return Owe({defaultSize:H,dragState:p,layout:v,panelData:K,panelIndex:I})},[p,v]),L=go(O=>{const{layout:H,panelDataArray:K}=E.current,{collapsedSize:I=0,collapsible:oe,panelSize:ce}=ru(K,O,H);return oe===!0&&ce===I},[]),F=go(O=>{const{layout:H,panelDataArray:K}=E.current,{collapsedSize:I=0,collapsible:oe,panelSize:ce}=ru(K,O,H);return wt(ce!=null),!oe||ce>I},[]),z=go(O=>{const{panelDataArray:H}=E.current;H.push(O),H.sort((K,I)=>{const oe=K.order,ce=I.order;return oe==null&&ce==null?0:oe==null?-1:ce==null?1:oe-ce}),E.current.panelDataArrayChanged=!0},[]);Vh(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:O,onLayout:H,storage:K}=C.current,{layout:I,panelDataArray:oe}=E.current;let ce=null;if(O){const he=Awe(O,oe,K);he&&(_.current=new Map(Object.entries(he.expandToSizes)),ce=he.layout)}ce==null&&(ce=$we({panelDataArray:oe}));const de=LA({layout:ce,panelConstraints:oe.map(he=>he.constraints)});IA(I,de)||(x(de),E.current.layout=de,H&&H(de),nu(oe,de,y.current))}});const X=go(O=>function(K){K.preventDefault();const{direction:I,dragState:oe,id:ce,keyboardResizeBy:de,onLayout:he}=C.current,{layout:ie,panelDataArray:ne}=E.current,{initialLayout:le}=oe??{},xe=N9(ce,O);let Z=Pwe(K,O,I,oe,de);if(Z===0)return;const ve=I==="horizontal";document.dir==="rtl"&&ve&&(Z=-Z);const Ce=ne.map(We=>We.constraints),Oe=If({delta:Z,layout:le??ie,panelConstraints:Ce,pivotIndices:xe,trigger:F9(K)?"keyboard":"mouse-or-touch"}),Te=!km(ie,Oe);(j9(K)||z9(K))&&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(ne,Oe,y.current))},[]),G=go((O,H)=>{const{onLayout:K}=C.current,{layout:I,panelDataArray:oe}=E.current,ce=oe.map(xe=>xe.constraints),{panelSize:de,pivotIndices:he}=ru(oe,O,I);wt(de!=null);const ne=cu(oe,O)===oe.length-1?de-H:H-de,le=If({delta:ne,layout:I,panelConstraints:ce,pivotIndices:he,trigger:"imperative-api"});km(I,le)||(x(le),E.current.layout=le,K&&K(le),nu(oe,le,y.current))},[]),M=go((O,H)=>{const{direction:K}=C.current,{layout:I}=E.current,oe=$v(O);wt(oe);const ce=B9(K,H);b({dragHandleId:O,dragHandleRect:oe.getBoundingClientRect(),initialCursorPosition:ce,initialLayout:I})},[]),U=go(()=>{Twe(),b(null)},[]),V=go(O=>{const{panelDataArray:H}=E.current,K=cu(H,O);K>=0&&(H.splice(K,1),delete y.current[O.id],E.current.panelDataArrayChanged=!0)},[]),Y=xwe(()=>({collapsePanel:$,direction:r,dragState:p,expandPanel:D,getPanelSize:T,getPanelStyle:A,groupId:h,isPanelCollapsed:L,isPanelExpanded:F,registerPanel:z,registerResizeHandle:X,resizePanel:G,startDragging:M,stopDragging:U,unregisterPanel:V}),[$,p,r,D,T,A,h,L,F,z,X,G,M,U,V]),q={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return dd(Pv.Provider,{value:Y},dd(u,{...d,children:t,className:n,style:{...q,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h}))}const G9=O9((e,t)=>dd(q9,{...e,forwardedRef:t}));q9.displayName="PanelGroup";G9.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 Iwe({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=Wh(a),l=I9(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 E2({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:a=0,tagName:s="div",...l}){const c=Ko(null),u=Ko({onDragging:o});tc(()=>{u.current.onDragging=o});const d=T9(Pv);if(d===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:h,dragState:p,groupId:b,registerResizeHandle:v,startDragging:x,stopDragging:y}=d,_=C2(r),S=(p==null?void 0:p.dragHandleId)===_,[C,E]=lb(!1),[$,D]=lb(null),T=go(()=>{const L=c.current;wt(L),L.blur(),y();const{onDragging:F}=u.current;F&&F(!1)},[y]);tc(()=>{if(n)D(null);else{const L=v(_);D(()=>L)}},[n,_,v]),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",T),X.body.addEventListener("mousemove",L),X.body.addEventListener("touchmove",L),X.body.addEventListener("mouseleave",F),window.addEventListener("mouseup",T),window.addEventListener("touchend",T),()=>{X.body.removeEventListener("contextmenu",T),X.body.removeEventListener("mousemove",L),X.body.removeEventListener("touchmove",L),X.body.removeEventListener("mouseleave",F),window.removeEventListener("mouseup",T),window.removeEventListener("touchend",T)}},[h,n,S,$,T]),Iwe({disabled:n,handleId:_,resizeHandler:$});const A={cursor:V9(h),touchAction:"none",userSelect:"none"};return dd(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:T,onTouchCancel:T,onTouchEnd:T,onTouchStart:L=>{x(_,L.nativeEvent);const F=u.current;wt(F);const{onDragging:z}=F;z&&z(!0)},ref:c,role:"separator",style:{...A,...i},tabIndex:a,"data-panel-group-direction":h,"data-panel-group-id":b,"data-resize-handle":"","data-resize-handle-active":S?"pointer":C?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}E2.displayName="PanelResizeHandle";const Y9=({className:e,...t})=>R.jsx(G9,{className:ye("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),cS=M9,Nwe=({withHandle:e,className:t,...n})=>R.jsx(E2,{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(Ek,{className:"h-2.5 w-2.5"})})}),Lwe=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>R.jsx(E2,{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(zb,{className:"size-4"}):R.jsx(mC,{className:"size-4"})})})});function Fwe(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,...b}=d,v=(h==null?void 0:h[e][l])||s,x=j.useMemo(()=>b,Object.values(b));return R.jsx(v.Provider,{value:x,children:p})}function u(d,h){const p=(h==null?void 0:h[e][l])||s,b=j.useContext(p);if(b)return b;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,jwe(o,...t)]}function jwe(...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 zwe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Bwe(...e){return t=>e.forEach(n=>zwe(n,t))}function K9(...e){return j.useCallback(Bwe(...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 Vwe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Hwe(...e){return t=>e.forEach(n=>Vwe(n,t))}function Pc(...e){return j.useCallback(Hwe(...e),e)}function Wwe(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 Uwe(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,...b}=d,v=(h==null?void 0:h[e][l])||s,x=j.useMemo(()=>b,Object.values(b));return R.jsx(v.Provider,{value:x,children:p})}function u(d,h){const p=(h==null?void 0:h[e][l])||s,b=j.useContext(p);if(b)return b;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,qwe(o,...t)]}function qwe(...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 cb=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},Gwe=j.useId||(()=>{}),Ywe=0;function Ax(e){const[t,n]=j.useState(Gwe());return cb(()=>{e||n(r=>r??String(Ywe++))},[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 Kwe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Xwe({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 Xwe({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 Qwe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],qa=Qwe.reduce((e,t)=>{const n=j.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?ov: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 Jwe(e,t){e&&SS.flushSync(()=>e.dispatchEvent(t))}function Zwe(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 e_e="DismissableLayer",uS="dismissableLayer.update",t_e="dismissableLayer.pointerDownOutside",n_e="dismissableLayer.focusOutside",jA,X9=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Q9=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=j.useContext(X9),[u,d]=j.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=j.useState({}),b=Pc(t,D=>d(D)),v=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(x),_=u?v.indexOf(u):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,C=_>=y,E=i_e(D=>{const T=D.target,A=[...c.branches].some(L=>L.contains(T));!C||A||(o==null||o(D),a==null||a(D),D.defaultPrevented||s==null||s())},h),$=a_e(D=>{const T=D.target;[...c.branches].some(L=>L.contains(T))||(i==null||i(D),a==null||a(D),D.defaultPrevented||s==null||s())},h);return Zwe(D=>{_===c.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&s&&(D.preventDefault(),s()))},h),j.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(jA=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),zA(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=jA)}},[u,h,n,c]),j.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),zA())},[u,c]),j.useEffect(()=>{const D=()=>p({});return document.addEventListener(uS,D),()=>document.removeEventListener(uS,D)},[]),R.jsx(qa.div,{...l,ref:b,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)})});Q9.displayName=e_e;var r_e="DismissableLayerBranch",o_e=j.forwardRef((e,t)=>{const n=j.useContext(X9),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})});o_e.displayName=r_e;function i_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(){J9(t_e,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 a_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&&J9(n_e,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 zA(){const e=new CustomEvent(uS);document.dispatchEvent(e)}function J9(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?Jwe(o,i):o.dispatchEvent(i)}var Mx="focusScope.autoFocusOnMount",kx="focusScope.autoFocusOnUnmount",BA={bubbles:!1,cancelable:!0},s_e="FocusScope",Z9=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,v=>l(v)),p=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let v=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",v),document.addEventListener("focusout",x);const _=new MutationObserver(y);return s&&_.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),_.disconnect()}}},[r,s,p.paused]),j.useEffect(()=>{if(s){HA.add(p);const v=document.activeElement;if(!s.contains(v)){const y=new CustomEvent(Mx,BA);s.addEventListener(Mx,c),s.dispatchEvent(y),y.defaultPrevented||(l_e(h_e(eN(s)),{select:!0}),document.activeElement===v&&bs(s))}return()=>{s.removeEventListener(Mx,c),setTimeout(()=>{const y=new CustomEvent(kx,BA);s.addEventListener(kx,u),s.dispatchEvent(y),y.defaultPrevented||bs(v??document.body,{select:!0}),s.removeEventListener(kx,u),HA.remove(p)},0)}}},[s,c,u,p]);const b=j.useCallback(v=>{if(!n&&!r||p.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(x&&y){const _=v.currentTarget,[S,C]=c_e(_);S&&C?!v.shiftKey&&y===C?(v.preventDefault(),n&&bs(S,{select:!0})):v.shiftKey&&y===S&&(v.preventDefault(),n&&bs(C,{select:!0})):y===_&&v.preventDefault()}},[n,r,p.paused]);return R.jsx(qa.div,{tabIndex:-1,...a,ref:h,onKeyDown:b})});Z9.displayName=s_e;function l_e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bs(r,{select:t}),document.activeElement!==n)return}function c_e(e){const t=eN(e),n=VA(t,e),r=VA(t.reverse(),e);return[n,r]}function eN(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 VA(e,t){for(const n of e)if(!u_e(n,{upTo:t}))return n}function u_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 d_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&&d_e(e)&&t&&e.select()}}var HA=f_e();function f_e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=WA(e,t),e.unshift(t)},remove(t){var n;e=WA(e,t),(n=e[0])==null||n.resume()}}}function WA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function h_e(e){return e.filter(t=>t.tagName!=="A")}var p_e="Portal",tN=j.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=j.useState(!1);cb(()=>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});tN.displayName=p_e;function g_e(e,t){return j.useReducer((n,r)=>t[n][r]??n,e)}var Ov=e=>{const{present:t,children:n}=e,r=m_e(t),o=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),i=Pc(r.ref,b_e(o));return typeof n=="function"||r.isPresent?j.cloneElement(o,{ref:i}):null};Ov.displayName="Presence";function m_e(e){const[t,n]=j.useState(),r=j.useRef({}),o=j.useRef(e),i=j.useRef("none"),a=e?"mounted":"unmounted",[s,l]=g_e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const c=Im(r.current);i.current=s==="mounted"?c:"none"},[s]),cb(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=Im(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]),cb(()=>{if(t){const c=d=>{const p=Im(r.current).includes(d.animationName);d.target===t&&p&&SS.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Im(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 Im(e){return(e==null?void 0:e.animationName)||"none"}function b_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 v_e(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??UA()),document.body.insertAdjacentElement("beforeend",e[1]??UA()),Ix++,()=>{Ix===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ix--}},[])}function UA(){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 nN=$E(),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,b=e.inert,v=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,_=e.gapMode,S=av(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,E=PE([n,t]),$=Nn(Nn({},S),o);return j.createElement(j.Fragment,null,u&&j.createElement(C,{sideCar:nN,removeScrollBar:c,shards:d,noIsolation:p,inert:b,setCallbacks:i,allowPinchZoom:!!v,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:Pu,zeroRight:Ru};var dS=!1;if(typeof window<"u")try{var Nm=Object.defineProperty({},"passive",{get:function(){return dS=!0,!0}});window.addEventListener("test",Nm,Nm),window.removeEventListener("test",Nm,Nm)}catch{dS=!1}var ou=dS?{passive:!1}:!1,y_e=function(e){return e.tagName==="TEXTAREA"},rN=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!y_e(e)&&n[t]==="visible")},x_e=function(e){return rN(e,"overflowY")},w_e=function(e){return rN(e,"overflowX")},qA=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=oN(e,r);if(o){var i=iN(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},__e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},S_e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},oN=function(e,t){return e==="v"?x_e(t):w_e(t)},iN=function(e,t){return e==="v"?__e(t):S_e(t)},C_e=function(e,t){return e==="h"&&t==="rtl"?-1:1},E_e=function(e,t,n,r,o){var i=C_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=iN(e,s),b=p[0],v=p[1],x=p[2],y=v-x-i*b;(b||y)&&oN(e,s)&&(d+=y,h+=b),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},Lm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},GA=function(e){return[e.deltaX,e.deltaY]},YA=function(e){return e&&"current"in e?e.current:e},R_e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},P_e=function(e){return`
418
- .block-interactivity-`.concat(e,` {pointer-events: none;}
419
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
420
- `)},$_e=0,iu=[];function O_e(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),o=j.useState($_e++)[0],i=j.useState(lv)[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 v=RE([e.lockRef.current],(e.shards||[]).map(YA),!0).filter(Boolean);return v.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=j.useCallback(function(v,x){if("touches"in v&&v.touches.length===2)return!a.current.allowPinchZoom;var y=Lm(v),_=n.current,S="deltaX"in v?v.deltaX:_[0]-y[0],C="deltaY"in v?v.deltaY:_[1]-y[1],E,$=v.target,D=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in v&&D==="h"&&$.type==="range")return!1;var T=qA(D,$);if(!T)return!0;if(T?E=D:(E=D==="v"?"h":"v",T=qA(D,$)),!T)return!1;if(!r.current&&"changedTouches"in v&&(S||C)&&(r.current=E),!E)return!0;var A=r.current||E;return E_e(A,x,v,A==="h"?S:C,!0)},[]),l=j.useCallback(function(v){var x=v;if(!(!iu.length||iu[iu.length-1]!==i)){var y="deltaY"in x?GA(x):Lm(x),_=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&R_e(E.delta,y)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var S=(a.current.shards||[]).map(YA).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(v,x,y,_){var S={name:v,delta:x,target:y,should:_,shadowParent:T_e(y)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=j.useCallback(function(v){n.current=Lm(v),r.current=void 0},[]),d=j.useCallback(function(v){c(v.type,GA(v),v.target,s(v,e.lockRef.current))},[]),h=j.useCallback(function(v){c(v.type,Lm(v),v.target,s(v,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(v){return v!==i}),document.removeEventListener("wheel",l,ou),document.removeEventListener("touchmove",l,ou),document.removeEventListener("touchstart",u,ou)}},[]);var p=e.removeScrollBar,b=e.inert;return j.createElement(j.Fragment,null,b?j.createElement(i,{styles:P_e(o)}):null,p?j.createElement(TE,{gapMode:e.gapMode}):null)}function T_e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const D_e=OE(nN,O_e);var aN=j.forwardRef(function(e,t){return j.createElement(Tv,Nn({},e,{ref:t,sideCar:D_e}))});aN.classNames=Tv.classNames;const A_e=aN;var R2="Dialog",[sN,lN]=Uwe(R2),[M_e,Si]=sN(R2),cN=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]=Kwe({prop:r,defaultProp:o,onChange:i});return R.jsx(M_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})};cN.displayName=R2;var uN="DialogTrigger",dN=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Si(uN,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":O2(o.open),...r,ref:i,onClick:Ns(e.onClick,o.onOpenToggle)})});dN.displayName=uN;var P2="DialogPortal",[k_e,fN]=sN(P2,{forceMount:void 0}),hN=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Si(P2,t);return R.jsx(k_e,{scope:t,forceMount:n,children:j.Children.map(r,a=>R.jsx(Ov,{present:n||i.open,children:R.jsx(tN,{asChild:!0,container:o,children:a})}))})};hN.displayName=P2;var ub="DialogOverlay",pN=j.forwardRef((e,t)=>{const n=fN(ub,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Si(ub,e.__scopeDialog);return i.modal?R.jsx(Ov,{present:r||i.open,children:R.jsx(I_e,{...o,ref:t})}):null});pN.displayName=ub;var I_e=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Si(ub,n);return R.jsx(A_e,{as:ov,allowPinchZoom:!0,shards:[o.contentRef],children:R.jsx(qa.div,{"data-state":O2(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),pc="DialogContent",gN=j.forwardRef((e,t)=>{const n=fN(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(N_e,{...o,ref:t}):R.jsx(L_e,{...o,ref:t})})});gN.displayName=pc;var N_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 Cp(i)},[]),R.jsx(mN,{...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())})}),L_e=j.forwardRef((e,t)=>{const n=Si(pc,e.__scopeDialog),r=j.useRef(!1),o=j.useRef(!1);return R.jsx(mN,{...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()}})}),mN=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 v_e(),R.jsxs(R.Fragment,{children:[R.jsx(Z9,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:R.jsx(Q9,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":O2(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),R.jsxs(R.Fragment,{children:[R.jsx(j_e,{titleId:s.titleId}),R.jsx(B_e,{contentRef:l,descriptionId:s.descriptionId})]})]})}),$2="DialogTitle",bN=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Si($2,n);return R.jsx(qa.h2,{id:o.titleId,...r,ref:t})});bN.displayName=$2;var vN="DialogDescription",yN=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Si(vN,n);return R.jsx(qa.p,{id:o.descriptionId,...r,ref:t})});yN.displayName=vN;var xN="DialogClose",wN=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Si(xN,n);return R.jsx(qa.button,{type:"button",...r,ref:t,onClick:Ns(e.onClick,()=>o.onOpenChange(!1))})});wN.displayName=xN;function O2(e){return e?"open":"closed"}var _N="DialogTitleWarning",[F_e,SN]=Wwe(_N,{contentName:pc,titleName:$2,docsSlug:"dialog"}),j_e=({titleId:e})=>{const t=SN(_N),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},z_e="DialogDescriptionWarning",B_e=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${SN(z_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},CN=cN,EN=dN,RN=hN,T2=pN,D2=gN,A2=bN,M2=yN,k2=wN;function V_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 PN="AlertDialog",[H_e,v5e]=Fwe(PN,[lN]),Ga=lN(),$N=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ga(t);return R.jsx(CN,{...r,...n,modal:!0})};$N.displayName=PN;var W_e="AlertDialogTrigger",U_e=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ga(n);return R.jsx(EN,{...o,...r,ref:t})});U_e.displayName=W_e;var q_e="AlertDialogPortal",ON=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ga(t);return R.jsx(RN,{...r,...n})};ON.displayName=q_e;var G_e="AlertDialogOverlay",TN=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ga(n);return R.jsx(T2,{...o,...r,ref:t})});TN.displayName=G_e;var Tu="AlertDialogContent",[Y_e,K_e]=H_e(Tu),DN=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=Ga(n),a=j.useRef(null),s=K9(t,a),l=j.useRef(null);return R.jsx(F_e,{contentName:Tu,titleName:AN,docsSlug:"alert-dialog",children:R.jsx(Y_e,{scope:n,cancelRef:l,children:R.jsxs(D2,{role:"alertdialog",...i,...o,ref:s,onOpenAutoFocus:V_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(hI,{children:r}),R.jsx(Q_e,{contentRef:a})]})})})});DN.displayName=Tu;var AN="AlertDialogTitle",MN=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ga(n);return R.jsx(A2,{...o,...r,ref:t})});MN.displayName=AN;var kN="AlertDialogDescription",IN=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ga(n);return R.jsx(M2,{...o,...r,ref:t})});IN.displayName=kN;var X_e="AlertDialogAction",NN=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Ga(n);return R.jsx(k2,{...o,...r,ref:t})});NN.displayName=X_e;var LN="AlertDialogCancel",FN=j.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=K_e(LN,n),i=Ga(n),a=K9(t,o);return R.jsx(k2,{...i,...r,ref:a})});FN.displayName=LN;var Q_e=({contentRef:e})=>{const t=`\`${Tu}\` requires a description for the component to be accessible for screen reader users.
425
-
426
- You can add a description to the \`${Tu}\` by passing a \`${kN}\` 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 \`${Tu}\`. 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},J_e=$N,Z_e=ON,jN=TN,zN=DN,BN=NN,VN=FN,HN=MN,WN=IN;const eSe=J_e,tSe=Z_e,UN=j.forwardRef(({className:e,...t},n)=>R.jsx(jN,{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}));UN.displayName=jN.displayName;const qN=j.forwardRef(({className:e,...t},n)=>R.jsx(tSe,{children:R.jsxs(bc,{children:[R.jsx(UN,{}),R.jsx(zN,{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})]})}));qN.displayName=zN.displayName;const GN=({className:e,...t})=>R.jsx("div",{className:ye("flex flex-col space-y-2 text-center sm:text-left",e),...t});GN.displayName="AlertDialogHeader";const YN=({className:e,...t})=>R.jsx("div",{className:ye("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});YN.displayName="AlertDialogFooter";const KN=j.forwardRef(({className:e,...t},n)=>R.jsx(HN,{ref:n,className:ye("text-lg font-semibold",e),...t}));KN.displayName=HN.displayName;const XN=j.forwardRef(({className:e,...t},n)=>R.jsx(WN,{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));XN.displayName=WN.displayName;const QN=j.forwardRef(({className:e,...t},n)=>R.jsx(BN,{ref:n,className:ye(wh(),e),...t}));QN.displayName=BN.displayName;const JN=j.forwardRef(({className:e,...t},n)=>R.jsx(VN,{ref:n,className:ye(wh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));JN.displayName=VN.displayName;function nSe({open:e,setOpen:t}){const n=we(i=>i.selectedSheetId),{deleteSheet:r}=dr();function o(){n&&(r(n),t(!1))}return R.jsx(eSe,{open:e,onOpenChange:t,children:R.jsxs(qN,{children:[R.jsxs(GN,{children:[R.jsx(KN,{children:"Delete Sheet"}),R.jsx(XN,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),R.jsxs(YN,{children:[R.jsx(JN,{children:"Cancel"}),R.jsx(QN,{onClick:o,children:"Delete"})]})]})})}function ZN(){var x,y;const[e,t]=m.useState(!1),n=we(_=>{var S;return(S=_.dashboard)==null?void 0:S.sheets}),{showAssistant:r}=Mo(),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 b(){const _={id:Fs(),title:"New Sheet"};h(_)}function v(){return(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)?"hsl(var(--semaphor-muted))":(l==null?void 0:l.canvasTheme)==="clear"?"":l==null?void 0:l.canvasTheme}return R.jsxs(WS,{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(Cb,{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(Eb,{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(bd,{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:b,children:R.jsx(yC,{className:"size-3"})})]})}),R.jsxs(Y9,{className:"grow",direction:"horizontal",children:[R.jsx(cS,{children:R.jsx("div",{style:{},children:n==null?void 0:n.map(_=>R.jsx(US,{style:{backgroundColor:v()},className:ye("mt-0",{}),value:_.id,children:R.jsx(j0e,{sheet:_})},_.id))})}),r===!0&&R.jsxs(R.Fragment,{children:[R.jsx(Lwe,{open:i,onTabClick:p,withHandle:!0}),R.jsx(cS,{onResize:_=>{_<1?a(!1):i||a(!0)},defaultSize:0,ref:o,children:R.jsx(mwe,{})})]})]}),R.jsx(nSe,{open:e,setOpen:t})]})}function eL({children:e}){return R.jsx(pG,{defaultTheme:"system",storageKey:"vite-ui-theme",children:R.jsx(sle,{delayDuration:0,children:e})})}function tL(e){return R.jsx(Bb,{FallbackComponent:wC,children:R.jsx(c6,{dashboardProps:e,children:R.jsx(eL,{children:R.jsx(h6,{...e,children:R.jsx(ZN,{})})})})})}const nL=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(oSe);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(fS,ue({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(fS,ue({},r,{ref:t}),n)});nL.displayName="Slot";const fS=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...iSe(r,n.props),ref:t?Ba(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});fS.displayName="SlotClone";const rSe=({children:e})=>m.createElement(m.Fragment,null,e);function oSe(e){return m.isValidElement(e)&&e.type===rSe}function iSe(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 hS=["Enter"," "],aSe=["ArrowDown","PageUp","Home"],rL=["ArrowUp","PageDown","End"],sSe=[...aSe,...rL],lSe={ltr:[...hS,"ArrowRight"],rtl:[...hS,"ArrowLeft"]},cSe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Dv="Menu",[Uh,uSe,dSe]=Sb(Dv),[$c,oL]=hr(Dv,[dSe,oa,md]),I2=oa(),iL=md(),[fSe,Oc]=$c(Dv),[hSe,Ip]=$c(Dv),pSe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,s=I2(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",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),m.createElement(vp,s,m.createElement(fSe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c},m.createElement(hSe,{scope:t,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:h,modal:a},r)))},aL=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=I2(n);return m.createElement(yp,ue({},o,r,{ref:t}))}),sL="MenuPortal",[gSe,lL]=$c(sL,{forceMount:void 0}),mSe=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Oc(sL,t);return m.createElement(gSe,{scope:t,forceMount:n},m.createElement(pr,{present:n||i.open},m.createElement(lE,{asChild:!0,container:o},r)))},yi="MenuContent",[bSe,N2]=$c(yi),vSe=m.forwardRef((e,t)=>{const n=lL(yi,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Oc(yi,e.__scopeMenu),a=Ip(yi,e.__scopeMenu);return m.createElement(Uh.Provider,{scope:e.__scopeMenu},m.createElement(pr,{present:r||i.open},m.createElement(Uh.Slot,{scope:e.__scopeMenu},a.modal?m.createElement(ySe,ue({},o,{ref:t})):m.createElement(xSe,ue({},o,{ref:t})))))}),ySe=m.forwardRef((e,t)=>{const n=Oc(yi,e.__scopeMenu),r=m.useRef(null),o=Rt(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Cp(i)},[]),m.createElement(L2,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)}))}),xSe=m.forwardRef((e,t)=>{const n=Oc(yi,e.__scopeMenu);return m.createElement(L2,ue({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),L2=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:b,...v}=e,x=Oc(yi,n),y=Ip(yi,n),_=I2(n),S=iL(n),C=uSe(n),[E,$]=m.useState(null),D=m.useRef(null),T=Rt(t,D,x.onContentChange),A=m.useRef(0),L=m.useRef(""),F=m.useRef(0),z=m.useRef(null),X=m.useRef("right"),G=m.useRef(0),M=b?DE:m.Fragment,U=b?{as:nL,allowPinchZoom:!0}:void 0,V=q=>{var O,H;const K=L.current+q,I=C().filter(ne=>!ne.disabled),oe=document.activeElement,ce=(O=I.find(ne=>ne.ref.current===oe))===null||O===void 0?void 0:O.textValue,de=I.map(ne=>ne.textValue),he=jSe(de,K,ce),ie=(H=I.find(ne=>ne.textValue===he))===null||H===void 0?void 0:H.ref.current;(function ne(le){L.current=le,window.clearTimeout(A.current),le!==""&&(A.current=window.setTimeout(()=>ne(""),1e3))})(K),ie&&setTimeout(()=>ie.focus())};m.useEffect(()=>()=>window.clearTimeout(A.current),[]),CE();const Y=m.useCallback(q=>{var O,H;return X.current===((O=z.current)===null||O===void 0?void 0:O.side)&&BSe(q,(H=z.current)===null||H===void 0?void 0:H.area)},[]);return m.createElement(bSe,{scope:n,searchRef:L,onItemEnter:m.useCallback(q=>{Y(q)&&q.preventDefault()},[Y]),onItemLeave:m.useCallback(q=>{var O;Y(q)||((O=D.current)===null||O===void 0||O.focus(),$(null))},[Y]),onTriggerLeave:m.useCallback(q=>{Y(q)&&q.preventDefault()},[Y]),pointerGraceTimerRef:F,onPointerGraceIntentChange:m.useCallback(q=>{z.current=q},[])},m.createElement(M,U,m.createElement(EE,{asChild:!0,trapped:o,onMountAutoFocus:ke(i,q=>{var O;q.preventDefault(),(O=D.current)===null||O===void 0||O.focus()}),onUnmountAutoFocus:a},m.createElement(wp,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:p},m.createElement(BS,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(xp,ue({role:"menu","aria-orientation":"vertical","data-state":hL(x.open),"data-radix-menu-content":"",dir:y.dir},_,v,{ref:T,style:{outline:"none",...v.style},onKeyDown:ke(v.onKeyDown,q=>{const H=q.target.closest("[data-radix-menu-content]")===q.currentTarget,K=q.ctrlKey||q.altKey||q.metaKey,I=q.key.length===1;H&&(q.key==="Tab"&&q.preventDefault(),!K&&I&&V(q.key));const oe=D.current;if(q.target!==oe||!sSe.includes(q.key))return;q.preventDefault();const de=C().filter(he=>!he.disabled).map(he=>he.ref.current);rL.includes(q.key)&&de.reverse(),LSe(de)}),onBlur:ke(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(A.current),L.current="")}),onPointerMove:ke(e.onPointerMove,qh(q=>{const O=q.target,H=G.current!==q.clientX;if(q.currentTarget.contains(O)&&H){const K=q.clientX>G.current?"right":"left";X.current=K,G.current=q.clientX}}))})))))))}),wSe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,ue({role:"group"},r,{ref:t}))}),_Se=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,ue({},r,{ref:t}))}),pS="MenuItem",KA="menu.itemSelect",F2=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),a=Ip(pS,e.__scopeMenu),s=N2(pS,e.__scopeMenu),l=Rt(t,i),c=m.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const h=new CustomEvent(KA,{bubbles:!0,cancelable:!0});d.addEventListener(KA,p=>r==null?void 0:r(p),{once:!0}),g6(d,h),h.defaultPrevented?c.current=!1:a.onClose()}};return m.createElement(cL,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===" "||hS.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})}))}),cL=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=N2(pS,n),s=iL(n),l=m.useRef(null),c=Rt(t,l),[u,d]=m.useState(!1),[h,p]=m.useState("");return m.useEffect(()=>{const b=l.current;if(b){var v;p(((v=b.textContent)!==null&&v!==void 0?v:"").trim())}},[i.children]),m.createElement(Uh.ItemSlot,{scope:n,disabled:r,textValue:o??h},m.createElement(VS,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,qh(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:ke(e.onPointerLeave,qh(b=>a.onItemLeave(b))),onFocus:ke(e.onFocus,()=>d(!0)),onBlur:ke(e.onBlur,()=>d(!1))}))))}),SSe=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(dL,{scope:e.__scopeMenu,checked:n},m.createElement(F2,ue({role:"menuitemcheckbox","aria-checked":db(n)?"mixed":n},o,{ref:t,"data-state":j2(n),onSelect:ke(o.onSelect,()=>r==null?void 0:r(db(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),CSe="MenuRadioGroup",[ESe,RSe]=$c(CSe,{value:void 0,onValueChange:()=>{}}),PSe=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Xn(r);return m.createElement(ESe,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(wSe,ue({},o,{ref:t})))}),$Se="MenuRadioItem",OSe=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=RSe($Se,e.__scopeMenu),i=n===o.value;return m.createElement(dL,{scope:e.__scopeMenu,checked:i},m.createElement(F2,ue({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":j2(i),onSelect:ke(r.onSelect,()=>{var a;return(a=o.onValueChange)===null||a===void 0?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})))}),uL="MenuItemIndicator",[dL,TSe]=$c(uL,{checked:!1}),DSe=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=TSe(uL,n);return m.createElement(pr,{present:r||db(i.checked)||i.checked===!0},m.createElement(Qe.span,ue({},o,{ref:t,"data-state":j2(i.checked)})))}),ASe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,ue({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),MSe="MenuSub",[y5e,fL]=$c(MSe),Fm="MenuSubTrigger",kSe=m.forwardRef((e,t)=>{const n=Oc(Fm,e.__scopeMenu),r=Ip(Fm,e.__scopeMenu),o=fL(Fm,e.__scopeMenu),i=N2(Fm,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(aL,ue({asChild:!0},c),m.createElement(cL,ue({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":hL(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,qh(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,qh(d=>{var h;u();const p=(h=n.content)===null||h===void 0?void 0:h.getBoundingClientRect();if(p){var b;const v=(b=n.content)===null||b===void 0?void 0:b.dataset.side,x=v==="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:v}),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===" ")&&lSe[r.dir].includes(d.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),d.preventDefault()}})})))}),ISe="MenuSubContent",NSe=m.forwardRef((e,t)=>{const n=lL(yi,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Oc(yi,e.__scopeMenu),a=Ip(yi,e.__scopeMenu),s=fL(ISe,e.__scopeMenu),l=m.useRef(null),c=Rt(t,l);return m.createElement(Uh.Provider,{scope:e.__scopeMenu},m.createElement(pr,{present:r||i.open},m.createElement(Uh.Slot,{scope:e.__scopeMenu},m.createElement(L2,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=cSe[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 hL(e){return e?"open":"closed"}function db(e){return e==="indeterminate"}function j2(e){return db(e)?"indeterminate":e?"checked":"unchecked"}function LSe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function FSe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function jSe(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=FSe(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 zSe(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 BSe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return zSe(n,t)}function qh(e){return t=>t.pointerType==="mouse"?e(t):void 0}const VSe=pSe,HSe=aL,WSe=mSe,USe=vSe,qSe=_Se,GSe=F2,YSe=SSe,KSe=PSe,XSe=OSe,QSe=DSe,JSe=ASe,ZSe=kSe,eCe=NSe,pL="DropdownMenu",[tCe,x5e]=hr(pL,[oL]),ko=oL(),[nCe,gL]=tCe(pL),rCe=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,l=ko(t),c=m.useRef(null),[u=!1,d]=Fr({prop:o,defaultProp:i,onChange:a});return m.createElement(nCe,{scope:t,triggerId:xi(),triggerRef:c,contentId:xi(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(h=>!h),[d]),modal:s},m.createElement(VSe,ue({},l,{open:u,onOpenChange:d,dir:r,modal:s}),n))},oCe="DropdownMenuTrigger",iCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=gL(oCe,n),a=ko(n);return m.createElement(HSe,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())})})))}),aCe=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ko(t);return m.createElement(WSe,ue({},r,n))},sCe="DropdownMenuContent",lCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=gL(sCe,n),i=ko(n),a=m.useRef(!1);return m.createElement(USe,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)"}}))}),cCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ko(n);return m.createElement(qSe,ue({},o,r,{ref:t}))}),uCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ko(n);return m.createElement(GSe,ue({},o,r,{ref:t}))}),dCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ko(n);return m.createElement(YSe,ue({},o,r,{ref:t}))}),fCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ko(n);return m.createElement(KSe,ue({},o,r,{ref:t}))}),hCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ko(n);return m.createElement(XSe,ue({},o,r,{ref:t}))}),pCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ko(n);return m.createElement(QSe,ue({},o,r,{ref:t}))}),gCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ko(n);return m.createElement(JSe,ue({},o,r,{ref:t}))}),mCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ko(n);return m.createElement(ZSe,ue({},o,r,{ref:t}))}),bCe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ko(n);return m.createElement(eCe,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)"}}))}),vCe=rCe,yCe=iCe,xCe=aCe,mL=lCe,bL=cCe,vL=uCe,yL=dCe,wCe=fCe,xL=hCe,wL=pCe,_L=gCe,SL=mCe,CL=bCe,_Ce=vCe,SCe=yCe,CCe=wCe,ECe=j.forwardRef(({className:e,inset:t,children:n,...r},o)=>R.jsxs(SL,{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(zb,{className:"ml-auto h-4 w-4"})]}));ECe.displayName=SL.displayName;const RCe=j.forwardRef(({className:e,...t},n)=>R.jsx(bc,{children:R.jsx(CL,{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})}));RCe.displayName=CL.displayName;const EL=j.forwardRef(({className:e,sideOffset:t=4,...n},r)=>R.jsx(xCe,{children:R.jsx(bc,{children:R.jsx(mL,{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})})}));EL.displayName=mL.displayName;const RL=j.forwardRef(({className:e,inset:t,...n},r)=>R.jsx(vL,{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}));RL.displayName=vL.displayName;const PL=j.forwardRef(({className:e,children:t,checked:n,...r},o)=>R.jsxs(yL,{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(wL,{children:R.jsx(fp,{className:"h-4 w-4"})})}),t]}));PL.displayName=yL.displayName;const $L=j.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(xL,{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(wL,{children:R.jsx(bC,{className:"h-2 w-2 fill-current"})})}),t]}));$L.displayName=xL.displayName;const OL=j.forwardRef(({className:e,inset:t,...n},r)=>R.jsx(bL,{ref:r,className:ye("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));OL.displayName=bL.displayName;const TL=j.forwardRef(({className:e,...t},n)=>R.jsx(_L,{ref:n,className:ye("-mx-1 my-1 h-px bg-muted",e),...t}));TL.displayName=_L.displayName;const PCe=CN,$Ce=EN,OCe=RN,DL=j.forwardRef(({className:e,...t},n)=>R.jsx(T2,{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}));DL.displayName=T2.displayName;const AL=j.forwardRef(({className:e,children:t,...n},r)=>R.jsx(OCe,{children:R.jsxs(bc,{children:[R.jsx(DL,{}),R.jsxs(D2,{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(k2,{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(bd,{className:"h-4 w-4"}),R.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));AL.displayName=D2.displayName;const ML=({className:e,...t})=>R.jsx("div",{className:ye("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ML.displayName="DialogHeader";const kL=({className:e,...t})=>R.jsx("div",{className:ye("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});kL.displayName="DialogFooter";const IL=j.forwardRef(({className:e,...t},n)=>R.jsx(A2,{ref:n,className:ye("text-lg font-semibold leading-none tracking-tight",e),...t}));IL.displayName=A2.displayName;const NL=j.forwardRef(({className:e,...t},n)=>R.jsx(M2,{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));NL.displayName=M2.displayName;const LL=m.forwardRef(({className:e,...t},n)=>R.jsx("div",{role:"editor-panel",ref:n,className:ye("flex grow h-full",e),...t}));LL.displayName="EditorPanel";const FL=m.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:ye(" flex flex-col space-y-2 w-[270px]",e),...t}));FL.displayName="EditorAside";const jL=m.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:ye(" grow",e),...t}));jL.displayName="EditorMain";function TCe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XA(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 QA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XA(Object(n),!0).forEach(function(r){TCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DCe(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 ACe(e,t){if(e==null)return{};var n=DCe(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 MCe(e,t){return kCe(e)||ICe(e,t)||NCe(e,t)||LCe()}function kCe(e){if(Array.isArray(e))return e}function ICe(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 NCe(e,t){if(e){if(typeof e=="string")return JA(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 JA(e,t)}}function JA(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 LCe(){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 FCe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZA(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 eM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZA(Object(n),!0).forEach(function(r){FCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jCe(){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 Lf(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 fb(e){return{}.toString.call(e).includes("Object")}function zCe(e){return!Object.keys(e).length}function Gh(e){return typeof e=="function"}function BCe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function VCe(e,t){return fb(t)||Ls("changeType"),Object.keys(t).some(function(n){return!BCe(e,n)})&&Ls("changeField"),t}function HCe(e){Gh(e)||Ls("selectorType")}function WCe(e){Gh(e)||fb(e)||Ls("handlerType"),fb(e)&&Object.values(e).some(function(t){return!Gh(t)})&&Ls("handlersType")}function UCe(e){e||Ls("initialIsRequired"),fb(e)||Ls("initialType"),zCe(e)&&Ls("initialContent")}function qCe(e,t){throw new Error(e[t]||e.default)}var GCe={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=Lf(qCe)(GCe),jm={changes:VCe,selector:HCe,handler:WCe,initial:UCe};function YCe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};jm.initial(e),jm.handler(t);var n={current:e},r=Lf(QCe)(n,t),o=Lf(XCe)(n),i=Lf(jm.changes)(e),a=Lf(KCe)(n);function s(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return jm.selector(c),c(n.current)}function l(c){jCe(r,o,i,a)(c)}return[s,l]}function KCe(e,t){return Gh(t)?t(e.current):t}function XCe(e,t){return e.current=eM(eM({},e.current),t),t}function QCe(e,t,n){return Gh(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 JCe={create:YCe},ZCe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function eEe(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 tEe(e){return{}.toString.call(e).includes("Object")}function nEe(e){return e||tM("configIsRequired"),tEe(e)||tM("configType"),e.urls?(rEe(),{paths:{vs:e.urls.monacoBase}}):e}function rEe(){console.warn(zL.deprecation)}function oEe(e,t){throw new Error(e[t]||e.default)}var zL={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
- `},tM=eEe(oEe)(zL),iEe={config:nEe},aEe=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 BL(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],BL(e[n],t[n]))}),QA(QA({},e),t)}var sEe={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(sEe):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var lEe=JCe.create({config:ZCe,isInitialized:!1,resolve:null,reject:null,monaco:null}),VL=MCe(lEe,2),Np=VL[0],Av=VL[1];function cEe(e){var t=iEe.config(e),n=t.monaco,r=ACe(t,["monaco"]);Av(function(o){return{config:BL(o.config,r),monaco:n}})}function uEe(){var e=Np(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 HL(window.monaco),e.resolve(window.monaco),Lx(Fx);aEe(dEe,hEe)(pEe)}return Lx(Fx)}function dEe(e){return document.body.appendChild(e)}function fEe(e){var t=document.createElement("script");return e&&(t.src=e),t}function hEe(e){var t=Np(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=fEe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function pEe(){var e=Np(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){HL(n),e.resolve(n)},function(n){e.reject(n)})}function HL(e){Np().monaco||Av({monaco:e})}function gEe(){return Np(function(e){var t=e.monaco;return t})}var Fx=new Promise(function(e,t){return Av({resolve:e,reject:t})}),WL={config:cEe,init:uEe,__getMonacoInstance:gEe},mEe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},jx=mEe,bEe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},vEe=bEe;function yEe({children:e}){return m.createElement("div",{style:vEe.container},e)}var xEe=yEe,wEe=xEe;function _Ee({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(wEe,null,r),m.createElement("div",{ref:o,style:{...jx.fullWidth,...!n&&jx.hide},className:i}))}var SEe=_Ee,UL=m.memo(SEe);function CEe(e){m.useEffect(e,[])}var qL=CEe;function EEe(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var wo=EEe;function th(){}function bu(e,t,n,r){return REe(e,r)||PEe(e,t,n,r)}function REe(e,t){return e.editor.getModel(GL(e,t))}function PEe(e,t,n,r){return e.editor.createModel(t,n,r?GL(e,r):void 0)}function GL(e,t){return e.Uri.parse(t)}function $Ee({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:b,wrapperProps:v={},beforeMount:x=th,onMount:y=th}){let[_,S]=m.useState(!1),[C,E]=m.useState(!0),$=m.useRef(null),D=m.useRef(null),T=m.useRef(null),A=m.useRef(y),L=m.useRef(x),F=m.useRef(!1);qL(()=>{let M=WL.init();return M.then(U=>(D.current=U)&&E(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>$.current?G():M.cancel()}),wo(()=>{if($.current&&D.current){let M=$.current.getOriginalEditor(),U=bu(D.current,e||"",r||n||"text",i||"");U!==M.getModel()&&M.setModel(U)}},[i],_),wo(()=>{if($.current&&D.current){let M=$.current.getModifiedEditor(),U=bu(D.current,t||"",o||n||"text",a||"");U!==M.getModel()&&M.setModel(U)}},[a],_),wo(()=>{let M=$.current.getModifiedEditor();M.getOption(D.current.editor.EditorOption.readOnly)?M.setValue(t||""):t!==M.getValue()&&(M.executeEdits("",[{range:M.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),M.pushUndoStop())},[t],_),wo(()=>{var M,U;(U=(M=$.current)==null?void 0:M.getModel())==null||U.original.setValue(e||"")},[e],_),wo(()=>{let{original:M,modified:U}=$.current.getModel();D.current.editor.setModelLanguage(M,r||n||"text"),D.current.editor.setModelLanguage(U,o||n||"text")},[n,r,o],_),wo(()=>{var M;(M=D.current)==null||M.editor.setTheme(c)},[c],_),wo(()=>{var M;(M=$.current)==null||M.updateOptions(d)},[d],_);let z=m.useCallback(()=>{var V;if(!D.current)return;L.current(D.current);let M=bu(D.current,e||"",r||n||"text",i||""),U=bu(D.current,t||"",o||n||"text",a||"");(V=$.current)==null||V.setModel({original:M,modified:U})},[n,t,o,e,r,i,a]),X=m.useCallback(()=>{var M;!F.current&&T.current&&($.current=D.current.editor.createDiffEditor(T.current,{automaticLayout:!0,...d}),z(),(M=D.current)==null||M.editor.setTheme(c),S(!0),F.current=!0)},[d,c,z]);m.useEffect(()=>{_&&A.current($.current,D.current)},[_]),m.useEffect(()=>{!C&&!_&&X()},[C,_,X]);function G(){var U,V,Y,q;let M=(U=$.current)==null?void 0:U.getModel();s||((V=M==null?void 0:M.original)==null||V.dispose()),l||((Y=M==null?void 0:M.modified)==null||Y.dispose()),(q=$.current)==null||q.dispose()}return m.createElement(UL,{width:p,height:h,isEditorReady:_,loading:u,_ref:T,className:b,wrapperProps:v})}var OEe=$Ee;m.memo(OEe);function TEe(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var DEe=TEe,zm=new Map;function AEe({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:b="100%",className:v,wrapperProps:x={},beforeMount:y=th,onMount:_=th,onChange:S,onValidate:C=th}){let[E,$]=m.useState(!1),[D,T]=m.useState(!0),A=m.useRef(null),L=m.useRef(null),F=m.useRef(null),z=m.useRef(_),X=m.useRef(y),G=m.useRef(),M=m.useRef(r),U=DEe(i),V=m.useRef(!1),Y=m.useRef(!1);qL(()=>{let H=WL.init();return H.then(K=>(A.current=K)&&T(!1)).catch(K=>(K==null?void 0:K.type)!=="cancelation"&&console.error("Monaco initialization: error:",K)),()=>L.current?O():H.cancel()}),wo(()=>{var K,I,oe,ce;let H=bu(A.current,e||r||"",t||o||"",i||n||"");H!==((K=L.current)==null?void 0:K.getModel())&&(d&&zm.set(U,(I=L.current)==null?void 0:I.saveViewState()),(oe=L.current)==null||oe.setModel(H),d&&((ce=L.current)==null||ce.restoreViewState(zm.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(A.current.editor.EditorOption.readOnly)?L.current.setValue(r):r!==L.current.getValue()&&(Y.current=!0,L.current.executeEdits("",[{range:L.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),L.current.pushUndoStop(),Y.current=!1))},[r],E),wo(()=>{var K,I;let H=(K=L.current)==null?void 0:K.getModel();H&&o&&((I=A.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=A.current)==null||H.editor.setTheme(a)},[a],E);let q=m.useCallback(()=>{var H;if(!(!F.current||!A.current)&&!V.current){X.current(A.current);let K=i||n,I=bu(A.current,r||e||"",t||o||"",K||"");L.current=(H=A.current)==null?void 0:H.editor.create(F.current,{model:I,automaticLayout:!0,...c},u),d&&L.current.restoreViewState(zm.get(K)),A.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,A.current)},[E]),m.useEffect(()=>{!D&&!E&&q()},[D,E,q]),M.current=r,m.useEffect(()=>{var H,K;E&&S&&((H=G.current)==null||H.dispose(),G.current=(K=L.current)==null?void 0:K.onDidChangeModelContent(I=>{Y.current||S(L.current.getValue(),I)}))},[E,S]),m.useEffect(()=>{if(E){let H=A.current.editor.onDidChangeMarkers(K=>{var oe;let I=(oe=L.current.getModel())==null?void 0:oe.uri;if(I&&K.find(ce=>ce.path===I.path)){let ce=A.current.editor.getModelMarkers({resource:I});C==null||C(ce)}});return()=>{H==null||H.dispose()}}return()=>{}},[E,C]);function O(){var H,K;(H=G.current)==null||H.dispose(),h?d&&zm.set(i,L.current.saveViewState()):(K=L.current.getModel())==null||K.dispose(),L.current.dispose()}return m.createElement(UL,{width:p,height:b,isEditorReady:E,loading:l,_ref:F,className:v,wrapperProps:x})}var MEe=AEe,YL=m.memo(MEe),kEe=YL;const KL="Collapsible",[IEe,XL]=hr(KL),[NEe,z2]=IEe(KL),LEe=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(NEe,{scope:n,disabled:i,contentId:xi(),open:l,onOpenToggle:m.useCallback(()=>c(u=>!u),[c])},m.createElement(Qe.div,ue({"data-state":B2(l),"data-disabled":i?"":void 0},s,{ref:t})))}),FEe="CollapsibleTrigger",jEe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=z2(FEe,n);return m.createElement(Qe.button,ue({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":B2(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:ke(e.onClick,o.onOpenToggle)}))}),QL="CollapsibleContent",zEe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=z2(QL,e.__scopeCollapsible);return m.createElement(pr,{present:n||o.open},({present:i})=>m.createElement(BEe,ue({},r,{ref:t,present:i})))}),BEe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,a=z2(QL,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),b=p.current,v=a.open||s,x=m.useRef(v),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":B2(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v},i,{ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style}}),v&&o)});function B2(e){return e?"open":"closed"}const VEe=LEe,HEe=jEe,WEe=zEe,Zs="Accordion",UEe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[V2,qEe,GEe]=Sb(Zs),[Mv,w5e]=hr(Zs,[GEe,XL]),H2=XL(),JL=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(V2.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(QEe,ue({},i,{ref:t})):m.createElement(XEe,ue({},o,{ref:t})))});JL.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[ZL,YEe]=Mv(Zs),[eF,KEe]=Mv(Zs,{collapsible:!1}),XEe=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(ZL,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(eF,{scope:e.__scopeAccordion,collapsible:i},m.createElement(tF,ue({},a,{ref:t}))))}),QEe=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(ZL,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:c},m.createElement(eF,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(tF,ue({},i,{ref:t}))))}),[JEe,kv]=Mv(Zs),tF=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=qEe(n),d=vc(o)==="ltr",h=ke(e.onKeyDown,p=>{var b;if(!UEe.includes(p.key))return;const v=p.target,x=c().filter(A=>{var L;return!((L=A.ref.current)!==null&&L!==void 0&&L.disabled)}),y=x.findIndex(A=>A.ref.current===v),_=x.length;if(y===-1)return;p.preventDefault();let S=y;const C=0,E=_-1,$=()=>{S=y+1,S>E&&(S=C)},D=()=>{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?$():D());break;case"ArrowDown":i==="vertical"&&$();break;case"ArrowLeft":i==="horizontal"&&(d?D():$());break;case"ArrowUp":i==="vertical"&&D();break}const T=S%_;(b=x[T].ref.current)===null||b===void 0||b.focus()});return m.createElement(JEe,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(V2.Slot,{scope:n},m.createElement(Qe.div,ue({},a,{"data-orientation":i,ref:l,onKeyDown:r?void 0:h}))))}),gS="AccordionItem",[ZEe,W2]=Mv(gS),e2e=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=kv(gS,n),a=YEe(gS,n),s=H2(n),l=xi(),c=r&&a.value.includes(r)||!1,u=i.disabled||e.disabled;return m.createElement(ZEe,{scope:n,open:c,disabled:u,triggerId:l},m.createElement(VEe,ue({"data-orientation":i.orientation,"data-state":nF(c)},s,o,{ref:t,disabled:u,open:c,onOpenChange:d=>{d?a.onItemOpen(r):a.onItemClose(r)}})))}),t2e="AccordionHeader",n2e=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=kv(Zs,n),i=W2(t2e,n);return m.createElement(Qe.h3,ue({"data-orientation":o.orientation,"data-state":nF(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),nM="AccordionTrigger",r2e=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=kv(Zs,n),i=W2(nM,n),a=KEe(nM,n),s=H2(n);return m.createElement(V2.ItemSlot,{scope:n},m.createElement(HEe,ue({"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},s,r,{ref:t})))}),o2e="AccordionContent",i2e=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=kv(Zs,n),i=W2(o2e,n),a=H2(n);return m.createElement(WEe,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 nF(e){return e?"open":"closed"}const a2e=JL,s2e=e2e,l2e=n2e,rF=r2e,oF=i2e,c2e=a2e,iF=j.forwardRef(({className:e,...t},n)=>R.jsx(s2e,{ref:n,className:ye("border-b",e),...t}));iF.displayName="AccordionItem";const aF=j.forwardRef(({className:e,children:t,...n},r)=>R.jsx(l2e,{className:"flex",children:R.jsxs(rF,{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(jb,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));aF.displayName=rF.displayName;const sF=j.forwardRef(({className:e,children:t,...n},r)=>R.jsx(oF,{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})}));sF.displayName=oF.displayName;function Du(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 u2e(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function lF(...e){return t=>e.forEach(n=>u2e(n,t))}function Lp(...e){return m.useCallback(lF(...e),e)}function d2e(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,...b}=d,v=(h==null?void 0:h[e][l])||s,x=m.useMemo(()=>b,Object.values(b));return m.createElement(v.Provider,{value:x},p)}function u(d,h){const p=(h==null?void 0:h[e][l])||s,b=m.useContext(p);if(b)return b;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,f2e(o,...t)]}function f2e(...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 mS=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},h2e=j.useId||(()=>{});let p2e=0;function zx(e){const[t,n]=j.useState(h2e());return mS(()=>{e||n(r=>r??String(p2e++))},[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 g2e({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=m2e({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 m2e({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 U2=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(v2e);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(bS,ue({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(bS,ue({},r,{ref:t}),n)});U2.displayName="Slot";const bS=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...y2e(r,n.props),ref:lF(t,n.ref)}):m.Children.count(n)>1?m.Children.only(null):null});bS.displayName="SlotClone";const b2e=({children:e})=>m.createElement(m.Fragment,null,e);function v2e(e){return m.isValidElement(e)&&e.type===b2e}function y2e(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 x2e=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],Iv=x2e.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?U2: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 w2e(e,t){e&&Er.flushSync(()=>e.dispatchEvent(t))}function _2e(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 vS="dismissableLayer.update",S2e="dismissableLayer.pointerDownOutside",C2e="dismissableLayer.focusOutside";let rM;const E2e=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),R2e=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=m.useContext(E2e),[u,d]=m.useState(null),[,h]=m.useState({}),p=Lp(t,$=>d($)),b=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(v),y=u?b.indexOf(u):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=x,C=P2e($=>{const D=$.target,T=[...c.branches].some(A=>A.contains(D));!S||T||(o==null||o($),a==null||a($),$.defaultPrevented||s==null||s())}),E=$2e($=>{const D=$.target;[...c.branches].some(A=>A.contains(D))||(i==null||i($),a==null||a($),$.defaultPrevented||s==null||s())});return _2e($=>{y===c.layers.size-1&&(r==null||r($),!$.defaultPrevented&&s&&($.preventDefault(),s()))}),m.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(rM=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),oM(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=rM)}},[u,n,c]),m.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),oM())},[u,c]),m.useEffect(()=>{const $=()=>h({});return document.addEventListener(vS,$),()=>document.removeEventListener(vS,$)},[]),m.createElement(Iv.div,ue({},l,{ref:p,style:{pointerEvents:_?S?"auto":"none":void 0,...e.style},onFocusCapture:Du(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Du(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Du(e.onPointerDownCapture,C.onPointerDownCapture)}))});function P2e(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(){cF(S2e,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 $2e(e){const t=gc(e),n=m.useRef(!1);return m.useEffect(()=>{const r=o=>{o.target&&!n.current&&cF(C2e,t,{originalEvent:o},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function oM(){const e=new CustomEvent(vS);document.dispatchEvent(e)}function cF(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?w2e(o,i):o.dispatchEvent(i)}const Bx="focusScope.autoFocusOnMount",Vx="focusScope.autoFocusOnUnmount",iM={bubbles:!1,cancelable:!0},O2e=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=Lp(t,v=>l(v)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=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",v),document.addEventListener("focusout",x),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x)}}},[r,s,p.paused]),m.useEffect(()=>{if(s){sM.add(p);const v=document.activeElement;if(!s.contains(v)){const y=new CustomEvent(Bx,iM);s.addEventListener(Bx,c),s.dispatchEvent(y),y.defaultPrevented||(T2e(I2e(uF(s)),{select:!0}),document.activeElement===v&&Sl(s))}return()=>{s.removeEventListener(Bx,c),setTimeout(()=>{const y=new CustomEvent(Vx,iM);s.addEventListener(Vx,u),s.dispatchEvent(y),y.defaultPrevented||Sl(v??document.body,{select:!0}),s.removeEventListener(Vx,u),sM.remove(p)},0)}}},[s,c,u,p]);const b=m.useCallback(v=>{if(!n&&!r||p.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(x&&y){const _=v.currentTarget,[S,C]=D2e(_);S&&C?!v.shiftKey&&y===C?(v.preventDefault(),n&&Sl(S,{select:!0})):v.shiftKey&&y===S&&(v.preventDefault(),n&&Sl(C,{select:!0})):y===_&&v.preventDefault()}},[n,r,p.paused]);return m.createElement(Iv.div,ue({tabIndex:-1},a,{ref:h,onKeyDown:b}))});function T2e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Sl(r,{select:t}),document.activeElement!==n)return}function D2e(e){const t=uF(e),n=aM(t,e),r=aM(t.reverse(),e);return[n,r]}function uF(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 aM(e,t){for(const n of e)if(!A2e(n,{upTo:t}))return n}function A2e(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 M2e(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&&M2e(e)&&t&&e.select()}}const sM=k2e();function k2e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=lM(e,t),e.unshift(t)},remove(t){var n;e=lM(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function lM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function I2e(e){return e.filter(t=>t.tagName!=="A")}const N2e=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 L2e(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=F2e(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Lp(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};Nv.displayName="Presence";function F2e(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),a=e?"mounted":"unmounted",[s,l]=L2e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Bm(r.current);i.current=s==="mounted"?c:"none"},[s]),mS(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=Bm(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]),mS(()=>{if(t){const c=d=>{const p=Bm(r.current).includes(d.animationName);d.target===t&&p&&Er.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Bm(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 Bm(e){return(e==null?void 0:e.animationName)||"none"}let Hx=0;function j2e(){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:cM()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:cM()),Hx++,()=>{Hx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Hx--}},[])}function cM(){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 dF=$E(),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,b=e.inert,v=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,_=av(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=h,C=PE([n,t]),E=Nn(Nn({},_),o);return j.createElement(j.Fragment,null,u&&j.createElement(S,{sideCar:dF,removeScrollBar:c,shards:d,noIsolation:p,inert:b,setCallbacks:i,allowPinchZoom:!!v,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:Pu,zeroRight:Ru};var yS=!1;if(typeof window<"u")try{var Vm=Object.defineProperty({},"passive",{get:function(){return yS=!0,!0}});window.addEventListener("test",Vm,Vm),window.removeEventListener("test",Vm,Vm)}catch{yS=!1}var au=yS?{passive:!1}:!1,z2e=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},B2e=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},uM=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=fF(e,n);if(r){var o=hF(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},V2e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},H2e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},fF=function(e,t){return e==="v"?z2e(t):B2e(t)},hF=function(e,t){return e==="v"?V2e(t):H2e(t)},W2e=function(e,t){return e==="h"&&t==="rtl"?-1:1},U2e=function(e,t,n,r,o){var i=W2e(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=hF(e,s),b=p[0],v=p[1],x=p[2],y=v-x-i*b;(b||y)&&fF(e,s)&&(d+=y,h+=b),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},Hm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dM=function(e){return[e.deltaX,e.deltaY]},fM=function(e){return e&&"current"in e?e.current:e},q2e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},G2e=function(e){return`
441
- .block-interactivity-`.concat(e,` {pointer-events: none;}
442
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
443
- `)},Y2e=0,su=[];function K2e(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),o=j.useState(Y2e++)[0],i=j.useState(function(){return lv()})[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 v=RE([e.lockRef.current],(e.shards||[]).map(fM),!0).filter(Boolean);return v.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=j.useCallback(function(v,x){if("touches"in v&&v.touches.length===2)return!a.current.allowPinchZoom;var y=Hm(v),_=n.current,S="deltaX"in v?v.deltaX:_[0]-y[0],C="deltaY"in v?v.deltaY:_[1]-y[1],E,$=v.target,D=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in v&&D==="h"&&$.type==="range")return!1;var T=uM(D,$);if(!T)return!0;if(T?E=D:(E=D==="v"?"h":"v",T=uM(D,$)),!T)return!1;if(!r.current&&"changedTouches"in v&&(S||C)&&(r.current=E),!E)return!0;var A=r.current||E;return U2e(A,x,v,A==="h"?S:C,!0)},[]),l=j.useCallback(function(v){var x=v;if(!(!su.length||su[su.length-1]!==i)){var y="deltaY"in x?dM(x):Hm(x),_=t.current.filter(function(E){return E.name===x.type&&E.target===x.target&&q2e(E.delta,y)})[0];if(_&&_.should){x.preventDefault();return}if(!_){var S=(a.current.shards||[]).map(fM).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(v,x,y,_){var S={name:v,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(v){n.current=Hm(v),r.current=void 0},[]),d=j.useCallback(function(v){c(v.type,dM(v),v.target,s(v,e.lockRef.current))},[]),h=j.useCallback(function(v){c(v.type,Hm(v),v.target,s(v,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(v){return v!==i}),document.removeEventListener("wheel",l,au),document.removeEventListener("touchmove",l,au),document.removeEventListener("touchstart",u,au)}},[]);var p=e.removeScrollBar,b=e.inert;return j.createElement(j.Fragment,null,b?j.createElement(i,{styles:G2e(o)}):null,p?j.createElement(TE,{gapMode:"margin"}):null)}const X2e=OE(dF,K2e);var pF=j.forwardRef(function(e,t){return j.createElement(Lv,Nn({},e,{ref:t,sideCar:X2e}))});pF.classNames=Lv.classNames;const Q2e=pF,gF="Dialog",[mF,_5e]=d2e(gF),[J2e,Tc]=mF(gF),Z2e=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]=g2e({prop:r,defaultProp:o,onChange:i});return m.createElement(J2e,{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)},bF="DialogPortal",[eRe,vF]=mF(bF,{forceMount:void 0}),tRe=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Tc(bF,t);return m.createElement(eRe,{scope:t,forceMount:n},m.Children.map(r,a=>m.createElement(Nv,{present:n||i.open},m.createElement(N2e,{asChild:!0,container:o},a))))},xS="DialogOverlay",nRe=m.forwardRef((e,t)=>{const n=vF(xS,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Tc(xS,e.__scopeDialog);return i.modal?m.createElement(Nv,{present:r||i.open},m.createElement(rRe,ue({},o,{ref:t}))):null}),rRe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Tc(xS,n);return m.createElement(Q2e,{as:U2,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(Iv.div,ue({"data-state":xF(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Yh="DialogContent",oRe=m.forwardRef((e,t)=>{const n=vF(Yh,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Tc(Yh,e.__scopeDialog);return m.createElement(Nv,{present:r||i.open},i.modal?m.createElement(iRe,ue({},o,{ref:t})):m.createElement(aRe,ue({},o,{ref:t})))}),iRe=m.forwardRef((e,t)=>{const n=Tc(Yh,e.__scopeDialog),r=m.useRef(null),o=Lp(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Cp(i)},[]),m.createElement(yF,ue({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Du(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Du(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:Du(e.onFocusOutside,i=>i.preventDefault())}))}),aRe=m.forwardRef((e,t)=>{const n=Tc(Yh,e.__scopeDialog),r=m.useRef(!1);return m.createElement(yF,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()}}))}),yF=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=Tc(Yh,n),l=m.useRef(null),c=Lp(t,l);return j2e(),m.createElement(m.Fragment,null,m.createElement(O2e,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(R2e,ue({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":xF(s.open)},a,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)});function xF(e){return e?"open":"closed"}const sRe=Z2e,lRe=tRe,cRe=nRe,uRe=oRe;var hM=1,dRe=.9,fRe=.3,Ux=.1,hRe=0,qx=.999,pRe=.9999,gRe=.99,pM=/[\\\/\-_+.# \t"@\[\(\{&]/,mRe=/[\\\/\-_+.# \t"@\[\(\{&]/g;function wS(e,t,n,r,o,i){if(i===t.length)return o===e.length?hM:gRe;for(var a=r.charAt(i),s=n.indexOf(a,o),l=0,c,u,d;s>=0;)c=wS(e,t,n,r,s+1,i+1),c>l&&(s===o?c*=hM:pM.test(e.charAt(s-1))?(c*=dRe,d=e.slice(o,s-1).match(mRe),d&&o>0&&(c*=Math.pow(qx,d.length))):pM.test(e.slice(o,s-1))?(c*=hRe,o>0&&(c*=Math.pow(qx,s-o))):(c*=fRe,o>0&&(c*=Math.pow(qx,s-o))),e.charAt(s)!==t.charAt(i)&&(c*=pRe)),c<Ux&&n.charAt(s-1)===r.charAt(i+1)&&n.charAt(s-1)!==r.charAt(i)&&(u=wS(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 bRe(e,t){return wS(e,t,e.toLowerCase(),t.toLowerCase(),0,0)}var vRe=bRe;const yRe=mc(vRe);var xRe='[cmdk-list-sizer=""]',yf='[cmdk-group=""]',Gx='[cmdk-group-items=""]',wRe='[cmdk-group-heading=""]',wF='[cmdk-item=""]',gM=`${wF}:not([aria-disabled="true"])`,_S="cmdk-item-select",vs="data-value",_Re=(e,t)=>yRe(e,t),_F=j.createContext(void 0),Fp=()=>j.useContext(_F),SF=j.createContext(void 0),q2=()=>j.useContext(SF),CF=j.createContext(void 0),EF=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=RF(e),{label:c,children:u,value:d,onValueChange:h,filter:p,shouldFilter:b,...v}=e,x=j.useId(),y=j.useId(),_=j.useId(),S=MRe();Od(()=>{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 K,I,oe;if(!Object.is(r.current[q],O)){if(r.current[q]=O,q==="search")A(),D(),S(1,T);else if(q==="value")if(((K=l.current)==null?void 0:K.value)!==void 0){(oe=(I=l.current).onValueChange)==null||oe.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,()=>{D(),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,()=>{A(),D(),r.current.value||T(),C.emit()}),()=>{a.current.delete(q),o.current.delete(q),r.current.filtered.items.delete(q),S(4,()=>{A(),T(),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)??_Re;return q?H(q,r.current.search):0}function D(){if(!n.current||!r.current.search||l.current.shouldFilter===!1)return;let q=r.current.filtered.items,O=[];r.current.filtered.groups.forEach(K=>{let I=i.current.get(K),oe=0;I.forEach(ce=>{let de=q.get(ce);oe=Math.max(de,oe)}),O.push([K,oe])});let H=n.current.querySelector(xRe);z().sort((K,I)=>{let oe=K.getAttribute(vs),ce=I.getAttribute(vs);return(q.get(ce)??0)-(q.get(oe)??0)}).forEach(K=>{let I=K.closest(Gx);I?I.appendChild(K.parentElement===I?K:K.closest(`${Gx} > *`)):H.appendChild(K.parentElement===H?K:K.closest(`${Gx} > *`))}),O.sort((K,I)=>I[1]-K[1]).forEach(K=>{let I=n.current.querySelector(`${yf}[${vs}="${K[0]}"]`);I==null||I.parentElement.appendChild(I)})}function T(){let q=z().find(H=>!H.ariaDisabled),O=q==null?void 0:q.getAttribute(vs);C.setState("value",O||void 0)}function A(){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),K=$(H);r.current.filtered.items.set(O,K),K>0&&q++}for(let[O,H]of i.current)for(let K of H)if(r.current.filtered.items.get(K)>0){r.current.filtered.groups.add(O);break}r.current.filtered.count=q}function L(){var q,O,H;let K=F();K&&(((q=K.parentElement)==null?void 0:q.firstChild)===K&&((H=(O=K.closest(yf))==null?void 0:O.querySelector(wRe))==null||H.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function F(){return n.current.querySelector(`${wF}[aria-selected="true"]`)}function z(){return Array.from(n.current.querySelectorAll(gM))}function X(q){let O=z()[q];O&&C.setState("value",O.getAttribute(vs))}function G(q){var O;let H=F(),K=z(),I=K.findIndex(ce=>ce===H),oe=K[I+q];(O=l.current)!=null&&O.loop&&(oe=I+q<0?K[K.length-1]:I+q===K.length?K[0]:K[I+q]),oe&&C.setState("value",oe.getAttribute(vs))}function M(q){let O=F(),H=O==null?void 0:O.closest(yf),K;for(;H&&!K;)H=q>0?DRe(H,yf):ARe(H,yf),K=H==null?void 0:H.querySelector(gM);K?C.setState("value",K.getAttribute(vs)):G(q)}let U=()=>X(z().length-1),V=q=>{q.preventDefault(),q.metaKey?U():q.altKey?M(1):G(1)},Y=q=>{q.preventDefault(),q.metaKey?X(0):q.altKey?M(-1):G(-1)};return j.createElement("div",{ref:jp([n,t]),...v,"cmdk-root":"",onKeyDown:q=>{var O;if((O=v.onKeyDown)==null||O.call(v,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&&Y(q);break}case"ArrowUp":{Y(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 K=new Event(_S);H.dispatchEvent(K)}}}}},j.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:kRe},c),j.createElement(SF.Provider,{value:C},j.createElement(_F.Provider,{value:E},u)))}),SRe=j.forwardRef((e,t)=>{let n=j.useId(),r=j.useRef(null),o=j.useContext(CF),i=Fp(),a=RF(e);Od(()=>i.item(n,o),[]);let s=PF(n,r,[e.value,e.children,r]),l=q2(),c=fd(y=>y.value&&y.value===s.current),u=fd(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(_S,d),()=>y.removeEventListener(_S,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:b,onSelect:v,...x}=e;return j.createElement("div",{ref:jp([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)}),CRe=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=Fp(),u=fd(h=>c.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);Od(()=>c.group(i),[]),PF(i,a,[e.value,e.heading,s]);let d=j.createElement(CF.Provider,{value:i},r);return j.createElement("div",{ref:jp([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))}),ERe=j.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=j.useRef(null),i=fd(a=>!a.search);return!n&&!i?null:j.createElement("div",{ref:jp([o,t]),...r,"cmdk-separator":"",role:"separator"})}),RRe=j.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=q2(),a=fd(l=>l.search),s=Fp();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)}})}),PRe=j.forwardRef((e,t)=>{let{children:n,...r}=e,o=j.useRef(null),i=j.useRef(null),a=Fp();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:jp([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))}),$Re=j.forwardRef((e,t)=>{let{open:n,onOpenChange:r,container:o,...i}=e;return j.createElement(sRe,{open:n,onOpenChange:r},j.createElement(lRe,{container:o},j.createElement(cRe,{"cmdk-overlay":""}),j.createElement(uRe,{"aria-label":e.label,"cmdk-dialog":""},j.createElement(EF,{ref:t,...i}))))}),ORe=j.forwardRef((e,t)=>{let n=j.useRef(!0),r=fd(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"})}),TRe=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(EF,{List:PRe,Item:SRe,Input:RRe,Group:CRe,Separator:ERe,Dialog:$Re,Empty:ORe,Loading:TRe});function DRe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ARe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function RF(e){let t=j.useRef(e);return Od(()=>{t.current=e}),t}var Od=typeof window>"u"?j.useEffect:j.useLayoutEffect;function uu(e){let t=j.useRef();return t.current===void 0&&(t.current=e()),t}function jp(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function fd(e){let t=q2(),n=()=>e(t.snapshot());return j.useSyncExternalStore(t.subscribe,n,n)}function PF(e,t,n){let r=j.useRef(),o=Fp();return Od(()=>{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 MRe=()=>{let[e,t]=j.useState(),n=uu(()=>new Map);return Od(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}},kRe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const $F=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}));$F.displayName=io.displayName;const OF=j.forwardRef(({className:e,...t},n)=>R.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[R.jsx(Ok,{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})]}));OF.displayName=io.Input.displayName;const TF=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}));TF.displayName=io.List.displayName;const DF=j.forwardRef((e,t)=>R.jsx(io.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));DF.displayName=io.Empty.displayName;const AF=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}));AF.displayName=io.Group.displayName;const IRe=j.forwardRef(({className:e,...t},n)=>R.jsx(io.Separator,{ref:n,className:ye("-mx-1 h-px bg-border",e),...t}));IRe.displayName=io.Separator.displayName;const MF=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}));MF.displayName=io.Item.displayName;var NRe=Object.defineProperty,LRe=(e,t,n)=>t in e?NRe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wm=(e,t,n)=>(LRe(e,typeof t!="symbol"?t+"":t,n),n);const FRe={stringify:e=>e,parse:e=>e},jRe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},zRe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},BRe={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}},VRe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},Yx={string:FRe,number:jRe,boolean:zRe,function:BRe,json:VRe},Kx=Symbol.for("r2wc.render"),Um=Symbol.for("r2wc.connected"),bl=Symbol.for("r2wc.context"),ps=Symbol.for("r2wc.props");function HRe(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=WRe(d);l[d]=h,c[h]=d}class u extends HTMLElement{constructor(){super(),Wm(this,r,!0),Wm(this,o),Wm(this,i,{}),Wm(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],b=this.getAttribute(p),v=s[h],x=Yx[v];b&&x!=null&&x.parse&&(this[ps][h]=x.parse(b,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[Um]=!0,this[Kx]()}disconnectedCallback(){this[Um]=!1,this[bl]&&n.unmount(this[bl]),delete this[bl]}attributeChangedCallback(h,p,b){const v=c[h],x=s[v],y=Yx[x];v in s&&y!=null&&y.parse&&(this[ps][v]=y.parse(b,this),this[Kx]())}[(r=Um,o=bl,i=ps,Kx)](){this[Um]&&(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(b){this[ps][d]=b;const v=Yx[p];if(v!=null&&v.stringify){const x=v.stringify(b);this.getAttribute(h)!==x&&this.setAttribute(h,x)}}})}return u}function WRe(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function URe(e,t,n){const r=aw(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function qRe({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function GRe({root:e}){e.unmount()}function YRe(e,t={}){return HRe(e,t,{mount:URe,update:qRe,unmount:GRe})}const KRe={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"},XRe=YRe(tL,{props:KRe});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=C8;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=rI;exports.Accordion=c2e;exports.AccordionContent=sF;exports.AccordionItem=iF;exports.AccordionTrigger=aF;exports.BOOLEAN_DATA_TYPES=AS;exports.Bot=zw;exports.Button=no;exports.Calendar=wk;exports.Card=d6;exports.CardContent=_b;exports.CardDescription=jS;exports.CardHeader=wb;exports.CardTitle=gd;exports.CaretSortIcon=yQ;exports.ChartJsVisual=NE;exports.Check=fp;exports.CheckIcon=pk;exports.Checkbox=wv;exports.ChevronDown=jb;exports.ChevronLeft=mC;exports.ChevronRight=zb;exports.ChevronUp=_k;exports.Circle=bC;exports.ClipboardCopyIcon=CQ;exports.ColorFormat=c8;exports.Command=$F;exports.CommandEmpty=DF;exports.CommandGroup=AF;exports.CommandInput=OF;exports.CommandItem=MF;exports.CommandList=TF;exports.Cross2Icon=gk;exports.DATAMODEL_NAMESPCACE=qM;exports.DATE_DATA_TYPES=pd;exports.Dashboard=tL;exports.DashboardPanel=h6;exports.DashboardTabs=ZN;exports.DashboardWC=XRe;exports.Dialog=PCe;exports.DialogContent=AL;exports.DialogDescription=NL;exports.DialogFooter=kL;exports.DialogHeader=ML;exports.DialogTitle=IL;exports.DialogTrigger=$Ce;exports.Download=Sk;exports.DropdownMenu=_Ce;exports.DropdownMenuCheckboxItem=PL;exports.DropdownMenuContent=EL;exports.DropdownMenuItem=RL;exports.DropdownMenuLabel=OL;exports.DropdownMenuRadioGroup=CCe;exports.DropdownMenuRadioItem=$L;exports.DropdownMenuSeparator=TL;exports.DropdownMenuTrigger=SCe;exports.Editable=qi;exports.EditorAside=FL;exports.EditorMain=jL;exports.EditorPanel=LL;exports.ErrorBoundary=Bb;exports.Fallback=wC;exports.FallbackEditorCard=sJ;exports.Filter=Ck;exports.FilterHeader=E4;exports.FilterX=vC;exports.Ft=kEe;exports.GripVertical=Ek;exports.HoverCard=ev;exports.HoverCardContent=_p;exports.HoverCardTrigger=tv;exports.Icon=xk;exports.Info=Rk;exports.InfoCircledIcon=MQ;exports.Input=Jl;exports.Jt=R4;exports.KPICard=k7;exports.LOCALE_CURRENCY_PAIRS=sw;exports.Label=Tn;exports.Markdown=$9;exports.NUMBER_DATA_TYPES=ap;exports.PYTHON_DEFAULT_CODE=UM;exports.PaperPlaneIcon=mk;exports.Percent=Pk;exports.PlayIcon=NQ;exports.Plus=yC;exports.Popover=fv;exports.PopoverContent=Ep;exports.PopoverTrigger=hv;exports.RadioGroup=i2;exports.RadioGroupItem=ob;exports.ResizableHandle=Nwe;exports.ResizablePanel=cS;exports.ResizablePanelGroup=Y9;exports.ScanSearch=$k;exports.ScrollArea=Sh;exports.ScrollBar=mv;exports.Search=Ok;exports.Select=Ea;exports.SelectContent=ki;exports.SelectGroup=lu;exports.SelectItem=Hn;exports.SelectLabel=El;exports.SelectSeparator=Xf;exports.SelectTrigger=Mi;exports.SelectValue=Ra;exports.SemaphorContextProvider=c6;exports.SemaphorQueryClient=s6;exports.Separator=Sp;exports.Settings=xC;exports.SliderIcon=FQ;exports.Switch=V4;exports.TEXT_DATA_TYPES=yb;exports.Table=Tk;exports.Table$1=mE;exports.TableBody=vE;exports.TableCell=xE;exports.TableHead=yE;exports.TableHeader=bE;exports.TableRow=Kf;exports.TableVisual=d8;exports.Tabs=WS;exports.TabsContent=US;exports.TabsList=Cb;exports.TabsTrigger=Eb;exports.Te=N0e;exports.TextCard=R_;exports.Textarea=o2;exports.Toggle=IE;exports.Tooltip=aI;exports.TooltipContent=pE;exports.TooltipTrigger=sI;exports.TriangleDownIcon=bk;exports.TriangleUpIcon=vk;exports.UXProvider=eL;exports.UserRound=Dk;exports.X=bd;exports._=Vl;exports.cn=ye;exports.copyToClipboard=Pq;exports.createChartConfig=eE;exports.createLucideIcon=jn;exports.createSqlGenConfig=sG;exports.de=YL;exports.flexRender=k_;exports.fmt=MS;exports.getCanvasBackgroundColor=ih;exports.getColumnDataType=lG;exports.getContrastColor=Gu;exports.getCoreRowModel=RI;exports.getCssVariableValue=kk;exports.getDefaultFilterSql=Fme;exports.getFilterComponent=a2;exports.getFilterValueType=vu;exports.getKeys=tr;exports.getNumberAxis=SC;exports.getPaginationRowModel=$I;exports.getPlugins=Aq;exports.getQualifiedTableName=GM;exports.getRequest=Cq;exports.getSortedRowModel=PI;exports.getSql=aG;exports.getTenantAndEndUserId=Eq;exports.getTokenParams=AM;exports.isColumnInSqlGen=cG;exports.jsxRuntimeExports=R;exports.loadManifest=f8;exports.pivotData=y0;exports.postRequest=pb;exports.removeRing=Ff;exports.resolveDataType=xb;exports.titleCase=Tq;exports.useCard=Pae;exports.useCustomVisual=h8;exports.useDashboardActions=dr;exports.useDashboardCardQuery=Vb;exports.useDashboardStore=we;exports.useEditorActions=Fb;exports.useEditorStore=Ir;exports.useQuery=lp;exports.useQueryClient=FS;exports.useReactTable=OI;exports.useSemaphorContext=Mo;exports.useTheme=KM;exports.useTopoJson=A7;exports.v4=Fs;