react-semaphor 0.0.377 → 0.0.3772

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,440 +0,0 @@
1
- "use strict";var FY=Object.defineProperty;var ZT=e=>{throw TypeError(e)};var jY=(e,t,n)=>t in e?FY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Oe=(e,t,n)=>jY(e,typeof t!="symbol"?t+"":t,n),cx=(e,t,n)=>t.has(e)||ZT("Cannot "+n);var le=(e,t,n)=>(cx(e,t,"read from private field"),n?n.call(e):t.get(e)),et=(e,t,n)=>t.has(e)?ZT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ze=(e,t,n,r)=>(cx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Lt=(e,t,n)=>(cx(e,t,"access private method"),n);var Ng=(e,t,n,r)=>({set _(i){ze(e,t,i,n)},get _(){return le(e,t,r)}});const k=require("react"),Ar=require("react-dom");function nN(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const P=nN(k),mc=nN(Ar);var Ra=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ic(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function z_(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 i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var d1={exports:{}},df={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var JT;function $Y(){if(JT)return df;JT=1;var e=k,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,d={},p=null,h=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(h=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:p,ref:h,props:d,_owner:i.current}}return df.Fragment=n,df.jsx=s,df.jsxs=s,df}var ff={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var ek;function zY(){return ek||(ek=1,process.env.NODE_ENV!=="production"&&function(){var e=k,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m=Symbol.iterator,b="@@iterator";function y(te){if(te===null||typeof te!="object")return null;var Re=m&&te[m]||te[b];return typeof Re=="function"?Re:null}var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(te){{for(var Re=arguments.length,Me=new Array(Re>1?Re-1:0),We=1;We<Re;We++)Me[We-1]=arguments[We];_("error",te,Me)}}function _(te,Re,Me){{var We=x.ReactDebugCurrentFrame,Dt=We.getStackAddendum();Dt!==""&&(Re+="%s",Me=Me.concat([Dt]));var Ht=Me.map(function(St){return String(St)});Ht.unshift("Warning: "+Re),Function.prototype.apply.call(console[te],console,Ht)}}var E=!1,C=!1,R=!1,T=!1,M=!1,N;N=Symbol.for("react.module.reference");function j(te){return!!(typeof te=="string"||typeof te=="function"||te===r||te===o||M||te===i||te===c||te===u||T||te===h||E||C||R||typeof te=="object"&&te!==null&&(te.$$typeof===p||te.$$typeof===d||te.$$typeof===s||te.$$typeof===a||te.$$typeof===l||te.$$typeof===N||te.getModuleId!==void 0))}function F(te,Re,Me){var We=te.displayName;if(We)return We;var Dt=Re.displayName||Re.name||"";return Dt!==""?Me+"("+Dt+")":Me}function $(te){return te.displayName||"Context"}function Q(te){if(te==null)return null;if(typeof te.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof te=="function")return te.displayName||te.name||null;if(typeof te=="string")return te;switch(te){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof te=="object")switch(te.$$typeof){case a:var Re=te;return $(Re)+".Consumer";case s:var Me=te;return $(Me._context)+".Provider";case l:return F(te,te.render,"ForwardRef");case d:var We=te.displayName||null;return We!==null?We:Q(te.type)||"Memo";case p:{var Dt=te,Ht=Dt._payload,St=Dt._init;try{return Q(St(Ht))}catch{return null}}}return null}var H=Object.assign,L=0,G,V,B,X,I,q,U;function O(){}O.__reactDisabledLog=!0;function ee(){{if(L===0){G=console.log,V=console.info,B=console.warn,X=console.error,I=console.group,q=console.groupCollapsed,U=console.groupEnd;var te={configurable:!0,enumerable:!0,value:O,writable:!0};Object.defineProperties(console,{info:te,log:te,warn:te,error:te,group:te,groupCollapsed:te,groupEnd:te})}L++}}function K(){{if(L--,L===0){var te={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},te,{value:G}),info:H({},te,{value:V}),warn:H({},te,{value:B}),error:H({},te,{value:X}),group:H({},te,{value:I}),groupCollapsed:H({},te,{value:q}),groupEnd:H({},te,{value:U})})}L<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var oe=x.ReactCurrentDispatcher,Y;function J(te,Re,Me){{if(Y===void 0)try{throw Error()}catch(Dt){var We=Dt.stack.trim().match(/\n( *(at )?)/);Y=We&&We[1]||""}return`
18
- `+Y+te}}var se=!1,ae;{var ge=typeof WeakMap=="function"?WeakMap:Map;ae=new ge}function ne(te,Re){if(!te||se)return"";{var Me=ae.get(te);if(Me!==void 0)return Me}var We;se=!0;var Dt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ht;Ht=oe.current,oe.current=null,ee();try{if(Re){var St=function(){throw Error()};if(Object.defineProperty(St.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(St,[])}catch(Tt){We=Tt}Reflect.construct(te,[],St)}else{try{St.call()}catch(Tt){We=Tt}te.call(St.prototype)}}else{try{throw Error()}catch(Tt){We=Tt}te()}}catch(Tt){if(Tt&&We&&typeof Tt.stack=="string"){for(var bt=Tt.stack.split(`
19
- `),Ne=We.stack.split(`
20
- `),re=bt.length-1,Se=Ne.length-1;re>=1&&Se>=0&&bt[re]!==Ne[Se];)Se--;for(;re>=1&&Se>=0;re--,Se--)if(bt[re]!==Ne[Se]){if(re!==1||Se!==1)do if(re--,Se--,Se<0||bt[re]!==Ne[Se]){var Ie=`
21
- `+bt[re].replace(" at new "," at ");return te.displayName&&Ie.includes("<anonymous>")&&(Ie=Ie.replace("<anonymous>",te.displayName)),typeof te=="function"&&ae.set(te,Ie),Ie}while(re>=1&&Se>=0);break}}}finally{se=!1,oe.current=Ht,K(),Error.prepareStackTrace=Dt}var Mt=te?te.displayName||te.name:"",hn=Mt?J(Mt):"";return typeof te=="function"&&ae.set(te,hn),hn}function fe(te,Re,Me){return ne(te,!1)}function he(te){var Re=te.prototype;return!!(Re&&Re.isReactComponent)}function _e(te,Re,Me){if(te==null)return"";if(typeof te=="function")return ne(te,he(te));if(typeof te=="string")return J(te);switch(te){case c:return J("Suspense");case u:return J("SuspenseList")}if(typeof te=="object")switch(te.$$typeof){case l:return fe(te.render);case d:return _e(te.type,Re,Me);case p:{var We=te,Dt=We._payload,Ht=We._init;try{return _e(Ht(Dt),Re,Me)}catch{}}}return""}var Ae=Object.prototype.hasOwnProperty,Le={},ke=x.ReactDebugCurrentFrame;function Be(te){if(te){var Re=te._owner,Me=_e(te.type,te._source,Re?Re.type:null);ke.setExtraStackFrame(Me)}else ke.setExtraStackFrame(null)}function dt(te,Re,Me,We,Dt){{var Ht=Function.call.bind(Ae);for(var St in te)if(Ht(te,St)){var bt=void 0;try{if(typeof te[St]!="function"){var Ne=Error((We||"React class")+": "+Me+" type `"+St+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof te[St]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ne.name="Invariant Violation",Ne}bt=te[St](Re,St,We,Me,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(re){bt=re}bt&&!(bt instanceof Error)&&(Be(Dt),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",We||"React class",Me,St,typeof bt),Be(null)),bt instanceof Error&&!(bt.message in Le)&&(Le[bt.message]=!0,Be(Dt),w("Failed %s type: %s",Me,bt.message),Be(null))}}}var Ct=Array.isArray;function an(te){return Ct(te)}function mt(te){{var Re=typeof Symbol=="function"&&Symbol.toStringTag,Me=Re&&te[Symbol.toStringTag]||te.constructor.name||"Object";return Me}}function Wt(te){try{return jt(te),!1}catch{return!0}}function jt(te){return""+te}function de(te){if(Wt(te))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",mt(te)),jt(te)}var Ce=x.ReactCurrentOwner,He={key:!0,ref:!0,__self:!0,__source:!0},Ge,at;function On(te){if(Ae.call(te,"ref")){var Re=Object.getOwnPropertyDescriptor(te,"ref").get;if(Re&&Re.isReactWarning)return!1}return te.ref!==void 0}function jn(te){if(Ae.call(te,"key")){var Re=Object.getOwnPropertyDescriptor(te,"key").get;if(Re&&Re.isReactWarning)return!1}return te.key!==void 0}function Pn(te,Re){typeof te.ref=="string"&&Ce.current}function ln(te,Re){{var Me=function(){Ge||(Ge=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Re))};Me.isReactWarning=!0,Object.defineProperty(te,"key",{get:Me,configurable:!0})}}function $n(te,Re){{var Me=function(){at||(at=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Re))};Me.isReactWarning=!0,Object.defineProperty(te,"ref",{get:Me,configurable:!0})}}var nn=function(te,Re,Me,We,Dt,Ht,St){var bt={$$typeof:t,type:te,key:Re,ref:Me,props:St,_owner:Ht};return bt._store={},Object.defineProperty(bt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(bt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:We}),Object.defineProperty(bt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Dt}),Object.freeze&&(Object.freeze(bt.props),Object.freeze(bt)),bt};function ir(te,Re,Me,We,Dt){{var Ht,St={},bt=null,Ne=null;Me!==void 0&&(de(Me),bt=""+Me),jn(Re)&&(de(Re.key),bt=""+Re.key),On(Re)&&(Ne=Re.ref,Pn(Re,Dt));for(Ht in Re)Ae.call(Re,Ht)&&!He.hasOwnProperty(Ht)&&(St[Ht]=Re[Ht]);if(te&&te.defaultProps){var re=te.defaultProps;for(Ht in re)St[Ht]===void 0&&(St[Ht]=re[Ht])}if(bt||Ne){var Se=typeof te=="function"?te.displayName||te.name||"Unknown":te;bt&&ln(St,Se),Ne&&$n(St,Se)}return nn(te,bt,Ne,Dt,We,Ce.current,St)}}var Xn=x.ReactCurrentOwner,Gi=x.ReactDebugCurrentFrame;function xr(te){if(te){var Re=te._owner,Me=_e(te.type,te._source,Re?Re.type:null);Gi.setExtraStackFrame(Me)}else Gi.setExtraStackFrame(null)}var jo;jo=!1;function wr(te){return typeof te=="object"&&te!==null&&te.$$typeof===t}function Lr(){{if(Xn.current){var te=Q(Xn.current.type);if(te)return`
22
-
23
- Check the render method of \``+te+"`."}return""}}function dl(te){return""}var je={};function wt(te){{var Re=Lr();if(!Re){var Me=typeof te=="string"?te:te.displayName||te.name;Me&&(Re=`
24
-
25
- Check the top-level render call using <`+Me+">.")}return Re}}function Ut(te,Re){{if(!te._store||te._store.validated||te.key!=null)return;te._store.validated=!0;var Me=wt(Re);if(je[Me])return;je[Me]=!0;var We="";te&&te._owner&&te._owner!==Xn.current&&(We=" It was passed a child from "+Q(te._owner.type)+"."),xr(te),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Me,We),xr(null)}}function Qn(te,Re){{if(typeof te!="object")return;if(an(te))for(var Me=0;Me<te.length;Me++){var We=te[Me];wr(We)&&Ut(We,Re)}else if(wr(te))te._store&&(te._store.validated=!0);else if(te){var Dt=y(te);if(typeof Dt=="function"&&Dt!==te.entries)for(var Ht=Dt.call(te),St;!(St=Ht.next()).done;)wr(St.value)&&Ut(St.value,Re)}}}function Zn(te){{var Re=te.type;if(Re==null||typeof Re=="string")return;var Me;if(typeof Re=="function")Me=Re.propTypes;else if(typeof Re=="object"&&(Re.$$typeof===l||Re.$$typeof===d))Me=Re.propTypes;else return;if(Me){var We=Q(Re);dt(Me,te.props,"prop",We,te)}else if(Re.PropTypes!==void 0&&!jo){jo=!0;var Dt=Q(Re);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Dt||"Unknown")}typeof Re.getDefaultProps=="function"&&!Re.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Fr(te){{for(var Re=Object.keys(te.props),Me=0;Me<Re.length;Me++){var We=Re[Me];if(We!=="children"&&We!=="key"){xr(te),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",We),xr(null);break}}te.ref!==null&&(xr(te),w("Invalid attribute `ref` supplied to `React.Fragment`."),xr(null))}}var fr={};function or(te,Re,Me,We,Dt,Ht){{var St=j(te);if(!St){var bt="";(te===void 0||typeof te=="object"&&te!==null&&Object.keys(te).length===0)&&(bt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ne=dl();Ne?bt+=Ne:bt+=Lr();var re;te===null?re="null":an(te)?re="array":te!==void 0&&te.$$typeof===t?(re="<"+(Q(te.type)||"Unknown")+" />",bt=" Did you accidentally export a JSX literal instead of a component?"):re=typeof te,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",re,bt)}var Se=ir(te,Re,Me,Dt,Ht);if(Se==null)return Se;if(St){var Ie=Re.children;if(Ie!==void 0)if(We)if(an(Ie)){for(var Mt=0;Mt<Ie.length;Mt++)Qn(Ie[Mt],te);Object.freeze&&Object.freeze(Ie)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Qn(Ie,te)}if(Ae.call(Re,"key")){var hn=Q(te),Tt=Object.keys(Re).filter(function(_s){return _s!=="key"}),Wn=Tt.length>0?"{key: someKey, "+Tt.join(": ..., ")+": ...}":"{key: someKey}";if(!fr[hn+Wn]){var Jr=Tt.length>0?"{"+Tt.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
26
- let props = %s;
27
- <%s {...props} />
28
- React keys must be passed directly to JSX without using spread:
29
- let props = %s;
30
- <%s key={someKey} {...props} />`,Wn,hn,Jr,hn),fr[hn+Wn]=!0}}return te===r?Fr(Se):Zn(Se),Se}}function yn(te,Re,Me){return or(te,Re,Me,!0)}function aa(te,Re,Me){return or(te,Re,Me,!1)}var Wc=aa,Uc=yn;ff.Fragment=r,ff.jsx=Wc,ff.jsxs=Uc}()),ff}process.env.NODE_ENV==="production"?d1.exports=$Y():d1.exports=zY();var v=d1.exports;function rN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=rN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rd(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=rN(e))&&(r&&(r+=" "),r+=t);return r}const BY=Object.freeze(Object.defineProperty({__proto__:null,clsx:rd,default:rd},Symbol.toStringTag,{value:"Module"})),B_="-",HY=e=>{const t=WY(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(B_);return a[0]===""&&a.length!==1&&a.shift(),iN(a,t)||VY(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},iN=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?iN(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(B_);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},tk=/^\[(.+)\]$/,VY=e=>{if(tk.test(e)){const t=tk.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},WY=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return GY(Object.entries(e.classGroups),n).forEach(([o,s])=>{f1(s,r,o,t)}),r},f1=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:nk(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(UY(i)){f1(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{f1(s,nk(t,o),n,r)})})},nk=(e,t)=>{let n=e;return t.split(B_).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},UY=e=>e.isThemeGetter,GY=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e,qY=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},oN="!",YY=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,s=a=>{const l=[];let c=0,u=0,d;for(let y=0;y<a.length;y++){let x=a[y];if(c===0){if(x===i&&(r||a.slice(y,y+o)===t)){l.push(a.slice(u,y)),u=y+o;continue}if(x==="/"){d=y;continue}}x==="["?c++:x==="]"&&c--}const p=l.length===0?a:a.substring(u),h=p.startsWith(oN),m=h?p.substring(1):p,b=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:s}):s},KY=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},XY=e=>({cache:qY(e.cacheSize),parseClassName:YY(e),...HY(e)}),QY=/\s+/,ZY=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(QY);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:u,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(c);let m=!!h,b=r(m?p.substring(0,h):p);if(!b){if(!m){a=c+(a.length>0?" "+a:a);continue}if(b=r(p),!b){a=c+(a.length>0?" "+a:a);continue}m=!1}const y=KY(u).join(":"),x=d?y+oN:y,w=x+b;if(o.includes(w))continue;o.push(w);const _=i(b,m);for(let E=0;E<_.length;++E){const C=_[E];o.push(x+C)}a=c+(a.length>0?" "+a:a)}return a};function JY(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=sN(t))&&(r&&(r+=" "),r+=n);return r}const sN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=sN(e[r]))&&(n&&(n+=" "),n+=t);return n};function eK(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=XY(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=ZY(l,n);return i(l,u),u}return function(){return o(JY.apply(null,arguments))}}const xn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},aN=/^\[(?:([a-z-]+):)?(.+)\]$/i,tK=/^\d+\/\d+$/,nK=new Set(["px","full","screen"]),rK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iK=/\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$/,oK=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,sK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Is=e=>ku(e)||nK.has(e)||tK.test(e),ba=e=>Td(e,"length",gK),ku=e=>!!e&&!Number.isNaN(Number(e)),ux=e=>Td(e,"number",ku),hf=e=>!!e&&Number.isInteger(Number(e)),lK=e=>e.endsWith("%")&&ku(e.slice(0,-1)),ht=e=>aN.test(e),ya=e=>rK.test(e),cK=new Set(["length","size","percentage"]),uK=e=>Td(e,cK,lN),dK=e=>Td(e,"position",lN),fK=new Set(["image","url"]),hK=e=>Td(e,fK,bK),pK=e=>Td(e,"",mK),pf=()=>!0,Td=(e,t,n)=>{const r=aN.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},gK=e=>iK.test(e)&&!oK.test(e),lN=()=>!1,mK=e=>sK.test(e),bK=e=>aK.test(e),yK=()=>{const e=xn("colors"),t=xn("spacing"),n=xn("blur"),r=xn("brightness"),i=xn("borderColor"),o=xn("borderRadius"),s=xn("borderSpacing"),a=xn("borderWidth"),l=xn("contrast"),c=xn("grayscale"),u=xn("hueRotate"),d=xn("invert"),p=xn("gap"),h=xn("gradientColorStops"),m=xn("gradientColorStopPositions"),b=xn("inset"),y=xn("margin"),x=xn("opacity"),w=xn("padding"),_=xn("saturate"),E=xn("scale"),C=xn("sepia"),R=xn("skew"),T=xn("space"),M=xn("translate"),N=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",ht,t],$=()=>[ht,t],Q=()=>["",Is,ba],H=()=>["auto",ku,ht],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["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"],B=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",ht],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[ku,ht];return{cacheSize:500,separator:":",theme:{colors:[pf],spacing:[Is,ba],blur:["none","",ya,ht],brightness:q(),borderColor:[e],borderRadius:["none","","full",ya,ht],borderSpacing:$(),borderWidth:Q(),contrast:q(),grayscale:X(),hueRotate:q(),invert:X(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[lK,ba],inset:F(),margin:F(),opacity:q(),padding:$(),saturate:q(),scale:q(),sepia:X(),skew:q(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",ht]}],container:["container"],columns:[{columns:[ya]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),ht]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",hf,ht]}],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",ht]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",hf,ht]}],"grid-cols":[{"grid-cols":[pf]}],"col-start-end":[{col:["auto",{span:["full",hf,ht]},ht]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[pf]}],"row-start-end":[{row:["auto",{span:[hf,ht]},ht]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ht]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ht]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ht,t]}],"min-w":[{"min-w":[ht,t,"min","max","fit"]}],"max-w":[{"max-w":[ht,t,"none","full","min","max","fit","prose",{screen:[ya]},ya]}],h:[{h:[ht,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ht,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ht,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ht,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ya,ba]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ux]}],"font-family":[{font:[pf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ht]}],"line-clamp":[{"line-clamp":["none",ku,ux]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Is,ht]}],"list-image":[{"list-image":["none",ht]}],"list-style-type":[{list:["none","disc","decimal",ht]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Is,ba]}],"underline-offset":[{"underline-offset":["auto",Is,ht]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ht]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),dK]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uK]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hK]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:G()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[Is,ht]}],"outline-w":[{outline:[Is,ba]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Is,ba]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ya,pK]}],"shadow-color":[{shadow:[pf]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ya,ht]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ht]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",ht]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",ht]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[hf,ht]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ht]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ht]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ht]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Is,ba,ux]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},vK=eK(yK);class Ff extends Error{}Ff.prototype.name="InvalidTokenError";function xK(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 wK(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 xK(t)}catch{return atob(t)}}function H_(e,t){if(typeof e!="string")throw new Ff("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new Ff(`Invalid token specified: missing part #${n+1}`);let i;try{i=wK(r)}catch(o){throw new Ff(`Invalid token specified: invalid base64 for part #${n+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new Ff(`Invalid token specified: invalid json for part #${n+1} (${o.message})`)}}const rk=e=>{let t;const n=new Set,r=(u,d)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const h=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(m=>m(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{n.clear()}},c=t=e(r,i,l);return l},SK=e=>e?rk(e):rk;var h1={exports:{}},dx={},Lg={exports:{}},fx={};/**
31
- * @license React
32
- * use-sync-external-store-shim.production.js
33
- *
34
- * Copyright (c) Meta Platforms, Inc. and affiliates.
35
- *
36
- * This source code is licensed under the MIT license found in the
37
- * LICENSE file in the root directory of this source tree.
38
- */var ik;function _K(){if(ik)return fx;ik=1;var e=k;function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(d,p){var h=p(),m=r({inst:{value:h,getSnapshot:p}}),b=m[0].inst,y=m[1];return o(function(){b.value=h,b.getSnapshot=p,l(b)&&y({inst:b})},[d,h,p]),i(function(){return l(b)&&y({inst:b}),d(function(){l(b)&&y({inst:b})})},[d]),s(h),h}function l(d){var p=d.getSnapshot;d=d.value;try{var h=p();return!n(d,h)}catch{return!0}}function c(d,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return fx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,fx}var hx={};/**
39
- * @license React
40
- * use-sync-external-store-shim.development.js
41
- *
42
- * Copyright (c) Meta Platforms, Inc. and affiliates.
43
- *
44
- * This source code is licensed under the MIT license found in the
45
- * LICENSE file in the root directory of this source tree.
46
- */var ok;function CK(){return ok||(ok=1,process.env.NODE_ENV!=="production"&&function(){function e(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}function t(h,m){u||i.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var b=m();if(!d){var y=m();o(b,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}y=s({inst:{value:b,getSnapshot:m}});var x=y[0].inst,w=y[1];return l(function(){x.value=b,x.getSnapshot=m,n(x)&&w({inst:x})},[h,b,m]),a(function(){return n(x)&&w({inst:x}),h(function(){n(x)&&w({inst:x})})},[h]),c(b),b}function n(h){var m=h.getSnapshot;h=h.value;try{var b=m();return!o(h,b)}catch{return!0}}function r(h,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=k,o=typeof Object.is=="function"?Object.is:e,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,c=i.useDebugValue,u=!1,d=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;hx.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),hx}var sk;function V_(){return sk||(sk=1,process.env.NODE_ENV==="production"?Lg.exports=_K():Lg.exports=CK()),Lg.exports}/**
47
- * @license React
48
- * use-sync-external-store-shim/with-selector.production.js
49
- *
50
- * Copyright (c) Meta Platforms, Inc. and affiliates.
51
- *
52
- * This source code is licensed under the MIT license found in the
53
- * LICENSE file in the root directory of this source tree.
54
- */var ak;function EK(){if(ak)return dx;ak=1;var e=k,t=V_();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,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return dx.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var m=o(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=a(function(){function x(R){if(!w){if(w=!0,_=R,R=p(R),h!==void 0&&b.hasValue){var T=b.value;if(h(T,R))return E=T}return E=R}if(T=E,r(_,R))return T;var M=p(R);return h!==void 0&&h(T,M)?(_=R,T):(_=R,E=M)}var w=!1,_,E,C=d===void 0?null:d;return[function(){return x(u())},C===null?void 0:function(){return x(C())}]},[u,d,p,h]);var y=i(c,m[0],m[1]);return s(function(){b.hasValue=!0,b.value=y},[y]),l(y),y},dx}var px={};/**
55
- * @license React
56
- * use-sync-external-store-shim/with-selector.development.js
57
- *
58
- * Copyright (c) Meta Platforms, Inc. and affiliates.
59
- *
60
- * This source code is licensed under the MIT license found in the
61
- * LICENSE file in the root directory of this source tree.
62
- */var lk;function RK(){return lk||(lk=1,process.env.NODE_ENV!=="production"&&function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,n=V_(),r=typeof Object.is=="function"?Object.is:e,i=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;px.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var m=o(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=a(function(){function x(R){if(!w){if(w=!0,_=R,R=p(R),h!==void 0&&b.hasValue){var T=b.value;if(h(T,R))return E=T}return E=R}if(T=E,r(_,R))return T;var M=p(R);return h!==void 0&&h(T,M)?(_=R,T):(_=R,E=M)}var w=!1,_,E,C=d===void 0?null:d;return[function(){return x(u())},C===null?void 0:function(){return x(C())}]},[u,d,p,h]);var y=i(c,m[0],m[1]);return s(function(){b.hasValue=!0,b.value=y},[y]),l(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),px}process.env.NODE_ENV==="production"?h1.exports=EK():h1.exports=RK();var PK=h1.exports;const TK=Ic(PK),{useDebugValue:kK}=k,{useSyncExternalStoreWithSelector:AK}=TK,OK=e=>e;function MK(e,t=OK,n){const r=AK(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return kK(r),r}const ck=e=>{const t=typeof e=="function"?SK(e):e,n=(r,i)=>MK(t,r,i);return Object.assign(n,t),n},cN=e=>e?ck(e):ck;var uN=Symbol.for("immer-nothing"),uk=Symbol.for("immer-draftable"),$i=Symbol.for("immer-state"),IK=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 pi(e,...t){if(process.env.NODE_ENV!=="production"){const n=IK[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var id=Object.getPrototypeOf;function od(e){return!!e&&!!e[$i]}function bc(e){var t;return e?dN(e)||Array.isArray(e)||!!e[uk]||!!((t=e.constructor)!=null&&t[uk])||wy(e)||Sy(e):!1}var DK=Object.prototype.constructor.toString();function dN(e){if(!e||typeof e!="object")return!1;const t=id(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===DK}function ub(e,t){xy(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function xy(e){const t=e[$i];return t?t.type_:Array.isArray(e)?1:wy(e)?2:Sy(e)?3:0}function p1(e,t){return xy(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function fN(e,t,n){const r=xy(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function NK(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function wy(e){return e instanceof Map}function Sy(e){return e instanceof Set}function Al(e){return e.copy_||e.base_}function g1(e,t){if(wy(e))return new Map(e);if(Sy(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=dN(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[$i];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(id(e),r)}else{const r=id(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function W_(e,t=!1){return _y(e)||od(e)||!bc(e)||(xy(e)>1&&(e.set=e.add=e.clear=e.delete=LK),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>W_(r,!0))),e}function LK(){pi(2)}function _y(e){return Object.isFrozen(e)}var FK={};function yc(e){const t=FK[e];return t||pi(0,e),t}var _h;function hN(){return _h}function jK(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function dk(e,t){t&&(yc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function m1(e){b1(e),e.drafts_.forEach($K),e.drafts_=null}function b1(e){e===_h&&(_h=e.parent_)}function fk(e){return _h=jK(_h,e)}function $K(e){const t=e[$i];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function hk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[$i].modified_&&(m1(t),pi(4)),bc(e)&&(e=db(t,e),t.parent_||fb(t,e)),t.patches_&&yc("Patches").generateReplacementPatches_(n[$i].base_,e,t.patches_,t.inversePatches_)):e=db(t,n,[]),m1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==uN?e:void 0}function db(e,t,n){if(_y(t))return t;const r=t[$i];if(!r)return ub(t,(i,o)=>pk(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return fb(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),ub(o,(a,l)=>pk(e,r,i,a,l,n,s)),fb(e,i,!1),n&&e.patches_&&yc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function pk(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&pi(5),od(i)){const a=o&&t&&t.type_!==3&&!p1(t.assigned_,r)?o.concat(r):void 0,l=db(e,i,a);if(fN(n,r,l),od(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(bc(i)&&!_y(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;db(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&fb(e,i)}}function fb(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&W_(t,n)}function zK(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:hN(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=U_;n&&(i=[r],o=Ch);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var U_={get(e,t){if(t===$i)return e;const n=Al(e);if(!p1(n,t))return BK(e,n,t);const r=n[t];return e.finalized_||!bc(r)?r:r===gx(e.base_,t)?(mx(e),e.copy_[t]=v1(r,e)):r},has(e,t){return t in Al(e)},ownKeys(e){return Reflect.ownKeys(Al(e))},set(e,t,n){const r=pN(Al(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=gx(Al(e),t),o=i==null?void 0:i[$i];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(NK(n,i)&&(n!==void 0||p1(e.base_,t)))return!0;mx(e),y1(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 gx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,mx(e),y1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Al(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){pi(11)},getPrototypeOf(e){return id(e.base_)},setPrototypeOf(){pi(12)}},Ch={};ub(U_,(e,t)=>{Ch[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ch.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&pi(13),Ch.set.call(this,e,t,void 0)};Ch.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&pi(14),U_.set.call(this,e[0],t,n,e[0])};function gx(e,t){const n=e[$i];return(n?Al(n):e)[t]}function BK(e,t,n){var i;const r=pN(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function pN(e,t){if(!(t in e))return;let n=id(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=id(n)}}function y1(e){e.modified_||(e.modified_=!0,e.parent_&&y1(e.parent_))}function mx(e){e.copy_||(e.copy_=g1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var HK=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&pi(6),r!==void 0&&typeof r!="function"&&pi(7);let i;if(bc(t)){const o=fk(this),s=v1(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?m1(o):b1(o)}return dk(o,r),hk(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===uN&&(i=void 0),this.autoFreeze_&&W_(i,!0),r){const o=[],s=[];yc("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else pi(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){bc(e)||pi(8),od(e)&&(e=VK(e));const t=fk(this),n=v1(e,void 0);return n[$i].isManual_=!0,b1(t),n}finishDraft(e,t){const n=e&&e[$i];(!n||!n.isManual_)&&pi(9);const{scope_:r}=n;return dk(r,t),hk(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=yc("Patches").applyPatches_;return od(e)?r(e,t):this.produce(e,i=>r(i,t))}};function v1(e,t){const n=wy(e)?yc("MapSet").proxyMap_(e,t):Sy(e)?yc("MapSet").proxySet_(e,t):zK(e,t);return(t?t.scope_:hN()).drafts_.push(n),n}function VK(e){return od(e)||pi(10,e),gN(e)}function gN(e){if(!bc(e)||_y(e))return e;const t=e[$i];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=g1(e,t.scope_.immer_.useStrictShallowCopy_)}else n=g1(e,!0);return ub(n,(r,i)=>{fN(n,r,gN(i))}),t&&(t.finalized_=!1),n}var zi=new HK,WK=zi.produce;zi.produceWithPatches.bind(zi);zi.setAutoFreeze.bind(zi);zi.setUseStrictShallowCopy.bind(zi);zi.applyPatches.bind(zi);zi.createDraft.bind(zi);zi.finishDraft.bind(zi);const UK=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?WK(i):i;return t(a,o,...s)},e(r.setState,n,r)),mN=UK;var x1,Fg=Ar;if(process.env.NODE_ENV==="production")x1=Fg.createRoot,Fg.hydrateRoot;else{var gk=Fg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;x1=function(e,t){gk.usingClientEntryPoint=!0;try{return Fg.createRoot(e,t)}finally{gk.usingClientEntryPoint=!1}}}var bN={},yN={},G_={exports:{}},pt=String,vN=function(){return{isColorSupported:!1,reset:pt,bold:pt,dim:pt,italic:pt,underline:pt,inverse:pt,hidden:pt,strikethrough:pt,black:pt,red:pt,green:pt,yellow:pt,blue:pt,magenta:pt,cyan:pt,white:pt,gray:pt,bgBlack:pt,bgRed:pt,bgGreen:pt,bgYellow:pt,bgBlue:pt,bgMagenta:pt,bgCyan:pt,bgWhite:pt,blackBright:pt,redBright:pt,greenBright:pt,yellowBright:pt,blueBright:pt,magentaBright:pt,cyanBright:pt,whiteBright:pt,bgBlackBright:pt,bgRedBright:pt,bgGreenBright:pt,bgYellowBright:pt,bgBlueBright:pt,bgMagentaBright:pt,bgCyanBright:pt,bgWhiteBright:pt}};G_.exports=vN();G_.exports.createColors=vN;var GK=G_.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(GK);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&i.has(u)||(u&&i.add(u),console.warn(""),c.forEach(d=>console.warn(l,"-",d)))}function s(l){return n.default.dim(l)}const a={info(l,c){o(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){o(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){o(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(yN);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(yN);function n(o){return o.__esModule?o:{default:o}}function r({version:o,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${o}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(bN);let bx=bN;var qK=(bx.__esModule?bx:{default:bx}).default;const $t=Ic(qK),q_=`import pandas as pd
63
- df = pd.DataFrame(data) # 'data' contains the query result
64
- result = df.to_dict('records') # must return 'result' as [dict] type
65
- `,Y_="dm",w1=[{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"}],YK=[{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)"}]}],K_=["lg","md","sm","xs","xxs"],hb={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[$t.blue[500],$t.teal[500],$t.amber[500],$t.red[500],$t.indigo[500],$t.green[500]],borderColor:[$t.blue[500],$t.teal[500],$t.amber[500],$t.red[500],$t.indigo[500],$t.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:S1},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[$t.blue[500],$t.teal[500],$t.amber[500],$t.red[500],$t.indigo[500],$t.green[500]],borderColor:[$t.blue[500],$t.teal[500],$t.amber[500],$t.red[500],$t.indigo[500],$t.green[500]],datalables:{color:S1}},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:$t.slate[800]}},y:{grid:{display:!0,color:$t.slate[800]}}}}}}};function S1(e){var r,i,o,s,a,l;const t=(a=(s=(o=(i=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:i._config)==null?void 0:o.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Eh()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Eh()),sd(n)}function Eh(){return ye.getState().theme==="dark"?"#000000":"#FFFFFF"}function sd(e){let t=0,n=0,r=0,i=0;const o=u=>{if(!u)return $t.gray[500];const d=u.replace("#",""),p=parseInt(d.substring(0,2),16),h=parseInt(d.substring(2,4),16),m=parseInt(d.substring(4,6),16);t+=p,n+=h,r+=m,i++};Array.isArray(e)?e.forEach(u=>{o(u)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const KK=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],XK=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],QK=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],ZK=["boolean"];function X_(e){return e.match(/[A-Z]/)?`"${e}"`:e}function Cy(e){return KK.includes(e.toLowerCase())||/varchar/i.test(e)}function cp(e){return XK.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function kd(e){return QK.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function Q_(e){return ZK.includes(e.toLowerCase())||/boolean/i.test(e)}function JK(e,t,n,r,i){const{measures:o,dimensions:s}=e,a=o==null?void 0:o.map(d=>`${d.calc}(${d.name}) as ${d.calc}_${d.name.replace(/"/g,"")}`).join(", "),l=(s==null?void 0:s.join(", "))||"";let c="";const u=r?`${Y_}.${r}`:Z_(t,n,i);if(a&&l)return c=`SELECT ${l}, COUNT(*) as count, ${a} FROM ${u} GROUP BY ${l} ORDER BY ${l} DESC LIMIT 100`,c;if(!a&&l)return c=`SELECT ${l}, COUNT(*) as count FROM ${u} GROUP BY ${l} ORDER BY ${l} DESC LIMIT 100`,c;if(a&&!l)return c=`SELECT ${a} FROM ${u} LIMIT 100`,c}function eX(e,t,n="AVG"){var o,s,a,l;let r={};const i=X_(e.column_name);return Cy(e.data_type)&&(((o=t.dimensions)==null?void 0:o.includes(i))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==i)}:r={...t,dimensions:[...t.dimensions||[],i]}),cp(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===i&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===i&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:i,calc:n||"SUM"}]}),r}function Au(e){return Cy(e.dataType)?"string":cp(e.dataType)?"number":kd(e.dataType)?"date":Q_(e.dataType)?"boolean":"string"}function tX(e){let t;const n=e.data_type.toLowerCase();return Cy(n)?t="T":cp(n)?t="#":kd(n)?t="D":Q_(n)?t="B":t="?",t}function nX(e,t){const{dimensions:n,measures:r}=t,i=n==null?void 0:n.includes(e.column_name),o=r==null?void 0:r.some(s=>s.name===e.column_name);return i||o}function xN({schemaName:e,tableName:t,modelName:n,connectionType:r}){let i=Z_(e,t,r);n&&(i=`${Y_}.${n}`);let o=i;return(a=>/[A-Z]/.test(a))(t)&&(o=o.split(".").map(l=>`"${l}"`).join(".")),o}function Z_(e,t,n){return t==="api"||e===X_("NA")||n==="S3"||n==="API"?t:e?`${e}.${t}`:`${t}`}const rX=e=>{const t=new Date(e);return!isNaN(t.getTime())},iX=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Ey=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?rX(e)?t="date":iX(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function oX({get:e,dataPoint:t,card:n}){var p;const{addOrUpdateFilterValue:r,addFilteringCard:i,removeFilterValues:o,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(p=n.preferences)==null?void 0:p.filterOnClickField,valueType:Ey(u),operation:"=",values:[u]};if(l!=null&&l.find(h=>h.id===n.id)){const h=n.id;if(u==null){a(n),o(h);return}else s(d)}i(n),r(d)}var pb={exports:{}};/**
66
- * @license
67
- * Lodash <https://lodash.com/>
68
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
69
- * Released under MIT license <https://lodash.com/license>
70
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
71
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
72
- */pb.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,p=2,h=4,m=1,b=2,y=1,x=2,w=4,_=8,E=16,C=32,R=64,T=128,M=256,N=512,j=30,F="...",$=800,Q=16,H=1,L=2,G=3,V=1/0,B=9007199254740991,X=17976931348623157e292,I=NaN,q=4294967295,U=q-1,O=q>>>1,ee=[["ary",T],["bind",y],["bindKey",x],["curry",_],["curryRight",E],["flip",N],["partial",C],["partialRight",R],["rearg",M]],K="[object Arguments]",oe="[object Array]",Y="[object AsyncFunction]",J="[object Boolean]",se="[object Date]",ae="[object DOMException]",ge="[object Error]",ne="[object Function]",fe="[object GeneratorFunction]",he="[object Map]",_e="[object Number]",Ae="[object Null]",Le="[object Object]",ke="[object Promise]",Be="[object Proxy]",dt="[object RegExp]",Ct="[object Set]",an="[object String]",mt="[object Symbol]",Wt="[object Undefined]",jt="[object WeakMap]",de="[object WeakSet]",Ce="[object ArrayBuffer]",He="[object DataView]",Ge="[object Float32Array]",at="[object Float64Array]",On="[object Int8Array]",jn="[object Int16Array]",Pn="[object Int32Array]",ln="[object Uint8Array]",$n="[object Uint8ClampedArray]",nn="[object Uint16Array]",ir="[object Uint32Array]",Xn=/\b__p \+= '';/g,Gi=/\b(__p \+=) '' \+/g,xr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,jo=/&(?:amp|lt|gt|quot|#39);/g,wr=/[&<>"']/g,Lr=RegExp(jo.source),dl=RegExp(wr.source),je=/<%-([\s\S]+?)%>/g,wt=/<%([\s\S]+?)%>/g,Ut=/<%=([\s\S]+?)%>/g,Qn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zn=/^\w*$/,Fr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fr=/[\\^$.*+?()[\]{}|]/g,or=RegExp(fr.source),yn=/^\s+/,aa=/\s/,Wc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Uc=/\{\n\/\* \[wrapped with (.+)\] \*/,te=/,? & /,Re=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Me=/[()=,{}\[\]\/\s]/,We=/\\(\\)?/g,Dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ht=/\w*$/,St=/^[-+]0x[0-9a-f]+$/i,bt=/^0b[01]+$/i,Ne=/^\[object .+?Constructor\]$/,re=/^0o[0-7]+$/i,Se=/^(?:0|[1-9]\d*)$/,Ie=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Mt=/($^)/,hn=/['\n\r\u2028\u2029\\]/g,Tt="\\ud800-\\udfff",Wn="\\u0300-\\u036f",Jr="\\ufe20-\\ufe2f",_s="\\u20d0-\\u20ff",sr=Wn+Jr+_s,qd="\\u2700-\\u27bf",Yd="a-z\\xdf-\\xf6\\xf8-\\xff",IB="\\xac\\xb1\\xd7\\xf7",DB="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",NB="\\u2000-\\u206f",LB=" \\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",A2="A-Z\\xc0-\\xd6\\xd8-\\xde",O2="\\ufe0e\\ufe0f",M2=IB+DB+NB+LB,J0="['’]",FB="["+Tt+"]",I2="["+M2+"]",Kp="["+sr+"]",D2="\\d+",jB="["+qd+"]",N2="["+Yd+"]",L2="[^"+Tt+M2+D2+qd+Yd+A2+"]",ev="\\ud83c[\\udffb-\\udfff]",$B="(?:"+Kp+"|"+ev+")",F2="[^"+Tt+"]",tv="(?:\\ud83c[\\udde6-\\uddff]){2}",nv="[\\ud800-\\udbff][\\udc00-\\udfff]",Gc="["+A2+"]",j2="\\u200d",$2="(?:"+N2+"|"+L2+")",zB="(?:"+Gc+"|"+L2+")",z2="(?:"+J0+"(?:d|ll|m|re|s|t|ve))?",B2="(?:"+J0+"(?:D|LL|M|RE|S|T|VE))?",H2=$B+"?",V2="["+O2+"]?",BB="(?:"+j2+"(?:"+[F2,tv,nv].join("|")+")"+V2+H2+")*",HB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",VB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",W2=V2+H2+BB,WB="(?:"+[jB,tv,nv].join("|")+")"+W2,UB="(?:"+[F2+Kp+"?",Kp,tv,nv,FB].join("|")+")",GB=RegExp(J0,"g"),qB=RegExp(Kp,"g"),rv=RegExp(ev+"(?="+ev+")|"+UB+W2,"g"),YB=RegExp([Gc+"?"+N2+"+"+z2+"(?="+[I2,Gc,"$"].join("|")+")",zB+"+"+B2+"(?="+[I2,Gc+$2,"$"].join("|")+")",Gc+"?"+$2+"+"+z2,Gc+"+"+B2,VB,HB,D2,WB].join("|"),"g"),KB=RegExp("["+j2+Tt+sr+O2+"]"),XB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,QB=["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"],ZB=-1,vn={};vn[Ge]=vn[at]=vn[On]=vn[jn]=vn[Pn]=vn[ln]=vn[$n]=vn[nn]=vn[ir]=!0,vn[K]=vn[oe]=vn[Ce]=vn[J]=vn[He]=vn[se]=vn[ge]=vn[ne]=vn[he]=vn[_e]=vn[Le]=vn[dt]=vn[Ct]=vn[an]=vn[jt]=!1;var pn={};pn[K]=pn[oe]=pn[Ce]=pn[He]=pn[J]=pn[se]=pn[Ge]=pn[at]=pn[On]=pn[jn]=pn[Pn]=pn[he]=pn[_e]=pn[Le]=pn[dt]=pn[Ct]=pn[an]=pn[mt]=pn[ln]=pn[$n]=pn[nn]=pn[ir]=!0,pn[ge]=pn[ne]=pn[jt]=!1;var JB={À:"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"},eH={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tH={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},nH={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},rH=parseFloat,iH=parseInt,U2=typeof Ra=="object"&&Ra&&Ra.Object===Object&&Ra,oH=typeof self=="object"&&self&&self.Object===Object&&self,hr=U2||oH||Function("return this")(),iv=t&&!t.nodeType&&t,fl=iv&&!0&&e&&!e.nodeType&&e,G2=fl&&fl.exports===iv,ov=G2&&U2.process,qi=function(){try{var ce=fl&&fl.require&&fl.require("util").types;return ce||ov&&ov.binding&&ov.binding("util")}catch{}}(),q2=qi&&qi.isArrayBuffer,Y2=qi&&qi.isDate,K2=qi&&qi.isMap,X2=qi&&qi.isRegExp,Q2=qi&&qi.isSet,Z2=qi&&qi.isTypedArray;function Si(ce,be,pe){switch(pe.length){case 0:return ce.call(be);case 1:return ce.call(be,pe[0]);case 2:return ce.call(be,pe[0],pe[1]);case 3:return ce.call(be,pe[0],pe[1],pe[2])}return ce.apply(be,pe)}function sH(ce,be,pe,$e){for(var st=-1,qt=ce==null?0:ce.length;++st<qt;){var Jn=ce[st];be($e,Jn,pe(Jn),ce)}return $e}function Yi(ce,be){for(var pe=-1,$e=ce==null?0:ce.length;++pe<$e&&be(ce[pe],pe,ce)!==!1;);return ce}function aH(ce,be){for(var pe=ce==null?0:ce.length;pe--&&be(ce[pe],pe,ce)!==!1;);return ce}function J2(ce,be){for(var pe=-1,$e=ce==null?0:ce.length;++pe<$e;)if(!be(ce[pe],pe,ce))return!1;return!0}function la(ce,be){for(var pe=-1,$e=ce==null?0:ce.length,st=0,qt=[];++pe<$e;){var Jn=ce[pe];be(Jn,pe,ce)&&(qt[st++]=Jn)}return qt}function Xp(ce,be){var pe=ce==null?0:ce.length;return!!pe&&qc(ce,be,0)>-1}function sv(ce,be,pe){for(var $e=-1,st=ce==null?0:ce.length;++$e<st;)if(pe(be,ce[$e]))return!0;return!1}function Tn(ce,be){for(var pe=-1,$e=ce==null?0:ce.length,st=Array($e);++pe<$e;)st[pe]=be(ce[pe],pe,ce);return st}function ca(ce,be){for(var pe=-1,$e=be.length,st=ce.length;++pe<$e;)ce[st+pe]=be[pe];return ce}function av(ce,be,pe,$e){var st=-1,qt=ce==null?0:ce.length;for($e&&qt&&(pe=ce[++st]);++st<qt;)pe=be(pe,ce[st],st,ce);return pe}function lH(ce,be,pe,$e){var st=ce==null?0:ce.length;for($e&&st&&(pe=ce[--st]);st--;)pe=be(pe,ce[st],st,ce);return pe}function lv(ce,be){for(var pe=-1,$e=ce==null?0:ce.length;++pe<$e;)if(be(ce[pe],pe,ce))return!0;return!1}var cH=cv("length");function uH(ce){return ce.split("")}function dH(ce){return ce.match(Re)||[]}function eP(ce,be,pe){var $e;return pe(ce,function(st,qt,Jn){if(be(st,qt,Jn))return $e=qt,!1}),$e}function Qp(ce,be,pe,$e){for(var st=ce.length,qt=pe+($e?1:-1);$e?qt--:++qt<st;)if(be(ce[qt],qt,ce))return qt;return-1}function qc(ce,be,pe){return be===be?_H(ce,be,pe):Qp(ce,tP,pe)}function fH(ce,be,pe,$e){for(var st=pe-1,qt=ce.length;++st<qt;)if($e(ce[st],be))return st;return-1}function tP(ce){return ce!==ce}function nP(ce,be){var pe=ce==null?0:ce.length;return pe?dv(ce,be)/pe:I}function cv(ce){return function(be){return be==null?n:be[ce]}}function uv(ce){return function(be){return ce==null?n:ce[be]}}function rP(ce,be,pe,$e,st){return st(ce,function(qt,Jn,dn){pe=$e?($e=!1,qt):be(pe,qt,Jn,dn)}),pe}function hH(ce,be){var pe=ce.length;for(ce.sort(be);pe--;)ce[pe]=ce[pe].value;return ce}function dv(ce,be){for(var pe,$e=-1,st=ce.length;++$e<st;){var qt=be(ce[$e]);qt!==n&&(pe=pe===n?qt:pe+qt)}return pe}function fv(ce,be){for(var pe=-1,$e=Array(ce);++pe<ce;)$e[pe]=be(pe);return $e}function pH(ce,be){return Tn(be,function(pe){return[pe,ce[pe]]})}function iP(ce){return ce&&ce.slice(0,lP(ce)+1).replace(yn,"")}function _i(ce){return function(be){return ce(be)}}function hv(ce,be){return Tn(be,function(pe){return ce[pe]})}function Kd(ce,be){return ce.has(be)}function oP(ce,be){for(var pe=-1,$e=ce.length;++pe<$e&&qc(be,ce[pe],0)>-1;);return pe}function sP(ce,be){for(var pe=ce.length;pe--&&qc(be,ce[pe],0)>-1;);return pe}function gH(ce,be){for(var pe=ce.length,$e=0;pe--;)ce[pe]===be&&++$e;return $e}var mH=uv(JB),bH=uv(eH);function yH(ce){return"\\"+nH[ce]}function vH(ce,be){return ce==null?n:ce[be]}function Yc(ce){return KB.test(ce)}function xH(ce){return XB.test(ce)}function wH(ce){for(var be,pe=[];!(be=ce.next()).done;)pe.push(be.value);return pe}function pv(ce){var be=-1,pe=Array(ce.size);return ce.forEach(function($e,st){pe[++be]=[st,$e]}),pe}function aP(ce,be){return function(pe){return ce(be(pe))}}function ua(ce,be){for(var pe=-1,$e=ce.length,st=0,qt=[];++pe<$e;){var Jn=ce[pe];(Jn===be||Jn===u)&&(ce[pe]=u,qt[st++]=pe)}return qt}function Zp(ce){var be=-1,pe=Array(ce.size);return ce.forEach(function($e){pe[++be]=$e}),pe}function SH(ce){var be=-1,pe=Array(ce.size);return ce.forEach(function($e){pe[++be]=[$e,$e]}),pe}function _H(ce,be,pe){for(var $e=pe-1,st=ce.length;++$e<st;)if(ce[$e]===be)return $e;return-1}function CH(ce,be,pe){for(var $e=pe+1;$e--;)if(ce[$e]===be)return $e;return $e}function Kc(ce){return Yc(ce)?RH(ce):cH(ce)}function mo(ce){return Yc(ce)?PH(ce):uH(ce)}function lP(ce){for(var be=ce.length;be--&&aa.test(ce.charAt(be)););return be}var EH=uv(tH);function RH(ce){for(var be=rv.lastIndex=0;rv.test(ce);)++be;return be}function PH(ce){return ce.match(rv)||[]}function TH(ce){return ce.match(YB)||[]}var kH=function ce(be){be=be==null?hr:Xc.defaults(hr.Object(),be,Xc.pick(hr,QB));var pe=be.Array,$e=be.Date,st=be.Error,qt=be.Function,Jn=be.Math,dn=be.Object,gv=be.RegExp,AH=be.String,Ki=be.TypeError,Jp=pe.prototype,OH=qt.prototype,Qc=dn.prototype,eg=be["__core-js_shared__"],tg=OH.toString,rn=Qc.hasOwnProperty,MH=0,cP=function(){var f=/[^.]+$/.exec(eg&&eg.keys&&eg.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),ng=Qc.toString,IH=tg.call(dn),DH=hr._,NH=gv("^"+tg.call(rn).replace(fr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rg=G2?be.Buffer:n,da=be.Symbol,ig=be.Uint8Array,uP=rg?rg.allocUnsafe:n,og=aP(dn.getPrototypeOf,dn),dP=dn.create,fP=Qc.propertyIsEnumerable,sg=Jp.splice,hP=da?da.isConcatSpreadable:n,Xd=da?da.iterator:n,hl=da?da.toStringTag:n,ag=function(){try{var f=yl(dn,"defineProperty");return f({},"",{}),f}catch{}}(),LH=be.clearTimeout!==hr.clearTimeout&&be.clearTimeout,FH=$e&&$e.now!==hr.Date.now&&$e.now,jH=be.setTimeout!==hr.setTimeout&&be.setTimeout,lg=Jn.ceil,cg=Jn.floor,mv=dn.getOwnPropertySymbols,$H=rg?rg.isBuffer:n,pP=be.isFinite,zH=Jp.join,BH=aP(dn.keys,dn),er=Jn.max,Sr=Jn.min,HH=$e.now,VH=be.parseInt,gP=Jn.random,WH=Jp.reverse,bv=yl(be,"DataView"),Qd=yl(be,"Map"),yv=yl(be,"Promise"),Zc=yl(be,"Set"),Zd=yl(be,"WeakMap"),Jd=yl(dn,"create"),ug=Zd&&new Zd,Jc={},UH=vl(bv),GH=vl(Qd),qH=vl(yv),YH=vl(Zc),KH=vl(Zd),dg=da?da.prototype:n,ef=dg?dg.valueOf:n,mP=dg?dg.toString:n;function z(f){if(Mn(f)&&!lt(f)&&!(f instanceof It)){if(f instanceof Xi)return f;if(rn.call(f,"__wrapped__"))return bT(f)}return new Xi(f)}var eu=function(){function f(){}return function(g){if(!kn(g))return{};if(dP)return dP(g);f.prototype=g;var S=new f;return f.prototype=n,S}}();function fg(){}function Xi(f,g){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}z.templateSettings={escape:je,evaluate:wt,interpolate:Ut,variable:"",imports:{_:z}},z.prototype=fg.prototype,z.prototype.constructor=z,Xi.prototype=eu(fg.prototype),Xi.prototype.constructor=Xi;function It(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=q,this.__views__=[]}function XH(){var f=new It(this.__wrapped__);return f.__actions__=ei(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=ei(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=ei(this.__views__),f}function QH(){if(this.__filtered__){var f=new It(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function ZH(){var f=this.__wrapped__.value(),g=this.__dir__,S=lt(f),A=g<0,D=S?f.length:0,W=uW(0,D,this.__views__),Z=W.start,ie=W.end,ue=ie-Z,ve=A?ie:Z-1,we=this.__iteratees__,Ee=we.length,De=0,Ve=Sr(ue,this.__takeCount__);if(!S||!A&&D==ue&&Ve==ue)return zP(f,this.__actions__);var qe=[];e:for(;ue--&&De<Ve;){ve+=g;for(var yt=-1,Ye=f[ve];++yt<Ee;){var kt=we[yt],Nt=kt.iteratee,Ri=kt.type,zr=Nt(Ye);if(Ri==L)Ye=zr;else if(!zr){if(Ri==H)continue e;break e}}qe[De++]=Ye}return qe}It.prototype=eu(fg.prototype),It.prototype.constructor=It;function pl(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var A=f[g];this.set(A[0],A[1])}}function JH(){this.__data__=Jd?Jd(null):{},this.size=0}function eV(f){var g=this.has(f)&&delete this.__data__[f];return this.size-=g?1:0,g}function tV(f){var g=this.__data__;if(Jd){var S=g[f];return S===l?n:S}return rn.call(g,f)?g[f]:n}function nV(f){var g=this.__data__;return Jd?g[f]!==n:rn.call(g,f)}function rV(f,g){var S=this.__data__;return this.size+=this.has(f)?0:1,S[f]=Jd&&g===n?l:g,this}pl.prototype.clear=JH,pl.prototype.delete=eV,pl.prototype.get=tV,pl.prototype.has=nV,pl.prototype.set=rV;function Cs(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var A=f[g];this.set(A[0],A[1])}}function iV(){this.__data__=[],this.size=0}function oV(f){var g=this.__data__,S=hg(g,f);if(S<0)return!1;var A=g.length-1;return S==A?g.pop():sg.call(g,S,1),--this.size,!0}function sV(f){var g=this.__data__,S=hg(g,f);return S<0?n:g[S][1]}function aV(f){return hg(this.__data__,f)>-1}function lV(f,g){var S=this.__data__,A=hg(S,f);return A<0?(++this.size,S.push([f,g])):S[A][1]=g,this}Cs.prototype.clear=iV,Cs.prototype.delete=oV,Cs.prototype.get=sV,Cs.prototype.has=aV,Cs.prototype.set=lV;function Es(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var A=f[g];this.set(A[0],A[1])}}function cV(){this.size=0,this.__data__={hash:new pl,map:new(Qd||Cs),string:new pl}}function uV(f){var g=Eg(this,f).delete(f);return this.size-=g?1:0,g}function dV(f){return Eg(this,f).get(f)}function fV(f){return Eg(this,f).has(f)}function hV(f,g){var S=Eg(this,f),A=S.size;return S.set(f,g),this.size+=S.size==A?0:1,this}Es.prototype.clear=cV,Es.prototype.delete=uV,Es.prototype.get=dV,Es.prototype.has=fV,Es.prototype.set=hV;function gl(f){var g=-1,S=f==null?0:f.length;for(this.__data__=new Es;++g<S;)this.add(f[g])}function pV(f){return this.__data__.set(f,l),this}function gV(f){return this.__data__.has(f)}gl.prototype.add=gl.prototype.push=pV,gl.prototype.has=gV;function bo(f){var g=this.__data__=new Cs(f);this.size=g.size}function mV(){this.__data__=new Cs,this.size=0}function bV(f){var g=this.__data__,S=g.delete(f);return this.size=g.size,S}function yV(f){return this.__data__.get(f)}function vV(f){return this.__data__.has(f)}function xV(f,g){var S=this.__data__;if(S instanceof Cs){var A=S.__data__;if(!Qd||A.length<i-1)return A.push([f,g]),this.size=++S.size,this;S=this.__data__=new Es(A)}return S.set(f,g),this.size=S.size,this}bo.prototype.clear=mV,bo.prototype.delete=bV,bo.prototype.get=yV,bo.prototype.has=vV,bo.prototype.set=xV;function bP(f,g){var S=lt(f),A=!S&&xl(f),D=!S&&!A&&ma(f),W=!S&&!A&&!D&&iu(f),Z=S||A||D||W,ie=Z?fv(f.length,AH):[],ue=ie.length;for(var ve in f)(g||rn.call(f,ve))&&!(Z&&(ve=="length"||D&&(ve=="offset"||ve=="parent")||W&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||ks(ve,ue)))&&ie.push(ve);return ie}function yP(f){var g=f.length;return g?f[kv(0,g-1)]:n}function wV(f,g){return Rg(ei(f),ml(g,0,f.length))}function SV(f){return Rg(ei(f))}function vv(f,g,S){(S!==n&&!yo(f[g],S)||S===n&&!(g in f))&&Rs(f,g,S)}function tf(f,g,S){var A=f[g];(!(rn.call(f,g)&&yo(A,S))||S===n&&!(g in f))&&Rs(f,g,S)}function hg(f,g){for(var S=f.length;S--;)if(yo(f[S][0],g))return S;return-1}function _V(f,g,S,A){return fa(f,function(D,W,Z){g(A,D,S(D),Z)}),A}function vP(f,g){return f&&zo(g,ar(g),f)}function CV(f,g){return f&&zo(g,ni(g),f)}function Rs(f,g,S){g=="__proto__"&&ag?ag(f,g,{configurable:!0,enumerable:!0,value:S,writable:!0}):f[g]=S}function xv(f,g){for(var S=-1,A=g.length,D=pe(A),W=f==null;++S<A;)D[S]=W?n:ex(f,g[S]);return D}function ml(f,g,S){return f===f&&(S!==n&&(f=f<=S?f:S),g!==n&&(f=f>=g?f:g)),f}function Qi(f,g,S,A,D,W){var Z,ie=g&d,ue=g&p,ve=g&h;if(S&&(Z=D?S(f,A,D,W):S(f)),Z!==n)return Z;if(!kn(f))return f;var we=lt(f);if(we){if(Z=fW(f),!ie)return ei(f,Z)}else{var Ee=_r(f),De=Ee==ne||Ee==fe;if(ma(f))return VP(f,ie);if(Ee==Le||Ee==K||De&&!D){if(Z=ue||De?{}:lT(f),!ie)return ue?tW(f,CV(Z,f)):eW(f,vP(Z,f))}else{if(!pn[Ee])return D?f:{};Z=hW(f,Ee,ie)}}W||(W=new bo);var Ve=W.get(f);if(Ve)return Ve;W.set(f,Z),FT(f)?f.forEach(function(Ye){Z.add(Qi(Ye,g,S,Ye,f,W))}):NT(f)&&f.forEach(function(Ye,kt){Z.set(kt,Qi(Ye,g,S,kt,f,W))});var qe=ve?ue?zv:$v:ue?ni:ar,yt=we?n:qe(f);return Yi(yt||f,function(Ye,kt){yt&&(kt=Ye,Ye=f[kt]),tf(Z,kt,Qi(Ye,g,S,kt,f,W))}),Z}function EV(f){var g=ar(f);return function(S){return xP(S,f,g)}}function xP(f,g,S){var A=S.length;if(f==null)return!A;for(f=dn(f);A--;){var D=S[A],W=g[D],Z=f[D];if(Z===n&&!(D in f)||!W(Z))return!1}return!0}function wP(f,g,S){if(typeof f!="function")throw new Ki(s);return cf(function(){f.apply(n,S)},g)}function nf(f,g,S,A){var D=-1,W=Xp,Z=!0,ie=f.length,ue=[],ve=g.length;if(!ie)return ue;S&&(g=Tn(g,_i(S))),A?(W=sv,Z=!1):g.length>=i&&(W=Kd,Z=!1,g=new gl(g));e:for(;++D<ie;){var we=f[D],Ee=S==null?we:S(we);if(we=A||we!==0?we:0,Z&&Ee===Ee){for(var De=ve;De--;)if(g[De]===Ee)continue e;ue.push(we)}else W(g,Ee,A)||ue.push(we)}return ue}var fa=YP($o),SP=YP(Sv,!0);function RV(f,g){var S=!0;return fa(f,function(A,D,W){return S=!!g(A,D,W),S}),S}function pg(f,g,S){for(var A=-1,D=f.length;++A<D;){var W=f[A],Z=g(W);if(Z!=null&&(ie===n?Z===Z&&!Ei(Z):S(Z,ie)))var ie=Z,ue=W}return ue}function PV(f,g,S,A){var D=f.length;for(S=ft(S),S<0&&(S=-S>D?0:D+S),A=A===n||A>D?D:ft(A),A<0&&(A+=D),A=S>A?0:$T(A);S<A;)f[S++]=g;return f}function _P(f,g){var S=[];return fa(f,function(A,D,W){g(A,D,W)&&S.push(A)}),S}function pr(f,g,S,A,D){var W=-1,Z=f.length;for(S||(S=gW),D||(D=[]);++W<Z;){var ie=f[W];g>0&&S(ie)?g>1?pr(ie,g-1,S,A,D):ca(D,ie):A||(D[D.length]=ie)}return D}var wv=KP(),CP=KP(!0);function $o(f,g){return f&&wv(f,g,ar)}function Sv(f,g){return f&&CP(f,g,ar)}function gg(f,g){return la(g,function(S){return As(f[S])})}function bl(f,g){g=pa(g,f);for(var S=0,A=g.length;f!=null&&S<A;)f=f[Bo(g[S++])];return S&&S==A?f:n}function EP(f,g,S){var A=g(f);return lt(f)?A:ca(A,S(f))}function jr(f){return f==null?f===n?Wt:Ae:hl&&hl in dn(f)?cW(f):SW(f)}function _v(f,g){return f>g}function TV(f,g){return f!=null&&rn.call(f,g)}function kV(f,g){return f!=null&&g in dn(f)}function AV(f,g,S){return f>=Sr(g,S)&&f<er(g,S)}function Cv(f,g,S){for(var A=S?sv:Xp,D=f[0].length,W=f.length,Z=W,ie=pe(W),ue=1/0,ve=[];Z--;){var we=f[Z];Z&&g&&(we=Tn(we,_i(g))),ue=Sr(we.length,ue),ie[Z]=!S&&(g||D>=120&&we.length>=120)?new gl(Z&&we):n}we=f[0];var Ee=-1,De=ie[0];e:for(;++Ee<D&&ve.length<ue;){var Ve=we[Ee],qe=g?g(Ve):Ve;if(Ve=S||Ve!==0?Ve:0,!(De?Kd(De,qe):A(ve,qe,S))){for(Z=W;--Z;){var yt=ie[Z];if(!(yt?Kd(yt,qe):A(f[Z],qe,S)))continue e}De&&De.push(qe),ve.push(Ve)}}return ve}function OV(f,g,S,A){return $o(f,function(D,W,Z){g(A,S(D),W,Z)}),A}function rf(f,g,S){g=pa(g,f),f=fT(f,g);var A=f==null?f:f[Bo(Ji(g))];return A==null?n:Si(A,f,S)}function RP(f){return Mn(f)&&jr(f)==K}function MV(f){return Mn(f)&&jr(f)==Ce}function IV(f){return Mn(f)&&jr(f)==se}function of(f,g,S,A,D){return f===g?!0:f==null||g==null||!Mn(f)&&!Mn(g)?f!==f&&g!==g:DV(f,g,S,A,of,D)}function DV(f,g,S,A,D,W){var Z=lt(f),ie=lt(g),ue=Z?oe:_r(f),ve=ie?oe:_r(g);ue=ue==K?Le:ue,ve=ve==K?Le:ve;var we=ue==Le,Ee=ve==Le,De=ue==ve;if(De&&ma(f)){if(!ma(g))return!1;Z=!0,we=!1}if(De&&!we)return W||(W=new bo),Z||iu(f)?oT(f,g,S,A,D,W):aW(f,g,ue,S,A,D,W);if(!(S&m)){var Ve=we&&rn.call(f,"__wrapped__"),qe=Ee&&rn.call(g,"__wrapped__");if(Ve||qe){var yt=Ve?f.value():f,Ye=qe?g.value():g;return W||(W=new bo),D(yt,Ye,S,A,W)}}return De?(W||(W=new bo),lW(f,g,S,A,D,W)):!1}function NV(f){return Mn(f)&&_r(f)==he}function Ev(f,g,S,A){var D=S.length,W=D,Z=!A;if(f==null)return!W;for(f=dn(f);D--;){var ie=S[D];if(Z&&ie[2]?ie[1]!==f[ie[0]]:!(ie[0]in f))return!1}for(;++D<W;){ie=S[D];var ue=ie[0],ve=f[ue],we=ie[1];if(Z&&ie[2]){if(ve===n&&!(ue in f))return!1}else{var Ee=new bo;if(A)var De=A(ve,we,ue,f,g,Ee);if(!(De===n?of(we,ve,m|b,A,Ee):De))return!1}}return!0}function PP(f){if(!kn(f)||bW(f))return!1;var g=As(f)?NH:Ne;return g.test(vl(f))}function LV(f){return Mn(f)&&jr(f)==dt}function FV(f){return Mn(f)&&_r(f)==Ct}function jV(f){return Mn(f)&&Mg(f.length)&&!!vn[jr(f)]}function TP(f){return typeof f=="function"?f:f==null?ri:typeof f=="object"?lt(f)?OP(f[0],f[1]):AP(f):XT(f)}function Rv(f){if(!lf(f))return BH(f);var g=[];for(var S in dn(f))rn.call(f,S)&&S!="constructor"&&g.push(S);return g}function $V(f){if(!kn(f))return wW(f);var g=lf(f),S=[];for(var A in f)A=="constructor"&&(g||!rn.call(f,A))||S.push(A);return S}function Pv(f,g){return f<g}function kP(f,g){var S=-1,A=ti(f)?pe(f.length):[];return fa(f,function(D,W,Z){A[++S]=g(D,W,Z)}),A}function AP(f){var g=Hv(f);return g.length==1&&g[0][2]?uT(g[0][0],g[0][1]):function(S){return S===f||Ev(S,f,g)}}function OP(f,g){return Wv(f)&&cT(g)?uT(Bo(f),g):function(S){var A=ex(S,f);return A===n&&A===g?tx(S,f):of(g,A,m|b)}}function mg(f,g,S,A,D){f!==g&&wv(g,function(W,Z){if(D||(D=new bo),kn(W))zV(f,g,Z,S,mg,A,D);else{var ie=A?A(Gv(f,Z),W,Z+"",f,g,D):n;ie===n&&(ie=W),vv(f,Z,ie)}},ni)}function zV(f,g,S,A,D,W,Z){var ie=Gv(f,S),ue=Gv(g,S),ve=Z.get(ue);if(ve){vv(f,S,ve);return}var we=W?W(ie,ue,S+"",f,g,Z):n,Ee=we===n;if(Ee){var De=lt(ue),Ve=!De&&ma(ue),qe=!De&&!Ve&&iu(ue);we=ue,De||Ve||qe?lt(ie)?we=ie:zn(ie)?we=ei(ie):Ve?(Ee=!1,we=VP(ue,!0)):qe?(Ee=!1,we=WP(ue,!0)):we=[]:uf(ue)||xl(ue)?(we=ie,xl(ie)?we=zT(ie):(!kn(ie)||As(ie))&&(we=lT(ue))):Ee=!1}Ee&&(Z.set(ue,we),D(we,ue,A,W,Z),Z.delete(ue)),vv(f,S,we)}function MP(f,g){var S=f.length;if(S)return g+=g<0?S:0,ks(g,S)?f[g]:n}function IP(f,g,S){g.length?g=Tn(g,function(W){return lt(W)?function(Z){return bl(Z,W.length===1?W[0]:W)}:W}):g=[ri];var A=-1;g=Tn(g,_i(Ue()));var D=kP(f,function(W,Z,ie){var ue=Tn(g,function(ve){return ve(W)});return{criteria:ue,index:++A,value:W}});return hH(D,function(W,Z){return JV(W,Z,S)})}function BV(f,g){return DP(f,g,function(S,A){return tx(f,A)})}function DP(f,g,S){for(var A=-1,D=g.length,W={};++A<D;){var Z=g[A],ie=bl(f,Z);S(ie,Z)&&sf(W,pa(Z,f),ie)}return W}function HV(f){return function(g){return bl(g,f)}}function Tv(f,g,S,A){var D=A?fH:qc,W=-1,Z=g.length,ie=f;for(f===g&&(g=ei(g)),S&&(ie=Tn(f,_i(S)));++W<Z;)for(var ue=0,ve=g[W],we=S?S(ve):ve;(ue=D(ie,we,ue,A))>-1;)ie!==f&&sg.call(ie,ue,1),sg.call(f,ue,1);return f}function NP(f,g){for(var S=f?g.length:0,A=S-1;S--;){var D=g[S];if(S==A||D!==W){var W=D;ks(D)?sg.call(f,D,1):Mv(f,D)}}return f}function kv(f,g){return f+cg(gP()*(g-f+1))}function VV(f,g,S,A){for(var D=-1,W=er(lg((g-f)/(S||1)),0),Z=pe(W);W--;)Z[A?W:++D]=f,f+=S;return Z}function Av(f,g){var S="";if(!f||g<1||g>B)return S;do g%2&&(S+=f),g=cg(g/2),g&&(f+=f);while(g);return S}function _t(f,g){return qv(dT(f,g,ri),f+"")}function WV(f){return yP(ou(f))}function UV(f,g){var S=ou(f);return Rg(S,ml(g,0,S.length))}function sf(f,g,S,A){if(!kn(f))return f;g=pa(g,f);for(var D=-1,W=g.length,Z=W-1,ie=f;ie!=null&&++D<W;){var ue=Bo(g[D]),ve=S;if(ue==="__proto__"||ue==="constructor"||ue==="prototype")return f;if(D!=Z){var we=ie[ue];ve=A?A(we,ue,ie):n,ve===n&&(ve=kn(we)?we:ks(g[D+1])?[]:{})}tf(ie,ue,ve),ie=ie[ue]}return f}var LP=ug?function(f,g){return ug.set(f,g),f}:ri,GV=ag?function(f,g){return ag(f,"toString",{configurable:!0,enumerable:!1,value:rx(g),writable:!0})}:ri;function qV(f){return Rg(ou(f))}function Zi(f,g,S){var A=-1,D=f.length;g<0&&(g=-g>D?0:D+g),S=S>D?D:S,S<0&&(S+=D),D=g>S?0:S-g>>>0,g>>>=0;for(var W=pe(D);++A<D;)W[A]=f[A+g];return W}function YV(f,g){var S;return fa(f,function(A,D,W){return S=g(A,D,W),!S}),!!S}function bg(f,g,S){var A=0,D=f==null?A:f.length;if(typeof g=="number"&&g===g&&D<=O){for(;A<D;){var W=A+D>>>1,Z=f[W];Z!==null&&!Ei(Z)&&(S?Z<=g:Z<g)?A=W+1:D=W}return D}return Ov(f,g,ri,S)}function Ov(f,g,S,A){var D=0,W=f==null?0:f.length;if(W===0)return 0;g=S(g);for(var Z=g!==g,ie=g===null,ue=Ei(g),ve=g===n;D<W;){var we=cg((D+W)/2),Ee=S(f[we]),De=Ee!==n,Ve=Ee===null,qe=Ee===Ee,yt=Ei(Ee);if(Z)var Ye=A||qe;else ve?Ye=qe&&(A||De):ie?Ye=qe&&De&&(A||!Ve):ue?Ye=qe&&De&&!Ve&&(A||!yt):Ve||yt?Ye=!1:Ye=A?Ee<=g:Ee<g;Ye?D=we+1:W=we}return Sr(W,U)}function FP(f,g){for(var S=-1,A=f.length,D=0,W=[];++S<A;){var Z=f[S],ie=g?g(Z):Z;if(!S||!yo(ie,ue)){var ue=ie;W[D++]=Z===0?0:Z}}return W}function jP(f){return typeof f=="number"?f:Ei(f)?I:+f}function Ci(f){if(typeof f=="string")return f;if(lt(f))return Tn(f,Ci)+"";if(Ei(f))return mP?mP.call(f):"";var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function ha(f,g,S){var A=-1,D=Xp,W=f.length,Z=!0,ie=[],ue=ie;if(S)Z=!1,D=sv;else if(W>=i){var ve=g?null:oW(f);if(ve)return Zp(ve);Z=!1,D=Kd,ue=new gl}else ue=g?[]:ie;e:for(;++A<W;){var we=f[A],Ee=g?g(we):we;if(we=S||we!==0?we:0,Z&&Ee===Ee){for(var De=ue.length;De--;)if(ue[De]===Ee)continue e;g&&ue.push(Ee),ie.push(we)}else D(ue,Ee,S)||(ue!==ie&&ue.push(Ee),ie.push(we))}return ie}function Mv(f,g){return g=pa(g,f),f=fT(f,g),f==null||delete f[Bo(Ji(g))]}function $P(f,g,S,A){return sf(f,g,S(bl(f,g)),A)}function yg(f,g,S,A){for(var D=f.length,W=A?D:-1;(A?W--:++W<D)&&g(f[W],W,f););return S?Zi(f,A?0:W,A?W+1:D):Zi(f,A?W+1:0,A?D:W)}function zP(f,g){var S=f;return S instanceof It&&(S=S.value()),av(g,function(A,D){return D.func.apply(D.thisArg,ca([A],D.args))},S)}function Iv(f,g,S){var A=f.length;if(A<2)return A?ha(f[0]):[];for(var D=-1,W=pe(A);++D<A;)for(var Z=f[D],ie=-1;++ie<A;)ie!=D&&(W[D]=nf(W[D]||Z,f[ie],g,S));return ha(pr(W,1),g,S)}function BP(f,g,S){for(var A=-1,D=f.length,W=g.length,Z={};++A<D;){var ie=A<W?g[A]:n;S(Z,f[A],ie)}return Z}function Dv(f){return zn(f)?f:[]}function Nv(f){return typeof f=="function"?f:ri}function pa(f,g){return lt(f)?f:Wv(f,g)?[f]:mT(Qt(f))}var KV=_t;function ga(f,g,S){var A=f.length;return S=S===n?A:S,!g&&S>=A?f:Zi(f,g,S)}var HP=LH||function(f){return hr.clearTimeout(f)};function VP(f,g){if(g)return f.slice();var S=f.length,A=uP?uP(S):new f.constructor(S);return f.copy(A),A}function Lv(f){var g=new f.constructor(f.byteLength);return new ig(g).set(new ig(f)),g}function XV(f,g){var S=g?Lv(f.buffer):f.buffer;return new f.constructor(S,f.byteOffset,f.byteLength)}function QV(f){var g=new f.constructor(f.source,Ht.exec(f));return g.lastIndex=f.lastIndex,g}function ZV(f){return ef?dn(ef.call(f)):{}}function WP(f,g){var S=g?Lv(f.buffer):f.buffer;return new f.constructor(S,f.byteOffset,f.length)}function UP(f,g){if(f!==g){var S=f!==n,A=f===null,D=f===f,W=Ei(f),Z=g!==n,ie=g===null,ue=g===g,ve=Ei(g);if(!ie&&!ve&&!W&&f>g||W&&Z&&ue&&!ie&&!ve||A&&Z&&ue||!S&&ue||!D)return 1;if(!A&&!W&&!ve&&f<g||ve&&S&&D&&!A&&!W||ie&&S&&D||!Z&&D||!ue)return-1}return 0}function JV(f,g,S){for(var A=-1,D=f.criteria,W=g.criteria,Z=D.length,ie=S.length;++A<Z;){var ue=UP(D[A],W[A]);if(ue){if(A>=ie)return ue;var ve=S[A];return ue*(ve=="desc"?-1:1)}}return f.index-g.index}function GP(f,g,S,A){for(var D=-1,W=f.length,Z=S.length,ie=-1,ue=g.length,ve=er(W-Z,0),we=pe(ue+ve),Ee=!A;++ie<ue;)we[ie]=g[ie];for(;++D<Z;)(Ee||D<W)&&(we[S[D]]=f[D]);for(;ve--;)we[ie++]=f[D++];return we}function qP(f,g,S,A){for(var D=-1,W=f.length,Z=-1,ie=S.length,ue=-1,ve=g.length,we=er(W-ie,0),Ee=pe(we+ve),De=!A;++D<we;)Ee[D]=f[D];for(var Ve=D;++ue<ve;)Ee[Ve+ue]=g[ue];for(;++Z<ie;)(De||D<W)&&(Ee[Ve+S[Z]]=f[D++]);return Ee}function ei(f,g){var S=-1,A=f.length;for(g||(g=pe(A));++S<A;)g[S]=f[S];return g}function zo(f,g,S,A){var D=!S;S||(S={});for(var W=-1,Z=g.length;++W<Z;){var ie=g[W],ue=A?A(S[ie],f[ie],ie,S,f):n;ue===n&&(ue=f[ie]),D?Rs(S,ie,ue):tf(S,ie,ue)}return S}function eW(f,g){return zo(f,Vv(f),g)}function tW(f,g){return zo(f,sT(f),g)}function vg(f,g){return function(S,A){var D=lt(S)?sH:_V,W=g?g():{};return D(S,f,Ue(A,2),W)}}function tu(f){return _t(function(g,S){var A=-1,D=S.length,W=D>1?S[D-1]:n,Z=D>2?S[2]:n;for(W=f.length>3&&typeof W=="function"?(D--,W):n,Z&&$r(S[0],S[1],Z)&&(W=D<3?n:W,D=1),g=dn(g);++A<D;){var ie=S[A];ie&&f(g,ie,A,W)}return g})}function YP(f,g){return function(S,A){if(S==null)return S;if(!ti(S))return f(S,A);for(var D=S.length,W=g?D:-1,Z=dn(S);(g?W--:++W<D)&&A(Z[W],W,Z)!==!1;);return S}}function KP(f){return function(g,S,A){for(var D=-1,W=dn(g),Z=A(g),ie=Z.length;ie--;){var ue=Z[f?ie:++D];if(S(W[ue],ue,W)===!1)break}return g}}function nW(f,g,S){var A=g&y,D=af(f);function W(){var Z=this&&this!==hr&&this instanceof W?D:f;return Z.apply(A?S:this,arguments)}return W}function XP(f){return function(g){g=Qt(g);var S=Yc(g)?mo(g):n,A=S?S[0]:g.charAt(0),D=S?ga(S,1).join(""):g.slice(1);return A[f]()+D}}function nu(f){return function(g){return av(YT(qT(g).replace(GB,"")),f,"")}}function af(f){return function(){var g=arguments;switch(g.length){case 0:return new f;case 1:return new f(g[0]);case 2:return new f(g[0],g[1]);case 3:return new f(g[0],g[1],g[2]);case 4:return new f(g[0],g[1],g[2],g[3]);case 5:return new f(g[0],g[1],g[2],g[3],g[4]);case 6:return new f(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new f(g[0],g[1],g[2],g[3],g[4],g[5],g[6])}var S=eu(f.prototype),A=f.apply(S,g);return kn(A)?A:S}}function rW(f,g,S){var A=af(f);function D(){for(var W=arguments.length,Z=pe(W),ie=W,ue=ru(D);ie--;)Z[ie]=arguments[ie];var ve=W<3&&Z[0]!==ue&&Z[W-1]!==ue?[]:ua(Z,ue);if(W-=ve.length,W<S)return tT(f,g,xg,D.placeholder,n,Z,ve,n,n,S-W);var we=this&&this!==hr&&this instanceof D?A:f;return Si(we,this,Z)}return D}function QP(f){return function(g,S,A){var D=dn(g);if(!ti(g)){var W=Ue(S,3);g=ar(g),S=function(ie){return W(D[ie],ie,D)}}var Z=f(g,S,A);return Z>-1?D[W?g[Z]:Z]:n}}function ZP(f){return Ts(function(g){var S=g.length,A=S,D=Xi.prototype.thru;for(f&&g.reverse();A--;){var W=g[A];if(typeof W!="function")throw new Ki(s);if(D&&!Z&&Cg(W)=="wrapper")var Z=new Xi([],!0)}for(A=Z?A:S;++A<S;){W=g[A];var ie=Cg(W),ue=ie=="wrapper"?Bv(W):n;ue&&Uv(ue[0])&&ue[1]==(T|_|C|M)&&!ue[4].length&&ue[9]==1?Z=Z[Cg(ue[0])].apply(Z,ue[3]):Z=W.length==1&&Uv(W)?Z[ie]():Z.thru(W)}return function(){var ve=arguments,we=ve[0];if(Z&&ve.length==1&&lt(we))return Z.plant(we).value();for(var Ee=0,De=S?g[Ee].apply(this,ve):we;++Ee<S;)De=g[Ee].call(this,De);return De}})}function xg(f,g,S,A,D,W,Z,ie,ue,ve){var we=g&T,Ee=g&y,De=g&x,Ve=g&(_|E),qe=g&N,yt=De?n:af(f);function Ye(){for(var kt=arguments.length,Nt=pe(kt),Ri=kt;Ri--;)Nt[Ri]=arguments[Ri];if(Ve)var zr=ru(Ye),Pi=gH(Nt,zr);if(A&&(Nt=GP(Nt,A,D,Ve)),W&&(Nt=qP(Nt,W,Z,Ve)),kt-=Pi,Ve&&kt<ve){var Bn=ua(Nt,zr);return tT(f,g,xg,Ye.placeholder,S,Nt,Bn,ie,ue,ve-kt)}var vo=Ee?S:this,Ms=De?vo[f]:f;return kt=Nt.length,ie?Nt=_W(Nt,ie):qe&&kt>1&&Nt.reverse(),we&&ue<kt&&(Nt.length=ue),this&&this!==hr&&this instanceof Ye&&(Ms=yt||af(Ms)),Ms.apply(vo,Nt)}return Ye}function JP(f,g){return function(S,A){return OV(S,f,g(A),{})}}function wg(f,g){return function(S,A){var D;if(S===n&&A===n)return g;if(S!==n&&(D=S),A!==n){if(D===n)return A;typeof S=="string"||typeof A=="string"?(S=Ci(S),A=Ci(A)):(S=jP(S),A=jP(A)),D=f(S,A)}return D}}function Fv(f){return Ts(function(g){return g=Tn(g,_i(Ue())),_t(function(S){var A=this;return f(g,function(D){return Si(D,A,S)})})})}function Sg(f,g){g=g===n?" ":Ci(g);var S=g.length;if(S<2)return S?Av(g,f):g;var A=Av(g,lg(f/Kc(g)));return Yc(g)?ga(mo(A),0,f).join(""):A.slice(0,f)}function iW(f,g,S,A){var D=g&y,W=af(f);function Z(){for(var ie=-1,ue=arguments.length,ve=-1,we=A.length,Ee=pe(we+ue),De=this&&this!==hr&&this instanceof Z?W:f;++ve<we;)Ee[ve]=A[ve];for(;ue--;)Ee[ve++]=arguments[++ie];return Si(De,D?S:this,Ee)}return Z}function eT(f){return function(g,S,A){return A&&typeof A!="number"&&$r(g,S,A)&&(S=A=n),g=Os(g),S===n?(S=g,g=0):S=Os(S),A=A===n?g<S?1:-1:Os(A),VV(g,S,A,f)}}function _g(f){return function(g,S){return typeof g=="string"&&typeof S=="string"||(g=eo(g),S=eo(S)),f(g,S)}}function tT(f,g,S,A,D,W,Z,ie,ue,ve){var we=g&_,Ee=we?Z:n,De=we?n:Z,Ve=we?W:n,qe=we?n:W;g|=we?C:R,g&=~(we?R:C),g&w||(g&=-4);var yt=[f,g,D,Ve,Ee,qe,De,ie,ue,ve],Ye=S.apply(n,yt);return Uv(f)&&hT(Ye,yt),Ye.placeholder=A,pT(Ye,f,g)}function jv(f){var g=Jn[f];return function(S,A){if(S=eo(S),A=A==null?0:Sr(ft(A),292),A&&pP(S)){var D=(Qt(S)+"e").split("e"),W=g(D[0]+"e"+(+D[1]+A));return D=(Qt(W)+"e").split("e"),+(D[0]+"e"+(+D[1]-A))}return g(S)}}var oW=Zc&&1/Zp(new Zc([,-0]))[1]==V?function(f){return new Zc(f)}:sx;function nT(f){return function(g){var S=_r(g);return S==he?pv(g):S==Ct?SH(g):pH(g,f(g))}}function Ps(f,g,S,A,D,W,Z,ie){var ue=g&x;if(!ue&&typeof f!="function")throw new Ki(s);var ve=A?A.length:0;if(ve||(g&=-97,A=D=n),Z=Z===n?Z:er(ft(Z),0),ie=ie===n?ie:ft(ie),ve-=D?D.length:0,g&R){var we=A,Ee=D;A=D=n}var De=ue?n:Bv(f),Ve=[f,g,S,A,D,we,Ee,W,Z,ie];if(De&&xW(Ve,De),f=Ve[0],g=Ve[1],S=Ve[2],A=Ve[3],D=Ve[4],ie=Ve[9]=Ve[9]===n?ue?0:f.length:er(Ve[9]-ve,0),!ie&&g&(_|E)&&(g&=-25),!g||g==y)var qe=nW(f,g,S);else g==_||g==E?qe=rW(f,g,ie):(g==C||g==(y|C))&&!D.length?qe=iW(f,g,S,A):qe=xg.apply(n,Ve);var yt=De?LP:hT;return pT(yt(qe,Ve),f,g)}function rT(f,g,S,A){return f===n||yo(f,Qc[S])&&!rn.call(A,S)?g:f}function iT(f,g,S,A,D,W){return kn(f)&&kn(g)&&(W.set(g,f),mg(f,g,n,iT,W),W.delete(g)),f}function sW(f){return uf(f)?n:f}function oT(f,g,S,A,D,W){var Z=S&m,ie=f.length,ue=g.length;if(ie!=ue&&!(Z&&ue>ie))return!1;var ve=W.get(f),we=W.get(g);if(ve&&we)return ve==g&&we==f;var Ee=-1,De=!0,Ve=S&b?new gl:n;for(W.set(f,g),W.set(g,f);++Ee<ie;){var qe=f[Ee],yt=g[Ee];if(A)var Ye=Z?A(yt,qe,Ee,g,f,W):A(qe,yt,Ee,f,g,W);if(Ye!==n){if(Ye)continue;De=!1;break}if(Ve){if(!lv(g,function(kt,Nt){if(!Kd(Ve,Nt)&&(qe===kt||D(qe,kt,S,A,W)))return Ve.push(Nt)})){De=!1;break}}else if(!(qe===yt||D(qe,yt,S,A,W))){De=!1;break}}return W.delete(f),W.delete(g),De}function aW(f,g,S,A,D,W,Z){switch(S){case He:if(f.byteLength!=g.byteLength||f.byteOffset!=g.byteOffset)return!1;f=f.buffer,g=g.buffer;case Ce:return!(f.byteLength!=g.byteLength||!W(new ig(f),new ig(g)));case J:case se:case _e:return yo(+f,+g);case ge:return f.name==g.name&&f.message==g.message;case dt:case an:return f==g+"";case he:var ie=pv;case Ct:var ue=A&m;if(ie||(ie=Zp),f.size!=g.size&&!ue)return!1;var ve=Z.get(f);if(ve)return ve==g;A|=b,Z.set(f,g);var we=oT(ie(f),ie(g),A,D,W,Z);return Z.delete(f),we;case mt:if(ef)return ef.call(f)==ef.call(g)}return!1}function lW(f,g,S,A,D,W){var Z=S&m,ie=$v(f),ue=ie.length,ve=$v(g),we=ve.length;if(ue!=we&&!Z)return!1;for(var Ee=ue;Ee--;){var De=ie[Ee];if(!(Z?De in g:rn.call(g,De)))return!1}var Ve=W.get(f),qe=W.get(g);if(Ve&&qe)return Ve==g&&qe==f;var yt=!0;W.set(f,g),W.set(g,f);for(var Ye=Z;++Ee<ue;){De=ie[Ee];var kt=f[De],Nt=g[De];if(A)var Ri=Z?A(Nt,kt,De,g,f,W):A(kt,Nt,De,f,g,W);if(!(Ri===n?kt===Nt||D(kt,Nt,S,A,W):Ri)){yt=!1;break}Ye||(Ye=De=="constructor")}if(yt&&!Ye){var zr=f.constructor,Pi=g.constructor;zr!=Pi&&"constructor"in f&&"constructor"in g&&!(typeof zr=="function"&&zr instanceof zr&&typeof Pi=="function"&&Pi instanceof Pi)&&(yt=!1)}return W.delete(f),W.delete(g),yt}function Ts(f){return qv(dT(f,n,xT),f+"")}function $v(f){return EP(f,ar,Vv)}function zv(f){return EP(f,ni,sT)}var Bv=ug?function(f){return ug.get(f)}:sx;function Cg(f){for(var g=f.name+"",S=Jc[g],A=rn.call(Jc,g)?S.length:0;A--;){var D=S[A],W=D.func;if(W==null||W==f)return D.name}return g}function ru(f){var g=rn.call(z,"placeholder")?z:f;return g.placeholder}function Ue(){var f=z.iteratee||ix;return f=f===ix?TP:f,arguments.length?f(arguments[0],arguments[1]):f}function Eg(f,g){var S=f.__data__;return mW(g)?S[typeof g=="string"?"string":"hash"]:S.map}function Hv(f){for(var g=ar(f),S=g.length;S--;){var A=g[S],D=f[A];g[S]=[A,D,cT(D)]}return g}function yl(f,g){var S=vH(f,g);return PP(S)?S:n}function cW(f){var g=rn.call(f,hl),S=f[hl];try{f[hl]=n;var A=!0}catch{}var D=ng.call(f);return A&&(g?f[hl]=S:delete f[hl]),D}var Vv=mv?function(f){return f==null?[]:(f=dn(f),la(mv(f),function(g){return fP.call(f,g)}))}:ax,sT=mv?function(f){for(var g=[];f;)ca(g,Vv(f)),f=og(f);return g}:ax,_r=jr;(bv&&_r(new bv(new ArrayBuffer(1)))!=He||Qd&&_r(new Qd)!=he||yv&&_r(yv.resolve())!=ke||Zc&&_r(new Zc)!=Ct||Zd&&_r(new Zd)!=jt)&&(_r=function(f){var g=jr(f),S=g==Le?f.constructor:n,A=S?vl(S):"";if(A)switch(A){case UH:return He;case GH:return he;case qH:return ke;case YH:return Ct;case KH:return jt}return g});function uW(f,g,S){for(var A=-1,D=S.length;++A<D;){var W=S[A],Z=W.size;switch(W.type){case"drop":f+=Z;break;case"dropRight":g-=Z;break;case"take":g=Sr(g,f+Z);break;case"takeRight":f=er(f,g-Z);break}}return{start:f,end:g}}function dW(f){var g=f.match(Uc);return g?g[1].split(te):[]}function aT(f,g,S){g=pa(g,f);for(var A=-1,D=g.length,W=!1;++A<D;){var Z=Bo(g[A]);if(!(W=f!=null&&S(f,Z)))break;f=f[Z]}return W||++A!=D?W:(D=f==null?0:f.length,!!D&&Mg(D)&&ks(Z,D)&&(lt(f)||xl(f)))}function fW(f){var g=f.length,S=new f.constructor(g);return g&&typeof f[0]=="string"&&rn.call(f,"index")&&(S.index=f.index,S.input=f.input),S}function lT(f){return typeof f.constructor=="function"&&!lf(f)?eu(og(f)):{}}function hW(f,g,S){var A=f.constructor;switch(g){case Ce:return Lv(f);case J:case se:return new A(+f);case He:return XV(f,S);case Ge:case at:case On:case jn:case Pn:case ln:case $n:case nn:case ir:return WP(f,S);case he:return new A;case _e:case an:return new A(f);case dt:return QV(f);case Ct:return new A;case mt:return ZV(f)}}function pW(f,g){var S=g.length;if(!S)return f;var A=S-1;return g[A]=(S>1?"& ":"")+g[A],g=g.join(S>2?", ":" "),f.replace(Wc,`{
73
- /* [wrapped with `+g+`] */
74
- `)}function gW(f){return lt(f)||xl(f)||!!(hP&&f&&f[hP])}function ks(f,g){var S=typeof f;return g=g??B,!!g&&(S=="number"||S!="symbol"&&Se.test(f))&&f>-1&&f%1==0&&f<g}function $r(f,g,S){if(!kn(S))return!1;var A=typeof g;return(A=="number"?ti(S)&&ks(g,S.length):A=="string"&&g in S)?yo(S[g],f):!1}function Wv(f,g){if(lt(f))return!1;var S=typeof f;return S=="number"||S=="symbol"||S=="boolean"||f==null||Ei(f)?!0:Zn.test(f)||!Qn.test(f)||g!=null&&f in dn(g)}function mW(f){var g=typeof f;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?f!=="__proto__":f===null}function Uv(f){var g=Cg(f),S=z[g];if(typeof S!="function"||!(g in It.prototype))return!1;if(f===S)return!0;var A=Bv(S);return!!A&&f===A[0]}function bW(f){return!!cP&&cP in f}var yW=eg?As:lx;function lf(f){var g=f&&f.constructor,S=typeof g=="function"&&g.prototype||Qc;return f===S}function cT(f){return f===f&&!kn(f)}function uT(f,g){return function(S){return S==null?!1:S[f]===g&&(g!==n||f in dn(S))}}function vW(f){var g=Ag(f,function(A){return S.size===c&&S.clear(),A}),S=g.cache;return g}function xW(f,g){var S=f[1],A=g[1],D=S|A,W=D<(y|x|T),Z=A==T&&S==_||A==T&&S==M&&f[7].length<=g[8]||A==(T|M)&&g[7].length<=g[8]&&S==_;if(!(W||Z))return f;A&y&&(f[2]=g[2],D|=S&y?0:w);var ie=g[3];if(ie){var ue=f[3];f[3]=ue?GP(ue,ie,g[4]):ie,f[4]=ue?ua(f[3],u):g[4]}return ie=g[5],ie&&(ue=f[5],f[5]=ue?qP(ue,ie,g[6]):ie,f[6]=ue?ua(f[5],u):g[6]),ie=g[7],ie&&(f[7]=ie),A&T&&(f[8]=f[8]==null?g[8]:Sr(f[8],g[8])),f[9]==null&&(f[9]=g[9]),f[0]=g[0],f[1]=D,f}function wW(f){var g=[];if(f!=null)for(var S in dn(f))g.push(S);return g}function SW(f){return ng.call(f)}function dT(f,g,S){return g=er(g===n?f.length-1:g,0),function(){for(var A=arguments,D=-1,W=er(A.length-g,0),Z=pe(W);++D<W;)Z[D]=A[g+D];D=-1;for(var ie=pe(g+1);++D<g;)ie[D]=A[D];return ie[g]=S(Z),Si(f,this,ie)}}function fT(f,g){return g.length<2?f:bl(f,Zi(g,0,-1))}function _W(f,g){for(var S=f.length,A=Sr(g.length,S),D=ei(f);A--;){var W=g[A];f[A]=ks(W,S)?D[W]:n}return f}function Gv(f,g){if(!(g==="constructor"&&typeof f[g]=="function")&&g!="__proto__")return f[g]}var hT=gT(LP),cf=jH||function(f,g){return hr.setTimeout(f,g)},qv=gT(GV);function pT(f,g,S){var A=g+"";return qv(f,pW(A,CW(dW(A),S)))}function gT(f){var g=0,S=0;return function(){var A=HH(),D=Q-(A-S);if(S=A,D>0){if(++g>=$)return arguments[0]}else g=0;return f.apply(n,arguments)}}function Rg(f,g){var S=-1,A=f.length,D=A-1;for(g=g===n?A:g;++S<g;){var W=kv(S,D),Z=f[W];f[W]=f[S],f[S]=Z}return f.length=g,f}var mT=vW(function(f){var g=[];return f.charCodeAt(0)===46&&g.push(""),f.replace(Fr,function(S,A,D,W){g.push(D?W.replace(We,"$1"):A||S)}),g});function Bo(f){if(typeof f=="string"||Ei(f))return f;var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function vl(f){if(f!=null){try{return tg.call(f)}catch{}try{return f+""}catch{}}return""}function CW(f,g){return Yi(ee,function(S){var A="_."+S[0];g&S[1]&&!Xp(f,A)&&f.push(A)}),f.sort()}function bT(f){if(f instanceof It)return f.clone();var g=new Xi(f.__wrapped__,f.__chain__);return g.__actions__=ei(f.__actions__),g.__index__=f.__index__,g.__values__=f.__values__,g}function EW(f,g,S){(S?$r(f,g,S):g===n)?g=1:g=er(ft(g),0);var A=f==null?0:f.length;if(!A||g<1)return[];for(var D=0,W=0,Z=pe(lg(A/g));D<A;)Z[W++]=Zi(f,D,D+=g);return Z}function RW(f){for(var g=-1,S=f==null?0:f.length,A=0,D=[];++g<S;){var W=f[g];W&&(D[A++]=W)}return D}function PW(){var f=arguments.length;if(!f)return[];for(var g=pe(f-1),S=arguments[0],A=f;A--;)g[A-1]=arguments[A];return ca(lt(S)?ei(S):[S],pr(g,1))}var TW=_t(function(f,g){return zn(f)?nf(f,pr(g,1,zn,!0)):[]}),kW=_t(function(f,g){var S=Ji(g);return zn(S)&&(S=n),zn(f)?nf(f,pr(g,1,zn,!0),Ue(S,2)):[]}),AW=_t(function(f,g){var S=Ji(g);return zn(S)&&(S=n),zn(f)?nf(f,pr(g,1,zn,!0),n,S):[]});function OW(f,g,S){var A=f==null?0:f.length;return A?(g=S||g===n?1:ft(g),Zi(f,g<0?0:g,A)):[]}function MW(f,g,S){var A=f==null?0:f.length;return A?(g=S||g===n?1:ft(g),g=A-g,Zi(f,0,g<0?0:g)):[]}function IW(f,g){return f&&f.length?yg(f,Ue(g,3),!0,!0):[]}function DW(f,g){return f&&f.length?yg(f,Ue(g,3),!0):[]}function NW(f,g,S,A){var D=f==null?0:f.length;return D?(S&&typeof S!="number"&&$r(f,g,S)&&(S=0,A=D),PV(f,g,S,A)):[]}function yT(f,g,S){var A=f==null?0:f.length;if(!A)return-1;var D=S==null?0:ft(S);return D<0&&(D=er(A+D,0)),Qp(f,Ue(g,3),D)}function vT(f,g,S){var A=f==null?0:f.length;if(!A)return-1;var D=A-1;return S!==n&&(D=ft(S),D=S<0?er(A+D,0):Sr(D,A-1)),Qp(f,Ue(g,3),D,!0)}function xT(f){var g=f==null?0:f.length;return g?pr(f,1):[]}function LW(f){var g=f==null?0:f.length;return g?pr(f,V):[]}function FW(f,g){var S=f==null?0:f.length;return S?(g=g===n?1:ft(g),pr(f,g)):[]}function jW(f){for(var g=-1,S=f==null?0:f.length,A={};++g<S;){var D=f[g];A[D[0]]=D[1]}return A}function wT(f){return f&&f.length?f[0]:n}function $W(f,g,S){var A=f==null?0:f.length;if(!A)return-1;var D=S==null?0:ft(S);return D<0&&(D=er(A+D,0)),qc(f,g,D)}function zW(f){var g=f==null?0:f.length;return g?Zi(f,0,-1):[]}var BW=_t(function(f){var g=Tn(f,Dv);return g.length&&g[0]===f[0]?Cv(g):[]}),HW=_t(function(f){var g=Ji(f),S=Tn(f,Dv);return g===Ji(S)?g=n:S.pop(),S.length&&S[0]===f[0]?Cv(S,Ue(g,2)):[]}),VW=_t(function(f){var g=Ji(f),S=Tn(f,Dv);return g=typeof g=="function"?g:n,g&&S.pop(),S.length&&S[0]===f[0]?Cv(S,n,g):[]});function WW(f,g){return f==null?"":zH.call(f,g)}function Ji(f){var g=f==null?0:f.length;return g?f[g-1]:n}function UW(f,g,S){var A=f==null?0:f.length;if(!A)return-1;var D=A;return S!==n&&(D=ft(S),D=D<0?er(A+D,0):Sr(D,A-1)),g===g?CH(f,g,D):Qp(f,tP,D,!0)}function GW(f,g){return f&&f.length?MP(f,ft(g)):n}var qW=_t(ST);function ST(f,g){return f&&f.length&&g&&g.length?Tv(f,g):f}function YW(f,g,S){return f&&f.length&&g&&g.length?Tv(f,g,Ue(S,2)):f}function KW(f,g,S){return f&&f.length&&g&&g.length?Tv(f,g,n,S):f}var XW=Ts(function(f,g){var S=f==null?0:f.length,A=xv(f,g);return NP(f,Tn(g,function(D){return ks(D,S)?+D:D}).sort(UP)),A});function QW(f,g){var S=[];if(!(f&&f.length))return S;var A=-1,D=[],W=f.length;for(g=Ue(g,3);++A<W;){var Z=f[A];g(Z,A,f)&&(S.push(Z),D.push(A))}return NP(f,D),S}function Yv(f){return f==null?f:WH.call(f)}function ZW(f,g,S){var A=f==null?0:f.length;return A?(S&&typeof S!="number"&&$r(f,g,S)?(g=0,S=A):(g=g==null?0:ft(g),S=S===n?A:ft(S)),Zi(f,g,S)):[]}function JW(f,g){return bg(f,g)}function eU(f,g,S){return Ov(f,g,Ue(S,2))}function tU(f,g){var S=f==null?0:f.length;if(S){var A=bg(f,g);if(A<S&&yo(f[A],g))return A}return-1}function nU(f,g){return bg(f,g,!0)}function rU(f,g,S){return Ov(f,g,Ue(S,2),!0)}function iU(f,g){var S=f==null?0:f.length;if(S){var A=bg(f,g,!0)-1;if(yo(f[A],g))return A}return-1}function oU(f){return f&&f.length?FP(f):[]}function sU(f,g){return f&&f.length?FP(f,Ue(g,2)):[]}function aU(f){var g=f==null?0:f.length;return g?Zi(f,1,g):[]}function lU(f,g,S){return f&&f.length?(g=S||g===n?1:ft(g),Zi(f,0,g<0?0:g)):[]}function cU(f,g,S){var A=f==null?0:f.length;return A?(g=S||g===n?1:ft(g),g=A-g,Zi(f,g<0?0:g,A)):[]}function uU(f,g){return f&&f.length?yg(f,Ue(g,3),!1,!0):[]}function dU(f,g){return f&&f.length?yg(f,Ue(g,3)):[]}var fU=_t(function(f){return ha(pr(f,1,zn,!0))}),hU=_t(function(f){var g=Ji(f);return zn(g)&&(g=n),ha(pr(f,1,zn,!0),Ue(g,2))}),pU=_t(function(f){var g=Ji(f);return g=typeof g=="function"?g:n,ha(pr(f,1,zn,!0),n,g)});function gU(f){return f&&f.length?ha(f):[]}function mU(f,g){return f&&f.length?ha(f,Ue(g,2)):[]}function bU(f,g){return g=typeof g=="function"?g:n,f&&f.length?ha(f,n,g):[]}function Kv(f){if(!(f&&f.length))return[];var g=0;return f=la(f,function(S){if(zn(S))return g=er(S.length,g),!0}),fv(g,function(S){return Tn(f,cv(S))})}function _T(f,g){if(!(f&&f.length))return[];var S=Kv(f);return g==null?S:Tn(S,function(A){return Si(g,n,A)})}var yU=_t(function(f,g){return zn(f)?nf(f,g):[]}),vU=_t(function(f){return Iv(la(f,zn))}),xU=_t(function(f){var g=Ji(f);return zn(g)&&(g=n),Iv(la(f,zn),Ue(g,2))}),wU=_t(function(f){var g=Ji(f);return g=typeof g=="function"?g:n,Iv(la(f,zn),n,g)}),SU=_t(Kv);function _U(f,g){return BP(f||[],g||[],tf)}function CU(f,g){return BP(f||[],g||[],sf)}var EU=_t(function(f){var g=f.length,S=g>1?f[g-1]:n;return S=typeof S=="function"?(f.pop(),S):n,_T(f,S)});function CT(f){var g=z(f);return g.__chain__=!0,g}function RU(f,g){return g(f),f}function Pg(f,g){return g(f)}var PU=Ts(function(f){var g=f.length,S=g?f[0]:0,A=this.__wrapped__,D=function(W){return xv(W,f)};return g>1||this.__actions__.length||!(A instanceof It)||!ks(S)?this.thru(D):(A=A.slice(S,+S+(g?1:0)),A.__actions__.push({func:Pg,args:[D],thisArg:n}),new Xi(A,this.__chain__).thru(function(W){return g&&!W.length&&W.push(n),W}))});function TU(){return CT(this)}function kU(){return new Xi(this.value(),this.__chain__)}function AU(){this.__values__===n&&(this.__values__=jT(this.value()));var f=this.__index__>=this.__values__.length,g=f?n:this.__values__[this.__index__++];return{done:f,value:g}}function OU(){return this}function MU(f){for(var g,S=this;S instanceof fg;){var A=bT(S);A.__index__=0,A.__values__=n,g?D.__wrapped__=A:g=A;var D=A;S=S.__wrapped__}return D.__wrapped__=f,g}function IU(){var f=this.__wrapped__;if(f instanceof It){var g=f;return this.__actions__.length&&(g=new It(this)),g=g.reverse(),g.__actions__.push({func:Pg,args:[Yv],thisArg:n}),new Xi(g,this.__chain__)}return this.thru(Yv)}function DU(){return zP(this.__wrapped__,this.__actions__)}var NU=vg(function(f,g,S){rn.call(f,S)?++f[S]:Rs(f,S,1)});function LU(f,g,S){var A=lt(f)?J2:RV;return S&&$r(f,g,S)&&(g=n),A(f,Ue(g,3))}function FU(f,g){var S=lt(f)?la:_P;return S(f,Ue(g,3))}var jU=QP(yT),$U=QP(vT);function zU(f,g){return pr(Tg(f,g),1)}function BU(f,g){return pr(Tg(f,g),V)}function HU(f,g,S){return S=S===n?1:ft(S),pr(Tg(f,g),S)}function ET(f,g){var S=lt(f)?Yi:fa;return S(f,Ue(g,3))}function RT(f,g){var S=lt(f)?aH:SP;return S(f,Ue(g,3))}var VU=vg(function(f,g,S){rn.call(f,S)?f[S].push(g):Rs(f,S,[g])});function WU(f,g,S,A){f=ti(f)?f:ou(f),S=S&&!A?ft(S):0;var D=f.length;return S<0&&(S=er(D+S,0)),Ig(f)?S<=D&&f.indexOf(g,S)>-1:!!D&&qc(f,g,S)>-1}var UU=_t(function(f,g,S){var A=-1,D=typeof g=="function",W=ti(f)?pe(f.length):[];return fa(f,function(Z){W[++A]=D?Si(g,Z,S):rf(Z,g,S)}),W}),GU=vg(function(f,g,S){Rs(f,S,g)});function Tg(f,g){var S=lt(f)?Tn:kP;return S(f,Ue(g,3))}function qU(f,g,S,A){return f==null?[]:(lt(g)||(g=g==null?[]:[g]),S=A?n:S,lt(S)||(S=S==null?[]:[S]),IP(f,g,S))}var YU=vg(function(f,g,S){f[S?0:1].push(g)},function(){return[[],[]]});function KU(f,g,S){var A=lt(f)?av:rP,D=arguments.length<3;return A(f,Ue(g,4),S,D,fa)}function XU(f,g,S){var A=lt(f)?lH:rP,D=arguments.length<3;return A(f,Ue(g,4),S,D,SP)}function QU(f,g){var S=lt(f)?la:_P;return S(f,Og(Ue(g,3)))}function ZU(f){var g=lt(f)?yP:WV;return g(f)}function JU(f,g,S){(S?$r(f,g,S):g===n)?g=1:g=ft(g);var A=lt(f)?wV:UV;return A(f,g)}function eG(f){var g=lt(f)?SV:qV;return g(f)}function tG(f){if(f==null)return 0;if(ti(f))return Ig(f)?Kc(f):f.length;var g=_r(f);return g==he||g==Ct?f.size:Rv(f).length}function nG(f,g,S){var A=lt(f)?lv:YV;return S&&$r(f,g,S)&&(g=n),A(f,Ue(g,3))}var rG=_t(function(f,g){if(f==null)return[];var S=g.length;return S>1&&$r(f,g[0],g[1])?g=[]:S>2&&$r(g[0],g[1],g[2])&&(g=[g[0]]),IP(f,pr(g,1),[])}),kg=FH||function(){return hr.Date.now()};function iG(f,g){if(typeof g!="function")throw new Ki(s);return f=ft(f),function(){if(--f<1)return g.apply(this,arguments)}}function PT(f,g,S){return g=S?n:g,g=f&&g==null?f.length:g,Ps(f,T,n,n,n,n,g)}function TT(f,g){var S;if(typeof g!="function")throw new Ki(s);return f=ft(f),function(){return--f>0&&(S=g.apply(this,arguments)),f<=1&&(g=n),S}}var Xv=_t(function(f,g,S){var A=y;if(S.length){var D=ua(S,ru(Xv));A|=C}return Ps(f,A,g,S,D)}),kT=_t(function(f,g,S){var A=y|x;if(S.length){var D=ua(S,ru(kT));A|=C}return Ps(g,A,f,S,D)});function AT(f,g,S){g=S?n:g;var A=Ps(f,_,n,n,n,n,n,g);return A.placeholder=AT.placeholder,A}function OT(f,g,S){g=S?n:g;var A=Ps(f,E,n,n,n,n,n,g);return A.placeholder=OT.placeholder,A}function MT(f,g,S){var A,D,W,Z,ie,ue,ve=0,we=!1,Ee=!1,De=!0;if(typeof f!="function")throw new Ki(s);g=eo(g)||0,kn(S)&&(we=!!S.leading,Ee="maxWait"in S,W=Ee?er(eo(S.maxWait)||0,g):W,De="trailing"in S?!!S.trailing:De);function Ve(Bn){var vo=A,Ms=D;return A=D=n,ve=Bn,Z=f.apply(Ms,vo),Z}function qe(Bn){return ve=Bn,ie=cf(kt,g),we?Ve(Bn):Z}function yt(Bn){var vo=Bn-ue,Ms=Bn-ve,QT=g-vo;return Ee?Sr(QT,W-Ms):QT}function Ye(Bn){var vo=Bn-ue,Ms=Bn-ve;return ue===n||vo>=g||vo<0||Ee&&Ms>=W}function kt(){var Bn=kg();if(Ye(Bn))return Nt(Bn);ie=cf(kt,yt(Bn))}function Nt(Bn){return ie=n,De&&A?Ve(Bn):(A=D=n,Z)}function Ri(){ie!==n&&HP(ie),ve=0,A=ue=D=ie=n}function zr(){return ie===n?Z:Nt(kg())}function Pi(){var Bn=kg(),vo=Ye(Bn);if(A=arguments,D=this,ue=Bn,vo){if(ie===n)return qe(ue);if(Ee)return HP(ie),ie=cf(kt,g),Ve(ue)}return ie===n&&(ie=cf(kt,g)),Z}return Pi.cancel=Ri,Pi.flush=zr,Pi}var oG=_t(function(f,g){return wP(f,1,g)}),sG=_t(function(f,g,S){return wP(f,eo(g)||0,S)});function aG(f){return Ps(f,N)}function Ag(f,g){if(typeof f!="function"||g!=null&&typeof g!="function")throw new Ki(s);var S=function(){var A=arguments,D=g?g.apply(this,A):A[0],W=S.cache;if(W.has(D))return W.get(D);var Z=f.apply(this,A);return S.cache=W.set(D,Z)||W,Z};return S.cache=new(Ag.Cache||Es),S}Ag.Cache=Es;function Og(f){if(typeof f!="function")throw new Ki(s);return function(){var g=arguments;switch(g.length){case 0:return!f.call(this);case 1:return!f.call(this,g[0]);case 2:return!f.call(this,g[0],g[1]);case 3:return!f.call(this,g[0],g[1],g[2])}return!f.apply(this,g)}}function lG(f){return TT(2,f)}var cG=KV(function(f,g){g=g.length==1&&lt(g[0])?Tn(g[0],_i(Ue())):Tn(pr(g,1),_i(Ue()));var S=g.length;return _t(function(A){for(var D=-1,W=Sr(A.length,S);++D<W;)A[D]=g[D].call(this,A[D]);return Si(f,this,A)})}),Qv=_t(function(f,g){var S=ua(g,ru(Qv));return Ps(f,C,n,g,S)}),IT=_t(function(f,g){var S=ua(g,ru(IT));return Ps(f,R,n,g,S)}),uG=Ts(function(f,g){return Ps(f,M,n,n,n,g)});function dG(f,g){if(typeof f!="function")throw new Ki(s);return g=g===n?g:ft(g),_t(f,g)}function fG(f,g){if(typeof f!="function")throw new Ki(s);return g=g==null?0:er(ft(g),0),_t(function(S){var A=S[g],D=ga(S,0,g);return A&&ca(D,A),Si(f,this,D)})}function hG(f,g,S){var A=!0,D=!0;if(typeof f!="function")throw new Ki(s);return kn(S)&&(A="leading"in S?!!S.leading:A,D="trailing"in S?!!S.trailing:D),MT(f,g,{leading:A,maxWait:g,trailing:D})}function pG(f){return PT(f,1)}function gG(f,g){return Qv(Nv(g),f)}function mG(){if(!arguments.length)return[];var f=arguments[0];return lt(f)?f:[f]}function bG(f){return Qi(f,h)}function yG(f,g){return g=typeof g=="function"?g:n,Qi(f,h,g)}function vG(f){return Qi(f,d|h)}function xG(f,g){return g=typeof g=="function"?g:n,Qi(f,d|h,g)}function wG(f,g){return g==null||xP(f,g,ar(g))}function yo(f,g){return f===g||f!==f&&g!==g}var SG=_g(_v),_G=_g(function(f,g){return f>=g}),xl=RP(function(){return arguments}())?RP:function(f){return Mn(f)&&rn.call(f,"callee")&&!fP.call(f,"callee")},lt=pe.isArray,CG=q2?_i(q2):MV;function ti(f){return f!=null&&Mg(f.length)&&!As(f)}function zn(f){return Mn(f)&&ti(f)}function EG(f){return f===!0||f===!1||Mn(f)&&jr(f)==J}var ma=$H||lx,RG=Y2?_i(Y2):IV;function PG(f){return Mn(f)&&f.nodeType===1&&!uf(f)}function TG(f){if(f==null)return!0;if(ti(f)&&(lt(f)||typeof f=="string"||typeof f.splice=="function"||ma(f)||iu(f)||xl(f)))return!f.length;var g=_r(f);if(g==he||g==Ct)return!f.size;if(lf(f))return!Rv(f).length;for(var S in f)if(rn.call(f,S))return!1;return!0}function kG(f,g){return of(f,g)}function AG(f,g,S){S=typeof S=="function"?S:n;var A=S?S(f,g):n;return A===n?of(f,g,n,S):!!A}function Zv(f){if(!Mn(f))return!1;var g=jr(f);return g==ge||g==ae||typeof f.message=="string"&&typeof f.name=="string"&&!uf(f)}function OG(f){return typeof f=="number"&&pP(f)}function As(f){if(!kn(f))return!1;var g=jr(f);return g==ne||g==fe||g==Y||g==Be}function DT(f){return typeof f=="number"&&f==ft(f)}function Mg(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=B}function kn(f){var g=typeof f;return f!=null&&(g=="object"||g=="function")}function Mn(f){return f!=null&&typeof f=="object"}var NT=K2?_i(K2):NV;function MG(f,g){return f===g||Ev(f,g,Hv(g))}function IG(f,g,S){return S=typeof S=="function"?S:n,Ev(f,g,Hv(g),S)}function DG(f){return LT(f)&&f!=+f}function NG(f){if(yW(f))throw new st(o);return PP(f)}function LG(f){return f===null}function FG(f){return f==null}function LT(f){return typeof f=="number"||Mn(f)&&jr(f)==_e}function uf(f){if(!Mn(f)||jr(f)!=Le)return!1;var g=og(f);if(g===null)return!0;var S=rn.call(g,"constructor")&&g.constructor;return typeof S=="function"&&S instanceof S&&tg.call(S)==IH}var Jv=X2?_i(X2):LV;function jG(f){return DT(f)&&f>=-9007199254740991&&f<=B}var FT=Q2?_i(Q2):FV;function Ig(f){return typeof f=="string"||!lt(f)&&Mn(f)&&jr(f)==an}function Ei(f){return typeof f=="symbol"||Mn(f)&&jr(f)==mt}var iu=Z2?_i(Z2):jV;function $G(f){return f===n}function zG(f){return Mn(f)&&_r(f)==jt}function BG(f){return Mn(f)&&jr(f)==de}var HG=_g(Pv),VG=_g(function(f,g){return f<=g});function jT(f){if(!f)return[];if(ti(f))return Ig(f)?mo(f):ei(f);if(Xd&&f[Xd])return wH(f[Xd]());var g=_r(f),S=g==he?pv:g==Ct?Zp:ou;return S(f)}function Os(f){if(!f)return f===0?f:0;if(f=eo(f),f===V||f===-1/0){var g=f<0?-1:1;return g*X}return f===f?f:0}function ft(f){var g=Os(f),S=g%1;return g===g?S?g-S:g:0}function $T(f){return f?ml(ft(f),0,q):0}function eo(f){if(typeof f=="number")return f;if(Ei(f))return I;if(kn(f)){var g=typeof f.valueOf=="function"?f.valueOf():f;f=kn(g)?g+"":g}if(typeof f!="string")return f===0?f:+f;f=iP(f);var S=bt.test(f);return S||re.test(f)?iH(f.slice(2),S?2:8):St.test(f)?I:+f}function zT(f){return zo(f,ni(f))}function WG(f){return f?ml(ft(f),-9007199254740991,B):f===0?f:0}function Qt(f){return f==null?"":Ci(f)}var UG=tu(function(f,g){if(lf(g)||ti(g)){zo(g,ar(g),f);return}for(var S in g)rn.call(g,S)&&tf(f,S,g[S])}),BT=tu(function(f,g){zo(g,ni(g),f)}),Dg=tu(function(f,g,S,A){zo(g,ni(g),f,A)}),GG=tu(function(f,g,S,A){zo(g,ar(g),f,A)}),qG=Ts(xv);function YG(f,g){var S=eu(f);return g==null?S:vP(S,g)}var KG=_t(function(f,g){f=dn(f);var S=-1,A=g.length,D=A>2?g[2]:n;for(D&&$r(g[0],g[1],D)&&(A=1);++S<A;)for(var W=g[S],Z=ni(W),ie=-1,ue=Z.length;++ie<ue;){var ve=Z[ie],we=f[ve];(we===n||yo(we,Qc[ve])&&!rn.call(f,ve))&&(f[ve]=W[ve])}return f}),XG=_t(function(f){return f.push(n,iT),Si(HT,n,f)});function QG(f,g){return eP(f,Ue(g,3),$o)}function ZG(f,g){return eP(f,Ue(g,3),Sv)}function JG(f,g){return f==null?f:wv(f,Ue(g,3),ni)}function eq(f,g){return f==null?f:CP(f,Ue(g,3),ni)}function tq(f,g){return f&&$o(f,Ue(g,3))}function nq(f,g){return f&&Sv(f,Ue(g,3))}function rq(f){return f==null?[]:gg(f,ar(f))}function iq(f){return f==null?[]:gg(f,ni(f))}function ex(f,g,S){var A=f==null?n:bl(f,g);return A===n?S:A}function oq(f,g){return f!=null&&aT(f,g,TV)}function tx(f,g){return f!=null&&aT(f,g,kV)}var sq=JP(function(f,g,S){g!=null&&typeof g.toString!="function"&&(g=ng.call(g)),f[g]=S},rx(ri)),aq=JP(function(f,g,S){g!=null&&typeof g.toString!="function"&&(g=ng.call(g)),rn.call(f,g)?f[g].push(S):f[g]=[S]},Ue),lq=_t(rf);function ar(f){return ti(f)?bP(f):Rv(f)}function ni(f){return ti(f)?bP(f,!0):$V(f)}function cq(f,g){var S={};return g=Ue(g,3),$o(f,function(A,D,W){Rs(S,g(A,D,W),A)}),S}function uq(f,g){var S={};return g=Ue(g,3),$o(f,function(A,D,W){Rs(S,D,g(A,D,W))}),S}var dq=tu(function(f,g,S){mg(f,g,S)}),HT=tu(function(f,g,S,A){mg(f,g,S,A)}),fq=Ts(function(f,g){var S={};if(f==null)return S;var A=!1;g=Tn(g,function(W){return W=pa(W,f),A||(A=W.length>1),W}),zo(f,zv(f),S),A&&(S=Qi(S,d|p|h,sW));for(var D=g.length;D--;)Mv(S,g[D]);return S});function hq(f,g){return VT(f,Og(Ue(g)))}var pq=Ts(function(f,g){return f==null?{}:BV(f,g)});function VT(f,g){if(f==null)return{};var S=Tn(zv(f),function(A){return[A]});return g=Ue(g),DP(f,S,function(A,D){return g(A,D[0])})}function gq(f,g,S){g=pa(g,f);var A=-1,D=g.length;for(D||(D=1,f=n);++A<D;){var W=f==null?n:f[Bo(g[A])];W===n&&(A=D,W=S),f=As(W)?W.call(f):W}return f}function mq(f,g,S){return f==null?f:sf(f,g,S)}function bq(f,g,S,A){return A=typeof A=="function"?A:n,f==null?f:sf(f,g,S,A)}var WT=nT(ar),UT=nT(ni);function yq(f,g,S){var A=lt(f),D=A||ma(f)||iu(f);if(g=Ue(g,4),S==null){var W=f&&f.constructor;D?S=A?new W:[]:kn(f)?S=As(W)?eu(og(f)):{}:S={}}return(D?Yi:$o)(f,function(Z,ie,ue){return g(S,Z,ie,ue)}),S}function vq(f,g){return f==null?!0:Mv(f,g)}function xq(f,g,S){return f==null?f:$P(f,g,Nv(S))}function wq(f,g,S,A){return A=typeof A=="function"?A:n,f==null?f:$P(f,g,Nv(S),A)}function ou(f){return f==null?[]:hv(f,ar(f))}function Sq(f){return f==null?[]:hv(f,ni(f))}function _q(f,g,S){return S===n&&(S=g,g=n),S!==n&&(S=eo(S),S=S===S?S:0),g!==n&&(g=eo(g),g=g===g?g:0),ml(eo(f),g,S)}function Cq(f,g,S){return g=Os(g),S===n?(S=g,g=0):S=Os(S),f=eo(f),AV(f,g,S)}function Eq(f,g,S){if(S&&typeof S!="boolean"&&$r(f,g,S)&&(g=S=n),S===n&&(typeof g=="boolean"?(S=g,g=n):typeof f=="boolean"&&(S=f,f=n)),f===n&&g===n?(f=0,g=1):(f=Os(f),g===n?(g=f,f=0):g=Os(g)),f>g){var A=f;f=g,g=A}if(S||f%1||g%1){var D=gP();return Sr(f+D*(g-f+rH("1e-"+((D+"").length-1))),g)}return kv(f,g)}var Rq=nu(function(f,g,S){return g=g.toLowerCase(),f+(S?GT(g):g)});function GT(f){return nx(Qt(f).toLowerCase())}function qT(f){return f=Qt(f),f&&f.replace(Ie,mH).replace(qB,"")}function Pq(f,g,S){f=Qt(f),g=Ci(g);var A=f.length;S=S===n?A:ml(ft(S),0,A);var D=S;return S-=g.length,S>=0&&f.slice(S,D)==g}function Tq(f){return f=Qt(f),f&&dl.test(f)?f.replace(wr,bH):f}function kq(f){return f=Qt(f),f&&or.test(f)?f.replace(fr,"\\$&"):f}var Aq=nu(function(f,g,S){return f+(S?"-":"")+g.toLowerCase()}),Oq=nu(function(f,g,S){return f+(S?" ":"")+g.toLowerCase()}),Mq=XP("toLowerCase");function Iq(f,g,S){f=Qt(f),g=ft(g);var A=g?Kc(f):0;if(!g||A>=g)return f;var D=(g-A)/2;return Sg(cg(D),S)+f+Sg(lg(D),S)}function Dq(f,g,S){f=Qt(f),g=ft(g);var A=g?Kc(f):0;return g&&A<g?f+Sg(g-A,S):f}function Nq(f,g,S){f=Qt(f),g=ft(g);var A=g?Kc(f):0;return g&&A<g?Sg(g-A,S)+f:f}function Lq(f,g,S){return S||g==null?g=0:g&&(g=+g),VH(Qt(f).replace(yn,""),g||0)}function Fq(f,g,S){return(S?$r(f,g,S):g===n)?g=1:g=ft(g),Av(Qt(f),g)}function jq(){var f=arguments,g=Qt(f[0]);return f.length<3?g:g.replace(f[1],f[2])}var $q=nu(function(f,g,S){return f+(S?"_":"")+g.toLowerCase()});function zq(f,g,S){return S&&typeof S!="number"&&$r(f,g,S)&&(g=S=n),S=S===n?q:S>>>0,S?(f=Qt(f),f&&(typeof g=="string"||g!=null&&!Jv(g))&&(g=Ci(g),!g&&Yc(f))?ga(mo(f),0,S):f.split(g,S)):[]}var Bq=nu(function(f,g,S){return f+(S?" ":"")+nx(g)});function Hq(f,g,S){return f=Qt(f),S=S==null?0:ml(ft(S),0,f.length),g=Ci(g),f.slice(S,S+g.length)==g}function Vq(f,g,S){var A=z.templateSettings;S&&$r(f,g,S)&&(g=n),f=Qt(f),g=Dg({},g,A,rT);var D=Dg({},g.imports,A.imports,rT),W=ar(D),Z=hv(D,W),ie,ue,ve=0,we=g.interpolate||Mt,Ee="__p += '",De=gv((g.escape||Mt).source+"|"+we.source+"|"+(we===Ut?Dt:Mt).source+"|"+(g.evaluate||Mt).source+"|$","g"),Ve="//# sourceURL="+(rn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ZB+"]")+`
75
- `;f.replace(De,function(Ye,kt,Nt,Ri,zr,Pi){return Nt||(Nt=Ri),Ee+=f.slice(ve,Pi).replace(hn,yH),kt&&(ie=!0,Ee+=`' +
76
- __e(`+kt+`) +
77
- '`),zr&&(ue=!0,Ee+=`';
78
- `+zr+`;
79
- __p += '`),Nt&&(Ee+=`' +
80
- ((__t = (`+Nt+`)) == null ? '' : __t) +
81
- '`),ve=Pi+Ye.length,Ye}),Ee+=`';
82
- `;var qe=rn.call(g,"variable")&&g.variable;if(!qe)Ee=`with (obj) {
83
- `+Ee+`
84
- }
85
- `;else if(Me.test(qe))throw new st(a);Ee=(ue?Ee.replace(Xn,""):Ee).replace(Gi,"$1").replace(xr,"$1;"),Ee="function("+(qe||"obj")+`) {
86
- `+(qe?"":`obj || (obj = {});
87
- `)+"var __t, __p = ''"+(ie?", __e = _.escape":"")+(ue?`, __j = Array.prototype.join;
88
- function print() { __p += __j.call(arguments, '') }
89
- `:`;
90
- `)+Ee+`return __p
91
- }`;var yt=KT(function(){return qt(W,Ve+"return "+Ee).apply(n,Z)});if(yt.source=Ee,Zv(yt))throw yt;return yt}function Wq(f){return Qt(f).toLowerCase()}function Uq(f){return Qt(f).toUpperCase()}function Gq(f,g,S){if(f=Qt(f),f&&(S||g===n))return iP(f);if(!f||!(g=Ci(g)))return f;var A=mo(f),D=mo(g),W=oP(A,D),Z=sP(A,D)+1;return ga(A,W,Z).join("")}function qq(f,g,S){if(f=Qt(f),f&&(S||g===n))return f.slice(0,lP(f)+1);if(!f||!(g=Ci(g)))return f;var A=mo(f),D=sP(A,mo(g))+1;return ga(A,0,D).join("")}function Yq(f,g,S){if(f=Qt(f),f&&(S||g===n))return f.replace(yn,"");if(!f||!(g=Ci(g)))return f;var A=mo(f),D=oP(A,mo(g));return ga(A,D).join("")}function Kq(f,g){var S=j,A=F;if(kn(g)){var D="separator"in g?g.separator:D;S="length"in g?ft(g.length):S,A="omission"in g?Ci(g.omission):A}f=Qt(f);var W=f.length;if(Yc(f)){var Z=mo(f);W=Z.length}if(S>=W)return f;var ie=S-Kc(A);if(ie<1)return A;var ue=Z?ga(Z,0,ie).join(""):f.slice(0,ie);if(D===n)return ue+A;if(Z&&(ie+=ue.length-ie),Jv(D)){if(f.slice(ie).search(D)){var ve,we=ue;for(D.global||(D=gv(D.source,Qt(Ht.exec(D))+"g")),D.lastIndex=0;ve=D.exec(we);)var Ee=ve.index;ue=ue.slice(0,Ee===n?ie:Ee)}}else if(f.indexOf(Ci(D),ie)!=ie){var De=ue.lastIndexOf(D);De>-1&&(ue=ue.slice(0,De))}return ue+A}function Xq(f){return f=Qt(f),f&&Lr.test(f)?f.replace(jo,EH):f}var Qq=nu(function(f,g,S){return f+(S?" ":"")+g.toUpperCase()}),nx=XP("toUpperCase");function YT(f,g,S){return f=Qt(f),g=S?n:g,g===n?xH(f)?TH(f):dH(f):f.match(g)||[]}var KT=_t(function(f,g){try{return Si(f,n,g)}catch(S){return Zv(S)?S:new st(S)}}),Zq=Ts(function(f,g){return Yi(g,function(S){S=Bo(S),Rs(f,S,Xv(f[S],f))}),f});function Jq(f){var g=f==null?0:f.length,S=Ue();return f=g?Tn(f,function(A){if(typeof A[1]!="function")throw new Ki(s);return[S(A[0]),A[1]]}):[],_t(function(A){for(var D=-1;++D<g;){var W=f[D];if(Si(W[0],this,A))return Si(W[1],this,A)}})}function eY(f){return EV(Qi(f,d))}function rx(f){return function(){return f}}function tY(f,g){return f==null||f!==f?g:f}var nY=ZP(),rY=ZP(!0);function ri(f){return f}function ix(f){return TP(typeof f=="function"?f:Qi(f,d))}function iY(f){return AP(Qi(f,d))}function oY(f,g){return OP(f,Qi(g,d))}var sY=_t(function(f,g){return function(S){return rf(S,f,g)}}),aY=_t(function(f,g){return function(S){return rf(f,S,g)}});function ox(f,g,S){var A=ar(g),D=gg(g,A);S==null&&!(kn(g)&&(D.length||!A.length))&&(S=g,g=f,f=this,D=gg(g,ar(g)));var W=!(kn(S)&&"chain"in S)||!!S.chain,Z=As(f);return Yi(D,function(ie){var ue=g[ie];f[ie]=ue,Z&&(f.prototype[ie]=function(){var ve=this.__chain__;if(W||ve){var we=f(this.__wrapped__),Ee=we.__actions__=ei(this.__actions__);return Ee.push({func:ue,args:arguments,thisArg:f}),we.__chain__=ve,we}return ue.apply(f,ca([this.value()],arguments))})}),f}function lY(){return hr._===this&&(hr._=DH),this}function sx(){}function cY(f){return f=ft(f),_t(function(g){return MP(g,f)})}var uY=Fv(Tn),dY=Fv(J2),fY=Fv(lv);function XT(f){return Wv(f)?cv(Bo(f)):HV(f)}function hY(f){return function(g){return f==null?n:bl(f,g)}}var pY=eT(),gY=eT(!0);function ax(){return[]}function lx(){return!1}function mY(){return{}}function bY(){return""}function yY(){return!0}function vY(f,g){if(f=ft(f),f<1||f>B)return[];var S=q,A=Sr(f,q);g=Ue(g),f-=q;for(var D=fv(A,g);++S<f;)g(S);return D}function xY(f){return lt(f)?Tn(f,Bo):Ei(f)?[f]:ei(mT(Qt(f)))}function wY(f){var g=++MH;return Qt(f)+g}var SY=wg(function(f,g){return f+g},0),_Y=jv("ceil"),CY=wg(function(f,g){return f/g},1),EY=jv("floor");function RY(f){return f&&f.length?pg(f,ri,_v):n}function PY(f,g){return f&&f.length?pg(f,Ue(g,2),_v):n}function TY(f){return nP(f,ri)}function kY(f,g){return nP(f,Ue(g,2))}function AY(f){return f&&f.length?pg(f,ri,Pv):n}function OY(f,g){return f&&f.length?pg(f,Ue(g,2),Pv):n}var MY=wg(function(f,g){return f*g},1),IY=jv("round"),DY=wg(function(f,g){return f-g},0);function NY(f){return f&&f.length?dv(f,ri):0}function LY(f,g){return f&&f.length?dv(f,Ue(g,2)):0}return z.after=iG,z.ary=PT,z.assign=UG,z.assignIn=BT,z.assignInWith=Dg,z.assignWith=GG,z.at=qG,z.before=TT,z.bind=Xv,z.bindAll=Zq,z.bindKey=kT,z.castArray=mG,z.chain=CT,z.chunk=EW,z.compact=RW,z.concat=PW,z.cond=Jq,z.conforms=eY,z.constant=rx,z.countBy=NU,z.create=YG,z.curry=AT,z.curryRight=OT,z.debounce=MT,z.defaults=KG,z.defaultsDeep=XG,z.defer=oG,z.delay=sG,z.difference=TW,z.differenceBy=kW,z.differenceWith=AW,z.drop=OW,z.dropRight=MW,z.dropRightWhile=IW,z.dropWhile=DW,z.fill=NW,z.filter=FU,z.flatMap=zU,z.flatMapDeep=BU,z.flatMapDepth=HU,z.flatten=xT,z.flattenDeep=LW,z.flattenDepth=FW,z.flip=aG,z.flow=nY,z.flowRight=rY,z.fromPairs=jW,z.functions=rq,z.functionsIn=iq,z.groupBy=VU,z.initial=zW,z.intersection=BW,z.intersectionBy=HW,z.intersectionWith=VW,z.invert=sq,z.invertBy=aq,z.invokeMap=UU,z.iteratee=ix,z.keyBy=GU,z.keys=ar,z.keysIn=ni,z.map=Tg,z.mapKeys=cq,z.mapValues=uq,z.matches=iY,z.matchesProperty=oY,z.memoize=Ag,z.merge=dq,z.mergeWith=HT,z.method=sY,z.methodOf=aY,z.mixin=ox,z.negate=Og,z.nthArg=cY,z.omit=fq,z.omitBy=hq,z.once=lG,z.orderBy=qU,z.over=uY,z.overArgs=cG,z.overEvery=dY,z.overSome=fY,z.partial=Qv,z.partialRight=IT,z.partition=YU,z.pick=pq,z.pickBy=VT,z.property=XT,z.propertyOf=hY,z.pull=qW,z.pullAll=ST,z.pullAllBy=YW,z.pullAllWith=KW,z.pullAt=XW,z.range=pY,z.rangeRight=gY,z.rearg=uG,z.reject=QU,z.remove=QW,z.rest=dG,z.reverse=Yv,z.sampleSize=JU,z.set=mq,z.setWith=bq,z.shuffle=eG,z.slice=ZW,z.sortBy=rG,z.sortedUniq=oU,z.sortedUniqBy=sU,z.split=zq,z.spread=fG,z.tail=aU,z.take=lU,z.takeRight=cU,z.takeRightWhile=uU,z.takeWhile=dU,z.tap=RU,z.throttle=hG,z.thru=Pg,z.toArray=jT,z.toPairs=WT,z.toPairsIn=UT,z.toPath=xY,z.toPlainObject=zT,z.transform=yq,z.unary=pG,z.union=fU,z.unionBy=hU,z.unionWith=pU,z.uniq=gU,z.uniqBy=mU,z.uniqWith=bU,z.unset=vq,z.unzip=Kv,z.unzipWith=_T,z.update=xq,z.updateWith=wq,z.values=ou,z.valuesIn=Sq,z.without=yU,z.words=YT,z.wrap=gG,z.xor=vU,z.xorBy=xU,z.xorWith=wU,z.zip=SU,z.zipObject=_U,z.zipObjectDeep=CU,z.zipWith=EU,z.entries=WT,z.entriesIn=UT,z.extend=BT,z.extendWith=Dg,ox(z,z),z.add=SY,z.attempt=KT,z.camelCase=Rq,z.capitalize=GT,z.ceil=_Y,z.clamp=_q,z.clone=bG,z.cloneDeep=vG,z.cloneDeepWith=xG,z.cloneWith=yG,z.conformsTo=wG,z.deburr=qT,z.defaultTo=tY,z.divide=CY,z.endsWith=Pq,z.eq=yo,z.escape=Tq,z.escapeRegExp=kq,z.every=LU,z.find=jU,z.findIndex=yT,z.findKey=QG,z.findLast=$U,z.findLastIndex=vT,z.findLastKey=ZG,z.floor=EY,z.forEach=ET,z.forEachRight=RT,z.forIn=JG,z.forInRight=eq,z.forOwn=tq,z.forOwnRight=nq,z.get=ex,z.gt=SG,z.gte=_G,z.has=oq,z.hasIn=tx,z.head=wT,z.identity=ri,z.includes=WU,z.indexOf=$W,z.inRange=Cq,z.invoke=lq,z.isArguments=xl,z.isArray=lt,z.isArrayBuffer=CG,z.isArrayLike=ti,z.isArrayLikeObject=zn,z.isBoolean=EG,z.isBuffer=ma,z.isDate=RG,z.isElement=PG,z.isEmpty=TG,z.isEqual=kG,z.isEqualWith=AG,z.isError=Zv,z.isFinite=OG,z.isFunction=As,z.isInteger=DT,z.isLength=Mg,z.isMap=NT,z.isMatch=MG,z.isMatchWith=IG,z.isNaN=DG,z.isNative=NG,z.isNil=FG,z.isNull=LG,z.isNumber=LT,z.isObject=kn,z.isObjectLike=Mn,z.isPlainObject=uf,z.isRegExp=Jv,z.isSafeInteger=jG,z.isSet=FT,z.isString=Ig,z.isSymbol=Ei,z.isTypedArray=iu,z.isUndefined=$G,z.isWeakMap=zG,z.isWeakSet=BG,z.join=WW,z.kebabCase=Aq,z.last=Ji,z.lastIndexOf=UW,z.lowerCase=Oq,z.lowerFirst=Mq,z.lt=HG,z.lte=VG,z.max=RY,z.maxBy=PY,z.mean=TY,z.meanBy=kY,z.min=AY,z.minBy=OY,z.stubArray=ax,z.stubFalse=lx,z.stubObject=mY,z.stubString=bY,z.stubTrue=yY,z.multiply=MY,z.nth=GW,z.noConflict=lY,z.noop=sx,z.now=kg,z.pad=Iq,z.padEnd=Dq,z.padStart=Nq,z.parseInt=Lq,z.random=Eq,z.reduce=KU,z.reduceRight=XU,z.repeat=Fq,z.replace=jq,z.result=gq,z.round=IY,z.runInContext=ce,z.sample=ZU,z.size=tG,z.snakeCase=$q,z.some=nG,z.sortedIndex=JW,z.sortedIndexBy=eU,z.sortedIndexOf=tU,z.sortedLastIndex=nU,z.sortedLastIndexBy=rU,z.sortedLastIndexOf=iU,z.startCase=Bq,z.startsWith=Hq,z.subtract=DY,z.sum=NY,z.sumBy=LY,z.template=Vq,z.times=vY,z.toFinite=Os,z.toInteger=ft,z.toLength=$T,z.toLower=Wq,z.toNumber=eo,z.toSafeInteger=WG,z.toString=Qt,z.toUpper=Uq,z.trim=Gq,z.trimEnd=qq,z.trimStart=Yq,z.truncate=Kq,z.unescape=Xq,z.uniqueId=wY,z.upperCase=Qq,z.upperFirst=nx,z.each=ET,z.eachRight=RT,z.first=wT,ox(z,function(){var f={};return $o(z,function(g,S){rn.call(z.prototype,S)||(f[S]=g)}),f}(),{chain:!1}),z.VERSION=r,Yi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){z[f].placeholder=z}),Yi(["drop","take"],function(f,g){It.prototype[f]=function(S){S=S===n?1:er(ft(S),0);var A=this.__filtered__&&!g?new It(this):this.clone();return A.__filtered__?A.__takeCount__=Sr(S,A.__takeCount__):A.__views__.push({size:Sr(S,q),type:f+(A.__dir__<0?"Right":"")}),A},It.prototype[f+"Right"]=function(S){return this.reverse()[f](S).reverse()}}),Yi(["filter","map","takeWhile"],function(f,g){var S=g+1,A=S==H||S==G;It.prototype[f]=function(D){var W=this.clone();return W.__iteratees__.push({iteratee:Ue(D,3),type:S}),W.__filtered__=W.__filtered__||A,W}}),Yi(["head","last"],function(f,g){var S="take"+(g?"Right":"");It.prototype[f]=function(){return this[S](1).value()[0]}}),Yi(["initial","tail"],function(f,g){var S="drop"+(g?"":"Right");It.prototype[f]=function(){return this.__filtered__?new It(this):this[S](1)}}),It.prototype.compact=function(){return this.filter(ri)},It.prototype.find=function(f){return this.filter(f).head()},It.prototype.findLast=function(f){return this.reverse().find(f)},It.prototype.invokeMap=_t(function(f,g){return typeof f=="function"?new It(this):this.map(function(S){return rf(S,f,g)})}),It.prototype.reject=function(f){return this.filter(Og(Ue(f)))},It.prototype.slice=function(f,g){f=ft(f);var S=this;return S.__filtered__&&(f>0||g<0)?new It(S):(f<0?S=S.takeRight(-f):f&&(S=S.drop(f)),g!==n&&(g=ft(g),S=g<0?S.dropRight(-g):S.take(g-f)),S)},It.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},It.prototype.toArray=function(){return this.take(q)},$o(It.prototype,function(f,g){var S=/^(?:filter|find|map|reject)|While$/.test(g),A=/^(?:head|last)$/.test(g),D=z[A?"take"+(g=="last"?"Right":""):g],W=A||/^find/.test(g);D&&(z.prototype[g]=function(){var Z=this.__wrapped__,ie=A?[1]:arguments,ue=Z instanceof It,ve=ie[0],we=ue||lt(Z),Ee=function(kt){var Nt=D.apply(z,ca([kt],ie));return A&&De?Nt[0]:Nt};we&&S&&typeof ve=="function"&&ve.length!=1&&(ue=we=!1);var De=this.__chain__,Ve=!!this.__actions__.length,qe=W&&!De,yt=ue&&!Ve;if(!W&&we){Z=yt?Z:new It(this);var Ye=f.apply(Z,ie);return Ye.__actions__.push({func:Pg,args:[Ee],thisArg:n}),new Xi(Ye,De)}return qe&&yt?f.apply(this,ie):(Ye=this.thru(Ee),qe?A?Ye.value()[0]:Ye.value():Ye)})}),Yi(["pop","push","shift","sort","splice","unshift"],function(f){var g=Jp[f],S=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",A=/^(?:pop|shift)$/.test(f);z.prototype[f]=function(){var D=arguments;if(A&&!this.__chain__){var W=this.value();return g.apply(lt(W)?W:[],D)}return this[S](function(Z){return g.apply(lt(Z)?Z:[],D)})}}),$o(It.prototype,function(f,g){var S=z[g];if(S){var A=S.name+"";rn.call(Jc,A)||(Jc[A]=[]),Jc[A].push({name:g,func:S})}}),Jc[xg(n,x).name]=[{name:"wrapper",func:n}],It.prototype.clone=XH,It.prototype.reverse=QH,It.prototype.value=ZH,z.prototype.at=PU,z.prototype.chain=TU,z.prototype.commit=kU,z.prototype.next=AU,z.prototype.plant=MU,z.prototype.reverse=IU,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=DU,z.prototype.first=z.prototype.head,Xd&&(z.prototype[Xd]=OU),z},Xc=kH();fl?((fl.exports=Xc)._=Xc,iv._=Xc):hr._=Xc}).call(Ra)})(pb,pb.exports);var jf=pb.exports;const tc=Ic(jf);function mk({id:e,layouts:t,initialHeight:n,y:r,x:i,w:o,minH:s}){const a={i:e,x:i??0,y:r??1/0,w:o||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return K_.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,p)=>Math.max(d,p.y+p.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function bk(e,t){if(!t)return;const n={...t};return K_.forEach(r=>{n[r]&&(n[r]=n[r].filter(i=>i.i!==e))}),n}function J_(e){return ye.getState().dashboard.globalCacheConfig}const ye=cN()(mN((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:hb},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:hb},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setIsDownloadingPdf:n=>{e(r=>{r.isDownloadingPdf=n})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var o,s,a,l,c,u,d,p;const i=(o=r.dashboard.sheets)==null?void 0:o.findIndex(h=>h.id===n);if(i!==void 0&&i>-1){(s=r.dashboard.sheets)==null||s.splice(i,1);const h=(a=r.dashboard.filters)==null?void 0:a.filter(b=>b.sheetId===n),m=(l=r.filterValues)==null?void 0:l.filter(b=>h==null?void 0:h.some(y=>y.id===b.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(b=>!(m!=null&&m.some(y=>y.filterId===b.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(b=>b.sheetId!==n),r.selectedSheetId=(p=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:p.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const i=r.dashboard.filters;let o={};i==null||i.forEach(a=>{K_.forEach(l=>{o!=null&&o[l]||(o={...o,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};o[l].push(c)})});const s={...n,layouts:o};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},addToAIScope:n=>{e(r=>{const{connectionId:i,connectionType:o,databaseName:s,schemaName:a,tableName:l,datamodelName:c}=n,u={connectionId:i||"",connectionType:o||"",databaseName:s||"",schemaName:a||"",tableName:l||"",datamodelName:c||""};let p=[...r.dashboard.aiScopeTables||[],u];p=p.filter((h,m,b)=>b.findIndex(y=>y.tableName===h.tableName&&y.datamodelName===h.datamodelName)===m),r.dashboard.aiScopeTables=p})},removeFromAIScope:n=>{e(r=>{const{connectionId:i,tableName:o,datamodelName:s}=n,a=r.dashboard.aiScopeTables||[];if(s){const l=a.filter(c=>!(c.datamodelName===s&&c.connectionId===i));r.dashboard.aiScopeTables=l}else if(o){const l=a.filter(c=>!(c.tableName===o&&c.connectionId===i));r.dashboard.aiScopeTables=l}})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&jf.forEach(o.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 i;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(i=r.dashboard.baseQueries)==null||i.push(n)})},removeBaseQuery:n=>{e(r=>{var o,s;const i=(o=r.dashboard.baseQueries)==null?void 0:o.findIndex(a=>a.id===n);i!=null&&i>-1&&((s=r.dashboard.baseQueries)==null||s.splice(i,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var i;(i=r.filteringCards)==null||i.push(n)})},removeFilteringCard:n=>{e(r=>{var o,s;const i=(o=r.filteringCards)==null?void 0:o.findIndex(a=>a.id===n.id);i!==void 0&&i>-1&&((s=r.filteringCards)==null||s.splice(i,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(i=>{i.dashboard=n,i.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.title=r)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&jf.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.title=i)})})},setCardInfo:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&jf.forEach(o.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,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&jf.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.id===r);u&&(u.description=i)})})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,u;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(p=>p.id===r);d&&(d.sql=i,(u=o.onUpdateCard)==null||u.call(o,d,n))}})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setSheetLayouts:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.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 i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(i=>{var s,a,l;const o=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===i.filterId);o!==void 0&&o>-1?(a=r.filterValues)==null||a.splice(o,1,i):(l=r.filterValues)==null||l.push(i)}):r.filterValues=n})},removeFilterValues:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.filter(o=>o.filterId!==n&&!o.filterId.startsWith(n));r.filterValues=i}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1&&r.filterValues.splice(i,1,n)}})},addFilter:n=>{e(r=>{var o,s;r.dashboard.filters?(o=r.dashboard.filters)==null||o.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const i=r.dashboard.sheets;i==null||i.forEach(a=>{mk({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var i,o,s;if(r.dashboard.filters){const a=(i=r.dashboard.filters)==null?void 0:i.findIndex(l=>l.id===n);if(a>-1){(o=r.dashboard.filters)==null||o.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=bk(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,i)=>{e(o=>{var l,c,u,d,p;const s=(c=(l=o.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(h=>h.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(h=>h.id===r);if(a){const h=(d=a.cards)==null?void 0:d.findIndex(m=>m.id===i.id);h>-1&&((p=a.cards)==null||p.splice(h,1,i))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},updateFilterId:(n,r)=>{e(i=>{var a,l;const o=(a=i.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=i.dashboard.filters)==null?void 0:l.some(c=>c.id===r);o&&!s&&(o.id=r)})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,i)=>{e(o=>{var a,l,c,u;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const p=0;i==="start"&&(d=0);const h=mk({id:r.id,layouts:s.layouts,minH:10,x:p,y:d});s.layouts=h,(u=o.onAddFrame)==null||u.call(o,r,n)}})},removeFrame:(n,r)=>{e(i=>{var s,a,l,c,u;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(o){const d=(l=o.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=o.frames)==null||c.splice(d,1),(u=o.layout)==null||u.splice(d,1),bk(r,o.layouts))}})},updateFrame:(n,r)=>{e(i=>{var a,l,c,u,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.frames)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((u=o.frames)==null||u.splice(s,1,r)),(d=i.onAcceptChanges)==null||d.call(i,r,i.dashboard)})},updateCard:(n,r)=>{e(i=>{var a,l,c,u,d;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((u=o.cards)==null||u.splice(s,1,r),(d=i.onUpdateCard)==null||d.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,u,d,p;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(h=>h.id===r.id);o&&((u=o.cards)==null||u.splice(s,1),(d=o.layout)==null||d.splice(s,1),(p=i.onRemoveCard)==null||p.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(u=>u.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},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(i=>i.id===t().selectedSheetId)},getCardFrame:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((o=a[l].cards)==null?void 0:o.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.frames)==null?void 0:o.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(o=a[l].cards)==null?void 0:o.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var i,o;const r=(i=t().dashboard)==null?void 0:i.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((o=a[l].cards)==null?void 0:o.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{oX({card:n,dataPoint:r,set:e,get:t})}}}))),Vn=()=>ye(e=>e.actions);async function sX(e,t){const n=t.slice(0,16),r=new TextEncoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),o=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},o,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function wN(e,t){const n=t.slice(0,16),r=new TextEncoder,i=new TextDecoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),p=>p.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const p=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:i.decode(p)}}catch(p){throw new Error(`Decryption failed: ${p}`)}}function me(...e){return vK(rd(e))}const aX=e=>Object.keys(e).length===0;async function lX(e,t,n={}){try{const r=new URLSearchParams(n).toString(),i=`${e}?${r}`,o=await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const a=await o.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${o.status}`)}return await o.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function Ry(e,t,n={}){try{const r=JSON.stringify(n),i=await sX(r,t),o=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(i)});if(!o.ok)return o.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${o.status}`)});const s=await o.json();if(s.payload){const a=await wN(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}function cX(e){if(!e)return{tenantId:"",endUserId:""};const t=H_(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function uX(e){if(!e)return;const t=H_(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function SN(e){return e?H_(e).params:void 0}function dX(e){return e.charAt(0).toUpperCase()+e.slice(1)}const nh="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function fX(){var i,o;const e=(o=(i=ye.getState())==null?void 0:i.authToken)==null?void 0:o.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function hX(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),i=new URLSearchParams(r).toString();i&&(n+=`?${i}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await wN(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function pX(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}const gX={theme:"system",setTheme:()=>null},_N=k.createContext(gX);function mX({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=k.useState(()=>localStorage.getItem(n)||t);k.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return v.jsx(_N.Provider,{...r,value:s,children:e})}const CN=()=>{const e=k.useContext(_N);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var up=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(){}},vc=typeof window>"u"||"Deno"in globalThis;function ro(){}function bX(e,t){return typeof e=="function"?e(t):e}function _1(e){return typeof e=="number"&&e>=0&&e!==1/0}function EN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ou(e,t){return typeof e=="function"?e(t):e}function Ro(e,t){return typeof e=="function"?e(t):e}function yk(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==eC(s,t.options))return!1}else if(!Ph(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function vk(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Rh(t.options.mutationKey)!==Rh(o))return!1}else if(!Ph(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function eC(e,t){return((t==null?void 0:t.queryKeyHashFn)||Rh)(e)}function Rh(e){return JSON.stringify(e,(t,n)=>R1(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ph(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ph(e[n],t[n])):!1}function C1(e,t){if(e===t)return e;const n=xk(e)&&xk(t);if(n||R1(e)&&R1(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:o[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=C1(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function E1(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 xk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function R1(e){if(!wk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!wk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wk(e){return Object.prototype.toString.call(e)==="[object Object]"}function yX(e){return new Promise(t=>{setTimeout(t,e)})}function P1(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 C1(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 C1(e,t)}return t}function vX(e){return e}function xX(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function wX(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var gb=Symbol();function RN(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===gb&&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===gb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Yl,Ta,Wu,qD,SX=(qD=class extends up{constructor(){super();et(this,Yl);et(this,Ta);et(this,Wu);ze(this,Wu,t=>{if(!vc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){le(this,Ta)||this.setEventListener(le(this,Wu))}onUnsubscribe(){var t;this.hasListeners()||((t=le(this,Ta))==null||t.call(this),ze(this,Ta,void 0))}setEventListener(t){var n;ze(this,Wu,t),(n=le(this,Ta))==null||n.call(this),ze(this,Ta,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){le(this,Yl)!==t&&(ze(this,Yl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof le(this,Yl)=="boolean"?le(this,Yl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Yl=new WeakMap,Ta=new WeakMap,Wu=new WeakMap,qD),tC=new SX,Uu,ka,Gu,YD,_X=(YD=class extends up{constructor(){super();et(this,Uu,!0);et(this,ka);et(this,Gu);ze(this,Gu,t=>{if(!vc&&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(){le(this,ka)||this.setEventListener(le(this,Gu))}onUnsubscribe(){var t;this.hasListeners()||((t=le(this,ka))==null||t.call(this),ze(this,ka,void 0))}setEventListener(t){var n;ze(this,Gu,t),(n=le(this,ka))==null||n.call(this),ze(this,ka,t(this.setOnline.bind(this)))}setOnline(t){le(this,Uu)!==t&&(ze(this,Uu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return le(this,Uu)}},Uu=new WeakMap,ka=new WeakMap,Gu=new WeakMap,YD),mb=new _X;function T1(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function CX(e){return Math.min(1e3*2**e,3e4)}function PN(e){return(e??"online")==="online"?mb.isOnline():!0}var TN=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function yx(e){return e instanceof TN}function kN(e){let t=!1,n=0,r=!1,i;const o=T1(),s=b=>{var y;r||(p(new TN(b)),(y=e.abort)==null||y.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>tC.isFocused()&&(e.networkMode==="always"||mb.isOnline())&&e.canRun(),u=()=>PN(e.networkMode)&&e.canRun(),d=b=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,b),i==null||i(),o.resolve(b))},p=b=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,b),i==null||i(),o.reject(b))},h=()=>new Promise(b=>{var y;i=x=>{(r||c())&&b(x)},(y=e.onPause)==null||y.call(e)}).then(()=>{var b;i=void 0,r||(b=e.onContinue)==null||b.call(e)}),m=()=>{if(r)return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(x){b=Promise.reject(x)}Promise.resolve(b).then(d).catch(x=>{var R;if(r)return;const w=e.retry??(vc?0:3),_=e.retryDelay??CX,E=typeof _=="function"?_(n,x):_,C=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,x);if(t||!C){p(x);return}n++,(R=e.onFail)==null||R.call(e,n,x),yX(E).then(()=>c()?void 0:h()).then(()=>{t?p(x):m()})})};return{promise:o,cancel:s,continue:()=>(i==null||i(),o),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():h().then(m),o)}}function EX(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const o=a=>{t?e.push(a):i(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var br=EX(),Kl,KD,AN=(KD=class{constructor(){et(this,Kl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_1(this.gcTime)&&ze(this,Kl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vc?1/0:5*60*1e3))}clearGcTimeout(){le(this,Kl)&&(clearTimeout(le(this,Kl)),ze(this,Kl,void 0))}},Kl=new WeakMap,KD),qu,Yu,no,Pr,op,Xl,Co,Fs,XD,RX=(XD=class extends AN{constructor(t){super();et(this,Co);et(this,qu);et(this,Yu);et(this,no);et(this,Pr);et(this,op);et(this,Xl);ze(this,Xl,!1),ze(this,op,t.defaultOptions),this.setOptions(t.options),this.observers=[],ze(this,no,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ze(this,qu,PX(this.options)),this.state=t.state??le(this,qu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=le(this,Pr))==null?void 0:t.promise}setOptions(t){this.options={...le(this,op),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&le(this,no).remove(this)}setData(t,n){const r=P1(this.state.data,t,this.options);return Lt(this,Co,Fs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Lt(this,Co,Fs).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=le(this,Pr))==null?void 0:r.promise;return(i=le(this,Pr))==null||i.cancel(t),n?n.then(ro).catch(ro):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(le(this,qu))}isActive(){return this.observers.some(t=>Ro(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===gb||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||!EN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=le(this,Pr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=le(this,Pr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),le(this,no).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(le(this,Pr)&&(le(this,Xl)?le(this,Pr).cancel({revert:!0}):le(this,Pr).cancelRetry()),this.scheduleGc()),le(this,no).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Lt(this,Co,Fs).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(le(this,Pr))return le(this,Pr).continueRetry(),le(this,Pr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(p=>p.options.queryFn);d&&this.setOptions(d.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(ze(this,Xl,!0),r.signal)})},o=()=>{const d=RN(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),ze(this,Xl,!1),this.options.persister?this.options.persister(d,p,this):d(p)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(s),(l=this.options.behavior)==null||l.onFetch(s,this),ze(this,Yu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Lt(this,Co,Fs).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var p,h,m,b;yx(d)&&d.silent||Lt(this,Co,Fs).call(this,{type:"error",error:d}),yx(d)||((h=(p=le(this,no).config).onError)==null||h.call(p,d,this),(b=(m=le(this,no).config).onSettled)==null||b.call(m,this.state.data,d,this)),this.scheduleGc()};return ze(this,Pr,kN({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var p,h,m,b;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(y){a(y);return}(h=(p=le(this,no).config).onSuccess)==null||h.call(p,d,this),(b=(m=le(this,no).config).onSettled)==null||b.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,p)=>{Lt(this,Co,Fs).call(this,{type:"failed",failureCount:d,error:p})},onPause:()=>{Lt(this,Co,Fs).call(this,{type:"pause"})},onContinue:()=>{Lt(this,Co,Fs).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),le(this,Pr).start()}},qu=new WeakMap,Yu=new WeakMap,no=new WeakMap,Pr=new WeakMap,op=new WeakMap,Xl=new WeakMap,Co=new WeakSet,Fs=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,...ON(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 i=t.error;return yx(i)&&i.revert&&le(this,Yu)?{...le(this,Yu),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),br.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),le(this,no).notify({query:this,type:"updated",action:t})})},XD);function ON(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:PN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function PX(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 qo,QD,MN=(QD=class extends up{constructor(t={}){super();et(this,qo);this.config=t,ze(this,qo,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??eC(i,n);let s=this.get(o);return s||(s=new RX({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){le(this,qo).has(t.queryHash)||(le(this,qo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=le(this,qo).get(t.queryHash);n&&(t.destroy(),n===t&&le(this,qo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){br.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return le(this,qo).get(t)}getAll(){return[...le(this,qo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>yk(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>yk(t,r)):n}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){br.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){br.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},qo=new WeakMap,QD),Yo,Vr,Ql,Ko,_a,ZD,TX=(ZD=class extends AN{constructor(t){super();et(this,Ko);et(this,Yo);et(this,Vr);et(this,Ql);this.mutationId=t.mutationId,ze(this,Vr,t.mutationCache),ze(this,Yo,[]),this.state=t.state||kX(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){le(this,Yo).includes(t)||(le(this,Yo).push(t),this.clearGcTimeout(),le(this,Vr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ze(this,Yo,le(this,Yo).filter(n=>n!==t)),this.scheduleGc(),le(this,Vr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){le(this,Yo).length||(this.state.status==="pending"?this.scheduleGc():le(this,Vr).remove(this))}continue(){var t;return((t=le(this,Ql))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,u,d,p,h,m,b,y,x,w,_,E,C,R,T;ze(this,Ql,kN({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,N)=>{Lt(this,Ko,_a).call(this,{type:"failed",failureCount:M,error:N})},onPause:()=>{Lt(this,Ko,_a).call(this,{type:"pause"})},onContinue:()=>{Lt(this,Ko,_a).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>le(this,Vr).canRun(this)}));const n=this.state.status==="pending",r=!le(this,Ql).canStart();try{if(!n){Lt(this,Ko,_a).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=le(this,Vr).config).onMutate)==null?void 0:o.call(i,t,this));const N=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));N!==this.state.context&&Lt(this,Ko,_a).call(this,{type:"pending",context:N,variables:t,isPaused:r})}const M=await le(this,Ql).start();return await((c=(l=le(this,Vr).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,M,t,this.state.context)),await((h=(p=le(this,Vr).config).onSettled)==null?void 0:h.call(p,M,null,this.state.variables,this.state.context,this)),await((b=(m=this.options).onSettled)==null?void 0:b.call(m,M,null,t,this.state.context)),Lt(this,Ko,_a).call(this,{type:"success",data:M}),M}catch(M){try{throw await((x=(y=le(this,Vr).config).onError)==null?void 0:x.call(y,M,t,this.state.context,this)),await((_=(w=this.options).onError)==null?void 0:_.call(w,M,t,this.state.context)),await((C=(E=le(this,Vr).config).onSettled)==null?void 0:C.call(E,void 0,M,this.state.variables,this.state.context,this)),await((T=(R=this.options).onSettled)==null?void 0:T.call(R,void 0,M,t,this.state.context)),M}finally{Lt(this,Ko,_a).call(this,{type:"error",error:M})}}finally{le(this,Vr).runNext(this)}}},Yo=new WeakMap,Vr=new WeakMap,Ql=new WeakMap,Ko=new WeakSet,_a=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),br.batch(()=>{le(this,Yo).forEach(r=>{r.onMutationUpdate(t)}),le(this,Vr).notify({mutation:this,type:"updated",action:t})})},ZD);function kX(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ws,Eo,sp,JD,AX=(JD=class extends up{constructor(t={}){super();et(this,Ws);et(this,Eo);et(this,sp);this.config=t,ze(this,Ws,new Set),ze(this,Eo,new Map),ze(this,sp,0)}build(t,n,r){const i=new TX({mutationCache:this,mutationId:++Ng(this,sp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){le(this,Ws).add(t);const n=jg(t);if(typeof n=="string"){const r=le(this,Eo).get(n);r?r.push(t):le(this,Eo).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(le(this,Ws).delete(t)){const n=jg(t);if(typeof n=="string"){const r=le(this,Eo).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&le(this,Eo).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=jg(t);if(typeof n=="string"){const r=le(this,Eo).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=jg(t);if(typeof n=="string"){const i=(r=le(this,Eo).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){br.batch(()=>{le(this,Ws).forEach(t=>{this.notify({type:"removed",mutation:t})}),le(this,Ws).clear(),le(this,Eo).clear()})}getAll(){return Array.from(le(this,Ws))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>vk(n,r))}findAll(t={}){return this.getAll().filter(n=>vk(t,n))}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return br.batch(()=>Promise.all(t.map(n=>n.continue().catch(ro))))}},Ws=new WeakMap,Eo=new WeakMap,sp=new WeakMap,JD);function jg(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Sk(e){return{onFetch:(t,n)=>{var u,d,p,h,m;const r=t.options,i=(p=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let b=!1;const y=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},x=RN(t.options,t.fetchOptions),w=async(_,E,C)=>{if(b)return Promise.reject();if(E==null&&_.pages.length)return Promise.resolve(_);const R={queryKey:t.queryKey,pageParam:E,direction:C?"backward":"forward",meta:t.options.meta};y(R);const T=await x(R),{maxPages:M}=t.options,N=C?wX:xX;return{pages:N(_.pages,T,M),pageParams:N(_.pageParams,E,M)}};if(i&&o.length){const _=i==="backward",E=_?OX:_k,C={pages:o,pageParams:s},R=E(r,C);a=await w(C,R,_)}else{const _=e??o.length;do{const E=l===0?s[0]??r.initialPageParam:_k(r,a);if(l>0&&E==null)break;a=await w(a,E),l++}while(l<_)}return a};t.options.persister?t.fetchFn=()=>{var b,y;return(y=(b=t.options).persister)==null?void 0:y.call(b,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function _k(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 OX(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 In,Aa,Oa,Ku,Xu,Ma,Qu,Zu,eN,MX=(eN=class{constructor(e={}){et(this,In);et(this,Aa);et(this,Oa);et(this,Ku);et(this,Xu);et(this,Ma);et(this,Qu);et(this,Zu);ze(this,In,e.queryCache||new MN),ze(this,Aa,e.mutationCache||new AX),ze(this,Oa,e.defaultOptions||{}),ze(this,Ku,new Map),ze(this,Xu,new Map),ze(this,Ma,0)}mount(){Ng(this,Ma)._++,le(this,Ma)===1&&(ze(this,Qu,tC.subscribe(async e=>{e&&(await this.resumePausedMutations(),le(this,In).onFocus())})),ze(this,Zu,mb.subscribe(async e=>{e&&(await this.resumePausedMutations(),le(this,In).onOnline())})))}unmount(){var e,t;Ng(this,Ma)._--,le(this,Ma)===0&&((e=le(this,Qu))==null||e.call(this),ze(this,Qu,void 0),(t=le(this,Zu))==null||t.call(this),ze(this,Zu,void 0))}isFetching(e){return le(this,In).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return le(this,Aa).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=le(this,In).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=le(this,In).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ou(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return le(this,In).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=le(this,In).get(r.queryHash),o=i==null?void 0:i.state.data,s=bX(t,o);if(s!==void 0)return le(this,In).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return br.batch(()=>le(this,In).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=le(this,In).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=le(this,In);br.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=le(this,In),r={type:"active",...e};return br.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=br.batch(()=>le(this,In).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(ro).catch(ro)}invalidateQueries(e,t={}){return br.batch(()=>{if(le(this,In).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=br.batch(()=>le(this,In).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(ro)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(ro)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=le(this,In).build(this,t);return n.isStaleByTime(Ou(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ro).catch(ro)}fetchInfiniteQuery(e){return e.behavior=Sk(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ro).catch(ro)}ensureInfiniteQueryData(e){return e.behavior=Sk(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return mb.isOnline()?le(this,Aa).resumePausedMutations():Promise.resolve()}getQueryCache(){return le(this,In)}getMutationCache(){return le(this,Aa)}getDefaultOptions(){return le(this,Oa)}setDefaultOptions(e){ze(this,Oa,e)}setQueryDefaults(e,t){le(this,Ku).set(Rh(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...le(this,Ku).values()],n={};return t.forEach(r=>{Ph(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){le(this,Xu).set(Rh(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...le(this,Xu).values()];let n={};return t.forEach(r=>{Ph(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...le(this,Oa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=eC(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===gb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...le(this,Oa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){le(this,In).clear(),le(this,Aa).clear()}},In=new WeakMap,Aa=new WeakMap,Oa=new WeakMap,Ku=new WeakMap,Xu=new WeakMap,Ma=new WeakMap,Qu=new WeakMap,Zu=new WeakMap,eN),ui,Ft,ap,Wr,Zl,Ju,Ia,Xo,lp,ed,td,Jl,ec,Da,nd,tn,$f,k1,A1,O1,M1,I1,D1,N1,IN,tN,IX=(tN=class extends up{constructor(t,n){super();et(this,tn);et(this,ui);et(this,Ft);et(this,ap);et(this,Wr);et(this,Zl);et(this,Ju);et(this,Ia);et(this,Xo);et(this,lp);et(this,ed);et(this,td);et(this,Jl);et(this,ec);et(this,Da);et(this,nd,new Set);this.options=n,ze(this,ui,t),ze(this,Xo,null),ze(this,Ia,T1()),this.options.experimental_prefetchInRender||le(this,Ia).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(le(this,Ft).addObserver(this),Ck(le(this,Ft),this.options)?Lt(this,tn,$f).call(this):this.updateResult(),Lt(this,tn,M1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L1(le(this,Ft),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L1(le(this,Ft),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Lt(this,tn,I1).call(this),Lt(this,tn,D1).call(this),le(this,Ft).removeObserver(this)}setOptions(t,n){const r=this.options,i=le(this,Ft);if(this.options=le(this,ui).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ro(this.options.enabled,le(this,Ft))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Lt(this,tn,N1).call(this),le(this,Ft).setOptions(this.options),r._defaulted&&!E1(this.options,r)&&le(this,ui).getQueryCache().notify({type:"observerOptionsUpdated",query:le(this,Ft),observer:this});const o=this.hasListeners();o&&Ek(le(this,Ft),i,this.options,r)&&Lt(this,tn,$f).call(this),this.updateResult(n),o&&(le(this,Ft)!==i||Ro(this.options.enabled,le(this,Ft))!==Ro(r.enabled,le(this,Ft))||Ou(this.options.staleTime,le(this,Ft))!==Ou(r.staleTime,le(this,Ft)))&&Lt(this,tn,k1).call(this);const s=Lt(this,tn,A1).call(this);o&&(le(this,Ft)!==i||Ro(this.options.enabled,le(this,Ft))!==Ro(r.enabled,le(this,Ft))||s!==le(this,Da))&&Lt(this,tn,O1).call(this,s)}getOptimisticResult(t){const n=le(this,ui).getQueryCache().build(le(this,ui),t),r=this.createResult(n,t);return NX(this,r)&&(ze(this,Wr,r),ze(this,Ju,this.options),ze(this,Zl,le(this,Ft).state)),r}getCurrentResult(){return le(this,Wr)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){le(this,nd).add(t)}getCurrentQuery(){return le(this,Ft)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=le(this,ui).defaultQueryOptions(t),r=le(this,ui).getQueryCache().build(le(this,ui),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Lt(this,tn,$f).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),le(this,Wr)))}createResult(t,n){var M;const r=le(this,Ft),i=this.options,o=le(this,Wr),s=le(this,Zl),a=le(this,Ju),c=t!==r?t.state:le(this,ap),{state:u}=t;let d={...u},p=!1,h;if(n._optimisticResults){const N=this.hasListeners(),j=!N&&Ck(t,n),F=N&&Ek(t,r,n,i);(j||F)&&(d={...d,...ON(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:b,status:y}=d;if(n.select&&d.data!==void 0)if(o&&d.data===(s==null?void 0:s.data)&&n.select===le(this,lp))h=le(this,ed);else try{ze(this,lp,n.select),h=n.select(d.data),h=P1(o==null?void 0:o.data,h,n),ze(this,ed,h),ze(this,Xo,null)}catch(N){ze(this,Xo,N)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&y==="pending"){let N;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))N=o.data;else if(N=typeof n.placeholderData=="function"?n.placeholderData((M=le(this,td))==null?void 0:M.state.data,le(this,td)):n.placeholderData,n.select&&N!==void 0)try{N=n.select(N),ze(this,Xo,null)}catch(j){ze(this,Xo,j)}N!==void 0&&(y="success",h=P1(o==null?void 0:o.data,N,n),p=!0)}le(this,Xo)&&(m=le(this,Xo),h=le(this,ed),b=Date.now(),y="error");const x=d.fetchStatus==="fetching",w=y==="pending",_=y==="error",E=w&&x,C=h!==void 0,T={status:y,fetchStatus:d.fetchStatus,isPending:w,isSuccess:y==="success",isError:_,isInitialLoading:E,isLoading:E,data:h,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:b,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:_&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&C,isStale:nC(t,n),refetch:this.refetch,promise:le(this,Ia)};if(this.options.experimental_prefetchInRender){const N=$=>{T.status==="error"?$.reject(T.error):T.data!==void 0&&$.resolve(T.data)},j=()=>{const $=ze(this,Ia,T.promise=T1());N($)},F=le(this,Ia);switch(F.status){case"pending":t.queryHash===r.queryHash&&N(F);break;case"fulfilled":(T.status==="error"||T.data!==F.value)&&j();break;case"rejected":(T.status!=="error"||T.error!==F.reason)&&j();break}}return T}updateResult(t){const n=le(this,Wr),r=this.createResult(le(this,Ft),this.options);if(ze(this,Zl,le(this,Ft).state),ze(this,Ju,this.options),le(this,Zl).data!==void 0&&ze(this,td,le(this,Ft)),E1(r,n))return;ze(this,Wr,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!le(this,nd).size)return!0;const l=new Set(a??le(this,nd));return this.options.throwOnError&&l.add("error"),Object.keys(le(this,Wr)).some(c=>{const u=c;return le(this,Wr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),Lt(this,tn,IN).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Lt(this,tn,M1).call(this)}},ui=new WeakMap,Ft=new WeakMap,ap=new WeakMap,Wr=new WeakMap,Zl=new WeakMap,Ju=new WeakMap,Ia=new WeakMap,Xo=new WeakMap,lp=new WeakMap,ed=new WeakMap,td=new WeakMap,Jl=new WeakMap,ec=new WeakMap,Da=new WeakMap,nd=new WeakMap,tn=new WeakSet,$f=function(t){Lt(this,tn,N1).call(this);let n=le(this,Ft).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ro)),n},k1=function(){Lt(this,tn,I1).call(this);const t=Ou(this.options.staleTime,le(this,Ft));if(vc||le(this,Wr).isStale||!_1(t))return;const r=EN(le(this,Wr).dataUpdatedAt,t)+1;ze(this,Jl,setTimeout(()=>{le(this,Wr).isStale||this.updateResult()},r))},A1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(le(this,Ft)):this.options.refetchInterval)??!1},O1=function(t){Lt(this,tn,D1).call(this),ze(this,Da,t),!(vc||Ro(this.options.enabled,le(this,Ft))===!1||!_1(le(this,Da))||le(this,Da)===0)&&ze(this,ec,setInterval(()=>{(this.options.refetchIntervalInBackground||tC.isFocused())&&Lt(this,tn,$f).call(this)},le(this,Da)))},M1=function(){Lt(this,tn,k1).call(this),Lt(this,tn,O1).call(this,Lt(this,tn,A1).call(this))},I1=function(){le(this,Jl)&&(clearTimeout(le(this,Jl)),ze(this,Jl,void 0))},D1=function(){le(this,ec)&&(clearInterval(le(this,ec)),ze(this,ec,void 0))},N1=function(){const t=le(this,ui).getQueryCache().build(le(this,ui),this.options);if(t===le(this,Ft))return;const n=le(this,Ft);ze(this,Ft,t),ze(this,ap,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},IN=function(t){br.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(le(this,Wr))}),le(this,ui).getQueryCache().notify({query:le(this,Ft),type:"observerResultsUpdated"})})},tN);function DX(e,t){return Ro(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ck(e,t){return DX(e,t)||e.state.data!==void 0&&L1(e,t,t.refetchOnMount)}function L1(e,t,n){if(Ro(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&nC(e,t)}return!1}function Ek(e,t,n,r){return(e!==t||Ro(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&nC(e,n)}function nC(e,t){return Ro(t.enabled,e)!==!1&&e.isStaleByTime(Ou(t.staleTime,e))}function NX(e,t){return!E1(e.getCurrentResult(),t)}var rC=P.createContext(void 0),iC=e=>{const t=P.useContext(rC);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},LX=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(rC.Provider,{value:e,children:t})),DN=P.createContext(!1),FX=()=>P.useContext(DN);DN.Provider;function jX(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $X=P.createContext(jX()),zX=()=>P.useContext($X);function BX(e,t){return typeof e=="function"?e(...t):!!e}function Rk(){}var HX=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},VX=e=>{P.useEffect(()=>{e.clearReset()},[e])},WX=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&BX(n,[e.error,r]),UX=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)))},GX=(e,t)=>e.isLoading&&e.isFetching&&!t,qX=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Pk=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function YX(e,t,n){var d,p,h,m,b;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=iC(),i=FX(),o=zX(),s=r.defaultQueryOptions(e);(p=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||p.call(d,s),s._optimisticResults=i?"isRestoring":"optimistic",UX(s),HX(s,o),VX(o);const a=!r.getQueryCache().get(s.queryHash),[l]=P.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!i&&e.subscribed!==!1;if(P.useSyncExternalStore(P.useCallback(y=>{const x=u?l.subscribe(br.batchCalls(y)):Rk;return l.updateResult(),x},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),P.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),qX(s,c))throw Pk(s,l,o);if(WX({result:c,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw c.error;if((m=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||m.call(h,s,c),s.experimental_prefetchInRender&&!vc&&GX(c,i)){const y=a?Pk(s,l,o):(b=r.getQueryCache().get(s.queryHash))==null?void 0:b.promise;y==null||y.catch(Rk).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function dp(e,t){return YX(e,IX)}function KX(){const e=k.useContext(rC);if(e&&e.isSemaphorClient)return e}function NN({children:e}){const{setIsSessionExpired:t}=Vn(),n=KX(),[r]=k.useState(()=>{const i=new MX({queryCache:new MN({onError:o=>{o instanceof Error?(console.error(`Something went wrong: ${o.message}`),o.message==="invalid token"&&t(!0)):console.error("Something went wrong:",o)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return i.isSemaphorClient=!0,i});return n?v.jsx(v.Fragment,{children:e}):v.jsx(LX,{client:r,children:e})}const Dc=k.forwardRef(({children:e,className:t,...n},r)=>v.jsx("div",{className:me("semaphor-scope",t),ref:r,...n,children:e})),XX={id:"",authToken:void 0},LN=k.createContext(XX),FN=({children:e,dashboardProps:t})=>v.jsx(NN,{children:v.jsx(LN.Provider,{value:t,children:v.jsx(Dc,{style:{height:"100%"},children:e})})});function Wi(){const e=k.useContext(LN);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function QX(){const{authToken:e,version:t}=Wi(),n=ye(a=>a.selectedLensId),{data:r,isLoading:i,isFetching:o,isError:s}=dp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>hX(e==null?void 0:e.accessToken,{lensId:n,version:t}),enabled:!!(e!=null&&e.accessToken)});return{data:r,isLoading:i,isFetching:o,isError:s}}function ZX(){const{authToken:e}=Wi(),t=ye(r=>r.authToken),{setAuthToken:n}=Vn();return k.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}function jN(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function Tk(e,t){const n=jN(e);return n==="dark"?tc.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function JX({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:i,selectedSheetId:o,onFilterValuesChange:s}){const{authToken:a}=Wi();ZX();const l=ye(G=>G.selectedLensId),{data:c,isLoading:u,isFetching:d,isError:p}=QX(),[h,m]=k.useState(i||[]),{theme:b,setTheme:y}=CN(),x=ye(G=>G.dashboard.globalStyle),{setDashboard:w,setDashboardWithFilterValues:_,setSelectedSheetId:E,setStyle:C,setOnSaveFunction:R,setLenses:T,setSelectedLensId:M,setInitStore:N}=Vn();ye(G=>G.actions.setCustomCards);const j=ye(G=>G.actions.setFilterValues),F=ye(G=>G.filterValues),$=ye(G=>G.actions.setThemeStyle),Q=ye(G=>G.actions.setDashboardTheme),H=ye(G=>G.actions.setOnEvent);k.useEffect(()=>{a&&N()},[a,N]),k.useEffect(()=>{if(b){const G=jN(b);Q(G)}},[b,Q]),k.useEffect(()=>{t&&y(t)},[t,y]);const L=k.useCallback(()=>{const G=tc.cloneDeep(hb),V=tc.merge(G,x);if(e){const B=tc.merge(V,e),X=Tk(b,B);$(X),C(B)}else{const B=Tk(b,V);$(B),C(hb)}},[b,e,x,$,C]);return k.useEffect(()=>{c&&c.dashboard&&L()},[b,e,x,L,c]),k.useEffect(()=>{var U,O;function G(ee,K){const oe=ee.filters||[],Y=[];for(const J of K){const se=oe.find(ae=>ae.id===J.filterId);se&&Y.push({filterId:J.filterId,connectionType:se.database==="NA"?"api":"database",name:se.column,operation:se.operation,valueType:Au(se),values:J.values})}return Y}if(!c||!c.dashboard)return;const{dashboard:V,filterValues:B,defaultLensId:X,lenses:I}=c,q=G(V,h||[]);_(V,(!B||(B==null?void 0:B.length)===0?q:B)||[]),X&&M(X),I&&T(I),E(o||((O=(U=V==null?void 0:V.sheets)==null?void 0:U[0])==null?void 0:O.id)||null)},[c,w,E,j,l,T,_,M,h,o]),k.useEffect(()=>{s&&F&&s(F)},[F,s]),k.useEffect(()=>{n&&R(n),r&&H(r)},[n,R,r,H]),{isFetching:d,isLoading:u,isError:p}}function Mu({className:e,...t}){return v.jsx("div",{className:me("animate-pulse rounded-md bg-muted",e),...t})}const $N=P.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:me("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));$N.displayName="Card";const Py=P.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-6",e),...t}));Py.displayName="CardHeader";const Ad=P.forwardRef(({className:e,...t},n)=>v.jsx("h3",{ref:n,className:me("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ad.displayName="CardTitle";const oC=P.forwardRef(({className:e,...t},n)=>v.jsx("p",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));oC.displayName="CardDescription";const Ty=P.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:me("px-6 pt-0",e),...t}));Ty.displayName="CardContent";const zN=P.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));zN.displayName="CardFooter";function BN({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:p,defaultFilterValues:h,onFilterValuesChange:m,selectedSheetId:b,...y}){const{placeholders:x}=Wi(),w=ye(R=>R.themeStyle),_=ye(R=>R.isSessionExpired),{isLoading:E,isError:C}=JX({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:h,onFilterValuesChange:m,selectedSheetId:b});return E||!l?(r==null||r({type:"info",message:"Loading dashboard"}),i?v.jsx(i,{message:"loading"}):v.jsx("div",{className:"flex items-center gap-3",children:v.jsx(Mu,{className:"h-1 w-full dark:h-[2px]"})})):C?(r==null||r({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),v.jsx(o,{})):v.jsx("div",{children:"Error"})):_?(r==null||r({type:"error",message:"Session Expired"}),x!=null&&x.SessionExpired?v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsx("div",{children:x.SessionExpired})}):v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[v.jsx(Ad,{children:"Session Expired"}),v.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):v.jsx("div",{className:me("flex h-full flex-col justify-between",w==null?void 0:w.dashboardPanel,e),style:{},role:"dashboard-panel",...y})}function Pe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function eQ(e,t){const n=P.createContext(t),r=o=>{const{children:s,...a}=o,l=P.useMemo(()=>a,Object.values(a));return v.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=P.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function rr(e,t=[]){let n=[];function r(o,s){const a=P.createContext(s),l=n.length;n=[...n,s];const c=d=>{var x;const{scope:p,children:h,...m}=d,b=((x=p==null?void 0:p[e])==null?void 0:x[l])||a,y=P.useMemo(()=>m,Object.values(m));return v.jsx(b.Provider,{value:y,children:h})};c.displayName=o+"Provider";function u(d,p){var b;const h=((b=p==null?void 0:p[e])==null?void 0:b[l])||a,m=P.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(s=>P.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return P.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,tQ(i,...t)]}function tQ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...a,...d}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function kk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ky(...e){return t=>{let n=!1;const r=e.map(i=>{const o=kk(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():kk(e[i],null)}}}}function it(...e){return P.useCallback(ky(...e),e)}var ea=P.forwardRef((e,t)=>{const{children:n,...r}=e,i=P.Children.toArray(n),o=i.find(nQ);if(o){const s=o.props.children,a=i.map(l=>l===o?P.Children.count(s)>1?P.Children.only(null):P.isValidElement(s)?s.props.children:null:l);return v.jsx(F1,{...r,ref:t,children:P.isValidElement(s)?P.cloneElement(s,void 0,a):null})}return v.jsx(F1,{...r,ref:t,children:n})});ea.displayName="Slot";var F1=P.forwardRef((e,t)=>{const{children:n,...r}=e;if(P.isValidElement(n)){const i=iQ(n);return P.cloneElement(n,{...rQ(r,n.props),ref:t?ky(t,i):i})}return P.Children.count(n)>1?P.Children.only(null):null});F1.displayName="SlotClone";var sC=({children:e})=>v.jsx(v.Fragment,{children:e});function nQ(e){return P.isValidElement(e)&&e.type===sC}function rQ(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function iQ(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ay(e){const t=e+"CollectionProvider",[n,r]=rr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:m,children:b}=h,y=k.useRef(null),x=k.useRef(new Map).current;return v.jsx(i,{scope:m,itemMap:x,collectionRef:y,children:b})};s.displayName=t;const a=e+"CollectionSlot",l=k.forwardRef((h,m)=>{const{scope:b,children:y}=h,x=o(a,b),w=it(m,x.collectionRef);return v.jsx(ea,{ref:w,children:y})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=k.forwardRef((h,m)=>{const{scope:b,children:y,...x}=h,w=k.useRef(null),_=it(m,w),E=o(c,b);return k.useEffect(()=>(E.itemMap.set(w,{ref:w,...x}),()=>void E.itemMap.delete(w))),v.jsx(ea,{[u]:"",ref:_,children:y})});d.displayName=c;function p(h){const m=o(e+"CollectionConsumer",h);return k.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const x=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((E,C)=>x.indexOf(E.ref.current)-x.indexOf(C.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},p,r]}var yr=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},oQ=P.useId||(()=>{}),sQ=0;function Yn(e){const[t,n]=P.useState(oQ());return yr(()=>{e||n(r=>r??String(sQ++))},[e]),e||(t?`radix-${t}`:"")}var aQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Fe=aQ.reduce((e,t)=>{const n=P.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?ea:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(a,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function HN(e,t){e&&mc.flushSync(()=>e.dispatchEvent(t))}function tr(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Dr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=lQ({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=tr(n),l=P.useCallback(c=>{if(o){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else i(c)},[o,e,i,a]);return[s,l]}function lQ({defaultProp:e,onChange:t}){const n=P.useState(e),[r]=n,i=P.useRef(r),o=tr(t);return P.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var cQ=P.createContext(void 0);function Nc(e){const t=P.useContext(cQ);return e||t||"ltr"}var vx="rovingFocusGroup.onEntryFocus",uQ={bubbles:!1,cancelable:!0},Oy="RovingFocusGroup",[j1,VN,dQ]=Ay(Oy),[fQ,Od]=rr(Oy,[dQ]),[hQ,pQ]=fQ(Oy),WN=P.forwardRef((e,t)=>v.jsx(j1.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(j1.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(gQ,{...e,ref:t})})}));WN.displayName=Oy;var gQ=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,p=P.useRef(null),h=it(t,p),m=Nc(o),[b=null,y]=Dr({prop:s,defaultProp:a,onChange:l}),[x,w]=P.useState(!1),_=tr(c),E=VN(n),C=P.useRef(!1),[R,T]=P.useState(0);return P.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(vx,_),()=>M.removeEventListener(vx,_)},[_]),v.jsx(hQ,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:b,onItemFocus:P.useCallback(M=>y(M),[y]),onItemShiftTab:P.useCallback(()=>w(!0),[]),onFocusableItemAdd:P.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:P.useCallback(()=>T(M=>M-1),[]),children:v.jsx(Fe.div,{tabIndex:x||R===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Pe(e.onMouseDown,()=>{C.current=!0}),onFocus:Pe(e.onFocus,M=>{const N=!C.current;if(M.target===M.currentTarget&&N&&!x){const j=new CustomEvent(vx,uQ);if(M.currentTarget.dispatchEvent(j),!j.defaultPrevented){const F=E().filter(G=>G.focusable),$=F.find(G=>G.active),Q=F.find(G=>G.id===b),L=[$,Q,...F].filter(Boolean).map(G=>G.ref.current);qN(L,u)}}C.current=!1}),onBlur:Pe(e.onBlur,()=>w(!1))})})}),UN="RovingFocusGroupItem",GN=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=Yn(),l=o||a,c=pQ(UN,n),u=c.currentTabStopId===l,d=VN(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return P.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),v.jsx(j1.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:v.jsx(Fe.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Pe(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Pe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Pe(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const b=yQ(m,c.orientation,c.dir);if(b!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=d().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const w=x.indexOf(m.currentTarget);x=c.loop?vQ(x,w+1):x.slice(w+1)}setTimeout(()=>qN(x))}})})})});GN.displayName=UN;var mQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function bQ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yQ(e,t,n){const r=bQ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return mQ[r]}function qN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function vQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aC=WN,lC=GN;function xQ(e,t){return P.useReducer((n,r)=>t[n][r]??n,e)}var Kn=e=>{const{present:t,children:n}=e,r=wQ(t),i=typeof n=="function"?n({present:r.isPresent}):P.Children.only(n),o=it(r.ref,SQ(i));return typeof n=="function"||r.isPresent?P.cloneElement(i,{ref:o}):null};Kn.displayName="Presence";function wQ(e){const[t,n]=P.useState(),r=P.useRef({}),i=P.useRef(e),o=P.useRef("none"),s=e?"mounted":"unmounted",[a,l]=xQ(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const c=$g(r.current);o.current=a==="mounted"?c:"none"},[a]),yr(()=>{const c=r.current,u=i.current;if(u!==e){const p=o.current,h=$g(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),yr(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const b=$g(r.current).includes(h.animationName);if(h.target===t&&b&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=h=>{h.target===t&&(o.current=$g(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:P.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function $g(e){return(e==null?void 0:e.animationName)||"none"}function SQ(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cC="Tabs",[_Q,DAe]=rr(cC,[Od]),YN=Od(),[CQ,uC]=_Q(cC),KN=P.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Nc(a),[d,p]=Dr({prop:r,onChange:i,defaultProp:o});return v.jsx(CQ,{scope:n,baseId:Yn(),value:d,onValueChange:p,orientation:s,dir:u,activationMode:l,children:v.jsx(Fe.div,{dir:u,"data-orientation":s,...c,ref:t})})});KN.displayName=cC;var XN="TabsList",QN=P.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=uC(XN,n),s=YN(n);return v.jsx(aC,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:v.jsx(Fe.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});QN.displayName=XN;var ZN="TabsTrigger",JN=P.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=uC(ZN,n),a=YN(n),l=n5(s.baseId,r),c=r5(s.baseId,r),u=r===s.value;return v.jsx(lC,{asChild:!0,...a,focusable:!i,active:u,children:v.jsx(Fe.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...o,ref:t,onMouseDown:Pe(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:Pe(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:Pe(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!i&&d&&s.onValueChange(r)})})})});JN.displayName=ZN;var e5="TabsContent",t5=P.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=uC(e5,n),l=n5(a.baseId,r),c=r5(a.baseId,r),u=r===a.value,d=P.useRef(u);return P.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),v.jsx(Kn,{present:i||u,children:({present:p})=>v.jsx(Fe.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&o})})});t5.displayName=e5;function n5(e,t){return`${e}-trigger-${t}`}function r5(e,t){return`${e}-content-${t}`}var EQ=KN,i5=QN,o5=JN,s5=t5;const dC=EQ,My=P.forwardRef(({className:e,...t},n)=>v.jsx(i5,{ref:n,className:me("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));My.displayName=i5.displayName;const Iy=P.forwardRef(({className:e,...t},n)=>v.jsx(o5,{ref:n,className:me("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Iy.displayName=o5.displayName;const fC=P.forwardRef(({className:e,...t},n)=>v.jsx(s5,{ref:n,className:me("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));fC.displayName=s5.displayName;var a5={exports:{}},fp={},$1={exports:{}};(function(e,t){(function(n,r){r(t)})(Ra,function(n){function r(J){return function(ae,ge,ne,fe,he,_e,Ae){return J(ae,ge,Ae)}}function i(J){return function(ae,ge,ne,fe){if(!ae||!ge||typeof ae!="object"||typeof ge!="object")return J(ae,ge,ne,fe);var he=fe.get(ae),_e=fe.get(ge);if(he&&_e)return he===ge&&_e===ae;fe.set(ae,ge),fe.set(ge,ae);var Ae=J(ae,ge,ne,fe);return fe.delete(ae),fe.delete(ge),Ae}}function o(J,se){var ae={};for(var ge in J)ae[ge]=J[ge];for(var ge in se)ae[ge]=se[ge];return ae}function s(J){return J.constructor===Object||J.constructor==null}function a(J){return typeof J.then=="function"}function l(J,se){return J===se||J!==J&&se!==se}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",p="[object RegExp]",h="[object Map]",m="[object Number]",b="[object Object]",y="[object Set]",x="[object String]",w=Object.prototype.toString;function _(J){var se=J.areArraysEqual,ae=J.areDatesEqual,ge=J.areMapsEqual,ne=J.areObjectsEqual,fe=J.areRegExpsEqual,he=J.areSetsEqual,_e=J.createIsNestedEqual,Ae=_e(Le);function Le(ke,Be,dt){if(ke===Be)return!0;if(!ke||!Be||typeof ke!="object"||typeof Be!="object")return ke!==ke&&Be!==Be;if(s(ke)&&s(Be))return ne(ke,Be,Ae,dt);var Ct=Array.isArray(ke),an=Array.isArray(Be);if(Ct||an)return Ct===an&&se(ke,Be,Ae,dt);var mt=w.call(ke);return mt!==w.call(Be)?!1:mt===d?ae(ke,Be,Ae,dt):mt===p?fe(ke,Be,Ae,dt):mt===h?ge(ke,Be,Ae,dt):mt===y?he(ke,Be,Ae,dt):mt===b||mt===c?a(ke)||a(Be)?!1:ne(ke,Be,Ae,dt):mt===u||mt===m||mt===x?l(ke.valueOf(),Be.valueOf()):!1}return Le}function E(J,se,ae,ge){var ne=J.length;if(se.length!==ne)return!1;for(;ne-- >0;)if(!ae(J[ne],se[ne],ne,ne,J,se,ge))return!1;return!0}var C=i(E);function R(J,se){return l(J.valueOf(),se.valueOf())}function T(J,se,ae,ge){var ne=J.size===se.size;if(!ne)return!1;if(!J.size)return!0;var fe={},he=0;return J.forEach(function(_e,Ae){if(ne){var Le=!1,ke=0;se.forEach(function(Be,dt){!Le&&!fe[ke]&&(Le=ae(Ae,dt,he,ke,J,se,ge)&&ae(_e,Be,Ae,dt,J,se,ge))&&(fe[ke]=!0),ke++}),he++,ne=Le}}),ne}var M=i(T),N="_owner",j=Object.prototype.hasOwnProperty;function F(J,se,ae,ge){var ne=Object.keys(J),fe=ne.length;if(Object.keys(se).length!==fe)return!1;for(var he;fe-- >0;){if(he=ne[fe],he===N){var _e=!!J.$$typeof,Ae=!!se.$$typeof;if((_e||Ae)&&_e!==Ae)return!1}if(!j.call(se,he)||!ae(J[he],se[he],he,he,J,se,ge))return!1}return!0}var $=i(F);function Q(J,se){return J.source===se.source&&J.flags===se.flags}function H(J,se,ae,ge){var ne=J.size===se.size;if(!ne)return!1;if(!J.size)return!0;var fe={};return J.forEach(function(he,_e){if(ne){var Ae=!1,Le=0;se.forEach(function(ke,Be){!Ae&&!fe[Le]&&(Ae=ae(he,ke,_e,Be,J,se,ge))&&(fe[Le]=!0),Le++}),ne=Ae}}),ne}var L=i(H),G=Object.freeze({areArraysEqual:E,areDatesEqual:R,areMapsEqual:T,areObjectsEqual:F,areRegExpsEqual:Q,areSetsEqual:H,createIsNestedEqual:r}),V=Object.freeze({areArraysEqual:C,areDatesEqual:R,areMapsEqual:M,areObjectsEqual:$,areRegExpsEqual:Q,areSetsEqual:L,createIsNestedEqual:r}),B=_(G);function X(J,se){return B(J,se,void 0)}var I=_(o(G,{createIsNestedEqual:function(){return l}}));function q(J,se){return I(J,se,void 0)}var U=_(V);function O(J,se){return U(J,se,new WeakMap)}var ee=_(o(V,{createIsNestedEqual:function(){return l}}));function K(J,se){return ee(J,se,new WeakMap)}function oe(J){return _(o(G,J(G)))}function Y(J){var se=_(o(V,J(V)));return function(ae,ge,ne){return ne===void 0&&(ne=new WeakMap),se(ae,ge,ne)}}n.circularDeepEqual=O,n.circularShallowEqual=K,n.createCustomCircularEqual=Y,n.createCustomEqual=oe,n.deepEqual=X,n.sameValueZeroEqual=l,n.shallowEqual=q,Object.defineProperty(n,"__esModule",{value:!0})})})($1,$1.exports);var hC=$1.exports;const pC=z_(BY);var Pt={},RQ=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(Pt,"__esModule",{value:!0});Pt.bottom=gC;Pt.childrenEqual=AQ;Pt.cloneLayout=l5;Pt.cloneLayoutItem=nc;Pt.collides=Dy;Pt.compact=u5;Pt.compactItem=d5;Pt.compactType=VQ;Pt.correctBounds=f5;Pt.fastPositionEqual=OQ;Pt.fastRGLPropsEqual=void 0;Pt.getAllCollisions=h5;Pt.getFirstCollision=zl;Pt.getLayoutItem=mC;Pt.getStatics=bC;Pt.modifyLayout=c5;Pt.moveElement=Bf;Pt.moveElementAwayFromCollision=B1;Pt.noop=void 0;Pt.perc=IQ;Pt.resizeItemInDirection=$Q;Pt.setTopLeft=BQ;Pt.setTransform=zQ;Pt.sortLayoutItems=_C;Pt.sortLayoutItemsByColRow=y5;Pt.sortLayoutItemsByRowCol=b5;Pt.synchronizeLayoutWithChildren=HQ;Pt.validateLayout=v5;Pt.withLayoutItem=kQ;var Ak=hC,zf=PQ(k);function PQ(e){return e&&e.__esModule?e:{default:e}}const TQ=process.env.NODE_ENV==="production";function gC(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function l5(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=nc(e[n]);return t}function c5(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function kQ(e,t,n){let r=mC(e,t);return r?(r=n(nc(r)),e=c5(e,r),[e,r]):[e,null]}function nc(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 AQ(e,t){return(0,Ak.deepEqual)(zf.default.Children.map(e,n=>n==null?void 0:n.key),zf.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,Ak.deepEqual)(zf.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),zf.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Pt.fastRGLPropsEqual=RQ;function OQ(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Dy(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 u5(e,t,n,r){const i=bC(e),o=_C(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=nc(o[a]);c.static||(c=d5(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const MQ={x:"w",y:"h"};function z1(e,t,n,r){const i=MQ[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Dy(t,a)&&z1(e,a,n+t[i],r)}}t[r]=n}function d5(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(gC(e),t.y);t.y>0&&!zl(e,t);)t.y--;else if(a)for(;t.x>0&&!zl(e,t);)t.x--;let l;for(;(l=zl(e,t))&&!(n===null&&o);)if(a?z1(i,t,l.x+l.w,"x"):z1(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!zl(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function f5(e,t){const n=bC(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;zl(n,o);)o.y++}return e}function mC(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function zl(e,t){for(let n=0,r=e.length;n<r;n++)if(Dy(e[n],t))return e[n]}function h5(e,t){return e.filter(n=>Dy(n,t))}function bC(e){return e.filter(t=>t.static)}function Bf(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=_C(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=h5(d,t),m=h.length>0;if(m&&l)return l5(e);if(m&&o)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let b=0,y=h.length;b<y;b++){const x=h[b];`${t.i}${t.x}${t.y}${x.i}${x.x}${x.y}`,!x.moved&&(x.static?e=B1(e,x,t,i,s):e=B1(e,t,x,i,s))}return e}function B1(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const d={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},p=zl(e,d),h=p&&p.y+p.h>t.y,m=p&&t.x+t.w>p.x;if(p){if(h&&a)return Bf(e,n,void 0,t.y+1,r,l,i);if(h&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(m&&s)return Bf(e,t,n.x,void 0,r,l,i)}else return`${n.i}${d.x}${d.y}`,Bf(e,n,s?d.x:void 0,a?d.y:void 0,r,l,i)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:Bf(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function IQ(e){return e*100+"%"}const p5=(e,t,n,r)=>e+n>r?t:n,g5=(e,t,n)=>e<0?t:n,m5=e=>Math.max(0,e),yC=e=>Math.max(0,e),vC=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:g5(s,e.height,i),top:yC(s)}},xC=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:p5(e.left,e.width,s,n),left:m5(i)}},wC=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:p5(e.left,e.width,o,n),top:yC(r),left:m5(s)}},SC=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:g5(r,e.height,o),top:yC(r)}},DQ=function(){return vC(arguments.length<=0?void 0:arguments[0],xC(...arguments))},NQ=function(){return vC(arguments.length<=0?void 0:arguments[0],wC(...arguments))},LQ=function(){return SC(arguments.length<=0?void 0:arguments[0],xC(...arguments))},FQ=function(){return SC(arguments.length<=0?void 0:arguments[0],wC(...arguments))},jQ={n:vC,ne:DQ,e:xC,se:LQ,s:SC,sw:FQ,w:wC,nw:NQ};function $Q(e,t,n,r){const i=jQ[e];return i?i(t,{...t,...n},r):n}function zQ(e){let{top:t,left:n,width:r,height:i}=e;const o=`translate(${n}px,${t}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${r}px`,height:`${i}px`,position:"absolute"}}function BQ(e){let{top:t,left:n,width:r,height:i}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${i}px`,position:"absolute"}}function _C(e,t){return t==="horizontal"?y5(e):t==="vertical"?b5(e):e}function b5(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 y5(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 HQ(e,t,n,r,i){e=e||[];const o=[];zf.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=mC(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(nc(l)):c?(TQ||v5([c],"ReactGridLayout.children"),o.push(nc({...c,i:a.key}))):o.push(nc({w:1,h:1,x:0,y:gC(o),i:String(a.key)}))});const s=f5(o,{cols:n});return i?s:u5(s,r,n)}function v5(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=o[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof o.i<"u"&&typeof o.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${o.i} (${typeof o.i})`)}}function VQ(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const WQ=()=>{};Pt.noop=WQ;var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.calcGridColWidth=Ny;ms.calcGridItemPosition=UQ;ms.calcGridItemWHPx=H1;ms.calcWH=qQ;ms.calcXY=GQ;ms.clamp=Bl;function Ny(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function H1(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function UQ(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Ny(e),u={};return o&&o.resizing?(u.width=Math.round(o.resizing.width),u.height=Math.round(o.resizing.height)):(u.width=H1(r,c,s[0]),u.height=H1(i,l,s[1])),o&&o.dragging?(u.top=Math.round(o.dragging.top),u.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(u.top=Math.round(o.resizing.top),u.left=Math.round(o.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function GQ(e,t,n,r,i){const{margin:o,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=Ny(e);let d=Math.round((n-s[0])/(u+o[0])),p=Math.round((t-s[1])/(l+o[1]));return d=Bl(d,0,a-r),p=Bl(p,0,c-i),{x:d,y:p}}function qQ(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=Ny(e);let d=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),h=Bl(d,0,l-r),m=Bl(p,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(h=Bl(d,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(m=Bl(p,0,a)),{w:h,h:m}}function Bl(e,t,n){return Math.max(Math.min(e,n),t)}var Ly={},V1={exports:{}},zg={exports:{}},Zt={};/** @license React v16.13.1
92
- * react-is.production.min.js
93
- *
94
- * Copyright (c) Facebook, Inc. and its affiliates.
95
- *
96
- * This source code is licensed under the MIT license found in the
97
- * LICENSE file in the root directory of this source tree.
98
- */var Ok;function YQ(){if(Ok)return Zt;Ok=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,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function _(C){if(typeof C=="object"&&C!==null){var R=C.$$typeof;switch(R){case t:switch(C=C.type,C){case l:case c:case r:case o:case i:case d:return C;default:switch(C=C&&C.$$typeof,C){case a:case u:case m:case h:case s:return C;default:return R}}case n:return R}}}function E(C){return _(C)===c}return Zt.AsyncMode=l,Zt.ConcurrentMode=c,Zt.ContextConsumer=a,Zt.ContextProvider=s,Zt.Element=t,Zt.ForwardRef=u,Zt.Fragment=r,Zt.Lazy=m,Zt.Memo=h,Zt.Portal=n,Zt.Profiler=o,Zt.StrictMode=i,Zt.Suspense=d,Zt.isAsyncMode=function(C){return E(C)||_(C)===l},Zt.isConcurrentMode=E,Zt.isContextConsumer=function(C){return _(C)===a},Zt.isContextProvider=function(C){return _(C)===s},Zt.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===t},Zt.isForwardRef=function(C){return _(C)===u},Zt.isFragment=function(C){return _(C)===r},Zt.isLazy=function(C){return _(C)===m},Zt.isMemo=function(C){return _(C)===h},Zt.isPortal=function(C){return _(C)===n},Zt.isProfiler=function(C){return _(C)===o},Zt.isStrictMode=function(C){return _(C)===i},Zt.isSuspense=function(C){return _(C)===d},Zt.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===r||C===c||C===o||C===i||C===d||C===p||typeof C=="object"&&C!==null&&(C.$$typeof===m||C.$$typeof===h||C.$$typeof===s||C.$$typeof===a||C.$$typeof===u||C.$$typeof===y||C.$$typeof===x||C.$$typeof===w||C.$$typeof===b)},Zt.typeOf=_,Zt}var Jt={};/** @license React v16.13.1
99
- * react-is.development.js
100
- *
101
- * Copyright (c) Facebook, Inc. and its affiliates.
102
- *
103
- * This source code is licensed under the MIT license found in the
104
- * LICENSE file in the root directory of this source tree.
105
- */var Mk;function KQ(){return Mk||(Mk=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function _(ne){return typeof ne=="string"||typeof ne=="function"||ne===r||ne===c||ne===o||ne===i||ne===d||ne===p||typeof ne=="object"&&ne!==null&&(ne.$$typeof===m||ne.$$typeof===h||ne.$$typeof===s||ne.$$typeof===a||ne.$$typeof===u||ne.$$typeof===y||ne.$$typeof===x||ne.$$typeof===w||ne.$$typeof===b)}function E(ne){if(typeof ne=="object"&&ne!==null){var fe=ne.$$typeof;switch(fe){case t:var he=ne.type;switch(he){case l:case c:case r:case o:case i:case d:return he;default:var _e=he&&he.$$typeof;switch(_e){case a:case u:case m:case h:case s:return _e;default:return fe}}case n:return fe}}}var C=l,R=c,T=a,M=s,N=t,j=u,F=r,$=m,Q=h,H=n,L=o,G=i,V=d,B=!1;function X(ne){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),I(ne)||E(ne)===l}function I(ne){return E(ne)===c}function q(ne){return E(ne)===a}function U(ne){return E(ne)===s}function O(ne){return typeof ne=="object"&&ne!==null&&ne.$$typeof===t}function ee(ne){return E(ne)===u}function K(ne){return E(ne)===r}function oe(ne){return E(ne)===m}function Y(ne){return E(ne)===h}function J(ne){return E(ne)===n}function se(ne){return E(ne)===o}function ae(ne){return E(ne)===i}function ge(ne){return E(ne)===d}Jt.AsyncMode=C,Jt.ConcurrentMode=R,Jt.ContextConsumer=T,Jt.ContextProvider=M,Jt.Element=N,Jt.ForwardRef=j,Jt.Fragment=F,Jt.Lazy=$,Jt.Memo=Q,Jt.Portal=H,Jt.Profiler=L,Jt.StrictMode=G,Jt.Suspense=V,Jt.isAsyncMode=X,Jt.isConcurrentMode=I,Jt.isContextConsumer=q,Jt.isContextProvider=U,Jt.isElement=O,Jt.isForwardRef=ee,Jt.isFragment=K,Jt.isLazy=oe,Jt.isMemo=Y,Jt.isPortal=J,Jt.isProfiler=se,Jt.isStrictMode=ae,Jt.isSuspense=ge,Jt.isValidElementType=_,Jt.typeOf=E}()),Jt}var Ik;function x5(){return Ik||(Ik=1,process.env.NODE_ENV==="production"?zg.exports=YQ():zg.exports=KQ()),zg.exports}/*
106
- object-assign
107
- (c) Sindre Sorhus
108
- @license MIT
109
- */var xx,Dk;function XQ(){if(Dk)return xx;Dk=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return xx=i()?Object.assign:function(o,s){for(var a,l=r(o),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var p=0;p<c.length;p++)n.call(a,c[p])&&(l[c[p]]=a[c[p]])}}return l},xx}var wx,Nk;function CC(){if(Nk)return wx;Nk=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return wx=e,wx}var Sx,Lk;function w5(){return Lk||(Lk=1,Sx=Function.call.bind(Object.prototype.hasOwnProperty)),Sx}var _x,Fk;function QQ(){if(Fk)return _x;Fk=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=CC(),n={},r=w5();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var d;try{if(typeof o[u]!="function"){var p=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}d=o[u](s,u,l,a,null,t)}catch(m){d=m}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=c?c():"";e("Failed "+a+" type: "+d.message+(h??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},_x=i,_x}var Cx,jk;function ZQ(){if(jk)return Cx;jk=1;var e=x5(),t=XQ(),n=CC(),r=w5(),i=QQ(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return Cx=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(I){var q=I&&(c&&I[c]||I[u]);if(typeof q=="function")return q}var p="<<anonymous>>",h={array:x("array"),bigint:x("bigint"),bool:x("boolean"),func:x("function"),number:x("number"),object:x("object"),string:x("string"),symbol:x("symbol"),any:w(),arrayOf:_,element:E(),elementType:C(),instanceOf:R,node:j(),objectOf:M,oneOf:T,oneOfType:N,shape:$,exact:Q};function m(I,q){return I===q?I!==0||1/I===1/q:I!==I&&q!==q}function b(I,q){this.message=I,this.data=q&&typeof q=="object"?q:{},this.stack=""}b.prototype=Error.prototype;function y(I){if(process.env.NODE_ENV!=="production")var q={},U=0;function O(K,oe,Y,J,se,ae,ge){if(J=J||p,ae=ae||Y,ge!==n){if(l){var ne=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 ne.name="Invariant Violation",ne}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var fe=J+":"+Y;!q[fe]&&U<3&&(o("You are manually calling a React.PropTypes validation function for the `"+ae+"` prop on `"+J+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),q[fe]=!0,U++)}}return oe[Y]==null?K?oe[Y]===null?new b("The "+se+" `"+ae+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new b("The "+se+" `"+ae+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:I(oe,Y,J,se,ae)}var ee=O.bind(null,!1);return ee.isRequired=O.bind(null,!0),ee}function x(I){function q(U,O,ee,K,oe,Y){var J=U[O],se=G(J);if(se!==I){var ae=V(J);return new b("Invalid "+K+" `"+oe+"` of type "+("`"+ae+"` supplied to `"+ee+"`, expected ")+("`"+I+"`."),{expectedType:I})}return null}return y(q)}function w(){return y(s)}function _(I){function q(U,O,ee,K,oe){if(typeof I!="function")return new b("Property `"+oe+"` of component `"+ee+"` has invalid PropType notation inside arrayOf.");var Y=U[O];if(!Array.isArray(Y)){var J=G(Y);return new b("Invalid "+K+" `"+oe+"` of type "+("`"+J+"` supplied to `"+ee+"`, expected an array."))}for(var se=0;se<Y.length;se++){var ae=I(Y,se,ee,K,oe+"["+se+"]",n);if(ae instanceof Error)return ae}return null}return y(q)}function E(){function I(q,U,O,ee,K){var oe=q[U];if(!a(oe)){var Y=G(oe);return new b("Invalid "+ee+" `"+K+"` of type "+("`"+Y+"` supplied to `"+O+"`, expected a single ReactElement."))}return null}return y(I)}function C(){function I(q,U,O,ee,K){var oe=q[U];if(!e.isValidElementType(oe)){var Y=G(oe);return new b("Invalid "+ee+" `"+K+"` of type "+("`"+Y+"` supplied to `"+O+"`, expected a single ReactElement type."))}return null}return y(I)}function R(I){function q(U,O,ee,K,oe){if(!(U[O]instanceof I)){var Y=I.name||p,J=X(U[O]);return new b("Invalid "+K+" `"+oe+"` of type "+("`"+J+"` supplied to `"+ee+"`, expected ")+("instance of `"+Y+"`."))}return null}return y(q)}function T(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function q(U,O,ee,K,oe){for(var Y=U[O],J=0;J<I.length;J++)if(m(Y,I[J]))return null;var se=JSON.stringify(I,function(ge,ne){var fe=V(ne);return fe==="symbol"?String(ne):ne});return new b("Invalid "+K+" `"+oe+"` of value `"+String(Y)+"` "+("supplied to `"+ee+"`, expected one of "+se+"."))}return y(q)}function M(I){function q(U,O,ee,K,oe){if(typeof I!="function")return new b("Property `"+oe+"` of component `"+ee+"` has invalid PropType notation inside objectOf.");var Y=U[O],J=G(Y);if(J!=="object")return new b("Invalid "+K+" `"+oe+"` of type "+("`"+J+"` supplied to `"+ee+"`, expected an object."));for(var se in Y)if(r(Y,se)){var ae=I(Y,se,ee,K,oe+"."+se,n);if(ae instanceof Error)return ae}return null}return y(q)}function N(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var q=0;q<I.length;q++){var U=I[q];if(typeof U!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+B(U)+" at index "+q+"."),s}function O(ee,K,oe,Y,J){for(var se=[],ae=0;ae<I.length;ae++){var ge=I[ae],ne=ge(ee,K,oe,Y,J,n);if(ne==null)return null;ne.data&&r(ne.data,"expectedType")&&se.push(ne.data.expectedType)}var fe=se.length>0?", expected one of type ["+se.join(", ")+"]":"";return new b("Invalid "+Y+" `"+J+"` supplied to "+("`"+oe+"`"+fe+"."))}return y(O)}function j(){function I(q,U,O,ee,K){return H(q[U])?null:new b("Invalid "+ee+" `"+K+"` supplied to "+("`"+O+"`, expected a ReactNode."))}return y(I)}function F(I,q,U,O,ee){return new b((I||"React class")+": "+q+" type `"+U+"."+O+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ee+"`.")}function $(I){function q(U,O,ee,K,oe){var Y=U[O],J=G(Y);if(J!=="object")return new b("Invalid "+K+" `"+oe+"` of type `"+J+"` "+("supplied to `"+ee+"`, expected `object`."));for(var se in I){var ae=I[se];if(typeof ae!="function")return F(ee,K,oe,se,V(ae));var ge=ae(Y,se,ee,K,oe+"."+se,n);if(ge)return ge}return null}return y(q)}function Q(I){function q(U,O,ee,K,oe){var Y=U[O],J=G(Y);if(J!=="object")return new b("Invalid "+K+" `"+oe+"` of type `"+J+"` "+("supplied to `"+ee+"`, expected `object`."));var se=t({},U[O],I);for(var ae in se){var ge=I[ae];if(r(I,ae)&&typeof ge!="function")return F(ee,K,oe,ae,V(ge));if(!ge)return new b("Invalid "+K+" `"+oe+"` key `"+ae+"` supplied to `"+ee+"`.\nBad object: "+JSON.stringify(U[O],null," ")+`
110
- Valid keys: `+JSON.stringify(Object.keys(I),null," "));var ne=ge(Y,ae,ee,K,oe+"."+ae,n);if(ne)return ne}return null}return y(q)}function H(I){switch(typeof I){case"number":case"string":case"undefined":return!0;case"boolean":return!I;case"object":if(Array.isArray(I))return I.every(H);if(I===null||a(I))return!0;var q=d(I);if(q){var U=q.call(I),O;if(q!==I.entries){for(;!(O=U.next()).done;)if(!H(O.value))return!1}else for(;!(O=U.next()).done;){var ee=O.value;if(ee&&!H(ee[1]))return!1}}else return!1;return!0;default:return!1}}function L(I,q){return I==="symbol"?!0:q?q["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&q instanceof Symbol:!1}function G(I){var q=typeof I;return Array.isArray(I)?"array":I instanceof RegExp?"object":L(q,I)?"symbol":q}function V(I){if(typeof I>"u"||I===null)return""+I;var q=G(I);if(q==="object"){if(I instanceof Date)return"date";if(I instanceof RegExp)return"regexp"}return q}function B(I){var q=V(I);switch(q){case"array":case"object":return"an "+q;case"boolean":case"date":case"regexp":return"a "+q;default:return q}}function X(I){return!I.constructor||!I.constructor.name?p:I.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},Cx}var Ex,$k;function JQ(){if($k)return Ex;$k=1;var e=CC();function t(){}function n(){}return n.resetWarningCache=t,Ex=function(){function r(s,a,l,c,u,d){if(d!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Ex}if(process.env.NODE_ENV!=="production"){var eZ=x5(),tZ=!0;V1.exports=ZQ()(eZ.isElement,tZ)}else V1.exports=JQ()();var nl=V1.exports,Fy={exports:{}},S5={};function _5(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=_5(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function zk(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=_5(e))&&(r&&(r+=" "),r+=t);return r}const nZ=Object.freeze(Object.defineProperty({__proto__:null,clsx:zk,default:zk},Symbol.toStringTag,{value:"Module"})),rZ=z_(nZ);var Fn={},bs={};Object.defineProperty(bs,"__esModule",{value:!0});bs.dontSetMe=lZ;bs.findInArray=iZ;bs.int=aZ;bs.isFunction=oZ;bs.isNum=sZ;function iZ(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function oZ(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function sZ(e){return typeof e=="number"&&!isNaN(e)}function aZ(e){return parseInt(e,10)}function lZ(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 Lc={};Object.defineProperty(Lc,"__esModule",{value:!0});Lc.browserPrefixToKey=E5;Lc.browserPrefixToStyle=cZ;Lc.default=void 0;Lc.getPrefix=C5;const Rx=["Moz","Webkit","O","ms"];function C5(){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<Rx.length;r++)if(E5(t,Rx[r])in n)return Rx[r];return""}function E5(e,t){return t?"".concat(t).concat(uZ(e)):e}function cZ(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function uZ(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}Lc.default=C5();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.addClassName=T5;Fn.addEvent=hZ;Fn.addUserSelectStyles=CZ;Fn.createCSSTransform=xZ;Fn.createSVGTransform=wZ;Fn.getTouch=SZ;Fn.getTouchIdentifier=_Z;Fn.getTranslation=EC;Fn.innerHeight=bZ;Fn.innerWidth=yZ;Fn.matchesSelector=P5;Fn.matchesSelectorAndParentsTo=fZ;Fn.offsetXYFromParent=vZ;Fn.outerHeight=gZ;Fn.outerWidth=mZ;Fn.removeClassName=k5;Fn.removeEvent=pZ;Fn.removeUserSelectStyles=EZ;var Fi=bs,Bk=dZ(Lc);function R5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(R5=function(r){return r?n:t})(e)}function dZ(e,t){if(e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=R5(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}let Bg="";function P5(e,t){return Bg||(Bg=(0,Fi.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Fi.isFunction)(e[n])})),(0,Fi.isFunction)(e[Bg])?e[Bg](t):!1}function fZ(e,t,n){let r=e;do{if(P5(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function hZ(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function pZ(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function gZ(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Fi.int)(n.borderTopWidth),t+=(0,Fi.int)(n.borderBottomWidth),t}function mZ(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Fi.int)(n.borderLeftWidth),t+=(0,Fi.int)(n.borderRightWidth),t}function bZ(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Fi.int)(n.paddingTop),t-=(0,Fi.int)(n.paddingBottom),t}function yZ(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Fi.int)(n.paddingLeft),t-=(0,Fi.int)(n.paddingRight),t}function vZ(e,t,n){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-i.left)/n,s=(e.clientY+t.scrollTop-i.top)/n;return{x:o,y:s}}function xZ(e,t){const n=EC(e,t,"px");return{[(0,Bk.browserPrefixToKey)("transform",Bk.default)]:n}}function wZ(e,t){return EC(e,t,"")}function EC(e,t,n){let{x:r,y:i}=e,o="translate(".concat(r).concat(n,",").concat(i).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);o="translate(".concat(s,", ").concat(a,")")+o}return o}function SZ(e,t){return e.targetTouches&&(0,Fi.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Fi.findInArray)(e.changedTouches,n=>t===n.identifier)}function _Z(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function CZ(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
111
- `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
112
- `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&T5(e.body,"react-draggable-transparent-selection")}function EZ(e){if(e)try{if(e.body&&k5(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 T5(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function k5(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.canDragX=TZ;ys.canDragY=kZ;ys.createCoreData=OZ;ys.createDraggableData=MZ;ys.getBoundPosition=RZ;ys.getControlPosition=AZ;ys.snapToGrid=PZ;var ki=bs,Su=Fn;function RZ(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:IZ(r);const i=RC(e);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(i),u=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,ki.int)(u.paddingLeft)+(0,ki.int)(c.marginLeft),top:-i.offsetTop+(0,ki.int)(u.paddingTop)+(0,ki.int)(c.marginTop),right:(0,Su.innerWidth)(l)-(0,Su.outerWidth)(i)-i.offsetLeft+(0,ki.int)(u.paddingRight)-(0,ki.int)(c.marginRight),bottom:(0,Su.innerHeight)(l)-(0,Su.outerHeight)(i)-i.offsetTop+(0,ki.int)(u.paddingBottom)-(0,ki.int)(c.marginBottom)}}return(0,ki.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,ki.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,ki.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,ki.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function PZ(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function TZ(e){return e.props.axis==="both"||e.props.axis==="x"}function kZ(e){return e.props.axis==="both"||e.props.axis==="y"}function AZ(e,t,n){const r=typeof t=="number"?(0,Su.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const i=RC(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,Su.offsetXYFromParent)(r||e,o,n.props.scale)}function OZ(e,t,n){const r=!(0,ki.isNum)(e.lastX),i=RC(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function MZ(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 IZ(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function RC(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var jy={},$y={};Object.defineProperty($y,"__esModule",{value:!0});$y.default=DZ;function DZ(){}Object.defineProperty(jy,"__esModule",{value:!0});jy.default=void 0;var Px=LZ(k),ii=PC(nl),NZ=PC(Ar),Cr=Fn,va=ys,Tx=bs,gf=PC($y);function PC(e){return e&&e.__esModule?e:{default:e}}function A5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(A5=function(r){return r?n:t})(e)}function LZ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=A5(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Hr(e,t,n){return t=FZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FZ(e){var t=jZ(e,"string");return typeof t=="symbol"?t:String(t)}function jZ(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 wo={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let xa=wo.mouse,zy=class extends Px.Component{constructor(){super(...arguments),Hr(this,"dragging",!1),Hr(this,"lastX",NaN),Hr(this,"lastY",NaN),Hr(this,"touchIdentifier",null),Hr(this,"mounted",!1),Hr(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Cr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Cr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Cr.getTouchIdentifier)(t);this.touchIdentifier=i;const o=(0,va.getControlPosition)(t,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,va.createCoreData)(this,s,a);(0,gf.default)("DraggableCore: handleDragStart: %j",l),(0,gf.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Cr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Cr.addEvent)(r,xa.move,this.handleDrag),(0,Cr.addEvent)(r,xa.stop,this.handleDragStop))}),Hr(this,"handleDrag",t=>{const n=(0,va.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=i-this.lastY;if([a,l]=(0,va.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,va.createCoreData)(this,r,i);if((0,gf.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=i}),Hr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,va.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,va.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,va.createCoreData)(this,r,i);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Cr.removeUserSelectStyles)(a.ownerDocument),(0,gf.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,gf.default)("DraggableCore: Removing handlers"),(0,Cr.removeEvent)(a.ownerDocument,xa.move,this.handleDrag),(0,Cr.removeEvent)(a.ownerDocument,xa.stop,this.handleDragStop))}),Hr(this,"onMouseDown",t=>(xa=wo.mouse,this.handleDragStart(t))),Hr(this,"onMouseUp",t=>(xa=wo.mouse,this.handleDragStop(t))),Hr(this,"onTouchStart",t=>(xa=wo.touch,this.handleDragStart(t))),Hr(this,"onTouchEnd",t=>(xa=wo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Cr.addEvent)(t,wo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Cr.removeEvent)(n,wo.mouse.move,this.handleDrag),(0,Cr.removeEvent)(n,wo.touch.move,this.handleDrag),(0,Cr.removeEvent)(n,wo.mouse.stop,this.handleDragStop),(0,Cr.removeEvent)(n,wo.touch.stop,this.handleDragStop),(0,Cr.removeEvent)(t,wo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Cr.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:NZ.default.findDOMNode(this)}render(){return Px.cloneElement(Px.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};jy.default=zy;Hr(zy,"displayName","DraggableCore");Hr(zy,"propTypes",{allowAnyClick:ii.default.bool,children:ii.default.node.isRequired,disabled:ii.default.bool,enableUserSelectHack:ii.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:ii.default.arrayOf(ii.default.number),handle:ii.default.string,cancel:ii.default.string,nodeRef:ii.default.object,onStart:ii.default.func,onDrag:ii.default.func,onStop:ii.default.func,onMouseDown:ii.default.func,scale:ii.default.number,className:Tx.dontSetMe,style:Tx.dontSetMe,transform:Tx.dontSetMe});Hr(zy,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=p(k),n=u(nl),r=u(Ar),i=u(rZ),o=Fn,s=ys,a=bs,l=u(jy),c=u($y);function u(w){return w&&w.__esModule?w:{default:w}}function d(w){if(typeof WeakMap!="function")return null;var _=new WeakMap,E=new WeakMap;return(d=function(C){return C?E:_})(w)}function p(w,_){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var E=d(_);if(E&&E.has(w))return E.get(w);var C={},R=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in w)if(T!=="default"&&Object.prototype.hasOwnProperty.call(w,T)){var M=R?Object.getOwnPropertyDescriptor(w,T):null;M&&(M.get||M.set)?Object.defineProperty(C,T,M):C[T]=w[T]}return C.default=w,E&&E.set(w,C),C}function h(){return h=Object.assign?Object.assign.bind():function(w){for(var _=1;_<arguments.length;_++){var E=arguments[_];for(var C in E)Object.prototype.hasOwnProperty.call(E,C)&&(w[C]=E[C])}return w},h.apply(this,arguments)}function m(w,_,E){return _=b(_),_ in w?Object.defineProperty(w,_,{value:E,enumerable:!0,configurable:!0,writable:!0}):w[_]=E,w}function b(w){var _=y(w,"string");return typeof _=="symbol"?_:String(_)}function y(w,_){if(typeof w!="object"||w===null)return w;var E=w[Symbol.toPrimitive];if(E!==void 0){var C=E.call(w,_||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(w)}class x extends t.Component{static getDerivedStateFromProps(_,E){let{position:C}=_,{prevPropsPosition:R}=E;return C&&(!R||C.x!==R.x||C.y!==R.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:R}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}constructor(_){super(_),m(this,"onDragStart",(E,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(E,(0,s.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(E,C)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",C);const R=(0,s.createDraggableData)(this,C),T={x:R.x,y:R.y,slackX:0,slackY:0};if(this.props.bounds){const{x:N,y:j}=T;T.x+=this.state.slackX,T.y+=this.state.slackY;const[F,$]=(0,s.getBoundPosition)(this,T.x,T.y);T.x=F,T.y=$,T.slackX=this.state.slackX+(N-T.x),T.slackY=this.state.slackY+(j-T.y),R.x=T.x,R.y=T.y,R.deltaX=T.x-this.state.x,R.deltaY=T.y-this.state.y}if(this.props.onDrag(E,R)===!1)return!1;this.setState(T)}),m(this,"onDragStop",(E,C)=>{if(!this.state.dragging||this.props.onStop(E,(0,s.createDraggableData)(this,C))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",C);const T={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:N,y:j}=this.props.position;T.x=N,T.y=j}this.setState(T)}),this.state={dragging:!1,dragged:!1,x:_.position?_.position.x:_.defaultPosition.x,y:_.position?_.position.y:_.defaultPosition.y,prevPropsPosition:{..._.position},slackX:0,slackY:0,isElementSVG:!1},_.position&&!(_.onDrag||_.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var _,E;return(_=(E=this.props)===null||E===void 0||(E=E.nodeRef)===null||E===void 0?void 0:E.current)!==null&&_!==void 0?_:r.default.findDOMNode(this)}render(){const{axis:_,bounds:E,children:C,defaultPosition:R,defaultClassName:T,defaultClassNameDragging:M,defaultClassNameDragged:N,position:j,positionOffset:F,scale:$,...Q}=this.props;let H={},L=null;const V=!!!j||this.state.dragging,B=j||R,X={x:(0,s.canDragX)(this)&&V?this.state.x:B.x,y:(0,s.canDragY)(this)&&V?this.state.y:B.y};this.state.isElementSVG?L=(0,o.createSVGTransform)(X,F):H=(0,o.createCSSTransform)(X,F);const I=(0,i.default)(C.props.className||"",T,{[M]:this.state.dragging,[N]:this.state.dragged});return t.createElement(l.default,h({},Q,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(C),{className:I,style:{...C.props.style,...H},transform:L}))}}e.default=x,m(x,"displayName","Draggable"),m(x,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(x,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(S5);const{default:O5,DraggableCore:$Z}=S5;Fy.exports=O5;Fy.exports.default=O5;Fy.exports.DraggableCore=$Z;var M5=Fy.exports,By={exports:{}},hp={},TC={};TC.__esModule=!0;TC.cloneElement=UZ;var zZ=BZ(k);function BZ(e){return e&&e.__esModule?e:{default:e}}function Hk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hk(Object(n),!0).forEach(function(r){HZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HZ(e,t,n){return t=VZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VZ(e){var t=WZ(e,"string");return typeof t=="symbol"?t:String(t)}function WZ(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 UZ(e,t){return t.style&&e.props.style&&(t.style=Vk(Vk({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),zZ.default.cloneElement(e,t)}var pp={};pp.__esModule=!0;pp.resizableProps=void 0;var gt=GZ(nl);function GZ(e){return e&&e.__esModule?e:{default:e}}var qZ={axis:gt.default.oneOf(["both","x","y","none"]),className:gt.default.string,children:gt.default.element.isRequired,draggableOpts:gt.default.shape({allowAnyClick:gt.default.bool,cancel:gt.default.string,children:gt.default.node,disabled:gt.default.bool,enableUserSelectHack:gt.default.bool,offsetParent:gt.default.node,grid:gt.default.arrayOf(gt.default.number),handle:gt.default.string,nodeRef:gt.default.object,onStart:gt.default.func,onDrag:gt.default.func,onStop:gt.default.func,onMouseDown:gt.default.func,scale:gt.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="y"){var o;return(o=gt.default.number).isRequired.apply(o,n)}return gt.default.number.apply(gt.default,n)},handle:gt.default.oneOfType([gt.default.node,gt.default.func]),handleSize:gt.default.arrayOf(gt.default.number),lockAspectRatio:gt.default.bool,maxConstraints:gt.default.arrayOf(gt.default.number),minConstraints:gt.default.arrayOf(gt.default.number),onResizeStop:gt.default.func,onResizeStart:gt.default.func,onResize:gt.default.func,resizeHandles:gt.default.arrayOf(gt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:gt.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="x"){var o;return(o=gt.default.number).isRequired.apply(o,n)}return gt.default.number.apply(gt.default,n)}};pp.resizableProps=qZ;hp.__esModule=!0;hp.default=void 0;var mf=ZZ(k),YZ=M5,KZ=TC,XZ=pp,QZ=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function I5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(I5=function(i){return i?n:t})(e)}function ZZ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=I5(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function W1(){return W1=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},W1.apply(this,arguments)}function JZ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Wk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wk(Object(n),!0).forEach(function(r){eJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eJ(e,t,n){return t=tJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tJ(e){var t=nJ(e,"string");return typeof t=="symbol"?t:String(t)}function nJ(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 rJ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,U1(e,t)}function U1(e,t){return U1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},U1(e,t)}var kC=function(e){rJ(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(i,o){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[i,o];if(c){var u=this.props.width/this.props.height,d=i-this.props.width,p=o-this.props.height;Math.abs(d)>Math.abs(p*u)?o=i/u:i=o*u}var h=i,m=o,b=this.slack||[0,0],y=b[0],x=b[1];return i+=y,o+=x,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[y+(h-i),x+(m-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,u=l.deltaX,d=l.deltaY;i==="onResizeStart"&&s.resetData();var p=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!p&&!h)){var m=o[0],b=o[o.length-1],y=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var x=y.left-s.lastHandleRect.left;u+=x}if(m==="n"){var w=y.top-s.lastHandleRect.top;d+=w}}s.lastHandleRect=y,b==="w"&&(u=-u),m==="n"&&(d=-d);var _=s.props.width+(p?u/s.props.transformScale:0),E=s.props.height+(h?d/s.props.transformScale:0),C=s.runConstraints(_,E);_=C[0],E=C[1];var R=_!==s.props.width||E!==s.props.height,T=typeof s.props[i]=="function"?s.props[i]:null,M=i==="onResize"&&!R;T&&!M&&(a.persist==null||a.persist(),T(a,{node:c,size:{width:_,height:E},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return mf.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=kx({ref:o},a?{}:{handleAxis:i});return mf.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var u=JZ(o,QZ);return(0,KZ.cloneElement)(s,kx(kx({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var p,h=(p=i.handleRefs[d])!=null?p:i.handleRefs[d]=mf.createRef();return mf.createElement(YZ.DraggableCore,W1({},l,{nodeRef:h,key:"resizableHandle-"+d,onStop:i.resizeHandler("onResizeStop",d),onStart:i.resizeHandler("onResizeStart",d),onDrag:i.resizeHandler("onResize",d)}),i.renderResizeHandle(d,h))}))}))},t}(mf.Component);hp.default=kC;kC.propTypes=XZ.resizableProps;kC.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Hy={};Hy.__esModule=!0;Hy.default=void 0;var Ax=lJ(k),iJ=D5(nl),oJ=D5(hp),sJ=pp,aJ=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function D5(e){return e&&e.__esModule?e:{default:e}}function N5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(N5=function(i){return i?n:t})(e)}function lJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=N5(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function G1(){return G1=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},G1.apply(this,arguments)}function Uk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uk(Object(n),!0).forEach(function(r){cJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cJ(e,t,n){return t=uJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uJ(e){var t=dJ(e,"string");return typeof t=="symbol"?t:String(t)}function dJ(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 fJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function hJ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,q1(e,t)}function q1(e,t){return q1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},q1(e,t)}var L5=function(e){hJ(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(i,o){return o.propsWidth!==i.width||o.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null};var n=t.prototype;return n.render=function(){var i=this.props,o=i.handle,s=i.handleSize;i.onResize;var a=i.onResizeStart,l=i.onResizeStop,c=i.draggableOpts,u=i.minConstraints,d=i.maxConstraints,p=i.lockAspectRatio,h=i.axis;i.width,i.height;var m=i.resizeHandles,b=i.style,y=i.transformScale,x=fJ(i,aJ);return Ax.createElement(oJ.default,{axis:h,draggableOpts:c,handle:o,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:m,transformScale:y,width:this.state.width},Ax.createElement("div",G1({},x,{style:bb(bb({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Ax.Component);Hy.default=L5;L5.propTypes=bb(bb({},sJ.resizableProps),{},{children:iJ.default.element});By.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};By.exports.Resizable=hp.default;By.exports.ResizableBox=Hy.default;var pJ=By.exports,Js={};Object.defineProperty(Js,"__esModule",{value:!0});Js.resizeHandleType=Js.resizeHandleAxesType=Js.default=void 0;var vt=F5(nl),gJ=F5(k);function F5(e){return e&&e.__esModule?e:{default:e}}const mJ=Js.resizeHandleAxesType=vt.default.arrayOf(vt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),bJ=Js.resizeHandleType=vt.default.oneOfType([vt.default.node,vt.default.func]);Js.default={className:vt.default.string,style:vt.default.object,width:vt.default.number,autoSize:vt.default.bool,cols:vt.default.number,draggableCancel:vt.default.string,draggableHandle:vt.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:vt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Pt.validateLayout(t,"layout")},margin:vt.default.arrayOf(vt.default.number),containerPadding:vt.default.arrayOf(vt.default.number),rowHeight:vt.default.number,maxRows:vt.default.number,isBounded:vt.default.bool,isDraggable:vt.default.bool,isResizable:vt.default.bool,allowOverlap:vt.default.bool,preventCollision:vt.default.bool,useCSSTransforms:vt.default.bool,transformScale:vt.default.number,isDroppable:vt.default.bool,resizeHandles:mJ,resizeHandle:bJ,onLayoutChange:vt.default.func,onDragStart:vt.default.func,onDrag:vt.default.func,onDragStop:vt.default.func,onResizeStart:vt.default.func,onResize:vt.default.func,onResizeStop:vt.default.func,onDrop:vt.default.func,droppingItem:vt.default.shape({i:vt.default.string.isRequired,w:vt.default.number.isRequired,h:vt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};gJ.default.Children.forEach(n,function(i){if((i==null?void 0:i.key)!=null){if(r[i.key])throw new Error('Duplicate child key "'+i.key+'" found! This will cause problems in ReactGridLayout.');r[i.key]=!0}})},innerRef:vt.default.any};Object.defineProperty(Ly,"__esModule",{value:!0});Ly.default=void 0;var su=AC(k),Yt=AC(nl),yJ=M5,vJ=pJ,au=Pt,gr=ms,Gk=Js,xJ=AC(pC);function AC(e){return e&&e.__esModule?e:{default:e}}function Vo(e,t,n){return t=wJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wJ(e){var t=SJ(e,"string");return typeof t=="symbol"?t:String(t)}function SJ(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 OC extends su.default.Component{constructor(){super(...arguments),Vo(this,"state",{resizing:null,dragging:null,className:""}),Vo(this,"elementRef",su.default.createRef()),Vo(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:i,transformScale:o}=this.props;if(!i)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/o,d=l.left/o,p=c.top/o,h=l.top/o;s.left=u-d+a.scrollLeft,s.top=p-h+a.scrollTop,this.setState({dragging:s});const{x:m,y:b}=(0,gr.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return i.call(this,this.props.i,m,b,{e:t,node:r,newPosition:s})}),Vo(this,"onDrag",(t,n)=>{let{node:r,deltaX:i,deltaY:o}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+o,l=this.state.dragging.left+i;const{isBounded:c,i:u,w:d,h:p,containerWidth:h}=this.props,m=this.getPositionParams();if(c){const{offsetParent:w}=r;if(w){const{margin:_,rowHeight:E,containerPadding:C}=this.props,R=w.clientHeight-(0,gr.calcGridItemWHPx)(p,E,_[1]);a=(0,gr.clamp)(a-C[1],0,R);const T=(0,gr.calcGridColWidth)(m),M=h-(0,gr.calcGridItemWHPx)(d,T,_[0]);l=(0,gr.clamp)(l-C[0],0,M)}}const b={top:a,left:l};this.setState({dragging:b});const{x:y,y:x}=(0,gr.calcXY)(m,a,l,d,p);return s.call(this,u,y,x,{e:t,node:r,newPosition:b})}),Vo(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:p}=(0,gr.calcXY)(this.getPositionParams(),c,l,o,s);return i.call(this,a,d,p,{e:t,node:r,newPosition:u})}),Vo(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Vo(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Vo(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,gr.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,gr.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,au.fastPositionEqual)(r,i)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const i=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,s=o&&n.left!==i.left||n.top!==i.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-o.left,l=n.top-o.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:i}=this.props;let o;return i?o=(0,au.setTransform)(t):(o=(0,au.setTopLeft)(t),n&&(o.left=(0,au.perc)(t.left/r),o.width=(0,au.perc)(t.width/r))),o}mixinDraggable(t,n){return su.default.createElement(yJ.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,i)=>n(r,i,t)}mixinResizable(t,n,r){const{cols:i,minW:o,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,p=this.getPositionParams(),h=(0,gr.calcGridItemPosition)(p,0,0,i,0).width,m=(0,gr.calcGridItemPosition)(p,0,0,o,s),b=(0,gr.calcGridItemPosition)(p,0,0,a,l),y=[m.width,m.height],x=[Math.min(b.width,h),Math.min(b.height,1/0)];return su.default.createElement(vJ.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:y,maxConstraints:x,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,n,r,i){let{node:o,size:s,handle:a}=n;const l=this.props[i];if(!l)return;const{x:c,y:u,i:d,maxH:p,minH:h,containerWidth:m}=this.props,{minW:b,maxW:y}=this.props;let x=s;o&&(x=(0,au.resizeItemInDirection)(a,r,s,m),this.setState({resizing:i==="onResizeStop"?null:x}));let{w,h:_}=(0,gr.calcWH)(this.getPositionParams(),x.width,x.height,c,u,a);w=(0,gr.clamp)(w,Math.max(b,1),y),_=(0,gr.clamp)(_,h,p),l.call(this,d,w,_,{e:t,node:o,size:x,handle:a})}render(){const{x:t,y:n,w:r,h:i,isDraggable:o,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,gr.calcGridItemPosition)(this.getPositionParams(),t,n,r,i,this.state),u=su.default.Children.only(this.props.children);let d=su.default.cloneElement(u,{ref:this.elementRef,className:(0,xJ.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,s),d=this.mixinDraggable(d,o),d}}Ly.default=OC;Vo(OC,"propTypes",{children:Yt.default.element,cols:Yt.default.number.isRequired,containerWidth:Yt.default.number.isRequired,rowHeight:Yt.default.number.isRequired,margin:Yt.default.array.isRequired,maxRows:Yt.default.number.isRequired,containerPadding:Yt.default.array.isRequired,x:Yt.default.number.isRequired,y:Yt.default.number.isRequired,w:Yt.default.number.isRequired,h:Yt.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:Yt.default.string.isRequired,resizeHandles:Gk.resizeHandleAxesType,resizeHandle:Gk.resizeHandleType,onDragStop:Yt.default.func,onDragStart:Yt.default.func,onDrag:Yt.default.func,onResizeStop:Yt.default.func,onResizeStart:Yt.default.func,onResize:Yt.default.func,isDraggable:Yt.default.bool.isRequired,isResizable:Yt.default.bool.isRequired,isBounded:Yt.default.bool.isRequired,static:Yt.default.bool,useCSSTransforms:Yt.default.bool.isRequired,transformScale:Yt.default.number,className:Yt.default.string,handle:Yt.default.string,cancel:Yt.default.string,droppingPosition:Yt.default.shape({e:Yt.default.object.isRequired,left:Yt.default.number.isRequired,top:Yt.default.number.isRequired})});Vo(OC,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(fp,"__esModule",{value:!0});fp.default=void 0;var wl=RJ(k),Ox=hC,_J=MC(pC),nt=Pt,CJ=ms,qk=MC(Ly),EJ=MC(Js);function MC(e){return e&&e.__esModule?e:{default:e}}function j5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(j5=function(r){return r?n:t})(e)}function RJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=j5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Rr(e,t,n){return t=PJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PJ(e){var t=TJ(e,"string");return typeof t=="symbol"?t:String(t)}function TJ(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 Yk="react-grid-layout";let $5=!1;try{$5=/firefox/i.test(navigator.userAgent)}catch{}class Vy extends wl.Component{constructor(){super(...arguments),Rr(this,"state",{activeDrag:null,layout:(0,nt.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,nt.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Rr(this,"dragEnterCounter",0),Rr(this,"onDragStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,nt.getLayoutItem)(a,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,nt.cloneLayoutItem)(l),oldLayout:a,activeDrag:c}),this.props.onDragStart(a,l,l,null,o,s)}),Rr(this,"onDrag",(t,n,r,i)=>{let{e:o,node:s}=i;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,p=(0,nt.getLayoutItem)(l,t);if(!p)return;const h={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t};l=(0,nt.moveElement)(l,p,n,r,!0,d,(0,nt.compactType)(this.props),c,u),this.props.onDrag(l,a,p,h,o,s),this.setState({layout:u?l:(0,nt.compact)(l,(0,nt.compactType)(this.props),c),activeDrag:h})}),Rr(this,"onDragStop",(t,n,r,i)=>{let{e:o,node:s}=i;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,p=(0,nt.getLayoutItem)(l,t);if(!p)return;l=(0,nt.moveElement)(l,p,n,r,!0,u,(0,nt.compactType)(this.props),c,d);const m=d?l:(0,nt.compact)(l,(0,nt.compactType)(this.props),c);this.props.onDragStop(m,a,p,null,o,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:m,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(m,b)}),Rr(this,"onResizeStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,nt.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,nt.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,o,s))}),Rr(this,"onResize",(t,n,r,i)=>{let{e:o,node:s,size:a,handle:l}=i;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:d,preventCollision:p,allowOverlap:h}=this.props;let m=!1,b,y,x;const[w,_]=(0,nt.withLayoutItem)(u,t,C=>{let R;return y=C.x,x=C.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(y=C.x+(C.w-n),n=C.x!==y&&y<0?C.w:n,y=y<0?0:y),["ne","n","nw"].indexOf(l)!==-1&&(x=C.y+(C.h-r),r=C.y!==x&&x<0?C.h:r,x=x<0?0:x),m=!0),p&&!h&&(R=(0,nt.getAllCollisions)(u,{...C,w:n,h:r,x:y,y:x}).filter(M=>M.i!==C.i).length>0,R&&(x=C.y,r=C.h,y=C.x,n=C.w,m=!1)),C.w=n,C.h=r,C});if(!_)return;b=w,m&&(b=(0,nt.moveElement)(w,_,y,x,!0,this.props.preventCollision,(0,nt.compactType)(this.props),d,h));const E={w:_.w,h:_.h,x:_.x,y:_.y,static:!0,i:t};this.props.onResize(b,c,_,E,o,s),this.setState({layout:h?b:(0,nt.compact)(b,(0,nt.compactType)(this.props),d),activeDrag:E})}),Rr(this,"onResizeStop",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,nt.getLayoutItem)(a,t),p=u?a:(0,nt.compact)(a,(0,nt.compactType)(this.props),c);this.props.onResizeStop(p,l,d,null,o,s);const{oldLayout:h}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,h)}),Rr(this,"onDragOver",t=>{var w;if(t.preventDefault(),t.stopPropagation(),$5&&!((w=t.nativeEvent.target)!=null&&w.classList.contains(Yk)))return!1;const{droppingItem:n,onDropDragOver:r,margin:i,cols:o,rowHeight:s,maxRows:a,width:l,containerPadding:c,transformScale:u}=this.props,d=r==null?void 0:r(t);if(d===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...n,...d},{layout:h}=this.state,m=t.currentTarget.getBoundingClientRect(),b=t.clientX-m.left,y=t.clientY-m.top,x={left:b/u,top:y/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:E}=this.state.droppingPosition;(_!=b||E!=y)&&this.setState({droppingPosition:x})}}else{const _={cols:o,margin:i,maxRows:a,rowHeight:s,containerWidth:l,containerPadding:c||i},E=(0,CJ.calcXY)(_,y,b,p.w,p.h);this.setState({droppingDOMNode:wl.createElement("div",{key:p.i}),droppingPosition:x,layout:[...h,{...p,x:E.x,y:E.y,static:!1,isDraggable:!0}]})}}),Rr(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,i=(0,nt.compact)(r.filter(o=>o.i!==t.i),(0,nt.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:i,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Rr(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Rr(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Rr(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,i=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,i,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,Ox.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,nt.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,nt.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,nt.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,nt.fastRGLPropsEqual)(this.props,t,Ox.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,i=n.layout;this.onLayoutMaybeChanged(r,i)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,nt.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,Ox.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:i,containerPadding:o,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return wl.createElement(qk.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:i,containerPadding:o||i,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},wl.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,nt.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:i,cols:o,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:p,useCSSTransforms:h,transformScale:m,draggableCancel:b,draggableHandle:y,resizeHandles:x,resizeHandle:w}=this.props,{mounted:_,droppingPosition:E}=this.state,C=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,R=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,T=r.resizeHandles||x,M=C&&p&&r.isBounded!==!1;return wl.createElement(qk.default,{containerWidth:i,cols:o,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:y,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:C,isResizable:R,isBounded:M,useCSSTransforms:h&&_,usePercentages:!_,transformScale:m,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?E:void 0,resizeHandles:T,resizeHandle:w},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:i}=this.props,o=(0,_J.default)(Yk,t),s={height:this.containerHeight(),...n};return wl.createElement("div",{ref:i,className:o,style:s,onDrop:r?this.onDrop:nt.noop,onDragLeave:r?this.onDragLeave:nt.noop,onDragEnter:r?this.onDragEnter:nt.noop,onDragOver:r?this.onDragOver:nt.noop},wl.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}fp.default=Vy;Rr(Vy,"displayName","ReactGridLayout");Rr(Vy,"propTypes",EJ.default);Rr(Vy,"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:nt.noop,onDragStart:nt.noop,onDrag:nt.noop,onDragStop:nt.noop,onResizeStart:nt.noop,onResize:nt.noop,onResizeStop:nt.noop,onDrop:nt.noop,onDropDragOver:nt.noop});var Wy={},Fc={};Object.defineProperty(Fc,"__esModule",{value:!0});Fc.findOrGenerateResponsiveLayout=OJ;Fc.getBreakpointFromWidth=kJ;Fc.getColsFromBreakpoint=AJ;Fc.sortBreakpoints=IC;var Hg=Pt;function kJ(e,t){const n=IC(e);let r=n[0];for(let i=1,o=n.length;i<o;i++){const s=n[i];t>e[s]&&(r=s)}return r}function AJ(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function OJ(e,t,n,r,i,o){if(e[n])return(0,Hg.cloneLayout)(e[n]);let s=e[r];const a=IC(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){s=e[d];break}}return s=(0,Hg.cloneLayout)(s||[]),(0,Hg.compact)((0,Hg.correctBounds)(s,{cols:i}),o,i)}function IC(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Wy,"__esModule",{value:!0});Wy.default=void 0;var Kk=IJ(k),oi=z5(nl),Mx=hC,Iu=Pt,Sl=Fc,MJ=z5(fp);function z5(e){return e&&e.__esModule?e:{default:e}}function B5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(B5=function(r){return r?n:t})(e)}function IJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=B5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Y1(){return Y1=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},Y1.apply(this,arguments)}function yb(e,t,n){return t=DJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DJ(e){var t=NJ(e,"string");return typeof t=="symbol"?t:String(t)}function NJ(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 Xk=e=>Object.prototype.toString.call(e);function Vg(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class DC extends Kk.Component{constructor(){super(...arguments),yb(this,"state",this.generateInitialState()),yb(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:i}=this.props,o=(0,Sl.getBreakpointFromWidth)(n,t),s=(0,Sl.getColsFromBreakpoint)(o,i),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Sl.findOrGenerateResponsiveLayout)(r,n,o,o,s,a),breakpoint:o,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Mx.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:i}=n;return{layout:(0,Sl.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,i,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,Mx.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Mx.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:i,compactType:o}=this.props,s=this.props.breakpoint||(0,Sl.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Sl.getColsFromBreakpoint)(s,r),c={...i};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Iu.cloneLayout)(this.state.layout));let p=(0,Sl.findOrGenerateResponsiveLayout)(c,n,s,a,l,o);p=(0,Iu.synchronizeLayoutWithChildren)(p,this.props.children,l,o,this.props.allowOverlap),c[s]=p,this.props.onBreakpointChange(s,l),this.props.onLayoutChange(p,c),this.setState({breakpoint:s,layout:p,cols:l})}const u=Vg(this.props.margin,s),d=Vg(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:i,margin:o,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return Kk.createElement(MJ.default,Y1({},u,{margin:Vg(o,this.state.breakpoint),containerPadding:Vg(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Wy.default=DC;yb(DC,"propTypes",{breakpoint:oi.default.string,breakpoints:oi.default.object,allowOverlap:oi.default.bool,cols:oi.default.object,margin:oi.default.oneOfType([oi.default.array,oi.default.object]),containerPadding:oi.default.oneOfType([oi.default.array,oi.default.object]),layouts(e,t){if(Xk(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+Xk(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,Iu.validateLayout)(e.layouts[n],"layouts."+n)})},width:oi.default.number.isRequired,onBreakpointChange:oi.default.func,onLayoutChange:oi.default.func,onWidthChange:oi.default.func});yb(DC,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:Iu.noop,onLayoutChange:Iu.noop,onWidthChange:Iu.noop});var NC={},H5=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var s=o[i];n.call(r,s[1],s[0])}},t}()}(),K1=typeof window<"u"&&typeof document<"u"&&window.document===document,vb=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")()}(),LJ=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(vb):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),FJ=2;function jJ(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){LJ(o)}function a(){var l=Date.now();if(n){if(l-i<FJ)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=l}return a}var $J=20,zJ=["top","right","bottom","left","width","height","size","weight"],BJ=typeof MutationObserver<"u",HJ=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=jJ(this.refresh.bind(this),$J)}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(){!K1||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),BJ?(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(){!K1||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=zJ.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),V5=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},ad=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||vb},W5=Uy(0,0,0,0);function xb(e){return parseFloat(e)||0}function Qk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var o=e["border-"+i+"-width"];return r+xb(o)},0)}function VJ(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var o=i[r],s=e["padding-"+o];n[o]=xb(s)}return n}function WJ(e){var t=e.getBBox();return Uy(0,0,t.width,t.height)}function UJ(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return W5;var r=ad(e).getComputedStyle(e),i=VJ(r),o=i.left+i.right,s=i.top+i.bottom,a=xb(r.width),l=xb(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=Qk(r,"left","right")+o),Math.round(l+s)!==n&&(l-=Qk(r,"top","bottom")+s)),!qJ(e)){var c=Math.round(a+o)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return Uy(i.left,i.top,a,l)}var GJ=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ad(e).SVGGraphicsElement}:function(e){return e instanceof ad(e).SVGElement&&typeof e.getBBox=="function"}}();function qJ(e){return e===ad(e).document.documentElement}function YJ(e){return K1?GJ(e)?WJ(e):UJ(e):W5}function KJ(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return V5(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function Uy(e,t,n,r){return{x:e,y:t,width:n,height:r}}var XJ=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Uy(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=YJ(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}(),QJ=function(){function e(t,n){var r=KJ(n);V5(this,{target:t,contentRect:r})}return e}(),ZJ=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new H5,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 ad(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new XJ(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 ad(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 QJ(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}(),U5=typeof WeakMap<"u"?new WeakMap:new H5,G5=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=HJ.getInstance(),r=new ZJ(t,n,this);U5.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){G5.prototype[e]=function(){var t;return(t=U5.get(this))[e].apply(t,arguments)}});var JJ=function(){return typeof vb.ResizeObserver<"u"?vb.ResizeObserver:G5}();const eee=Object.freeze(Object.defineProperty({__proto__:null,default:JJ},Symbol.toStringTag,{value:"Module"})),tee=z_(eee);Object.defineProperty(NC,"__esModule",{value:!0});NC.default=cee;var Wg=oee(k),nee=LC(nl),ree=LC(tee),iee=LC(pC);function LC(e){return e&&e.__esModule?e:{default:e}}function q5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(q5=function(r){return r?n:t})(e)}function oee(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=q5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function X1(){return X1=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},X1.apply(this,arguments)}function lu(e,t,n){return t=see(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function see(e){var t=aee(e,"string");return typeof t=="symbol"?t:String(t)}function aee(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 lee="react-grid-layout";function cee(e){var t;return t=class extends Wg.Component{constructor(){super(...arguments),lu(this,"state",{width:1280}),lu(this,"elementRef",Wg.createRef()),lu(this,"mounted",!1),lu(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new ree.default(i=>{if(this.elementRef.current instanceof HTMLElement){const s=i[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...i}=this.props;return r&&!this.mounted?Wg.createElement("div",{className:(0,iee.default)(this.props.className,lee),style:this.props.style,ref:this.elementRef}):Wg.createElement(e,X1({innerRef:this.elementRef},i,this.state))}},lu(t,"defaultProps",{measureBeforeMount:!1}),lu(t,"propTypes",{measureBeforeMount:nee.default.bool}),t}(function(e){e.exports=fp.default,e.exports.utils=Pt,e.exports.calculateUtils=ms,e.exports.Responsive=Wy.default,e.exports.Responsive.utils=Fc,e.exports.WidthProvider=NC.default})(a5);var Zk=a5.exports;function rl(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var uee=["color"],dee=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=rl(e,uee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),k.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"}))}),fee=["color"],FC=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=rl(e,fee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),k.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"}))}),hee=["color"],Y5=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=rl(e,hee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),k.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"}))}),pee=["color"],gee=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=rl(e,pee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),k.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"}))}),mee=["color"],bee=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=rl(e,mee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),k.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"}))}),yee=["color"],vee=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=rl(e,yee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),k.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"}))}),xee=["color"],K5=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=rl(e,xee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),k.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),wee=["color"],X5=k.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=rl(e,wee);return k.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),k.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Ug;const See=new Uint8Array(16);function _ee(){if(!Ug&&(Ug=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ug))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ug(See)}const mr=[];for(let e=0;e<256;++e)mr.push((e+256).toString(16).slice(1));function Cee(e,t=0){return mr[e[t+0]]+mr[e[t+1]]+mr[e[t+2]]+mr[e[t+3]]+"-"+mr[e[t+4]]+mr[e[t+5]]+"-"+mr[e[t+6]]+mr[e[t+7]]+"-"+mr[e[t+8]]+mr[e[t+9]]+"-"+mr[e[t+10]]+mr[e[t+11]]+mr[e[t+12]]+mr[e[t+13]]+mr[e[t+14]]+mr[e[t+15]]}const Eee=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Jk={randomUUID:Eee};function Ua(e,t,n){if(Jk.randomUUID&&!e)return Jk.randomUUID();e=e||{};const r=e.random||(e.rng||_ee)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Cee(r)}const fi=cN()(mN((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:Ua(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Ua(),cards:[],activeCardId:""},actions:{updateCardTab:(n,r)=>{e(i=>{const o=i.frame,s={...o,cards:o.cards.map(l=>l.id===r.id?r:l),activeCardId:n};i.frame=s;const a=s.cards.find(l=>l.id===n);i.card=a})},setActiveTabCardId:n=>{e(r=>{r.activeTabCardId=n})},setCustomCardPreferences:n=>{e(r=>{r.card.customCardPreferences=n})},setChartOrientation:n=>{e(r=>{var s,a,l,c,u,d;const i=r.card.preferences;let o={};((s=i==null?void 0:i.chartOptions)==null?void 0:s.indexAxis)!==n&&(o={x:(l=(a=i==null?void 0:i.chartOptions)==null?void 0:a.scales)==null?void 0:l.y,y:(u=(c=i==null?void 0:i.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...i,chartOptions:{...i==null?void 0:i.chartOptions,scales:{...(d=i==null?void 0:i.chartOptions)==null?void 0:d.scales,...o},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,i,o)=>{e(s=>{var a,l,c;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{...(c=(l=s.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:i,suffix:o,enabled:!0}}})},setColorRanges:n=>{e(r=>{var i,o;r.card.preferences={...r.card.preferences,formatNumber:{...(o=(i=r.card)==null?void 0:i.preferences)==null?void 0:o.formatNumber,colorRanges:n}}})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},updateCardInFrame:n=>{e(r=>{r.frame.cards=r.frame.cards.map(i=>i.id===n.id?n:i)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},switchCardType:n=>{e(r=>{r.card.type=n,r.card.sql="",r.card.python="",r.card.cfg={},r.card.customCfg={},r.card.preferences={}})},setCardType:n=>{e(r=>{var i;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(i=r.card.preferences)==null?void 0:i.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(i=>{i.sqlGen.measures=[...i.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setSelectedDatamodelId:n=>{var r,i;e(o=>{o.selectedDatamodelId=n,o.card.datamodelId=n}),(i=(r=t()).onDatamodelChange)==null||i.call(r,n)},setSelectedConnectionId:n=>{var r,i;e(o=>{o.selectedConnectionId=n,o.card.connectionId=n}),(i=(r=t()).onConnectionChange)==null||i.call(r,n)},setSelectedDatabaseName:n=>{var r,i;e(o=>{o.selectedDatabaseName=n,o.card.lastSelectedDatabase=n}),(i=(r=t()).onDatabaseChange)==null||i.call(r,n)},setSelectedSchemaName:n=>{var r,i;e(o=>{o.selectedSchemaName=n,o.card.lastSelectedSchema=n}),(i=(r=t()).onSchemaChange)==null||i.call(r,n)},setSelectedTableName:n=>{var r,i;e(o=>{o.selectedTableName=n,o.card.lastSelectedTable=n}),(i=(r=t()).onTableChange)==null||i.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),gp=()=>fi(e=>e.actions);function Ree(e){return/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(e)}function Pee(e,t=1){if(!Ree(e)||t===1)return e;e=e.replace(/^#/,"");const n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16);return t=Math.min(Math.max(t,0),1),`rgba(${n}, ${r}, ${i}, ${t})`}function Tee(e,t,n,r=1){var c,u,d,p;const i=n==null?void 0:n.datasetOptions,o=ye.getState().themeStyle,s=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,a=(p=(d=o==null?void 0:o.chart)==null?void 0:d.dataset)==null?void 0:p.borderColor;return e.map((h,m)=>{var E;const b=i==null?void 0:i.find(C=>C.idx===m),y=Pee(s==null?void 0:s[m%s.length],r),x=a==null?void 0:a[m%a.length],w=a==null?void 0:a[m%a.length];return{label:h.charAt(0).toUpperCase()+h.slice(1),data:t.map(C=>C[h]),...b,datalabels:{...b==null?void 0:b.datalabels,color:kee((E=b==null?void 0:b.datalabels)==null?void 0:E.align,y)},backgroundColor:y,pointBackgroundColor:x,borderColor:w}})}function kee(e,t){return sd(e==="end"||e==="start"?Eh():t)}function Aee(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=lr(e);let r=[];const i=ye.getState().themeStyle,o=(l=(a=i==null?void 0:i.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=i==null?void 0:i.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const d=e.map(p=>({x:p[t[0]],y:p[t[1]],r:p[t[2]],label:p[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:d}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(p=>p[n==null?void 0:n[1]]))].map((p,h)=>{const m=e.filter(b=>b[n==null?void 0:n[1]]===p);return{label:p,data:m.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:o==null?void 0:o[h%o.length],borderColor:s==null?void 0:s[h%s.length]}})),r}function Oee(e){var c,u,d,p;const{dimensionKeys:t,metricKeys:n}=lr(e),r=ye.getState().themeStyle,i=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,o=(p=(d=r==null?void 0:r.chart)==null?void 0:d.dataset)==null?void 0:p.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(h=>h==null?void 0:h[s]))].map((h,m)=>({label:h,data:e.filter(b=>(b==null?void 0:b[s])===h).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:i==null?void 0:i[m%i.length],borderColor:o==null?void 0:o[m%o.length],borderSkipped:!1}))}function Mee(e,t){var s,a,l,c;const n=ye.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,i=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(d=>d[u]),backgroundColor:t.map((d,p)=>(d==null?void 0:d._color)||(r==null?void 0:r[p%r.length])),borderColor:t.map((d,p)=>(d==null?void 0:d._color)||(i==null?void 0:i[p%i.length]))}))}function Iee(e){let t=-1,n=0;return e.forEach((r,i)=>{const o=Object.keys(r).length;o>n&&(t=i,n=o)}),t}function lr(e){if(!e||e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=Iee(e),n=Object.keys(e[t]),r=n.filter(o=>{var s,a,l,c,u,d,p,h;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[o])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[o])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[o])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[o])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[o])&&typeof((d=e==null?void 0:e[1])==null?void 0:d[o])=="string"||typeof((p=e==null?void 0:e[2])==null?void 0:p[o])&&typeof((h=e==null?void 0:e[2])==null?void 0:h[o])=="string")});r.length===0&&r.push(n[0]);const i=n.filter(o=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[o])===+((a=e==null?void 0:e[t])==null?void 0:a[o])});return{keys:n,dimensionKeys:r,metricKeys:i}}function Hf(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((o,s)=>({...o,...n==null?void 0:n[s],data:o.data,label:o.label})):e}function Dee(e,t="asc"){function n(r){return Object.entries(r).slice(1).reduce((s,[a,l])=>{const c=typeof l=="number"?l:parseFloat(l);return s+(isNaN(c)?0:c)},0)}return e.sort((r,i)=>{const o=n(r),s=n(i);return t==="asc"?o-s:s-o})}function wb({dataArray:e,groupKey:t,pivotKey:n,valueKey:r,sortChart:i}){const o=e.reduce((l,c)=>{const u=c[t],d=c[n],p=c[r];return l[u]||(l[u]={[t]:u}),l[u][d]=p,l},{});let s=Object.values(o);return i!=="none"&&i!==void 0&&(s=Dee(s,i)),s.map(l=>Object.fromEntries(Object.entries(l).filter(([c,u])=>u!==0)))}function di(e,t){var s;const n=ye.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,i=tc.cloneDeep(r);return tc.merge(i,e,t)}function Q1(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
113
- * @license lucide-react v0.453.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */const Nee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Q5=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
118
- * @license lucide-react v0.453.0 - ISC
119
- *
120
- * This source code is licensed under the ISC license.
121
- * See the LICENSE file in the root directory of this source tree.
122
- */var Lee={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
123
- * @license lucide-react v0.453.0 - ISC
124
- *
125
- * This source code is licensed under the ISC license.
126
- * See the LICENSE file in the root directory of this source tree.
127
- */const Z5=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>k.createElement("svg",{ref:l,...Lee,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Q5("lucide",i),...a},[...s.map(([c,u])=>k.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
128
- * @license lucide-react v0.453.0 - ISC
129
- *
130
- * This source code is licensed under the ISC license.
131
- * See the LICENSE file in the root directory of this source tree.
132
- */const Bt=(e,t)=>{const n=k.forwardRef(({className:r,...i},o)=>k.createElement(Z5,{ref:o,iconNode:t,className:Q5(`lucide-${Nee(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
133
- * @license lucide-react v0.453.0 - ISC
134
- *
135
- * This source code is licensed under the ISC license.
136
- * See the LICENSE file in the root directory of this source tree.
137
- */const J5=Bt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
138
- * @license lucide-react v0.453.0 - ISC
139
- *
140
- * This source code is licensed under the ISC license.
141
- * See the LICENSE file in the root directory of this source tree.
142
- */const Md=Bt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
143
- * @license lucide-react v0.453.0 - ISC
144
- *
145
- * This source code is licensed under the ISC license.
146
- * See the LICENSE file in the root directory of this source tree.
147
- */const mp=Bt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
148
- * @license lucide-react v0.453.0 - ISC
149
- *
150
- * This source code is licensed under the ISC license.
151
- * See the LICENSE file in the root directory of this source tree.
152
- */const jC=Bt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
153
- * @license lucide-react v0.453.0 - ISC
154
- *
155
- * This source code is licensed under the ISC license.
156
- * See the LICENSE file in the root directory of this source tree.
157
- */const Gy=Bt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
158
- * @license lucide-react v0.453.0 - ISC
159
- *
160
- * This source code is licensed under the ISC license.
161
- * See the LICENSE file in the root directory of this source tree.
162
- */const eL=Bt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
163
- * @license lucide-react v0.453.0 - ISC
164
- *
165
- * This source code is licensed under the ISC license.
166
- * See the LICENSE file in the root directory of this source tree.
167
- */const $C=Bt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
168
- * @license lucide-react v0.453.0 - ISC
169
- *
170
- * This source code is licensed under the ISC license.
171
- * See the LICENSE file in the root directory of this source tree.
172
- */const zC=Bt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
173
- * @license lucide-react v0.453.0 - ISC
174
- *
175
- * This source code is licensed under the ISC license.
176
- * See the LICENSE file in the root directory of this source tree.
177
- */const tL=Bt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
178
- * @license lucide-react v0.453.0 - ISC
179
- *
180
- * This source code is licensed under the ISC license.
181
- * See the LICENSE file in the root directory of this source tree.
182
- */const nL=Bt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
183
- * @license lucide-react v0.453.0 - ISC
184
- *
185
- * This source code is licensed under the ISC license.
186
- * See the LICENSE file in the root directory of this source tree.
187
- */const rL=Bt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
188
- * @license lucide-react v0.453.0 - ISC
189
- *
190
- * This source code is licensed under the ISC license.
191
- * See the LICENSE file in the root directory of this source tree.
192
- */const BC=Bt("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
193
- * @license lucide-react v0.453.0 - ISC
194
- *
195
- * This source code is licensed under the ISC license.
196
- * See the LICENSE file in the root directory of this source tree.
197
- */const iL=Bt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
198
- * @license lucide-react v0.453.0 - ISC
199
- *
200
- * This source code is licensed under the ISC license.
201
- * See the LICENSE file in the root directory of this source tree.
202
- */const oL=Bt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
203
- * @license lucide-react v0.453.0 - ISC
204
- *
205
- * This source code is licensed under the ISC license.
206
- * See the LICENSE file in the root directory of this source tree.
207
- */const sL=Bt("IdCard",[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]);/**
208
- * @license lucide-react v0.453.0 - ISC
209
- *
210
- * This source code is licensed under the ISC license.
211
- * See the LICENSE file in the root directory of this source tree.
212
- */const aL=Bt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
213
- * @license lucide-react v0.453.0 - ISC
214
- *
215
- * This source code is licensed under the ISC license.
216
- * See the LICENSE file in the root directory of this source tree.
217
- */const lL=Bt("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
218
- * @license lucide-react v0.453.0 - ISC
219
- *
220
- * This source code is licensed under the ISC license.
221
- * See the LICENSE file in the root directory of this source tree.
222
- */const cL=Bt("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
223
- * @license lucide-react v0.453.0 - ISC
224
- *
225
- * This source code is licensed under the ISC license.
226
- * See the LICENSE file in the root directory of this source tree.
227
- */const uL=Bt("Octagon",[["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]]);/**
228
- * @license lucide-react v0.453.0 - ISC
229
- *
230
- * This source code is licensed under the ISC license.
231
- * See the LICENSE file in the root directory of this source tree.
232
- */const dL=Bt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
233
- * @license lucide-react v0.453.0 - ISC
234
- *
235
- * This source code is licensed under the ISC license.
236
- * See the LICENSE file in the root directory of this source tree.
237
- */const fL=Bt("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
238
- * @license lucide-react v0.453.0 - ISC
239
- *
240
- * This source code is licensed under the ISC license.
241
- * See the LICENSE file in the root directory of this source tree.
242
- */const hL=Bt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
243
- * @license lucide-react v0.453.0 - ISC
244
- *
245
- * This source code is licensed under the ISC license.
246
- * See the LICENSE file in the root directory of this source tree.
247
- */const qy=Bt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
248
- * @license lucide-react v0.453.0 - ISC
249
- *
250
- * This source code is licensed under the ISC license.
251
- * See the LICENSE file in the root directory of this source tree.
252
- */const pL=Bt("SearchX",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
253
- * @license lucide-react v0.453.0 - ISC
254
- *
255
- * This source code is licensed under the ISC license.
256
- * See the LICENSE file in the root directory of this source tree.
257
- */const gL=Bt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
258
- * @license lucide-react v0.453.0 - ISC
259
- *
260
- * This source code is licensed under the ISC license.
261
- * See the LICENSE file in the root directory of this source tree.
262
- */const mL=Bt("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
263
- * @license lucide-react v0.453.0 - ISC
264
- *
265
- * This source code is licensed under the ISC license.
266
- * See the LICENSE file in the root directory of this source tree.
267
- */const bL=Bt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
268
- * @license lucide-react v0.453.0 - ISC
269
- *
270
- * This source code is licensed under the ISC license.
271
- * See the LICENSE file in the root directory of this source tree.
272
- */const yL=Bt("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
273
- * @license lucide-react v0.453.0 - ISC
274
- *
275
- * This source code is licensed under the ISC license.
276
- * See the LICENSE file in the root directory of this source tree.
277
- */const vL=Bt("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);/**
278
- * @license lucide-react v0.453.0 - ISC
279
- *
280
- * This source code is licensed under the ISC license.
281
- * See the LICENSE file in the root directory of this source tree.
282
- */const xL=Bt("TreePalm",[["path",{d:"M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4",key:"foxbe7"}],["path",{d:"M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3",key:"18arnh"}],["path",{d:"M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35",key:"ywahnh"}],["path",{d:"M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14",key:"ft0feo"}]]);/**
283
- * @license lucide-react v0.453.0 - ISC
284
- *
285
- * This source code is licensed under the ISC license.
286
- * See the LICENSE file in the root directory of this source tree.
287
- */const wL=Bt("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
288
- * @license lucide-react v0.453.0 - ISC
289
- *
290
- * This source code is licensed under the ISC license.
291
- * See the LICENSE file in the root directory of this source tree.
292
- */const SL=Bt("UserSearch",[["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}],["path",{d:"M10.3 15H7a4 4 0 0 0-4 4v2",key:"3bnktk"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}]]);/**
293
- * @license lucide-react v0.453.0 - ISC
294
- *
295
- * This source code is licensed under the ISC license.
296
- * See the LICENSE file in the root directory of this source tree.
297
- */const jc=Bt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Fee=({data:e,filename:t="output.csv"})=>{const n=()=>{if(e.length===0)return;const r=[],i=Object.keys(e[0]);r.push(i.join(","));for(const c of e){const u=i.map(d=>`"${(""+c[d]).replace(/"/g,'""')}"`);r.push(u.join(","))}const o=r.join(`
298
- `),s=new Blob([o],{type:"text/csv"}),a=window.URL.createObjectURL(s),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",a),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return v.jsx(tL,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};var ld=1e3,cd=ld*60,ud=cd*60,xc=ud*24,jee=xc*7,$ee=xc*365.25,zee=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Bee(e);if(n==="number"&&isFinite(e))return t.long?Vee(e):Hee(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Bee(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*$ee;case"weeks":case"week":case"w":return n*jee;case"days":case"day":case"d":return n*xc;case"hours":case"hour":case"hrs":case"hr":case"h":return n*ud;case"minutes":case"minute":case"mins":case"min":case"m":return n*cd;case"seconds":case"second":case"secs":case"sec":case"s":return n*ld;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Hee(e){var t=Math.abs(e);return t>=xc?Math.round(e/xc)+"d":t>=ud?Math.round(e/ud)+"h":t>=cd?Math.round(e/cd)+"m":t>=ld?Math.round(e/ld)+"s":e+"ms"}function Vee(e){var t=Math.abs(e);return t>=xc?Gg(e,t,xc,"day"):t>=ud?Gg(e,t,ud,"hour"):t>=cd?Gg(e,t,cd,"minute"):t>=ld?Gg(e,t,ld,"second"):e+" ms"}function Gg(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+" "+r+(i?"s":"")}const Wee=Ic(zee);function Uee(e){const t=ye(u=>u.selectedSheetId),n=ye(u=>u.selectedLensId);ye(u=>u.dashboard.baseQueries);const r=ye(u=>u.dashboard.filters),i=ye(u=>u.filterValues),o=r==null?void 0:r.filter(u=>u.sheetId===t||!u.sheetId),s=i==null?void 0:i.filter(u=>(o==null?void 0:o.some(d=>d.id===u.filterId))||u.filterId.endsWith(t)),a=(e==null?void 0:e.sql)||"",l=Gee((e==null?void 0:e.python)||"");return{queryKey:["query",e==null?void 0:e.id,e==null?void 0:e.title,a,l,n||"",JSON.stringify(s)],sql:a,sheetFilterValues:s}}function Gee(e){return e===q_?"":e}function Ga(e,t){const{authToken:n}=Wi(),r=ye(p=>p.isVisualEditing),i=ye(p=>p.authToken),o=Wee((e==null?void 0:e.refreshInterval)||"0"),{queryKey:s,sql:a,sheetFilterValues:l}=Uee(e);let c={};return r||(c={refetchInterval:o}),{...dp({queryKey:s,queryFn:async()=>{var p;if(!(e!=null&&e.connectionId)||!((p=e==null?void 0:e.sql)!=null&&p.trim()))return null;try{return await Ry("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(i==null?void 0:i.accessToken)||"",{connection_id:e.connectionId,sql:a,python:e.python===q_?"":e.python,active_filters:l,cache_config:J_({card:e})})}catch(h){if(r)return{records:[],error:h};throw h}},placeholderData:vX,...c,enabled:!!(e!=null&&e.connectionId)&&!!(e!=null&&e.sql)&&!0&&!r}),queryKey:s}}function _L({frame:e}){var C;const t=ye(R=>R.isDashboardEditing),n=ye(R=>R.filterValues),r=ye(R=>R.isVisualEditing),i=ye(R=>R.selectedSheetId);ye(R=>R.currentBreakpoint);const{removeFrame:o}=ye(R=>R.actions),s=ye(R=>R.actions.setIsVisualEditing),a=fi(R=>R.actions.setFilterValues),l=fi(R=>R.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:d,setActiveTabCardId:p}=gp(),h=fi(R=>R.actions.setSelectedConnectionId),m=fi(R=>R.actions.setSelectedDatamodelId),b=fi(R=>R.actions.setSelectedDatabaseName),y=fi(R=>R.actions.setSelectedSchemaName),x=fi(R=>R.actions.setSelectedTableName),w=e.cards.find(R=>R.id===e.activeCardId),{data:_}=Ga(w);function E(){s(!r),c(w),p(e.activeCardId);const{dimensionKeys:R}=lr((_==null?void 0:_.records)||[]);d(R),u(e),w!=null&&w.connectionId&&h(w==null?void 0:w.connectionId),w!=null&&w.datamodelId&&w.datamodelId!=="none"&&(m(w==null?void 0:w.datamodelId),b("")),w!=null&&w.lastSelectedDatabase&&w.lastSelectedDatabase!=="none"&&(b(w==null?void 0:w.lastSelectedDatabase),m("")),w!=null&&w.lastSelectedSchema&&y(w==null?void 0:w.lastSelectedSchema),w!=null&&w.lastSelectedTable&&x(w==null?void 0:w.lastSelectedTable),n&&(a(n),l(!0))}return v.jsx("section",{onMouseDown:R=>{R.stopPropagation()},className:"absolute right-2 top-2 z-50",children:v.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?v.jsx("button",{onClick:()=>{s(!r)},children:v.jsx(gee,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}):v.jsx("button",{role:"edit-visual",onClick:E,children:v.jsx(bee,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})),t&&v.jsx("button",{onClick:()=>o(i,e.id),children:v.jsx(Y5,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}),((C=w.preferences)==null?void 0:C.allowDownload)===!0&&v.jsx(Fee,{data:(_==null?void 0:_.records)||[],filename:w.title})]})})}function qee(e,t){ye(s=>s.selectedSheetId);const n=ye(s=>s.selectedFrameId),r=ye(s=>s.isDashboardEditing),i=ye(s=>s.isVisualEditing);ye(s=>s.actions),k.useEffect(()=>{n===e.id&&r&&!i&&o()},[n,e.id,r,i]);function o(){const s=t==null?void 0:t.current;s==null||s.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}const Yee=k.createContext(null),Ix={didCatch:!1,error:null};class Yy extends k.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Ix}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(Ix)}}componentDidCatch(t,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&Kee(t.resetKeys,i)){var o,s;(o=(s=this.props).onReset)===null||o===void 0||o.call(s,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Ix)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:s}=this.state;let a=t;if(o){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=k.createElement(r,l);else if(i!==void 0)a=i;else throw s}return k.createElement(Yee.Provider,{value:{didCatch:o,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Kee(){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 HC({error:e}){return v.jsx("div",{className:"flex flex-col items-center justify-center",role:"alert",style:{height:"100%",width:"100%"},children:v.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md bg-muted p-10",children:[v.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),v.jsx("p",{className:"text-sm",children:"Something went wrong:"}),v.jsx("pre",{className:"text-xs",children:e.message})]})})}function Xee({error:e,frame:t}){return v.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[v.jsx(_L,{frame:t}),v.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),v.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[v.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),v.jsx("p",{className:"text-sm",children:"Something went wrong:"}),v.jsx("pre",{className:"text-xs",children:e.message})]})]})}function Qee({error:e}){return v.jsxs("div",{className:"flex h-full flex-col items-center justify-center",role:"alert",children:[v.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),v.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[v.jsx("p",{className:"text-lg font-semibold",children:"Oops! Something went wrong!"}),v.jsx("p",{className:"text-sm",children:"Something went wrong:"}),v.jsx("pre",{className:"text-xs",children:e.message})]})]})}function ao({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:i="",locale:o="en-US"}){let s=1,a=r,l=o;const c=t;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&o==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&o==="en-IN"?(s=1e5,a="L"):e>=1e6?(s=1e6,a="M"):e>=1e3&&(s=1e3,a="K"));const u=e/s,d={maximumFractionDigits:c,minimumFractionDigits:c};if(i){d.style="currency",d.currency=i;try{new Intl.NumberFormat(o,d).format(0)}catch{}}try{new Intl.NumberFormat(o,d).format(0)}catch{l="en-US"}let h=new Intl.NumberFormat(l,d).format(u);return n&&(h+=a),h}function VC(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function Z1(e){try{const n=new Function("getDatalabelColor",e)(S1);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 Zee(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return CL(t)}function CL(e){const[t,n,r]=e.split(" "),i=parseFloat(t),o=parseFloat(n),s=parseFloat(r),a=o/100,l=s/100,c=(1-Math.abs(2*l-1))*a,u=c*(1-Math.abs(i/60%2-1)),d=l-c/2;let p=0,h=0,m=0;0<=i&&i<60?(p=c,h=u,m=0):60<=i&&i<120?(p=u,h=c,m=0):120<=i&&i<180?(p=0,h=c,m=u):180<=i&&i<240?(p=0,h=u,m=c):240<=i&&i<300?(p=u,h=0,m=c):300<=i&&i<360&&(p=c,h=0,m=u),p=Math.round((p+d)*255),h=Math.round((h+d)*255),m=Math.round((m+d)*255);const b=y=>{const x=y.toString(16);return x.length==1?"0"+x:x};return`#${b(p)}${b(h)}${b(m)}`}function _l({data:e,cfg:t,customCfg:n,preferences:r,cardType:i}){ye.getState().themeStyle;const o=i==="radar"?.2:1,{dimensionKeys:s,metricKeys:a}=lr(e),l=Tee(a,e,r,o),c=Hf(l,n),u=s[0],d=Q1(e,u);WC(r,t),EL(r);const{options:p,plugins:h}=PL({cfg:t,preferences:r,customCfg:n});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:d,datasets:c},options:p,plugins:h}}function WC(e,t){var i,o,s;const n=((i=t==null?void 0:t.options)==null?void 0:i.indexAxis)==="y"?"x":"y";return(o=e==null?void 0:e.chartOptions)!=null&&o.indexAxis?((s=e==null?void 0:e.chartOptions)==null?void 0:s.indexAxis)==="x"?"y":"x":n}function EL(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 RL(e,t){var o,s,a,l,c,u,d,p,h,m,b,y;const n=WC(t,e),r=EL(t);return{...e==null?void 0:e.options,scales:{...(o=e==null?void 0:e.options)==null?void 0:o.scales,[n]:{...(a=(s=e==null?void 0:e.options)==null?void 0:s.scales)==null?void 0:a[n],ticks:{...(u=(c=(l=e==null?void 0:e.options)==null?void 0:l.scales)==null?void 0:c[n])==null?void 0:u.ticks,callback:x=>{var w,_,E,C;return ao({number:Number(x),decimalPlaces:((w=t==null?void 0:t.numberAxisFormat)==null?void 0:w.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.suffix),customSuffix:"",locale:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}},[r]:{...(h=(p=(d=e==null?void 0:e.options)==null?void 0:d.scales)==null?void 0:p[r])==null?void 0:h.ticks,callback:null}},plugins:{...(m=e==null?void 0:e.options)==null?void 0:m.plugins,datalabels:{...(y=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:y.datalabels,formatter:function(x){var w,_,E,C;return ao({number:Number(x),decimalPlaces:((w=t==null?void 0:t.numberAxisFormat)==null?void 0:w.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.suffix),customSuffix:"",locale:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}}}}function PL({cfg:e,preferences:t,customCfg:n}){var p,h,m,b,y,x,w,_,E,C,R,T,M,N,j,F,$,Q,H,L,G,V,B,X,I,q,U,O,ee,K,oe;const r=ye.getState().themeStyle,i=RL(e,t),o=di((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),s=di(i,o),a=di(s,(n==null?void 0:n.options)||{}),l={...a,scales:{...a==null?void 0:a.scales,x:{...(p=a==null?void 0:a.scales)==null?void 0:p.x,grid:{...(m=(h=a==null?void 0:a.scales)==null?void 0:h.x)==null?void 0:m.grid,color:(_=(w=(x=(y=(b=r==null?void 0:r.chart)==null?void 0:b.options)==null?void 0:y.scales)==null?void 0:x.x)==null?void 0:w.grid)==null?void 0:_.color}},y:{...(E=a==null?void 0:a.scales)==null?void 0:E.y,grid:{...(R=(C=a==null?void 0:a.scales)==null?void 0:C.y)==null?void 0:R.grid,color:(F=(j=(N=(M=(T=r==null?void 0:r.chart)==null?void 0:T.options)==null?void 0:M.scales)==null?void 0:N.y)==null?void 0:j.grid)==null?void 0:F.color}}},plugins:{...a==null?void 0:a.plugins,tooltip:{filter:function(Y){return Y.raw!==void 0&&Y.raw!==0},callbacks:{title:function(Y){var se,ae,ge,ne,fe;const J=((se=Y==null?void 0:Y[0])==null?void 0:se.label)||"";if(Y.length>1){const he=Y.reduce((Ae,Le)=>{const ke=Le.raw;return ke!==void 0&&ke!==0?Ae+ke:Ae},0),_e=ao({number:he,decimalPlaces:((ae=t==null?void 0:t.numberAxisFormat)==null?void 0:ae.decimalPlaces)||0,useSuffix:!!((ge=t==null?void 0:t.numberAxisFormat)!=null&&ge.suffix),customSuffix:"",locale:((ne=t==null?void 0:t.numberAxisFormat)==null?void 0:ne.locale)||"",currency:((fe=t==null?void 0:t.numberAxisFormat)==null?void 0:fe.currency)||""});return`${J} (${_e})`}return J},label:function(Y){var ge,ne,fe,he,_e;const J=((ge=Y==null?void 0:Y.dataset)==null?void 0:ge.label)||"",se=Y==null?void 0:Y.raw;if(se===void 0||se===0)return;const ae=ao({number:Number(se),decimalPlaces:((ne=t==null?void 0:t.numberAxisFormat)==null?void 0:ne.decimalPlaces)||0,useSuffix:!!((fe=t==null?void 0:t.numberAxisFormat)!=null&&fe.suffix),customSuffix:"",locale:((he=t==null?void 0:t.numberAxisFormat)==null?void 0:he.locale)||"",currency:((_e=t==null?void 0:t.numberAxisFormat)==null?void 0:_e.currency)||""});return`${J}: ${ae}`},...(Q=($=a==null?void 0:a.plugins)==null?void 0:$.tooltip)==null?void 0:Q.callbacks},...(H=a==null?void 0:a.plugins)==null?void 0:H.tooltip,backgroundColor:(B=(V=(G=(L=r==null?void 0:r.chart)==null?void 0:L.options)==null?void 0:G.plugins)==null?void 0:V.tooltip)==null?void 0:B.backgroundColor,bodyColor:(U=(q=(I=(X=r==null?void 0:r.chart)==null?void 0:X.options)==null?void 0:I.plugins)==null?void 0:q.tooltip)==null?void 0:U.bodyColor,titleColor:(oe=(K=(ee=(O=r==null?void 0:r.chart)==null?void 0:O.options)==null?void 0:ee.plugins)==null?void 0:K.tooltip)==null?void 0:oe.titleColor}}},{plugins:c,options:u}=Z1((t==null?void 0:t.customVisualCode)||"");return{options:di(l,u),plugins:c}}/*!
299
- * @kurkle/color v0.3.4
300
- * https://github.com/kurkle/color#readme
301
- * (c) 2024 Jukka Kurkela
302
- * Released under the MIT License
303
- */function bp(e){return e+.5|0}const Na=(e,t,n)=>Math.max(Math.min(e,n),t);function Vf(e){return Na(bp(e*2.55),0,255)}function Ha(e){return Na(bp(e*255),0,255)}function Vs(e){return Na(bp(e/2.55)/100,0,1)}function eA(e){return Na(bp(e*100),0,100)}const to={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},J1=[..."0123456789ABCDEF"],Jee=e=>J1[e&15],ete=e=>J1[(e&240)>>4]+J1[e&15],qg=e=>(e&240)>>4===(e&15),tte=e=>qg(e.r)&&qg(e.g)&&qg(e.b)&&qg(e.a);function nte(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&to[e[1]]*17,g:255&to[e[2]]*17,b:255&to[e[3]]*17,a:t===5?to[e[4]]*17:255}:(t===7||t===9)&&(n={r:to[e[1]]<<4|to[e[2]],g:to[e[3]]<<4|to[e[4]],b:to[e[5]]<<4|to[e[6]],a:t===9?to[e[7]]<<4|to[e[8]]:255})),n}const rte=(e,t)=>e<255?t(e):"";function ite(e){var t=tte(e)?Jee:ete;return e?"#"+t(e.r)+t(e.g)+t(e.b)+rte(e.a,t):void 0}const ote=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function TL(e,t,n){const r=t*Math.min(n,1-n),i=(o,s=(o+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[i(0),i(8),i(4)]}function ste(e,t,n){const r=(i,o=(i+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function ate(e,t,n){const r=TL(e,1,.5);let i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function lte(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function UC(e){const n=e.r/255,r=e.g/255,i=e.b/255,o=Math.max(n,r,i),s=Math.min(n,r,i),a=(o+s)/2;let l,c,u;return o!==s&&(u=o-s,c=a>.5?u/(2-o-s):u/(o+s),l=lte(n,r,i,u,o),l=l*60+.5),[l|0,c||0,a]}function GC(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Ha)}function qC(e,t,n){return GC(TL,e,t,n)}function cte(e,t,n){return GC(ate,e,t,n)}function ute(e,t,n){return GC(ste,e,t,n)}function kL(e){return(e%360+360)%360}function dte(e){const t=ote.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Vf(+t[5]):Ha(+t[5]));const i=kL(+t[2]),o=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=cte(i,o,s):t[1]==="hsv"?r=ute(i,o,s):r=qC(i,o,s),{r:r[0],g:r[1],b:r[2],a:n}}function fte(e,t){var n=UC(e);n[0]=kL(n[0]+t),n=qC(n),e.r=n[0],e.g=n[1],e.b=n[2]}function hte(e){if(!e)return;const t=UC(e),n=t[0],r=eA(t[1]),i=eA(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${Vs(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const tA={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"},nA={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 pte(){const e={},t=Object.keys(nA),n=Object.keys(tA);let r,i,o,s,a;for(r=0;r<t.length;r++){for(s=a=t[r],i=0;i<n.length;i++)o=n[i],a=a.replace(o,tA[o]);o=parseInt(nA[s],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let Yg;function gte(e){Yg||(Yg=pte(),Yg.transparent=[0,0,0,0]);const t=Yg[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const mte=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function bte(e){const t=mte.exec(e);let n=255,r,i,o;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Vf(s):Na(s*255,0,255)}return r=+t[1],i=+t[3],o=+t[5],r=255&(t[2]?Vf(r):Na(r,0,255)),i=255&(t[4]?Vf(i):Na(i,0,255)),o=255&(t[6]?Vf(o):Na(o,0,255)),{r,g:i,b:o,a:n}}}function yte(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Vs(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Dx=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,cu=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function vte(e,t,n){const r=cu(Vs(e.r)),i=cu(Vs(e.g)),o=cu(Vs(e.b));return{r:Ha(Dx(r+n*(cu(Vs(t.r))-r))),g:Ha(Dx(i+n*(cu(Vs(t.g))-i))),b:Ha(Dx(o+n*(cu(Vs(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Kg(e,t,n){if(e){let r=UC(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=qC(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function AL(e,t){return e&&Object.assign(t||{},e)}function rA(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Ha(e[3]))):(t=AL(e,{r:0,g:0,b:0,a:1}),t.a=Ha(t.a)),t}function xte(e){return e.charAt(0)==="r"?bte(e):dte(e)}let OL=class eS{constructor(t){if(t instanceof eS)return t;const n=typeof t;let r;n==="object"?r=rA(t):n==="string"&&(r=nte(t)||gte(t)||xte(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=AL(this._rgb);return t&&(t.a=Vs(t.a)),t}set rgb(t){this._rgb=rA(t)}rgbString(){return this._valid?yte(this._rgb):void 0}hexString(){return this._valid?ite(this._rgb):void 0}hslString(){return this._valid?hte(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,i=t.rgb;let o;const s=n===o?.5:n,a=2*s-1,l=r.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,r.r=255&c*r.r+o*i.r+.5,r.g=255&c*r.g+o*i.g+.5,r.b=255&c*r.b+o*i.b+.5,r.a=s*r.a+(1-s)*i.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=vte(this._rgb,t._rgb,n)),this}clone(){return new eS(this.rgb)}alpha(t){return this._rgb.a=Ha(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=bp(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 Kg(this._rgb,2,t),this}darken(t){return Kg(this._rgb,2,-t),this}saturate(t){return Kg(this._rgb,1,t),this}desaturate(t){return Kg(this._rgb,1,-t),this}rotate(t){return fte(this._rgb,t),this}};/*!
304
- * Chart.js v4.4.7
305
- * https://www.chartjs.org
306
- * (c) 2024 Chart.js Contributors
307
- * Released under the MIT License
308
- */function Ds(){}const wte=(()=>{let e=0;return()=>e++})();function Rt(e){return e==null}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 Ot(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Ln(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Oi(e,t){return Ln(e)?e:t}function rt(e,t){return typeof e>"u"?t:e}const Ste=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,ML=(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 en(e,t,n,r){let i,o,s;if(_n(e))for(o=e.length,i=0;i<o;i++)t.call(n,e[i],i);else if(Ot(e))for(s=Object.keys(e),o=s.length,i=0;i<o;i++)t.call(n,e[s[i]],s[i])}function Sb(e,t){let n,r,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function _b(e){if(_n(e))return e.map(_b);if(Ot(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=_b(e[n[i]]);return t}return e}function IL(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function _te(e,t,n,r){if(!IL(e))return;const i=t[e],o=n[e];Ot(i)&&Ot(o)?dr(i,o,r):t[e]=_b(o)}function dr(e,t,n){const r=_n(t)?t:[t],i=r.length;if(!Ot(e))return e;n=n||{};const o=n.merger||_te;let s;for(let a=0;a<i;++a){if(s=r[a],!Ot(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)o(l[c],e,s,n)}return e}function rh(e,t){return dr(e,t,{merger:Cte})}function Cte(e,t,n){if(!IL(e))return;const r=t[e],i=n[e];Ot(r)&&Ot(i)?rh(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=_b(i))}const iA={"":e=>e,x:e=>e.x,y:e=>e.y};function Ete(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function Rte(e){const t=Ete(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function qa(e,t){return(iA[t]||(iA[t]=Rte(t)))(e)}function YC(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Th=e=>typeof e<"u",Ya=e=>typeof e=="function",oA=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Pte(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Rn=Math.PI,Cn=2*Rn,Tte=Cn+Rn,Cb=Number.POSITIVE_INFINITY,kte=Rn/180,Hn=Rn/2,Cl=Rn/4,sA=Rn*2/3,La=Math.log10,rs=Math.sign;function ih(e,t,n){return Math.abs(e-t)<n}function aA(e){const t=Math.round(e);e=ih(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(La(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Ate(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((i,o)=>i-o).pop(),t}function dd(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Ote(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function DL(e,t,n){let r,i,o;for(r=0,i=e.length;r<i;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function To(e){return e*(Rn/180)}function KC(e){return e*(180/Rn)}function lA(e){if(!Ln(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function NL(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*Rn&&(o+=Cn),{angle:o,distance:i}}function tS(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Mte(e,t){return(e-t+Tte)%Cn-Rn}function Di(e){return(e%Cn+Cn)%Cn}function kh(e,t,n,r){const i=Di(e),o=Di(t),s=Di(n),a=Di(o-i),l=Di(s-i),c=Di(i-o),u=Di(i-s);return i===o||i===s||r&&o===s||a>l&&c<u}function ur(e,t,n){return Math.max(t,Math.min(n,e))}function Ite(e){return ur(e,-32768,32767)}function Ks(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function XC(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,i=0,o;for(;r-i>1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const Xs=(e,t,n,r)=>XC(e,n,r?i=>{const o=e[i][t];return o<n||o===n&&e[i+1][t]===n}:i=>e[i][t]<n),Dte=(e,t,n)=>XC(e,n,r=>e[r][t]>=n);function Nte(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const LL=["push","pop","shift","splice","unshift"];function Lte(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),LL.forEach(n=>{const r="_onData"+YC(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const s=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function cA(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(LL.forEach(o=>{delete e[o]}),delete e._chartjs)}function FL(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const jL=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function $L(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,jL.call(window,()=>{r=!1,e.apply(t,n)}))}}function Fte(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const QC=e=>e==="start"?"left":e==="end"?"right":"center",Tr=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,jte=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function zL(e,t,n){const r=t.length;let i=0,o=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:p}=s.getUserBounds();d&&(i=ur(Math.min(Xs(a,l,c).lo,n?r:Xs(t,l,s.getPixelForValue(c)).lo),0,r-1)),p?o=ur(Math.max(Xs(a,s.axis,u,!0).hi+1,n?0:Xs(t,l,s.getPixelForValue(u),!0).hi+1),i,r)-i:o=r-i}return{start:i,count:o}}function BL(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}const Xg=e=>e===0||e===1,uA=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Cn/n)),dA=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Cn/n)+1,oh={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*Hn)+1,easeOutSine:e=>Math.sin(e*Hn),easeInOutSine:e=>-.5*(Math.cos(Rn*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=>Xg(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=>Xg(e)?e:uA(e,.075,.3),easeOutElastic:e=>Xg(e)?e:dA(e,.075,.3),easeInOutElastic(e){return Xg(e)?e:e<.5?.5*uA(e*2,.1125,.45):.5+.5*dA(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-oh.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?oh.easeInBounce(e*2)*.5:oh.easeOutBounce(e*2-1)*.5+.5};function ZC(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function fA(e){return ZC(e)?e:new OL(e)}function Nx(e){return ZC(e)?e:new OL(e).saturate(.5).darken(.1).hexString()}const $te=["x","y","borderWidth","radius","tension"],zte=["color","borderColor","backgroundColor"];function Bte(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:zte},numbers:{type:"number",properties:$te}}),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 Hte(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const hA=new Map;function Vte(e,t){t=t||{};const n=e+JSON.stringify(t);let r=hA.get(n);return r||(r=new Intl.NumberFormat(e,t),hA.set(n,r)),r}function yp(e,t,n){return Vte(t,n).format(e)}const HL={values(e){return _n(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,o=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)&&(i="scientific"),o=Wte(e,n)}const s=La(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),yp(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(La(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?HL.numeric.call(this,e,t,n):""}};function Wte(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 Ky={formatters:HL};function Ute(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:Ky.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 wc=Object.create(null),nS=Object.create(null);function sh(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function Lx(e,t,n){return typeof t=="string"?dr(sh(e,t),n):dr(sh(e,""),t)}class Gte{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,i)=>Nx(i.backgroundColor),this.hoverBorderColor=(r,i)=>Nx(i.borderColor),this.hoverColor=(r,i)=>Nx(i.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 Lx(this,t,n)}get(t){return sh(this,t)}describe(t,n){return Lx(nS,t,n)}override(t,n){return Lx(wc,t,n)}route(t,n,r,i){const o=sh(this,t),s=sh(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[i];return Ot(l)?Object.assign({},c,l):rt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var En=new Gte({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Bte,Hte,Ute]);function qte(e){return!e||Rt(e.size)||Rt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Eb(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function Yte(e,t,n,r){r=r||{};let i=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,u,d,p;for(l=0;l<a;l++)if(d=n[l],d!=null&&!_n(d))s=Eb(e,i,o,s,d);else if(_n(d))for(c=0,u=d.length;c<u;c++)p=d[c],p!=null&&!_n(p)&&(s=Eb(e,i,o,s,p));e.restore();const h=o.length/2;if(h>n.length){for(l=0;l<h;l++)delete i[o[l]];o.splice(0,h)}return s}function El(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function pA(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Rb(e,t,n,r){VL(e,t,n,r,null)}function VL(e,t,n,r,i){let o,s,a,l,c,u,d,p;const h=t.pointStyle,m=t.rotation,b=t.radius;let y=(m||0)*kte;if(h&&typeof h=="object"&&(o=h.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(y),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(b)||b<=0)){switch(e.beginPath(),h){default:i?e.ellipse(n,r,i/2,b,0,0,Cn):e.arc(n,r,b,0,Cn),e.closePath();break;case"triangle":u=i?i/2:b,e.moveTo(n+Math.sin(y)*u,r-Math.cos(y)*b),y+=sA,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*b),y+=sA,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*b),e.closePath();break;case"rectRounded":c=b*.516,l=b-c,s=Math.cos(y+Cl)*l,d=Math.cos(y+Cl)*(i?i/2-c:l),a=Math.sin(y+Cl)*l,p=Math.sin(y+Cl)*(i?i/2-c:l),e.arc(n-d,r-a,c,y-Rn,y-Hn),e.arc(n+p,r-s,c,y-Hn,y),e.arc(n+d,r+a,c,y,y+Hn),e.arc(n-p,r+s,c,y+Hn,y+Rn),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*b,u=i?i/2:l,e.rect(n-u,r-l,2*u,2*l);break}y+=Cl;case"rectRot":d=Math.cos(y)*(i?i/2:b),s=Math.cos(y)*b,a=Math.sin(y)*b,p=Math.sin(y)*(i?i/2:b),e.moveTo(n-d,r-a),e.lineTo(n+p,r-s),e.lineTo(n+d,r+a),e.lineTo(n-p,r+s),e.closePath();break;case"crossRot":y+=Cl;case"cross":d=Math.cos(y)*(i?i/2:b),s=Math.cos(y)*b,a=Math.sin(y)*b,p=Math.sin(y)*(i?i/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"star":d=Math.cos(y)*(i?i/2:b),s=Math.cos(y)*b,a=Math.sin(y)*b,p=Math.sin(y)*(i?i/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s),y+=Cl,d=Math.cos(y)*(i?i/2:b),s=Math.cos(y)*b,a=Math.sin(y)*b,p=Math.sin(y)*(i?i/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"line":s=i?i/2:Math.cos(y)*b,a=Math.sin(y)*b,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(y)*(i?i/2:b),r+Math.sin(y)*b);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Qs(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 rc(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function ic(e){e.restore()}function Kte(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Xte(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 Qte(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Rt(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 Zte(e,t,n,r,i){if(i.strikethrough||i.underline){const o=e.measureText(r),s=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(s,u),e.lineTo(a,u),e.stroke()}}function Jte(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,i,o={}){const s=_n(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,Qte(e,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&Jte(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),Rt(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,r,o.maxWidth)),e.fillText(c,n,r,o.maxWidth),Zte(e,n,r,c,o),r+=Number(i.lineHeight);e.restore()}function Ah(e,t){const{x:n,y:r,w:i,h:o,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*Rn,Rn,!0),e.lineTo(n,r+o-s.bottomLeft),e.arc(n+s.bottomLeft,r+o-s.bottomLeft,s.bottomLeft,Rn,Hn,!0),e.lineTo(n+i-s.bottomRight,r+o),e.arc(n+i-s.bottomRight,r+o-s.bottomRight,s.bottomRight,Hn,0,!0),e.lineTo(n+i,r+s.topRight),e.arc(n+i-s.topRight,r+s.topRight,s.topRight,0,-Hn,!0),e.lineTo(n+s.topLeft,r)}const ene=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,tne=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function nne(e,t){const n=(""+e).match(ene);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 rne=e=>+e||0;function JC(e,t){const n={},r=Ot(t),i=r?Object.keys(t):t,o=Ot(e)?r?s=>rt(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=rne(o(s));return n}function WL(e){return JC(e,{top:"y",right:"x",bottom:"y",left:"x"})}function oc(e){return JC(e,["topLeft","topRight","bottomLeft","bottomRight"])}function vr(e){const t=WL(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function qn(e,t){e=e||{},t=t||En.font;let n=rt(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=rt(e.style,t.style);r&&!(""+r).match(tne)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:rt(e.family,t.family),lineHeight:nne(rt(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:rt(e.weight,t.weight),string:""};return i.string=qte(i),i}function wn(e,t,n,r){let i,o,s;for(i=0,o=e.length;i<o;++i)if(s=e[i],s!==void 0&&(t!==void 0&&typeof s=="function"&&(s=s(t)),n!==void 0&&_n(s)&&(s=s[n%s.length]),s!==void 0))return s}function ine(e,t,n){const{min:r,max:i}=e,o=ML(t,(i-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(o)),max:s(i,o)}}function il(e,t){return Object.assign(Object.create(e),t)}function eE(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=YL("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>eE([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return GL(a,l,()=>fne(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return mA(a).includes(l)},ownKeys(a){return mA(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function fd(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:UL(e,r),setContext:o=>fd(e,o,n,r),override:o=>fd(e.override(o),t,n,r)};return new Proxy(i,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return GL(o,s,()=>sne(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function UL(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Ya(n)?n:()=>n,isIndexable:Ya(r)?r:()=>r}}const one=(e,t)=>e?e+YC(t):t,tE=(e,t)=>Ot(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function GL(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function sne(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return Ya(a)&&s.isScriptable(t)&&(a=ane(t,a,e,n)),_n(a)&&a.length&&(a=lne(t,a,e,s.isIndexable)),tE(t,a)&&(a=fd(a,i,o&&o[t],s)),a}function ane(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,s||r);return a.delete(e),tE(e,l)&&(l=nE(i._scopes,i,e,l)),l}function lne(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(Ot(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=nE(c,i,e,u);t.push(fd(d,o,s&&s[e],a))}}return t}function qL(e,t,n){return Ya(e)?e(t,n):e}const cne=(e,t)=>e===!0?t:typeof e=="string"?qa(t,e):void 0;function une(e,t,n,r,i){for(const o of t){const s=cne(n,o);if(s){e.add(s);const a=qL(s._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function nE(e,t,n,r){const i=t._rootScopes,o=qL(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let l=gA(a,s,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=gA(a,s,o,l,r),l===null)?!1:eE(Array.from(a),[""],i,o,()=>dne(t,n,r))}function gA(e,t,n,r,i){for(;n;)n=une(e,t,n,r,i);return n}function dne(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return _n(i)&&Ot(n)?n:i||{}}function fne(e,t,n,r){let i;for(const o of t)if(i=YL(one(o,e),n),typeof i<"u")return tE(e,i)?nE(n,r,e,i):i}function YL(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function mA(e){let t=e._keys;return t||(t=e._keys=hne(e._scopes)),t}function hne(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function KL(e,t,n,r){const{iScale:i}=e,{key:o="r"}=this._parsing,s=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],s[a]={r:i.parse(qa(u,o),c)};return s}const pne=Number.EPSILON||1e-14,hd=(e,t)=>t<e.length&&!e[t].skip&&e[t],XL=e=>e==="x"?"y":"x";function gne(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=tS(o,i),l=tS(s,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,p=r*u;return{previous:{x:o.x-d*(s.x-i.x),y:o.y-d*(s.y-i.y)},next:{x:o.x+p*(s.x-i.x),y:o.y+p*(s.y-i.y)}}}function mne(e,t,n){const r=e.length;let i,o,s,a,l,c=hd(e,0);for(let u=0;u<r-1;++u)if(l=c,c=hd(e,u+1),!(!l||!c)){if(ih(t[u],0,pne)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(i,2)+Math.pow(o,2),!(a<=9)&&(s=3/Math.sqrt(a),n[u]=i*s*t[u],n[u+1]=o*s*t[u])}}function bne(e,t,n="x"){const r=XL(n),i=e.length;let o,s,a,l=hd(e,0);for(let c=0;c<i;++c){if(s=a,a=l,l=hd(e,c+1),!a)continue;const u=a[n],d=a[r];s&&(o=(u-s[n])/3,a[`cp1${n}`]=u-o,a[`cp1${r}`]=d-o*t[c]),l&&(o=(l[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${r}`]=d+o*t[c])}}function yne(e,t="x"){const n=XL(t),r=e.length,i=Array(r).fill(0),o=Array(r);let s,a,l,c=hd(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=hd(e,s+1),!!l){if(c){const u=c[t]-l[t];i[s]=u!==0?(c[n]-l[n])/u:0}o[s]=a?c?rs(i[s-1])!==rs(i[s])?0:(i[s-1]+i[s])/2:i[s-1]:i[s]}mne(e,i,o),bne(e,o,t)}function Qg(e,t,n){return Math.max(Math.min(e,n),t)}function vne(e,t){let n,r,i,o,s,a=Qs(e[0],t);for(n=0,r=e.length;n<r;++n)s=o,o=a,a=n<r-1&&Qs(e[n+1],t),o&&(i=e[n],s&&(i.cp1x=Qg(i.cp1x,t.left,t.right),i.cp1y=Qg(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=Qg(i.cp2x,t.left,t.right),i.cp2y=Qg(i.cp2y,t.top,t.bottom)))}function xne(e,t,n,r,i){let o,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")yne(e,i);else{let c=r?e[e.length-1]:e[0];for(o=0,s=e.length;o<s;++o)a=e[o],l=gne(c,a,e[Math.min(o+1,s-(r?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&vne(e,n)}function rE(){return typeof window<"u"&&typeof document<"u"}function iE(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Pb(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 Xy=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function wne(e,t){return Xy(e).getPropertyValue(t)}const Sne=["top","right","bottom","left"];function sc(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=Sne[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const _ne=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Cne(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,l;if(_ne(i,o,e.target))a=i,l=o;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function Ol(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Xy(n),o=i.boxSizing==="border-box",s=sc(i,"padding"),a=sc(i,"border","width"),{x:l,y:c,box:u}=Cne(e,n),d=s.left+(u&&a.left),p=s.top+(u&&a.top);let{width:h,height:m}=t;return o&&(h-=s.width+a.width,m-=s.height+a.height),{x:Math.round((l-d)/h*n.width/r),y:Math.round((c-p)/m*n.height/r)}}function Ene(e,t,n){let r,i;if(t===void 0||n===void 0){const o=e&&iE(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=Xy(o),l=sc(a,"border","width"),c=sc(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Pb(a.maxWidth,o,"clientWidth"),i=Pb(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||Cb,maxHeight:i||Cb}}const Zg=e=>Math.round(e*10)/10;function Rne(e,t,n,r){const i=Xy(e),o=sc(i,"margin"),s=Pb(i.maxWidth,e,"clientWidth")||Cb,a=Pb(i.maxHeight,e,"clientHeight")||Cb,l=Ene(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const p=sc(i,"border","width"),h=sc(i,"padding");c-=h.width+p.width,u-=h.height+p.height}return c=Math.max(0,c-o.width),u=Math.max(0,r?c/r:u-o.height),c=Zg(Math.min(c,s,l.maxWidth)),u=Zg(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Zg(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Zg(Math.floor(u*r))),{width:c,height:u}}function bA(e,t,n){const r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o?(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const Pne=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};rE()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function yA(e,t){const n=wne(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Ml(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Tne(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 kne(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=Ml(e,i,n),a=Ml(i,o,n),l=Ml(o,t,n),c=Ml(s,a,n),u=Ml(a,l,n);return Ml(c,u,n)}const Ane=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}}},One=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Du(e,t,n){return e?Ane(t,n):One()}function QL(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 ZL(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function JL(e){return e==="angle"?{between:kh,compare:Mte,normalize:Di}:{between:Ks,compare:(t,n)=>t-n,normalize:t=>t}}function vA({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function Mne(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=JL(r),l=t.length;let{start:c,end:u,loop:d}=e,p,h;if(d){for(c+=l,u+=l,p=0,h=l;p<h&&s(a(t[c%l][r]),i,o);++p)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function eF(e,t,n){if(!n)return[e];const{property:r,start:i,end:o}=n,s=t.length,{compare:a,between:l,normalize:c}=JL(r),{start:u,end:d,loop:p,style:h}=Mne(e,t,n),m=[];let b=!1,y=null,x,w,_;const E=()=>l(i,_,x)&&a(i,_)!==0,C=()=>a(o,x)===0||l(o,_,x),R=()=>b||E(),T=()=>!b||C();for(let M=u,N=u;M<=d;++M)w=t[M%s],!w.skip&&(x=c(w[r]),x!==_&&(b=l(x,i,o),y===null&&R()&&(y=a(x,i)===0?M:N),y!==null&&T()&&(m.push(vA({start:y,end:M,loop:p,count:s,style:h})),y=null),N=M,_=x));return y!==null&&m.push(vA({start:y,end:d,loop:p,count:s,style:h})),m}function tF(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const o=eF(r[i],e.points,t);o.length&&n.push(...o)}return n}function Ine(e,t,n,r){let i=0,o=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(o+=i);o>i&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function Dne(e,t,n,r){const i=e.length,o=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,o.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&o.push({start:t%i,end:s%i,loop:r}),o}function Nne(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=Ine(n,i,o,r);if(r===!0)return xA(e,[{start:s,end:a,loop:o}],n,t);const l=a<s?a+i:a,c=!!e._fullLoop&&s===0&&a===i-1;return xA(e,Dne(n,s,l,c),n,t)}function xA(e,t,n,r){return!r||!r.setContext||!n?t:Lne(e,t,n,r)}function Lne(e,t,n,r){const i=e._chart.getContext(),o=wA(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=o,d=t[0].start,p=d;function h(m,b,y,x){const w=a?-1:1;if(m!==b){for(m+=l;n[m%l].skip;)m-=w;for(;n[b%l].skip;)b+=w;m%l!==b%l&&(c.push({start:m%l,end:b%l,loop:y,style:x}),u=x,d=b%l)}}for(const m of t){d=a?d:m.start;let b=n[d%l],y;for(p=d+1;p<=m.end;p++){const x=n[p%l];y=wA(r.setContext(il(i,{type:"segment",p0:b,p1:x,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),Fne(y,u)&&h(d,p-1,m.loop,u),b=x,u=y}d<p-1&&h(d,p-1,m.loop,u)}return c}function wA(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Fne(e,t){if(!t)return!1;const n=[],r=function(i,o){return ZC(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
309
- * Chart.js v4.4.7
310
- * https://www.chartjs.org
311
- * (c) 2024 Chart.js Contributors
312
- * Released under the MIT License
313
- */class jne{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=jL.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var js=new jne;const SA="transparent",$ne={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=fA(e||SA),i=r.valid&&fA(t||SA);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class zne{constructor(t,n,r,i){const o=n[r];i=wn([t.to,i,o,t.from]);const s=wn([t.from,o,i]);this._active=!0,this._fn=t.fn||$ne[t.type||typeof s],this._easing=oh[t.easing]||oh.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=wn([t.to,n,i,t.from]),this._from=wn([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class nF{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ot(t))return;const n=Object.keys(En.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!Ot(o))return;const s={};for(const a of n)s[a]=o[a];(_n(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=Hne(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&Bne(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=o[c];const p=r.get(c);if(d)if(p&&d.active()){d.update(p,u,a);continue}else d.cancel();if(!p||!p.duration){t[c]=u;continue}o[c]=d=new zne(p,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return js.add(this._chart,r),!0}}function Bne(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function Hne(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 _A(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function Vne(e,t,n){if(n===!1)return!1;const r=_A(e,n),i=_A(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Wne(e){let t,n,r,i;return Ot(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function rF(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function CA(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let s,a,l,c;if(t===null)return;let u=!1;for(s=0,a=i.length;s<a;++s){if(l=+i[s],l===n){if(u=!0,r.all)continue;break}c=e.values[l],Ln(c)&&(o||t===0||rs(t)===rs(c))&&(t+=c)}return!u&&!r.all?0:t}function Une(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",s=Object.keys(e),a=new Array(s.length);let l,c,u;for(l=0,c=s.length;l<c;++l)u=s[l],a[l]={[i]:u,[o]:e[u]};return a}function Fx(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Gne(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function qne(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function Yne(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function EA(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function RA(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,u=Gne(o,s,r),d=t.length;let p;for(let h=0;h<d;++h){const m=t[h],{[l]:b,[c]:y}=m,x=m._stacks||(m._stacks={});p=x[c]=Yne(i,u,b),p[a]=y,p._top=EA(p,s,!0,r.type),p._bottom=EA(p,s,!1,r.type);const w=p._visualValues||(p._visualValues={});w[a]=y}}function jx(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Kne(e,t){return il(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Xne(e,t,n){return il(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function bf(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const $x=e=>e==="reset"||e==="none",PA=(e,t)=>t?e:Object.assign({},e),Qne=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:rF(n,!0),values:null};class co{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=Fx(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&&bf(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,p,h,m)=>d==="x"?p:d==="r"?m:h,o=n.xAxisID=rt(r.xAxisID,jx(t,"x")),s=n.yAxisID=rt(r.yAxisID,jx(t,"y")),a=n.rAxisID=rt(r.rAxisID,jx(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),u=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(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&&cA(this._data,this),t._stacked&&bf(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ot(n)){const i=this._cachedMeta;this._data=Une(n,i)}else if(r!==n){if(r){cA(r,this);const i=this._cachedMeta;bf(i),i._parsed=[]}n&&Object.isExtensible(n)&&Lte(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=Fx(n.vScale,n),n.stack!==r.stack&&(i=!0,bf(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&(RA(this,n._parsed),n._stacked=Fx(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,p;if(this._parsing===!1)r._parsed=i,r._sorted=!0,p=i;else{_n(i[t])?p=this.parseArrayData(r,i,t,n):Ot(i[t])?p=this.parseObjectData(r,i,t,n):p=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=p[u],l&&(h()&&(l=!1),c=d);r._sorted=l}s&&RA(this,p)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:s}=t,a=o.axis,l=s.axis,c=o.getLabels(),u=o===s,d=new Array(i);let p,h,m;for(p=0,h=i;p<h;++p)m=p+r,d[p]={[a]:u||o.parse(c[m],m),[l]:s.parse(n[m],m)};return d}parseArrayData(t,n,r,i){const{xScale:o,yScale:s}=t,a=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],a[l]={x:o.parse(d[0],u),y:s.parse(d[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,p,h;for(u=0,d=i;u<d;++u)p=u+r,h=n[p],c[u]={x:o.parse(qa(h,a),p),y:s.parse(qa(h,l),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,s=n[t.axis],a={keys:rF(i,!0),values:n._stacks[t.axis]._visualValues};return CA(a,s,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let s=o===null?NaN:o;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,s=CA(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,s=i.length,a=this._getOtherScale(t),l=Qne(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=qne(a);let p,h;function m(){h=i[p];const b=h[a.axis];return!Ln(h[t.axis])||u>b||d<b}for(p=0;p<s&&!(!m()&&(this.updateRangeFromParsed(c,t,h,l),o));++p);if(o){for(p=s-1;p>=0;--p)if(!m()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i<o;++i)s=n[i][t.axis],Ln(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Wne(rt(this.options.clip,Vne(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,a,l),u=a;u<a+l;++u){const d=i[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,o))}for(u=0;u<s.length;++u)s[u].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];o=s.$context||(s.$context=Xne(this.getContext(),t,s)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Kne(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",o=this._cachedDataOpts,s=t+"-"+n,a=o[s],l=this.enableOptionSharing&&Th(r);if(a)return PA(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),u),h=Object.keys(En.elements[t]),m=()=>this.getContext(r,i,n),b=c.resolveNamedOptions(p,h,m,d);return b.$shared&&(b.$shared=l,o[s]=Object.freeze(PA(b,l))),b}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),p=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(p,this.getContext(t,r,n))}const c=new nF(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||$x(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){$x(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!$x(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.data,s=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(o),a=t;a<s;++a)o[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&bf(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Oe(co,"defaults",{}),Oe(co,"datasetElementType",null),Oe(co,"dataElementType",null);function Zne(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=FL(r.sort((i,o)=>i-o))}return e._cache.$bar}function Jne(e){const t=e.iScale,n=Zne(t,e.type);let r=t._length,i,o,s,a;const l=()=>{s===32767||s===-32768||(Th(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(i=0,o=n.length;i<o;++i)s=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=t.ticks.length;i<o;++i)s=t.getPixelForTick(i),l();return r}function ere(e,t,n,r){const i=n.barThickness;let o,s;return Rt(i)?(o=t.min*n.categoryPercentage,s=n.barPercentage):(o=i*r,s=1),{chunk:o/r,ratio:s,start:t.pixels[e]-o/2}}function tre(e,t,n,r){const i=t.pixels,o=i[e];let s=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;s===null&&(s=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-s);const c=o-(o-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function nre(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),s=Math.min(i,o),a=Math.max(i,o);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:s,max:a}}function iF(e,t,n,r){return _n(e)?nre(e,t,n,r):t[n.axis]=n.parse(e,r),t}function TA(e,t,n,r){const i=e.iScale,o=e.vScale,s=i.getLabels(),a=i===o,l=[];let c,u,d,p;for(c=n,u=n+r;c<u;++c)p=t[c],d={},d[i.axis]=a||i.parse(s[c],c),l.push(iF(p,d,o,c));return l}function zx(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function rre(e,t,n){return e!==0?rs(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function ire(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function ore(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:u}=ire(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[kA(u,s,a,l)]=!0,i=c)),o[kA(i,s,a,l)]=!0,e.borderSkipped=o}function kA(e,t,n,r){return r?(e=sre(e,t,n),e=AA(e,n,t)):e=AA(e,t,n),e}function sre(e,t,n){return e===t?n:e===n?t:e}function AA(e,t,n){return e==="start"?t:e==="end"?n:e}function are(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class qm extends co{parsePrimitiveData(t,n,r,i){return TA(t,n,r,i)}parseArrayData(t,n,r,i){return TA(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,u=s.axis==="x"?a:l,d=[];let p,h,m,b;for(p=r,h=r+i;p<h;++p)b=n[p],m={},m[o.axis]=o.parse(qa(b,c),p),d.push(iF(qa(b,u),m,s,p));return d}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),s=o._custom,a=zx(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const o=i==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:p}=this._getSharedOptions(n,i);for(let h=n;h<n+r;h++){const m=this.getParsed(h),b=o||Rt(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,u),x=(m._stacks||{})[a.axis],w={horizontal:c,base:b.base,enableBorderRadius:!x||zx(m._custom)||s===x._top||s===x._bottom,x:c?b.head:y.center,y:c?y.center:b.head,height:c?y.size:Math.abs(b.size),width:c?Math.abs(b.size):y.size};p&&(w.options=d||this.resolveDataElementOptions(h,t[h].active?"active":i));const _=w.options||t[h].options;ore(w,_,x,s),are(w,_,u.ratio),this.updateElement(t[h],h,w,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,s=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=u=>{const d=u._parsed.find(h=>h[r.axis]===l),p=d&&d[u.vScale.axis];if(Rt(p)||isNaN(p))return!0};for(const u of i)if(!(n!==void 0&&c(u))&&((o===!1||s.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&s.push(u.stack),u.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,s;for(o=0,s=n.data.length;o<s;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||Jne(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:s}}=this,a=o||0,l=this.getParsed(t),c=l._custom,u=zx(c);let d=l[n.axis],p=0,h=r?this.applyStack(n,l,r):d,m,b;h!==d&&(p=h-d,h=d),u&&(d=c.barStart,h=c.barEnd-c.barStart,d!==0&&rs(d)!==rs(c.barEnd)&&(p=0),p+=d);const y=!Rt(o)&&!u?o:p;let x=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(p+h):m=x,b=m-x,Math.abs(b)<s){b=rre(b,n,a)*s,d===a&&(x-=b/2);const w=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),E=Math.min(w,_),C=Math.max(w,_);x=Math.max(Math.min(x,C),E),m=x+b,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(m)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const w=rs(b)*n.getLineWidthForValue(a)/2;x+=w,b-=w}return{size:b,base:x,head:m,center:m+b/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,s=rt(i.maxBarThickness,1/0);let a,l;if(n.grouped){const c=o?this._getStackCount(t):n.stackCount,u=i.barThickness==="flex"?tre(t,n,i,c):ere(t,n,i,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}Oe(qm,"id","bar"),Oe(qm,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Oe(qm,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Ym extends co{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const o=super.parsePrimitiveData(t,n,r,i);for(let s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+r).radius;return o}parseArrayData(t,n,r,i){const o=super.parseArrayData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=rt(a[2],this.resolveDataElementOptions(s+r).radius)}return o}parseObjectData(t,n,r,i){const o=super.parseObjectData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=rt(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),u=s.axis,d=a.axis;for(let p=n;p<n+r;p++){const h=t[p],m=!o&&this.getParsed(p),b={},y=b[u]=o?s.getPixelForDecimal(.5):s.getPixelForValue(m[u]),x=b[d]=o?a.getBasePixel():a.getPixelForValue(m[d]);b.skip=isNaN(y)||isNaN(x),c&&(b.options=l||this.resolveDataElementOptions(p,h.active?"active":i),o&&(b.options.radius=0)),this.updateElement(h,p,b,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return n!=="active"&&(i.radius=0),i.radius+=rt(r&&r._custom,o),i}}Oe(Ym,"id","bubble"),Oe(Ym,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Oe(Ym,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function lre(e,t,n){let r=1,i=1,o=0,s=0;if(t<Cn){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),p=Math.sin(l),h=(_,E,C)=>kh(_,a,l,!0)?1:Math.max(E,E*n,C,C*n),m=(_,E,C)=>kh(_,a,l,!0)?-1:Math.min(E,E*n,C,C*n),b=h(0,c,d),y=h(Hn,u,p),x=m(Rn,c,d),w=m(Rn+Hn,u,p);r=(b-x)/2,i=(y-w)/2,o=-(b+x)/2,s=-(y+w)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}class Hl extends co{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(Ot(r[t])){const{key:l="value"}=this._parsing;o=c=>+qa(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)i._parsed[s]=o(s)}}_getRotation(){return To(this.options.rotation-90)}_getCircumference(){return To(this.options.circumference)}_getRotationExtents(){let t=Cn,n=-Cn;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),s=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(Ste(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:m,offsetY:b}=lre(d,u,l),y=(r.width-s)/p,x=(r.height-s)/h,w=Math.max(Math.min(y,x)/2,0),_=ML(this.options.radius,w),E=Math.max(_*l,0),C=(_-E)/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=b*_,i.total=this.calculateTotal(),this.outerRadius=_-C*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-C*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/Cn)}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,p=o&&c.animateScale,h=p?0:this.innerRadius,m=p?0:this.outerRadius,{sharedOptions:b,includeOptions:y}=this._getSharedOptions(n,i);let x=this._getRotation(),w;for(w=0;w<n;++w)x+=this._circumference(w,o);for(w=n;w<n+r;++w){const _=this._circumference(w,o),E=t[w],C={x:u+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+_,circumference:_,outerRadius:m,innerRadius:h};y&&(C.options=b||this.resolveDataElementOptions(w,E.active?"active":i)),x+=_,this.updateElement(E,w,C,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Cn*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=yp(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,s,a,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,a=s.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Oe(Hl,"id","doughnut"),Oe(Hl,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Oe(Hl,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Oe(Hl,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class Km extends co{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=zL(n,i,s);this._drawStart=a,this._drawCount=l,BL(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),p=s.axis,h=a.axis,{spanGaps:m,segment:b}=this.options,y=dd(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||i==="none",w=n+r,_=t.length;let E=n>0&&this.getParsed(n-1);for(let C=0;C<_;++C){const R=t[C],T=x?R:{};if(C<n||C>=w){T.skip=!0;continue}const M=this.getParsed(C),N=Rt(M[h]),j=T[p]=s.getPixelForValue(M[p],C),F=T[h]=o||N?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[h],C);T.skip=isNaN(j)||isNaN(F)||N,T.stop=C>0&&Math.abs(M[p]-E[p])>y,b&&(T.parsed=M,T.raw=c.data[C]),d&&(T.options=u||this.resolveDataElementOptions(C,R.active?"active":i)),x||this.updateElement(R,C,T,i),E=M}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Oe(Km,"id","line"),Oe(Km,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Oe(Km,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ah extends co{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=yp(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,r,i){return KL.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-s)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,p=c.getIndexAngle(0)-.5*Rn;let h=p,m;const b=360/this.countVisibleElements();for(m=0;m<n;++m)h+=this._computeAngle(m,i,b);for(m=n;m<n+r;m++){const y=t[m];let x=h,w=h+this._computeAngle(m,i,b),_=s.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;h=w,o&&(l.animateScale&&(_=0),l.animateRotate&&(x=w=p));const E={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:x,endAngle:w,options:this.resolveDataElementOptions(m,y.active?"active":i)};this.updateElement(y,m,E,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?To(this.resolveDataElementOptions(t,n).angle||r):0}}Oe(ah,"id","polarArea"),Oe(ah,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Oe(ah,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class rS extends Hl{}Oe(rS,"id","pie"),Oe(rS,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Xm extends co{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return KL.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const o=this._cachedMeta.rScale,s=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=o.getPointPositionForValue(a,this.getParsed(a).r),d=s?o.xCenter:u.x,p=s?o.yCenter:u.y,h={x:d,y:p,angle:u.angle,skip:isNaN(d)||isNaN(p),options:c};this.updateElement(l,a,h,i)}}}Oe(Xm,"id","radar"),Oe(Xm,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Oe(Xm,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Qm extends co{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:o,count:s}=zL(n,r,i);if(this._drawStart=o,this._drawCount=s,BL(n)&&(o=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),d=this.getSharedOptions(u),p=this.includeOptions(i,d),h=s.axis,m=a.axis,{spanGaps:b,segment:y}=this.options,x=dd(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||i==="none";let _=n>0&&this.getParsed(n-1);for(let E=n;E<n+r;++E){const C=t[E],R=this.getParsed(E),T=w?C:{},M=Rt(R[m]),N=T[h]=s.getPixelForValue(R[h],E),j=T[m]=o||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,R,l):R[m],E);T.skip=isNaN(N)||isNaN(j)||M,T.stop=E>0&&Math.abs(R[h]-_[h])>x,y&&(T.parsed=R,T.raw=c.data[E]),p&&(T.options=d||this.resolveDataElementOptions(E,C.active?"active":i)),w||this.updateElement(C,E,T,i),_=R}this.updateSharedOptions(d,i,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,s)/2}}Oe(Qm,"id","scatter"),Oe(Qm,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Oe(Qm,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var cre=Object.freeze({__proto__:null,BarController:qm,BubbleController:Ym,DoughnutController:Hl,LineController:Km,PieController:rS,PolarAreaController:ah,RadarController:Xm,ScatterController:Qm});function Rl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class oE{constructor(t){Oe(this,"options");this.options=t||{}}static override(t){Object.assign(oE.prototype,t)}init(){}formats(){return Rl()}parse(){return Rl()}format(){return Rl()}add(){return Rl()}diff(){return Rl()}startOf(){return Rl()}endOf(){return Rl()}}var ure={_date:oE};function dre(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?Dte:Xs;if(r){if(i._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(o,t,n-u),p=l(o,t,n+u);return{lo:d.lo,hi:p.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function vp(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:u}=o[a],{lo:d,hi:p}=dre(o[a],t,s,i);for(let h=d;h<=p;++h){const m=u[h];m.skip||r(m,c,h)}}}function fre(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,s=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function Bx(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||vp(e,n,t,function(a,l,c){!i&&!Qs(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function hre(e,t,n,r){let i=[];function o(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=NL(s,{x:t.x,y:t.y});kh(d,c,u)&&i.push({element:s,datasetIndex:a,index:l})}return vp(e,n,t,o),i}function pre(e,t,n,r,i,o){let s=[];const a=fre(n);let l=Number.POSITIVE_INFINITY;function c(u,d,p){const h=u.inRange(t.x,t.y,i);if(r&&!h)return;const m=u.getCenterPoint(i);if(!(!!o||e.isPointInArea(m))&&!h)return;const y=a(t,m);y<l?(s=[{element:u,datasetIndex:d,index:p}],l=y):y===l&&s.push({element:u,datasetIndex:d,index:p})}return vp(e,n,t,c),s}function Hx(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?hre(e,t,n,i):pre(e,t,n,r,i,o)}function OA(e,t,n,r,i){const o=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return vp(e,n,t,(l,c,u)=>{l[s]&&l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var gre={evaluateInteractionItems:vp,modes:{index(e,t,n,r){const i=Ol(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Bx(e,i,o,r,s):Hx(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=Ol(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Bx(e,i,o,r,s):Hx(e,i,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const i=Ol(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return Bx(e,i,o,r,s)},nearest(e,t,n,r){const i=Ol(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return Hx(e,i,o,n.intersect,r,s)},x(e,t,n,r){const i=Ol(t,e);return OA(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Ol(t,e);return OA(e,i,"y",n.intersect,r)}}};const oF=["left","top","right","bottom"];function yf(e,t){return e.filter(n=>n.pos===t)}function MA(e,t){return e.filter(n=>oF.indexOf(n.pos)===-1&&n.box.axis===t)}function vf(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function mre(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:s,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&o+s,stackWeight:a});return t}function bre(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!oF.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return t}function yre(e,t){const n=bre(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,s,a;for(o=0,s=e.length;o<s;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function vre(e){const t=mre(e),n=vf(t.filter(c=>c.box.fullSize),!0),r=vf(yf(t,"left"),!0),i=vf(yf(t,"right")),o=vf(yf(t,"top"),!0),s=vf(yf(t,"bottom")),a=MA(t,"x"),l=MA(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:yf(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function IA(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function sF(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 xre(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!Ot(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&sF(s,o.getPadding());const a=Math.max(0,t.outerWidth-IA(s,e,"left","right")),l=Math.max(0,t.outerHeight-IA(s,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function wre(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Sre(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function Wf(e,t,n,r){const i=[];let o,s,a,l,c,u;for(o=0,s=e.length,c=0;o<s;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Sre(a.horizontal,t));const{same:d,other:p}=xre(t,n,a,r);c|=d&&i.length,u=u||p,l.fullSize||i.push(a)}return c&&Wf(i,t,n,r)||u}function Jg(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function DA(e,t,n,r){const i=n.padding;let{x:o,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,p=c.size||l.height;Th(c.start)&&(s=c.start),l.fullSize?Jg(l,i.left,s,n.outerWidth-i.right-i.left,p):Jg(l,t.left+c.placed,s,d,p),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,p=c.size||l.width;Th(c.start)&&(o=c.start),l.fullSize?Jg(l,o,i.top,p,n.outerHeight-i.bottom-i.top):Jg(l,o,t.top+c.placed,p,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=s}var Or={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=vr(e.options.layout.padding),o=Math.max(t-i.width,0),s=Math.max(n-i.height,0),a=vre(e.boxes),l=a.vertical,c=a.horizontal;en(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,y)=>y.box.options&&y.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),p=Object.assign({},i);sF(p,vr(r));const h=Object.assign({maxPadding:p,w:o,h:s,x:i.left,y:i.top},i),m=yre(l.concat(c),d);Wf(a.fullSize,h,d,m),Wf(l,h,d,m),Wf(c,h,d,m)&&Wf(l,h,d,m),wre(h),DA(a.leftAndTop,h,d,m),h.x+=h.w,h.y+=h.h,DA(a.rightAndBottom,h,d,m),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},en(a.chartArea,b=>{const y=b.box;Object.assign(y,e.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class aF{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class _re extends aF{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Zm="$chartjs",Cre={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},NA=e=>e===null||e==="";function Ere(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Zm]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",NA(i)){const o=yA(e,"width");o!==void 0&&(e.width=o)}if(NA(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=yA(e,"height");o!==void 0&&(e.height=o)}return e}const lF=Pne?{passive:!0}:!1;function Rre(e,t,n){e&&e.addEventListener(t,n,lF)}function Pre(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,lF)}function Tre(e,t){const n=Cre[e.type]||e.type,{x:r,y:i}=Ol(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Tb(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function kre(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Tb(a.addedNodes,r),s=s&&!Tb(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Are(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Tb(a.removedNodes,r),s=s&&!Tb(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Oh=new Map;let LA=0;function cF(){const e=window.devicePixelRatio;e!==LA&&(LA=e,Oh.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Ore(e,t){Oh.size||window.addEventListener("resize",cF),Oh.set(e,t)}function Mre(e){Oh.delete(e),Oh.size||window.removeEventListener("resize",cF)}function Ire(e,t,n){const r=e.canvas,i=r&&iE(r);if(!i)return;const o=$L((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return s.observe(i),Ore(e,o),s}function Vx(e,t,n){n&&n.disconnect(),t==="resize"&&Mre(e)}function Dre(e,t,n){const r=e.canvas,i=$L(o=>{e.ctx!==null&&n(Tre(o,e))},e);return Rre(r,t,i),i}class Nre extends aF{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Ere(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Zm])return!1;const r=n[Zm].initial;["height","width"].forEach(o=>{const s=r[o];Rt(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[Zm],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:kre,detach:Are,resize:Ire}[n]||Dre;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Vx,detach:Vx,resize:Vx}[n]||Pre)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return Rne(t,n,r,i)}isAttached(t){const n=t&&iE(t);return!!(n&&n.isConnected)}}function Lre(e){return!rE()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?_re:Nre}var Gm;let vs=(Gm=class{constructor(){Oe(this,"x");Oe(this,"y");Oe(this,"active",!1);Oe(this,"options");Oe(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return dd(this.x)&&dd(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}},Oe(Gm,"defaults",{}),Oe(Gm,"defaultRoutes"),Gm);function Fre(e,t){const n=e.options.ticks,r=jre(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?zre(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return Bre(t,c,o,s/i),c;const u=$re(o,t,i);if(s>0){let d,p;const h=s>1?Math.round((l-a)/(s-1)):null;for(em(t,c,u,Rt(h)?0:a-h,a),d=0,p=s-1;d<p;d++)em(t,c,u,o[d],o[d+1]);return em(t,c,u,l,Rt(h)?t.length:l+h),c}return em(t,c,u),c}function jre(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function $re(e,t,n){const r=Hre(e),i=t.length/n;if(!r)return Math.max(i,1);const o=Ate(r);for(let s=0,a=o.length-1;s<a;s++){const l=o[s];if(l>i)return l}return Math.max(i,1)}function zre(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Bre(e,t,n,r){let i=0,o=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===o&&(t.push(e[s]),i++,o=n[i*r])}function em(e,t,n,r,i){const o=rt(r,0),s=Math.min(rt(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<s;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function Hre(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 Vre=e=>e==="left"?"right":e==="right"?"left":e,FA=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,jA=(e,t)=>Math.min(t||e,e);function $A(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function Wre(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-a||l>s+a)))return l}function Ure(e,t){en(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function xf(e){return e.drawTicks?e.tickLength:0}function zA(e,t){if(!e.display)return 0;const n=qn(e.font,t),r=vr(e.padding);return(_n(e.text)?e.text.length:1)*n.lineHeight+r.height}function Gre(e,t){return il(e,{scale:t,type:"scale"})}function qre(e,t,n){return il(e,{tick:n,index:t,type:"tick"})}function Yre(e,t,n){let r=QC(e);return(n&&t!=="right"||!n&&t==="right")&&(r=Vre(r)),r}function Kre(e,t,n,r){const{top:i,left:o,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,p,h,m;const b=s-i,y=a-o;if(e.isHorizontal()){if(h=Tr(r,o,a),Ot(n)){const x=Object.keys(n)[0],w=n[x];m=u[x].getPixelForValue(w)+b-t}else n==="center"?m=(c.bottom+c.top)/2+b-t:m=FA(e,n,t);p=a-o}else{if(Ot(n)){const x=Object.keys(n)[0],w=n[x];h=u[x].getPixelForValue(w)-y+t}else n==="center"?h=(c.left+c.right)/2-y+t:h=FA(e,n,t);m=Tr(r,s,i),d=n==="left"?-Hn:Hn}return{titleX:h,titleY:m,maxWidth:p,rotation:d}}class ol extends vs{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=Oi(t,Number.POSITIVE_INFINITY),n=Oi(n,Number.NEGATIVE_INFINITY),r=Oi(r,Number.POSITIVE_INFINITY),i=Oi(i,Number.NEGATIVE_INFINITY),{min:Oi(t,r),max:Oi(n,i),minDefined:Ln(t),maxDefined:Ln(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),s;if(i&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,s.min)),o||(r=Math.max(r,s.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Oi(n,Oi(r,n)),max:Oi(r,Oi(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:i,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ine(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?$A(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=Fre(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,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=cn(n.callback,[o.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=jA(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let s=i,a,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,p=u.highest.height,h=ur(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-xf(t.grid)-n.padding-zA(t.title,this.chart.options.font),c=Math.sqrt(d*d+p*p),s=KC(Math.min(Math.asin(ur((u.highest.height+6)/a,-1,1)),Math.asin(ur(l/c,-1,1))-Math.asin(ur(p/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}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:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=zA(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=xf(o)+l):(t.height=this.maxHeight,t.width=xf(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:p}=this._getLabelSizes(),h=r.padding*2,m=To(this.labelRotation),b=Math.cos(m),y=Math.sin(m);if(a){const x=r.mirror?0:y*d.width+b*p.height;t.height=Math.min(this.maxHeight,t.height+x+h)}else{const x=r.mirror?0:b*d.width+y*p.height;t.width=Math.min(this.maxWidth,t.width+x+h)}this._calculatePadding(c,u,y,b)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,h=0;l?c?(p=i*t.width,h=r*n.height):(p=r*t.height,h=i*n.width):o==="start"?h=n.width:o==="end"?p=t.width:o!=="inner"&&(p=t.width/2,h=n.width/2),this.paddingLeft=Math.max((p-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){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++)Rt(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=$A(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,s=[],a=[],l=Math.floor(n/jA(n,r));let c=0,u=0,d,p,h,m,b,y,x,w,_,E,C;for(d=0;d<n;d+=l){if(m=t[d].label,b=this._resolveTickFontOptions(d),i.font=y=b.string,x=o[y]=o[y]||{data:{},gc:[]},w=b.lineHeight,_=E=0,!Rt(m)&&!_n(m))_=Eb(i,x.data,x.gc,_,m),E=w;else if(_n(m))for(p=0,h=m.length;p<h;++p)C=m[p],!Rt(C)&&!_n(C)&&(_=Eb(i,x.data,x.gc,_,C),E+=w);s.push(_),a.push(E),c=Math.max(_,c),u=Math.max(E,u)}Ure(o,n);const R=s.indexOf(c),T=a.indexOf(u),M=N=>({width:s[N]||0,height:a[N]||0});return{first:M(0),last:M(n-1),widest:M(R),highest:M(T),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return Ite(this._alignToPixels?El(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=qre(this.getContext(),t,r))}return this.$context||(this.$context=Gre(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=To(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),s=t.autoSkipPadding||0,a=o?o.widest.width+s:0,l=o?o.highest.height+s:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),p=xf(o),h=[],m=a.setContext(this.getContext()),b=m.display?m.width:0,y=b/2,x=function(G){return El(r,G,b)};let w,_,E,C,R,T,M,N,j,F,$,Q;if(s==="top")w=x(this.bottom),T=this.bottom-p,N=w-y,F=x(t.top)+y,Q=t.bottom;else if(s==="bottom")w=x(this.top),F=t.top,Q=x(t.bottom)-y,T=w+y,N=this.top+p;else if(s==="left")w=x(this.right),R=this.right-p,M=w-y,j=x(t.left)+y,$=t.right;else if(s==="right")w=x(this.left),j=t.left,$=x(t.right)-y,R=w+y,M=this.left+p;else if(n==="x"){if(s==="center")w=x((t.top+t.bottom)/2+.5);else if(Ot(s)){const G=Object.keys(s)[0],V=s[G];w=x(this.chart.scales[G].getPixelForValue(V))}F=t.top,Q=t.bottom,T=w+y,N=T+p}else if(n==="y"){if(s==="center")w=x((t.left+t.right)/2);else if(Ot(s)){const G=Object.keys(s)[0],V=s[G];w=x(this.chart.scales[G].getPixelForValue(V))}R=w-y,M=R-p,j=t.left,$=t.right}const H=rt(i.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/H));for(_=0;_<d;_+=L){const G=this.getContext(_),V=o.setContext(G),B=a.setContext(G),X=V.lineWidth,I=V.color,q=B.dash||[],U=B.dashOffset,O=V.tickWidth,ee=V.tickColor,K=V.tickBorderDash||[],oe=V.tickBorderDashOffset;E=Wre(this,_,l),E!==void 0&&(C=El(r,E,X),c?R=M=j=$=C:T=N=F=Q=C,h.push({tx1:R,ty1:T,tx2:M,ty2:N,x1:j,y1:F,x2:$,y2:Q,width:X,color:I,borderDash:q,borderDashOffset:U,tickWidth:O,tickColor:ee,tickBorderDash:K,tickBorderDashOffset:oe}))}return this._ticksLength=d,this._borderValue=w,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=o,p=xf(r.grid),h=p+u,m=d?-u:h,b=-To(this.labelRotation),y=[];let x,w,_,E,C,R,T,M,N,j,F,$,Q="middle";if(i==="top")R=this.bottom-m,T=this._getXAxisLabelAlignment();else if(i==="bottom")R=this.top+m,T=this._getXAxisLabelAlignment();else if(i==="left"){const L=this._getYAxisLabelAlignment(p);T=L.textAlign,C=L.x}else if(i==="right"){const L=this._getYAxisLabelAlignment(p);T=L.textAlign,C=L.x}else if(n==="x"){if(i==="center")R=(t.top+t.bottom)/2+h;else if(Ot(i)){const L=Object.keys(i)[0],G=i[L];R=this.chart.scales[L].getPixelForValue(G)+h}T=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")C=(t.left+t.right)/2-h;else if(Ot(i)){const L=Object.keys(i)[0],G=i[L];C=this.chart.scales[L].getPixelForValue(G)}T=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const H=this._getLabelSizes();for(x=0,w=a.length;x<w;++x){_=a[x],E=_.label;const L=o.setContext(this.getContext(x));M=this.getPixelForTick(x)+o.labelOffset,N=this._resolveTickFontOptions(x),j=N.lineHeight,F=_n(E)?E.length:1;const G=F/2,V=L.color,B=L.textStrokeColor,X=L.textStrokeWidth;let I=T;s?(C=M,T==="inner"&&(x===w-1?I=this.options.reverse?"left":"right":x===0?I=this.options.reverse?"right":"left":I="center"),i==="top"?c==="near"||b!==0?$=-F*j+j/2:c==="center"?$=-H.highest.height/2-G*j+j:$=-H.highest.height+j/2:c==="near"||b!==0?$=j/2:c==="center"?$=H.highest.height/2-G*j:$=H.highest.height-F*j,d&&($*=-1),b!==0&&!L.showLabelBackdrop&&(C+=j/2*Math.sin(b))):(R=M,$=(1-F)*j/2);let q;if(L.showLabelBackdrop){const U=vr(L.backdropPadding),O=H.heights[x],ee=H.widths[x];let K=$-U.top,oe=0-U.left;switch(Q){case"middle":K-=O/2;break;case"bottom":K-=O;break}switch(T){case"center":oe-=ee/2;break;case"right":oe-=ee;break;case"inner":x===w-1?oe-=ee:x>0&&(oe-=ee/2);break}q={left:oe,top:K,width:ee+U.width,height:O+U.height,color:L.backdropColor}}y.push({label:E,font:N,textOffset:$,options:{rotation:b,color:V,strokeColor:B,strokeWidth:X,textAlign:I,textBaseline:Q,translation:[C,R],backdrop:q}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-To(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,c,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(o=0,s=i.length;o<s;++o){const l=i[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),s=r.display?o.width:0;if(!s)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,p;this.isHorizontal()?(c=El(t,this.left,s)-s/2,u=El(t,this.right,a)+a/2,d=p=l):(d=El(t,this.top,s)-s/2,p=El(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&rc(r,i);const o=this.getLabelItems(t);for(const s of o){const a=s.options,l=s.font,c=s.label,u=s.textOffset;Sc(r,c,0,u,l,a)}i&&ic(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=qn(r.font),s=vr(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Ot(n)?(l+=s.bottom,_n(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:p}=Kre(this,l,n,a);Sc(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:p,textAlign:Yre(a,n,i),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=rt(t.grid&&t.grid.z,-1),i=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ol.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o<s;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return qn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class tm{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;Zre(n)&&(r=this.register(n));const i=this.items,o=t.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,Xre(t,s,r),this.override&&En.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in En[i]&&(delete En[i][r],this.override&&delete wc[r])}}function Xre(e,t,n){const r=dr(Object.create(null),[n?En.get(n):{},En.get(t),e.defaults]);En.set(t,r),e.defaultRoutes&&Qre(t,e.defaultRoutes),e.descriptors&&En.describe(t,e.descriptors)}function Qre(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");En.route(o,i,l,a)})}function Zre(e){return"id"in e&&"defaults"in e}class Jre{constructor(){this.controllers=new tm(co,"datasets",!0),this.elements=new tm(vs,"elements"),this.plugins=new tm(Object,"plugins"),this.scales=new tm(ol,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):en(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=YC(t);cn(r["before"+i],[],r),n[t](r),cn(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var qr=new Jre;class eie{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,i){i=i||{};for(const o of t){const s=o.plugin,a=s[r],l=[n,i,o.options];if(cn(a,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){Rt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=rt(r.options&&r.options.plugins,{}),o=tie(r);return i===!1&&!n?[]:rie(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,s)=>o.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function tie(e){const t={},n=[],r=Object.keys(qr.plugins.items);for(let o=0;o<r.length;o++)n.push(qr.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const s=i[o];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function nie(e,t){return!t&&e===!1?null:e===!0?{}:e}function rie(e,{plugins:t,localIds:n},r,i){const o=[],s=e.getContext();for(const a of t){const l=a.id,c=nie(r[l],i);c!==null&&o.push({plugin:a,options:iie(e.config,{plugin:a,local:n[l]},c,s)})}return o}function iie(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),s=e.getOptionScopes(r,o);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function iS(e,t){const n=En.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function oie(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function sie(e,t){return e===t?"_index_":"_value_"}function BA(e){if(e==="x"||e==="y"||e==="r")return e}function aie(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function oS(e,...t){if(BA(e))return e;for(const n of t){const r=n.axis||aie(n.position)||e.length>1&&BA(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function HA(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function lie(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 HA(e,"x",n[0])||HA(e,"y",n[0])}return{}}function cie(e,t){const n=wc[e.type]||{scales:{}},r=t.scales||{},i=iS(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Ot(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=oS(s,a,lie(s,e),En.scales[a.type]),c=sie(l,i),u=n.scales||{};o[s]=rh(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||iS(a,t),u=(wc[a]||{}).scales||{};Object.keys(u).forEach(d=>{const p=oie(d,l),h=s[p+"AxisID"]||p;o[h]=o[h]||Object.create(null),rh(o[h],[{axis:p},r[h],u[d]])})}),Object.keys(o).forEach(s=>{const a=o[s];rh(a,[En.scales[a.type],En.scale])}),o}function uF(e){const t=e.options||(e.options={});t.plugins=rt(t.plugins,{}),t.scales=cie(e,t)}function dF(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function uie(e){return e=e||{},e.data=dF(e.data),uF(e),e}const VA=new Map,fF=new Set;function nm(e,t){let n=VA.get(e);return n||(n=t(),VA.set(e,n),fF.add(n)),n}const wf=(e,t,n)=>{const r=qa(t,n);r!==void 0&&e.add(r)};class die{constructor(t){this._config=uie(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=dF(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(),uF(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return nm(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return nm(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return nm(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return nm(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>wf(l,t,d))),u.forEach(d=>wf(l,i,d)),u.forEach(d=>wf(l,wc[o]||{},d)),u.forEach(d=>wf(l,En,d)),u.forEach(d=>wf(l,nS,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),fF.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,wc[n]||{},En.datasets[n]||{},{type:n},En,nS]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=WA(this._resolverCache,t,i);let l=s;if(hie(s,n)){o.$shared=!1,r=Ya(r)?r():r;const c=this.createResolver(t,r,a);l=fd(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=WA(this._resolverCache,t,r);return Ot(n)?fd(o,n,void 0,i):o}}function WA(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:eE(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const fie=e=>Ot(e)&&Object.getOwnPropertyNames(e).some(t=>Ya(e[t]));function hie(e,t){const{isScriptable:n,isIndexable:r}=UL(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Ya(a)||fie(a))||s&&_n(a))return!0}return!1}var pie="4.4.7";const gie=["top","bottom","left","right","chartArea"];function UA(e,t){return e==="top"||e==="bottom"||gie.indexOf(e)===-1&&t==="x"}function GA(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function qA(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),cn(n&&n.onComplete,[e],t)}function mie(e){const t=e.chart,n=t.options.animation;cn(n&&n.onProgress,[e],t)}function hF(e){return rE()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Jm={},YA=e=>{const t=hF(e);return Object.values(Jm).filter(n=>n.canvas===t).pop()};function bie(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function yie(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function rm(e,t,n){return e.options.clip?e[n]:t[n]}function vie(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:rm(n,t,"left"),right:rm(n,t,"right"),top:rm(r,t,"top"),bottom:rm(r,t,"bottom")}:t}class An{static register(...t){qr.add(...t),KA()}static unregister(...t){qr.remove(...t),KA()}constructor(t,n){const r=this.config=new die(n),i=hF(t),o=YA(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||Lre(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=wte(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new eie,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Fte(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Jm[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}js.listen(this,"complete",qA),js.listen(this,"progress",mie),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return Rt(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():bA(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return pA(this.canvas,this.ctx),this}stop(){return js.stop(this),this}resize(t,n){js.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,bA(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),cn(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};en(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=oS(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),en(o,s=>{const a=s.options,l=a.id,c=oS(l,a),u=rt(a.type,s.dtype);(a.position===void 0||UA(a.position,c)!==UA(s.dposition))&&(a.position=s.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const p=qr.getScale(u);d=new p({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),en(i,(s,a)=>{s||delete r[a]}),en(r,s=>{Or.configure(this,s,s.options),Or.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(GA("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let s=this.getDatasetMeta(r);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=o.indexAxis||iS(a,this.options),s.order=o.order||0,s.index=r,s.label=""+o.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=qr.getController(a),{datasetElementType:c,dataElementType:u}=En.datasets[a];Object.assign(l,{dataElementType:qr.getElement(u),datasetElementType:c&&qr.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){en(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),p=!i&&o.indexOf(d)===-1;d.buildOrUpdateElements(p),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||en(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(GA("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){en(this.scales,t=>{Or.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!oA(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;bie(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!oA(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Or.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],en(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Ya(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(js.has(this)?this.attached&&!js.running(this)&&js.start(this):(this.draw(),qA({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const s=n[i];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=vie(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&rc(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&ic(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Qs(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=gre.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=il(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);Th(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),js.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(),pA(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Jm[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,s)=>{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};en(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){en(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},en(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Sb(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=Pte(t),c=yie(t,this._lastEvent,r,l);r&&(this._lastEvent=null,cn(o.onHover,[t,a,this],this),l&&cn(o.onClick,[t,a,this],this));const u=!Sb(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}Oe(An,"defaults",En),Oe(An,"instances",Jm),Oe(An,"overrides",wc),Oe(An,"registry",qr),Oe(An,"version",pie),Oe(An,"getChart",YA);function KA(){return en(An.instances,e=>e._plugins.invalidate())}function xie(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:s,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(o,s,a,r-c,n+c),l>i?(c=i/l,e.arc(o,s,l,n+c,r-c,!0)):e.arc(o,s,i,n+Hn,r-Hn),e.closePath(),e.clip()}function wie(e){return JC(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Sie(e,t,n,r){const i=wie(e.options.borderRadius),o=(n-t)/2,s=Math.min(o,r*t/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return ur(l,0,Math.min(o,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:ur(i.innerStart,0,s),innerEnd:ur(i.innerEnd,0,s)}}function uu(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function kb(e,t,n,r,i,o){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),p=u>0?u+r+n+c:0;let h=0;const m=i-l;if(r){const L=u>0?u-r:0,G=d>0?d-r:0,V=(L+G)/2,B=V!==0?m*V/(V+r):m;h=(m-B)/2}const b=Math.max(.001,m*d-n/Rn)/d,y=(m-b)/2,x=l+y+h,w=i-y-h,{outerStart:_,outerEnd:E,innerStart:C,innerEnd:R}=Sie(t,p,d,w-x),T=d-_,M=d-E,N=x+_/T,j=w-E/M,F=p+C,$=p+R,Q=x+C/F,H=w-R/$;if(e.beginPath(),o){const L=(N+j)/2;if(e.arc(s,a,d,N,L),e.arc(s,a,d,L,j),E>0){const X=uu(M,j,s,a);e.arc(X.x,X.y,E,j,w+Hn)}const G=uu($,w,s,a);if(e.lineTo(G.x,G.y),R>0){const X=uu($,H,s,a);e.arc(X.x,X.y,R,w+Hn,H+Math.PI)}const V=(w-R/p+(x+C/p))/2;if(e.arc(s,a,p,w-R/p,V,!0),e.arc(s,a,p,V,x+C/p,!0),C>0){const X=uu(F,Q,s,a);e.arc(X.x,X.y,C,Q+Math.PI,x-Hn)}const B=uu(T,x,s,a);if(e.lineTo(B.x,B.y),_>0){const X=uu(T,N,s,a);e.arc(X.x,X.y,_,x-Hn,N)}}else{e.moveTo(s,a);const L=Math.cos(N)*d+s,G=Math.sin(N)*d+a;e.lineTo(L,G);const V=Math.cos(j)*d+s,B=Math.sin(j)*d+a;e.lineTo(V,B)}e.closePath()}function _ie(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){kb(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=s+(a%Cn||Cn))}return kb(e,t,n,r,l,i),e.fill(),l}function Cie(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:p}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=p,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let m=t.endAngle;if(o){kb(e,t,n,r,m,i);for(let b=0;b<o;++b)e.stroke();isNaN(a)||(m=s+(a%Cn||Cn))}h&&xie(e,t,m),o||(kb(e,t,n,r,m,i),e.stroke())}class _u extends vs{constructor(n){super();Oe(this,"circumference");Oe(this,"endAngle");Oe(this,"fullCircles");Oe(this,"innerRadius");Oe(this,"outerRadius");Oe(this,"pixelMargin");Oe(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.getProps(["x","y"],i),{angle:s,distance:a}=NL(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),h=(this.options.spacing+this.options.borderWidth)/2,m=rt(p,c-l),b=kh(s,l,c)&&l!==c,y=m>=Cn||b,x=Ks(a,u+h,d+h);return y&&x}getCenterPoint(n){const{x:r,y:i,startAngle:o,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(o+s)/2,p=(a+l+u+c)/2;return{x:r+Math.cos(d)*p,y:i+Math.sin(d)*p}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,o=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>Cn?Math.floor(i/Cn):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(Rn,i||0)),u=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,_ie(n,this,u,s,a),Cie(n,this,u,s,a),n.restore()}}Oe(_u,"id","arc"),Oe(_u,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Oe(_u,"defaultRoutes",{backgroundColor:"backgroundColor"}),Oe(_u,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function pF(e,t,n=t){e.lineCap=rt(n.borderCapStyle,t.borderCapStyle),e.setLineDash(rt(n.borderDash,t.borderDash)),e.lineDashOffset=rt(n.borderDashOffset,t.borderDashOffset),e.lineJoin=rt(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=rt(n.borderWidth,t.borderWidth),e.strokeStyle=rt(n.borderColor,t.borderColor)}function Eie(e,t,n){e.lineTo(n.x,n.y)}function Rie(e){return e.stepped?Kte:e.tension||e.cubicInterpolationMode==="monotone"?Xte:Eie}function gF(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),u=i<s&&o<s||i>a&&o>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function Pie(e,t,n,r){const{points:i,options:o}=t,{count:s,start:a,loop:l,ilen:c}=gF(i,n,r),u=Rie(o);let{move:d=!0,reverse:p}=r||{},h,m,b;for(h=0;h<=c;++h)m=i[(a+(p?c-h:h))%s],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,b,m,p,o.stepped),b=m);return l&&(m=i[(a+(p?c:0))%s],u(e,b,m,p,o.stepped)),!!l}function Tie(e,t,n,r){const i=t.points,{count:o,start:s,ilen:a}=gF(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,p,h,m,b,y,x;const w=E=>(s+(c?a-E:E))%o,_=()=>{b!==y&&(e.lineTo(u,y),e.lineTo(u,b),e.lineTo(u,x))};for(l&&(h=i[w(0)],e.moveTo(h.x,h.y)),p=0;p<=a;++p){if(h=i[w(p)],h.skip)continue;const E=h.x,C=h.y,R=E|0;R===m?(C<b?b=C:C>y&&(y=C),u=(d*u+E)/++d):(_(),e.lineTo(E,C),m=R,d=0,b=y=C),x=C}_()}function sS(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Tie:Pie}function kie(e){return e.stepped?Tne:e.tension||e.cubicInterpolationMode==="monotone"?kne:Ml}function Aie(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),pF(e,t.options),e.stroke(i)}function Oie(e,t,n,r){const{segments:i,options:o}=t,s=sS(t);for(const a of i)pF(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Mie=typeof Path2D=="function";function Iie(e,t,n,r){Mie&&!t.options.segment?Aie(e,t,n,r):Oie(e,t,n,r)}class Fa extends vs{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;xne(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Nne(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,s=tF(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=kie(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:p}=s[c],h=o[d],m=o[p];if(h===m){a.push(h);continue}const b=Math.abs((i-h[n])/(m[n]-h[n])),y=l(h,m,b,r.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,r){return sS(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=sS(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)s&=o(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Iie(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Oe(Fa,"id","line"),Oe(Fa,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Oe(Fa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Oe(Fa,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function XA(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class ac extends vs{constructor(n){super();Oe(this,"parsed");Oe(this,"skip");Oe(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,r){return XA(this,n,"x",r)}inYRange(n,r){return XA(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!Qs(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Rb(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Oe(ac,"id","point"),Oe(ac,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Oe(ac,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function mF(e,t){const{x:n,y:r,base:i,width:o,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return e.horizontal?(d=s/2,a=Math.min(n,i),l=Math.max(n,i),c=r-d,u=r+d):(d=o/2,a=n-d,l=n+d,c=Math.min(r,i),u=Math.max(r,i)),{left:a,top:c,right:l,bottom:u}}function ja(e,t,n,r){return e?0:ur(t,n,r)}function Die(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=WL(r);return{t:ja(i.top,o.top,0,n),r:ja(i.right,o.right,0,t),b:ja(i.bottom,o.bottom,0,n),l:ja(i.left,o.left,0,t)}}function Nie(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=oc(i),s=Math.min(t,n),a=e.borderSkipped,l=r||Ot(i);return{topLeft:ja(!l||a.top||a.left,o.topLeft,0,s),topRight:ja(!l||a.top||a.right,o.topRight,0,s),bottomLeft:ja(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:ja(!l||a.bottom||a.right,o.bottomRight,0,s)}}function Lie(e){const t=mF(e),n=t.right-t.left,r=t.bottom-t.top,i=Die(e,n/2,r/2),o=Nie(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function Wx(e,t,n,r){const i=t===null,o=n===null,a=e&&!(i&&o)&&mF(e,r);return a&&(i||Ks(t,a.left,a.right))&&(o||Ks(n,a.top,a.bottom))}function Fie(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function jie(e,t){e.rect(t.x,t.y,t.w,t.h)}function Ux(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+s,radius:e.radius}}class lc extends vs{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:s}=Lie(this),a=Fie(s.radius)?Ah:jie;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,Ux(s,n,o)),t.clip(),a(t,Ux(o,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Ux(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return Wx(this,t,n,r)}inXRange(t,n){return Wx(this,t,null,n)}inYRange(t,n){return Wx(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Oe(lc,"id","bar"),Oe(lc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Oe(lc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var $ie=Object.freeze({__proto__:null,ArcElement:_u,BarElement:lc,LineElement:Fa,PointElement:ac});const aS=["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)"],QA=aS.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function bF(e){return aS[e%aS.length]}function yF(e){return QA[e%QA.length]}function zie(e,t){return e.borderColor=bF(t),e.backgroundColor=yF(t),++t}function Bie(e,t){return e.backgroundColor=e.data.map(()=>bF(t++)),t}function Hie(e,t){return e.backgroundColor=e.data.map(()=>yF(t++)),t}function Vie(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof Hl?t=Bie(n,t):i instanceof ah?t=Hie(n,t):i&&(t=zie(n,t))}}function ZA(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Wie(e){return e&&(e.borderColor||e.backgroundColor)}function Uie(){return En.borderColor!=="rgba(0,0,0,0.1)"||En.backgroundColor!=="rgba(0,0,0,0.1)"}var Gie={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:o}=i,s=ZA(r)||Wie(i)||o&&ZA(o)||Uie();if(!n.forceOverride&&s)return;const a=Vie(e);r.forEach(a)}};function qie(e,t,n,r,i){const o=i.samples||r;if(o>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let u=t,d,p,h,m,b;for(s[l++]=e[u],d=0;d<o-2;d++){let y=0,x=0,w;const _=Math.floor((d+1)*a)+1+t,E=Math.min(Math.floor((d+2)*a)+1,n)+t,C=E-_;for(w=_;w<E;w++)y+=e[w].x,x+=e[w].y;y/=C,x/=C;const R=Math.floor(d*a)+1+t,T=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:M,y:N}=e[u];for(h=m=-1,w=R;w<T;w++)m=.5*Math.abs((M-y)*(e[w].y-N)-(M-e[w].x)*(x-N)),m>h&&(h=m,p=e[w],b=w);s[l++]=p,u=b}return s[l++]=e[c],s}function Yie(e,t,n,r){let i=0,o=0,s,a,l,c,u,d,p,h,m,b;const y=[],x=t+n-1,w=e[t].x,E=e[x].x-w;for(s=t;s<t+n;++s){a=e[s],l=(a.x-w)/E*r,c=a.y;const C=l|0;if(C===u)c<m?(m=c,d=s):c>b&&(b=c,p=s),i=(o*i+a.x)/++o;else{const R=s-1;if(!Rt(d)&&!Rt(p)){const T=Math.min(d,p),M=Math.max(d,p);T!==h&&T!==R&&y.push({...e[T],x:i}),M!==h&&M!==R&&y.push({...e[M],x:i})}s>0&&R!==h&&y.push(e[R]),y.push(a),u=C,o=0,m=b=c,d=p=h=s}}return y}function vF(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 JA(e){e.data.datasets.forEach(t=>{vF(t)})}function Kie(e,t){const n=t.length;let r=0,i;const{iScale:o}=e,{min:s,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=ur(Xs(t,o.axis,s).lo,0,n-1)),c?i=ur(Xs(t,o.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var Xie={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){JA(e);return}const r=e.width;e.data.datasets.forEach((i,o)=>{const{_data:s,indexAxis:a}=i,l=e.getDatasetMeta(o),c=s||i.data;if(wn([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:p}=Kie(l,c);const h=n.threshold||4*r;if(p<=h){vF(i);return}Rt(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let m;switch(n.algorithm){case"lttb":m=qie(c,d,p,r,n);break;case"min-max":m=Yie(c,d,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=m})},destroy(e){JA(e)}};function Qie(e,t,n){const r=e.segments,i=e.points,o=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=sE(l,c,i);const u=lS(n,i[l],i[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:i[l],end:i[c]});continue}const d=tF(t,u);for(const p of d){const h=lS(n,o[p.start],o[p.end],p.loop),m=eF(a,i,h);for(const b of m)s.push({source:b,target:p,start:{[n]:eO(u,h,"start",Math.max)},end:{[n]:eO(u,h,"end",Math.min)}})}}return s}function lS(e,t,n,r){if(r)return;let i=t[e],o=n[e];return e==="angle"&&(i=Di(i),o=Di(o)),{property:e,start:i,end:o}}function Zie(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=sE(s,a,i);const l=i[s],c=i[a];r!==null?(o.push({x:l.x,y:r}),o.push({x:c.x,y:r})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function sE(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function eO(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function xF(e,t){let n=[],r=!1;return _n(e)?(r=!0,n=e):n=Zie(e,t),n.length?new Fa({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function tO(e){return e&&e.fill!==!1}function Jie(e,t,n){let i=e[t].fill;const o=[t];let s;if(!n)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!Ln(i))return i;if(s=e[i],!s)return!1;if(s.visible)return i;o.push(i),i=s.fill}return!1}function eoe(e,t,n){const r=ioe(e);if(Ot(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return Ln(i)&&Math.floor(i)===i?toe(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function toe(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function noe(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Ot(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function roe(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Ot(e)?r=e.value:r=t.getBaseValue(),r}function ioe(e){const t=e.options,n=t.fill;let r=rt(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function ooe(e){const{scale:t,index:n,line:r}=e,i=[],o=r.segments,s=r.points,a=soe(t,n);a.push(xF({x:null,y:t.bottom},r));for(let l=0;l<o.length;l++){const c=o[l];for(let u=c.start;u<=c.end;u++)aoe(i,s[u],a)}return new Fa({points:i,options:{}})}function soe(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const o=r[i];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function aoe(e,t,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:s,last:a,point:l}=loe(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function loe(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],o=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const u=o[c],d=s[u.start][n],p=s[u.end][n];if(Ks(i,d,p)){a=i===d,l=i===p;break}}return{first:a,last:l,point:r}}class wF{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:o,radius:s}=this;return n=n||{start:0,end:Cn},t.arc(i,o,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,o=t.angle;return{x:n+Math.cos(o)*i,y:r+Math.sin(o)*i,angle:o}}}function coe(e){const{chart:t,fill:n,line:r}=e;if(Ln(n))return uoe(t,n);if(n==="stack")return ooe(e);if(n==="shape")return!0;const i=doe(e);return i instanceof wF?i:xF(i,r)}function uoe(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function doe(e){return(e.scale||{}).getPointPositionForValue?hoe(e):foe(e)}function foe(e){const{scale:t={},fill:n}=e,r=noe(n,t);if(Ln(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function hoe(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,o=r.reverse?t.max:t.min,s=roe(n,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new wF({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,s));return a}function Gx(e,t,n){const r=coe(t),{line:i,scale:o,axis:s}=t,a=i.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};r&&i.points.length&&(rc(e,n),poe(e,{line:i,target:r,above:u,below:d,area:n,scale:o,axis:s}),ic(e))}function poe(e,t){const{line:n,target:r,above:i,below:o,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&o!==i&&(nO(e,r,s.top),rO(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),nO(e,r,s.bottom)),rO(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore()}function nO(e,t,n){const{segments:r,points:i}=t;let o=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[sE(l,c,i)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function rO(e,t){const{line:n,target:r,property:i,color:o,scale:s}=t,a=Qie(n,r,i);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:p=o}={}}=l,h=r!==!0;e.save(),e.fillStyle=p,goe(e,s,h&&lS(i,u,d)),e.beginPath();const m=!!n.pathSegment(e,l);let b;if(h){m?e.closePath():iO(e,r,d,i);const y=!!r.pathSegment(e,c,{move:m,reverse:!0});b=m&&y,b||iO(e,r,u,i)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function goe(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:o,start:s,end:a}=n||{};o==="x"&&(e.beginPath(),e.rect(s,r,a-s,i-r),e.clip())}function iO(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var moe={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let o,s,a,l;for(s=0;s<r;++s)o=e.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof Fa&&(l={visible:e.isDatasetVisible(s),index:s,fill:eoe(a,s,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=Jie(i,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let s=i.length-1;s>=0;--s){const a=i[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&Gx(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const o=r[i].$filler;tO(o)&&Gx(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!tO(r)||n.drawTime!=="beforeDatasetDraw"||Gx(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const oO=(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)}},boe=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class sO extends vs{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,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=qn(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=oO(r,o);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let d=t;o.textAlign="left",o.textBaseline="middle";let p=-1,h=-u;return this.legendItems.forEach((m,b)=>{const y=r+n/2+o.measureText(m.text).width;(b===0||c[c.length-1]+y+2*a>s)&&(d+=u,c[c.length-(b>0?0:1)]=0,h+=u,p++),l[b]={left:0,top:h,row:p,width:y,height:i},c[c.length-1]+=y+a}),d}_fitCols(t,n,r,i){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=a,p=0,h=0,m=0,b=0;return this.legendItems.forEach((y,x)=>{const{itemWidth:w,itemHeight:_}=yoe(r,n,o,y,i);x>0&&h+_+2*a>u&&(d+=p+a,c.push({width:p,height:h}),m+=p+a,b++,p=h=0),l[x]={left:m,top:h,col:b,width:w,height:_},p=Math.max(p,w),h+=_+a}),d+=p,c.push({width:p,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,s=Du(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Tr(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Tr(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let a=0,l=Tr(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Tr(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;rc(t,this),this._draw(),ic(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=En.color,l=Du(t.rtl,this.left,this.width),c=qn(s.font),{padding:u}=s,d=c.size,p=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:m,boxHeight:b,itemHeight:y}=oO(s,d),x=function(R,T,M){if(isNaN(m)||m<=0||isNaN(b)||b<0)return;i.save();const N=rt(M.lineWidth,1);if(i.fillStyle=rt(M.fillStyle,a),i.lineCap=rt(M.lineCap,"butt"),i.lineDashOffset=rt(M.lineDashOffset,0),i.lineJoin=rt(M.lineJoin,"miter"),i.lineWidth=N,i.strokeStyle=rt(M.strokeStyle,a),i.setLineDash(rt(M.lineDash,[])),s.usePointStyle){const j={radius:b*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:N},F=l.xPlus(R,m/2),$=T+p;VL(i,j,F,$,s.pointStyleWidth&&m)}else{const j=T+Math.max((d-b)/2,0),F=l.leftForLtr(R,m),$=oc(M.borderRadius);i.beginPath(),Object.values($).some(Q=>Q!==0)?Ah(i,{x:F,y:j,w:m,h:b,radius:$}):i.rect(F,j,m,b),i.fill(),N!==0&&i.stroke()}i.restore()},w=function(R,T,M){Sc(i,M.text,R,T+y/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},_=this.isHorizontal(),E=this._computeTitleHeight();_?h={x:Tr(o,this.left+u,this.right-r[0]),y:this.top+u+E,line:0}:h={x:this.left+u,y:Tr(o,this.top+E+u,this.bottom-n[0].height),line:0},QL(this.ctx,t.textDirection);const C=y+u;this.legendItems.forEach((R,T)=>{i.strokeStyle=R.fontColor,i.fillStyle=R.fontColor;const M=i.measureText(R.text).width,N=l.textAlign(R.textAlign||(R.textAlign=s.textAlign)),j=m+p+M;let F=h.x,$=h.y;l.setWidth(this.width),_?T>0&&F+j+u>this.right&&($=h.y+=C,h.line++,F=h.x=Tr(o,this.left+u,this.right-r[h.line])):T>0&&$+C>this.bottom&&(F=h.x=F+n[h.line].width+u,h.line++,$=h.y=Tr(o,this.top+E+u,this.bottom-n[h.line].height));const Q=l.x(F);if(x(Q,$,R),F=jte(N,F+m+p,_?F+j:this.right,t.rtl),w(l.x(F),$,R),_)h.x+=j+u;else if(typeof R.text!="string"){const H=c.lineHeight;h.y+=SF(R,H)+u}else h.y+=C}),ZL(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=qn(n.font),i=vr(n.padding);if(!n.display)return;const o=Du(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+c,d=Tr(t.align,d,this.right-p);else{const m=this.columnSizes.reduce((b,y)=>Math.max(b,y.height),0);u=c+Tr(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const h=Tr(a,d,d+p);s.textAlign=o.textAlign(QC(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Sc(s,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=qn(t.font),r=vr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(Ks(t,this.left,this.right)&&Ks(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],Ks(t,i.left,i.left+i.width)&&Ks(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!woe(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=boe(i,r);i&&!o&&cn(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&cn(n.onHover,[t,r,this],this)}else r&&cn(n.onClick,[t,r,this],this)}}function yoe(e,t,n,r,i){const o=voe(r,e,t,n),s=xoe(i,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function voe(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,s)=>o.length>s.length?o:s)),t+n.size/2+r.measureText(i).width}function xoe(e,t,n){let r=e;return typeof t.text!="string"&&(r=SF(t,n)),r}function SF(e,t){const n=e.text?e.text.length:0;return t*n}function woe(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Soe={id:"legend",_element:sO,start(e,t,n){const r=e.legend=new sO({ctx:e.ctx,options:n,chart:e});Or.configure(e,r,n),Or.addBox(e,r)},stop(e){Or.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Or.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=vr(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:s&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let aE=class extends vs{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=_n(r.text)?r.text.length:1;this._padding=vr(r.padding);const o=i*qn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:o,options:s}=this,a=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=Tr(a,r,o),d=n+t,c=o-r):(s.position==="left"?(u=r+t,d=Tr(a,i,n),l=Rn*-.5):(u=o-t,d=Tr(a,n,i),l=Rn*.5),c=i-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),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Sc(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:QC(n.align),textBaseline:"middle",translation:[s,a]})}};function _oe(e,t){const n=new aE({ctx:e.ctx,options:t,chart:e});Or.configure(e,n,t),Or.addBox(e,n),e.titleBlock=n}var Coe={id:"title",_element:aE,start(e,t,n){_oe(e,n)},stop(e){const t=e.titleBlock;Or.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Or.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const im=new WeakMap;var Eoe={id:"subtitle",start(e,t,n){const r=new aE({ctx:e.ctx,options:n,chart:e});Or.configure(e,r,n),Or.addBox(e,r),im.set(e,r)},stop(e){Or.removeBox(e,im.get(e)),im.delete(e)},beforeUpdate(e,t,n){const r=im.get(e);Or.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Uf={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,o=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=e.length;o<s;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=tS(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Ho(e,t){return t&&(_n(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function $s(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
314
- `)>-1?e.split(`
315
- `):e}function Roe(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(i);return{chart:e,label:s,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function aO(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,l=qn(t.bodyFont),c=qn(t.titleFont),u=qn(t.footerFont),d=o.length,p=i.length,h=r.length,m=vr(t.padding);let b=m.height,y=0,x=r.reduce((E,C)=>E+C.before.length+C.lines.length+C.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const E=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=h*E+(x-h)*l.lineHeight+(x-1)*t.bodySpacing}p&&(b+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let w=0;const _=function(E){y=Math.max(y,n.measureText(E).width+w)};return n.save(),n.font=c.string,en(e.title,_),n.font=l.string,en(e.beforeBody.concat(e.afterBody),_),w=t.displayColors?s+2+t.boxPadding:0,en(r,E=>{en(E.before,_),en(E.lines,_),en(E.after,_)}),w=0,n.font=u.string,en(e.footer,_),n.restore(),y+=m.width,{width:y,height:b}}function Poe(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Toe(e,t,n,r){const{x:i,width:o}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&i+o+s>t.width||e==="right"&&i-o-s<0)return!0}function koe(e,t,n,r){const{x:i,width:o}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=o/2?c="left":i>=s-o/2&&(c="right"),Toe(c,e,t,n)&&(c="center"),c}function lO(e,t,n){const r=n.yAlign||t.yAlign||Poe(e,n);return{xAlign:n.xAlign||t.xAlign||koe(e,t,n,r),yAlign:r}}function Aoe(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Ooe(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function cO(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:p,bottomRight:h}=oc(s);let m=Aoe(t,a);const b=Ooe(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,p)+i:a==="right"&&(m+=Math.max(d,h)+i),{x:ur(m,0,r.width-t.width),y:ur(b,0,r.height-t.height)}}function om(e,t,n){const r=vr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function uO(e){return Ho([],$s(e))}function Moe(e,t,n){return il(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function dO(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const _F={beforeTitle:Ds,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:Ds,beforeBody:Ds,beforeLabel:Ds,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 Rt(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:Ds,afterBody:Ds,beforeFooter:Ds,footer:Ds,afterFooter:Ds};function si(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?_F[t].call(n,r):i}var u1;let fO=(u1=class extends vs{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new nF(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Moe(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=si(r,"beforeTitle",this,t),o=si(r,"title",this,t),s=si(r,"afterTitle",this,t);let a=[];return a=Ho(a,$s(i)),a=Ho(a,$s(o)),a=Ho(a,$s(s)),a}getBeforeBody(t,n){return uO(si(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return en(t,o=>{const s={before:[],lines:[],after:[]},a=dO(r,o);Ho(s.before,$s(si(a,"beforeLabel",this,o))),Ho(s.lines,si(a,"label",this,o)),Ho(s.after,$s(si(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return uO(si(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=si(r,"beforeFooter",this,t),o=si(r,"footer",this,t),s=si(r,"afterFooter",this,t);let a=[];return a=Ho(a,$s(i)),a=Ho(a,$s(o)),a=Ho(a,$s(s)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(Roe(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,p)=>t.filter(u,d,p,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),en(a,u=>{const d=dO(t.callbacks,u);i.push(si(d,"labelColor",this,u)),o.push(si(d,"labelPointStyle",this,u)),s.push(si(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,s=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=Uf[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=aO(this,r),c=Object.assign({},a,l),u=lO(this.chart,r,c),d=cO(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=oc(a),{x:p,y:h}=t,{width:m,height:b}=n;let y,x,w,_,E,C;return o==="center"?(E=h+b/2,i==="left"?(y=p,x=y-s,_=E+s,C=E-s):(y=p+m,x=y+s,_=E-s,C=E+s),w=y):(i==="left"?x=p+Math.max(l,u)+s:i==="right"?x=p+m-Math.max(c,d)-s:x=this.caretX,o==="top"?(_=h,E=_-s,y=x-s,w=x+s):(_=h+b,E=_+s,y=x+s,w=x-s),C=_),{x1:y,x2:x,x3:w,y1:_,y2:E,y3:C}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,l;if(o){const c=Du(r.rtl,this.x,this.width);for(t.x=om(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=qn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,o){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=qn(o.bodyFont),d=om(this,"left",o),p=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+h;if(o.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=i.leftForLtr(p,c)+c/2,x=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Rb(t,b,y,x),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Rb(t,b,y,x)}else{t.lineWidth=Ot(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const b=i.leftForLtr(p,c),y=i.leftForLtr(i.xPlus(p,1),c-2),x=oc(s.borderRadius);Object.values(x).some(w=>w!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Ah(t,{x:b,y:m,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Ah(t,{x:y,y:m+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(b,m,c,l),t.strokeRect(b,m,c,l),t.fillStyle=s.backgroundColor,t.fillRect(y,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=qn(r.bodyFont);let p=d.lineHeight,h=0;const m=Du(r.rtl,this.x,this.width),b=function(M){n.fillText(M,m.x(t.x+h),t.y+p/2),t.y+=p+o},y=m.textAlign(s);let x,w,_,E,C,R,T;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=om(this,y,r),n.fillStyle=r.bodyColor,en(this.beforeBody,b),h=a&&y!=="right"?s==="center"?c/2+u:c+2+u:0,E=0,R=i.length;E<R;++E){for(x=i[E],w=this.labelTextColors[E],n.fillStyle=w,en(x.before,b),_=x.lines,a&&_.length&&(this._drawColorBox(n,t,E,m,r),p=Math.max(d.lineHeight,l)),C=0,T=_.length;C<T;++C)b(_[C]),p=d.lineHeight;en(x.after,b)}h=0,p=d.lineHeight,en(this.afterBody,b),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let s,a;if(o){const l=Du(r.rtl,this.x,this.width);for(t.x=om(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=qn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<o;++a)n.fillText(i[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:p,bottomLeft:h,bottomRight:m}=oc(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),s==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-p,l),n.quadraticCurveTo(a+c,l,a+c,l+p),s==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-m),n.quadraticCurveTo(a+c,l+u,a+c-m,l+u),s==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),s==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const s=Uf[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=aO(this,t),l=Object.assign({},s,this._size),c=lO(n,t,l),u=cO(t,l,c,n);(i._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=vr(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),QL(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),ZL(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Sb(r,i),s=this._positionChanged(i,n);(o||s)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],s=this._getActiveElements(t,o,n,r),a=this._positionChanged(s,t),l=n||!Sb(s,o)||a;return l&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,s=Uf[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}},Oe(u1,"positioners",Uf),u1);var CF={id:"tooltip",_element:fO,positioners:Uf,afterInit(e,t,n){n&&(e.tooltip=new fO({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:_F},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"]},Ioe=Object.freeze({__proto__:null,Colors:Gie,Decimation:Xie,Filler:moe,Legend:Soe,SubTitle:Eoe,Title:Coe,Tooltip:CF});const Doe=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Noe(e,t,n,r){const i=e.indexOf(t);if(i===-1)return Doe(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const Loe=(e,t)=>e===null?null:ur(Math.round(e),0,t);function hO(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Ab extends ol{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Rt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Noe(r,t,rt(n,t),this._addedLabels),Loe(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)i.push({value:s});return i}getLabelForValue(t){return hO.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Oe(Ab,"id","category"),Oe(Ab,"defaults",{ticks:{callback:hO}});function Foe(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:p}=e,h=o||1,m=u-1,{min:b,max:y}=t,x=!Rt(s),w=!Rt(a),_=!Rt(c),E=(y-b)/(d+1);let C=aA((y-b)/m/h)*h,R,T,M,N;if(C<1e-14&&!x&&!w)return[{value:b},{value:y}];N=Math.ceil(y/C)-Math.floor(b/C),N>m&&(C=aA(N*C/m/h)*h),Rt(l)||(R=Math.pow(10,l),C=Math.ceil(C*R)/R),i==="ticks"?(T=Math.floor(b/C)*C,M=Math.ceil(y/C)*C):(T=b,M=y),x&&w&&o&&Ote((a-s)/o,C/1e3)?(N=Math.round(Math.min((a-s)/C,u)),C=(a-s)/N,T=s,M=a):_?(T=x?s:T,M=w?a:M,N=c-1,C=(M-T)/N):(N=(M-T)/C,ih(N,Math.round(N),C/1e3)?N=Math.round(N):N=Math.ceil(N));const j=Math.max(lA(C),lA(T));R=Math.pow(10,Rt(l)?j:l),T=Math.round(T*R)/R,M=Math.round(M*R)/R;let F=0;for(x&&(p&&T!==s?(n.push({value:s}),T<s&&F++,ih(Math.round((T+F*C)*R)/R,s,pO(s,E,e))&&F++):T<s&&F++);F<N;++F){const $=Math.round((T+F*C)*R)/R;if(w&&$>a)break;n.push({value:$})}return w&&p&&M!==a?n.length&&ih(n[n.length-1].value,a,pO(a,E,e))?n[n.length-1].value=a:n.push({value:a}):(!w||M===a)&&n.push({value:M}),n}function pO(e,t,{horizontal:n,minRotation:r}){const i=To(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class Ob extends ol{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 Rt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=rs(i),c=rs(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,s=Foe(i,o);return t.bounds==="ticks"&&DL(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return yp(t,this.chart.options.locale,this.options.ticks.format)}}class pd extends Ob{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=To(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Oe(pd,"id","linear"),Oe(pd,"defaults",{ticks:{callback:Ky.formatters.numeric}});const Mh=e=>Math.floor(La(e)),Pl=(e,t)=>Math.pow(10,Mh(e)+t);function gO(e){return e/Math.pow(10,Mh(e))===1}function mO(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function joe(e,t){const n=t-e;let r=Mh(n);for(;mO(e,t,r)>10;)r++;for(;mO(e,t,r)<10;)r--;return Math.min(r,Mh(e))}function $oe(e,{min:t,max:n}){t=Oi(e.min,t);const r=[],i=Mh(t);let o=joe(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,o)),p=Oi(e.min,Math.round((l+u+d*Math.pow(10,o))*s)/s);for(;p<n;)r.push({value:p,major:gO(p),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,s=o>=0?1:s),p=Math.round((l+u+d*Math.pow(10,o))*s)/s;const h=Oi(e.max,p);return r.push({value:h,major:gO(h),significand:d}),r}class gd extends ol{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Ob.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===Pl(this.min,0)?Pl(this.min,-1):Pl(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(Pl(r,-1)),s(Pl(i,1)))),r<=0&&o(Pl(i,-1)),i<=0&&s(Pl(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=$oe(n,this);return t.bounds==="ticks"&&DL(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":yp(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=La(t),this._valueRange=La(this.max)-La(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(La(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Oe(gd,"id","logarithmic"),Oe(gd,"defaults",{ticks:{callback:Ky.formatters.logarithmic,major:{enabled:!0}}});function cS(e){const t=e.ticks;if(t.display&&e.display){const n=vr(t.backdropPadding);return rt(t.font&&t.font.size,En.font.size)+n.height}return 0}function zoe(e,t,n){return n=_n(n)?n:[n],{w:Yte(e,t.string,n),h:n.length*t.lineHeight}}function bO(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Boe(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Rn/o:0;for(let l=0;l<o;l++){const c=s.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),d=qn(c.font),p=zoe(e.ctx,d,e._pointLabels[l]);r[l]=p;const h=Di(e.getIndexAngle(l)+a),m=Math.round(KC(h)),b=bO(m,u.x,p.w,0,180),y=bO(m,u.y,p.h,90,270);Hoe(n,t,h,b,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Uoe(e,r,i)}function Hoe(e,t,n,r,i){const o=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/s,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function Voe(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(KC(Di(l.angle+Hn))),u=Yoe(l.y,a.h,c),d=Goe(c),p=qoe(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:p,top:u,right:p+a.w,bottom:u+a.h}}function Woe(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(Qs({x:n,y:r},t)||Qs({x:n,y:o},t)||Qs({x:i,y:r},t)||Qs({x:i,y:o},t))}function Uoe(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:cS(o)/2,additionalAngle:s?Rn/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=Voe(e,u,l);r.push(d),a==="auto"&&(d.visible=Woe(d,c),d.visible&&(c=d))}return r}function Goe(e){return e===0||e===180?"center":e<180?"left":"right"}function qoe(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Yoe(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Koe(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!Rt(a)){const l=oc(t.borderRadius),c=vr(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,p=o-r+c.width,h=s-i+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),Ah(e,{x:u,y:d,w:p,h,radius:l}),e.fill()):e.fillRect(u,d,p,h)}}function Xoe(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));Koe(n,s,o);const a=qn(s.font),{x:l,y:c,textAlign:u}=o;Sc(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function EF(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Cn);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s<r;s++)o=e.getPointPosition(s,t),i.lineTo(o.x,o.y)}}function Qoe(e,t,n,r,i){const o=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(i.dash||[]),o.lineDashOffset=i.dashOffset,o.beginPath(),EF(e,n,s,r),o.closePath(),o.stroke(),o.restore())}function Zoe(e,t,n){return il(e,{label:n,index:t,type:"pointLabel"})}class Gf extends Ob{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=vr(cS(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/cS(this.options))}generateTickLabels(t){Ob.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=cn(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?Boe(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=Cn/(this._pointLabels.length||1),r=this.options.startAngle||0;return Di(t*n+To(r))}getDistanceFromCenterForValue(t){if(Rt(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(Rt(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 Zoe(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-Hn+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),EF(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:o}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&Xoe(this,s),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const p=this.getContext(d),h=i.setContext(p),m=o.setContext(p);Qoe(this,h,l,s,m)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:p}=u;!p||!d||(t.lineWidth=p,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=qn(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=vr(c.backdropPadding);t.fillRect(-s/2-d.left,-o-u.size/2-d.top,s+d.width,u.size+d.height)}Sc(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Oe(Gf,"id","radialLinear"),Oe(Gf,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ky.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Oe(Gf,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Oe(Gf,"descriptors",{angleLines:{_fallback:"grid"}});const Qy={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}},gi=Object.keys(Qy);function yO(e,t){return e-t}function vO(e,t){if(Rt(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),Ln(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(dd(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function xO(e,t,n,r){const i=gi.length;for(let o=gi.indexOf(e);o<i-1;++o){const s=Qy[gi[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return gi[o]}return gi[i-1]}function Joe(e,t,n,r,i){for(let o=gi.length-1;o>=gi.indexOf(n);o--){const s=gi[o];if(Qy[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return gi[n?gi.indexOf(n):0]}function ese(e){for(let t=gi.indexOf(e)+1,n=gi.length;t<n;++t)if(Qy[gi[t]].common)return gi[t]}function wO(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=XC(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function tse(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function SO(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s<o;++s)a=t[s],i[a]=s,r.push({value:a,major:!1});return o===0||!n?r:tse(e,r,i,n)}class Ih extends ol{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new ure._date(t.adapters.date);i.init(n),rh(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:vO(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Ln(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=Ln(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,s=this.max,a=Nte(i,o,s);return this._unit=n.unit||(r.autoSkip?xO(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Joe(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:ese(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),SO(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=ur(n,0,s),r=ur(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||xO(o.minUnit,n,r,this._getLabelCapacity(n)),a=rt(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=dd(l)||l===!0,u={};let d=n,p,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(p=d,h=0;p<r;p=+t.add(p,a,s),h++)wO(u,p,m);return(p===r||i.bounds==="ticks"||h===1)&&wO(u,p,m),Object.keys(u).sort(yO).map(b=>+b)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return cn(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],p=r[n],h=c&&d&&p&&p.major;return this._adapter.format(t,i||(h?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=To(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),s=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*s,h:r*s+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,SO(this,[t],this._majorUnit),i),s=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(vO(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return FL(t.sort(yO))}}Oe(Ih,"id","time"),Oe(Ih,"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 sm(e,t,n){let r=0,i=e.length-1,o,s,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=Xs(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=Xs(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class uS extends Ih{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=sm(n,this.min),this._tableRange=sm(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,l,c,u;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;s<a;++s)u=i[s+1],l=i[s-1],c=i[s],Math.round((u+l)/2)!==c&&o.push({time:c,pos:s/(a-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(sm(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return sm(this._table,r*this._tableRange+this._minPos,!0)}}Oe(uS,"id","timeseries"),Oe(uS,"defaults",Ih.defaults);var nse=Object.freeze({__proto__:null,CategoryScale:Ab,LinearScale:pd,LogarithmicScale:gd,RadialLinearScale:Gf,TimeScale:Ih,TimeSeriesScale:uS});const rse=[cre,$ie,Ioe,nse];class Ka{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[r++]=a),t=s}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,o,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}}function*ise(e){for(const t of e)yield*t}function RF(e){return Array.from(ise(e))}function Cu(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}var Ze=1e-6,PF=1e-12,Et=Math.PI,Nn=Et/2,_O=Et/4,Bi=Et*2,Ur=180/Et,un=Et/180,Vt=Math.abs,Id=Math.atan,cs=Math.atan2,ut=Math.cos,am=Math.ceil,TF=Math.exp,Mb=Math.log,qx=Math.pow,ot=Math.sin,lo=Math.sign||function(e){return e>0?1:e<0?-1:0},Xr=Math.sqrt,lE=Math.tan;function kF(e){return e>1?0:e<-1?Et:Math.acos(e)}function fo(e){return e>1?Nn:e<-1?-Nn:Math.asin(e)}function cr(){}function Ib(e,t){e&&EO.hasOwnProperty(e.type)&&EO[e.type](e,t)}var CO={Feature:function(e,t){Ib(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Ib(n[r].geometry,t)}},EO={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,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){dS(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)dS(n[r],t,0)},Polygon:function(e,t){RO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)RO(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Ib(n[r],t)}};function dS(e,t,n){var r=-1,i=e.length-n,o;for(t.lineStart();++r<i;)o=e[r],t.point(o[0],o[1],o[2]);t.lineEnd()}function RO(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)dS(e[n],t,1);t.polygonEnd()}function Nl(e,t){e&&CO.hasOwnProperty(e.type)?CO[e.type](e,t):Ib(e,t)}function fS(e){return[cs(e[1],e[0]),fo(e[2])]}function md(e){var t=e[0],n=e[1],r=ut(n);return[r*ut(t),r*ot(t),ot(n)]}function lm(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Db(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 Yx(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function cm(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function hS(e){var t=Xr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function pS(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function gS(e,t){return Vt(e)>Et&&(e-=Math.round(e/Bi)*Bi),[e,t]}gS.invert=gS;function AF(e,t,n){return(e%=Bi)?t||n?pS(TO(e),kO(t,n)):TO(e):t||n?kO(t,n):gS}function PO(e){return function(t,n){return t+=e,Vt(t)>Et&&(t-=Math.round(t/Bi)*Bi),[t,n]}}function TO(e){var t=PO(e);return t.invert=PO(-e),t}function kO(e,t){var n=ut(e),r=ot(e),i=ut(t),o=ot(t);function s(a,l){var c=ut(l),u=ut(a)*c,d=ot(a)*c,p=ot(l),h=p*n+u*r;return[cs(d*i-h*o,u*n-p*r),fo(h*i+d*o)]}return s.invert=function(a,l){var c=ut(l),u=ut(a)*c,d=ot(a)*c,p=ot(l),h=p*i-d*o;return[cs(d*i+p*o,u*n+h*r),fo(h*n-u*r)]},s}function ose(e){e=AF(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]*=Ur,n[1]*=Ur,n}return t.invert=function(n){return n=e.invert(n[0]*un,n[1]*un),n[0]*=Ur,n[1]*=Ur,n},t}function sse(e,t,n,r,i,o){if(n){var s=ut(t),a=ot(t),l=r*n;i==null?(i=t+r*Bi,o=t-l/2):(i=AO(s,i),o=AO(s,o),(r>0?i<o:i>o)&&(i+=r*Bi));for(var c,u=i;r>0?u>o:u<o;u-=l)c=fS([s,-a*ut(u),-a*ot(u)]),e.point(c[0],c[1])}}function AO(e,t){t=md(t),t[0]-=e,hS(t);var n=kF(-t[1]);return((-t[2]<0?-n:n)+Bi-Ze)%Bi}function OF(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:cr,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function eb(e,t){return Vt(e[0]-t[0])<Ze&&Vt(e[1]-t[1])<Ze}function um(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 MF(e,t,n,r,i){var o=[],s=[],a,l;if(e.forEach(function(m){if(!((b=m.length-1)<=0)){var b,y=m[0],x=m[b],w;if(eb(y,x)){if(!y[2]&&!x[2]){for(i.lineStart(),a=0;a<b;++a)i.point((y=m[a])[0],y[1]);i.lineEnd();return}x[0]+=2*Ze}o.push(w=new um(y,m,null,!0)),s.push(w.o=new um(y,null,w,!1)),o.push(w=new um(x,m,null,!1)),s.push(w.o=new um(x,null,w,!0))}}),!!o.length){for(s.sort(t),OO(o),OO(s),a=0,l=s.length;a<l;++a)s[a].e=n=!n;for(var c=o[0],u,d;;){for(var p=c,h=!0;p.v;)if((p=p.n)===c)return;u=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(a=0,l=u.length;a<l;++a)i.point((d=u[a])[0],d[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(h)for(u=p.p.z,a=u.length-1;a>=0;--a)i.point((d=u[a])[0],d[1]);else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,u=p.z,h=!h}while(!p.v);i.lineEnd()}}}function OO(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function Kx(e){return Vt(e[0])<=Et?e[0]:lo(e[0])*((Vt(e[0])+Et)%Bi-Et)}function IF(e,t){var n=Kx(t),r=t[1],i=ot(r),o=[ot(n),-ut(n),0],s=0,a=0,l=new Ka;i===1?r=Nn+Ze:i===-1&&(r=-Nn-Ze);for(var c=0,u=e.length;c<u;++c)if(p=(d=e[c]).length)for(var d,p,h=d[p-1],m=Kx(h),b=h[1]/2+_O,y=ot(b),x=ut(b),w=0;w<p;++w,m=E,y=R,x=T,h=_){var _=d[w],E=Kx(_),C=_[1]/2+_O,R=ot(C),T=ut(C),M=E-m,N=M>=0?1:-1,j=N*M,F=j>Et,$=y*R;if(l.add(cs($*N*ot(j),x*T+$*ut(j))),s+=F?M+N*Bi:M,F^m>=n^E>=n){var Q=Db(md(h),md(_));hS(Q);var H=Db(o,Q);hS(H);var L=(F^M>=0?-1:1)*fo(H[2]);(r>L||r===L&&(Q[0]||Q[1]))&&(a+=F^M>=0?1:-1)}}return(s<-1e-6||s<Ze&&l<-1e-12)^a&1}function DF(e,t,n,r){return function(i){var o=t(i),s=OF(),a=t(s),l=!1,c,u,d,p={point:h,lineStart:b,lineEnd:y,polygonStart:function(){p.point=x,p.lineStart=w,p.lineEnd=_,u=[],c=[]},polygonEnd:function(){p.point=h,p.lineStart=b,p.lineEnd=y,u=RF(u);var E=IF(c,r);u.length?(l||(i.polygonStart(),l=!0),MF(u,lse,E,n,i)):E&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(E,C){e(E,C)&&i.point(E,C)}function m(E,C){o.point(E,C)}function b(){p.point=m,o.lineStart()}function y(){p.point=h,o.lineEnd()}function x(E,C){d.push([E,C]),a.point(E,C)}function w(){a.lineStart(),d=[]}function _(){x(d[0][0],d[0][1]),a.lineEnd();var E=a.clean(),C=s.result(),R,T=C.length,M,N,j;if(d.pop(),c.push(d),d=null,!!T){if(E&1){if(N=C[0],(M=N.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),R=0;R<M;++R)i.point((j=N[R])[0],j[1]);i.lineEnd()}return}T>1&&E&2&&C.push(C.pop().concat(C.shift())),u.push(C.filter(ase))}}return p}}function ase(e){return e.length>1}function lse(e,t){return((e=e.x)[0]<0?e[1]-Nn-Ze:Nn-e[1])-((t=t.x)[0]<0?t[1]-Nn-Ze:Nn-t[1])}const MO=DF(function(){return!0},cse,dse,[-Et,-Nn]);function cse(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?Et:-Et,l=Vt(o-t);Vt(l-Et)<Ze?(e.point(t,n=(n+s)/2>0?Nn:-Nn),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&l>=Et&&(Vt(t-r)<Ze&&(t-=r*Ze),Vt(o-a)<Ze&&(o-=a*Ze),n=use(t,n,o,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),i=0),e.point(t=o,n=s),r=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function use(e,t,n,r){var i,o,s=ot(e-n);return Vt(s)>Ze?Id((ot(t)*(o=ut(r))*ot(n)-ot(r)*(i=ut(t))*ot(e))/(i*o*s)):(t+r)/2}function dse(e,t,n,r){var i;if(e==null)i=n*Nn,r.point(-Et,i),r.point(0,i),r.point(Et,i),r.point(Et,0),r.point(Et,-i),r.point(0,-i),r.point(-Et,-i),r.point(-Et,0),r.point(-Et,i);else if(Vt(e[0]-t[0])>Ze){var o=e[0]<t[0]?Et:-Et;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function fse(e){var t=ut(e),n=2*un,r=t>0,i=Vt(t)>Ze;function o(u,d,p,h){sse(h,e,n,p,u,d)}function s(u,d){return ut(u)*ut(d)>t}function a(u){var d,p,h,m,b;return{lineStart:function(){m=h=!1,b=1},point:function(y,x){var w=[y,x],_,E=s(y,x),C=r?E?0:c(y,x):E?c(y+(y<0?Et:-Et),x):0;if(!d&&(m=h=E)&&u.lineStart(),E!==h&&(_=l(d,w),(!_||eb(d,_)||eb(w,_))&&(w[2]=1)),E!==h)b=0,E?(u.lineStart(),_=l(w,d),u.point(_[0],_[1])):(_=l(d,w),u.point(_[0],_[1],2),u.lineEnd()),d=_;else if(i&&d&&r^E){var R;!(C&p)&&(R=l(w,d,!0))&&(b=0,r?(u.lineStart(),u.point(R[0][0],R[0][1]),u.point(R[1][0],R[1][1]),u.lineEnd()):(u.point(R[1][0],R[1][1]),u.lineEnd(),u.lineStart(),u.point(R[0][0],R[0][1],3)))}E&&(!d||!eb(d,w))&&u.point(w[0],w[1]),d=w,h=E,p=C},lineEnd:function(){h&&u.lineEnd(),d=null},clean:function(){return b|(m&&h)<<1}}}function l(u,d,p){var h=md(u),m=md(d),b=[1,0,0],y=Db(h,m),x=lm(y,y),w=y[0],_=x-w*w;if(!_)return!p&&u;var E=t*x/_,C=-t*w/_,R=Db(b,y),T=cm(b,E),M=cm(y,C);Yx(T,M);var N=R,j=lm(T,N),F=lm(N,N),$=j*j-F*(lm(T,T)-1);if(!($<0)){var Q=Xr($),H=cm(N,(-j-Q)/F);if(Yx(H,T),H=fS(H),!p)return H;var L=u[0],G=d[0],V=u[1],B=d[1],X;G<L&&(X=L,L=G,G=X);var I=G-L,q=Vt(I-Et)<Ze,U=q||I<Ze;if(!q&&B<V&&(X=V,V=B,B=X),U?q?V+B>0^H[1]<(Vt(H[0]-L)<Ze?V:B):V<=H[1]&&H[1]<=B:I>Et^(L<=H[0]&&H[0]<=G)){var O=cm(N,(-j+Q)/F);return Yx(O,T),[H,fS(O)]}}}function c(u,d){var p=r?e:Et-e,h=0;return u<-p?h|=1:u>p&&(h|=2),d<-p?h|=4:d>p&&(h|=8),h}return DF(s,a,o,r?[0,-e]:[-Et,e-Et])}function hse(e,t,n,r,i,o){var s=e[0],a=e[1],l=t[0],c=t[1],u=0,d=1,p=l-s,h=c-a,m;if(m=n-s,!(!p&&m>0)){if(m/=p,p<0){if(m<u)return;m<d&&(d=m)}else if(p>0){if(m>d)return;m>u&&(u=m)}if(m=i-s,!(!p&&m<0)){if(m/=p,p<0){if(m>d)return;m>u&&(u=m)}else if(p>0){if(m<u)return;m<d&&(d=m)}if(m=r-a,!(!h&&m>0)){if(m/=h,h<0){if(m<u)return;m<d&&(d=m)}else if(h>0){if(m>d)return;m>u&&(u=m)}if(m=o-a,!(!h&&m<0)){if(m/=h,h<0){if(m>d)return;m>u&&(u=m)}else if(h>0){if(m<u)return;m<d&&(d=m)}return u>0&&(e[0]=s+u*p,e[1]=a+u*h),d<1&&(t[0]=s+d*p,t[1]=a+d*h),!0}}}}}var dm=1e9,fm=-1e9;function pse(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function o(c,u,d,p){var h=0,m=0;if(c==null||(h=s(c,d))!==(m=s(u,d))||l(c,u)<0^d>0)do p.point(h===0||h===3?e:n,h>1?r:t);while((h=(h+d+4)%4)!==m);else p.point(u[0],u[1])}function s(c,u){return Vt(c[0]-e)<Ze?u>0?0:3:Vt(c[0]-n)<Ze?u>0?2:1:Vt(c[1]-t)<Ze?u>0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var d=s(c,1),p=s(u,1);return d!==p?d-p:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=OF(),p,h,m,b,y,x,w,_,E,C,R,T={point:M,lineStart:$,lineEnd:Q,polygonStart:j,polygonEnd:F};function M(L,G){i(L,G)&&u.point(L,G)}function N(){for(var L=0,G=0,V=h.length;G<V;++G)for(var B=h[G],X=1,I=B.length,q=B[0],U,O,ee=q[0],K=q[1];X<I;++X)U=ee,O=K,q=B[X],ee=q[0],K=q[1],O<=r?K>r&&(ee-U)*(r-O)>(K-O)*(e-U)&&++L:K<=r&&(ee-U)*(r-O)<(K-O)*(e-U)&&--L;return L}function j(){u=d,p=[],h=[],R=!0}function F(){var L=N(),G=R&&L,V=(p=RF(p)).length;(G||V)&&(c.polygonStart(),G&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),V&&MF(p,a,L,o,c),c.polygonEnd()),u=c,p=h=m=null}function $(){T.point=H,h&&h.push(m=[]),C=!0,E=!1,w=_=NaN}function Q(){p&&(H(b,y),x&&E&&d.rejoin(),p.push(d.result())),T.point=M,E&&u.lineEnd()}function H(L,G){var V=i(L,G);if(h&&m.push([L,G]),C)b=L,y=G,x=V,C=!1,V&&(u.lineStart(),u.point(L,G));else if(V&&E)u.point(L,G);else{var B=[w=Math.max(fm,Math.min(dm,w)),_=Math.max(fm,Math.min(dm,_))],X=[L=Math.max(fm,Math.min(dm,L)),G=Math.max(fm,Math.min(dm,G))];hse(B,X,e,t,n,r)?(E||(u.lineStart(),u.point(B[0],B[1])),u.point(X[0],X[1]),V||u.lineEnd(),R=!1):V&&(u.lineStart(),u.point(L,G),R=!1)}w=L,_=G,E=V}return T}}var mS,bS,tb,nb,bd={sphere:cr,point:cr,lineStart:gse,lineEnd:cr,polygonStart:cr,polygonEnd:cr};function gse(){bd.point=bse,bd.lineEnd=mse}function mse(){bd.point=bd.lineEnd=cr}function bse(e,t){e*=un,t*=un,bS=e,tb=ot(t),nb=ut(t),bd.point=yse}function yse(e,t){e*=un,t*=un;var n=ot(t),r=ut(t),i=Vt(e-bS),o=ut(i),s=ot(i),a=r*s,l=nb*n-tb*r*o,c=tb*n+nb*r*o;mS.add(cs(Xr(a*a+l*l),c)),bS=e,tb=n,nb=r}function vse(e){return mS=new Ka,Nl(e,bd),+mS}var yS=[null,null],xse={type:"LineString",coordinates:yS};function vS(e,t){return yS[0]=e,yS[1]=t,vse(xse)}var IO={Feature:function(e,t){return Nb(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(Nb(n[r].geometry,t))return!0;return!1}},DO={Sphere:function(){return!0},Point:function(e,t){return NO(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(NO(n[r],t))return!0;return!1},LineString:function(e,t){return LO(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(LO(n[r],t))return!0;return!1},Polygon:function(e,t){return FO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(FO(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(Nb(n[r],t))return!0;return!1}};function Nb(e,t){return e&&DO.hasOwnProperty(e.type)?DO[e.type](e,t):!1}function NO(e,t){return vS(e,t)===0}function LO(e,t){for(var n,r,i,o=0,s=e.length;o<s;o++){if(r=vS(e[o],t),r===0||o>0&&(i=vS(e[o],e[o-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<PF*i))return!0;n=r}return!1}function FO(e,t){return!!IF(e.map(wse),NF(t))}function wse(e){return e=e.map(NF),e.pop(),e}function NF(e){return[e[0]*un,e[1]*un]}function Sse(e,t){return(e&&IO.hasOwnProperty(e.type)?IO[e.type]:Nb)(e,t)}function jO(e,t,n){var r=Cu(e,t-Ze,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function $O(e,t,n){var r=Cu(e,t-Ze,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function LF(){var e,t,n,r,i,o,s,a,l=10,c=l,u=90,d=360,p,h,m,b,y=2.5;function x(){return{type:"MultiLineString",coordinates:w()}}function w(){return Cu(am(r/u)*u,n,u).map(m).concat(Cu(am(a/d)*d,s,d).map(b)).concat(Cu(am(t/l)*l,e,l).filter(function(_){return Vt(_%u)>Ze}).map(p)).concat(Cu(am(o/c)*c,i,c).filter(function(_){return Vt(_%d)>Ze}).map(h))}return x.lines=function(){return w().map(function(_){return{type:"LineString",coordinates:_}})},x.outline=function(){return{type:"Polygon",coordinates:[m(r).concat(b(s).slice(1),m(n).reverse().slice(1),b(a).reverse().slice(1))]}},x.extent=function(_){return arguments.length?x.extentMajor(_).extentMinor(_):x.extentMinor()},x.extentMajor=function(_){return arguments.length?(r=+_[0][0],n=+_[1][0],a=+_[0][1],s=+_[1][1],r>n&&(_=r,r=n,n=_),a>s&&(_=a,a=s,s=_),x.precision(y)):[[r,a],[n,s]]},x.extentMinor=function(_){return arguments.length?(t=+_[0][0],e=+_[1][0],o=+_[0][1],i=+_[1][1],t>e&&(_=t,t=e,e=_),o>i&&(_=o,o=i,i=_),x.precision(y)):[[t,o],[e,i]]},x.step=function(_){return arguments.length?x.stepMajor(_).stepMinor(_):x.stepMinor()},x.stepMajor=function(_){return arguments.length?(u=+_[0],d=+_[1],x):[u,d]},x.stepMinor=function(_){return arguments.length?(l=+_[0],c=+_[1],x):[l,c]},x.precision=function(_){return arguments.length?(y=+_,p=jO(o,i,90),h=$O(t,e,y),m=jO(a,s,90),b=$O(r,n,y),x):y},x.extentMajor([[-180,-90+Ze],[180,90-Ze]]).extentMinor([[-180,-80-Ze],[180,80+Ze]])}function _se(){return LF()()}const xS=e=>e;var Xx=new Ka,wS=new Ka,FF,jF,SS,_S,Us={point:cr,lineStart:cr,lineEnd:cr,polygonStart:function(){Us.lineStart=Cse,Us.lineEnd=Rse},polygonEnd:function(){Us.lineStart=Us.lineEnd=Us.point=cr,Xx.add(Vt(wS)),wS=new Ka},result:function(){var e=Xx/2;return Xx=new Ka,e}};function Cse(){Us.point=Ese}function Ese(e,t){Us.point=$F,FF=SS=e,jF=_S=t}function $F(e,t){wS.add(_S*e-SS*t),SS=e,_S=t}function Rse(){$F(FF,jF)}var yd=1/0,Lb=yd,Dh=-yd,Fb=Dh,jb={point:Pse,lineStart:cr,lineEnd:cr,polygonStart:cr,polygonEnd:cr,result:function(){var e=[[yd,Lb],[Dh,Fb]];return Dh=Fb=-(Lb=yd=1/0),e}};function Pse(e,t){e<yd&&(yd=e),e>Dh&&(Dh=e),t<Lb&&(Lb=t),t>Fb&&(Fb=t)}var CS=0,ES=0,qf=0,$b=0,zb=0,Eu=0,RS=0,PS=0,Yf=0,zF,BF,Qo,Zo,so={point:_c,lineStart:zO,lineEnd:BO,polygonStart:function(){so.lineStart=Ase,so.lineEnd=Ose},polygonEnd:function(){so.point=_c,so.lineStart=zO,so.lineEnd=BO},result:function(){var e=Yf?[RS/Yf,PS/Yf]:Eu?[$b/Eu,zb/Eu]:qf?[CS/qf,ES/qf]:[NaN,NaN];return CS=ES=qf=$b=zb=Eu=RS=PS=Yf=0,e}};function _c(e,t){CS+=e,ES+=t,++qf}function zO(){so.point=Tse}function Tse(e,t){so.point=kse,_c(Qo=e,Zo=t)}function kse(e,t){var n=e-Qo,r=t-Zo,i=Xr(n*n+r*r);$b+=i*(Qo+e)/2,zb+=i*(Zo+t)/2,Eu+=i,_c(Qo=e,Zo=t)}function BO(){so.point=_c}function Ase(){so.point=Mse}function Ose(){HF(zF,BF)}function Mse(e,t){so.point=HF,_c(zF=Qo=e,BF=Zo=t)}function HF(e,t){var n=e-Qo,r=t-Zo,i=Xr(n*n+r*r);$b+=i*(Qo+e)/2,zb+=i*(Zo+t)/2,Eu+=i,i=Zo*e-Qo*t,RS+=i*(Qo+e),PS+=i*(Zo+t),Yf+=i*3,_c(Qo=e,Zo=t)}function VF(e){this._context=e}VF.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,Bi);break}}},result:cr};var TS=new Ka,Qx,WF,UF,Kf,Xf,Nh={point:cr,lineStart:function(){Nh.point=Ise},lineEnd:function(){Qx&&GF(WF,UF),Nh.point=cr},polygonStart:function(){Qx=!0},polygonEnd:function(){Qx=null},result:function(){var e=+TS;return TS=new Ka,e}};function Ise(e,t){Nh.point=GF,WF=Kf=e,UF=Xf=t}function GF(e,t){Kf-=e,Xf-=t,TS.add(Xr(Kf*Kf+Xf*Xf)),Kf=e,Xf=t}let HO,Bb,VO,WO;class UO{constructor(t){this._append=t==null?qF:Dse(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!==VO||this._append!==Bb){const r=this._radius,i=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`,VO=r,Bb=this._append,WO=this._,this._=i}this._+=WO;break}}}result(){const t=this._;return this._="",t.length?t:null}}function qF(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Dse(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return qF;if(t!==HO){const n=10**t;HO=t,Bb=function(i){let o=1;this._+=i[0];for(const s=i.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return Bb}function GO(e,t){let n=3,r=4.5,i,o;function s(a){return a&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),Nl(a,i(o))),o.result()}return s.area=function(a){return Nl(a,i(Us)),Us.result()},s.measure=function(a){return Nl(a,i(Nh)),Nh.result()},s.bounds=function(a){return Nl(a,i(jb)),jb.result()},s.centroid=function(a){return Nl(a,i(so)),so.result()},s.projection=function(a){return arguments.length?(i=a==null?(e=null,xS):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new UO(n)):new VF(t=a),typeof r!="function"&&o.pointRadius(r),s):t},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(o.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const l=Math.floor(a);if(!(l>=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(o=new UO(n)),s},s.projection(e).digits(n).context(t)}function cE(e){return function(t){var n=new kS;for(var r in e)n[r]=e[r];return n.stream=t,n}}function kS(){}kS.prototype={constructor:kS,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 uE(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Nl(n,e.stream(jb)),t(jb.result()),r!=null&&e.clipExtent(r),e}function dE(e,t,n){return uE(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(o-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function YF(e,t,n){return dE(e,[[0,0],t],n)}function KF(e,t,n){return uE(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];e.scale(150*o).translate([s,a])},n)}function XF(e,t,n){return uE(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var qO=16,Nse=ut(30*un);function YO(e,t){return+t?Fse(e,t):Lse(e)}function Lse(e){return cE({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Fse(e,t){function n(r,i,o,s,a,l,c,u,d,p,h,m,b,y){var x=c-r,w=u-i,_=x*x+w*w;if(_>4*t&&b--){var E=s+p,C=a+h,R=l+m,T=Xr(E*E+C*C+R*R),M=fo(R/=T),N=Vt(Vt(R)-1)<Ze||Vt(o-d)<Ze?(o+d)/2:cs(C,E),j=e(N,M),F=j[0],$=j[1],Q=F-r,H=$-i,L=w*Q-x*H;(L*L/_>t||Vt((x*Q+w*H)/_-.5)>.3||s*p+a*h+l*m<Nse)&&(n(r,i,o,s,a,l,F,$,N,E/=T,C/=T,R,b,y),y.point(F,$),n(F,$,N,E,C,R,c,u,d,p,h,m,b,y))}}return function(r){var i,o,s,a,l,c,u,d,p,h,m,b,y={point:x,lineStart:w,lineEnd:E,polygonStart:function(){r.polygonStart(),y.lineStart=C},polygonEnd:function(){r.polygonEnd(),y.lineStart=w}};function x(M,N){M=e(M,N),r.point(M[0],M[1])}function w(){d=NaN,y.point=_,r.lineStart()}function _(M,N){var j=md([M,N]),F=e(M,N);n(d,p,u,h,m,b,d=F[0],p=F[1],u=M,h=j[0],m=j[1],b=j[2],qO,r),r.point(d,p)}function E(){y.point=x,r.lineEnd()}function C(){w(),y.point=R,y.lineEnd=T}function R(M,N){_(i=M,N),o=d,s=p,a=h,l=m,c=b,y.point=_}function T(){n(d,p,u,h,m,b,o,s,i,a,l,c,qO,r),y.lineEnd=E,E()}return y}}var jse=cE({point:function(e,t){this.stream.point(e*un,t*un)}});function $se(e){return cE({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function zse(e,t,n,r,i){function o(s,a){return s*=r,a*=i,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*i]},o}function KO(e,t,n,r,i,o){if(!o)return zse(e,t,n,r,i);var s=ut(o),a=ot(o),l=s*e,c=a*e,u=s/e,d=a/e,p=(a*n-s*t)/e,h=(a*t+s*n)/e;function m(b,y){return b*=r,y*=i,[l*b-c*y+t,n-c*b-l*y]}return m.invert=function(b,y){return[r*(u*b-d*y+p),i*(h-d*b-u*y)]},m}function ia(e){return QF(function(){return e})()}function QF(e){var t,n=150,r=480,i=250,o=0,s=0,a=0,l=0,c=0,u,d=0,p=1,h=1,m=null,b=MO,y=null,x,w,_,E=xS,C=.5,R,T,M,N,j;function F(L){return M(L[0]*un,L[1]*un)}function $(L){return L=M.invert(L[0],L[1]),L&&[L[0]*Ur,L[1]*Ur]}F.stream=function(L){return N&&j===L?N:N=jse($se(u)(b(R(E(j=L)))))},F.preclip=function(L){return arguments.length?(b=L,m=void 0,H()):b},F.postclip=function(L){return arguments.length?(E=L,y=x=w=_=null,H()):E},F.clipAngle=function(L){return arguments.length?(b=+L?fse(m=L*un):(m=null,MO),H()):m*Ur},F.clipExtent=function(L){return arguments.length?(E=L==null?(y=x=w=_=null,xS):pse(y=+L[0][0],x=+L[0][1],w=+L[1][0],_=+L[1][1]),H()):y==null?null:[[y,x],[w,_]]},F.scale=function(L){return arguments.length?(n=+L,Q()):n},F.translate=function(L){return arguments.length?(r=+L[0],i=+L[1],Q()):[r,i]},F.center=function(L){return arguments.length?(o=L[0]%360*un,s=L[1]%360*un,Q()):[o*Ur,s*Ur]},F.rotate=function(L){return arguments.length?(a=L[0]%360*un,l=L[1]%360*un,c=L.length>2?L[2]%360*un:0,Q()):[a*Ur,l*Ur,c*Ur]},F.angle=function(L){return arguments.length?(d=L%360*un,Q()):d*Ur},F.reflectX=function(L){return arguments.length?(p=L?-1:1,Q()):p<0},F.reflectY=function(L){return arguments.length?(h=L?-1:1,Q()):h<0},F.precision=function(L){return arguments.length?(R=YO(T,C=L*L),H()):Xr(C)},F.fitExtent=function(L,G){return dE(F,L,G)},F.fitSize=function(L,G){return YF(F,L,G)},F.fitWidth=function(L,G){return KF(F,L,G)},F.fitHeight=function(L,G){return XF(F,L,G)};function Q(){var L=KO(n,0,0,p,h,d).apply(null,t(o,s)),G=KO(n,r-L[0],i-L[1],p,h,d);return u=AF(a,l,c),T=pS(t,G),M=pS(u,T),R=YO(T,C),H()}function H(){return N=j=null,F}return function(){return t=e.apply(this,arguments),F.invert=t.invert&&$,Q()}}function fE(e){var t=0,n=Et/3,r=QF(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*un,n=o[1]*un):[t*Ur,n*Ur]},i}function Bse(e){var t=ut(e);function n(r,i){return[r*t,ot(i)/t]}return n.invert=function(r,i){return[r/t,fo(i*t)]},n}function Hse(e,t){var n=ot(e),r=(n+ot(t))/2;if(Vt(r)<Ze)return Bse(e);var i=1+n*(2*r-n),o=Xr(i)/r;function s(a,l){var c=Xr(i-2*r*ot(l))/r;return[c*ot(a*=r),o-c*ut(a)]}return s.invert=function(a,l){var c=o-l,u=cs(a,Vt(c))*lo(c);return c*r<0&&(u-=Et*lo(a)*lo(c)),[u/r,fo((i-(a*a+c*c)*r*r)/(2*r))]},s}function Hb(){return fE(Hse).scale(155.424).center([0,33.6442])}function ZF(){return Hb().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Vse(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i<t;)e[i].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 Wse(){var e,t,n=ZF(),r,i=Hb().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=Hb().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,l,c={point:function(p,h){l=[p,h]}};function u(p){var h=p[0],m=p[1];return l=null,r.point(h,m),l||(o.point(h,m),l)||(a.point(h,m),l)}u.invert=function(p){var h=n.scale(),m=n.translate(),b=(p[0]-m[0])/h,y=(p[1]-m[1])/h;return(y>=.12&&y<.234&&b>=-.425&&b<-.214?i:y>=.166&&y<.234&&b>=-.214&&b<-.115?s:n).invert(p)},u.stream=function(p){return e&&t===p?e:e=Vse([n.stream(t=p),i.stream(p),s.stream(p)])},u.precision=function(p){return arguments.length?(n.precision(p),i.precision(p),s.precision(p),d()):n.precision()},u.scale=function(p){return arguments.length?(n.scale(p),i.scale(p*.35),s.scale(p),u.translate(n.translate())):n.scale()},u.translate=function(p){if(!arguments.length)return n.translate();var h=n.scale(),m=+p[0],b=+p[1];return r=n.translate(p).clipExtent([[m-.455*h,b-.238*h],[m+.455*h,b+.238*h]]).stream(c),o=i.translate([m-.307*h,b+.201*h]).clipExtent([[m-.425*h+Ze,b+.12*h+Ze],[m-.214*h-Ze,b+.234*h-Ze]]).stream(c),a=s.translate([m-.205*h,b+.212*h]).clipExtent([[m-.214*h+Ze,b+.166*h+Ze],[m-.115*h-Ze,b+.234*h-Ze]]).stream(c),d()},u.fitExtent=function(p,h){return dE(u,p,h)},u.fitSize=function(p,h){return YF(u,p,h)},u.fitWidth=function(p,h){return KF(u,p,h)},u.fitHeight=function(p,h){return XF(u,p,h)};function d(){return e=t=null,u}return u.scale(1070)}function JF(e){return function(t,n){var r=ut(t),i=ut(n),o=e(r*i);return o===1/0?[2,0]:[o*i*ot(t),o*ot(n)]}}function xp(e){return function(t,n){var r=Xr(t*t+n*n),i=e(r),o=ot(i),s=ut(i);return[cs(t*o,r*s),fo(r&&n*o/r)]}}var e4=JF(function(e){return Xr(2/(1+e))});e4.invert=xp(function(e){return 2*fo(e/2)});function Use(){return ia(e4).scale(124.75).clipAngle(180-.001)}var t4=JF(function(e){return(e=kF(e))&&e/ot(e)});t4.invert=xp(function(e){return e});function Gse(){return ia(t4).scale(79.4188).clipAngle(180-.001)}function Zy(e,t){return[e,Mb(lE((Nn+t)/2))]}Zy.invert=function(e,t){return[e,2*Id(TF(t))-Nn]};function qse(){return n4(Zy).scale(961/Bi)}function n4(e){var t=ia(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,s=null,a,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?s=a=l=c=null:(s=+d[0][0],a=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var d=Et*r(),p=t(ose(t.rotate()).invert([0,0]));return o(s==null?[[p[0]-d,p[1]-d],[p[0]+d,p[1]+d]]:e===Zy?[[Math.max(p[0]-d,s),a],[Math.min(p[0]+d,l),c]]:[[s,Math.max(p[1]-d,a)],[l,Math.min(p[1]+d,c)]])}return u()}function hm(e){return lE((Nn+e)/2)}function Yse(e,t){var n=ut(e),r=e===t?ot(e):Mb(n/ut(t))/Mb(hm(t)/hm(e)),i=n*qx(hm(e),r)/r;if(!r)return Zy;function o(s,a){i>0?a<-Nn+Ze&&(a=-Nn+Ze):a>Nn-Ze&&(a=Nn-Ze);var l=i/qx(hm(a),r);return[l*ot(r*s),i-l*ut(r*s)]}return o.invert=function(s,a){var l=i-a,c=lo(r)*Xr(s*s+l*l),u=cs(s,Vt(l))*lo(l);return l*r<0&&(u-=Et*lo(s)*lo(l)),[u/r,2*Id(qx(i/c,1/r))-Nn]},o}function Kse(){return fE(Yse).scale(109.5).parallels([30,30])}function Vb(e,t){return[e,t]}Vb.invert=Vb;function Xse(){return ia(Vb).scale(152.63)}function Qse(e,t){var n=ut(e),r=e===t?ot(e):(n-ut(t))/(t-e),i=n/r+e;if(Vt(r)<Ze)return Vb;function o(s,a){var l=i-a,c=r*s;return[l*ot(c),i-l*ut(c)]}return o.invert=function(s,a){var l=i-a,c=cs(s,Vt(l))*lo(l);return l*r<0&&(c-=Et*lo(s)*lo(l)),[c/r,i-lo(r)*Xr(s*s+l*l)]},o}function Zse(){return fE(Qse).scale(131.154).center([0,13.9389])}var lh=1.340264,ch=-.081106,uh=893e-6,dh=.003796,Wb=Xr(3)/2,Jse=12;function r4(e,t){var n=fo(Wb*ot(t)),r=n*n,i=r*r*r;return[e*ut(n)/(Wb*(lh+3*ch*r+i*(7*uh+9*dh*r))),n*(lh+ch*r+i*(uh+dh*r))]}r4.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,s,a,l;o<Jse&&(a=n*(lh+ch*r+i*(uh+dh*r))-t,l=lh+3*ch*r+i*(7*uh+9*dh*r),n-=s=a/l,r=n*n,i=r*r*r,!(Vt(s)<PF));++o);return[Wb*e*(lh+3*ch*r+i*(7*uh+9*dh*r))/ut(n),fo(ot(n)/Wb)]};function eae(){return ia(r4).scale(177.158)}function i4(e,t){var n=ut(t),r=ut(e)*n;return[n*ot(e)/r,ot(t)/r]}i4.invert=xp(Id);function tae(){return ia(i4).scale(144.049).clipAngle(60)}function o4(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)))]}o4.invert=function(e,t){var n=t,r=25,i;do{var o=n*n,s=o*o;n-=i=(n*(1.007226+o*(.015085+s*(-.044475+.028874*o-.005916*s)))-t)/(1.007226+o*(.015085*3+s*(-.044475*7+.028874*9*o-.005916*11*s)))}while(Vt(i)>Ze&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function nae(){return ia(o4).scale(175.295)}function s4(e,t){return[ut(t)*ot(e),ot(t)]}s4.invert=xp(fo);function rae(){return ia(s4).scale(249.5).clipAngle(90+Ze)}function a4(e,t){var n=ut(t),r=1+ut(e)*n;return[n*ot(e)/r,ot(t)/r]}a4.invert=xp(function(e){return 2*Id(e)});function iae(){return ia(a4).scale(250).clipAngle(142)}function l4(e,t){return[Mb(lE((Nn+t)/2)),-e]}l4.invert=function(e,t){return[-t,2*Id(TF(e))-Nn]};function oae(){var e=n4(l4),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 Jy(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Dd(){}var Cc=.7,vd=1/Cc,Nu="\\s*([+-]?\\d+)\\s*",Lh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",is="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sae=/^#([0-9a-f]{3,8})$/,aae=new RegExp(`^rgb\\(${Nu},${Nu},${Nu}\\)$`),lae=new RegExp(`^rgb\\(${is},${is},${is}\\)$`),cae=new RegExp(`^rgba\\(${Nu},${Nu},${Nu},${Lh}\\)$`),uae=new RegExp(`^rgba\\(${is},${is},${is},${Lh}\\)$`),dae=new RegExp(`^hsl\\(${Lh},${is},${is}\\)$`),fae=new RegExp(`^hsla\\(${Lh},${is},${is},${Lh}\\)$`),XO={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};Jy(Dd,pE,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:QO,formatHex:QO,formatHex8:hae,formatHsl:pae,formatRgb:ZO,toString:ZO});function QO(){return this.rgb().formatHex()}function hae(){return this.rgb().formatHex8()}function pae(){return u4(this).formatHsl()}function ZO(){return this.rgb().formatRgb()}function pE(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sae.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?JO(t):n===3?new Mr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?pm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?pm(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=aae.exec(e))?new Mr(t[1],t[2],t[3],1):(t=lae.exec(e))?new Mr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cae.exec(e))?pm(t[1],t[2],t[3],t[4]):(t=uae.exec(e))?pm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dae.exec(e))?nM(t[1],t[2]/100,t[3]/100,1):(t=fae.exec(e))?nM(t[1],t[2]/100,t[3]/100,t[4]):XO.hasOwnProperty(e)?JO(XO[e]):e==="transparent"?new Mr(NaN,NaN,NaN,0):null}function JO(e){return new Mr(e>>16&255,e>>8&255,e&255,1)}function pm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Mr(e,t,n,r)}function c4(e){return e instanceof Dd||(e=pE(e)),e?(e=e.rgb(),new Mr(e.r,e.g,e.b,e.opacity)):new Mr}function Fh(e,t,n,r){return arguments.length===1?c4(e):new Mr(e,t,n,r??1)}function Mr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Jy(Mr,Fh,hE(Dd,{brighter(e){return e=e==null?vd:Math.pow(vd,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cc:Math.pow(Cc,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mr(cc(this.r),cc(this.g),cc(this.b),Ub(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:eM,formatHex:eM,formatHex8:gae,formatRgb:tM,toString:tM}));function eM(){return`#${Vl(this.r)}${Vl(this.g)}${Vl(this.b)}`}function gae(){return`#${Vl(this.r)}${Vl(this.g)}${Vl(this.b)}${Vl((isNaN(this.opacity)?1:this.opacity)*255)}`}function tM(){const e=Ub(this.opacity);return`${e===1?"rgb(":"rgba("}${cc(this.r)}, ${cc(this.g)}, ${cc(this.b)}${e===1?")":`, ${e})`}`}function Ub(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Vl(e){return e=cc(e),(e<16?"0":"")+e.toString(16)}function nM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Po(e,t,n,r)}function u4(e){if(e instanceof Po)return new Po(e.h,e.s,e.l,e.opacity);if(e instanceof Dd||(e=pE(e)),!e)return new Po;if(e instanceof Po)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new Po(s,a,l,e.opacity)}function mae(e,t,n,r){return arguments.length===1?u4(e):new Po(e,t,n,r??1)}function Po(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Jy(Po,mae,hE(Dd,{brighter(e){return e=e==null?vd:Math.pow(vd,e),new Po(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cc:Math.pow(Cc,e),new Po(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,i=2*n-r;return new Mr(Zx(e>=240?e-240:e+120,i,r),Zx(e,i,r),Zx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Po(rM(this.h),gm(this.s),gm(this.l),Ub(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=Ub(this.opacity);return`${e===1?"hsl(":"hsla("}${rM(this.h)}, ${gm(this.s)*100}%, ${gm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rM(e){return e=(e||0)%360,e<0?e+360:e}function gm(e){return Math.max(0,Math.min(1,e||0))}function Zx(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 bae=Math.PI/180,yae=180/Math.PI;var d4=-.14861,gE=1.78277,mE=-.29227,e0=-.90649,jh=1.97294,iM=jh*e0,oM=jh*gE,sM=gE*mE-e0*d4;function vae(e){if(e instanceof uc)return new uc(e.h,e.s,e.l,e.opacity);e instanceof Mr||(e=c4(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(sM*r+iM*t-oM*n)/(sM+iM-oM),o=r-i,s=(jh*(n-i)-mE*o)/e0,a=Math.sqrt(s*s+o*o)/(jh*i*(1-i)),l=a?Math.atan2(s,o)*yae-120:NaN;return new uc(l<0?l+360:l,a,i,e.opacity)}function us(e,t,n,r){return arguments.length===1?vae(e):new uc(e,t,n,r??1)}function uc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Jy(uc,us,hE(Dd,{brighter(e){return e=e==null?vd:Math.pow(vd,e),new uc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cc:Math.pow(Cc,e),new uc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*bae,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Mr(255*(t+n*(d4*r+gE*i)),255*(t+n*(mE*r+e0*i)),255*(t+n*(jh*r)),this.opacity)}}));function xae(e,t,n,r,i){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*n+(1+3*e+3*o-3*s)*r+s*i)/6}function wae(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),i=e[r],o=e[r+1],s=r>0?e[r-1]:2*i-o,a=r<t-1?e[r+2]:2*o-i;return xae((n-r/t)*t,s,i,o,a)}}const bE=e=>()=>e;function f4(e,t){return function(n){return e+n*t}}function Sae(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 _ae(e,t){var n=t-e;return n?f4(e,n>180||n<-180?n-360*Math.round(n/360):n):bE(isNaN(e)?t:e)}function Cae(e){return(e=+e)==1?Lu:function(t,n){return n-t?Sae(t,n,e):bE(isNaN(t)?n:t)}}function Lu(e,t){var n=t-e;return n?f4(e,n):bE(isNaN(e)?t:e)}(function e(t){var n=Cae(t);function r(i,o){var s=n((i=Fh(i)).r,(o=Fh(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=Lu(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r})(1);function Eae(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;s<n;++s)a=Fh(t[s]),r[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return r=e(r),i=e(i),o=e(o),a.opacity=1,function(l){return a.r=r(l),a.g=i(l),a.b=o(l),a+""}}}var Rae=Eae(wae);function h4(e){return function t(n){n=+n;function r(i,o){var s=e((i=us(i)).h,(o=us(o)).h),a=Lu(i.s,o.s),l=Lu(i.l,o.l),c=Lu(i.opacity,o.opacity);return function(u){return i.h=s(u),i.s=a(u),i.l=l(Math.pow(u,n)),i.opacity=c(u),i+""}}return r.gamma=t,r}(1)}h4(_ae);var yE=h4(Lu);const fn=e=>Rae(e[e.length-1]);var Pae=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Xt);const Tae=fn(Pae);var kae=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Xt);const Aae=fn(kae);var Oae=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Xt);const Mae=fn(Oae);var Iae=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Xt);const Dae=fn(Iae);var Nae=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Xt);const Lae=fn(Nae);var Fae=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Xt);const jae=fn(Fae);var $ae=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Xt);const zae=fn($ae);var Bae=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Xt);const Hae=fn(Bae);var Vae=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Xt);const Wae=fn(Vae);var Uae=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Xt);const Gae=fn(Uae);var qae=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Xt);const Yae=fn(qae);var Kae=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Xt);const Xae=fn(Kae);var Qae=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Xt);const Zae=fn(Qae);var Jae=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Xt);const ele=fn(Jae);var tle=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Xt);const nle=fn(tle);var rle=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Xt);const ile=fn(rle);var ole=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Xt);const sle=fn(ole);var ale=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Xt);const lle=fn(ale);var cle=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Xt);const ule=fn(cle);var dle=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Xt);const fle=fn(dle);var hle=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Xt);const ple=fn(hle);var gle=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Xt);const mle=fn(gle);var ble=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Xt);const yle=fn(ble);var vle=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Xt);const xle=fn(vle);var wle=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Xt);const Sle=fn(wle);var _le=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Xt);const Cle=fn(_le);var Ele=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Xt);const Rle=fn(Ele);function Ple(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 Tle=yE(us(300,.5,0),us(-240,.5,1));var kle=yE(us(-100,.75,.35),us(80,1.5,.8)),Ale=yE(us(260,.75,.35),us(80,1.5,.8)),mm=us();function Ole(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return mm.h=360*e-100,mm.s=1.5-1.5*t,mm.l=.8-.9*t,mm+""}var bm=Fh(),Mle=Math.PI/3,Ile=Math.PI*2/3;function Dle(e){var t;return e=(.5-e)*Math.PI,bm.r=255*(t=Math.sin(e))*t,bm.g=255*(t=Math.sin(e+Mle))*t,bm.b=255*(t=Math.sin(e+Ile))*t,bm+""}function Nle(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 t0(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const Lle=t0(Xt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Fle=t0(Xt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),jle=t0(Xt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),$le=t0(Xt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function zle(e){return e}function Ble(e){if(e==null)return zle;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var c=2,u=a.length,d=new Array(u);for(d[0]=(t+=a[0])*r+o,d[1]=(n+=a[1])*i+s;c<u;)d[c]=a[c],++c;return d}}function Hle(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function Vle(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return aM(e,n)})}:aM(e,t)}function aM(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,o=Wle(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:o}:r==null?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function Wle(e,t){var n=Ble(e.transform),r=e.arcs;function i(u,d){d.length&&d.pop();for(var p=r[u<0?~u:u],h=0,m=p.length;h<m;++h)d.push(n(p[h],h));u<0&&Hle(d,m)}function o(u){return n(u)}function s(u){for(var d=[],p=0,h=u.length;p<h;++p)i(u[p],d);return d.length<2&&d.push(d[0]),d}function a(u){for(var d=s(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(a)}function c(u){var d=u.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":p=o(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(o);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=l(u.arcs);break;case"MultiPolygon":p=u.arcs.map(l);break;default:return null}return{type:d,coordinates:p}}return c(t)}const fh={geoAzimuthalEqualArea:Use,geoAzimuthalEquidistant:Gse,geoGnomonic:tae,geoOrthographic:rae,geoStereographic:iae,geoEqualEarth:eae,geoAlbers:ZF,geoAlbersUsa:Wse,geoConicConformal:Kse,geoConicEqualArea:Hb,geoConicEquidistant:Zse,geoEquirectangular:Xse,geoMercator:qse,geoTransverseMercator:oae,geoNaturalEarth1:nae};Object.keys(fh).forEach(e=>{fh[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=fh[e]});class $c extends ol{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=GO()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(fh[t.projection]||fh.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=GO(this.projection.fitWidth(1e3,t)).bounds(t),r=Math.ceil(n[1][1]-n[0][1]),i=Math.ceil(n[1][0]-n[0][0]),o=this.projection.translate();this.outlineBounds={width:i,height:r,aspectRatio:i/r,refScale:this.projection.scale(),refX:o[0],refY:o[1]}}updateBounds(){const t=this.chart.chartArea,n=this.outlineBounds;if(!n)return!1;const r=this.options.padding,i=typeof r=="number"?r:r.top,o=typeof r=="number"?r:r.left,s=typeof r=="number"?r:r.bottom,a=typeof r=="number"?r:r.right,l=t.right-t.left-o-a,c=t.bottom-t.top-i-s,u=this.oldChartBounds;this.oldChartBounds={chartWidth:l,chartHeight:c};const d=Math.min(l/n.width,c/n.height),p=n.width*d,h=n.height*d,m=(l-p)*.5+t.left+o,b=(c-h)*.5+t.top+i,y=this.options;return this.projection.scale(n.refScale*d*y.projectionScale).translate([d*n.refX+m+y.projectionOffset[0],d*n.refY+b+y.projectionOffset[1]]),!u||u.chartWidth!==this.oldChartBounds.chartWidth||u.chartHeight!==this.oldChartBounds.chartHeight}}$c.id="projection";$c.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};$c.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const n0={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 Ule(e){const{indicatorWidth:t,align:n,margin:r}=e,i=(typeof r=="number"?r:r.left)+(n==="right"?t:0),o=(typeof r=="number"?r:r.top)+(n==="bottom"?t:0),s=(typeof r=="number"?r:r.right)+(n==="left"?t:0),a=(typeof r=="number"?r:r.bottom)+(n==="top"?t:0);return{left:i,top:o,right:s,bottom:a}}function Gle(e,t,n,r,i){const{indicatorWidth:o,align:s,position:a}=t,l=s==="top"||s==="bottom",c=(s==="left"?i.w:n)+(l?o:0),u=(s==="top"?i.h:r)+(l?0:o),d=Ule(t);if(typeof a=="string")switch(a){case"top-left":return[d.left,d.top];case"top":return[(e.right-c)/2,d.top];case"left":return[d.left,(e.bottom-u)/2];case"top-right":return[e.right-c-d.right,d.top];case"bottom-right":return[e.right-c-d.right,e.bottom-u-d.bottom];case"bottom":return[(e.right-c)/2,e.bottom-u-d.bottom];case"bottom-left":return[d.left,e.bottom-u-d.bottom];default:return[e.right-c-d.right,(e.bottom-u)/2]}return[a.x,a.y]}class Ru extends pd{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 i=Math.min(n,this.bottom==null?Number.POSITIVE_INFINITY:this.bottom),o=Math.min(t,this.right==null?Number.POSITIVE_INFINITY:this.right),s=this.options.legend,a=this.isHorizontal(),l=(h,m)=>h<1?m*h:h,c=Math.min(o,l(a?s.length:s.width,o))-(a?0:s.indicatorWidth),u=Math.min(i,l(a?s.width:s.length,i))-(a?s.indicatorWidth:0);this.legendSize={w:c,h:u},this.bottom=u,this.height=u,this.right=c,this.width=c;const d=this.options.position;this.options.position=this.options.legend.align;const p=super.update(c,u,r);return this.options.position=d,this.height=Math.min(u,this.height),this.width=Math.min(c,this.width),p}_computeLabelArea(){}draw(t){if(!this._isVisible())return;const n=Gle(t,this.options.legend,this.width,this.height,this.legendSize),{ctx:r}=this;r.save(),r.translate(n[0],n[1]);const i=this.options.position;this.options.position=this.options.legend.align,super.draw({...t,bottom:this.height+10,right:this.width}),this.options.position=i;const{indicatorWidth:o}=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,-o);break;default:r.translate(-o,0);break}this._drawIndicator(),r.restore()}_drawIndicator(){}}class p4 extends gd{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){Ru.prototype.init.call(this,t)}parse(t,n){return Ru.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 Ru.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return Ru.prototype.draw.call(this,t)}_drawIndicator(){}}const Gs={interpolateBlues:mle,interpolateBrBG:Tae,interpolateBuGn:Gae,interpolateBuPu:Yae,interpolateCividis:Ple,interpolateCool:Ale,interpolateCubehelixDefault:Tle,interpolateGnBu:Xae,interpolateGreens:yle,interpolateGreys:xle,interpolateInferno:jle,interpolateMagma:Fle,interpolateOrRd:Zae,interpolateOranges:Rle,interpolatePRGn:Aae,interpolatePiYG:Mae,interpolatePlasma:$le,interpolatePuBu:nle,interpolatePuBuGn:ele,interpolatePuOr:Dae,interpolatePuRd:ile,interpolatePurples:Sle,interpolateRainbow:Ole,interpolateRdBu:Lae,interpolateRdGy:jae,interpolateRdPu:sle,interpolateRdYlBu:zae,interpolateRdYlGn:Hae,interpolateReds:Cle,interpolateSinebow:Dle,interpolateSpectral:Wae,interpolateTurbo:Nle,interpolateViridis:Lle,interpolateWarm:kle,interpolateYlGn:ule,interpolateYlGnBu:lle,interpolateYlOrBr:fle,interpolateYlOrRd:ple};Object.keys(Gs).forEach(e=>{Gs[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=Gs[e],Gs[e.slice(11)]=Gs[e]});function g4(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 m4={interpolate:"blues",missing:"transparent",quantize:0};class Xa extends Ru{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:Gs[t.interpolate]||Gs.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=g4(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 i=r/this.options.quantize,o=n?s=>r-i-s:s=>s;for(let s=0;s<r;s+=i){const a=(s+i/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(o(s),0,i,t)}}else{const i=n?o=>r-1-o:o=>o;for(let o=0;o<r;o+=1)this.ctx.fillStyle=this.getColor((o+.5)/r),this.ctx.fillRect(i(o),0,1,t)}}else{const r=this.height;if(this.options.quantize>0){const i=r/this.options.quantize,o=n?s=>r-i-s:s=>s;for(let s=0;s<r;s+=i){const a=(s+i/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(0,o(s),t,i)}}else{const i=n?o=>r-1-o:o=>o;for(let o=0;o<r;o+=1)this.ctx.fillStyle=this.getColor((o+.5)/r),this.ctx.fillRect(0,i(o),t,1)}}}}Xa.id="color";Xa.defaults=dr({},[pd.defaults,n0,m4]);Xa.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class vE extends p4{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=Gs[t.interpolate]||Gs.blues}getColorForValue(t){return Xa.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=g4(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return Xa.prototype._drawIndicator.call(this)}}vE.id="colorLogarithmic";vE.defaults=dr({},[gd.defaults,n0,m4]);vE.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const b4={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class Qa extends Ru{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 o=r*r*Math.PI,s=n*n*Math.PI,a=o-s,l=t*a+s;return Math.sqrt(l/Math.PI)}const i=r-n;return t*i+n}_drawIndicator(){const{ctx:t}=this,n=this.options.legend.indicatorWidth/2,r=this.isHorizontal(),i=this.ticks,o=this.getLabelItems(),s=o?o.map(a=>({[r?"x":"y"]:a.options.translation[r?0:1]})):i.map((a,l)=>({[r?"x":"y"]:this.getPixelForTick(l)}));if((this._gridLineItems||[]).forEach(a=>{if(t.save(),t.strokeStyle=a.color,t.lineWidth=a.width,t.setLineDash&&(t.setLineDash(a.borderDash),t.lineDashOffset=a.borderDashOffset),t.beginPath(),this.options.grid.drawTicks)switch(this.options.legend.align){case"left":t.moveTo(0,a.ty1),t.lineTo(n,a.ty2);break;case"top":t.moveTo(a.tx1,0),t.lineTo(a.tx2,n);break;case"bottom":t.moveTo(a.tx1,n),t.lineTo(a.tx2,n*2);break;default:t.moveTo(n,a.ty1),t.lineTo(n*2,a.ty2);break}t.stroke(),t.restore()}),this._model){const a=this._model;t.strokeStyle=a.borderColor,t.lineWidth=a.borderWidth||0,t.fillStyle=a.backgroundColor}else t.fillStyle="blue";i.forEach((a,l)=>{const c=s[l],u=this.getSizeForValue(a.value),d=r?c.x:n,p=r?n:c.y,h={pointStyle:"circle",borderWidth:0,...this._model||{},radius:u};Rb(t,h,d,p)})}}Qa.id="size";Qa.defaults=dr({},[pd.defaults,n0,b4]);Qa.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class y4 extends p4{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){return Qa.prototype.getSizeImpl.call(this,t)}_drawIndicator(){Qa.prototype._drawIndicator.call(this)}}y4.id="sizeLogarithmic";y4.defaults=dr({},[gd.defaults,n0,b4]);function qle(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class ta extends vs{constructor(){super(...arguments),this.cache=void 0}inRange(t,n){const r=this.getBounds(),i=(Number.isNaN(t)||t>=r.x&&t<=r.x2)&&(Number.isNaN(n)||n>=r.y&&n<=r.y2),o=this.projectionScale.geoPath.projection();if(i&&!Number.isNaN(t)&&!Number.isNaN(n)&&typeof o.invert=="function"){const s=o.invert([t,n]);return s!=null&&Sse(this.feature,s)}return i}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=qle(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"),i=Math.floor(n.x),o=Math.floor(n.y),s=Math.ceil(n.x+n.width),a=Math.ceil(n.y+n.height),l=this.pixelRatio||1,c=Math.ceil(Math.max(s-i,1)*l),u=Math.ceil(Math.max(a-o,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(-i,-o),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 i=Math.floor(r.x),o=Math.floor(r.y),s=Math.ceil(r.x+r.width),a=Math.ceil(r.y+r.height),l=s-i,c=a-o;l>0&&c>0&&t.drawImage(this.cache.canvas,i,o,s-i,a-o)}else Number.isFinite(r.x)&&(t.save(),this._drawImpl(t),t.restore())}}ta.id="geoFeature";ta.defaults={...lc.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};ta.defaultRoutes={outlineBorderColor:"borderColor",...lc.defaultRoutes||{}};const v4={showOutline:!1,showGraticule:!1,clipMap:!0},x4={scales:{projection:{axis:"x",type:$c.id,position:"chartArea",display:!1}}};function lM(e){const t={...e};return Object.keys(e).forEach(n=>{let r=n;if(n.startsWith("outline")){const i=n.slice(7);r=i[0].toLowerCase()+i.slice(1)}else if(n.startsWith("hoverOutline"))r=`hover${n.slice(12)}`;else return;delete t[n],t[r]=e[n]}),t}class w4 extends co{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 rt(this.getGeoDataset().showOutline,this.getGeoOptions().showOutline)}clipMap(){return rt(this.getGeoDataset().clipMap,this.getGeoOptions().clipMap)}getGraticule(){return rt(this.getGeoDataset().showGraticule,this.getGeoOptions().showGraticule)}update(t){super.update(t);const n=this.getMeta(),r=this.getProjectionScale(),i=r.updateBounds();if(this.showOutline()){const o=n.dataset;if(i&&delete o.cache,o.projectionScale=r,o.pixelRatio=this.chart.currentDevicePixelRatio,t!=="resize"){const s=lM(this.resolveDatasetElementOptions(t)),a={feature:this.resolveOutline(),options:s};this.updateElement(o,void 0,a,t),this.getGraticule()&&(n.graticule=s)}}else this.getGraticule()&&t!=="resize"&&(n.graticule=lM(this.resolveDatasetElementOptions(t)));this.updateElements(n.data,0,n.data.length,t),i&&n.data.forEach(o=>delete o.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,o=this.getProjectionScale().geoPath.context(r);if(r.save(),r.beginPath(),typeof t=="boolean")t&&o(_se());else{const s=LF();t.stepMajor&&s.stepMajor(t.stepMajor),t.stepMinor&&s.stepMinor(t.stepMinor),o(s())}r.strokeStyle=n.graticuleBorderColor,r.lineWidth=n.graticuleBorderWidth,r.stroke(),r.restore()}draw(){const{chart:t}=this,n=this.clipMap();let r=!1;(n===!0||n==="outline"||n==="outline+graticule")&&(r=!0,rc(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||rc(t.ctx,t.chartArea):r&&(r=!1,ic(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||rc(t.ctx,t.chartArea):r&&(r=!1,ic(t.ctx)),this.getMeta().data.forEach(i=>i.draw.call(i,t.ctx,t.chartArea)),r&&(r=!1,ic(t.ctx))}}function S4(e,t,n,r=[],i=[]){qr.addControllers(n),Array.isArray(r)?qr.addElements(...r):qr.addElements(r),Array.isArray(i)?qr.addScales(...i):qr.addScales(i);const o=t;return o.type=e,o}class Nd extends w4{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:i}=this.getDataset(),o=this._cachedMeta;for(let s=t;s<t+n;s+=1)o._parsed[s]={[r.axis]:r.parse(i[s],s)}}updateElements(t,n,r,i){const o=this.resolveDataElementOptions(n,i),s=this.getSharedOptions(o),a=this.includeOptions(i,s),l=this.getProjectionScale();this.updateSharedOptions(s,i,o);for(let c=n;c<n+r;c+=1){const u=t[c];u.projectionScale=l,u.feature=this._data[c].feature,u.center=this._data[c].center,u.pixelRatio=this.chart.currentDevicePixelRatio;const d=u.getCenterPoint(),p={x:d.x,y:d.y};a&&(p.options=s||this.resolveDataElementOptions(c,i)),this.updateElement(u,c,p,i)}}indexToColor(t){const n=this.getMeta().rScale;return n.getColorForValue(this.getParsed(t)[n.axis])}}Nd.id="choropleth";Nd.defaults=dr({},[v4,{datasetElementType:ta.id,dataElementType:ta.id}]);Nd.overrides=dr({},[x4,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,i;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]:`${(i=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||i===void 0?void 0:i[e.dataIndex]}: ${e.formattedValue}`}}},colors:{enabled:!1}},scales:{color:{type:Xa.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class Yle extends An{constructor(t,n){super(t,S4("choropleth",n,Nd,ta,[Xa,$c]))}}Yle.id=Nd.id;class Ld extends w4{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,i=this.getDataset().data,o=this._cachedMeta;for(let s=t;s<t+n;s+=1){const a=i[s];o._parsed[s]={x:a.longitude==null?a.x:a.longitude,y:a.latitude==null?a.y:a.latitude,[r.axis]:r.parse(a,s)}}}updateElements(t,n,r,i){const o=i==="reset",s=this.resolveDataElementOptions(n,i),a=this.getSharedOptions(s),l=this.includeOptions(i,a),c=this.getProjectionScale();this.getMeta().rScale._model=s,this.updateSharedOptions(a,i,s);for(let u=n;u<n+r;u+=1){const d=t[u],p=this.getParsed(u),h=c.projection([p.x,p.y]),m={x:h?h[0]:0,y:h?h[1]:0,skip:Number.isNaN(p.x)||Number.isNaN(p.y)};l&&(m.options=a||this.resolveDataElementOptions(u,i),o&&(m.options.radius=0)),this.updateElement(d,u,m,i)}}indexToRadius(t){const n=this.getMeta().rScale;return n.getSizeForValue(this.getParsed(t)[n.axis])}}Ld.id="bubbleMap";Ld.defaults=dr({},[v4,{dataElementType:ac.id,datasetElementType:ta.id,showOutline:!0,clipMap:"outline+graticule"}]);Ld.overrides=dr({},[x4,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,i;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]:`${(i=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||i===void 0?void 0:i[e.dataIndex]}: ${e.formattedValue}`}}}},scales:{size:{axis:"x",type:Qa.id}},elements:{point:{radius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)},hoverRadius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)+1}}}}]);class Kle extends An{constructor(t,n){super(t,S4("bubbleMap",n,Ld,ta,[Qa,$c]))}}Kle.id=Ld.id;function Xle(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 Qle(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 Zle(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 Jle(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 ece(e,t){var r,i,o,s,a;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(i=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:i.x,display:!0,stacked:!0},y:{...(s=(o=e==null?void 0:e.options)==null?void 0:o.scales)==null?void 0:s.y,display:!0,stacked:t==="stackedBar"}},plugins:{...(a=e==null?void 0:e.options)==null?void 0:a.plugins,legend:{position:"bottom",align:"center"}}}}}function tce(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 nce(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 rce(e){var r,i;const t=ye.getState().theme;let n={...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1},r:{grid:{display:!0},angleLines:{},ticks:{}}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}};return t==="dark"&&(n={...n,options:{...n.options,scales:{...(i=n==null?void 0:n.options)==null?void 0:i.scales,r:{grid:{color:$t.slate[800]},angleLines:{color:$t.slate[800]},ticks:{color:$t.slate[800],showLabelBackdrop:!1}}}}}),n}function xE({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:i="chartjs",userSettings:o,preferences:s,topoJson:a}){var l,c,u,d,p,h,m,b,y,x;if(t==="map"){if(!a)return null;const w=(l=s==null?void 0:s.mapVisualOptions)==null?void 0:l.objectKey;if(!w)return null;const _=Vle(a,(c=a==null?void 0:a.objects)==null?void 0:c[w]).features;if(!_)return null;const E={plugins:{datalabels:{display:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1}},projection:{axis:"x",projection:((u=s==null?void 0:s.mapVisualOptions)==null?void 0:u.projection)||"mercator",projectionScale:((d=s==null?void 0:s.mapVisualOptions)==null?void 0:d.projectionScale)||1,projectionOffset:((p=s==null?void 0:s.mapVisualOptions)==null?void 0:p.projectionOffset)||[0,0]},color:{axis:"x",interpolate:((h=s==null?void 0:s.mapVisualOptions)==null?void 0:h.colorScale)||"blues",quantize:5,legend:{position:"bottom-right",align:"right"}}}},{keys:C}=lr(e),R=_.map($=>{var G;const Q=C==null?void 0:C[0],H=C==null?void 0:C[1],L=(G=e.find(V=>(V==null?void 0:V[Q])===$.properties.NAME||(V==null?void 0:V[Q])===$.properties.name))==null?void 0:G[H];return{feature:$,value:L}}),M=Hf([{label:w,data:R,borderColor:"lightgray"}],r),N={type:"choropleth",data:{labels:_.map($=>$.properties.NAME||$.properties.name),datasets:M},options:E},{options:j}=PL({cfg:N,preferences:s,customCfg:r});return{...N,options:j}}if(t==="bar"){const w=Zle(n);return _l({data:e,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="horizontalBar"){const w=Xle(n);return _l({data:e,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="pyramid"){const w=Qle(n),{dimensionKeys:_,metricKeys:E}=lr(e),C=wb({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:E[0]}),R=_l({data:C,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s}),T="x2";return{...R,data:{...R.data,datasets:R.data.datasets.map((N,j)=>j===1?{...N,xAxisID:T}:N)},options:{...R.options,scales:{...(m=R==null?void 0:R.options)==null?void 0:m.scales,[T]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const w=ece(n,t),{dimensionKeys:_,metricKeys:E}=lr(e),C=wb({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:E[0],sortChart:s==null?void 0:s.sortChart});return _l({data:C,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="line"){const w=tce(n);return _l({data:e,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="range"){const w=Jle(n),_=Oee(e),E=Hf(_,r),{plugins:C,options:R}=Z1((s==null?void 0:s.customVisualCode)||""),T=di(w==null?void 0:w.options,(n==null?void 0:n.options)||{}),M=di(T,(s==null?void 0:s.chartOptions)||{}),N=di(M,(r==null?void 0:r.options)||{}),j=di(N,R),F=RL(n,s),$=di(j,F),Q={...$,plugins:{...$==null?void 0:$.plugins,datalabels:{...(b=$==null?void 0:$.plugins)==null?void 0:b.datalabels,formatter:(B,X)=>B.map(q=>{var U,O,ee,K;return ao({number:Number(q),decimalPlaces:((U=s==null?void 0:s.numberAxisFormat)==null?void 0:U.decimalPlaces)||0,useSuffix:!!((O=s==null?void 0:s.numberAxisFormat)!=null&&O.suffix),customSuffix:"",locale:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.locale)||"",currency:((K=s==null?void 0:s.numberAxisFormat)==null?void 0:K.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:H}=lr(e),L=H[0];return{type:"bar",data:{labels:[...new Set(Q1(e,L))],datasets:E},options:Q,plugins:[...C]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const w=nce(t,n),{dimensionKeys:_,metricKeys:E}=lr(e),C=Mee(E,e),R=Hf(C,r),{plugins:T,options:M}=Z1((s==null?void 0:s.customVisualCode)||""),N=_[0],j=Q1(e,N),F=di(w==null?void 0:w.options,(r==null?void 0:r.options)||{}),$=di(F,(s==null?void 0:s.chartOptions)||{}),Q={...$,plugins:{...$.plugins,datalabels:{...(y=$.plugins)==null?void 0:y.datalabels,formatter:(B,X)=>{var I,q,U,O;return ao({number:Number(B),decimalPlaces:((I=s==null?void 0:s.numberAxisFormat)==null?void 0:I.decimalPlaces)||0,useSuffix:!!((q=s==null?void 0:s.numberAxisFormat)!=null&&q.suffix),customSuffix:"",locale:((U=s==null?void 0:s.numberAxisFormat)==null?void 0:U.locale)||"",currency:((O=s==null?void 0:s.numberAxisFormat)==null?void 0:O.currency)||""})}},tooltip:{...(x=$.plugins)==null?void 0:x.tooltip,callbacks:{label:function(B){var ee,K,oe,Y;B.dataset.label;const I=B.dataset.data.reduce((J,se)=>J+se,0),q=B.parsed,U=ao({number:Number(q),decimalPlaces:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.decimalPlaces)||0,useSuffix:!!((K=s==null?void 0:s.numberAxisFormat)!=null&&K.suffix),customSuffix:"",locale:((oe=s==null?void 0:s.numberAxisFormat)==null?void 0:oe.locale)||"",currency:((Y=s==null?void 0:s.numberAxisFormat)==null?void 0:Y.currency)||""}),O=(q/I*100).toFixed(2);return U+` (${O}%)`}}}}},H=di($,Q),L=di(H,M);return{type:t,data:{labels:j,datasets:R},options:L,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(B,X,I){var se,ae,ge,ne;const{ctx:q,data:U}=B;q.save();const O=B.getDatasetMeta(0).data[0].x,ee=B.getDatasetMeta(0).data[0].y,K=sd(Eh()),oe=window.getComputedStyle(q.canvas).fontFamily;q.font=`1em ${oe}`,q.fontWeight="bolder",q.fillStyle=K,q.textAlign="center",q.textBaseline="middle";const Y=U.datasets[0].data.reduce((fe,he)=>fe+he,0),J=ao({number:Number(Y),decimalPlaces:((se=s==null?void 0:s.numberAxisFormat)==null?void 0:se.decimalPlaces)||0,useSuffix:!!((ae=s==null?void 0:s.numberAxisFormat)!=null&&ae.suffix),customSuffix:"",locale:((ge=s==null?void 0:s.numberAxisFormat)==null?void 0:ge.locale)||"",currency:((ne=s==null?void 0:s.numberAxisFormat)==null?void 0:ne.currency)||""});q.fillText(J,O,ee)}}:"",...T]}}if(t==="radar"){const w=rce(n);return _l({data:e,cfg:w,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:w}=lr(e);if(w.length<3){console.log("Bubble charts require 3 numeric columns");return}const _=Aee(e),E=Hf(_,r),C={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:w[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:w[1]},beginAtZero:!0,ticks:{precision:0}}}},R=di(C,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:E},options:R}}return _l({data:e,cfg:n,customCfg:r,cardType:t,userSettings:o,provider:i,preferences:s})}function ice({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:i,apply:o}){const s=ye.getState().theme;if(!i)return;const a=s==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&sce(e,t,i,o,a),["pie","doughnut","polarArea"].includes(r)&&ace(e,t,i,o,a),["stackedBar","pyramid"].includes(r)&&oce({chart:e,elementIndex:t,datasetIndex:n,cfg:i,apply:o,blurColor:a})}function oce(e){var a,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:i,apply:o,blurColor:s}=e;o?(l=(a=t==null?void 0:t.data)==null?void 0:a.datasets)==null||l.forEach((d,p)=>{var h,m;typeof d.backgroundColor=="string"&&(d.backgroundColor=new Array(d.data.length).fill(d.backgroundColor),d.borderColor=new Array(d.data.length).fill(d.borderColor)),d.backgroundColor=(h=d==null?void 0:d.backgroundColor)==null?void 0:h.map((b,y)=>y===n&&p===r?b:s),d.borderColor=(m=d==null?void 0:d.borderColor)==null?void 0:m.map((b,y)=>y===n&&p===r?b:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((d,p)=>{var h,m,b,y,x,w;d.backgroundColor=new Array(d.data.length).fill((b=(m=(h=i==null?void 0:i.data)==null?void 0:h.datasets)==null?void 0:m[p])==null?void 0:b.backgroundColor),d.borderColor=new Array(d.data.length).fill((w=(x=(y=i==null?void 0:i.data)==null?void 0:y.datasets)==null?void 0:x[p])==null?void 0:w.borderColor)}),t==null||t.update()}function sce(e,t,n,r,i){var o,s,a,l;r?(s=(o=e==null?void 0:e.data)==null?void 0:o.datasets)==null||s.forEach(c=>{var u,d;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,h)=>h===t?p:i),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((p,h)=>h===t?p:i)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,p,h,m,b,y;c.backgroundColor=new Array(c.data.length).fill((h=(p=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:p[u])==null?void 0:h.backgroundColor),c.borderColor=new Array(c.data.length).fill((y=(b=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:b[u])==null?void 0:y.borderColor)}),e==null||e.update()}function ace(e,t,n,r,i){var o,s,a,l;r?(s=(o=e==null?void 0:e.data)==null?void 0:o.datasets)==null||s.forEach(c=>{var u,d;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((p,h)=>h===t?p:i),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((p,h)=>h===t?p:i)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,p,h,m,b,y,x,w;typeof c.backgroundColor=="string"&&(c.backgroundColor=(h=(p=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:p[u])==null?void 0:h.backgroundColor,c.borderColor=(y=(b=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:b[u])==null?void 0:y.borderColor),c.backgroundColor=(x=c==null?void 0:c.backgroundColor)==null?void 0:x.map((_,E)=>{var C;return(C=n.data.datasets[u].backgroundColor)==null?void 0:C[E]}),c.borderColor=(w=c==null?void 0:c.borderColor)==null?void 0:w.map((_,E)=>{var C;return(C=n.data.datasets[u].borderColor)==null?void 0:C[E]})}),e==null||e.update()}function lce({card:e,data:t,datasetIndex:n,clickIndex:r,value:i}){var o,s,a,l,c,u;try{if(!t)return;const{keys:d,dimensionKeys:p,metricKeys:h}=lr(t);if(e.type==="map"){const m=d[0],b=((s=(o=i==null?void 0:i.feature)==null?void 0:o.properties)==null?void 0:s.name)||((l=(a=i==null?void 0:i.feature)==null?void 0:a.properties)==null?void 0:l.NAME);return[{columnName:m,columnValue:b}]}if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const m=p[0],b=(c=t[r])==null?void 0:c[m];return[{columnName:m,columnValue:b,metric:h[n],value:i}]}if(["stackedBar","pyramid"].includes(e.type)){const m=wb({dataArray:t,groupKey:p[0],pivotKey:p[1],valueKey:h[0]}),b=p[0],y=(u=m[r])==null?void 0:u[b],x=p[1],{metricKeys:w}=lr(m),_=w[n];return[{columnName:b,columnValue:y,metric:h[0],value:i},{columnName:x,columnValue:_,metric:h[0],value:i}]}if(e.type==="bubble"||e.type==="scatter"){const m=p[0],b=i.label;return[{columnName:m,columnValue:b,metric1:h[0],value1:i.x,metric2:h[1],value2:i.y,metric3:h==null?void 0:h[2],value3:i==null?void 0:i.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function cce(e,t){var r,i;if((((r=e.data.datasets)==null?void 0:r.filter(o=>!!o.fill))||[]).length>0){const o=(i=e==null?void 0:e.data.datasets)==null?void 0:i.map(a=>({...a,backgroundColor:[a.backgroundColor].map(l=>{const c=t.createLinearGradient(0,0,0,400);return c.addColorStop(0,l),c.addColorStop(.7,Zee("--semaphor-background")),c})}));return{...e,data:{...e.data,datasets:o}}}return e}function _4(e){var a,l,c,u,d,p;const t=(((l=(a=e.preferences)==null?void 0:a.mapVisualOptions)==null?void 0:l.topoJsonUrl)==="custom"?(u=(c=e.preferences)==null?void 0:c.mapVisualOptions)==null?void 0:u.customTopoJsonUrl:(p=(d=e.preferences)==null?void 0:d.mapVisualOptions)==null?void 0:p.topoJsonUrl)||"",n=!!t&&e.type==="map",{data:r,isLoading:i,isFetching:o,isError:s}=dp({queryKey:["topojson",t],queryFn:()=>fetch(t).then(h=>h.json()),enabled:n,staleTime:1/0});return{data:r,isLoading:i,isFetching:o,isError:s}}function uce(e){var s,a;const[t]=k.useState({id:"",title:"",type:"bar"}),{getCard:n}=Vn(),r=n(e),i=C4(r||t),o={...r,data:((s=i==null?void 0:i.data)==null?void 0:s.records)||[]};return{...i,data:((a=i==null?void 0:i.data)==null?void 0:a.records)||[],card:o}}function C4(e){var Q,H,L,G;const{onChartElementClicked:t}=Wi(),[n,r]=k.useState(0);((Q=e==null?void 0:e.preferences)==null?void 0:Q.filterOnClickColumnIndex)===void 0||(H=e.preferences)==null||H.filterOnClickColumnIndex;const i=ye(V=>V.isVisualEditing),o=ye(V=>V.filteringCards),s=ye(V=>V.selectedSheetId),a=ye(V=>V.selectedLensId);ye(V=>V.selectedCardId),ye(V=>V.dashboard),ye(V=>V.isDashboardEditing),ye(V=>V.themeStyle);const l=ye(V=>V.filterValues),c=k.useRef(l),u=(L=e==null?void 0:e.preferences)==null?void 0:L.onClickFilter,{addFilteringCard:d,getCardFrame:p,addOrUpdateFilterValues:h,removeFilterValues:m,removeFilteringCard:b}=Vn(),{data:y,isLoading:x,isFetching:w,isError:_,queryKey:E}=Ga(e),{data:C}=_4(e),R=o==null?void 0:o.find(V=>V.id===e.id),T=p(e.id),M=(T==null?void 0:T.cards)||[],N=(M==null?void 0:M.length)==1;let j;y&&y.records&&((G=y.records)==null?void 0:G.length)>0&&e.type!=="custom"&&(j=xE({data:y==null?void 0:y.records,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences,topoJson:C}));const F=k.useRef({filteringCards:o});k.useEffect(()=>{!(y!=null&&y.records)||x||w||R&&N||i||r(V=>V+1)},[y==null?void 0:y.records,x,w,R,N,i]),k.useEffect(()=>{e.connectionId&&!R&&(c.current=l)},[l,a,e.connectionId,R]),k.useEffect(()=>{var B;R&&(F.current.filteringCards=[...o||[]]),!R&&((B=F.current.filteringCards)==null?void 0:B.find(X=>X.id===e.id))&&N&&r(X=>X+1)},[R,N,e.id,o]);function $(V,B,X,I){var O;let q=!1;if(!(y!=null&&y.records))return;const U=lce({card:e,data:y==null?void 0:y.records,datasetIndex:B,clickIndex:X,value:I});if(console.log("fieldValues",U),t==null||t(e,U),!!(((O=e==null?void 0:e.preferences)==null?void 0:O.onClickFilter)??[]).length){if(R){const ee=e.id;m(ee),b(e)}else{if(q=!0,!U)return;const ee=[];U.forEach((K,oe)=>{const Y=u==null?void 0:u.find(se=>se.columnIndex===oe);if(!Y)return;const J={filterId:e.id+"-"+K.columnName+"-"+s,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:K.columnName,expression:Y.expression,valueType:Ey(U[Y.columnIndex].columnValue),operation:"=",values:[U[Y.columnIndex].columnValue]};ee.push(J)}),h(ee),d(e)}ice({chart:V,elementIndex:X,datasetIndex:B,cardType:e.type,cfg:j,apply:q})}}return{isError:_,isLoading:x,isFetching:w,data:y,visualKey:n,handleDatapointClick:$,cfg:j,queryKey:E}}function os({children:e,containerClassName:t,className:n,text:r,onSave:i,type:o="input"}){const[s,a]=k.useState(!1),[l,c]=k.useState(r),u=ye(h=>h.isDashboardEditing),d=h=>{h.stopPropagation(),u&&a(!0)};function p(){return o==="textarea"?v.jsx("textarea",{className:me("grow rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:h=>c(h.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:h=>{h.stopPropagation(),!(h.key==="Enter"&&h.shiftKey)&&(h.key==="Enter"||h.key==="Tab")&&(a(!1),i(l))}}):v.jsx("input",{onMouseDown:h=>h.stopPropagation(),type:"text",className:me("rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:h=>c(h.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:h=>{h.stopPropagation(),(h.key==="Enter"||h.key==="Tab")&&(a(!1),i(l))}})}return v.jsx("div",{className:me("flex",t),role:"editable",onDoubleClick:d,children:s?p():e})}function E4(e){const{authToken:t}=Wi(),n=uX(t==null?void 0:t.accessToken);function r(){var o,s,a,l,c,u;if((s=(o=e.preferences)==null?void 0:o.formatNumber)!=null&&s.currency&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.currency)!=="none")return n!=null&&n.currency?n==null?void 0:n.currency:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.currency}function i(){var o,s,a,l,c,u;if((s=(o=e.preferences)==null?void 0:o.formatNumber)!=null&&s.locale&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.locale)!=="none")return n!=null&&n.locale?n==null?void 0:n.locale:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.locale}return{getCurrency:r,getLocale:i}}function Gb({card:e,data:t}){var w,_,E,C,R,T,M,N,j,F,$,Q,H,L,G,V;const n=ye(B=>B.actions.setCardTitle),r=ye(B=>B.actions.setCardDescription),i=ye(B=>B.isVisualEditing),o=fi(B=>B.card),s=fi(B=>B.actions.setCard);fi(B=>B.actions.setNumberFormat);const{getCurrency:a,getLocale:l}=E4(e),c=ye(B=>B.selectedSheetId),u=(_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.colorRanges,{metricKeys:d}=lr(t),p=(E=t==null?void 0:t[0])==null?void 0:E[d==null?void 0:d[0]],h=(C=t==null?void 0:t[0])==null?void 0:C[d==null?void 0:d[1]],m=t&&t.length>0;function b(B){i?s({...o,title:B}):n(c,e.id,B)}function y(B){i?s({...o,description:B}):r(c,e.id,B)}const x=h&&h-p!==0?(p-h)/h:null;return v.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[v.jsxs(Py,{className:"grow pb-3",children:[v.jsx(os,{text:i?o.title:e.title,onSave:b,children:v.jsx("div",{className:"flex items-center gap-2",children:v.jsx(Ad,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),m&&v.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[v.jsx("p",{style:{color:VC(p,u)},className:"text-3xl font-semibold",children:ao({number:p,decimalPlaces:((T=(R=e.preferences)==null?void 0:R.formatNumber)==null?void 0:T.decimalPlaces)||0,useSuffix:!!((N=(M=e.preferences)==null?void 0:M.formatNumber)!=null&&N.suffix),customSuffix:((F=(j=e.preferences)==null?void 0:j.formatNumber)==null?void 0:F.suffix)||"",locale:l()||"",currency:a()||""})}),h&&v.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",ao({number:h,decimalPlaces:((Q=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:Q.decimalPlaces)||0,useSuffix:!!((L=(H=e.preferences)==null?void 0:H.formatNumber)!=null&&L.suffix),customSuffix:((V=(G=e.preferences)==null?void 0:G.formatNumber)==null?void 0:V.suffix)||"",locale:l()||"",currency:a()||""})]})]})]}),x&&v.jsxs(Ty,{className:"grow items-start gap-1 pb-4 text-sm",children:[v.jsx(R4,{children:x}),v.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[x>0?"up ":"down ",v.jsx(os,{text:e.description||"",onSave:y,children:e.description})]})]})]})}function R4({children:e,className:t}){var o,s;const n=ye(a=>a.themeStyle),r=e>0?v.jsx("span",{children:"+"}):v.jsx("span",{children:"-"}),i=`${Math.abs(e*100).toFixed(0)}%`;return v.jsxs("div",{style:{borderRadius:(s=(o=n==null?void 0:n.chart)==null?void 0:o.options)==null?void 0:s.borderRadius},className:me("flex items-center px-1 text-sm font-semibold",{"bg-green-600/10 text-green-600":e>0,"bg-destructive/10 text-destructive":e<0},t),children:[r,v.jsx("span",{className:"ml-[1px]",children:i})]})}const dce=["top","right","bottom","left"],na=Math.min,kr=Math.max,$h=Math.round,ym=Math.floor,ss=e=>({x:e,y:e}),fce={left:"right",right:"left",bottom:"top",top:"bottom"},hce={start:"end",end:"start"};function AS(e,t,n){return kr(e,na(t,n))}function ds(e,t){return typeof e=="function"?e(t):e}function ra(e){return e.split("-")[0]}function Fd(e){return e.split("-")[1]}function wE(e){return e==="x"?"y":"x"}function SE(e){return e==="y"?"height":"width"}function Za(e){return["top","bottom"].includes(ra(e))?"y":"x"}function _E(e){return wE(Za(e))}function pce(e,t,n){n===void 0&&(n=!1);const r=Fd(e),i=_E(e),o=SE(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=qb(s)),[s,qb(s)]}function gce(e){const t=qb(e);return[OS(e),t,OS(t)]}function OS(e){return e.replace(/start|end/g,t=>hce[t])}function mce(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function bce(e,t,n,r){const i=Fd(e);let o=mce(ra(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(OS)))),o}function qb(e){return e.replace(/left|right|bottom|top/g,t=>fce[t])}function yce(e){return{top:0,right:0,bottom:0,left:0,...e}}function P4(e){return typeof e!="number"?yce(e):{top:e,right:e,bottom:e,left:e}}function Yb(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function cM(e,t,n){let{reference:r,floating:i}=e;const o=Za(t),s=_E(t),a=SE(s),l=ra(t),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Fd(t)){case"start":h[s]-=p*(n&&c?-1:1);break;case"end":h[s]+=p*(n&&c?-1:1);break}return h}const vce=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=cM(c,r,l),p=r,h={},m=0;for(let b=0;b<a.length;b++){const{name:y,fn:x}=a[b],{x:w,y:_,data:E,reset:C}=await x({x:u,y:d,initialPlacement:r,placement:p,strategy:i,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,d=_??d,h={...h,[y]:{...h[y],...E}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:u,y:d}=cM(c,p,l)),b=-1)}return{x:u,y:d,placement:p,strategy:i,middlewareData:h}};async function xd(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=ds(t,e),m=P4(h),y=a[p?d==="floating"?"reference":"floating":d],x=Yb(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},C=Yb(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:_,strategy:l}):w);return{top:(x.top-C.top+m.top)/E.y,bottom:(C.bottom-x.bottom+m.bottom)/E.y,left:(x.left-C.left+m.left)/E.x,right:(C.right-x.right+m.right)/E.x}}const xce=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=ds(e,t)||{};if(c==null)return{};const d=P4(u),p={x:n,y:r},h=_E(i),m=SE(h),b=await s.getDimensions(c),y=h==="y",x=y?"top":"left",w=y?"bottom":"right",_=y?"clientHeight":"clientWidth",E=o.reference[m]+o.reference[h]-p[h]-o.floating[m],C=p[h]-o.reference[h],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=R?R[_]:0;(!T||!await(s.isElement==null?void 0:s.isElement(R)))&&(T=a.floating[_]||o.floating[m]);const M=E/2-C/2,N=T/2-b[m]/2-1,j=na(d[x],N),F=na(d[w],N),$=j,Q=T-b[m]-F,H=T/2-b[m]/2+M,L=AS($,H,Q),G=!l.arrow&&Fd(i)!=null&&H!==L&&o.reference[m]/2-(H<$?j:F)-b[m]/2<0,V=G?H<$?H-$:H-Q:0;return{[h]:p[h]+V,data:{[h]:L,centerOffset:H-L-V,...G&&{alignmentOffset:V}},reset:G}}}),wce=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:b=!0,...y}=ds(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const x=ra(i),w=Za(a),_=ra(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(_||!b?[qb(a)]:gce(a)),R=m!=="none";!p&&R&&C.push(...bce(a,b,m,E));const T=[a,...C],M=await xd(t,y),N=[];let j=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&N.push(M[x]),d){const H=pce(i,s,E);N.push(M[H[0]],M[H[1]])}if(j=[...j,{placement:i,overflows:N}],!N.every(H=>H<=0)){var F,$;const H=(((F=o.flip)==null?void 0:F.index)||0)+1,L=T[H];if(L)return{data:{index:H,overflows:j},reset:{placement:L}};let G=($=j.filter(V=>V.overflows[0]<=0).sort((V,B)=>V.overflows[1]-B.overflows[1])[0])==null?void 0:$.placement;if(!G)switch(h){case"bestFit":{var Q;const V=(Q=j.filter(B=>{if(R){const X=Za(B.placement);return X===w||X==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(X=>X>0).reduce((X,I)=>X+I,0)]).sort((B,X)=>B[1]-X[1])[0])==null?void 0:Q[0];V&&(G=V);break}case"initialPlacement":G=a;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function uM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function dM(e){return dce.some(t=>e[t]>=0)}const Sce=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ds(e,t);switch(r){case"referenceHidden":{const o=await xd(t,{...i,elementContext:"reference"}),s=uM(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:dM(s)}}}case"escaped":{const o=await xd(t,{...i,altBoundary:!0}),s=uM(o,n.floating);return{data:{escapedOffsets:s,escaped:dM(s)}}}default:return{}}}}};async function _ce(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=ra(n),a=Fd(n),l=Za(n)==="y",c=["left","top"].includes(s)?-1:1,u=o&&l?-1:1,d=ds(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const Cce=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await _ce(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},Ece=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x,y:w}=y;return{x,y:w}}},...l}=ds(e,t),c={x:n,y:r},u=await xd(t,l),d=Za(ra(i)),p=wE(d);let h=c[p],m=c[d];if(o){const y=p==="y"?"top":"left",x=p==="y"?"bottom":"right",w=h+u[y],_=h-u[x];h=AS(w,h,_)}if(s){const y=d==="y"?"top":"left",x=d==="y"?"bottom":"right",w=m+u[y],_=m-u[x];m=AS(w,m,_)}const b=a.fn({...t,[p]:h,[d]:m});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:o,[d]:s}}}}}},Rce=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ds(e,t),u={x:n,y:r},d=Za(i),p=wE(d);let h=u[p],m=u[d];const b=ds(a,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const _=p==="y"?"height":"width",E=o.reference[p]-o.floating[_]+y.mainAxis,C=o.reference[p]+o.reference[_]-y.mainAxis;h<E?h=E:h>C&&(h=C)}if(c){var x,w;const _=p==="y"?"width":"height",E=["top","left"].includes(ra(i)),C=o.reference[d]-o.floating[_]+(E&&((x=s.offset)==null?void 0:x[d])||0)+(E?0:y.crossAxis),R=o.reference[d]+o.reference[_]+(E?0:((w=s.offset)==null?void 0:w[d])||0)-(E?y.crossAxis:0);m<C?m=C:m>R&&(m=R)}return{[p]:h,[d]:m}}}},Pce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...c}=ds(e,t),u=await xd(t,c),d=ra(i),p=Fd(i),h=Za(i)==="y",{width:m,height:b}=o.floating;let y,x;d==="top"||d==="bottom"?(y=d,x=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=d,y=p==="end"?"top":"bottom");const w=b-u.top-u.bottom,_=m-u.left-u.right,E=na(b-u[y],w),C=na(m-u[x],_),R=!t.middlewareData.shift;let T=E,M=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=w),R&&!p){const j=kr(u.left,0),F=kr(u.right,0),$=kr(u.top,0),Q=kr(u.bottom,0);h?M=m-2*(j!==0||F!==0?j+F:kr(u.left,u.right)):T=b-2*($!==0||Q!==0?$+Q:kr(u.top,u.bottom))}await l({...t,availableWidth:M,availableHeight:T});const N=await s.getDimensions(a.floating);return m!==N.width||b!==N.height?{reset:{rects:!0}}:{}}}};function r0(){return typeof window<"u"}function jd(e){return T4(e)?(e.nodeName||"").toLowerCase():"#document"}function ji(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xs(e){var t;return(t=(T4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function T4(e){return r0()?e instanceof Node||e instanceof ji(e).Node:!1}function Ir(e){return r0()?e instanceof Element||e instanceof ji(e).Element:!1}function fs(e){return r0()?e instanceof HTMLElement||e instanceof ji(e).HTMLElement:!1}function fM(e){return!r0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ji(e).ShadowRoot}function wp(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Io(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Tce(e){return["table","td","th"].includes(jd(e))}function i0(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function CE(e){const t=EE(),n=Ir(e)?Io(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function kce(e){let t=Ja(e);for(;fs(t)&&!wd(t);){if(CE(t))return t;if(i0(t))return null;t=Ja(t)}return null}function EE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function wd(e){return["html","body","#document"].includes(jd(e))}function Io(e){return ji(e).getComputedStyle(e)}function o0(e){return Ir(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ja(e){if(jd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fM(e)&&e.host||xs(e);return fM(t)?t.host:t}function k4(e){const t=Ja(e);return wd(t)?e.ownerDocument?e.ownerDocument.body:e.body:fs(t)&&wp(t)?t:k4(t)}function zh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=k4(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=ji(i);if(o){const a=MS(s);return t.concat(s,s.visualViewport||[],wp(i)?i:[],a&&n?zh(a):[])}return t.concat(i,zh(i,[],n))}function MS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function A4(e){const t=Io(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=fs(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=$h(n)!==o||$h(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function RE(e){return Ir(e)?e:e.contextElement}function Fu(e){const t=RE(e);if(!fs(t))return ss(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=A4(t);let s=(o?$h(n.width):n.width)/r,a=(o?$h(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Ace=ss(0);function O4(e){const t=ji(e);return!EE()||!t.visualViewport?Ace:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Oce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ji(e)?!1:t}function Ec(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=RE(e);let s=ss(1);t&&(r?Ir(r)&&(s=Fu(r)):s=Fu(e));const a=Oce(o,n,r)?O4(o):ss(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const p=ji(o),h=r&&Ir(r)?ji(r):r;let m=p,b=MS(m);for(;b&&r&&h!==m;){const y=Fu(b),x=b.getBoundingClientRect(),w=Io(b),_=x.left+(b.clientLeft+parseFloat(w.paddingLeft))*y.x,E=x.top+(b.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=_,c+=E,m=ji(b),b=MS(m)}}return Yb({width:u,height:d,x:l,y:c})}function PE(e,t){const n=o0(e).scrollLeft;return t?t.left+n:Ec(xs(e)).left+n}function M4(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:PE(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function Mce(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=xs(r),a=t?i0(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=ss(1);const u=ss(0),d=fs(r);if((d||!d&&!o)&&((jd(r)!=="body"||wp(s))&&(l=o0(r)),fs(r))){const h=Ec(r);c=Fu(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const p=s&&!d&&!o?M4(s,l,!0):ss(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function Ice(e){return Array.from(e.getClientRects())}function Dce(e){const t=xs(e),n=o0(e),r=e.ownerDocument.body,i=kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+PE(e);const a=-n.scrollTop;return Io(r).direction==="rtl"&&(s+=kr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function Nce(e,t){const n=ji(e),r=xs(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=EE();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function Lce(e,t){const n=Ec(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=fs(e)?Fu(e):ss(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function hM(e,t,n){let r;if(t==="viewport")r=Nce(e,n);else if(t==="document")r=Dce(xs(e));else if(Ir(t))r=Lce(t,n);else{const i=O4(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Yb(r)}function I4(e,t){const n=Ja(e);return n===t||!Ir(n)||wd(n)?!1:Io(n).position==="fixed"||I4(n,t)}function Fce(e,t){const n=t.get(e);if(n)return n;let r=zh(e,[],!1).filter(a=>Ir(a)&&jd(a)!=="body"),i=null;const o=Io(e).position==="fixed";let s=o?Ja(e):e;for(;Ir(s)&&!wd(s);){const a=Io(s),l=CE(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||wp(s)&&!l&&I4(e,s))?r=r.filter(u=>u!==s):i=a,s=Ja(s)}return t.set(e,r),r}function jce(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?i0(t)?[]:Fce(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=hM(t,u,i);return c.top=kr(d.top,c.top),c.right=na(d.right,c.right),c.bottom=na(d.bottom,c.bottom),c.left=kr(d.left,c.left),c},hM(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function $ce(e){const{width:t,height:n}=A4(e);return{width:t,height:n}}function zce(e,t,n){const r=fs(t),i=xs(t),o=n==="fixed",s=Ec(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ss(0);if(r||!r&&!o)if((jd(t)!=="body"||wp(i))&&(a=o0(t)),r){const p=Ec(t,!0,o,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&(l.x=PE(i));const c=i&&!r&&!o?M4(i,a):ss(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function Jx(e){return Io(e).position==="static"}function pM(e,t){if(!fs(e)||Io(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xs(e)===n&&(n=n.ownerDocument.body),n}function D4(e,t){const n=ji(e);if(i0(e))return n;if(!fs(e)){let i=Ja(e);for(;i&&!wd(i);){if(Ir(i)&&!Jx(i))return i;i=Ja(i)}return n}let r=pM(e,t);for(;r&&Tce(r)&&Jx(r);)r=pM(r,t);return r&&wd(r)&&Jx(r)&&!CE(r)?n:r||kce(e)||n}const Bce=async function(e){const t=this.getOffsetParent||D4,n=this.getDimensions,r=await n(e.floating);return{reference:zce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hce(e){return Io(e).direction==="rtl"}const Vce={convertOffsetParentRelativeRectToViewportRelativeRect:Mce,getDocumentElement:xs,getClippingRect:jce,getOffsetParent:D4,getElementRects:Bce,getClientRects:Ice,getDimensions:$ce,getScale:Fu,isElement:Ir,isRTL:Hce};function N4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wce(e,t){let n=null,r;const i=xs(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(a||t(),!p||!h)return;const m=ym(d),b=ym(i.clientWidth-(u+p)),y=ym(i.clientHeight-(d+h)),x=ym(u),_={rootMargin:-m+"px "+-b+"px "+-y+"px "+-x+"px",threshold:kr(0,na(1,l))||1};let E=!0;function C(R){const T=R[0].intersectionRatio;if(T!==l){if(!E)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!N4(c,e.getBoundingClientRect())&&s(),E=!1}try{n=new IntersectionObserver(C,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return s(!0),o}function L4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=RE(e),u=i||o?[...c?zh(c):[],...zh(t)]:[];u.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const d=c&&a?Wce(c,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(x=>{let[w]=x;w&&w.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m,b=l?Ec(e):null;l&&y();function y(){const x=Ec(e);b&&!N4(b,x)&&n(),b=x,m=requestAnimationFrame(y)}return n(),()=>{var x;u.forEach(w=>{i&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),d==null||d(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const ew=xd,Uce=Cce,Gce=Ece,qce=wce,Yce=Pce,Kce=Sce,gM=xce,Xce=Rce,Qce=(e,t,n)=>{const r=new Map,i={platform:Vce,...n},o={...i.platform,_c:r};return vce(e,t,{...i,platform:o})};var rb=typeof document<"u"?k.useLayoutEffect:k.useEffect;function Kb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kb(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Kb(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function F4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mM(e,t){const n=F4(e);return Math.round(t*n)/n}function tw(e){const t=P.useRef(e);return rb(()=>{t.current=e}),t}function j4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=P.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=P.useState(r);Kb(p,r)||h(r);const[m,b]=P.useState(null),[y,x]=P.useState(null),w=P.useCallback(B=>{B!==R.current&&(R.current=B,b(B))},[]),_=P.useCallback(B=>{B!==T.current&&(T.current=B,x(B))},[]),E=o||m,C=s||y,R=P.useRef(null),T=P.useRef(null),M=P.useRef(u),N=l!=null,j=tw(l),F=tw(i),$=tw(c),Q=P.useCallback(()=>{if(!R.current||!T.current)return;const B={placement:t,strategy:n,middleware:p};F.current&&(B.platform=F.current),Qce(R.current,T.current,B).then(X=>{const I={...X,isPositioned:$.current!==!1};H.current&&!Kb(M.current,I)&&(M.current=I,mc.flushSync(()=>{d(I)}))})},[p,t,n,F,$]);rb(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,d(B=>({...B,isPositioned:!1})))},[c]);const H=P.useRef(!1);rb(()=>(H.current=!0,()=>{H.current=!1}),[]),rb(()=>{if(E&&(R.current=E),C&&(T.current=C),E&&C){if(j.current)return j.current(E,C,Q);Q()}},[E,C,Q,j,N]);const L=P.useMemo(()=>({reference:R,floating:T,setReference:w,setFloating:_}),[w,_]),G=P.useMemo(()=>({reference:E,floating:C}),[E,C]),V=P.useMemo(()=>{const B={position:n,left:0,top:0};if(!G.floating)return B;const X=mM(G.floating,u.x),I=mM(G.floating,u.y);return a?{...B,transform:"translate("+X+"px, "+I+"px)",...F4(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:I}},[n,a,G.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:Q,refs:L,elements:G,floatingStyles:V}),[u,Q,L,G,V])}const Zce=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?gM({element:r.current,padding:i}).fn(n):{}:r?gM({element:r,padding:i}).fn(n):{}}}},TE=(e,t)=>({...Uce(e),options:[e,t]}),$4=(e,t)=>({...Gce(e),options:[e,t]}),Jce=(e,t)=>({...Xce(e),options:[e,t]}),z4=(e,t)=>({...qce(e),options:[e,t]}),B4=(e,t)=>({...Yce(e),options:[e,t]}),eue=(e,t)=>({...Kce(e),options:[e,t]}),tue=(e,t)=>({...Zce(e),options:[e,t]});var nue="Arrow",H4=P.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return v.jsx(Fe.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});H4.displayName=nue;var rue=H4;function s0(e){const[t,n]=P.useState(void 0);return yr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var kE="Popper",[V4,ws]=rr(kE),[iue,W4]=V4(kE),U4=e=>{const{__scopePopper:t,children:n}=e,[r,i]=P.useState(null);return v.jsx(iue,{scope:t,anchor:r,onAnchorChange:i,children:n})};U4.displayName=kE;var G4="PopperAnchor",q4=P.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=W4(G4,n),s=P.useRef(null),a=it(t,s);return P.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:v.jsx(Fe.div,{...i,ref:a})});q4.displayName=G4;var AE="PopperContent",[oue,sue]=V4(AE),Y4=P.forwardRef((e,t)=>{var Y,J,se,ae,ge,ne;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...b}=e,y=W4(AE,n),[x,w]=P.useState(null),_=it(t,fe=>w(fe)),[E,C]=P.useState(null),R=s0(E),T=(R==null?void 0:R.width)??0,M=(R==null?void 0:R.height)??0,N=r+(o!=="center"?"-"+o:""),j=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},F=Array.isArray(c)?c:[c],$=F.length>0,Q={padding:j,boundary:F.filter(lue),altBoundary:$},{refs:H,floatingStyles:L,placement:G,isPositioned:V,middlewareData:B}=j4({strategy:"fixed",placement:N,whileElementsMounted:(...fe)=>L4(...fe,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[TE({mainAxis:i+M,alignmentAxis:s}),l&&$4({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Jce():void 0,...Q}),l&&z4({...Q}),B4({...Q,apply:({elements:fe,rects:he,availableWidth:_e,availableHeight:Ae})=>{const{width:Le,height:ke}=he.reference,Be=fe.floating.style;Be.setProperty("--radix-popper-available-width",`${_e}px`),Be.setProperty("--radix-popper-available-height",`${Ae}px`),Be.setProperty("--radix-popper-anchor-width",`${Le}px`),Be.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),E&&tue({element:E,padding:a}),cue({arrowWidth:T,arrowHeight:M}),p&&eue({strategy:"referenceHidden",...Q})]}),[X,I]=Q4(G),q=tr(m);yr(()=>{V&&(q==null||q())},[V,q]);const U=(Y=B.arrow)==null?void 0:Y.x,O=(J=B.arrow)==null?void 0:J.y,ee=((se=B.arrow)==null?void 0:se.centerOffset)!==0,[K,oe]=P.useState();return yr(()=>{x&&oe(window.getComputedStyle(x).zIndex)},[x]),v.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:V?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(ae=B.transformOrigin)==null?void 0:ae.x,(ge=B.transformOrigin)==null?void 0:ge.y].join(" "),...((ne=B.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(oue,{scope:n,placedSide:X,onArrowChange:C,arrowX:U,arrowY:O,shouldHideArrow:ee,children:v.jsx(Fe.div,{"data-side":X,"data-align":I,...b,ref:_,style:{...b.style,animation:V?void 0:"none"}})})})});Y4.displayName=AE;var K4="PopperArrow",aue={top:"bottom",right:"left",bottom:"top",left:"right"},X4=P.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=sue(K4,r),s=aue[o.placedSide];return v.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:v.jsx(rue,{...i,ref:n,style:{...i.style,display:"block"}})})});X4.displayName=K4;function lue(e){return e!==null}var cue=e=>({name:"transformOrigin",options:e,fn(t){var y,x,w;const{placement:n,rects:r,middlewareData:i}=t,s=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=Q4(n),d={start:"0%",center:"50%",end:"100%"}[u],p=(((x=i.arrow)==null?void 0:x.x)??0)+a/2,h=(((w=i.arrow)==null?void 0:w.y)??0)+l/2;let m="",b="";return c==="bottom"?(m=s?d:`${p}px`,b=`${-l}px`):c==="top"?(m=s?d:`${p}px`,b=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,b=s?d:`${h}px`):c==="left"&&(m=`${r.floating.width+l}px`,b=s?d:`${h}px`),{data:{x:m,y:b}}}});function Q4(e){const[t,n="center"]=e.split("-");return[t,n]}var Sp=U4,$d=q4,_p=Y4,Cp=X4,uue="Portal",Ep=P.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,o]=P.useState(!1);yr(()=>o(!0),[]);const s=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Ar.createPortal(v.jsx(Fe.div,{...r,ref:t}),s):null});Ep.displayName=uue;function due(e,t=globalThis==null?void 0:globalThis.document){const n=tr(e);P.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var fue="DismissableLayer",IS="dismissableLayer.update",hue="dismissableLayer.pointerDownOutside",pue="dismissableLayer.focusOutside",bM,Z4=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zc=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,c=P.useContext(Z4),[u,d]=P.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=P.useState({}),m=it(t,T=>d(T)),b=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(y),w=u?b.indexOf(u):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,E=w>=x,C=bue(T=>{const M=T.target,N=[...c.branches].some(j=>j.contains(M));!E||N||(i==null||i(T),s==null||s(T),T.defaultPrevented||a==null||a())},p),R=yue(T=>{const M=T.target;[...c.branches].some(j=>j.contains(M))||(o==null||o(T),s==null||s(T),T.defaultPrevented||a==null||a())},p);return due(T=>{w===c.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},p),P.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(bM=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),yM(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=bM)}},[u,p,n,c]),P.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),yM())},[u,c]),P.useEffect(()=>{const T=()=>h({});return document.addEventListener(IS,T),()=>document.removeEventListener(IS,T)},[]),v.jsx(Fe.div,{...l,ref:m,style:{pointerEvents:_?E?"auto":"none":void 0,...e.style},onFocusCapture:Pe(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Pe(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Pe(e.onPointerDownCapture,C.onPointerDownCapture)})});zc.displayName=fue;var gue="DismissableLayerBranch",mue=P.forwardRef((e,t)=>{const n=P.useContext(Z4),r=P.useRef(null),i=it(t,r);return P.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),v.jsx(Fe.div,{...e,ref:i})});mue.displayName=gue;function bue(e,t=globalThis==null?void 0:globalThis.document){const n=tr(e),r=P.useRef(!1),i=P.useRef(()=>{});return P.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){J4(hue,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yue(e,t=globalThis==null?void 0:globalThis.document){const n=tr(e),r=P.useRef(!1);return P.useEffect(()=>{const i=o=>{o.target&&!r.current&&J4(pue,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function yM(){const e=new CustomEvent(IS);document.dispatchEvent(e)}function J4(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?HN(i,o):i.dispatchEvent(o)}var nw,OE="HoverCard",[e3,zAe]=rr(OE,[ws]),a0=ws(),[vue,ME]=e3(OE),t3=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:s=700,closeDelay:a=300}=e,l=a0(t),c=P.useRef(0),u=P.useRef(0),d=P.useRef(!1),p=P.useRef(!1),[h=!1,m]=Dr({prop:r,defaultProp:i,onChange:o}),b=P.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>m(!0),s)},[s,m]),y=P.useCallback(()=>{clearTimeout(c.current),!d.current&&!p.current&&(u.current=window.setTimeout(()=>m(!1),a))},[a,m]),x=P.useCallback(()=>m(!1),[m]);return P.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),v.jsx(vue,{scope:t,open:h,onOpenChange:m,onOpen:b,onClose:y,onDismiss:x,hasSelectionRef:d,isPointerDownOnContentRef:p,children:v.jsx(Sp,{...l,children:n})})};t3.displayName=OE;var n3="HoverCardTrigger",r3=P.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=ME(n3,n),o=a0(n);return v.jsx($d,{asChild:!0,...o,children:v.jsx(Fe.a,{"data-state":i.open?"open":"closed",...r,ref:t,onPointerEnter:Pe(e.onPointerEnter,Qb(i.onOpen)),onPointerLeave:Pe(e.onPointerLeave,Qb(i.onClose)),onFocus:Pe(e.onFocus,i.onOpen),onBlur:Pe(e.onBlur,i.onClose),onTouchStart:Pe(e.onTouchStart,s=>s.preventDefault())})})});r3.displayName=n3;var xue="HoverCardPortal",[BAe,wue]=e3(xue,{forceMount:void 0}),Xb="HoverCardContent",i3=P.forwardRef((e,t)=>{const n=wue(Xb,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=ME(Xb,e.__scopeHoverCard);return v.jsx(Kn,{present:r||o.open,children:v.jsx(Sue,{"data-state":o.open?"open":"closed",...i,onPointerEnter:Pe(e.onPointerEnter,Qb(o.onOpen)),onPointerLeave:Pe(e.onPointerLeave,Qb(o.onClose)),ref:t})})});i3.displayName=Xb;var Sue=P.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,...a}=e,l=ME(Xb,n),c=a0(n),u=P.useRef(null),d=it(t,u),[p,h]=P.useState(!1);return P.useEffect(()=>{if(p){const m=document.body;return nw=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=nw,m.style.webkitUserSelect=nw}}},[p]),P.useEffect(()=>{if(u.current){const m=()=>{h(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())==null?void 0:y.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",m),()=>{document.removeEventListener("pointerup",m),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),P.useEffect(()=>{u.current&&Eue(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),v.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:Pe(o,m=>{m.preventDefault()}),onDismiss:l.onDismiss,children:v.jsx(_p,{...c,...a,onPointerDown:Pe(a.onPointerDown,m=>{m.currentTarget.contains(m.target)&&h(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...a.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),_ue="HoverCardArrow",Cue=P.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=a0(n);return v.jsx(Cp,{...i,...r,ref:t})});Cue.displayName=_ue;function Qb(e){return t=>t.pointerType==="touch"?void 0:e()}function Eue(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var Rue=t3,Pue=r3,o3=i3;const Rp=Rue,Pp=Pue,zd=P.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>v.jsx(o3,{ref:i,align:t,sideOffset:n,className:me("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));zd.displayName=o3.displayName;function s3({card:e}){const{setCardInfo:t}=Vn();return v.jsxs(Rp,{openDelay:0,children:[v.jsx(Pp,{children:v.jsx(aL,{className:"size-4 text-muted-foreground/40"})}),v.jsx(zd,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:v.jsx(os,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:v.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}function Tue({card:e,renderFilterInfo:t}){var m,b,y,x,w,_,E,C,R,T,M,N,j,F,$,Q;ye(H=>H.themeStyle);const{data:n,isLoading:r}=Ga(e),i=(n==null?void 0:n.records)||[],o=ye(H=>H.isDashboardEditing),{getCurrency:s,getLocale:a}=E4(e),l=(b=(m=e.preferences)==null?void 0:m.formatNumber)==null?void 0:b.colorRanges,{metricKeys:c}=lr(i),u=(y=i==null?void 0:i[0])==null?void 0:y[c==null?void 0:c[0]],d=(x=i==null?void 0:i[0])==null?void 0:x[c==null?void 0:c[1]],p=(i==null?void 0:i.length)>0,h=d&&d-u!==0?(u-d)/d:null;return v.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:v.jsxs("div",{className:"grow",children:[p?v.jsx("div",{className:"",children:v.jsxs("div",{className:me("flex items-end gap-1.5",{"animate-pulse":r}),children:[v.jsx("p",{style:{color:VC(u,l)},className:"text-3xl font-semibold",children:ao({number:u,decimalPlaces:((_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((C=(E=e.preferences)==null?void 0:E.formatNumber)!=null&&C.suffix),customSuffix:((T=(R=e.preferences)==null?void 0:R.formatNumber)==null?void 0:T.suffix)||"",locale:a()||"",currency:s()||""})}),h&&v.jsxs("div",{className:"flex items-end gap-1",children:[v.jsx(R4,{className:"",children:h}),d&&v.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${ao({number:d,decimalPlaces:((N=(M=e.preferences)==null?void 0:M.formatNumber)==null?void 0:N.decimalPlaces)||0,useSuffix:!!((F=(j=e.preferences)==null?void 0:j.formatNumber)!=null&&F.suffix),customSuffix:((Q=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:Q.suffix)||"",locale:a()||"",currency:s()||""})}`})]})]})}):v.jsx("div",{className:"flex h-9 items-center justify-center"}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsxs(Ad,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(o||e.info)&&v.jsx(s3,{card:e})]}),t==null?void 0:t()]})]})})}var kue="VisuallyHidden",IE=P.forwardRef((e,t)=>v.jsx(Fe.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));IE.displayName=kue;var Aue=IE,[l0,HAe]=rr("Tooltip",[ws]),c0=ws(),a3="TooltipProvider",Oue=700,DS="tooltip.open",[Mue,DE]=l0(a3),l3=e=>{const{__scopeTooltip:t,delayDuration:n=Oue,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=P.useState(!0),l=P.useRef(!1),c=P.useRef(0);return P.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),v.jsx(Mue,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:P.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:P.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:P.useCallback(u=>{l.current=u},[]),disableHoverableContent:i,children:o})};l3.displayName=a3;var u0="Tooltip",[Iue,d0]=l0(u0),c3=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=e,l=DE(u0,e.__scopeTooltip),c=c0(t),[u,d]=P.useState(null),p=Yn(),h=P.useRef(0),m=s??l.disableHoverableContent,b=a??l.delayDuration,y=P.useRef(!1),[x=!1,w]=Dr({prop:r,defaultProp:i,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(DS))):l.onClose(),o==null||o(T)}}),_=P.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),E=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,w(!0)},[w]),C=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),R=P.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,w(!0),h.current=0},b)},[b,w]);return P.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),v.jsx(Sp,{...c,children:v.jsx(Iue,{scope:t,contentId:p,open:x,stateAttribute:_,trigger:u,onTriggerChange:d,onTriggerEnter:P.useCallback(()=>{l.isOpenDelayed?R():E()},[l.isOpenDelayed,R,E]),onTriggerLeave:P.useCallback(()=>{m?C():(window.clearTimeout(h.current),h.current=0)},[C,m]),onOpen:E,onClose:C,disableHoverableContent:m,children:n})})};c3.displayName=u0;var NS="TooltipTrigger",NE=P.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=d0(NS,n),o=DE(NS,n),s=c0(n),a=P.useRef(null),l=it(t,a,i.onTriggerChange),c=P.useRef(!1),u=P.useRef(!1),d=P.useCallback(()=>c.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),v.jsx($d,{asChild:!0,...s,children:v.jsx(Fe.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Pe(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Pe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Pe(e.onBlur,i.onClose),onClick:Pe(e.onClick,i.onClose)})})});NE.displayName=NS;var Due="TooltipPortal",[VAe,Nue]=l0(Due,{forceMount:void 0}),Sd="TooltipContent",u3=P.forwardRef((e,t)=>{const n=Nue(Sd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=d0(Sd,e.__scopeTooltip);return v.jsx(Kn,{present:r||s.open,children:s.disableHoverableContent?v.jsx(d3,{side:i,...o,ref:t}):v.jsx(Lue,{side:i,...o,ref:t})})}),Lue=P.forwardRef((e,t)=>{const n=d0(Sd,e.__scopeTooltip),r=DE(Sd,e.__scopeTooltip),i=P.useRef(null),o=it(t,i),[s,a]=P.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,p=P.useCallback(()=>{a(null),d(!1)},[d]),h=P.useCallback((m,b)=>{const y=m.currentTarget,x={x:m.clientX,y:m.clientY},w=zue(x,y.getBoundingClientRect()),_=Bue(x,w),E=Hue(b.getBoundingClientRect()),C=Wue([..._,...E]);a(C),d(!0)},[d]);return P.useEffect(()=>()=>p(),[p]),P.useEffect(()=>{if(l&&u){const m=y=>h(y,u),b=y=>h(y,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",b)}}},[l,u,h,p]),P.useEffect(()=>{if(s){const m=b=>{const y=b.target,x={x:b.clientX,y:b.clientY},w=(l==null?void 0:l.contains(y))||(u==null?void 0:u.contains(y)),_=!Vue(x,s);w?p():_&&(p(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,s,c,p]),v.jsx(d3,{...e,ref:o})}),[Fue,jue]=l0(u0,{isInside:!1}),d3=P.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,l=d0(Sd,n),c=c0(n),{onClose:u}=l;return P.useEffect(()=>(document.addEventListener(DS,u),()=>document.removeEventListener(DS,u)),[u]),P.useEffect(()=>{if(l.trigger){const d=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),v.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:v.jsxs(_p,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(sC,{children:r}),v.jsx(Fue,{scope:n,isInside:!0,children:v.jsx(Aue,{id:l.contentId,role:"tooltip",children:i||r})})]})})});u3.displayName=Sd;var f3="TooltipArrow",$ue=P.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=c0(n);return jue(f3,n).isInside?null:v.jsx(Cp,{...i,...r,ref:t})});$ue.displayName=f3;function zue(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Bue(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 Hue(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Vue(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(i=!i)}return i}function Wue(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),Uue(t)}function Uue(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Gue=l3,que=c3,Yue=NE,h3=u3;const Kue=Gue,p3=que,g3=Yue,LE=P.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(h3,{ref:r,sideOffset:t,className:me("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));LE.displayName=h3.displayName;/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */const{entries:m3,setPrototypeOf:vM,isFrozen:Xue,getPrototypeOf:Que,getOwnPropertyDescriptor:Zue}=Object;let{freeze:Qr,seal:ho,create:b3}=Object,{apply:LS,construct:FS}=typeof Reflect<"u"&&Reflect;Qr||(Qr=function(t){return t});ho||(ho=function(t){return t});LS||(LS=function(t,n,r){return t.apply(n,r)});FS||(FS=function(t,n){return new t(...n)});const vm=Hi(Array.prototype.forEach),xM=Hi(Array.prototype.pop),Sf=Hi(Array.prototype.push),ib=Hi(String.prototype.toLowerCase),rw=Hi(String.prototype.toString),wM=Hi(String.prototype.match),_f=Hi(String.prototype.replace),Jue=Hi(String.prototype.indexOf),ede=Hi(String.prototype.trim),So=Hi(Object.prototype.hasOwnProperty),Br=Hi(RegExp.prototype.test),Cf=tde(TypeError);function Hi(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return LS(e,t,r)}}function tde(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return FS(e,n)}}function At(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ib;vM&&vM(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=n(i);o!==i&&(Xue(t)||(t[r]=o),i=o)}e[i]=!0}return e}function nde(e){for(let t=0;t<e.length;t++)So(e,t)||(e[t]=null);return e}function Il(e){const t=b3(null);for(const[n,r]of m3(e))So(e,n)&&(Array.isArray(r)?t[n]=nde(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Il(r):t[n]=r);return t}function Ef(e,t){for(;e!==null;){const r=Zue(e,t);if(r){if(r.get)return Hi(r.get);if(typeof r.value=="function")return Hi(r.value)}e=Que(e)}function n(){return null}return n}const SM=Qr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),iw=Qr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ow=Qr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),rde=Qr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),sw=Qr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ide=Qr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_M=Qr(["#text"]),CM=Qr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),aw=Qr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),EM=Qr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xm=Qr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ode=ho(/\{\{[\w\W]*|[\w\W]*\}\}/gm),sde=ho(/<%[\w\W]*|[\w\W]*%>/gm),ade=ho(/\$\{[\w\W]*}/gm),lde=ho(/^data-[\-\w.\u00B7-\uFFFF]+$/),cde=ho(/^aria-[\-\w]+$/),y3=ho(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ude=ho(/^(?:\w+script|data):/i),dde=ho(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),v3=ho(/^html$/i),fde=ho(/^[a-z][.\w]*(-[.\w]+)+$/i);var RM=Object.freeze({__proto__:null,ARIA_ATTR:cde,ATTR_WHITESPACE:dde,CUSTOM_ELEMENT:fde,DATA_ATTR:lde,DOCTYPE_NAME:v3,ERB_EXPR:sde,IS_ALLOWED_URI:y3,IS_SCRIPT_OR_DATA:ude,MUSTACHE_EXPR:ode,TMPLIT_EXPR:ade});const Rf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},hde=function(){return typeof window>"u"?null:window},pde=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},PM=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function x3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hde();const t=Ne=>x3(Ne);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==Rf.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:h}=e,m=l.prototype,b=Ef(m,"cloneNode"),y=Ef(m,"remove"),x=Ef(m,"nextSibling"),w=Ef(m,"childNodes"),_=Ef(m,"parentNode");if(typeof s=="function"){const Ne=n.createElement("template");Ne.content&&Ne.content.ownerDocument&&(n=Ne.content.ownerDocument)}let E,C="";const{implementation:R,createNodeIterator:T,createDocumentFragment:M,getElementsByTagName:N}=n,{importNode:j}=r;let F=PM();t.isSupported=typeof m3=="function"&&typeof _=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:$,ERB_EXPR:Q,TMPLIT_EXPR:H,DATA_ATTR:L,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:B,CUSTOM_ELEMENT:X}=RM;let{IS_ALLOWED_URI:I}=RM,q=null;const U=At({},[...SM,...iw,...ow,...sw,..._M]);let O=null;const ee=At({},[...CM,...aw,...EM,...xm]);let K=Object.seal(b3(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,Y=null,J=!0,se=!0,ae=!1,ge=!0,ne=!1,fe=!0,he=!1,_e=!1,Ae=!1,Le=!1,ke=!1,Be=!1,dt=!0,Ct=!1;const an="user-content-";let mt=!0,Wt=!1,jt={},de=null;const Ce=At({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let He=null;const Ge=At({},["audio","video","img","source","image","track"]);let at=null;const On=At({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jn="http://www.w3.org/1998/Math/MathML",Pn="http://www.w3.org/2000/svg",ln="http://www.w3.org/1999/xhtml";let $n=ln,nn=!1,ir=null;const Xn=At({},[jn,Pn,ln],rw);let Gi=At({},["mi","mo","mn","ms","mtext"]),xr=At({},["annotation-xml"]);const jo=At({},["title","style","font","a","script"]);let wr=null;const Lr=["application/xhtml+xml","text/html"],dl="text/html";let je=null,wt=null;const Ut=n.createElement("form"),Qn=function(re){return re instanceof RegExp||re instanceof Function},Zn=function(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(wt&&wt===re)){if((!re||typeof re!="object")&&(re={}),re=Il(re),wr=Lr.indexOf(re.PARSER_MEDIA_TYPE)===-1?dl:re.PARSER_MEDIA_TYPE,je=wr==="application/xhtml+xml"?rw:ib,q=So(re,"ALLOWED_TAGS")?At({},re.ALLOWED_TAGS,je):U,O=So(re,"ALLOWED_ATTR")?At({},re.ALLOWED_ATTR,je):ee,ir=So(re,"ALLOWED_NAMESPACES")?At({},re.ALLOWED_NAMESPACES,rw):Xn,at=So(re,"ADD_URI_SAFE_ATTR")?At(Il(On),re.ADD_URI_SAFE_ATTR,je):On,He=So(re,"ADD_DATA_URI_TAGS")?At(Il(Ge),re.ADD_DATA_URI_TAGS,je):Ge,de=So(re,"FORBID_CONTENTS")?At({},re.FORBID_CONTENTS,je):Ce,oe=So(re,"FORBID_TAGS")?At({},re.FORBID_TAGS,je):{},Y=So(re,"FORBID_ATTR")?At({},re.FORBID_ATTR,je):{},jt=So(re,"USE_PROFILES")?re.USE_PROFILES:!1,J=re.ALLOW_ARIA_ATTR!==!1,se=re.ALLOW_DATA_ATTR!==!1,ae=re.ALLOW_UNKNOWN_PROTOCOLS||!1,ge=re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ne=re.SAFE_FOR_TEMPLATES||!1,fe=re.SAFE_FOR_XML!==!1,he=re.WHOLE_DOCUMENT||!1,Le=re.RETURN_DOM||!1,ke=re.RETURN_DOM_FRAGMENT||!1,Be=re.RETURN_TRUSTED_TYPE||!1,Ae=re.FORCE_BODY||!1,dt=re.SANITIZE_DOM!==!1,Ct=re.SANITIZE_NAMED_PROPS||!1,mt=re.KEEP_CONTENT!==!1,Wt=re.IN_PLACE||!1,I=re.ALLOWED_URI_REGEXP||y3,$n=re.NAMESPACE||ln,Gi=re.MATHML_TEXT_INTEGRATION_POINTS||Gi,xr=re.HTML_INTEGRATION_POINTS||xr,K=re.CUSTOM_ELEMENT_HANDLING||{},re.CUSTOM_ELEMENT_HANDLING&&Qn(re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),re.CUSTOM_ELEMENT_HANDLING&&Qn(re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),re.CUSTOM_ELEMENT_HANDLING&&typeof re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ne&&(se=!1),ke&&(Le=!0),jt&&(q=At({},_M),O=[],jt.html===!0&&(At(q,SM),At(O,CM)),jt.svg===!0&&(At(q,iw),At(O,aw),At(O,xm)),jt.svgFilters===!0&&(At(q,ow),At(O,aw),At(O,xm)),jt.mathMl===!0&&(At(q,sw),At(O,EM),At(O,xm))),re.ADD_TAGS&&(q===U&&(q=Il(q)),At(q,re.ADD_TAGS,je)),re.ADD_ATTR&&(O===ee&&(O=Il(O)),At(O,re.ADD_ATTR,je)),re.ADD_URI_SAFE_ATTR&&At(at,re.ADD_URI_SAFE_ATTR,je),re.FORBID_CONTENTS&&(de===Ce&&(de=Il(de)),At(de,re.FORBID_CONTENTS,je)),mt&&(q["#text"]=!0),he&&At(q,["html","head","body"]),q.table&&(At(q,["tbody"]),delete oe.tbody),re.TRUSTED_TYPES_POLICY){if(typeof re.TRUSTED_TYPES_POLICY.createHTML!="function")throw Cf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Cf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=re.TRUSTED_TYPES_POLICY,C=E.createHTML("")}else E===void 0&&(E=pde(h,i)),E!==null&&typeof C=="string"&&(C=E.createHTML(""));Qr&&Qr(re),wt=re}},Fr=At({},[...iw,...ow,...rde]),fr=At({},[...sw,...ide]),or=function(re){let Se=_(re);(!Se||!Se.tagName)&&(Se={namespaceURI:$n,tagName:"template"});const Ie=ib(re.tagName),Mt=ib(Se.tagName);return ir[re.namespaceURI]?re.namespaceURI===Pn?Se.namespaceURI===ln?Ie==="svg":Se.namespaceURI===jn?Ie==="svg"&&(Mt==="annotation-xml"||Gi[Mt]):!!Fr[Ie]:re.namespaceURI===jn?Se.namespaceURI===ln?Ie==="math":Se.namespaceURI===Pn?Ie==="math"&&xr[Mt]:!!fr[Ie]:re.namespaceURI===ln?Se.namespaceURI===Pn&&!xr[Mt]||Se.namespaceURI===jn&&!Gi[Mt]?!1:!fr[Ie]&&(jo[Ie]||!Fr[Ie]):!!(wr==="application/xhtml+xml"&&ir[re.namespaceURI]):!1},yn=function(re){Sf(t.removed,{element:re});try{_(re).removeChild(re)}catch{y(re)}},aa=function(re,Se){try{Sf(t.removed,{attribute:Se.getAttributeNode(re),from:Se})}catch{Sf(t.removed,{attribute:null,from:Se})}if(Se.removeAttribute(re),re==="is")if(Le||ke)try{yn(Se)}catch{}else try{Se.setAttribute(re,"")}catch{}},Wc=function(re){let Se=null,Ie=null;if(Ae)re="<remove></remove>"+re;else{const Tt=wM(re,/^[\r\n\t ]+/);Ie=Tt&&Tt[0]}wr==="application/xhtml+xml"&&$n===ln&&(re='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+re+"</body></html>");const Mt=E?E.createHTML(re):re;if($n===ln)try{Se=new p().parseFromString(Mt,wr)}catch{}if(!Se||!Se.documentElement){Se=R.createDocument($n,"template",null);try{Se.documentElement.innerHTML=nn?C:Mt}catch{}}const hn=Se.body||Se.documentElement;return re&&Ie&&hn.insertBefore(n.createTextNode(Ie),hn.childNodes[0]||null),$n===ln?N.call(Se,he?"html":"body")[0]:he?Se.documentElement:hn},Uc=function(re){return T.call(re.ownerDocument||re,re,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},te=function(re){return re instanceof d&&(typeof re.nodeName!="string"||typeof re.textContent!="string"||typeof re.removeChild!="function"||!(re.attributes instanceof u)||typeof re.removeAttribute!="function"||typeof re.setAttribute!="function"||typeof re.namespaceURI!="string"||typeof re.insertBefore!="function"||typeof re.hasChildNodes!="function")},Re=function(re){return typeof a=="function"&&re instanceof a};function Me(Ne,re,Se){vm(Ne,Ie=>{Ie.call(t,re,Se,wt)})}const We=function(re){let Se=null;if(Me(F.beforeSanitizeElements,re,null),te(re))return yn(re),!0;const Ie=je(re.nodeName);if(Me(F.uponSanitizeElement,re,{tagName:Ie,allowedTags:q}),re.hasChildNodes()&&!Re(re.firstElementChild)&&Br(/<[/\w]/g,re.innerHTML)&&Br(/<[/\w]/g,re.textContent)||re.nodeType===Rf.progressingInstruction||fe&&re.nodeType===Rf.comment&&Br(/<[/\w]/g,re.data))return yn(re),!0;if(!q[Ie]||oe[Ie]){if(!oe[Ie]&&Ht(Ie)&&(K.tagNameCheck instanceof RegExp&&Br(K.tagNameCheck,Ie)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Ie)))return!1;if(mt&&!de[Ie]){const Mt=_(re)||re.parentNode,hn=w(re)||re.childNodes;if(hn&&Mt){const Tt=hn.length;for(let Wn=Tt-1;Wn>=0;--Wn){const Jr=b(hn[Wn],!0);Jr.__removalCount=(re.__removalCount||0)+1,Mt.insertBefore(Jr,x(re))}}}return yn(re),!0}return re instanceof l&&!or(re)||(Ie==="noscript"||Ie==="noembed"||Ie==="noframes")&&Br(/<\/no(script|embed|frames)/i,re.innerHTML)?(yn(re),!0):(ne&&re.nodeType===Rf.text&&(Se=re.textContent,vm([$,Q,H],Mt=>{Se=_f(Se,Mt," ")}),re.textContent!==Se&&(Sf(t.removed,{element:re.cloneNode()}),re.textContent=Se)),Me(F.afterSanitizeElements,re,null),!1)},Dt=function(re,Se,Ie){if(dt&&(Se==="id"||Se==="name")&&(Ie in n||Ie in Ut))return!1;if(!(se&&!Y[Se]&&Br(L,Se))){if(!(J&&Br(G,Se))){if(!O[Se]||Y[Se]){if(!(Ht(re)&&(K.tagNameCheck instanceof RegExp&&Br(K.tagNameCheck,re)||K.tagNameCheck instanceof Function&&K.tagNameCheck(re))&&(K.attributeNameCheck instanceof RegExp&&Br(K.attributeNameCheck,Se)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(Se))||Se==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&Br(K.tagNameCheck,Ie)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Ie))))return!1}else if(!at[Se]){if(!Br(I,_f(Ie,B,""))){if(!((Se==="src"||Se==="xlink:href"||Se==="href")&&re!=="script"&&Jue(Ie,"data:")===0&&He[re])){if(!(ae&&!Br(V,_f(Ie,B,"")))){if(Ie)return!1}}}}}}return!0},Ht=function(re){return re!=="annotation-xml"&&wM(re,X)},St=function(re){Me(F.beforeSanitizeAttributes,re,null);const{attributes:Se}=re;if(!Se||te(re))return;const Ie={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0};let Mt=Se.length;for(;Mt--;){const hn=Se[Mt],{name:Tt,namespaceURI:Wn,value:Jr}=hn,_s=je(Tt);let sr=Tt==="value"?Jr:ede(Jr);if(Ie.attrName=_s,Ie.attrValue=sr,Ie.keepAttr=!0,Ie.forceKeepAttr=void 0,Me(F.uponSanitizeAttribute,re,Ie),sr=Ie.attrValue,Ct&&(_s==="id"||_s==="name")&&(aa(Tt,re),sr=an+sr),fe&&Br(/((--!?|])>)|<\/(style|title)/i,sr)){aa(Tt,re);continue}if(Ie.forceKeepAttr||(aa(Tt,re),!Ie.keepAttr))continue;if(!ge&&Br(/\/>/i,sr)){aa(Tt,re);continue}ne&&vm([$,Q,H],Yd=>{sr=_f(sr,Yd," ")});const qd=je(re.nodeName);if(Dt(qd,_s,sr)){if(E&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Wn)switch(h.getAttributeType(qd,_s)){case"TrustedHTML":{sr=E.createHTML(sr);break}case"TrustedScriptURL":{sr=E.createScriptURL(sr);break}}try{Wn?re.setAttributeNS(Wn,Tt,sr):re.setAttribute(Tt,sr),te(re)?yn(re):xM(t.removed)}catch{}}}Me(F.afterSanitizeAttributes,re,null)},bt=function Ne(re){let Se=null;const Ie=Uc(re);for(Me(F.beforeSanitizeShadowDOM,re,null);Se=Ie.nextNode();)Me(F.uponSanitizeShadowNode,Se,null),We(Se),St(Se),Se.content instanceof o&&Ne(Se.content);Me(F.afterSanitizeShadowDOM,re,null)};return t.sanitize=function(Ne){let re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Se=null,Ie=null,Mt=null,hn=null;if(nn=!Ne,nn&&(Ne="<!-->"),typeof Ne!="string"&&!Re(Ne))if(typeof Ne.toString=="function"){if(Ne=Ne.toString(),typeof Ne!="string")throw Cf("dirty is not a string, aborting")}else throw Cf("toString is not a function");if(!t.isSupported)return Ne;if(_e||Zn(re),t.removed=[],typeof Ne=="string"&&(Wt=!1),Wt){if(Ne.nodeName){const Jr=je(Ne.nodeName);if(!q[Jr]||oe[Jr])throw Cf("root node is forbidden and cannot be sanitized in-place")}}else if(Ne instanceof a)Se=Wc("<!---->"),Ie=Se.ownerDocument.importNode(Ne,!0),Ie.nodeType===Rf.element&&Ie.nodeName==="BODY"||Ie.nodeName==="HTML"?Se=Ie:Se.appendChild(Ie);else{if(!Le&&!ne&&!he&&Ne.indexOf("<")===-1)return E&&Be?E.createHTML(Ne):Ne;if(Se=Wc(Ne),!Se)return Le?null:Be?C:""}Se&&Ae&&yn(Se.firstChild);const Tt=Uc(Wt?Ne:Se);for(;Mt=Tt.nextNode();)We(Mt),St(Mt),Mt.content instanceof o&&bt(Mt.content);if(Wt)return Ne;if(Le){if(ke)for(hn=M.call(Se.ownerDocument);Se.firstChild;)hn.appendChild(Se.firstChild);else hn=Se;return(O.shadowroot||O.shadowrootmode)&&(hn=j.call(r,hn,!0)),hn}let Wn=he?Se.outerHTML:Se.innerHTML;return he&&q["!doctype"]&&Se.ownerDocument&&Se.ownerDocument.doctype&&Se.ownerDocument.doctype.name&&Br(v3,Se.ownerDocument.doctype.name)&&(Wn="<!DOCTYPE "+Se.ownerDocument.doctype.name+`>
316
- `+Wn),ne&&vm([$,Q,H],Jr=>{Wn=_f(Wn,Jr," ")}),E&&Be?E.createHTML(Wn):Wn},t.setConfig=function(){let Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zn(Ne),_e=!0},t.clearConfig=function(){wt=null,_e=!1},t.isValidAttribute=function(Ne,re,Se){wt||Zn({});const Ie=je(Ne),Mt=je(re);return Dt(Ie,Mt,Se)},t.addHook=function(Ne,re){typeof re=="function"&&Sf(F[Ne],re)},t.removeHook=function(Ne){return xM(F[Ne])},t.removeHooks=function(Ne){F[Ne]=[]},t.removeAllHooks=function(){F=PM()},t}var jS=x3();function Zb({card:e,isLoading:t,data:n}){var p,h;const r=n||[],{keys:i}=lr(r),o=ye(m=>m.selectedSheetId),s=ye(m=>m.isVisualEditing),a=(h=(p=e==null?void 0:e.preferences)==null?void 0:p.textVisualOptions)==null?void 0:h.isDynamicText,{setCardDescription:l}=Vn(),{setCard:c}=gp();function u(){var x;if(t)return v.jsxs("div",{className:"space-y-2",children:[v.jsx(Mu,{className:"h-3 w-full animate-pulse bg-muted"}),v.jsx(Mu,{className:"h-3 w-3/4 animate-pulse bg-muted"}),v.jsx(Mu,{className:"h-3 w-1/2 animate-pulse bg-muted"})]});const m=(x=r==null?void 0:r[0])==null?void 0:x[i[0]],b=jS.sanitize(m),y=v.jsx("div",{dangerouslySetInnerHTML:{__html:b}});return v.jsx("div",{className:"text-sm text-foreground/80 hover:cursor-text",onMouseDown:w=>w.stopPropagation(),children:y})}function d(){return v.jsx("div",{onMouseDown:m=>m.stopPropagation(),children:v.jsx(os,{type:"textarea",className:"w-full rounded-md bg-muted",text:(e==null?void 0:e.description)||"Double click to add description",onSave:m=>{s===!1&&l(o,e.id,m),s===!0&&c({...e,description:m})},children:v.jsx("div",{className:"text-sm text-foreground/70 hover:cursor-text",dangerouslySetInnerHTML:{__html:jS.sanitize((e==null?void 0:e.description)||(s?"Edit Description":"")||"")}})})})}return v.jsxs(v.Fragment,{children:[!a&&d(),a===!0&&u()]})}const TM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,kM=rd,FE=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return kM(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],d=o==null?void 0:o[c];if(u===null)return null;const p=TM(u)||TM(d);return i[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,p]=u;return p===void 0||(c[d]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:p,...h}=u;return Object.entries(h).every(m=>{let[b,y]=m;return Array.isArray(y)?y.includes({...o,...a}[b]):{...o,...a}[b]===y})?[...c,d,p]:c},[]);return kM(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Bh=FE("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),nr=P.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?ea:"button";return v.jsx(s,{className:me(Bh({variant:t,size:n,className:e})),ref:o,...i})});nr.displayName="Button";var gde="Separator",AM="horizontal",mde=["horizontal","vertical"],w3=P.forwardRef((e,t)=>{const{decorative:n,orientation:r=AM,...i}=e,o=bde(r)?r:AM,a=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return v.jsx(Fe.div,{"data-orientation":o,...a,...i,ref:t})});w3.displayName=gde;function bde(e){return mde.includes(e)}var S3=w3;const f0=P.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>v.jsx(S3,{ref:i,decorative:n,orientation:t,className:me("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));f0.displayName=S3.displayName;function yde(){var b,y;const e=ye(x=>x.themeStyle),t=ye(x=>x.filterValues),n=ye(x=>x.dashboard.filters),r=ye(x=>x.filteringCards),i=ye(x=>x.selectedSheetId),{removeFilterValues:o,removeFilteringCard:s,setFilterValues:a,setFilteringCards:l}=Vn(),c=n==null?void 0:n.filter(x=>x.sheetId===i||!x.sheetId),u=t==null?void 0:t.filter(x=>(c==null?void 0:c.some(w=>w.id===x.filterId))||x.filterId.endsWith(i));if(!u||u.length===0)return null;const d=u.map(x=>{const w=n==null?void 0:n.find(_=>_.id===x.filterId);return{filterId:x.filterId,name:(w==null?void 0:w.title)||x.name,values:x.values}});function p(x){return x instanceof Date?x.toLocaleDateString():x}function h(x){const w=r==null?void 0:r.find(_=>x.filterId.startsWith(_.id));w&&s(w),o(x.filterId)}function m(x){var w,_;return v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{style:{borderRadius:(_=(w=e==null?void 0:e.chart)==null?void 0:w.options)==null?void 0:_.borderRadius},className:"flex w-fit items-center gap-2 bg-muted-foreground px-2 py-1 font-semibold text-muted",children:[v.jsx("span",{className:"break-words",children:x.name}),v.jsx(jc,{onClick:()=>h(x),className:"size-3 text-muted hover:cursor-pointer hover:text-background"})]}),v.jsx("div",{className:"flex flex-wrap gap-1",children:x.values.map(E=>{var C,R;return v.jsx("span",{style:{borderRadius:(R=(C=e==null?void 0:e.chart)==null?void 0:C.options)==null?void 0:R.borderRadius},className:"inline-block",children:p(E)},E==null?void 0:E.toString())})})]})}return v.jsxs(Rp,{openDelay:100,children:[v.jsx(Pp,{children:v.jsx(iL,{className:"z-100 size-3.5 text-muted-foreground/40"})}),v.jsxs(zd,{style:{borderRadius:(y=(b=e==null?void 0:e.chart)==null?void 0:b.options)==null?void 0:y.borderRadius},className:"relative flex min-h-fit w-[300px] flex-col px-0 text-xs",align:"start",children:[v.jsx(BC,{onClick:()=>{l([]),a([])},className:"absolute right-4 size-3.5 text-muted-foreground/40 hover:cursor-pointer"}),v.jsx("div",{className:"h-fit max-h-[150px] min-h-0 grow overflow-auto",children:d==null?void 0:d.map(x=>v.jsxs("div",{className:"px-5",children:[m(x),v.jsx(f0,{className:"my-2"})]},x.name))})]})]})}const vde=P.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},i)=>v.jsx("div",{style:n,className:me("relative w-full overflow-auto",t),children:v.jsx("table",{ref:i,className:me("w-full caption-bottom text-sm",e),...r})}));vde.displayName="Table";const jE=P.forwardRef(({className:e,...t},n)=>v.jsx("thead",{ref:n,className:me("[&_tr]:border-b",e),...t}));jE.displayName="TableHeader";const $E=P.forwardRef(({className:e,...t},n)=>v.jsx("tbody",{ref:n,className:me("[&_tr:last-child]:border-0",e),...t}));$E.displayName="TableBody";const xde=P.forwardRef(({className:e,...t},n)=>v.jsx("tfoot",{ref:n,className:me("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));xde.displayName="TableFooter";const hh=P.forwardRef(({className:e,...t},n)=>v.jsx("tr",{ref:n,className:me("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));hh.displayName="TableRow";const zE=P.forwardRef(({className:e,...t},n)=>v.jsx("th",{ref:n,className:me("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));zE.displayName="TableHead";const BE=P.forwardRef(({className:e,...t},n)=>v.jsx("td",{ref:n,className:me("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));BE.displayName="TableCell";const wde=P.forwardRef(({className:e,...t},n)=>v.jsx("caption",{ref:n,className:me("mt-4 text-sm text-muted-foreground",e),...t}));wde.displayName="TableCaption";/**
317
- * table-core
318
- *
319
- * Copyright (c) TanStack
320
- *
321
- * This source code is licensed under the MIT license found in the
322
- * LICENSE.md file in the root directory of this source tree.
323
- *
324
- * @license MIT
325
- */function $a(e,t){return typeof e=="function"?e(t):e}function Vi(e,t){return n=>{t.setState(r=>({...r,[e]:$a(n,r[e])}))}}function h0(e){return e instanceof Function}function Sde(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function _de(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const s=t(o);s!=null&&s.length&&r(s)})};return r(e),n}function Xe(e,t,n){let r=[],i;return o=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(o);if(!(a.length!==r.length||a.some((u,d)=>r[d]!==u)))return i;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...a),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-c)*100)/100,p=d/16,h=(m,b)=>{for(m=String(m);m.length<b;)m=" "+m;return m};console.info(`%c⏱ ${h(d,5)} /${h(u,5)} ms`,`
326
- font-size: .6rem;
327
- font-weight: bold;
328
- color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function Qe(e,t,n,r){return{debug:()=>{var i;return(i=e==null?void 0:e.debugAll)!=null?i:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function Cde(e,t,n,r){const i=()=>{var s;return(s=o.getValue())!=null?s:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:Xe(()=>[e,n,t,o],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Qe(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(o,n,t,e)},{}),o}function Ede(e,t,n,r){var i,o;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(i=(o=a.id)!=null?o:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?i:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=p=>{let h=p;for(const b of l.split(".")){var m;h=(m=h)==null?void 0:m[b],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${b}" in deeply nested key "${l}" returned undefined.`)}return h}:u=p=>p[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Xe(()=>[!0],()=>{var p;return[d,...(p=d.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},Qe(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Xe(()=>[e._getOrderColumnsFn()],p=>{var h;if((h=d.columns)!=null&&h.length){let m=d.columns.flatMap(b=>b.getLeafColumns());return p(m)}return[d]},Qe(e.options,"debugColumns","column.getLeafColumns"))};for(const p of e._features)p.createColumn==null||p.createColumn(d,e);return d}const Er="debugHeaders";function OM(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(o),s},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(o,e)}),o}const Rde={createTable:e=>{e.getHeaderGroups=Xe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,s;const a=(o=r==null?void 0:r.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?o:[],l=(s=i==null?void 0:i.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(i!=null&&i.includes(d.id)));return wm(t,[...a,...c,...l],e)},Qe(e.options,Er,"getHeaderGroups")),e.getCenterHeaderGroups=Xe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),wm(t,n,e,"center")),Qe(e.options,Er,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Xe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return wm(t,o,e,"left")},Qe(e.options,Er,"getLeftHeaderGroups")),e.getRightHeaderGroups=Xe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return wm(t,o,e,"right")},Qe(e.options,Er,"getRightHeaderGroups")),e.getFooterGroups=Xe(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Qe(e.options,Er,"getFooterGroups")),e.getLeftFooterGroups=Xe(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Qe(e.options,Er,"getLeftFooterGroups")),e.getCenterFooterGroups=Xe(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Qe(e.options,Er,"getCenterFooterGroups")),e.getRightFooterGroups=Xe(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Qe(e.options,Er,"getRightFooterGroups")),e.getFlatHeaders=Xe(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,Er,"getFlatHeaders")),e.getLeftFlatHeaders=Xe(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,Er,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Xe(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,Er,"getCenterFlatHeaders")),e.getRightFlatHeaders=Xe(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,Er,"getRightFlatHeaders")),e.getCenterLeafHeaders=Xe(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Qe(e.options,Er,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Xe(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Qe(e.options,Er,"getLeftLeafHeaders")),e.getRightLeafHeaders=Xe(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Qe(e.options,Er,"getRightLeafHeaders")),e.getLeafHeaders=Xe(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,s,a,l,c;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},Qe(e.options,Er,"getLeafHeaders"))}};function wm(e,t,n,r){var i,o;let s=0;const a=function(p,h){h===void 0&&(h=1),s=Math.max(s,h),p.filter(m=>m.getIsVisible()).forEach(m=>{var b;(b=m.columns)!=null&&b.length&&a(m.columns,h+1)},0)};a(e);let l=[];const c=(p,h)=>{const m={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},b=[];p.forEach(y=>{const x=[...b].reverse()[0],w=y.column.depth===m.depth;let _,E=!1;if(w&&y.column.parent?_=y.column.parent:(_=y.column,E=!0),x&&(x==null?void 0:x.column)===_)x.subHeaders.push(y);else{const C=OM(n,_,{id:[r,h,_.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${b.filter(R=>R.column===_).length}`:void 0,depth:h,index:b.length});C.subHeaders.push(y),b.push(C)}m.headers.push(y),y.headerGroup=m}),l.push(m),h>0&&c(b,h-1)},u=t.map((p,h)=>OM(n,p,{depth:s,index:h}));c(u,s-1),l.reverse();const d=p=>p.filter(m=>m.column.getIsVisible()).map(m=>{let b=0,y=0,x=[0];m.subHeaders&&m.subHeaders.length?(x=[],d(m.subHeaders).forEach(_=>{let{colSpan:E,rowSpan:C}=_;b+=E,x.push(C)})):b=1;const w=Math.min(...x);return y=y+w,m.colSpan=b,m.rowSpan=y,{colSpan:b,rowSpan:y}});return d((i=(o=l[0])==null?void 0:o.headers)!=null?i:[]),l}const Pde=(e,t,n,r,i,o,s)=>{let a={id:t,index:r,original:n,depth:i,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>_de(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:Xe(()=>[e.getAllLeafColumns()],l=>l.map(c=>Cde(e,a,c,c.id)),Qe(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Xe(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Qe(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},Tde={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},_3=(e,t,n)=>{var r,i;const o=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(o))};_3.autoRemove=e=>Ao(e);const C3=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};C3.autoRemove=e=>Ao(e);const E3=(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())};E3.autoRemove=e=>Ao(e);const R3=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};R3.autoRemove=e=>Ao(e)||!(e!=null&&e.length);const P3=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});P3.autoRemove=e=>Ao(e)||!(e!=null&&e.length);const T3=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});T3.autoRemove=e=>Ao(e)||!(e!=null&&e.length);const k3=(e,t,n)=>e.getValue(t)===n;k3.autoRemove=e=>Ao(e);const A3=(e,t,n)=>e.getValue(t)==n;A3.autoRemove=e=>Ao(e);const HE=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};HE.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(i)?1/0:i;if(o>s){const a=o;o=s,s=a}return[o,s]};HE.autoRemove=e=>Ao(e)||Ao(e[0])&&Ao(e[1]);const zs={includesString:_3,includesStringSensitive:C3,equalsString:E3,arrIncludes:R3,arrIncludesAll:P3,arrIncludesSome:T3,equals:k3,weakEquals:A3,inNumberRange:HE};function Ao(e){return e==null||e===""}const kde={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Vi("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?zs.includesString:typeof r=="number"?zs.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?zs.equals:Array.isArray(r)?zs.arrIncludes:zs.weakEquals},e.getFilterFn=()=>{var n,r;return h0(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:zs[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=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(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r==null?void 0:r.find(u=>u.id===e.id),s=$a(n,o?o.value:void 0);if(MM(i,s,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(o){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=$a(t,i))==null?void 0:o.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(MM(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function MM(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Ade=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),Ode=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},Mde=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},Ide=(e,t,n)=>{let r,i;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r===void 0?s>=s&&(r=i=s):(r>s&&(r=s),i<s&&(i=s)))}),[r,i]},Dde=(e,t)=>{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},Nde=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!Sde(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,s)=>o-s);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},Lde=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Fde=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,jde=(e,t)=>t.length,lw={sum:Ade,min:Ode,max:Mde,extent:Ide,mean:Dde,median:Nde,unique:Lde,uniqueCount:Fde,count:jde},$de={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:Vi("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return lw.sum;if(Object.prototype.toString.call(r)==="[object Date]")return lw.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return h0(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:lw[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 i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function zde(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(s=>s.id===o)).filter(Boolean),...r]}const Bde={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Vi("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Xe(n=>[ph(t,n)],n=>n.findIndex(r=>r.id===e.id),Qe(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=ph(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=ph(t,n);return((r=i[i.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Xe(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const s=[...t],a=[...i];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&o.push(a.splice(c,1)[0])}o=[...o,...a]}return zde(o,n,r)},Qe(e.options,"debugTable","_getOrderColumnsFn"))}},cw=()=>({left:[],right:[]}),Hde={getInitialState:e=>({columnPinning:cw(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Vi("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,s;if(n==="right"){var a,l;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=i==null?void 0:i.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=i==null?void 0:i.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=i==null?void 0:i.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((o=i==null?void 0:i.left)!=null?o:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=i==null?void 0:i.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,s;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Xe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(s=>!o.includes(s.column.id))},Qe(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Xe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Qe(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Xe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Qe(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?cw():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:cw())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Xe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Qe(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Xe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Qe(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Xe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},Qe(e.options,"debugColumns","getCenterLeafColumns"))}},Sm={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},uw=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Vde={getDefaultColumnDef:()=>Sm,getInitialState:e=>({columnSizing:{},columnSizingInfo:uw(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Vi("columnSizing",e),onColumnSizingInfoChange:Vi("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Sm.minSize,(r=o??e.columnDef.size)!=null?r:Sm.size),(i=e.columnDef.maxSize)!=null?i:Sm.maxSize)},e.getStart=Xe(n=>[n,ph(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),Qe(t.options,"debugColumns","getStart")),e.getAfter=Xe(n=>[n,ph(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),Qe(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},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=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o: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),i=r==null?void 0:r.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),dw(o)&&o.touches&&o.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(x=>[x.column.id,x.column.getSize()]):[[r.id,r.getSize()]],l=dw(o)?Math.round(o.touches[0].clientX):o.clientX,c={},u=(x,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(_=>{var E,C;const R=t.options.columnResizeDirection==="rtl"?-1:1,T=(w-((E=_==null?void 0:_.startOffset)!=null?E:0))*R,M=Math.max(T/((C=_==null?void 0:_.startSize)!=null?C:0),-.999999);return _.columnSizingStart.forEach(N=>{let[j,F]=N;c[j]=Math.round(Math.max(F+F*M,0)*100)/100}),{..._,deltaOffset:T,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||x==="end")&&t.setColumnSizing(_=>({..._,...c})))},d=x=>u("move",x),p=x=>{u("end",x),t.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,m={moveHandler:x=>d(x.clientX),upHandler:x=>{h==null||h.removeEventListener("mousemove",m.moveHandler),h==null||h.removeEventListener("mouseup",m.upHandler),p(x.clientX)}},b={moveHandler:x=>(x.cancelable&&(x.preventDefault(),x.stopPropagation()),d(x.touches[0].clientX),!1),upHandler:x=>{var w;h==null||h.removeEventListener("touchmove",b.moveHandler),h==null||h.removeEventListener("touchend",b.upHandler),x.cancelable&&(x.preventDefault(),x.stopPropagation()),p((w=x.touches[0])==null?void 0:w.clientX)}},y=Wde()?{passive:!1}:!1;dw(o)?(h==null||h.addEventListener("touchmove",b.moveHandler,y),h==null||h.addEventListener("touchend",b.upHandler,y)):(h==null||h.addEventListener("mousemove",m.moveHandler,y),h==null||h.addEventListener("mouseup",m.upHandler,y)),t.setColumnSizingInfo(x=>({...x,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?uw():(n=e.initialState.columnSizingInfo)!=null?n:uw())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let _m=null;function Wde(){if(typeof _m=="boolean")return _m;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 _m=e,_m}function dw(e){return e.type==="touchstart"}const Ude={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Vi("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const i=e.columns;return(n=i.length?i.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Xe(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Qe(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Xe(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],Qe(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Xe(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Qe(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function ph(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Gde={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},qde={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Vi("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>zs.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return h0(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:zs[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Yde={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Vi("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i: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 i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},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(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const s=o.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(i=n)!=null?i:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.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()}}}},$S=0,zS=10,fw=()=>({pageIndex:$S,pageSize:zS}),Kde={getInitialState:e=>({...e,pagination:{...fw(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Vi("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>$a(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?fw():(i=e.initialState.pagination)!=null?i:fw())},e.setPageIndex=r=>{e.setPagination(i=>{let o=$a(r,i.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,s)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?$S:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:$S)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?zS:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:zS)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,$a(r,i.pageSize)),s=i.pageSize*i.pageIndex,a=Math.floor(s/o);return{...i,pageIndex:a,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let s=$a(r,(o=e.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...i,pageCount:s}}),e.getPageOptions=Xe(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,s)=>s)),i},Qe(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:r<i-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},hw=()=>({top:[],bottom:[]}),Xde={getInitialState:e=>({rowPinning:hw(),...e}),getDefaultOptions:e=>({onRowPinningChange:Vi("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=i?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...o]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,p;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(b=>!(a!=null&&a.has(b))),bottom:[...((p=l==null?void 0:l.bottom)!=null?p:[]).filter(b=>!(a!=null&&a.has(b))),...Array.from(a)]}}if(n==="top"){var h,m;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(b=>!(a!=null&&a.has(b))),...Array.from(a)],bottom:((m=l==null?void 0:l.bottom)!=null?m:[]).filter(b=>!(a!=null&&a.has(b)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(b=>!(a!=null&&a.has(b))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(b=>!(a!=null&&a.has(b)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?hw():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:hw())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=Xe(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Qe(e.options,"debugRows","getTopRows")),e.getBottomRows=Xe(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Qe(e.options,"debugRows","getBottomRows")),e.getCenterRows=Xe(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},Qe(e.options,"debugRows","getCenterRows"))}},Qde={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Vi("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},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{BS(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Xe(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?pw(e,n):{rows:[],flatRows:[],rowsById:{}},Qe(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Xe(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?pw(e,n):{rows:[],flatRows:[],rowsById:{}},Qe(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Xe(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?pw(e,n):{rows:[],flatRows:[],rowsById:{}},Qe(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.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 i=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const a={...o};return BS(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return VE(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return HS(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return HS(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 i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},BS=(e,t,n,r,i)=>{var o;const s=i.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=s.subRows)!=null&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>BS(e,a.id,n,r,i))};function pw(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(s,a){return s.map(l=>{var c;const u=VE(l,n);if(u&&(r.push(l),i[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:o(l.subRows)}),u)return l}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function VE(e,t){var n;return(n=t[e.id])!=null?n:!1}function HS(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(s=>{if(!(o&&!i)&&(s.getCanSelect()&&(VE(s,t)?o=!0:i=!1),s.subRows&&s.subRows.length)){const a=HS(s,t);a==="all"?o=!0:(a==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const VS=/([0-9]+)/gm,Zde=(e,t,n)=>O3(el(e.getValue(n)).toLowerCase(),el(t.getValue(n)).toLowerCase()),Jde=(e,t,n)=>O3(el(e.getValue(n)),el(t.getValue(n))),efe=(e,t,n)=>WE(el(e.getValue(n)).toLowerCase(),el(t.getValue(n)).toLowerCase()),tfe=(e,t,n)=>WE(el(e.getValue(n)),el(t.getValue(n))),nfe=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},rfe=(e,t,n)=>WE(e.getValue(n),t.getValue(n));function WE(e,t){return e===t?0:e>t?1:-1}function el(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function O3(e,t){const n=e.split(VS).filter(Boolean),r=t.split(VS).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),s=parseInt(i,10),a=parseInt(o,10),l=[s,a].sort();if(isNaN(l[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Pf={alphanumeric:Zde,alphanumericCaseSensitive:Jde,text:efe,textCaseSensitive:tfe,datetime:nfe,basic:rfe},ife={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Vi("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i==null?void 0:i.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Pf.datetime;if(typeof o=="string"&&(r=!0,o.split(VS).length>1))return Pf.alphanumeric}return r?Pf.text:Pf.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 h0(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:Pf[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(h=>h.id===e.id),l=s==null?void 0:s.findIndex(h=>h.id===e.id);let c=[],u,d=o?n:i==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(o||i||(u="remove")),u==="add"){var p;c=[...s,{id:e.id,desc:d}],c.splice(0,c.length-((p=t.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:d}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:s==="desc"?"asc":"desc":o},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(i=>i.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(i=>i.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())}},ofe=[Rde,Ude,Bde,Hde,Tde,kde,Gde,qde,ife,$de,Yde,Kde,Xde,Qde,Vde];function sfe(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...ofe,...(t=e._features)!=null?t:[]];let i={_features:r};const o=i._features.reduce((p,h)=>Object.assign(p,h.getDefaultOptions==null?void 0:h.getDefaultOptions(i)),{}),s=p=>i.options.mergeOptions?i.options.mergeOptions(o,p):{...o,...p};let l={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(p=>{var h;l=(h=p.getInitialState==null?void 0:p.getInitialState(l))!=null?h:l});const c=[];let u=!1;const d={_features:r,options:{...o,...e},initialState:l,_queue:p=>{c.push(p),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{i.setState(i.initialState)},setOptions:p=>{const h=$a(p,i.options);i.options=s(h)},getState:()=>i.options.state,setState:p=>{i.options.onStateChange==null||i.options.onStateChange(p)},_getRowId:(p,h,m)=>{var b;return(b=i.options.getRowId==null?void 0:i.options.getRowId(p,h,m))!=null?b:`${m?[m.id,h].join("."):h}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(p,h)=>{let m=(h?i.getPrePaginationRowModel():i.getRowModel()).rowsById[p];if(!m&&(m=i.getCoreRowModel().rowsById[p],!m))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${p}`):new Error;return m},_getDefaultColumnDef:Xe(()=>[i.options.defaultColumn],p=>{var h;return p=(h=p)!=null?h:{},{header:m=>{const b=m.header.column.columnDef;return b.accessorKey?b.accessorKey:b.accessorFn?b.id:null},cell:m=>{var b,y;return(b=(y=m.renderValue())==null||y.toString==null?void 0:y.toString())!=null?b:null},...i._features.reduce((m,b)=>Object.assign(m,b.getDefaultColumnDef==null?void 0:b.getDefaultColumnDef()),{}),...p}},Qe(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>i.options.columns,getAllColumns:Xe(()=>[i._getColumnDefs()],p=>{const h=function(m,b,y){return y===void 0&&(y=0),m.map(x=>{const w=Ede(i,x,y,b),_=x;return w.columns=_.columns?h(_.columns,w,y+1):[],w})};return h(p)},Qe(e,"debugColumns","getAllColumns")),getAllFlatColumns:Xe(()=>[i.getAllColumns()],p=>p.flatMap(h=>h.getFlatColumns()),Qe(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Xe(()=>[i.getAllFlatColumns()],p=>p.reduce((h,m)=>(h[m.id]=m,h),{}),Qe(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Xe(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(p,h)=>{let m=p.flatMap(b=>b.getLeafColumns());return h(m)},Qe(e,"debugColumns","getAllLeafColumns")),getColumn:p=>{const h=i._getAllFlatColumnsById()[p];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${p}' does not exist.`),h}};Object.assign(i,d);for(let p=0;p<i._features.length;p++){const h=i._features[p];h==null||h.createTable==null||h.createTable(i)}return i}function M3(){return e=>Xe(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,s){o===void 0&&(o=0);const a=[];for(let c=0;c<i.length;c++){const u=Pde(e,e._getRowId(i[c],c,s),i[c],c,o,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(i[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,o+1,u))}}return a};return n.rows=r(t),n},Qe(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function afe(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function I3(e){return t=>Xe(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=i*o,u=c+i;s=s.slice(c,u);let d;t.options.paginateExpandedRows?d={rows:s,flatRows:a,rowsById:l}:d=afe({rows:s,flatRows:a,rowsById:l}),d.flatRows=[];const p=h=>{d.flatRows.push(h),h.subRows.length&&h.subRows.forEach(p)};return d.rows.forEach(p),d},Qe(t.options,"debugTable","getPaginationRowModel"))}function D3(){return e=>Xe(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};o.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,d)=>{for(let h=0;h<o.length;h+=1){var p;const m=o[h],b=s[m.id],y=b.sortUndefined,x=(p=m==null?void 0:m.desc)!=null?p:!1;let w=0;if(y){const _=u.getValue(m.id),E=d.getValue(m.id),C=_===void 0,R=E===void 0;if(C||R){if(y==="first")return C?-1:1;if(y==="last")return C?1:-1;w=C&&R?0:C?y:-y}}if(w===0&&(w=b.sortingFn(u,d,m.id)),w!==0)return x&&(w*=-1),b.invertSorting&&(w*=-1),w}return u.index-d.index}),c.forEach(u=>{var d;i.push(u),(d=u.subRows)!=null&&d.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},Qe(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
329
- * react-table
330
- *
331
- * Copyright (c) TanStack
332
- *
333
- * This source code is licensed under the MIT license found in the
334
- * LICENSE.md file in the root directory of this source tree.
335
- *
336
- * @license MIT
337
- */function WS(e,t){return e?lfe(e)?P.createElement(e,t):e:null}function lfe(e){return cfe(e)||typeof e=="function"||ufe(e)}function cfe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function ufe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function N3(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=P.useState(()=>({current:sfe(t)})),[r,i]=P.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:s=>{i(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}function US(e,[t,n]){return Math.min(n,Math.max(t,e))}var gw=0;function p0(){P.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??IM()),document.body.insertAdjacentElement("beforeend",e[1]??IM()),gw++,()=>{gw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),gw--}},[])}function IM(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var mw="focusScope.autoFocusOnMount",bw="focusScope.autoFocusOnUnmount",DM={bubbles:!1,cancelable:!0},dfe="FocusScope",Tp=P.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=P.useState(null),c=tr(i),u=tr(o),d=P.useRef(null),p=it(t,b=>l(b)),h=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(r){let b=function(_){if(h.paused||!a)return;const E=_.target;a.contains(E)?d.current=E:Ca(d.current,{select:!0})},y=function(_){if(h.paused||!a)return;const E=_.relatedTarget;E!==null&&(a.contains(E)||Ca(d.current,{select:!0}))},x=function(_){if(document.activeElement===document.body)for(const C of _)C.removedNodes.length>0&&Ca(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",y);const w=new MutationObserver(x);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",y),w.disconnect()}}},[r,a,h.paused]),P.useEffect(()=>{if(a){LM.add(h);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(mw,DM);a.addEventListener(mw,c),a.dispatchEvent(x),x.defaultPrevented||(ffe(bfe(L3(a)),{select:!0}),document.activeElement===b&&Ca(a))}return()=>{a.removeEventListener(mw,c),setTimeout(()=>{const x=new CustomEvent(bw,DM);a.addEventListener(bw,u),a.dispatchEvent(x),x.defaultPrevented||Ca(b??document.body,{select:!0}),a.removeEventListener(bw,u),LM.remove(h)},0)}}},[a,c,u,h]);const m=P.useCallback(b=>{if(!n&&!r||h.paused)return;const y=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(y&&x){const w=b.currentTarget,[_,E]=hfe(w);_&&E?!b.shiftKey&&x===E?(b.preventDefault(),n&&Ca(_,{select:!0})):b.shiftKey&&x===_&&(b.preventDefault(),n&&Ca(E,{select:!0})):x===w&&b.preventDefault()}},[n,r,h.paused]);return v.jsx(Fe.div,{tabIndex:-1,...s,ref:p,onKeyDown:m})});Tp.displayName=dfe;function ffe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ca(r,{select:t}),document.activeElement!==n)return}function hfe(e){const t=L3(e),n=NM(t,e),r=NM(t.reverse(),e);return[n,r]}function L3(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function NM(e,t){for(const n of e)if(!pfe(n,{upTo:t}))return n}function pfe(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 gfe(e){return e instanceof HTMLInputElement&&"select"in e}function Ca(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gfe(e)&&t&&e.select()}}var LM=mfe();function mfe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=FM(e,t),e.unshift(t)},remove(t){var n;e=FM(e,t),(n=e[0])==null||n.resume()}}}function FM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bfe(e){return e.filter(t=>t.tagName!=="A")}function g0(e){const t=P.useRef({value:e,previous:e});return P.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var yfe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},du=new WeakMap,Cm=new WeakMap,Em={},yw=0,F3=function(e){return e&&(e.host||F3(e.parentNode))},vfe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=F3(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})},xfe=function(e,t,n,r){var i=vfe(t,Array.isArray(e)?e:[e]);Em[n]||(Em[n]=new WeakMap);var o=Em[n],s=[],a=new Set,l=new Set(i),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))u(p);else try{var h=p.getAttribute(r),m=h!==null&&h!=="false",b=(du.get(p)||0)+1,y=(o.get(p)||0)+1;du.set(p,b),o.set(p,y),s.push(p),b===1&&m&&Cm.set(p,!0),y===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return u(t),a.clear(),yw++,function(){s.forEach(function(d){var p=du.get(d)-1,h=o.get(d)-1;du.set(d,p),o.set(d,h),p||(Cm.has(d)||d.removeAttribute(r),Cm.delete(d)),h||d.removeAttribute(n)}),yw--,yw||(du=new WeakMap,du=new WeakMap,Cm=new WeakMap,Em={})}},m0=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=yfe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),xfe(r,i,n,"aria-hidden")):function(){return null}},Jo=function(){return Jo=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Jo.apply(this,arguments)};function j3(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function wfe(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var ob="right-scroll-bar-position",sb="width-before-scroll-bar",Sfe="with-scroll-bars-hidden",_fe="--removed-body-scroll-bar-size";function vw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Cfe(e,t){var n=k.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Efe=typeof window<"u"?P.useLayoutEffect:P.useEffect,jM=new WeakMap;function Rfe(e,t){var n=Cfe(null,function(r){return e.forEach(function(i){return vw(i,r)})});return Efe(function(){var r=jM.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||vw(a,null)}),o.forEach(function(a){i.has(a)||vw(a,s)})}jM.set(n,e)},[e]),n}function Pfe(e){return e}function Tfe(e,t){t===void 0&&(t=Pfe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var u=s;s=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return i}function kfe(e){e===void 0&&(e={});var t=Tfe(null);return t.options=Jo({async:!0,ssr:!1},e),t}var $3=function(e){var t=e.sideCar,n=j3(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return P.createElement(r,Jo({},n))};$3.isSideCarExport=!0;function Afe(e,t){return e.useMedium(t),$3}var z3=kfe(),xw=function(){},b0=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:xw,onWheelCapture:xw,onTouchMoveCapture:xw}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,h=e.noIsolation,m=e.inert,b=e.allowPinchZoom,y=e.as,x=y===void 0?"div":y,w=e.gapMode,_=j3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,C=Rfe([n,t]),R=Jo(Jo({},_),i);return P.createElement(P.Fragment,null,u&&P.createElement(E,{sideCar:z3,removeScrollBar:c,shards:d,noIsolation:h,inert:m,setCallbacks:o,allowPinchZoom:!!b,lockRef:n,gapMode:w}),s?P.cloneElement(P.Children.only(a),Jo(Jo({},R),{ref:C})):P.createElement(x,Jo({},R,{className:l,ref:C}),a))});b0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};b0.classNames={fullWidth:sb,zeroRight:ob};var Ofe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Mfe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ofe();return t&&e.setAttribute("nonce",t),e}function Ife(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Dfe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Nfe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Mfe())&&(Ife(t,n),Dfe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Lfe=function(){var e=Nfe();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},B3=function(){var e=Lfe(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Ffe={left:0,top:0,right:0,gap:0},ww=function(e){return parseInt(e||"",10)||0},jfe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[ww(n),ww(r),ww(i)]},$fe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ffe;var t=jfe(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])}},zfe=B3(),ju="data-scroll-locked",Bfe=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
338
- .`.concat(Sfe,` {
339
- overflow: hidden `).concat(r,`;
340
- padding-right: `).concat(a,"px ").concat(r,`;
341
- }
342
- body[`).concat(ju,`] {
343
- overflow: hidden `).concat(r,`;
344
- overscroll-behavior: contain;
345
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
346
- padding-left: `.concat(i,`px;
347
- padding-top: `).concat(o,`px;
348
- padding-right: `).concat(s,`px;
349
- margin-left:0;
350
- margin-top:0;
351
- margin-right: `).concat(a,"px ").concat(r,`;
352
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
353
- }
354
-
355
- .`).concat(ob,` {
356
- right: `).concat(a,"px ").concat(r,`;
357
- }
358
-
359
- .`).concat(sb,` {
360
- margin-right: `).concat(a,"px ").concat(r,`;
361
- }
362
-
363
- .`).concat(ob," .").concat(ob,` {
364
- right: 0 `).concat(r,`;
365
- }
366
-
367
- .`).concat(sb," .").concat(sb,` {
368
- margin-right: 0 `).concat(r,`;
369
- }
370
-
371
- body[`).concat(ju,`] {
372
- `).concat(_fe,": ").concat(a,`px;
373
- }
374
- `)},$M=function(){var e=parseInt(document.body.getAttribute(ju)||"0",10);return isFinite(e)?e:0},Hfe=function(){P.useEffect(function(){return document.body.setAttribute(ju,($M()+1).toString()),function(){var e=$M()-1;e<=0?document.body.removeAttribute(ju):document.body.setAttribute(ju,e.toString())}},[])},Vfe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Hfe();var o=P.useMemo(function(){return $fe(i)},[i]);return P.createElement(zfe,{styles:Bfe(o,!t,i,n?"":"!important")})},GS=!1;if(typeof window<"u")try{var Rm=Object.defineProperty({},"passive",{get:function(){return GS=!0,!0}});window.addEventListener("test",Rm,Rm),window.removeEventListener("test",Rm,Rm)}catch{GS=!1}var fu=GS?{passive:!1}:!1,Wfe=function(e){return e.tagName==="TEXTAREA"},H3=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Wfe(e)&&n[t]==="visible")},Ufe=function(e){return H3(e,"overflowY")},Gfe=function(e){return H3(e,"overflowX")},zM=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=V3(e,r);if(i){var o=W3(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qfe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Yfe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},V3=function(e,t){return e==="v"?Ufe(t):Gfe(t)},W3=function(e,t){return e==="v"?qfe(t):Yfe(t)},Kfe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Xfe=function(e,t,n,r,i){var o=Kfe(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,p=0;do{var h=W3(e,a),m=h[0],b=h[1],y=h[2],x=b-y-o*m;(m||x)&&V3(e,a)&&(d+=x,p+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(p)<1)&&(c=!0),c},Pm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},BM=function(e){return[e.deltaX,e.deltaY]},HM=function(e){return e&&"current"in e?e.current:e},Qfe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Zfe=function(e){return`
375
- .block-interactivity-`.concat(e,` {pointer-events: none;}
376
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
377
- `)},Jfe=0,hu=[];function ehe(e){var t=P.useRef([]),n=P.useRef([0,0]),r=P.useRef(),i=P.useState(Jfe++)[0],o=P.useState(B3)[0],s=P.useRef(e);P.useEffect(function(){s.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=wfe([e.lockRef.current],(e.shards||[]).map(HM),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=P.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var x=Pm(b),w=n.current,_="deltaX"in b?b.deltaX:w[0]-x[0],E="deltaY"in b?b.deltaY:w[1]-x[1],C,R=b.target,T=Math.abs(_)>Math.abs(E)?"h":"v";if("touches"in b&&T==="h"&&R.type==="range")return!1;var M=zM(T,R);if(!M)return!0;if(M?C=T:(C=T==="v"?"h":"v",M=zM(T,R)),!M)return!1;if(!r.current&&"changedTouches"in b&&(_||E)&&(r.current=C),!C)return!0;var N=r.current||C;return Xfe(N,y,b,N==="h"?_:E)},[]),l=P.useCallback(function(b){var y=b;if(!(!hu.length||hu[hu.length-1]!==o)){var x="deltaY"in y?BM(y):Pm(y),w=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&Qfe(C.delta,x)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var _=(s.current.shards||[]).map(HM).filter(Boolean).filter(function(C){return C.contains(y.target)}),E=_.length>0?a(y,_[0]):!s.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),c=P.useCallback(function(b,y,x,w){var _={name:b,delta:y,target:x,should:w,shadowParent:the(x)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(E){return E!==_})},1)},[]),u=P.useCallback(function(b){n.current=Pm(b),r.current=void 0},[]),d=P.useCallback(function(b){c(b.type,BM(b),b.target,a(b,e.lockRef.current))},[]),p=P.useCallback(function(b){c(b.type,Pm(b),b.target,a(b,e.lockRef.current))},[]);P.useEffect(function(){return hu.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,fu),document.addEventListener("touchmove",l,fu),document.addEventListener("touchstart",u,fu),function(){hu=hu.filter(function(b){return b!==o}),document.removeEventListener("wheel",l,fu),document.removeEventListener("touchmove",l,fu),document.removeEventListener("touchstart",u,fu)}},[]);var h=e.removeScrollBar,m=e.inert;return P.createElement(P.Fragment,null,m?P.createElement(o,{styles:Zfe(i)}):null,h?P.createElement(Vfe,{gapMode:e.gapMode}):null)}function the(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nhe=Afe(z3,ehe);var kp=P.forwardRef(function(e,t){return P.createElement(b0,Jo({},e,{ref:t,sideCar:nhe}))});kp.classNames=b0.classNames;var rhe=[" ","Enter","ArrowUp","ArrowDown"],ihe=[" ","Enter"],Ap="Select",[y0,v0,ohe]=Ay(Ap),[Bd,WAe]=rr(Ap,[ohe,ws]),x0=ws(),[she,sl]=Bd(Ap),[ahe,lhe]=Bd(Ap),U3=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:p,required:h,form:m}=e,b=x0(t),[y,x]=P.useState(null),[w,_]=P.useState(null),[E,C]=P.useState(!1),R=Nc(c),[T=!1,M]=Dr({prop:r,defaultProp:i,onChange:o}),[N,j]=Dr({prop:s,defaultProp:a,onChange:l}),F=P.useRef(null),$=y?m||!!y.closest("form"):!0,[Q,H]=P.useState(new Set),L=Array.from(Q).map(G=>G.props.value).join(";");return v.jsx(Sp,{...b,children:v.jsxs(she,{required:h,scope:t,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:E,onValueNodeHasChildrenChange:C,contentId:Yn(),value:N,onValueChange:j,open:T,onOpenChange:M,dir:R,triggerPointerDownPosRef:F,disabled:p,children:[v.jsx(y0.Provider,{scope:t,children:v.jsx(ahe,{scope:e.__scopeSelect,onNativeOptionAdd:P.useCallback(G=>{H(V=>new Set(V).add(G))},[]),onNativeOptionRemove:P.useCallback(G=>{H(V=>{const B=new Set(V);return B.delete(G),B})},[]),children:n})}),$?v.jsxs(b6,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:N,onChange:G=>j(G.target.value),disabled:p,form:m,children:[N===void 0?v.jsx("option",{value:""}):null,Array.from(Q)]},L):null]})})};U3.displayName=Ap;var G3="SelectTrigger",q3=P.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=x0(n),s=sl(G3,n),a=s.disabled||r,l=it(t,s.onTriggerChange),c=v0(n),u=P.useRef("touch"),[d,p,h]=y6(b=>{const y=c().filter(_=>!_.disabled),x=y.find(_=>_.value===s.value),w=v6(y,b,x);w!==void 0&&s.onValueChange(w.value)}),m=b=>{a||(s.onOpenChange(!0),h()),b&&(s.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return v.jsx($d,{asChild:!0,...o,children:v.jsx(Fe.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":m6(s.value)?"":void 0,...i,ref:l,onClick:Pe(i.onClick,b=>{b.currentTarget.focus(),u.current!=="mouse"&&m(b)}),onPointerDown:Pe(i.onPointerDown,b=>{u.current=b.pointerType;const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(m(b),b.preventDefault())}),onKeyDown:Pe(i.onKeyDown,b=>{const y=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&p(b.key),!(y&&b.key===" ")&&rhe.includes(b.key)&&(m(),b.preventDefault())})})})});q3.displayName=G3;var Y3="SelectValue",K3=P.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=sl(Y3,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=it(t,l.onValueNodeChange);return yr(()=>{c(u)},[c,u]),v.jsx(Fe.span,{...a,ref:d,style:{pointerEvents:"none"},children:m6(l.value)?v.jsx(v.Fragment,{children:s}):o})});K3.displayName=Y3;var che="SelectIcon",X3=P.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return v.jsx(Fe.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});X3.displayName=che;var uhe="SelectPortal",Q3=e=>v.jsx(Ep,{asChild:!0,...e});Q3.displayName=uhe;var Rc="SelectContent",Z3=P.forwardRef((e,t)=>{const n=sl(Rc,e.__scopeSelect),[r,i]=P.useState();if(yr(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?mc.createPortal(v.jsx(J3,{scope:e.__scopeSelect,children:v.jsx(y0.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),o):null}return v.jsx(e6,{...e,ref:t})});Z3.displayName=Rc;var _o=10,[J3,al]=Bd(Rc),dhe="SelectContentImpl",e6=P.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:y,...x}=e,w=sl(Rc,n),[_,E]=P.useState(null),[C,R]=P.useState(null),T=it(t,Y=>E(Y)),[M,N]=P.useState(null),[j,F]=P.useState(null),$=v0(n),[Q,H]=P.useState(!1),L=P.useRef(!1);P.useEffect(()=>{if(_)return m0(_)},[_]),p0();const G=P.useCallback(Y=>{const[J,...se]=$().map(ne=>ne.ref.current),[ae]=se.slice(-1),ge=document.activeElement;for(const ne of Y)if(ne===ge||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===J&&C&&(C.scrollTop=0),ne===ae&&C&&(C.scrollTop=C.scrollHeight),ne==null||ne.focus(),document.activeElement!==ge))return},[$,C]),V=P.useCallback(()=>G([M,_]),[G,M,_]);P.useEffect(()=>{Q&&V()},[Q,V]);const{onOpenChange:B,triggerPointerDownPosRef:X}=w;P.useEffect(()=>{if(_){let Y={x:0,y:0};const J=ae=>{var ge,ne;Y={x:Math.abs(Math.round(ae.pageX)-(((ge=X.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(ae.pageY)-(((ne=X.current)==null?void 0:ne.y)??0))}},se=ae=>{Y.x<=10&&Y.y<=10?ae.preventDefault():_.contains(ae.target)||B(!1),document.removeEventListener("pointermove",J),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",se,{capture:!0})}}},[_,B,X]),P.useEffect(()=>{const Y=()=>B(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[B]);const[I,q]=y6(Y=>{const J=$().filter(ge=>!ge.disabled),se=J.find(ge=>ge.ref.current===document.activeElement),ae=v6(J,Y,se);ae&&setTimeout(()=>ae.ref.current.focus())}),U=P.useCallback((Y,J,se)=>{const ae=!L.current&&!se;(w.value!==void 0&&w.value===J||ae)&&(N(Y),ae&&(L.current=!0))},[w.value]),O=P.useCallback(()=>_==null?void 0:_.focus(),[_]),ee=P.useCallback((Y,J,se)=>{const ae=!L.current&&!se;(w.value!==void 0&&w.value===J||ae)&&F(Y)},[w.value]),K=r==="popper"?qS:t6,oe=K===qS?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:y}:{};return v.jsx(J3,{scope:n,content:_,viewport:C,onViewportChange:R,itemRefCallback:U,selectedItem:M,onItemLeave:O,itemTextRefCallback:ee,focusSelectedItem:V,selectedItemText:j,position:r,isPositioned:Q,searchRef:I,children:v.jsx(kp,{as:ea,allowPinchZoom:!0,children:v.jsx(Tp,{asChild:!0,trapped:w.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Pe(i,Y=>{var J;(J=w.trigger)==null||J.focus({preventScroll:!0}),Y.preventDefault()}),children:v.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:v.jsx(K,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Y=>Y.preventDefault(),...x,...oe,onPlaced:()=>H(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Pe(x.onKeyDown,Y=>{const J=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!J&&Y.key.length===1&&q(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let ae=$().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const ge=Y.target,ne=ae.indexOf(ge);ae=ae.slice(ne+1)}setTimeout(()=>G(ae)),Y.preventDefault()}})})})})})})});e6.displayName=dhe;var fhe="SelectItemAlignedPosition",t6=P.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=sl(Rc,n),s=al(Rc,n),[a,l]=P.useState(null),[c,u]=P.useState(null),d=it(t,T=>u(T)),p=v0(n),h=P.useRef(!1),m=P.useRef(!0),{viewport:b,selectedItem:y,selectedItemText:x,focusSelectedItem:w}=s,_=P.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&b&&y&&x){const T=o.trigger.getBoundingClientRect(),M=c.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),j=x.getBoundingClientRect();if(o.dir!=="rtl"){const ge=j.left-M.left,ne=N.left-ge,fe=T.left-ne,he=T.width+fe,_e=Math.max(he,M.width),Ae=window.innerWidth-_o,Le=US(ne,[_o,Math.max(_o,Ae-_e)]);a.style.minWidth=he+"px",a.style.left=Le+"px"}else{const ge=M.right-j.right,ne=window.innerWidth-N.right-ge,fe=window.innerWidth-T.right-ne,he=T.width+fe,_e=Math.max(he,M.width),Ae=window.innerWidth-_o,Le=US(ne,[_o,Math.max(_o,Ae-_e)]);a.style.minWidth=he+"px",a.style.right=Le+"px"}const F=p(),$=window.innerHeight-_o*2,Q=b.scrollHeight,H=window.getComputedStyle(c),L=parseInt(H.borderTopWidth,10),G=parseInt(H.paddingTop,10),V=parseInt(H.borderBottomWidth,10),B=parseInt(H.paddingBottom,10),X=L+G+Q+B+V,I=Math.min(y.offsetHeight*5,X),q=window.getComputedStyle(b),U=parseInt(q.paddingTop,10),O=parseInt(q.paddingBottom,10),ee=T.top+T.height/2-_o,K=$-ee,oe=y.offsetHeight/2,Y=y.offsetTop+oe,J=L+G+Y,se=X-J;if(J<=ee){const ge=F.length>0&&y===F[F.length-1].ref.current;a.style.bottom="0px";const ne=c.clientHeight-b.offsetTop-b.offsetHeight,fe=Math.max(K,oe+(ge?O:0)+ne+V),he=J+fe;a.style.height=he+"px"}else{const ge=F.length>0&&y===F[0].ref.current;a.style.top="0px";const fe=Math.max(ee,L+b.offsetTop+(ge?U:0)+oe)+se;a.style.height=fe+"px",b.scrollTop=J-ee+b.offsetTop}a.style.margin=`${_o}px 0`,a.style.minHeight=I+"px",a.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,o.trigger,o.valueNode,a,c,b,y,x,o.dir,r]);yr(()=>_(),[_]);const[E,C]=P.useState();yr(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const R=P.useCallback(T=>{T&&m.current===!0&&(_(),w==null||w(),m.current=!1)},[_,w]);return v.jsx(phe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:R,children:v.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:v.jsx(Fe.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});t6.displayName=fhe;var hhe="SelectPopperPosition",qS=P.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_o,...o}=e,s=x0(n);return v.jsx(_p,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});qS.displayName=hhe;var[phe,UE]=Bd(Rc,{}),YS="SelectViewport",n6=P.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=al(YS,n),s=UE(YS,n),a=it(t,o.onViewportChange),l=P.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),v.jsx(y0.Slot,{scope:n,children:v.jsx(Fe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Pe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=s;if(p!=null&&p.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const m=window.innerHeight-_o*2,b=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),x=Math.max(b,y);if(x<m){const w=x+h,_=Math.min(m,w),E=w-_;d.style.height=_+"px",d.style.bottom==="0px"&&(u.scrollTop=E>0?E:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});n6.displayName=YS;var r6="SelectGroup",[ghe,mhe]=Bd(r6),i6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Yn();return v.jsx(ghe,{scope:n,id:i,children:v.jsx(Fe.div,{role:"group","aria-labelledby":i,...r,ref:t})})});i6.displayName=r6;var o6="SelectLabel",s6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=mhe(o6,n);return v.jsx(Fe.div,{id:i.id,...r,ref:t})});s6.displayName=o6;var Jb="SelectItem",[bhe,a6]=Bd(Jb),l6=P.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=sl(Jb,n),l=al(Jb,n),c=a.value===r,[u,d]=P.useState(o??""),[p,h]=P.useState(!1),m=it(t,w=>{var _;return(_=l.itemRefCallback)==null?void 0:_.call(l,w,r,i)}),b=Yn(),y=P.useRef("touch"),x=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(bhe,{scope:n,value:r,disabled:i,textId:b,isSelected:c,onItemTextChange:P.useCallback(w=>{d(_=>_||((w==null?void 0:w.textContent)??"").trim())},[]),children:v.jsx(y0.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:v.jsx(Fe.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:m,onFocus:Pe(s.onFocus,()=>h(!0)),onBlur:Pe(s.onBlur,()=>h(!1)),onClick:Pe(s.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:Pe(s.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:Pe(s.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:Pe(s.onPointerMove,w=>{var _;y.current=w.pointerType,i?(_=l.onItemLeave)==null||_.call(l):y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(s.onPointerLeave,w=>{var _;w.currentTarget===document.activeElement&&((_=l.onItemLeave)==null||_.call(l))}),onKeyDown:Pe(s.onKeyDown,w=>{var E;((E=l.searchRef)==null?void 0:E.current)!==""&&w.key===" "||(ihe.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});l6.displayName=Jb;var Qf="SelectItemText",c6=P.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=sl(Qf,n),a=al(Qf,n),l=a6(Qf,n),c=lhe(Qf,n),[u,d]=P.useState(null),p=it(t,x=>d(x),l.onItemTextChange,x=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,x,l.value,l.disabled)}),h=u==null?void 0:u.textContent,m=P.useMemo(()=>v.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=c;return yr(()=>(b(m),()=>y(m)),[b,y,m]),v.jsxs(v.Fragment,{children:[v.jsx(Fe.span,{id:l.textId,...o,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?mc.createPortal(o.children,s.valueNode):null]})});c6.displayName=Qf;var u6="SelectItemIndicator",d6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a6(u6,n).isSelected?v.jsx(Fe.span,{"aria-hidden":!0,...r,ref:t}):null});d6.displayName=u6;var KS="SelectScrollUpButton",f6=P.forwardRef((e,t)=>{const n=al(KS,e.__scopeSelect),r=UE(KS,e.__scopeSelect),[i,o]=P.useState(!1),s=it(t,r.onScrollButtonChange);return yr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?v.jsx(p6,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});f6.displayName=KS;var XS="SelectScrollDownButton",h6=P.forwardRef((e,t)=>{const n=al(XS,e.__scopeSelect),r=UE(XS,e.__scopeSelect),[i,o]=P.useState(!1),s=it(t,r.onScrollButtonChange);return yr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;o(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?v.jsx(p6,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});h6.displayName=XS;var p6=P.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=al("SelectScrollButton",n),s=P.useRef(null),a=v0(n),l=P.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return P.useEffect(()=>()=>l(),[l]),yr(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),v.jsx(Fe.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Pe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Pe(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Pe(i.onPointerLeave,()=>{l()})})}),yhe="SelectSeparator",g6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return v.jsx(Fe.div,{"aria-hidden":!0,...r,ref:t})});g6.displayName=yhe;var QS="SelectArrow",vhe=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=x0(n),o=sl(QS,n),s=al(QS,n);return o.open&&s.position==="popper"?v.jsx(Cp,{...i,...r,ref:t}):null});vhe.displayName=QS;function m6(e){return e===""||e===void 0}var b6=P.forwardRef((e,t)=>{const{value:n,...r}=e,i=P.useRef(null),o=it(t,i),s=g0(n);return P.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),v.jsx(IE,{asChild:!0,children:v.jsx("select",{...r,ref:o,defaultValue:n})})});b6.displayName="BubbleSelect";function y6(e){const t=tr(e),n=P.useRef(""),r=P.useRef(0),i=P.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=P.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function v6(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=xhe(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function xhe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var whe=U3,x6=q3,She=K3,_he=X3,Che=Q3,w6=Z3,Ehe=n6,Rhe=i6,S6=s6,_6=l6,Phe=c6,The=d6,C6=f6,E6=h6,R6=g6;const Bs=whe,vu=Rhe,Hs=She,Uo=P.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(x6,{ref:r,className:me("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,v.jsx(_he,{asChild:!0,children:v.jsx(mp,{className:"h-4 w-4 opacity-50"})})]}));Uo.displayName=x6.displayName;const P6=P.forwardRef(({className:e,...t},n)=>v.jsx(C6,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(eL,{className:"h-4 w-4"})}));P6.displayName=C6.displayName;const T6=P.forwardRef(({className:e,...t},n)=>v.jsx(E6,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(mp,{className:"h-4 w-4"})}));T6.displayName=E6.displayName;const Go=P.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>v.jsx(Che,{children:v.jsx(Dc,{children:v.jsxs(w6,{ref:i,className:me("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[v.jsx(P6,{}),v.jsx(Ehe,{className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),v.jsx(T6,{})]})})}));Go.displayName=w6.displayName;const Ll=P.forwardRef(({className:e,...t},n)=>v.jsx(S6,{ref:n,className:me("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ll.displayName=S6.displayName;const Dn=P.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(_6,{ref:r,className:me("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(The,{children:v.jsx(Md,{className:"h-4 w-4"})})}),v.jsx(Phe,{children:t})]}));Dn.displayName=_6.displayName;const gh=P.forwardRef(({className:e,...t},n)=>v.jsx(R6,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));gh.displayName=R6.displayName;const dc=P.forwardRef(({className:e,type:t,...n},r)=>v.jsx("input",{type:t,className:me("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));dc.displayName="Input";var khe="Label",k6=P.forwardRef((e,t)=>v.jsx(Fe.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));k6.displayName=khe;var A6=k6;const Ahe=FE("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Sn=P.forwardRef(({className:e,...t},n)=>v.jsx(A6,{ref:n,className:me(Ahe(),e),...t}));Sn.displayName=A6.displayName;var GE="Popover",[O6,UAe]=rr(GE,[ws]),Op=ws(),[Ohe,ll]=O6(GE),M6=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=Op(t),l=P.useRef(null),[c,u]=P.useState(!1),[d=!1,p]=Dr({prop:r,defaultProp:i,onChange:o});return v.jsx(Sp,{...a,children:v.jsx(Ohe,{scope:t,contentId:Yn(),triggerRef:l,open:d,onOpenChange:p,onOpenToggle:P.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:P.useCallback(()=>u(!0),[]),onCustomAnchorRemove:P.useCallback(()=>u(!1),[]),modal:s,children:n})})};M6.displayName=GE;var I6="PopoverAnchor",Mhe=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ll(I6,n),o=Op(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=i;return P.useEffect(()=>(s(),()=>a()),[s,a]),v.jsx($d,{...o,...r,ref:t})});Mhe.displayName=I6;var D6="PopoverTrigger",N6=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ll(D6,n),o=Op(n),s=it(t,i.triggerRef),a=v.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":z6(i.open),...r,ref:s,onClick:Pe(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:v.jsx($d,{asChild:!0,...o,children:a})});N6.displayName=D6;var qE="PopoverPortal",[Ihe,Dhe]=O6(qE,{forceMount:void 0}),L6=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=ll(qE,t);return v.jsx(Ihe,{scope:t,forceMount:n,children:v.jsx(Kn,{present:n||o.open,children:v.jsx(Ep,{asChild:!0,container:i,children:r})})})};L6.displayName=qE;var _d="PopoverContent",F6=P.forwardRef((e,t)=>{const n=Dhe(_d,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=ll(_d,e.__scopePopover);return v.jsx(Kn,{present:r||o.open,children:o.modal?v.jsx(Nhe,{...i,ref:t}):v.jsx(Lhe,{...i,ref:t})})});F6.displayName=_d;var Nhe=P.forwardRef((e,t)=>{const n=ll(_d,e.__scopePopover),r=P.useRef(null),i=it(t,r),o=P.useRef(!1);return P.useEffect(()=>{const s=r.current;if(s)return m0(s)},[]),v.jsx(kp,{as:ea,allowPinchZoom:!0,children:v.jsx(j6,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Lhe=P.forwardRef((e,t)=>{const n=ll(_d,e.__scopePopover),r=P.useRef(!1),i=P.useRef(!1);return v.jsx(j6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),j6=P.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,p=ll(_d,n),h=Op(n);return p0(),v.jsx(Tp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:v.jsx(zc,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:v.jsx(_p,{"data-state":z6(p.open),role:"dialog",id:p.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),$6="PopoverClose",Fhe=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ll($6,n);return v.jsx(Fe.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,()=>i.onOpenChange(!1))})});Fhe.displayName=$6;var jhe="PopoverArrow",$he=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Op(n);return v.jsx(Cp,{...i,...r,ref:t})});$he.displayName=jhe;function z6(e){return e?"open":"closed"}var zhe=M6,Bhe=N6,Hhe=L6,B6=F6;const w0=zhe,S0=Bhe,Mp=P.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>v.jsx(Hhe,{children:v.jsx(Dc,{children:v.jsx(B6,{ref:i,align:t,sideOffset:n,className:me("z-49 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})}));Mp.displayName=B6.displayName;function Vhe(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 H6({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function i(s){const a=[...e];a.splice(s,1),t(a)}function o(){t([...e,n])}return v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Sn,{children:"Color Range"}),v.jsx(nr,{onClick:o,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:v.jsx(qy,{className:"size-3"})})]}),e.map((s,a)=>v.jsxs("div",{className:"flex items-center gap-2 px-2",children:[v.jsx(dc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:me(`h-7 ${nh}`)}),v.jsx("span",{children:"-"}),v.jsx(dc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:me(`h-7 ${nh}`)}),v.jsx(dc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:me(`h-7 min-w-14 p-0 ${nh}`),type:"color",list:"presetColors"}),v.jsxs("datalist",{id:"presetColors",children:[v.jsx("option",{children:$t.green[600]}),v.jsx("option",{children:$t.red[500]}),v.jsx("option",{children:$t.yellow[400]}),v.jsx("option",{children:$t.orange[500]})]}),v.jsx(nr,{onClick:()=>i(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:v.jsx(jc,{className:"size-3"})})]},a))]})}var Whe="Toggle",V6=P.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:i,...o}=e,[s=!1,a]=Dr({prop:n,onChange:i,defaultProp:r});return v.jsx(Fe.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:Pe(e.onClick,()=>{e.disabled||a(!s)})})});V6.displayName=Whe;var W6=V6;const Uhe=FE("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"}}),_0=P.forwardRef(({className:e,variant:t,size:n,...r},i)=>v.jsx(W6,{ref:i,className:me(Uhe({variant:t,size:n,className:e})),...r}));_0.displayName=W6.displayName;function Ghe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return n==null?void 0:n.type}function qhe(e,t){var r,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return((i=n==null?void 0:n.options)==null?void 0:i.locale)||"en-US"}function Yhe(e,t){var r,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t&&o.type==="date");return((i=n==null?void 0:n.options)==null?void 0:i.format)||"short-date-time"}function Khe(e,t){var r,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return(i=n==null?void 0:n.options)==null?void 0:i.currency}function Xhe(e,t){var r,i,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((o=(i=n==null?void 0:n.options)==null?void 0:i.options)==null?void 0:o.minimumFractionDigits)||0}function Qhe(e,t){var r,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return((i=n==null?void 0:n.options)==null?void 0:i.colorRanges)||[]}function Zhe(e,t){var r,i,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((o=(i=n==null?void 0:n.options)==null?void 0:i.options)==null?void 0:o.style)==="percent"}function Jhe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return n==null?void 0:n.textAlign}function epe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return n==null?void 0:n.width}function tpe({columnIndex:e,columnName:t}){const[n,r]=k.useState(!1),i=fi(H=>{var L;return(L=H.card)==null?void 0:L.preferences}),[o,s]=k.useState(Ghe(i,e)),[a,l]=k.useState(Jhe(i,e)),[c,u]=k.useState(epe(i,e)),[d,p]=k.useState(Qhe(i,e)),[h,m]=k.useState(qhe(i,e)),[b,y]=k.useState(Yhe(i,e)),[x,w]=k.useState(Khe(i,e)),[_,E]=k.useState(Xhe(i,e).toString()),[C,R]=k.useState(Zhe(i,e));k.useState("");const T=fi(H=>H.actions.setCardPreferences);function M(){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[v.jsx(Sn,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),v.jsxs(Bs,{value:a||"left",onValueChange:H=>l(H),children:[v.jsx(Uo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:v.jsx(Hs,{})}),v.jsxs(Go,{children:[v.jsx(Dn,{value:"left",children:"Left"}),v.jsx(Dn,{value:"center",children:"Center"}),v.jsx(Dn,{value:"right",children:"Right"})]})]})]}),v.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[v.jsx(Sn,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),v.jsx(dc,{placeholder:"Auto",value:c?c.toString():"",className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",onChange:H=>{H.target.value===""?u(void 0):u(Number(H.target.value))}})]})]})}function N(){const H=[...new Set(w1.map(L=>L.currency))];return v.jsx(v.Fragment,{children:v.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[v.jsx(Sn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),v.jsxs(Bs,{value:h,onValueChange:L=>m(L),children:[v.jsx(Uo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:v.jsx(Hs,{})}),v.jsx(Go,{children:v.jsxs(vu,{children:[v.jsx(Ll,{children:"Locale"}),w1.map(L=>v.jsx(Dn,{value:L.locale,children:L.locale},L.locale))]})})]}),v.jsx(Sn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),v.jsxs(Bs,{value:x||"none",onValueChange:L=>w(L==="none"?void 0:L),children:[v.jsx(Uo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:v.jsx(Hs,{})}),v.jsx(Go,{children:v.jsxs(vu,{children:[v.jsx(Ll,{children:"Currency"}),v.jsx(Dn,{value:"none",children:"None"}),H.map(L=>v.jsx(Dn,{value:L,children:L},L))]})})]}),v.jsx(Sn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),v.jsxs(Bs,{value:_,onValueChange:L=>E(L),children:[v.jsx(Uo,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:v.jsx(Hs,{})}),v.jsx(Go,{children:["0","1","2","3","4"].map(L=>v.jsx(Dn,{value:L,children:L},L))})]}),!x&&v.jsx(_0,{onPressedChange:L=>R(L),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:v.jsx(fL,{className:"size-3"})})]})})}function j(){return v.jsx(v.Fragment,{children:v.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[v.jsx(Sn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),v.jsxs(Bs,{defaultValue:"en-US",value:h,onValueChange:H=>m(H),children:[v.jsx(Uo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:v.jsx(Hs,{})}),v.jsx(Go,{children:YK.map(H=>v.jsxs(vu,{children:[v.jsx(Ll,{children:H.label}),H.locales.map(L=>v.jsx(Dn,{value:L.code,children:L.name},L.code))]},H.label))})]}),v.jsx(Sn,{className:"col-span-3",htmlFor:"format",children:"Format"}),v.jsxs(Bs,{defaultValue:"short-date-time",value:b,onValueChange:H=>{console.log("format",H),y(H)},children:[v.jsx(Uo,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:v.jsx(Hs,{})}),v.jsx(Go,{className:"",id:"type",children:v.jsxs(vu,{children:[v.jsx(Ll,{children:"Option"}),v.jsx(Dn,{value:"full-date-time",children:"Full Date-Time"}),v.jsx(Dn,{value:"short-date-time",children:"Short Date-Time"}),v.jsx(Dn,{value:"hours-date-time",children:"24-Hour Date-Time"}),v.jsx(Dn,{value:"short-date",children:"Short Date"}),v.jsx(Dn,{value:"long-date",children:"Long Date"})]})})]})]})})}function F(){T({...i,columnSettings:[]})}function $(){var H;T({...i,columnSettings:[...((H=i==null?void 0:i.columnSettings)==null?void 0:H.filter(L=>L.columnIdx!==e))||[]]})}function Q(){var H,L,G,V;if(o==="date"){const B=Vhe(h,b),X={columnIdx:e,type:o,options:B};T({...i,columnSettings:[...((H=i==null?void 0:i.columnSettings)==null?void 0:H.filter(I=>I.columnIdx!==e))||[],X]})}else if(o==="number"){let B;x?B={locale:h,currency:x,options:{style:"currency",currency:x,minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0}:B={locale:h,currency:void 0,options:{style:C?"percent":"decimal",minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0};const X={columnIdx:e,type:o,textAlign:a,width:c,options:B};T({...i,columnSettings:[...((L=i==null?void 0:i.columnSettings)==null?void 0:L.filter(I=>I.columnIdx!==e))||[],X]})}else if(o==="html"){const B={columnIdx:e,type:o,options:{html:""}};T({...i,columnSettings:[...((G=i==null?void 0:i.columnSettings)==null?void 0:G.filter(X=>X.columnIdx!==e))||[],B]})}else{const B={columnIdx:e,type:"none",textAlign:a,width:c,options:{}};T({...i,columnSettings:[...((V=i==null?void 0:i.columnSettings)==null?void 0:V.filter(X=>X.columnIdx!==e))||[],B]})}}return v.jsxs(w0,{onOpenChange:H=>r(H),children:[v.jsx(S0,{asChild:!0,children:v.jsx(dL,{className:"size-3 cursor-pointer text-muted"})}),v.jsx(Mp,{align:"center",className:"max-w-70 z-20",children:v.jsxs("div",{className:"grid gap-4",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),v.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),v.jsxs("div",{className:"grid gap-2",children:[v.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[v.jsx(Sn,{htmlFor:"scale",children:"Type"}),v.jsxs(Bs,{value:o||"none",onValueChange:H=>s(H),children:[v.jsx(Uo,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:v.jsx(Hs,{})}),v.jsx(Go,{id:"type",children:v.jsxs(vu,{children:[v.jsx(Ll,{children:"Option"}),v.jsx(Dn,{value:"number",children:"Number"}),v.jsx(Dn,{value:"date",children:"Date"}),v.jsx(Dn,{value:"html",children:"HTML"}),v.jsx(Dn,{value:"none",children:"None"})]})})]})]}),M(),v.jsx(gh,{}),o==="number"&&N(),o==="date"&&j(),o==="number"&&v.jsxs(v.Fragment,{children:[v.jsx(gh,{}),v.jsx(H6,{colorRanges:d,setColorRanges:p})]}),v.jsx(gh,{}),v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx(nr,{onClick:F,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),v.jsx(nr,{onClick:$,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),v.jsx(nr,{onClick:Q,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function npe(e){const t=new Date(e);return!isNaN(t.getTime())}function U6({data:e,card:t}){var E,C,R,T;const[n,r]=k.useState([]),{keys:i}=lr(e),o=ye(M=>M.filteringCards),s=ye(M=>M.themeStyle),a=ye(M=>M.isVisualEditing),l=o==null?void 0:o.find(M=>M.id===t.id),c=(E=t==null?void 0:t.preferences)==null?void 0:E.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:d,removeFilterValues:p,removeFilteringCard:h}=Vn(),m=t==null?void 0:t.preferences;function b(M,N){if((N==null?void 0:N.type)==="date"&&npe(M)){const{locale:j,options:F}=N.options,$=new Date(M);return new Date($.getTime()).toLocaleDateString(j,F)}if((N==null?void 0:N.type)==="number"){const{locale:j,currency:F,options:$}=N.options;return F?new Intl.NumberFormat(j,{style:"currency",currency:F,...$}).format(M):new Intl.NumberFormat(j,$).format(M)}if((N==null?void 0:N.type)==="html"){const j=jS.sanitize(M);return v.jsx("div",{className:"hover:underline",dangerouslySetInnerHTML:{__html:j}})}return M}const y=i.map((M,N)=>({accessorKey:M,header:({column:j})=>{var V;const F=j.getIsSorted(),$=N,Q=(V=m==null?void 0:m.columnSettings)==null?void 0:V.find(B=>B.columnIdx===$),H=Q==null?void 0:Q.textAlign,L=Q==null?void 0:Q.width,G=L?{width:L}:{};return v.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[v.jsxs("div",{className:me("flex grow cursor-pointer items-center",{"justify-center":H==="center","justify-end":H==="right","justify-start":H==="left"}),style:G,onClick:()=>j.toggleSorting(j.getIsSorted()==="asc"),children:[M,F==="asc"?v.jsx(X5,{className:"ml-2 h-5 w-5"}):F==="desc"?v.jsx(K5,{className:"ml-2 h-5 w-5"}):null]}),v.jsx("div",{className:"opacity-0 group-hover:opacity-100",children:a&&v.jsx(tpe,{columnName:j.id,columnIndex:N})})]})},cell:({cell:j})=>{var G,V;const F=j.getValue(),$=(G=m==null?void 0:m.columnSettings)==null?void 0:G.find(B=>B.columnIdx===N),Q=b(F,$),H=VC(F,(V=$==null?void 0:$.options)==null?void 0:V.colorRanges),L=$==null?void 0:$.textAlign;return $!=null&&$.width&&$.width,v.jsx("p",{title:Q,className:me("overflow-auto px-2 py-1",{"text-center":L==="center","text-right":L==="right","text-left":L==="left"}),style:{backgroundColor:H},children:Q})}})),x=N3({data:e,columns:y,getCoreRowModel:M3(),getPaginationRowModel:I3(),onSortingChange:r,getSortedRowModel:D3(),manualPagination:!0,state:{sorting:n}}),w=x.getSelectedRowModel().rows;k.useEffect(()=>{if(w.length===0){if(l){const M=t.id;p(M),h(t)}return}if(c){const{dimensionKeys:M}=lr(e),N=c.map(j=>{const F=M==null?void 0:M[j.columnIndex],$=w.map(H=>H.getValue(F));return{filterId:t.id+"-"+F,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:F,expression:j.expression,valueType:Ey($[0]===void 0?"":$[0]),operation:"in",values:$}});u(N),d(t)}},[d,u,t,e,l,c,p,h,w]);function _(M){M.toggleSelected()}return v.jsx("div",{className:"rounded-md text-sm text-foreground/80",style:{borderTopRightRadius:(C=s==null?void 0:s.chart)==null?void 0:C.options.borderRadius,borderTopLeftRadius:(R=s==null?void 0:s.chart)==null?void 0:R.options.borderRadius},children:v.jsxs("table",{className:"w-full",onMouseDown:M=>M.stopPropagation(),children:[v.jsx(jE,{className:"group",children:x.getHeaderGroups().map(M=>v.jsx(hh,{children:M.headers.map((N,j)=>{var F,$,Q,H,L,G,V;return v.jsx(zE,{style:{backgroundColor:(Q=($=(F=s==null?void 0:s.chart)==null?void 0:F.dataset)==null?void 0:$.backgroundColor)==null?void 0:Q[0],color:sd((G=(L=(H=s==null?void 0:s.chart)==null?void 0:H.dataset)==null?void 0:L.backgroundColor)==null?void 0:G[0])},className:me("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":j>0&&j<M.headers.length-1,"border-l":j===1&&M.headers.length==2},(V=s==null?void 0:s.table)==null?void 0:V.tableHeaderColor),children:N.isPlaceholder?null:WS(N.column.columnDef.header,N.getContext())},N.id)})},M.id))}),v.jsx($E,{children:(T=x.getRowModel().rows)!=null&&T.length?x.getRowModel().rows.map((M,N)=>v.jsx(hh,{onClick:()=>_(M),className:me("whitespace-nowrap p-1",{"cursor-pointer data-[state=selected]:border-2 data-[state=selected]:border-dashed":c&&(c==null?void 0:c.length)>0}),"data-state":M.getIsSelected()&&"selected",children:M.getVisibleCells().map((j,F)=>{var L,G;const $=(L=m==null?void 0:m.columnSettings)==null?void 0:L.find(V=>V.columnIdx===F),Q=$==null?void 0:$.width,H=Q?{width:Q,maxWidth:Q}:{};return v.jsx("td",{style:H,onClick:V=>{var X;const B=((X=window==null?void 0:window.getSelection())==null?void 0:X.toString())||"";(B==null?void 0:B.length)>0&&V.stopPropagation()},className:me("",{"border-x":F>0&&F<y.length-1||F===1&&y.length==2,"border-l":F==0,"border-r":F===y.length-1,"border-b":N===((G=x.getRowModel().rows)==null?void 0:G.length)-1}),children:WS(j.column.columnDef.cell,j.getContext())},j.id)})},M.id)):v.jsx(hh,{children:v.jsx(BE,{colSpan:y.length,className:"p-1 text-center",children:"No results."})})})]})})}async function rpe(e,t){const n=`${e}/index.js`,r=`${e}/style.css`;return document.querySelector(`link[href="${r}"]`)||await new Promise((o,s)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=r,a.onload=()=>o(void 0),a.onerror=()=>s(new Error("Failed to load CSS")),document.head.appendChild(a)}),{default:(await import(n))[t]}}async function ipe(e){try{const t=await import(e),n=Object.keys(t),r=[];return n.forEach(i=>{typeof t[i]=="function"&&(i==null?void 0:i[0])===(i==null?void 0:i[0].toUpperCase())&&r.push({name:i,component:i})}),r}catch(t){return console.error("Error loading the library:",t),[]}}async function G6(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 q6=e=>{const[t,n]=k.useState([]),[r,i]=k.useState(!1),[o,s]=k.useState(null);k.useEffect(()=>{window.React=k,window.ReactDOM=Ar,i(!0)},[]),k.useEffect(()=>{e&&r&&G6(e).then(c=>{n(c.visuals),s(c)}).catch(()=>{ipe(e).then(c=>{console.log("componentNames",c),n(c)}).catch(c=>{console.error("Error loading manifest:",c)})})},[e,r]);const a=k.useMemo(()=>(t==null?void 0:t.map(c=>{const{name:u,component:d,dataInputs:p}=c;return{name:u,componentName:d,Component:k.lazy(()=>rpe(e,d)),type:p&&p.length>1?"multiple":"single"}}))||[],[t,e]);function l(c){const u=a==null?void 0:a.find(d=>d.name===c);return u?u.Component:null}return{getCard:l,components:a,manifest:o}};function Y6({onLoadingStatus:e,onDataChange:t,card:n}){const{isFetching:r,isLoading:i,data:o,queryKey:s}=Ga(n),a=JSON.stringify(s);return k.useEffect(()=>{e==null||e(i)},[r,i,e]),k.useEffect(()=>{t(n.id,(o==null?void 0:o.records)||[])},[o==null?void 0:o.records,n.id,a,t]),v.jsx(v.Fragment,{})}function ope({card:e,frame:t}){var w,_,E,C,R,T,M,N;const[n,r]=k.useState([]),{authToken:i}=Wi(),o=SN(i==null?void 0:i.accessToken),s=ye(j=>j.themeStyle),a={colors:((_=(w=s==null?void 0:s.chart)==null?void 0:w.dataset)==null?void 0:_.backgroundColor)||[]},[l,c]=k.useState(!1),{getCard:u}=q6(((E=e.customCardPreferences)==null?void 0:E.url)||""),d=((C=e.customCardPreferences)==null?void 0:C.visualType)||"single",p=(R=e.customCardPreferences)==null?void 0:R.componentName,{data:h}=Ga(e),m=k.useCallback((j,F)=>{r($=>({...$,[j]:F}))},[]);if(!p)return null;const b=u(p),y=Object.keys(((T=e.customCardPreferences)==null?void 0:T.dataInputCardIds)||{}).map(j=>{var Q,H,L;const F=(H=(Q=e.customCardPreferences)==null?void 0:Q.dataInputCardIds)==null?void 0:H[j].cardId,$=(L=t==null?void 0:t.cards)==null?void 0:L.find(G=>G.id===F);return $||null});function x(j){c(j)}return v.jsx("div",{className:"semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto",children:v.jsxs(k.Suspense,{fallback:v.jsx(v.Fragment,{}),children:[b&&d==="single"&&v.jsx(b,{params:o,theme:a,settings:(M=e.customCardPreferences)==null?void 0:M.settings,onDataChange:m,data:(h==null?void 0:h.records)||[]}),b&&d==="multiple"&&v.jsxs("div",{children:[Object.keys(((N=e.customCardPreferences)==null?void 0:N.dataInputCardIds)||{}).map(j=>{var Q,H,L;const F=(H=(Q=e.customCardPreferences)==null?void 0:Q.dataInputCardIds)==null?void 0:H[j].cardId,$=(L=t==null?void 0:t.cards)==null?void 0:L.find(G=>G.id===F);if($)return v.jsx(Y6,{onLoadingStatus:x,onDataChange:m,dataInputIndex:j,card:$},$.id+j)}),d==="multiple"&&v.jsx("div",{className:me("flex flex-col gap-2",{"opacity-50":l}),children:v.jsx(b,{params:o,theme:a,onDataChange:m,settings:y.map(j=>{var F;return(F=j==null?void 0:j.customCardPreferences)==null?void 0:F.settings}),data:y.map(j=>j!=null&&j.id?n==null?void 0:n[j.id]:[])})})]})]},e.id)})}/*!
378
- * chartjs-plugin-datalabels v2.2.0
379
- * https://chartjs-plugin-datalabels.netlify.app
380
- * (c) 2017-2022 chartjs-plugin-datalabels contributors
381
- * Released under the MIT license
382
- */var VM=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),mh={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
383
- `)):Array.isArray(n)?e.push.apply(e,n):Rt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),i=r.length,o=e.font,s=0,a;for(e.font=n.string,a=0;a<i;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=o,{height:i*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],i,o,s,a;for(i=0,s=t.length;i<s;++i)a=t[i],o=n.indexOf(a),o===-1?r.push([a,1]):n.splice(o,1);for(i=0,s=n.length;i<s;++i)r.push([n[i],-1]);return r},rasterize:function(e){return Math.round(e*VM)/VM}};function Sw(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var i=e.x-n,o=e.y-r,s=Math.sqrt(i*i+o*o);return{x:s?i/s:0,y:s?o/s:-1}}function spe(e,t,n,r,i){switch(i){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:i*=Math.PI/180,n=Math.cos(i),r=Math.sin(i);break}return{x:e,y:t,vx:n,vy:r}}var ape=0,K6=1,X6=2,Q6=4,Z6=8;function Tm(e,t,n){var r=ape;return e<n.left?r|=K6:e>n.right&&(r|=X6),t<n.top?r|=Z6:t>n.bottom&&(r|=Q6),r}function lpe(e,t){for(var n=e.x0,r=e.y0,i=e.x1,o=e.y1,s=Tm(n,r,t),a=Tm(i,o,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&Z6?(c=n+(i-n)*(t.top-r)/(o-r),u=t.top):l&Q6?(c=n+(i-n)*(t.bottom-r)/(o-r),u=t.bottom):l&X6?(u=r+(o-r)*(t.right-n)/(i-n),c=t.right):l&K6&&(u=r+(o-r)*(t.left-n)/(i-n),c=t.left),l===s?(n=c,r=u,s=Tm(n,r,t)):(i=c,o=u,a=Tm(i,o,t));return{x0:n,x1:i,y0:r,y1:o}}function km(e,t){var n=t.anchor,r=e,i,o;return t.clamp&&(r=lpe(r,t.area)),n==="start"?(i=r.x0,o=r.y0):n==="end"?(i=r.x1,o=r.y1):(i=(r.x0+r.x1)/2,o=(r.y0+r.y1)/2),spe(i,o,e.vx,e.vy,t.align)}var Am={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),i=Math.sin(n),o=e.innerRadius,s=e.outerRadius;return km({x0:e.x+r*o,y0:e.y+i*o,x1:e.x+r*s,y1:e.y+i*s,vx:r,vy:i},t)},point:function(e,t){var n=Sw(e,t.origin),r=n.x*e.options.radius,i=n.y*e.options.radius;return km({x0:e.x-r,y0:e.y-i,x1:e.x+r,y1:e.y+i,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=Sw(e,t.origin),r=e.x,i=e.y,o=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),o=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),km({x0:r,y0:i+s,x1:r+o,y1:i,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=Sw(e,t.origin);return km({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)}},Zs=mh.rasterize;function cpe(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,i=e.size.width,o=-i/2,s=-r/2;return{frame:{x:o-n.left-t,y:s-n.top-t,w:i+n.width+t*2,h:r+n.height+t*2},text:{x:o,y:s,w:i,h:r}}}function upe(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 dpe(e){return e instanceof _u?Am.arc:e instanceof ac?Am.point:e instanceof lc?Am.bar:Am.fallback}function fpe(e,t,n,r,i,o){var s=Math.PI/2;if(o){var a=Math.min(o,i/2,r/2),l=t+a,c=n+a,u=t+r-a,d=n+i-a;e.moveTo(t,c),l<u&&c<d?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,d,a,0,s),e.arc(l,d,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<d?(e.arc(l,c,a,-Math.PI,0),e.arc(l,d,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,i)}function hpe(e,t,n){var r=n.backgroundColor,i=n.borderColor,o=n.borderWidth;!r&&(!i||!o)||(e.beginPath(),fpe(e,Zs(t.x)+o/2,Zs(t.y)+o/2,Zs(t.w)-o,Zs(t.h)-o,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),i&&o&&(e.strokeStyle=i,e.lineWidth=o,e.lineJoin="miter",e.stroke()))}function ppe(e,t,n){var r=n.lineHeight,i=e.w,o=e.x,s=e.y+r/2;return t==="center"?o+=i/2:(t==="end"||t==="right")&&(o+=i),{h:r,w:i,x:o,y:s}}function gpe(e,t,n){var r=e.shadowBlur,i=n.stroked,o=Zs(n.x),s=Zs(n.y),a=Zs(n.w);i&&e.strokeText(t,o,s,a),n.filled&&(r&&i&&(e.shadowBlur=0),e.fillText(t,o,s,a),r&&i&&(e.shadowBlur=r))}function mpe(e,t,n,r){var i=r.textAlign,o=r.color,s=!!o,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,d=c&&u,p;if(!(!l||!s&&!d))for(n=ppe(n,i,a),e.font=a.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=o),d&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),p=0,l=t.length;p<l;++p)gpe(e,t[p],{stroked:d,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var J6=function(e,t,n,r){var i=this;i._config=e,i._index=r,i._model=null,i._rects=null,i._ctx=t,i._el=n};dr(J6.prototype,{_modelize:function(e,t,n,r){var i=this,o=i._index,s=qn(wn([n.font,{}],r,o)),a=wn([n.color,En.color],r,o);return{align:wn([n.align,"center"],r,o),anchor:wn([n.anchor,"center"],r,o),area:r.chart.chartArea,backgroundColor:wn([n.backgroundColor,null],r,o),borderColor:wn([n.borderColor,null],r,o),borderRadius:wn([n.borderRadius,0],r,o),borderWidth:wn([n.borderWidth,0],r,o),clamp:wn([n.clamp,!1],r,o),clip:wn([n.clip,!1],r,o),color:a,display:e,font:s,lines:t,offset:wn([n.offset,4],r,o),opacity:wn([n.opacity,1],r,o),origin:upe(i._el,r),padding:vr(wn([n.padding,4],r,o)),positioner:dpe(i._el),rotation:wn([n.rotation,0],r,o)*(Math.PI/180),size:mh.textSize(i._ctx,t,s),textAlign:wn([n.textAlign,"start"],r,o),textShadowBlur:wn([n.textShadowBlur,0],r,o),textShadowColor:wn([n.textShadowColor,a],r,o),textStrokeColor:wn([n.textStrokeColor,a],r,o),textStrokeWidth:wn([n.textStrokeWidth,0],r,o)}},update:function(e){var t=this,n=null,r=null,i=t._index,o=t._config,s,a,l,c=wn([o.display,!0],e,i);c&&(s=e.dataset.data[i],a=rt(cn(o.formatter,[s,e]),s),l=Rt(a)?[]:mh.toTextLines(a),l.length&&(n=t._modelize(c,l,o,e),r=cpe(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,i=n._model,o=n._rects,s;this.visible()&&(r.save(),i.clip&&(s=i.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=mh.bound(0,i.opacity,1),r.translate(Zs(t.x),Zs(t.y)),r.rotate(i.rotation),hpe(r,o.frame,i),mpe(r,i.lines,o.text,i),r.restore())}});var bpe=Number.MIN_SAFE_INTEGER||-9007199254740991,ype=Number.MAX_SAFE_INTEGER||9007199254740991;function Tf(e,t,n){var r=Math.cos(n),i=Math.sin(n),o=t.x,s=t.y;return{x:o+r*(e.x-o)-i*(e.y-s),y:s+i*(e.x-o)+r*(e.y-s)}}function WM(e,t){var n=ype,r=bpe,i=t.origin,o,s,a,l,c;for(o=0;o<e.length;++o)s=e[o],a=s.x-i.x,l=s.y-i.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function Om(e,t){var n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var ej=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};dr(ej.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=Tf(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=[Om(t[0],t[1]),Om(t[0],t[3])],i,o,s;for(this._rotation!==e._rotation&&r.push(Om(n[0],n[1]),Om(n[0],n[3])),i=0;i<r.length;++i)if(o=WM(t,r[i]),s=WM(n,r[i]),o.max<s.min||s.max<o.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Tf({x:t.x,y:t.y},r,n),Tf({x:t.x+t.w,y:t.y},r,n),Tf({x:t.x+t.w,y:t.y+t.h},r,n),Tf({x:t.x,y:t.y+t.h},r,n)]}});function tj(e,t,n){var r=t.positioner(e,t),i=r.vx,o=r.vy;if(!i&&!o)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),d=1/Math.max(Math.abs(i),Math.abs(o));return c*=i*d,u*=o*d,c+=t.offset*i,u+=t.offset*o,{x:r.x+c,y:r.y+u}}function vpe(e,t){var n,r,i,o;for(n=e.length-1;n>=0;--n)for(i=e[n].$layout,r=n-1;r>=0&&i._visible;--r)o=e[r].$layout,o._visible&&i._box.intersects(o._box)&&t(i,o);return e}function xpe(e){var t,n,r,i,o,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],i=r.$layout,i._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=r.geometry(),s=tj(a,r.model(),o),i._box.update(s,o,r.rotation()));return vpe(e,function(l,c){var u=l._hidable,d=c._hidable;u&&d||d?c._visible=!1:u&&(l._visible=!1)})}var bh={prepare:function(e){var t=[],n,r,i,o,s;for(n=0,i=e.length;n<i;++n)for(r=0,o=e[n].length;r<o;++r)s=e[n][r],t.push(s),s.$layout={_box:new ej,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,i,o,s;for(n=0,r=e.length;n<r;++n)i=e[n],o=i.model(),s=i.$layout,s._hidable=o&&o.display==="auto",s._visible=i.visible(),t|=s._hidable;t&&xpe(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,i,o,s,a;for(n=0,r=t.length;n<r;++n)i=t[n],o=i.$layout,o._visible&&(s=i.geometry(),a=tj(i._el,i.model(),s),o._box.update(a,s,i.rotation()),i.draw(e,a))}},wpe=function(e){if(Rt(e))return null;var t=e,n,r,i;if(Ot(e))if(!Rt(e.label))t=e.label;else if(!Rt(e.r))t=e.r;else for(t="",n=Object.keys(e),i=0,r=n.length;i<r;++i)t+=(i!==0?", ":"")+n[i]+": "+e[n[i]];return""+t},Spe={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:wpe,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},ci="$datalabels",nj="$default";function _pe(e,t){var n=e.datalabels,r={},i=[],o,s;return n===!1?null:(n===!0&&(n={}),t=dr({},[t,n]),o=t.labels||{},s=Object.keys(o),delete t.labels,s.length?s.forEach(function(a){o[a]&&i.push(dr({},[t,o[a],{_key:a}]))}):i.push(t),r=i.reduce(function(a,l){return en(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||nj]=c}),delete l.listeners,a},{}),{labels:i,listeners:r})}function ZS(e,t,n,r){if(t){var i=n.$context,o=n.$groups,s;t[o._set]&&(s=t[o._set][o._key],s&&cn(s,[i,r])===!0&&(e[ci]._dirty=!0,n.update(i)))}}function Cpe(e,t,n,r,i){var o,s;!n&&!r||(n?r?n!==r&&(s=o=!0):s=!0:o=!0,s&&ZS(e,t.leave,n,i),o&&ZS(e,t.enter,r,i))}function Epe(e,t){var n=e[ci],r=n._listeners,i,o;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")o=bh.lookup(n._labels,t);else if(t.type!=="mouseout")return;i=n._hovered,n._hovered=o,Cpe(e,r,i,o,t)}}function Rpe(e,t){var n=e[ci],r=n._listeners.click,i=r&&bh.lookup(n._labels,t);i&&ZS(e,r,i,t)}var Ppe={id:"datalabels",defaults:Spe,beforeInit:function(e){e[ci]={_actives:[]}},beforeUpdate:function(e){var t=e[ci];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,i=e[ci],o=i._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=_pe(a,n),c=t.meta.data||[],u=e.ctx,d,p,h,m,b,y,x,w;for(u.save(),d=0,h=c.length;d<h;++d)if(x=c[d],x[ci]=[],s&&x&&e.getDataVisibility(d)&&!x.skip)for(p=0,m=l.labels.length;p<m;++p)b=l.labels[p],y=b._key,w=new J6(b,u,x,d),w.$groups={_set:r,_key:y||nj},w.$context={active:!1,chart:e,dataIndex:d,dataset:a,datasetIndex:r},w.update(w.$context),x[ci].push(w),o.push(w);u.restore(),dr(i._listeners,l.listeners,{merger:function(_,E,C){E[_]=E[_]||{},E[_][t.index]=C[_],i._listened=!0}})},afterUpdate:function(e){e[ci]._labels=bh.prepare(e[ci]._datasets)},afterDatasetsDraw:function(e){bh.draw(e,e[ci]._labels)},beforeEvent:function(e,t){if(e[ci]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":Epe(e,n);break;case"click":Rpe(e,n);break}}},afterEvent:function(e){var t=e[ci],n=t._actives,r=t._actives=e.getActiveElements(),i=mh.arrayDiff(n,r),o,s,a,l,c,u,d;for(o=0,s=i.length;o<s;++o)if(c=i[o],c[1])for(d=c[0].element[ci]||[],a=0,l=d.length;a<l;++a)u=d[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||i.length)&&(bh.update(t._labels),e.render()),delete t._dirty}};An.register(...rse);An.register(Ppe);An.register(ac);An.register(Nd);An.register(Ld);An.register(ta);An.register($c);An.register(Xa);An.register(Qa);An.register(Ab);An.register(CF);function YE({cfg:e,onDatapointClick:t}){var d;const[n,r]=k.useState(""),i=ye(p=>p.selectedLensId),o=k.useRef(null),[s,a]=k.useState(),l=ye(p=>p.themeStyle);k.useEffect(()=>{if(o.current){const p=window.getComputedStyle(o.current);r(p.fontFamily)}},[]),k.useEffect(()=>{var b,y,x,w;if(!n)return;(y=(b=l==null?void 0:l.chart)==null?void 0:b.font)!=null&&y.family&&(An.defaults.font={...An.defaults.font,...(x=l==null?void 0:l.chart)==null?void 0:x.font,family:n});const p={...e,options:{...e.options,responsive:!0,maintainAspectRatio:!1}},h=(w=o==null?void 0:o.current)==null?void 0:w.getContext("2d");if(!h)return;let m;try{const _=cce(p,h);m=new An(h,_),a(m)}catch(_){console.log("error creating chart",_)}return()=>{m&&m.destroy()}},[(d=l==null?void 0:l.chart)==null?void 0:d.font,i,n]);function c(p){var m,b;if(!s)return;const h=s==null?void 0:s.getElementsAtEventForMode(p,"nearest",{intersect:!0},!0);if(h&&h.length>0){const y=h[0].datasetIndex,x=h[0].index,w=(b=(m=h[0].element)==null?void 0:m.$context)==null?void 0:b.raw;t==null||t(s,y,x,w)}}const u=e.type==="doughnut"||e.type==="pie";return v.jsx("div",{onClick:c,className:me("relative h-[99%]",{"mx-14":u}),children:v.jsx("canvas",{ref:o})})}function Tpe(e,t){return P.useReducer((n,r)=>t[n][r]??n,e)}var KE="ScrollArea",[rj,GAe]=rr(KE),[kpe,po]=rj(KE),ij=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,l]=P.useState(null),[c,u]=P.useState(null),[d,p]=P.useState(null),[h,m]=P.useState(null),[b,y]=P.useState(null),[x,w]=P.useState(0),[_,E]=P.useState(0),[C,R]=P.useState(!1),[T,M]=P.useState(!1),N=it(t,F=>l(F)),j=Nc(i);return v.jsx(kpe,{scope:n,type:r,dir:j,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:C,onScrollbarXEnabledChange:R,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:T,onScrollbarYEnabledChange:M,onCornerWidthChange:w,onCornerHeightChange:E,children:v.jsx(Fe.div,{dir:j,...s,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});ij.displayName=KE;var oj="ScrollAreaViewport",sj=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=po(oj,n),a=P.useRef(null),l=it(t,a,s.onViewportChange);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),v.jsx(Fe.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:v.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});sj.displayName=oj;var Ss="ScrollAreaScrollbar",XE=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=po(Ss,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return P.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?v.jsx(Ape,{...r,ref:t,forceMount:n}):i.type==="scroll"?v.jsx(Ope,{...r,ref:t,forceMount:n}):i.type==="auto"?v.jsx(aj,{...r,ref:t,forceMount:n}):i.type==="always"?v.jsx(QE,{...r,ref:t}):null});XE.displayName=Ss;var Ape=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=po(Ss,e.__scopeScrollArea),[o,s]=P.useState(!1);return P.useEffect(()=>{const a=i.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[i.scrollArea,i.scrollHideDelay]),v.jsx(Kn,{present:n||o,children:v.jsx(aj,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Ope=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=po(Ss,e.__scopeScrollArea),o=e.orientation==="horizontal",s=E0(()=>l("SCROLL_END"),100),[a,l]=Tpe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return P.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay,l]),P.useEffect(()=>{const c=i.viewport,u=o?"scrollLeft":"scrollTop";if(c){let d=c[u];const p=()=>{const h=c[u];d!==h&&(l("SCROLL"),s()),d=h};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[i.viewport,o,l,s]),v.jsx(Kn,{present:n||a!=="hidden",children:v.jsx(QE,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Pe(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Pe(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),aj=P.forwardRef((e,t)=>{const n=po(Ss,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=P.useState(!1),a=e.orientation==="horizontal",l=E0(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Cd(n.viewport,l),Cd(n.content,l),v.jsx(Kn,{present:r||o,children:v.jsx(QE,{"data-state":o?"visible":"hidden",...i,ref:t})})}),QE=P.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=po(Ss,e.__scopeScrollArea),o=P.useRef(null),s=P.useRef(0),[a,l]=P.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=fj(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function d(p,h){return Fpe(p,s.current,a,h)}return n==="horizontal"?v.jsx(Mpe,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollLeft,h=UM(p,a,i.dir);o.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=d(p,i.dir))}}):n==="vertical"?v.jsx(Ipe,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollTop,h=UM(p,a);o.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=d(p))}}):null}),Mpe=P.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=po(Ss,e.__scopeScrollArea),[s,a]=P.useState(),l=P.useRef(null),c=it(t,l,o.onScrollbarXChange);return P.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),v.jsx(cj,{"data-orientation":"horizontal",...i,ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":C0(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(o.viewport){const p=o.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),pj(p,d)&&u.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:ty(s.paddingLeft),paddingEnd:ty(s.paddingRight)}})}})}),Ipe=P.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=po(Ss,e.__scopeScrollArea),[s,a]=P.useState(),l=P.useRef(null),c=it(t,l,o.onScrollbarYChange);return P.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),v.jsx(cj,{"data-orientation":"vertical",...i,ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":C0(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(o.viewport){const p=o.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),pj(p,d)&&u.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:ty(s.paddingTop),paddingEnd:ty(s.paddingBottom)}})}})}),[Dpe,lj]=rj(Ss),cj=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...p}=e,h=po(Ss,n),[m,b]=P.useState(null),y=it(t,N=>b(N)),x=P.useRef(null),w=P.useRef(""),_=h.viewport,E=r.content-r.viewport,C=tr(u),R=tr(l),T=E0(d,10);function M(N){if(x.current){const j=N.clientX-x.current.left,F=N.clientY-x.current.top;c({x:j,y:F})}}return P.useEffect(()=>{const N=j=>{const F=j.target;(m==null?void 0:m.contains(F))&&C(j,E)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[_,m,E,C]),P.useEffect(R,[r,R]),Cd(m,T),Cd(h.content,T),v.jsx(Dpe,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:tr(o),onThumbPointerUp:tr(s),onThumbPositionChange:R,onThumbPointerDown:tr(a),children:v.jsx(Fe.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:Pe(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),x.current=m.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),M(N))}),onPointerMove:Pe(e.onPointerMove,M),onPointerUp:Pe(e.onPointerUp,N=>{const j=N.target;j.hasPointerCapture(N.pointerId)&&j.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=w.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),ey="ScrollAreaThumb",uj=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=lj(ey,e.__scopeScrollArea);return v.jsx(Kn,{present:n||i.hasThumb,children:v.jsx(Npe,{ref:t,...r})})}),Npe=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=po(ey,n),s=lj(ey,n),{onThumbPositionChange:a}=s,l=it(t,d=>s.onThumbChange(d)),c=P.useRef(void 0),u=E0(()=>{c.current&&(c.current(),c.current=void 0)},100);return P.useEffect(()=>{const d=o.viewport;if(d){const p=()=>{if(u(),!c.current){const h=jpe(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[o.viewport,u,a]),v.jsx(Fe.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Pe(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,b=d.clientY-h.top;s.onThumbPointerDown({x:m,y:b})}),onPointerUp:Pe(e.onPointerUp,s.onThumbPointerUp)})});uj.displayName=ey;var ZE="ScrollAreaCorner",dj=P.forwardRef((e,t)=>{const n=po(ZE,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?v.jsx(Lpe,{...e,ref:t}):null});dj.displayName=ZE;var Lpe=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=po(ZE,n),[o,s]=P.useState(0),[a,l]=P.useState(0),c=!!(o&&a);return Cd(i.scrollbarX,()=>{var d;const u=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(u),l(u)}),Cd(i.scrollbarY,()=>{var d;const u=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(u),s(u)}),c?v.jsx(Fe.div,{...r,ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function ty(e){return e?parseInt(e,10):0}function fj(e,t){const n=e/t;return isNaN(n)?0:n}function C0(e){const t=fj(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Fpe(e,t,n,r="ltr"){const i=C0(n),o=i/2,s=t||o,a=i-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return hj([l,c],d)(e)}function UM(e,t,n="ltr"){const r=C0(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,l=n==="ltr"?[0,s]:[s*-1,0],c=US(e,l);return hj([0,s],[0,a])(c)}function hj(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 pj(e,t){return e>0&&e<t}var jpe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function E0(e,t){const n=tr(e),r=P.useRef(0);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),P.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Cd(e,t){const n=tr(t);yr(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var gj=ij,$pe=sj,zpe=dj;const fc=P.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(gj,{ref:r,className:me("relative overflow-hidden",e),...n,children:[v.jsx($pe,{className:"h-full w-full rounded-[inherit]",children:t}),v.jsx(Ip,{}),v.jsx(zpe,{})]}));fc.displayName=gj.displayName;const Ip=P.forwardRef(({className:e,orientation:t="vertical",...n},r)=>v.jsx(XE,{ref:r,orientation:t,className:me("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:v.jsx(uj,{className:"relative flex-1 rounded-full bg-border"})}));Ip.displayName=XE.displayName;function zt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function vi(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Yr(e,t){const n=zt(e);return isNaN(t)?vi(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Do(e,t){const n=zt(e);if(isNaN(t))return vi(e,NaN);if(!t)return n;const r=n.getDate(),i=vi(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}function Bpe(e,t){const n=+zt(e);return vi(e,n+t)}const JE=6048e5,Hpe=864e5,Vpe=36e5;function GM(e,t){return Bpe(e,t*Vpe)}let Wpe={};function Dp(){return Wpe}function hs(e,t){var a,l,c,u;const n=Dp(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=zt(e),o=i.getDay(),s=(o<r?7:0)+o-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function Pc(e){return hs(e,{weekStartsOn:1})}function mj(e){const t=zt(e),n=t.getFullYear(),r=vi(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Pc(r),o=vi(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=Pc(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Ed(e){const t=zt(e);return t.setHours(0,0,0,0),t}function ny(e){const t=zt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ns(e,t){const n=Ed(e),r=Ed(t),i=+n-ny(n),o=+r-ny(r);return Math.round((i-o)/Hpe)}function Upe(e){const t=mj(e),n=vi(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Pc(n)}function JS(e,t){const n=t*7;return Yr(e,n)}function Gpe(e,t){return Do(e,t*12)}function qpe(e){let t;return e.forEach(function(n){const r=zt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function Ype(e){let t;return e.forEach(n=>{const r=zt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function mi(e,t){const n=Ed(e),r=Ed(t);return+n==+r}function eR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Kpe(e){if(!eR(e)&&typeof e!="number")return!1;const t=zt(e);return!isNaN(Number(t))}function Hh(e,t){const n=zt(e),r=zt(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function Xpe(e,t,n){const r=hs(e,n),i=hs(t,n),o=+r-ny(r),s=+i-ny(i);return Math.round((o-s)/JE)}function tR(e){const t=zt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function bi(e){const t=zt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function bj(e){const t=zt(e),n=vi(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function nR(e,t){var a,l,c,u;const n=Dp(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=zt(e),o=i.getDay(),s=(o<r?-7:0)+6-(o-r);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function yj(e){return nR(e,{weekStartsOn:1})}const Qpe={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"}},Zpe=(e,t,n)=>{let r;const i=Qpe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function _w(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Jpe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ege={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},tge={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},nge={date:_w({formats:Jpe,defaultWidth:"full"}),time:_w({formats:ege,defaultWidth:"full"}),dateTime:_w({formats:tge,defaultWidth:"full"})},rge={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ige=(e,t,n,r)=>rge[e];function kf(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[s]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const oge={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},sge={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},age={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"]},lge={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"]},cge={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"}},uge={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"}},dge=(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"},fge={ordinalNumber:dge,era:kf({values:oge,defaultWidth:"wide"}),quarter:kf({values:sge,defaultWidth:"wide",argumentCallback:e=>e-1}),month:kf({values:age,defaultWidth:"wide"}),day:kf({values:lge,defaultWidth:"wide"}),dayPeriod:kf({values:cge,defaultWidth:"wide",formattingValues:uge,defaultFormattingWidth:"wide"})};function Af(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?pge(a,d=>d.test(s)):hge(a,d=>d.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function hge(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function pge(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function gge(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(i.length);return{value:s,rest:a}}}const mge=/^(\d+)(th|st|nd|rd)?/i,bge=/\d+/i,yge={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},vge={any:[/^b/i,/^(a|c)/i]},xge={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wge={any:[/1/i,/2/i,/3/i,/4/i]},Sge={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},_ge={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]},Cge={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},Ege={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]},Rge={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},Pge={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}},Tge={ordinalNumber:gge({matchPattern:mge,parsePattern:bge,valueCallback:e=>parseInt(e,10)}),era:Af({matchPatterns:yge,defaultMatchWidth:"wide",parsePatterns:vge,defaultParseWidth:"any"}),quarter:Af({matchPatterns:xge,defaultMatchWidth:"wide",parsePatterns:wge,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Af({matchPatterns:Sge,defaultMatchWidth:"wide",parsePatterns:_ge,defaultParseWidth:"any"}),day:Af({matchPatterns:Cge,defaultMatchWidth:"wide",parsePatterns:Ege,defaultParseWidth:"any"}),dayPeriod:Af({matchPatterns:Rge,defaultMatchWidth:"any",parsePatterns:Pge,defaultParseWidth:"any"})},vj={code:"en-US",formatDistance:Zpe,formatLong:nge,formatRelative:ige,localize:fge,match:Tge,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kge(e){const t=zt(e);return ns(t,bj(t))+1}function xj(e){const t=zt(e),n=+Pc(t)-+Upe(t);return Math.round(n/JE)+1}function wj(e,t){var u,d,p,h;const n=zt(e),r=n.getFullYear(),i=Dp(),o=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((h=(p=i.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=vi(e,0);s.setFullYear(r+1,0,o),s.setHours(0,0,0,0);const a=hs(s,t),l=vi(e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=hs(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Age(e,t){var a,l,c,u;const n=Dp(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,i=wj(e,t),o=vi(e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),hs(o,t)}function Sj(e,t){const n=zt(e),r=+hs(n,t)-+Age(n,t);return Math.round(r/JE)+1}function on(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const wa={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return on(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):on(n+1,2)},d(e,t){return on(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 on(e.getHours()%12||12,t.length)},H(e,t){return on(e.getHours(),t.length)},m(e,t){return on(e.getMinutes(),t.length)},s(e,t){return on(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return on(i,t.length)}},pu={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qM={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return wa.y(e,t)},Y:function(e,t,n,r){const i=wj(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return on(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):on(o,t.length)},R:function(e,t){const n=mj(e);return on(n,t.length)},u:function(e,t){const n=e.getFullYear();return on(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 on(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 on(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 wa.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 on(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=Sj(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):on(i,t.length)},I:function(e,t,n){const r=xj(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):on(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):wa.d(e,t)},D:function(e,t,n){const r=kge(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):on(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return on(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return on(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return on(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=pu.noon:r===0?i=pu.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=pu.evening:r>=12?i=pu.afternoon:r>=4?i=pu.morning:i=pu.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return wa.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):wa.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):on(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):on(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):wa.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):wa.s(e,t)},S:function(e,t){return wa.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return KM(r);case"XXXX":case"XX":return Dl(r);case"XXXXX":case"XXX":default:return Dl(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return KM(r);case"xxxx":case"xx":return Dl(r);case"xxxxx":case"xxx":default:return Dl(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+YM(r,":");case"OOOO":default:return"GMT"+Dl(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+YM(r,":");case"zzzz":default:return"GMT"+Dl(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return on(r,t.length)},T:function(e,t,n){const r=e.getTime();return on(r,t.length)}};function YM(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+on(o,2)}function KM(e,t){return e%60===0?(e>0?"-":"+")+on(Math.abs(e)/60,2):Dl(e,t)}function Dl(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=on(Math.trunc(r/60),2),o=on(r%60,2);return n+i+t+o}const XM=(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"})}},_j=(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"})}},Oge=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return XM(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",XM(r,t)).replace("{{time}}",_j(i,t))},Mge={p:_j,P:Oge},Ige=/^D+$/,Dge=/^Y+$/,Nge=["D","DD","YY","YYYY"];function Lge(e){return Ige.test(e)}function Fge(e){return Dge.test(e)}function jge(e,t,n){const r=$ge(e,t,n);if(console.warn(r),Nge.includes(e))throw new RangeError(r)}function $ge(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 zge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bge=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Hge=/^'([^]*?)'?$/,Vge=/''/g,Wge=/[a-zA-Z]/;function as(e,t,n){var u,d,p,h,m,b,y,x;const r=Dp(),i=(n==null?void 0:n.locale)??r.locale??vj,o=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((b=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:b.weekStartsOn)??r.weekStartsOn??((x=(y=r.locale)==null?void 0:y.options)==null?void 0:x.weekStartsOn)??0,a=zt(e);if(!Kpe(a))throw new RangeError("Invalid time value");let l=t.match(Bge).map(w=>{const _=w[0];if(_==="p"||_==="P"){const E=Mge[_];return E(w,i.formatLong)}return w}).join("").match(zge).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const _=w[0];if(_==="'")return{isToken:!1,value:Uge(w)};if(qM[_])return{isToken:!0,value:w};if(_.match(Wge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:w}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(w=>{if(!w.isToken)return w.value;const _=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Fge(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Lge(_))&&jge(_,t,String(e));const E=qM[_[0]];return E(a,_,i.localize,c)}).join("")}function Uge(e){const t=e.match(Hge);return t?t[1].replace(Vge,"'"):e}function Gge(e){const t=zt(e),n=t.getFullYear(),r=t.getMonth(),i=vi(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function qge(e){return Math.trunc(+zt(e)/1e3)}function Yge(e){const t=zt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function Kge(e,t){return Xpe(Yge(e),bi(e),t)+1}function e_(e,t){const n=zt(e),r=zt(t);return n.getTime()>r.getTime()}function Cj(e,t){const n=zt(e),r=zt(t);return+n<+r}function rR(e,t){const n=zt(e),r=zt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Xge(e,t){const n=zt(e),r=zt(t);return n.getFullYear()===r.getFullYear()}function Cw(e,t){return Yr(e,-t)}function Ew(e,t){const n=zt(e),r=n.getFullYear(),i=n.getDate(),o=vi(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const s=Gge(o);return n.setMonth(t,Math.min(i,s)),n}function QM(e,t){const n=zt(e);return isNaN(+n)?vi(e,NaN):(n.setFullYear(t),n)}var Je=function(){return Je=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Je.apply(this,arguments)};function Qge(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ej(e,t,n){for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function Np(e){return e.mode==="multiple"}function Lp(e){return e.mode==="range"}function R0(e){return e.mode==="single"}var Zge={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 Jge(e,t){return as(e,"LLLL y",t)}function eme(e,t){return as(e,"d",t)}function tme(e,t){return as(e,"LLLL",t)}function nme(e){return"".concat(e)}function rme(e,t){return as(e,"cccccc",t)}function ime(e,t){return as(e,"yyyy",t)}var ome=Object.freeze({__proto__:null,formatCaption:Jge,formatDay:eme,formatMonthCaption:tme,formatWeekNumber:nme,formatWeekdayName:rme,formatYearCaption:ime}),sme=function(e,t,n){return as(e,"do MMMM (EEEE)",n)},ame=function(){return"Month: "},lme=function(){return"Go to next month"},cme=function(){return"Go to previous month"},ume=function(e,t){return as(e,"cccc",t)},dme=function(e){return"Week n. ".concat(e)},fme=function(){return"Year: "},hme=Object.freeze({__proto__:null,labelDay:sme,labelMonthDropdown:ame,labelNext:lme,labelPrevious:cme,labelWeekNumber:dme,labelWeekday:ume,labelYearDropdown:fme});function pme(){var e="buttons",t=Zge,n=vj,r={},i={},o=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:ome,labels:hme,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:o,styles:s,today:a,mode:"default"}}function gme(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,o=e.fromDate,s=e.toDate;return r?o=bi(r):t&&(o=new Date(t,0,1)),i?s=tR(i):n&&(s=new Date(n,11,31)),{fromDate:o?Ed(o):void 0,toDate:s?Ed(s):void 0}}var Rj=k.createContext(void 0);function mme(e){var t,n=e.initialProps,r=pme(),i=gme(n),o=i.fromDate,s=i.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!o||!s)&&(a="buttons");var l;(R0(n)||Np(n)||Lp(n))&&(l=n.onSelect);var c=Je(Je(Je({},r),n),{captionLayout:a,classNames:Je(Je({},r.classNames),n.classNames),components:Je({},n.components),formatters:Je(Je({},r.formatters),n.formatters),fromDate:o,labels:Je(Je({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Je(Je({},r.modifiers),n.modifiers),modifiersClassNames:Je(Je({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Je(Je({},r.styles),n.styles),toDate:s});return v.jsx(Rj.Provider,{value:c,children:e.children})}function bn(){var e=k.useContext(Rj);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function Pj(e){var t=bn(),n=t.locale,r=t.classNames,i=t.styles,o=t.formatters.formatCaption;return v.jsx("div",{className:r.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:n})})}function bme(e){return v.jsx("svg",Je({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:v.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 Tj(e){var t,n,r=e.onChange,i=e.value,o=e.children,s=e.caption,a=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:bme;return v.jsxs("div",{className:a,style:l,children:[v.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),v.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:i,onChange:r,children:o}),v.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,v.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function yme(e){var t,n=bn(),r=n.fromDate,i=n.toDate,o=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return v.jsx(v.Fragment,{});if(!i)return v.jsx(v.Fragment,{});var d=[];if(Xge(r,i))for(var p=bi(r),h=r.getMonth();h<=i.getMonth();h++)d.push(Ew(p,h));else for(var p=bi(new Date),h=0;h<=11;h++)d.push(Ew(p,h));var m=function(y){var x=Number(y.target.value),w=Ew(bi(e.displayMonth),x);e.onChange(w)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Tj;return v.jsx(b,{name:"months","aria-label":u(),className:l.dropdown_month,style:o.dropdown_month,onChange:m,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:d.map(function(y){return v.jsx("option",{value:y.getMonth(),children:a(y,{locale:s})},y.getMonth())})})}function vme(e){var t,n=e.displayMonth,r=bn(),i=r.fromDate,o=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,p=[];if(!i)return v.jsx(v.Fragment,{});if(!o)return v.jsx(v.Fragment,{});for(var h=i.getFullYear(),m=o.getFullYear(),b=h;b<=m;b++)p.push(QM(bj(new Date),b));var y=function(w){var _=QM(bi(n),Number(w.target.value));e.onChange(_)},x=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Tj;return v.jsx(x,{name:"years","aria-label":d(),className:l.dropdown_year,style:a.dropdown_year,onChange:y,value:n.getFullYear(),caption:u(n,{locale:s}),children:p.map(function(w){return v.jsx("option",{value:w.getFullYear(),children:u(w,{locale:s})},w.getFullYear())})})}function xme(e,t){var n=k.useState(e),r=n[0],i=n[1],o=t===void 0?r:t;return[o,i]}function wme(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,o=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(o&&Hh(o,i)<0){var c=-1*(l-1);i=Do(o,c)}return s&&Hh(i,s)<0&&(i=s),bi(i)}function Sme(){var e=bn(),t=wme(e),n=xme(t,e.month),r=n[0],i=n[1],o=function(s){var a;if(!e.disableNavigation){var l=bi(s);i(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,o]}function _me(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=bi(e),o=bi(Do(i,r)),s=Hh(o,i),a=[],l=0;l<s;l++){var c=Do(i,l);a.push(c)}return n&&(a=a.reverse()),a}function Cme(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=bi(e);if(!n)return Do(a,s);var l=Hh(n,e);if(!(l<o))return Do(a,s)}}function Eme(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=bi(e);if(!n)return Do(a,-s);var l=Hh(a,n);if(!(l<=0))return Do(a,-s)}}var kj=k.createContext(void 0);function Rme(e){var t=bn(),n=Sme(),r=n[0],i=n[1],o=_me(r,t),s=Cme(r,t),a=Eme(r,t),l=function(d){return o.some(function(p){return rR(d,p)})},c=function(d,p){l(d)||(p&&Cj(d,p)?i(Do(d,1+t.numberOfMonths*-1)):i(d))},u={currentMonth:r,displayMonths:o,goToMonth:i,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return v.jsx(kj.Provider,{value:u,children:e.children})}function Fp(){var e=k.useContext(kj);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function ZM(e){var t,n=bn(),r=n.classNames,i=n.styles,o=n.components,s=Fp().goToMonth,a=function(u){s(Do(u,e.displayIndex?-e.displayIndex:0))},l=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:Pj,c=v.jsx(l,{id:e.id,displayMonth:e.displayMonth});return v.jsxs("div",{className:r.caption_dropdowns,style:i.caption_dropdowns,children:[v.jsx("div",{className:r.vhidden,children:c}),v.jsx(yme,{onChange:a,displayMonth:e.displayMonth}),v.jsx(vme,{onChange:a,displayMonth:e.displayMonth})]})}function Pme(e){return v.jsx("svg",Je({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:v.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 Tme(e){return v.jsx("svg",Je({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:v.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 ry=k.forwardRef(function(e,t){var n=bn(),r=n.classNames,i=n.styles,o=[r.button_reset,r.button];e.className&&o.push(e.className);var s=o.join(" "),a=Je(Je({},i.button_reset),i.button);return e.style&&Object.assign(a,e.style),v.jsx("button",Je({},e,{ref:t,type:"button",className:s,style:a}))});function kme(e){var t,n,r=bn(),i=r.dir,o=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return v.jsx(v.Fragment,{});var p=c(e.previousMonth,{locale:o}),h=[s.nav_button,s.nav_button_previous].join(" "),m=u(e.nextMonth,{locale:o}),b=[s.nav_button,s.nav_button_next].join(" "),y=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:Tme,x=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:Pme;return v.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&v.jsx(ry,{name:"previous-month","aria-label":p,className:h,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:i==="rtl"?v.jsx(y,{className:s.nav_icon,style:a.nav_icon}):v.jsx(x,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&v.jsx(ry,{name:"next-month","aria-label":m,className:b,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:i==="rtl"?v.jsx(x,{className:s.nav_icon,style:a.nav_icon}):v.jsx(y,{className:s.nav_icon,style:a.nav_icon})})]})}function JM(e){var t=bn().numberOfMonths,n=Fp(),r=n.previousMonth,i=n.nextMonth,o=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(m){return rR(e.displayMonth,m)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l),p=function(){r&&o(r)},h=function(){i&&o(i)};return v.jsx(kme,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:i,previousMonth:r,onPreviousClick:p,onNextClick:h})}function Ame(e){var t,n=bn(),r=n.classNames,i=n.disableNavigation,o=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:Pj,c;return i?c=v.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=v.jsx(ZM,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=v.jsxs(v.Fragment,{children:[v.jsx(ZM,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),v.jsx(JM,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=v.jsxs(v.Fragment,{children:[v.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),v.jsx(JM,{displayMonth:e.displayMonth,id:e.id})]}),v.jsx("div",{className:r.caption,style:o.caption,children:c})}function Ome(e){var t=bn(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?v.jsx("tfoot",{className:i,style:r.tfoot,children:v.jsx("tr",{children:v.jsx("td",{colSpan:8,children:n})})}):v.jsx(v.Fragment,{})}function Mme(e,t,n){for(var r=n?Pc(new Date):hs(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var s=Yr(r,o);i.push(s)}return i}function Ime(){var e=bn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=Mme(i,o,s);return v.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&v.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,d){return v.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:i}),children:a(u,{locale:i})},d)})]})}function Dme(){var e,t=bn(),n=t.classNames,r=t.styles,i=t.components,o=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:Ime;return v.jsx("thead",{style:r.head,className:n.head,children:v.jsx(o,{})})}function Nme(e){var t=bn(),n=t.locale,r=t.formatters.formatDay;return v.jsx(v.Fragment,{children:r(e.date,{locale:n})})}var iR=k.createContext(void 0);function Lme(e){if(!Np(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return v.jsx(iR.Provider,{value:t,children:e.children})}return v.jsx(Fme,{initialProps:e.initialProps,children:e.children})}function Fme(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,s=function(c,u,d){var p,h;(p=t.onDayClick)===null||p===void 0||p.call(t,c,u,d);var m=!!(u.selected&&i&&(r==null?void 0:r.length)===i);if(!m){var b=!!(!u.selected&&o&&(r==null?void 0:r.length)===o);if(!b){var y=r?Ej([],r):[];if(u.selected){var x=y.findIndex(function(w){return mi(c,w)});y.splice(x,1)}else y.push(c);(h=t.onSelect)===null||h===void 0||h.call(t,y,c,u,d)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=o&&r.length>o-1,d=r.some(function(p){return mi(p,c)});return!!(u&&!d)});var l={selected:r,onDayClick:s,modifiers:a};return v.jsx(iR.Provider,{value:l,children:n})}function oR(){var e=k.useContext(iR);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function jme(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?mi(i,e)&&mi(r,e)?void 0:mi(i,e)?{from:i,to:void 0}:mi(r,e)?void 0:e_(r,e)?{from:e,to:i}:{from:r,to:e}:i?e_(e,i)?{from:i,to:e}:{from:e,to:i}:r?Cj(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var sR=k.createContext(void 0);function $me(e){if(!Lp(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return v.jsx(sR.Provider,{value:t,children:e.children})}return v.jsx(zme,{initialProps:e.initialProps,children:e.children})}function zme(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,s=i.to,a=t.min,l=t.max,c=function(h,m,b){var y,x;(y=t.onDayClick)===null||y===void 0||y.call(t,h,m,b);var w=jme(h,r);(x=t.onSelect)===null||x===void 0||x.call(t,w,h,m,b)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(u.range_start=[o],s?(u.range_end=[s],mi(o,s)||(u.range_middle=[{after:o,before:s}])):u.range_end=[o]):s&&(u.range_start=[s],u.range_end=[s]),a&&(o&&!s&&u.disabled.push({after:Cw(o,a-1),before:Yr(o,a-1)}),o&&s&&u.disabled.push({after:o,before:Yr(o,a-1)}),!o&&s&&u.disabled.push({after:Cw(s,a-1),before:Yr(s,a-1)})),l){if(o&&!s&&(u.disabled.push({before:Yr(o,-l+1)}),u.disabled.push({after:Yr(o,l-1)})),o&&s){var d=ns(s,o)+1,p=l-d;u.disabled.push({before:Cw(o,p)}),u.disabled.push({after:Yr(s,p)})}!o&&s&&(u.disabled.push({before:Yr(s,-l+1)}),u.disabled.push({after:Yr(s,l-1)}))}return v.jsx(sR.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function aR(){var e=k.useContext(sR);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function ab(e){return Array.isArray(e)?Ej([],e):e!==void 0?[e]:[]}function Bme(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=ab(i)}),t}var No;(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"})(No||(No={}));var Hme=No.Selected,Ns=No.Disabled,Vme=No.Hidden,Wme=No.Today,Rw=No.RangeEnd,Pw=No.RangeMiddle,Tw=No.RangeStart,Ume=No.Outside;function Gme(e,t,n){var r,i=(r={},r[Hme]=ab(e.selected),r[Ns]=ab(e.disabled),r[Vme]=ab(e.hidden),r[Wme]=[e.today],r[Rw]=[],r[Pw]=[],r[Tw]=[],r[Ume]=[],r);return e.fromDate&&i[Ns].push({before:e.fromDate}),e.toDate&&i[Ns].push({after:e.toDate}),Np(e)?i[Ns]=i[Ns].concat(t.modifiers[Ns]):Lp(e)&&(i[Ns]=i[Ns].concat(n.modifiers[Ns]),i[Tw]=n.modifiers[Tw],i[Pw]=n.modifiers[Pw],i[Rw]=n.modifiers[Rw]),i}var Aj=k.createContext(void 0);function qme(e){var t=bn(),n=oR(),r=aR(),i=Gme(t,n,r),o=Bme(t.modifiers),s=Je(Je({},i),o);return v.jsx(Aj.Provider,{value:s,children:e.children})}function Oj(){var e=k.useContext(Aj);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Yme(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Kme(e){return!!(e&&typeof e=="object"&&"from"in e)}function Xme(e){return!!(e&&typeof e=="object"&&"after"in e)}function Qme(e){return!!(e&&typeof e=="object"&&"before"in e)}function Zme(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Jme(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=ns(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var s=ns(e,r)>=0&&ns(i,e)>=0;return s}return i?mi(i,e):r?mi(r,e):!1}function ebe(e){return eR(e)}function tbe(e){return Array.isArray(e)&&e.every(eR)}function nbe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(ebe(n))return mi(e,n);if(tbe(n))return n.includes(e);if(Kme(n))return Jme(e,n);if(Zme(n))return n.dayOfWeek.includes(e.getDay());if(Yme(n)){var r=ns(n.before,e),i=ns(n.after,e),o=r>0,s=i<0,a=e_(n.before,n.after);return a?s&&o:o||s}return Xme(n)?ns(e,n.after)>0:Qme(n)?ns(n.before,e)>0:typeof n=="function"?n(e):!1})}function lR(e,t,n){var r=Object.keys(t).reduce(function(o,s){var a=t[s];return nbe(e,a)&&o.push(s),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!rR(e,n)&&(i.outside=!0),i}function rbe(e,t){for(var n=bi(e[0]),r=tR(e[e.length-1]),i,o,s=n;s<=r;){var a=lR(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Yr(s,1);continue}if(a.selected)return s;a.today&&!o&&(o=s),i||(i=s),s=Yr(s,1)}return o||i}var ibe=365;function Mj(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=i.weekStartsOn,c=i.fromDate,u=i.toDate,d=i.locale,p={day:Yr,week:JS,month:Do,year:Gpe,startOfWeek:function(y){return i.ISOWeek?Pc(y):hs(y,{locale:d,weekStartsOn:l})},endOfWeek:function(y){return i.ISOWeek?yj(y):nR(y,{locale:d,weekStartsOn:l})}},h=p[n](e,r==="after"?1:-1);r==="before"&&c?h=qpe([c,h]):r==="after"&&u&&(h=Ype([u,h]));var m=!0;if(o){var b=lR(h,o);m=!b.disabled&&!b.hidden}return m?h:a.count>ibe?a.lastFocused:Mj(h,{moveBy:n,direction:r,context:i,modifiers:o,retry:Je(Je({},a),{count:a.count+1})})}var Ij=k.createContext(void 0);function obe(e){var t=Fp(),n=Oj(),r=k.useState(),i=r[0],o=r[1],s=k.useState(),a=s[0],l=s[1],c=rbe(t.displayMonths,n),u=i??(a&&t.isDateDisplayed(a))?a:c,d=function(){l(i),o(void 0)},p=function(y){o(y)},h=bn(),m=function(y,x){if(i){var w=Mj(i,{moveBy:y,direction:x,context:h,modifiers:n});mi(i,w)||(t.goToDate(w,i),p(w))}},b={focusedDay:i,focusTarget:u,blur:d,focus:p,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return v.jsx(Ij.Provider,{value:b,children:e.children})}function cR(){var e=k.useContext(Ij);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function sbe(e,t){var n=Oj(),r=lR(e,n,t);return r}var uR=k.createContext(void 0);function abe(e){if(!R0(e.initialProps)){var t={selected:void 0};return v.jsx(uR.Provider,{value:t,children:e.children})}return v.jsx(lbe,{initialProps:e.initialProps,children:e.children})}function lbe(e){var t=e.initialProps,n=e.children,r=function(o,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,o,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,o,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,o,o,s,a)},i={selected:t.selected,onDayClick:r};return v.jsx(uR.Provider,{value:i,children:n})}function Dj(){var e=k.useContext(uR);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function cbe(e,t){var n=bn(),r=Dj(),i=oR(),o=aR(),s=cR(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,p=s.focus,h=s.focusMonthBefore,m=s.focusMonthAfter,b=s.focusYearBefore,y=s.focusYearAfter,x=s.focusStartOfWeek,w=s.focusEndOfWeek,_=function(V){var B,X,I,q;R0(n)?(B=r.onDayClick)===null||B===void 0||B.call(r,e,t,V):Np(n)?(X=i.onDayClick)===null||X===void 0||X.call(i,e,t,V):Lp(n)?(I=o.onDayClick)===null||I===void 0||I.call(o,e,t,V):(q=n.onDayClick)===null||q===void 0||q.call(n,e,t,V)},E=function(V){var B;p(e),(B=n.onDayFocus)===null||B===void 0||B.call(n,e,t,V)},C=function(V){var B;d(),(B=n.onDayBlur)===null||B===void 0||B.call(n,e,t,V)},R=function(V){var B;(B=n.onDayMouseEnter)===null||B===void 0||B.call(n,e,t,V)},T=function(V){var B;(B=n.onDayMouseLeave)===null||B===void 0||B.call(n,e,t,V)},M=function(V){var B;(B=n.onDayPointerEnter)===null||B===void 0||B.call(n,e,t,V)},N=function(V){var B;(B=n.onDayPointerLeave)===null||B===void 0||B.call(n,e,t,V)},j=function(V){var B;(B=n.onDayTouchCancel)===null||B===void 0||B.call(n,e,t,V)},F=function(V){var B;(B=n.onDayTouchEnd)===null||B===void 0||B.call(n,e,t,V)},$=function(V){var B;(B=n.onDayTouchMove)===null||B===void 0||B.call(n,e,t,V)},Q=function(V){var B;(B=n.onDayTouchStart)===null||B===void 0||B.call(n,e,t,V)},H=function(V){var B;(B=n.onDayKeyUp)===null||B===void 0||B.call(n,e,t,V)},L=function(V){var B;switch(V.key){case"ArrowLeft":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":V.preventDefault(),V.stopPropagation(),c();break;case"ArrowUp":V.preventDefault(),V.stopPropagation(),u();break;case"PageUp":V.preventDefault(),V.stopPropagation(),V.shiftKey?b():h();break;case"PageDown":V.preventDefault(),V.stopPropagation(),V.shiftKey?y():m();break;case"Home":V.preventDefault(),V.stopPropagation(),x();break;case"End":V.preventDefault(),V.stopPropagation(),w();break}(B=n.onDayKeyDown)===null||B===void 0||B.call(n,e,t,V)},G={onClick:_,onFocus:E,onBlur:C,onKeyDown:L,onKeyUp:H,onMouseEnter:R,onMouseLeave:T,onPointerEnter:M,onPointerLeave:N,onTouchCancel:j,onTouchEnd:F,onTouchMove:$,onTouchStart:Q};return G}function ube(){var e=bn(),t=Dj(),n=oR(),r=aR(),i=R0(e)?t.selected:Np(e)?n.selected:Lp(e)?r.selected:void 0;return i}function dbe(e){return Object.values(No).includes(e)}function fbe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(dbe(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function hbe(e,t){var n=Je({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Je(Je({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function pbe(e,t,n){var r,i,o,s=bn(),a=cR(),l=sbe(e,t),c=cbe(e,l),u=ube(),d=!!(s.onDayClick||s.mode!=="default");k.useEffect(function(){var R;l.outside||a.focusedDay&&d&&mi(a.focusedDay,e)&&((R=n.current)===null||R===void 0||R.focus())},[a.focusedDay,e,n,d,l.outside]);var p=fbe(s,l).join(" "),h=hbe(s,l),m=!!(l.outside&&!s.showOutsideDays||l.hidden),b=(o=(i=s.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:Nme,y=v.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),x={style:h,className:p,children:y,role:"gridcell"},w=a.focusTarget&&mi(a.focusTarget,e)&&!l.outside,_=a.focusedDay&&mi(a.focusedDay,e),E=Je(Je(Je({},x),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=_||w?0:-1,r)),c),C={isButton:d,isHidden:m,activeModifiers:l,selectedDays:u,buttonProps:E,divProps:x};return C}function gbe(e){var t=k.useRef(null),n=pbe(e.date,e.displayMonth,t);return n.isHidden?v.jsx("div",{role:"gridcell"}):n.isButton?v.jsx(ry,Je({name:"day",ref:t},n.buttonProps)):v.jsx("div",Je({},n.divProps))}function mbe(e){var t=e.number,n=e.dates,r=bn(),i=r.onWeekNumberClick,o=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!i)return v.jsx("span",{className:s.weeknumber,style:o.weeknumber,children:u});var d=l(Number(t),{locale:a}),p=function(h){i(t,n,h)};return v.jsx(ry,{name:"week-number","aria-label":d,className:s.weeknumber,style:o.weeknumber,onClick:p,children:u})}function bbe(e){var t,n,r=bn(),i=r.styles,o=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:gbe,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:mbe,u;return s&&(u=v.jsx("td",{className:o.cell,style:i.cell,children:v.jsx(c,{number:e.weekNumber,dates:e.dates})})),v.jsxs("tr",{className:o.row,style:i.row,children:[u,e.dates.map(function(d){return v.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:v.jsx(l,{displayMonth:e.displayMonth,date:d})},qge(d))})]})}function eI(e,t,n){for(var r=n!=null&&n.ISOWeek?yj(t):nR(t,n),i=n!=null&&n.ISOWeek?Pc(e):hs(e,n),o=ns(r,i),s=[],a=0;a<=o;a++)s.push(Yr(i,a));var l=s.reduce(function(c,u){var d=n!=null&&n.ISOWeek?xj(u):Sj(u,n),p=c.find(function(h){return h.weekNumber===d});return p?(p.dates.push(u),c):(c.push({weekNumber:d,dates:[u]}),c)},[]);return l}function ybe(e,t){var n=eI(bi(e),tR(e),t);if(t!=null&&t.useFixedWeeks){var r=Kge(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],s=JS(o,6-r),a=eI(JS(o,1),s,t);n.push.apply(n,a)}}return n}function vbe(e){var t,n,r,i=bn(),o=i.locale,s=i.classNames,a=i.styles,l=i.hideHead,c=i.fixedWeeks,u=i.components,d=i.weekStartsOn,p=i.firstWeekContainsDate,h=i.ISOWeek,m=ybe(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:h,locale:o,weekStartsOn:d,firstWeekContainsDate:p}),b=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:Dme,y=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:bbe,x=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:Ome;return v.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&v.jsx(b,{}),v.jsx("tbody",{className:s.tbody,style:a.tbody,children:m.map(function(w){return v.jsx(y,{displayMonth:e.displayMonth,dates:w.dates,weekNumber:w.weekNumber},w.weekNumber)})}),v.jsx(x,{displayMonth:e.displayMonth})]})}function xbe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var wbe=xbe()?k.useLayoutEffect:k.useEffect,kw=!1,Sbe=0;function tI(){return"react-day-picker-".concat(++Sbe)}function _be(e){var t,n=e??(kw?tI():null),r=k.useState(n),i=r[0],o=r[1];return wbe(function(){i===null&&o(tI())},[]),k.useEffect(function(){kw===!1&&(kw=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function Cbe(e){var t,n,r=bn(),i=r.dir,o=r.classNames,s=r.styles,a=r.components,l=Fp().displayMonths,c=_be(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,d=[o.month],p=s.month,h=e.displayIndex===0,m=e.displayIndex===l.length-1,b=!h&&!m;i==="rtl"&&(t=[h,m],m=t[0],h=t[1]),h&&(d.push(o.caption_start),p=Je(Je({},p),s.caption_start)),m&&(d.push(o.caption_end),p=Je(Je({},p),s.caption_end)),b&&(d.push(o.caption_between),p=Je(Je({},p),s.caption_between));var y=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:Ame;return v.jsxs("div",{className:d.join(" "),style:p,children:[v.jsx(y,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),v.jsx(vbe,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function Ebe(e){var t=bn(),n=t.classNames,r=t.styles;return v.jsx("div",{className:n.months,style:r.months,children:e.children})}function Rbe(e){var t,n,r=e.initialProps,i=bn(),o=cR(),s=Fp(),a=k.useState(!1),l=a[0],c=a[1];k.useEffect(function(){i.initialFocus&&o.focusTarget&&(l||(o.focus(o.focusTarget),c(!0)))},[i.initialFocus,l,o.focus,o.focusTarget,o]);var u=[i.classNames.root,i.className];i.numberOfMonths>1&&u.push(i.classNames.multiple_months),i.showWeekNumber&&u.push(i.classNames.with_weeknumber);var d=Je(Je({},i.styles.root),i.style),p=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,b){var y;return Je(Je({},m),(y={},y[b]=r[b],y))},{}),h=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:Ebe;return v.jsx("div",Je({className:u.join(" "),style:d,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:v.jsx(h,{children:s.displayMonths.map(function(m,b){return v.jsx(Cbe,{displayIndex:b,displayMonth:m},b)})})}))}function Pbe(e){var t=e.children,n=Qge(e,["children"]);return v.jsx(mme,{initialProps:n,children:v.jsx(Rme,{children:v.jsx(abe,{initialProps:n,children:v.jsx(Lme,{initialProps:n,children:v.jsx($me,{initialProps:n,children:v.jsx(qme,{children:v.jsx(obe,{children:t})})})})})})})}function Tbe(e){return v.jsx(Pbe,Je({},e,{children:v.jsx(Rbe,{initialProps:e})}))}function Nj({className:e,classNames:t,showOutsideDays:n=!0,...r}){return v.jsx(Tbe,{showOutsideDays:n,className:me("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:me(Bh({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:me(Bh({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...i})=>v.jsx(jC,{...i,className:"h-4 w-4"}),IconRight:({...i})=>v.jsx(Gy,{...i,className:"h-4 w-4"})},...r})}Nj.displayName="Calendar";function Lj(e){const{authToken:t}=Wi(),n=ye(E=>E.authToken),r=t||n,i=ye(E=>E.dashboard.filters),o=ye(E=>E.selectedSheetId),s=ye(E=>E.filterValues),[a,l]=k.useState(!0),c=i==null?void 0:i.filter(E=>E.sheetId===o||!E.sheetId),u=s==null?void 0:s.filter(E=>(c==null?void 0:c.some(C=>C.id===E.filterId))||E.filterId.endsWith(o));function d(E){return a?{allowQuery:!0,filterValues:E.filter(T=>T.filterId!==e.id)}:(E==null?void 0:E.find(R=>R.filterId===e.id))?{allowQuery:!1,filterValues:E}:{allowQuery:!0,filterValues:E}}const{allowQuery:p,filterValues:h}=d(u||[]),{data:m,isLoading:b,isFetching:y,isError:x,refetch:w,isSuccess:_}=dp({queryKey:["filter",e.id,e.sql,JSON.stringify(h)],queryFn:()=>Ry("https://semaphor.cloud/api/v1/query",(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:h,cache_config:J_()}),enabled:!!e.sql&&!!e.connectionId&&p&&!!(r!=null&&r.accessToken),placeholderData:E=>E});return k.useEffect(()=>{_&&a&&l(!1)},[_,a]),{data:m,isLoading:b,isFetching:y,isError:x,refetch:w}}function kbe(e){const t=ye(i=>{var o,s;return(s=(o=i.dashboard)==null?void 0:o.filters)==null?void 0:s.find(a=>a.id===e)}),{setDateRange:n,...r}=Fj(t||{});return r}function Fj(e){const[t,n]=k.useState(),[r,i]=k.useState(),o=ye(m=>m.filterValues),s=ye(m=>m.actions.addOrUpdateFilterValue),{removeFilterValues:a}=Vn(),{data:l,isLoading:c,isFetching:u,isError:d}=Lj(e);k.useEffect(()=>{var m;if(((m=l==null?void 0:l.records)==null?void 0:m.length)>0){const b=l.records[0];if(!b.min||!b.max)return;n({from:new Date(b.min),to:new Date(b.max)}),i({from:new Date(b.min),to:new Date(b.max)})}},[l]),k.useEffect(()=>{var m;if(o){const b=o.find(y=>y.filterId===e.id);if(!b)n(r);else if(((m=b.values)==null?void 0:m.length)===2){const[y,x]=b.values;n({from:y?new Date(y):void 0,to:x?new Date(x):void 0})}}},[o,e.id,r]);function p(){a(e.id),n(r)}function h(m){if(!m)return;let b=[m==null?void 0:m.from,m==null?void 0:m.to];m.from&&m.to===void 0?b=[m.from,GM(m.from,24)]:m.from&&m.to&&m.from.getTime()===m.to.getTime()?b=[m.from,GM(m.to,24)]:b=[m.from,m.to],n({from:b[0],to:b[1]});const y={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Au(e),name:e.column,operation:"between",values:b};s(y)}return{records:l==null?void 0:l.records,isLoading:c,isFetching:u,isError:d,initialDateRange:r,dateRange:t,setDateRange:n,handleClear:p,handleChange:h}}function Abe({filter:e,className:t}){var h,m,b,y,x,w,_,E;const n=ye(C=>C.themeStyle),[r,i]=k.useState(!1),{records:o,dateRange:s,isLoading:a,isFetching:l,isError:c,setDateRange:u,handleClear:d,handleChange:p}=Fj(e);return a||l?v.jsx("div",{children:v.jsx(Mu,{className:"h-8 w-full bg-foreground/10"})}):c?v.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):o?v.jsx("div",{className:me("grid gap-2",t),children:v.jsxs(w0,{open:r,onOpenChange:i,children:[v.jsx(S0,{style:{borderRadius:(m=(h=n==null?void 0:n.chart)==null?void 0:h.options)==null?void 0:m.borderRadius},asChild:!0,children:v.jsxs(nr,{size:"sm",id:"date",variant:"outline",className:me("h-[34px] w-full justify-start rounded-sm text-left font-normal",!s&&"text-muted-foreground"),children:[v.jsx(J5,{className:"mr-2 h-4 w-4"}),s!=null&&s.from?s.to?v.jsxs(v.Fragment,{children:[as(s.from,"LLL dd, y")," -"," ",as(s.to,"LLL dd, y")]}):as(s.from,"LLL dd, y"):v.jsx("span",{children:"Pick a date"})]})}),v.jsxs(Mp,{style:{borderRadius:(y=(b=n==null?void 0:n.chart)==null?void 0:b.options)==null?void 0:y.borderRadius},className:"w-auto p-0",align:"start",children:[v.jsx("div",{className:"px-4 pt-3",children:v.jsx(Sn,{children:e.title})}),v.jsx(Nj,{initialFocus:!0,mode:"range",defaultMonth:s==null?void 0:s.from,selected:s,onSelect:u,numberOfMonths:2}),v.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[v.jsx(nr,{style:{borderRadius:(w=(x=n==null?void 0:n.chart)==null?void 0:x.options)==null?void 0:w.borderRadius},size:"sm",variant:"outline",onClick:()=>{p(s),i(!1)},children:"Apply"}),v.jsx(nr,{style:{borderRadius:(E=(_=n==null?void 0:n.chart)==null?void 0:_.options)==null?void 0:E.borderRadius},size:"sm",variant:"outline",onClick:d,children:"Clear"})]})]})]})}):v.jsxs(Sn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}const jj=typeof document<"u"?k.useLayoutEffect:()=>{};function Obe(e){const t=k.useRef(null);return jj(()=>{t.current=e},[e]),k.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const jp=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Wl=e=>e&&"window"in e&&e.window===e?e:jp(e).defaultView||window;function Mbe(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Ibe(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function $j(e){let t=null;return()=>(t==null&&(t=e()),t)}const Dbe=$j(function(){return Ibe(/^Mac/i)}),Nbe=$j(function(){return Mbe(/Android/i)});function Lbe(e){return e.mozInputSource===0&&e.isTrusted?!0:Nbe()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class Fbe{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function zj(e){let t=k.useRef({isFocused:!1,observer:null});jj(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Obe(r=>{e==null||e(r)});return k.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r.target,o=s=>{t.current.isFocused=!1,i.disabled&&n(new Fbe("blur",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",o,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let a=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function jbe(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const o=k.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),i&&i(!1),!0},[r,i]),s=zj(o),a=k.useCallback(l=>{const c=jp(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(n&&n(l),i&&i(!0),s(l))},[i,n,s]);return{focusProps:{onFocus:!t&&(n||i||r)?a:void 0,onBlur:!t&&(r||i)?o:void 0}}}let $p=null,t_=new Set,yh=new Map,Tc=!1,n_=!1;const $be={Tab:!0,Escape:!0};function dR(e,t){for(let n of t_)n(e,t)}function zbe(e){return!(e.metaKey||!Dbe()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function iy(e){Tc=!0,zbe(e)&&($p="keyboard",dR("keyboard",e))}function io(e){$p="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Tc=!0,dR("pointer",e))}function Bj(e){Lbe(e)&&(Tc=!0,$p="virtual")}function Hj(e){e.target===window||e.target===document||(!Tc&&!n_&&($p="virtual",dR("virtual",e)),Tc=!1,n_=!1)}function Vj(){Tc=!1,n_=!0}function r_(e){if(typeof window>"u"||yh.get(Wl(e)))return;const t=Wl(e),n=jp(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Tc=!0,r.apply(this,arguments)},n.addEventListener("keydown",iy,!0),n.addEventListener("keyup",iy,!0),n.addEventListener("click",Bj,!0),t.addEventListener("focus",Hj,!0),t.addEventListener("blur",Vj,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",io,!0),n.addEventListener("pointermove",io,!0),n.addEventListener("pointerup",io,!0)):(n.addEventListener("mousedown",io,!0),n.addEventListener("mousemove",io,!0),n.addEventListener("mouseup",io,!0)),t.addEventListener("beforeunload",()=>{Wj(e)},{once:!0}),yh.set(t,{focus:r})}const Wj=(e,t)=>{const n=Wl(e),r=jp(e);t&&r.removeEventListener("DOMContentLoaded",t),yh.has(n)&&(n.HTMLElement.prototype.focus=yh.get(n).focus,r.removeEventListener("keydown",iy,!0),r.removeEventListener("keyup",iy,!0),r.removeEventListener("click",Bj,!0),n.removeEventListener("focus",Hj,!0),n.removeEventListener("blur",Vj,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",io,!0),r.removeEventListener("pointermove",io,!0),r.removeEventListener("pointerup",io,!0)):(r.removeEventListener("mousedown",io,!0),r.removeEventListener("mousemove",io,!0),r.removeEventListener("mouseup",io,!0)),yh.delete(n))};function Bbe(e){const t=jp(e);let n;return t.readyState!=="loading"?r_(e):(n=()=>{r_(e)},t.addEventListener("DOMContentLoaded",n)),()=>Wj(e,n)}typeof document<"u"&&Bbe();function Uj(){return $p!=="pointer"}const Hbe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Vbe(e,t,n){var r;const i=typeof window<"u"?Wl(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,o=typeof window<"u"?Wl(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?Wl(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Wl(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof i&&!Hbe.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof o||(n==null?void 0:n.target)instanceof s&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof a&&!$be[n.key])}function Wbe(e,t,n){r_(),k.useEffect(()=>{let r=(i,o)=>{Vbe(!!(n!=null&&n.isTextInput),i,o)&&e(Uj())};return t_.add(r),()=>{t_.delete(r)}},t)}function Ube(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,o=k.useRef({isFocusWithin:!1}),s=k.useCallback(c=>{o.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(o.current.isFocusWithin=!1,n&&n(c),i&&i(!1))},[n,i,o]),a=zj(s),l=k.useCallback(c=>{!o.current.isFocusWithin&&document.activeElement===c.target&&(r&&r(c),i&&i(!0),o.current.isFocusWithin=!0,a(c))},[r,i,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:s}}}let oy=!1,Aw=0;function i_(){oy=!0,setTimeout(()=>{oy=!1},50)}function nI(e){e.pointerType==="touch"&&i_()}function Gbe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",nI):document.addEventListener("touchend",i_),Aw++,()=>{Aw--,!(Aw>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",nI):document.removeEventListener("touchend",i_))}}function Gj(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[o,s]=k.useState(!1),a=k.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;k.useEffect(Gbe,[]);let{hoverProps:l,triggerHoverEnd:c}=k.useMemo(()=>{let u=(h,m)=>{if(a.pointerType=m,i||m==="touch"||a.isHovered||!h.currentTarget.contains(h.target))return;a.isHovered=!0;let b=h.currentTarget;a.target=b,t&&t({type:"hoverstart",target:b,pointerType:m}),n&&n(!0),s(!0)},d=(h,m)=>{if(a.pointerType="",a.target=null,m==="touch"||!a.isHovered)return;a.isHovered=!1;let b=h.currentTarget;r&&r({type:"hoverend",target:b,pointerType:m}),n&&n(!1),s(!1)},p={};return typeof PointerEvent<"u"?(p.onPointerEnter=h=>{oy&&h.pointerType==="mouse"||u(h,h.pointerType)},p.onPointerLeave=h=>{!i&&h.currentTarget.contains(h.target)&&d(h,h.pointerType)}):(p.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},p.onMouseEnter=h=>{!a.ignoreEmulatedMouseEvents&&!oy&&u(h,"mouse"),a.ignoreEmulatedMouseEvents=!1},p.onMouseLeave=h=>{!i&&h.currentTarget.contains(h.target)&&d(h,"mouse")}),{hoverProps:p,triggerHoverEnd:d}},[t,n,r,i,a]);return k.useEffect(()=>{i&&c({currentTarget:a.target},a.pointerType)},[i]),{hoverProps:l,isHovered:o}}function qj(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=k.useRef({isFocused:!1,isFocusVisible:t||Uj()}),[o,s]=k.useState(!1),[a,l]=k.useState(()=>i.current.isFocused&&i.current.isFocusVisible),c=k.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),u=k.useCallback(h=>{i.current.isFocused=h,s(h),c()},[c]);Wbe(h=>{i.current.isFocusVisible=h,c()},[],{isTextInput:n});let{focusProps:d}=jbe({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=Ube({isDisabled:!r,onFocusWithinChange:u});return{isFocused:o,isFocusVisible:a,focusProps:r?p:d}}var qbe=Object.defineProperty,Ybe=(e,t,n)=>t in e?qbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ow=(e,t,n)=>(Ybe(e,typeof t!="symbol"?t+"":t,n),n);let Kbe=class{constructor(){Ow(this,"current",this.detect()),Ow(this,"handoffState","pending"),Ow(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"}},hc=new Kbe;function zp(e){return hc.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function Yj(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ps(){let e=[],t={addEventListener(n,r,i,o){return n.addEventListener(r,i,o),t.add(()=>n.removeEventListener(r,i,o))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Yj(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,i){let o=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:o})})},group(n){let r=ps();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let i of e.splice(r,1))i()}},dispose(){for(let n of e.splice(0))n()}};return t}function Hd(){let[e]=k.useState(ps);return k.useEffect(()=>()=>e.dispose(),[e]),e}let sn=(e,t)=>{hc.isServer?k.useEffect(e,t):k.useLayoutEffect(e,t)};function cl(e){let t=k.useRef(e);return sn(()=>{t.current=e},[e]),t}let Ke=function(e){let t=cl(e);return k.useCallback((...n)=>t.current(...n),[t])};function Xbe(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function Qbe(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Zbe({disabled:e=!1}={}){let t=k.useRef(null),[n,r]=k.useState(!1),i=Hd(),o=Ke(()=>{t.current=null,r(!1),i.dispose()}),s=Ke(a=>{if(i.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=zp(a.currentTarget);i.addEventListener(l,"pointerup",o,!1),i.addEventListener(l,"pointermove",c=>{if(t.current){let u=Xbe(c);r(Qbe(u,t.current.getBoundingClientRect()))}},!1),i.addEventListener(l,"pointercancel",o,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:o,onClick:o}}}let Jbe=k.createContext(void 0);function fR(){return k.useContext(Jbe)}function o_(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Oo(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Oo),r}var sy=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(sy||{}),za=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(za||{});function Ui(){let e=tye();return k.useCallback(t=>eye({mergeRefs:e,...t}),[e])}function eye({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:a}){a=a??nye;let l=Kj(t,e);if(o)return Mm(l,n,r,s,a);let c=i??0;if(c&2){let{static:u=!1,...d}=l;if(u)return Mm(d,n,r,s,a)}if(c&1){let{unmount:u=!0,...d}=l;return Oo(u?0:1,{0(){return null},1(){return Mm({...d,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Mm(l,n,r,s,a)}function Mm(e,t={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=Mw(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let d={};if(t){let p=!1,h=[];for(let[m,b]of Object.entries(t))typeof b=="boolean"&&(p=!0),b===!0&&h.push(m.replace(/([A-Z])/g,y=>`-${y.toLowerCase()}`));if(p){d["data-headlessui-state"]=h.join(" ");for(let m of h)d[`data-${m}`]=""}}if(o===k.Fragment&&(Object.keys(Ea(l)).length>0||Object.keys(Ea(d)).length>0))if(!k.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(Ea(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Ea(l)).concat(Object.keys(Ea(d))).map(p=>` - ${p}`).join(`
384
- `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
385
- `)].join(`
386
- `))}else{let p=u.props,h=p==null?void 0:p.className,m=typeof h=="function"?(...x)=>o_(h(...x),l.className):o_(h,l.className),b=m?{className:m}:{},y=Kj(u.props,Ea(Mw(l,["ref"])));for(let x in d)x in y&&delete d[x];return k.cloneElement(u,Object.assign({},y,d,c,{ref:i(rye(u),c.ref)},b))}return k.createElement(o,Object.assign({},Mw(l,["ref"]),o!==k.Fragment&&c,o!==k.Fragment&&d),u)}function tye(){let e=k.useRef([]),t=k.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function nye(...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 Kj(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[i=>{var o;return(o=i==null?void 0:i.preventDefault)==null?void 0:o.call(i)}]);for(let r in n)Object.assign(t,{[r](i,...o){let s=n[r];for(let a of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...o)}}});return t}function hR(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];for(let r in n)Object.assign(t,{[r](...i){let o=n[r];for(let s of o)s==null||s(...i)}});return t}function xi(e){var t;return Object.assign(k.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ea(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Mw(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function rye(e){return k.version.split(".")[0]>="19"?e.props.ref:e.ref}function iye(e,t,n){let[r,i]=k.useState(n),o=e!==void 0,s=k.useRef(o),a=k.useRef(!1),l=k.useRef(!1);return o&&!s.current&&!a.current?(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?e:r,Ke(c=>(o||i(c),t==null?void 0:t(c)))]}function oye(e){let[t]=k.useState(e);return t}function Xj(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))Zj(n,Qj(t,r),i);return n}function Qj(e,t){return e?e+"["+t+"]":t}function Zj(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())Zj(e,Qj(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):Xj(n,t,e)}let sye="span";var pR=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(pR||{});function aye(e,t){var n;let{features:r=1,...i}=e,o={ref:t,"aria-hidden":(r&2)===2?!0:(n=i["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Ui()({ourProps:o,theirProps:i,slot:{},defaultTag:sye,name:"Hidden"})}let Jj=xi(aye),lye=k.createContext(null);function cye({children:e}){let t=k.useContext(lye);if(!t)return k.createElement(k.Fragment,null,e);let{target:n}=t;return n?Ar.createPortal(k.createElement(k.Fragment,null,e),n):null}function uye({data:e,form:t,disabled:n,onReset:r,overrides:i}){let[o,s]=k.useState(null),a=Hd();return k.useEffect(()=>{if(r&&o)return a.addEventListener(o,"reset",r)},[o,t,r]),k.createElement(cye,null,k.createElement(dye,{setForm:s,formId:t}),Xj(e).map(([l,c])=>k.createElement(Jj,{features:pR.Hidden,...Ea({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...i})})))}function dye({setForm:e,formId:t}){return k.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:k.createElement(Jj,{features:pR.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let fye=k.createContext(void 0);function e8(){return k.useContext(fye)}function hye(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&&pye(n)?!1:r}function pye(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let t8=Symbol();function gye(e,t=!0){return Object.assign(e,{[t8]:t})}function Lo(...e){let t=k.useRef(e);k.useEffect(()=>{t.current=e},[e]);let n=Ke(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[t8]))?void 0:n}let gR=k.createContext(null);gR.displayName="DescriptionContext";function n8(){let e=k.useContext(gR);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,n8),t}return e}function mye(){var e,t;return(t=(e=k.useContext(gR))==null?void 0:e.value)!=null?t:void 0}let bye="p";function yye(e,t){let n=k.useId(),r=fR(),{id:i=`headlessui-description-${n}`,...o}=e,s=n8(),a=Lo(t);sn(()=>s.register(i),[i,s.register]);let l=r||!1,c=k.useMemo(()=>({...s.slot,disabled:l}),[s.slot,l]),u={ref:a,...s.props,id:i};return Ui()({ourProps:u,theirProps:o,slot:c,defaultTag:bye,name:s.name||"Description"})}let vye=xi(yye);Object.assign(vye,{});var Gr=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Gr||{});let P0=k.createContext(null);P0.displayName="LabelContext";function r8(){let e=k.useContext(P0);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,r8),t}return e}function T0(e){var t,n,r;let i=(n=(t=k.useContext(P0))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[i,...e].filter(Boolean).join(" "):i}function xye({inherit:e=!1}={}){let t=T0(),[n,r]=k.useState([]),i=e?[t,...n].filter(Boolean):n;return[i.length>0?i.join(" "):void 0,k.useMemo(()=>function(o){let s=Ke(l=>(r(c=>[...c,l]),()=>r(c=>{let u=c.slice(),d=u.indexOf(l);return d!==-1&&u.splice(d,1),u}))),a=k.useMemo(()=>({register:s,slot:o.slot,name:o.name,props:o.props,value:o.value}),[s,o.slot,o.name,o.props,o.value]);return k.createElement(P0.Provider,{value:a},o.children)},[r])]}let wye="label";function Sye(e,t){var n;let r=k.useId(),i=r8(),o=e8(),s=fR(),{id:a=`headlessui-label-${r}`,htmlFor:l=o??((n=i.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,d=Lo(t);sn(()=>i.register(a),[a,i.register]);let p=Ke(y=>{let x=y.currentTarget;if(x instanceof HTMLLabelElement&&y.preventDefault(),i.props&&"onClick"in i.props&&typeof i.props.onClick=="function"&&i.props.onClick(y),x instanceof HTMLLabelElement){let w=document.getElementById(x.htmlFor);if(w){let _=w.getAttribute("disabled");if(_==="true"||_==="")return;let E=w.getAttribute("aria-disabled");if(E==="true"||E==="")return;(w instanceof HTMLInputElement&&(w.type==="radio"||w.type==="checkbox")||w.role==="radio"||w.role==="checkbox"||w.role==="switch")&&w.click(),w.focus({preventScroll:!0})}}}),h=s||!1,m=k.useMemo(()=>({...i.slot,disabled:h}),[i.slot,h]),b={ref:d,...i.props,id:a,htmlFor:l,onClick:p};return c&&("onClick"in b&&(delete b.htmlFor,delete b.onClick),"onClick"in u&&delete u.onClick),Ui()({ourProps:b,theirProps:u,slot:m,defaultTag:l?wye:"div",name:i.name||"Label"})}let _ye=xi(Sye),Cye=Object.assign(_ye,{});function gu(e,t,n){let r=n.initialDeps??[],i;return()=>{var o,s,a,l;let c;n.key&&((o=n.debug)!=null&&o.call(n))&&(c=Date.now());const u=e();if(!(u.length!==r.length||u.some((h,m)=>r[m]!==h)))return i;r=u;let p;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(p=Date.now()),i=t(...u),n.key&&((a=n.debug)!=null&&a.call(n))){const h=Math.round((Date.now()-c)*100)/100,m=Math.round((Date.now()-p)*100)/100,b=m/16,y=(x,w)=>{for(x=String(x);x.length<w;)x=" "+x;return x};console.info(`%c⏱ ${y(m,5)} /${y(h,5)} ms`,`
387
- font-size: .6rem;
388
- font-weight: bold;
389
- color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,i),i}}function Iw(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Eye=(e,t)=>Math.abs(e-t)<1,Rye=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Pye=e=>e,Tye=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},kye=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(s=>{const a=s[0];if(a!=null&&a.borderBoxSize){const l=a.borderBoxSize[0];if(l){i({width:l.inlineSize,height:l.blockSize});return}}i(n.getBoundingClientRect())});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},rI={passive:!0},Aye=typeof window>"u"?!0:"onscrollend"in window,Oye=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const o=e.options.useScrollendEvent&&Aye?()=>{}:Rye(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),s=c=>()=>{const{horizontal:u,isRtl:d}=e.options;i=u?n.scrollLeft*(d&&-1||1):n.scrollTop,o(),t(i,c)},a=s(!0),l=s(!1);return l(),n.addEventListener("scroll",a,rI),n.addEventListener("scrollend",l,rI),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",l)}},Mye=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},Iye=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;const s=e+t;(o=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class Dye{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{this._measureElement(o.target,o)})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var o;return(o=r())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=r())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Pye,rangeExtractor:Tye,onChange:()=>{},measureElement:Mye,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=gu(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,o=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(i.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&i.set(a.lane,!0),i.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=gu(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,i,o,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:s}),{key:!1}),this.getMeasurements=gu(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=o(u),p=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),h=p?p.end+this.options.gap:r+i,m=a.get(d),b=typeof m=="number"?m:this.options.estimateSize(u),y=h+b,x=p?p.lane:u%this.options.lanes;c[u]={index:u,start:h,size:b,end:y,key:d,lane:x}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=gu(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,i)=>this.range=n.length>0&&r>0?Nye({measurements:n,outerSize:r,scrollOffset:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=gu(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,i,o)=>r===null?[]:n({startIndex:r.startIndex,endIndex:r.endIndex,overscan:i,count:o}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.indexFromElement(n),o=this.measurementsCache[i];if(!o)return;const s=o.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const o=this.itemSizeCache.get(i.key)??i.size,s=r-o;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,s,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=gu(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let o=0,s=n.length;o<s;o++){const a=n[o],l=r[a];i.push(l)}return i},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Iw(r[i8(0,r.length-1,i=>Iw(r[i]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const i=this.getSize(),o=this.getScrollOffset();r==="auto"&&n>=o+i&&(r="end"),r==="end"&&(n-=i);const s=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const o=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(i.end>=s+o-this.options.scrollPaddingEnd)r="end";else if(i.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=i.start-this.options.scrollPaddingStart+(i.size-o)/2;switch(r){case"center":return[this.getOffsetForAlignment(a,r),r];case"end":return[this.getOffsetForAlignment(i.end+this.options.scrollPaddingEnd,r),r];default:return[this.getOffsetForAlignment(i.start-this.options.scrollPaddingStart,r),r]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const o=this.getOffsetForIndex(n,r);if(!o)return;const[s,a]=o;this._scrollToOffset(s,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=Iw(this.getOffsetForIndex(n,a));Eye(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:i})}else this.scrollToIndex(n,{align:a,behavior:i})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;return r.length===0?i=this.options.paddingStart:i=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(o=>o.end)),Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const i8=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,o=n(i);if(o<r)e=i+1;else if(o>r)t=i-1;else return i}return e>0?e-1:0};function Nye({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,o=i8(0,r,a=>e[a].start,n);let s=o;for(;s<r&&e[s].end<n+t;)s++;return{startIndex:o,endIndex:s}}const iI=typeof document<"u"?P.useLayoutEffect:P.useEffect;function Lye(e){const t=P.useReducer(()=>({}),{})[1],n={...e,onChange:(i,o)=>{var s;o?Ar.flushSync(t):t(),(s=e.onChange)==null||s.call(e,i,o)}},[r]=P.useState(()=>new Dye(n));return r.setOptions(n),iI(()=>r._didMount(),[]),iI(()=>r._willUpdate()),r}function Fye(e){return Lye({observeElementRect:kye,observeElementOffset:Oye,scrollToFn:Iye,...e})}function jye(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function $ye(e=jye){return k.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function zye(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function oI(e,t=!1){let[n,r]=k.useReducer(()=>({}),{}),i=k.useMemo(()=>zye(e),[e,n]);return sn(()=>{if(!e)return;let o=new ResizeObserver(r);return o.observe(e),()=>{o.disconnect()}},[e]),t?{width:`${i.width}px`,height:`${i.height}px`}:i}let Bye=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function o8(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...o){let s=t[i].call(n,...o);s&&(n=s,r.forEach(a=>a()))}}}function s8(e){return k.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Hye=new Bye(()=>o8(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function mR(e,t){let n=Hye.get(t),r=k.useId(),i=s8(n);if(sn(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let o=i.indexOf(r),s=i.length;return o===-1&&(o=s,s+=1),o===s-1}let s_=new Map,vh=new Map;function sI(e){var t;let n=(t=vh.get(e))!=null?t:0;return vh.set(e,n+1),n!==0?()=>aI(e):(s_.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>aI(e))}function aI(e){var t;let n=(t=vh.get(e))!=null?t:1;if(n===1?vh.delete(e):vh.set(e,n-1),n!==1)return;let r=s_.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,s_.delete(e))}function Vye(e,{allowed:t,disallowed:n}={}){let r=mR(e,"inert-others");sn(()=>{var i,o;if(!r)return;let s=ps();for(let l of(i=n==null?void 0:n())!=null?i:[])l&&s.add(sI(l));let a=(o=t==null?void 0:t())!=null?o:[];for(let l of a){if(!l)continue;let c=zp(l);if(!c)continue;let u=l.parentElement;for(;u&&u!==c.body;){for(let d of u.children)a.some(p=>d.contains(p))||s.add(sI(d));u=u.parentElement}}return s.dispose},[r,t,n])}function Wye(e,t,n){let r=cl(i=>{let o=i.getBoundingClientRect();o.x===0&&o.y===0&&o.width===0&&o.height===0&&n()});k.useEffect(()=>{if(!e)return;let i=t===null?null:t instanceof HTMLElement?t:t.current;if(!i)return;let o=ps();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(i));s.observe(i),o.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(i));s.observe(i),o.add(()=>s.disconnect())}return()=>o.dispose()},[t,r,e])}let a_=["[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 Uye=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Uye||{}),Gye=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Gye||{}),qye=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(qye||{}),a8=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(a8||{});function Yye(e,t=0){var n;return e===((n=zp(e))==null?void 0:n.body)?!1:Oo(t,{0(){return e.matches(a_)},1(){let r=e;for(;r!==null;){if(r.matches(a_))return!0;r=r.parentElement}return!1}})}var Kye=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Kye||{});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 Xye(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),o=t(r);if(i===null||o===null)return 0;let s=i.compareDocumentPosition(o);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function l8(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Qye(){return/Android/gi.test(window.navigator.userAgent)}function c8(){return l8()||Qye()}function Of(e,t,n,r){let i=cl(n);k.useEffect(()=>{if(!e)return;function o(s){i.current(s)}return document.addEventListener(t,o,r),()=>document.removeEventListener(t,o,r)},[e,t,r])}function Zye(e,t,n,r){let i=cl(n);k.useEffect(()=>{if(!e)return;function o(s){i.current(s)}return window.addEventListener(t,o,r),()=>window.removeEventListener(t,o,r)},[e,t,r])}const lI=30;function Jye(e,t,n){let r=mR(e,"outside-click"),i=cl(n),o=k.useCallback(function(l,c){if(l.defaultPrevented)return;let u=c(l);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let d=function p(h){return typeof h=="function"?p(h()):Array.isArray(h)||h instanceof Set?h:[h]}(t);for(let p of d)if(p!==null&&(p.contains(u)||l.composed&&l.composedPath().includes(p)))return;return!Yye(u,a8.Loose)&&u.tabIndex!==-1&&l.preventDefault(),i.current(l,u)},[i,t]),s=k.useRef(null);Of(r,"pointerdown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),Of(r,"mousedown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),Of(r,"click",l=>{c8()||s.current&&(o(l,()=>s.current),s.current=null)},!0);let a=k.useRef({x:0,y:0});Of(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),Of(r,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-a.current.x)>=lI||Math.abs(c.y-a.current.y)>=lI))return o(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),Zye(r,"blur",l=>o(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function k0(...e){return k.useMemo(()=>zp(...e),[...e])}function e0e(e,t,n,r){let i=cl(n);k.useEffect(()=>{e=e??window;function o(s){i.current(s)}return e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r)},[e,t,r])}function u8(e){let t=k.useRef({value:"",selectionStart:null,selectionEnd:null});return e0e(e,"blur",n=>{let r=n.target;r instanceof HTMLInputElement&&(t.current={value:r.value,selectionStart:r.selectionStart,selectionEnd:r.selectionEnd})}),Ke(()=>{if(document.activeElement!==e&&e instanceof HTMLInputElement&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:n,selectionEnd:r}=t.current;n!==null&&r!==null&&e.setSelectionRange(n,r)}t.current={value:"",selectionStart:null,selectionEnd:null}}})}function t0e(e,t){return k.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function n0e(){let e;return{before({doc:t}){var n;let r=t.documentElement,i=(n=t.defaultView)!=null?n:window;e=Math.max(0,i.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),o=Math.max(0,e-i);n.style(r,"paddingRight",`${o}px`)}}}function r0e(){return l8()?{before({doc:e,d:t,meta:n}){function r(i){return n.containers.flatMap(o=>o()).some(o=>o.contains(i))}t.microTask(()=>{var i;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=ps();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let o=(i=window.scrollY)!=null?i:window.pageYOffset,s=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),u=e.querySelector(c);u&&!r(u)&&(s=u)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement){if(a.target.tagName==="INPUT")return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;o!==l&&window.scrollTo(0,o),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function i0e(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function o0e(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Ul=o8(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ps(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:o0e(n)},i=[r0e(),n0e(),i0e()];i.forEach(({before:o})=>o==null?void 0:o(r)),i.forEach(({after:o})=>o==null?void 0:o(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Ul.subscribe(()=>{let e=Ul.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",i=n.count!==0;(i&&!r||!i&&r)&&Ul.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Ul.dispatch("TEARDOWN",n)}});function s0e(e,t,n=()=>({containers:[]})){let r=s8(Ul),i=t?r.get(t):void 0,o=i?i.count>0:!1;return sn(()=>{if(!(!t||!e))return Ul.dispatch("PUSH",t,n),()=>Ul.dispatch("POP",t,n)},[e,t]),o}function a0e(e,t,n=()=>[document.body]){let r=mR(e,"scroll-lock");s0e(r,t,i=>{var o;return{containers:[...(o=i.containers)!=null?o:[],n]}})}function cI(e){return[e.screenX,e.screenY]}function l0e(){let e=k.useRef([-1,-1]);return{wasMoved(t){let n=cI(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=cI(t)}}}function c0e(e=0){let[t,n]=k.useState(e),r=k.useCallback(l=>n(l),[t]),i=k.useCallback(l=>n(c=>c|l),[t]),o=k.useCallback(l=>(t&l)===l,[t]),s=k.useCallback(l=>n(c=>c&~l),[n]),a=k.useCallback(l=>n(c=>c^l),[n]);return{flags:t,setFlag:r,addFlag:i,hasFlag:o,removeFlag:s,toggleFlag:a}}var uI,dI;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((uI=process==null?void 0:process.env)==null?void 0:uI.NODE_ENV)==="test"&&typeof((dI=Element==null?void 0:Element.prototype)==null?void 0:dI.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
390
- `)),[]});var u0e=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(u0e||{});function d8(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function f8(e,t,n,r){let[i,o]=k.useState(n),{hasFlag:s,addFlag:a,removeFlag:l}=c0e(e&&i?3:0),c=k.useRef(!1),u=k.useRef(!1),d=Hd();return sn(()=>{var p;if(e){if(n&&o(!0),!t){n&&a(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),d0e(t,{inFlight:c,prepare(){u.current?u.current=!1:u.current=c.current,c.current=!0,!u.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){u.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var h;u.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(c.current=!1,l(7),n||o(!1),(h=r==null?void 0:r.end)==null||h.call(r,n))}})}},[e,n,t,d]),e?[i,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function d0e(e,{prepare:t,run:n,done:r,inFlight:i}){let o=ps();return h0e(e,{prepare:t,inFlight:i}),o.nextFrame(()=>{n(),o.requestAnimationFrame(()=>{o.add(f0e(e,r))})}),o.dispose}function f0e(e,t){var n,r;let i=ps();if(!e)return i.dispose;let o=!1;i.add(()=>{o=!0});let s=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return s.length===0?(t(),i.dispose):(Promise.allSettled(s.map(a=>a.finished)).then(()=>{o||t()}),i.dispose)}function h0e(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function p0e(e,{container:t,accept:n,walk:r}){let i=k.useRef(n),o=k.useRef(r);k.useEffect(()=>{i.current=n,o.current=r},[n,r]),sn(()=>{if(!t||!e)return;let s=zp(t);if(!s)return;let a=i.current,l=o.current,c=Object.assign(d=>a(d),{acceptNode:a}),u=s.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[t,e,i,o])}function fI(e,t){let n=k.useRef([]),r=Ke(e);k.useEffect(()=>{let i=[...n.current];for(let[o,s]of t.entries())if(n.current[o]!==s){let a=r(t,i);return n.current=t,a}},[r,...t])}function g0e(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const h8={...P},m0e=h8.useInsertionEffect,b0e=m0e||(e=>e());function p8(e){const t=P.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return b0e(()=>{t.current=e}),P.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}var l_=typeof document<"u"?k.useLayoutEffect:k.useEffect;let hI=!1,y0e=0;const pI=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+y0e++;function v0e(){const[e,t]=P.useState(()=>hI?pI():void 0);return l_(()=>{e==null&&t(pI())},[]),P.useEffect(()=>{hI=!0},[]),e}const x0e=h8.useId,w0e=x0e||v0e;let Vh;process.env.NODE_ENV!=="production"&&(Vh=new Set);function S0e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=Vh)!=null&&e.has(i))){var o;(o=Vh)==null||o.add(i),console.warn(i)}}function _0e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=Vh)!=null&&e.has(i))){var o;(o=Vh)==null||o.add(i),console.error(i)}}function C0e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const E0e=P.createContext(null),R0e=P.createContext(null),P0e=()=>{var e;return((e=P.useContext(E0e))==null?void 0:e.id)||null},T0e=()=>P.useContext(R0e),k0e="data-floating-ui-focusable";function A0e(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=w0e(),o=P.useRef({}),[s]=P.useState(()=>C0e()),a=P0e()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Ir(h)&&_0e("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=P.useState(r.reference),u=p8((h,m,b)=>{o.current.openEvent=h?m:void 0,s.emit("openchange",{open:h,event:m,reason:b,nested:a}),n==null||n(h,m,b)}),d=P.useMemo(()=>({setPositionReference:c}),[]),p=P.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return P.useMemo(()=>({dataRef:o,open:t,onOpenChange:u,elements:p,events:s,floatingId:i,refs:d}),[t,u,p,s,i,d])}function O0e(e){e===void 0&&(e={});const{nodeId:t}=e,n=A0e({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[o,s]=P.useState(null),[a,l]=P.useState(null),u=(i==null?void 0:i.domReference)||o,d=P.useRef(null),p=T0e();l_(()=>{u&&(d.current=u)},[u]);const h=j4({...e,elements:{...i,...a&&{reference:a}}}),m=P.useCallback(_=>{const E=Ir(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;l(E),h.refs.setReference(E)},[h.refs]),b=P.useCallback(_=>{(Ir(_)||_===null)&&(d.current=_,s(_)),(Ir(h.refs.reference.current)||h.refs.reference.current===null||_!==null&&!Ir(_))&&h.refs.setReference(_)},[h.refs]),y=P.useMemo(()=>({...h.refs,setReference:b,setPositionReference:m,domReference:d}),[h.refs,b,m]),x=P.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),w=P.useMemo(()=>({...h,...r,refs:y,elements:x,nodeId:t}),[h,y,x,t,r]);return l_(()=>{r.dataRef.current.floatingContext=w;const _=p==null?void 0:p.nodesRef.current.find(E=>E.id===t);_&&(_.context=w)}),P.useMemo(()=>({...h,context:w,refs:y,elements:x}),[h,y,x,w])}const gI="active",mI="selected";function Dw(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[gI]:s,[mI]:a,...l}=e;o=l}return{...n==="floating"&&{tabIndex:-1,[k0e]:""},...o,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(i&&[gI,mI].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),s[c]=function(){for(var p,h=arguments.length,m=new Array(h),b=0;b<h;b++)m[b]=arguments[b];return(p=r.get(c))==null?void 0:p.map(y=>y(...m)).find(y=>y!==void 0)}}}else s[c]=u}),s),{})}}function M0e(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),i=P.useCallback(a=>Dw(a,e,"reference"),t),o=P.useCallback(a=>Dw(a,e,"floating"),n),s=P.useCallback(a=>Dw(a,e,"item"),r);return P.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:s}),[i,o,s])}function bI(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const I0e=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:i,offset:o=0,index:s=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:c,...u}=ds(e,t),{rects:d,elements:{floating:p}}=t,h=n.current[s],m=(c==null?void 0:c.current)||p,b=p.clientTop||m.clientTop,y=p.clientTop!==0,x=m.clientTop!==0,w=p===m;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||S0e('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const _={...t,...await TE(-h.offsetTop-p.clientTop-d.reference.height/2-h.offsetHeight/2-o).fn(t)},E=await ew(bI(_,m.scrollHeight+b+p.clientTop),u),C=await ew(_,{...u,elementContext:"reference"}),R=kr(0,E.top),T=_.y+R,j=(m.scrollHeight>m.clientHeight?F=>F:$h)(kr(0,m.scrollHeight+(y&&w||x?b*2:0)-R-kr(0,E.bottom)));if(m.style.maxHeight=j+"px",m.scrollTop=R,i){const F=m.offsetHeight<h.offsetHeight*na(a,n.current.length)-1||C.top>=-l||C.bottom>=-l;mc.flushSync(()=>i(F))}return r&&(r.current=await ew(bI({..._,y:T},m.offsetHeight+b+p.clientTop),u)),{y:T}}});function D0e(e,t){const{open:n,elements:r}=e,{enabled:i=!0,overflowRef:o,scrollRef:s,onChange:a}=t,l=p8(a),c=P.useRef(!1),u=P.useRef(null),d=P.useRef(null);P.useEffect(()=>{if(!i)return;function h(b){if(b.ctrlKey||!m||o.current==null)return;const y=b.deltaY,x=o.current.top>=-.5,w=o.current.bottom>=-.5,_=m.scrollHeight-m.clientHeight,E=y<0?-1:1,C=y<0?"max":"min";m.scrollHeight<=m.clientHeight||(!x&&y>0||!w&&y<0?(b.preventDefault(),mc.flushSync(()=>{l(R=>R+Math[C](y,_*E))})):/firefox/i.test(g0e())&&(m.scrollTop+=y))}const m=(s==null?void 0:s.current)||r.floating;if(n&&m)return m.addEventListener("wheel",h),requestAnimationFrame(()=>{u.current=m.scrollTop,o.current!=null&&(d.current={...o.current})}),()=>{u.current=null,d.current=null,m.removeEventListener("wheel",h)}},[i,n,r.floating,o,s,l]);const p=P.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const h=(s==null?void 0:s.current)||r.floating;if(!(!o.current||!h||!c.current)){if(u.current!==null){const m=h.scrollTop-u.current;(o.current.bottom<-.5&&m<-1||o.current.top<-.5&&m>1)&&mc.flushSync(()=>l(b=>b+m))}requestAnimationFrame(()=>{u.current=h.scrollTop})}}}),[r.floating,l,o,s]);return P.useMemo(()=>i?{floating:p}:{},[i,p])}let Bp=k.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Bp.displayName="FloatingContext";let bR=k.createContext(null);bR.displayName="PlacementContext";function N0e(e){return k.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function L0e(){return k.useContext(Bp).setReference}function F0e(){let{getFloatingProps:e,slot:t}=k.useContext(Bp);return k.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function j0e(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=k.useContext(bR),n=k.useMemo(()=>e,[JSON.stringify(e,(i,o)=>{var s;return(s=o==null?void 0:o.outerHTML)!=null?s:o})]);sn(()=>{t==null||t(n??null)},[t,n]);let r=k.useContext(Bp);return k.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let yI=4;function $0e({children:e,enabled:t=!0}){let[n,r]=k.useState(null),[i,o]=k.useState(0),s=k.useRef(null),[a,l]=k.useState(null);z0e(a);let c=t&&n!==null&&a!==null,{to:u="bottom",gap:d=0,offset:p=0,padding:h=0,inner:m}=B0e(n,a),[b,y="center"]=u.split(" ");sn(()=>{c&&o(0)},[c]);let{refs:x,floatingStyles:w,context:_}=O0e({open:c,placement:b==="selection"?y==="center"?"bottom":`bottom-${y}`:y==="center"?`${b}`:`${b}-${y}`,strategy:"absolute",transform:!1,middleware:[TE({mainAxis:b==="selection"?0:d,crossAxis:p}),$4({padding:h}),b!=="selection"&&z4({padding:h}),b==="selection"&&m?I0e({...m,padding:h,overflowRef:s,offset:i,minItemsVisible:yI,referenceOverflowThreshold:h,onFallbackChange(F){var $,Q;if(!F)return;let H=_.elements.floating;if(!H)return;let L=parseFloat(getComputedStyle(H).scrollPaddingBottom)||0,G=Math.min(yI,H.childElementCount),V=0,B=0;for(let X of(Q=($=_.elements.floating)==null?void 0:$.childNodes)!=null?Q:[])if(X instanceof HTMLElement){let I=X.offsetTop,q=I+X.clientHeight+L,U=H.scrollTop,O=U+H.clientHeight;if(I>=U&&q<=O)G--;else{B=Math.max(0,Math.min(q,O)-Math.max(I,U)),V=X.clientHeight;break}}G>=1&&o(X=>{let I=V*G-B+L;return X>=I?X:I})}}):null,B4({padding:h,apply({availableWidth:F,availableHeight:$,elements:Q}){Object.assign(Q.floating.style,{overflow:"auto",maxWidth:`${F}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${$}px)`})}})].filter(Boolean),whileElementsMounted:L4}),[E=b,C=y]=_.placement.split("-");b==="selection"&&(E="selection");let R=k.useMemo(()=>({anchor:[E,C].filter(Boolean).join(" ")}),[E,C]),T=D0e(_,{overflowRef:s,onChange:o}),{getReferenceProps:M,getFloatingProps:N}=M0e([T]),j=Ke(F=>{l(F),x.setFloating(F)});return P.createElement(bR.Provider,{value:r},P.createElement(Bp.Provider,{value:{setFloating:j,setReference:x.setReference,styles:w,getReferenceProps:M,getFloatingProps:N,slot:R}},e))}function z0e(e){sn(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let i=parseInt(n);isNaN(i)||r!==i&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function B0e(e,t){var n,r,i;let o=Nw((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=Nw((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=Nw((i=e==null?void 0:e.padding)!=null?i:"var(--anchor-padding, 0)",t);return{...e,gap:o,offset:s,padding:a}}function Nw(e,t,n=void 0){let r=Hd(),i=Ke((l,c)=>{if(l==null)return[n,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!c)return[n,null];let u=vI(l,c);return[u,d=>{let p=g8(l);{let h=p.map(m=>window.getComputedStyle(c).getPropertyValue(m));r.requestAnimationFrame(function m(){r.nextFrame(m);let b=!1;for(let[x,w]of p.entries()){let _=window.getComputedStyle(c).getPropertyValue(w);if(h[x]!==_){h[x]=_,b=!0;break}}if(!b)return;let y=vI(l,c);u!==y&&(d(y),u=y)})}return r.dispose}]}return[n,null]}),o=k.useMemo(()=>i(e,t)[0],[e,t]),[s=o,a]=k.useState();return sn(()=>{let[l,c]=i(e,t);if(a(l),!!c)return c(a)},[e,t]),s}function g8(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),i=t[1].slice(n+1).trim();return i?[r,...g8(i)]:[r]}return[]}function vI(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function H0e({children:e,freeze:t}){let n=c_(t,e);return k.createElement(k.Fragment,null,n)}function c_(e,t){let[n,r]=k.useState(t);return!e&&n!==t&&r(t),e?n:t}let yR=k.createContext(null);yR.displayName="OpenClosedContext";var ko=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ko||{});function vR(){return k.useContext(yR)}function m8({value:e,children:t}){return k.createElement(yR.Provider,{value:e},t)}function V0e(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Fl=[];V0e(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Fl[0]===t.target)return;let n=t.target;n=n.closest(a_),Fl.unshift(n??t.target),Fl=Fl.filter(r=>r!=null&&r.isConnected),Fl.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 W0e(e){throw new Error("Unexpected object: "+e)}var Gn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Gn||{});function xI(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 1:{i===-1&&(i=n.length);for(let o=i-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 2:{for(let o=i+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return r}case 5:return null;default:W0e(e)}}var xR=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(xR||{});function U0e(e){let t=Ke(e),n=k.useRef(!1);k.useEffect(()=>(n.current=!1,()=>{n.current=!0,Yj(()=>{n.current&&t()})}),[t])}function G0e(){let e=typeof document>"u";return"useSyncExternalStore"in P?(t=>t.useSyncExternalStore)(P)(()=>()=>{},()=>!1,()=>!e):!1}function wR(){let e=G0e(),[t,n]=P.useState(hc.isHandoffComplete);return t&&hc.isHandoffComplete===!1&&n(!1),P.useEffect(()=>{t!==!0&&n(!0)},[t]),P.useEffect(()=>hc.handoff(),[]),e?!1:t}let q0e=k.createContext(!1);function Y0e(){return k.useContext(q0e)}function K0e(e){let t=Y0e(),n=k.useContext(y8),r=k0(e),[i,o]=k.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(hc.isServer)return null;let a=r==null?void 0:r.getElementById("headlessui-portal-root");if(a)return a;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return k.useEffect(()=>{i!==null&&(r!=null&&r.body.contains(i)||r==null||r.body.appendChild(i))},[i,r]),k.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),i}let b8=k.Fragment,X0e=xi(function(e,t){let n=e,r=k.useRef(null),i=Lo(gye(d=>{r.current=d}),t),o=k0(r),s=K0e(r),[a]=k.useState(()=>{var d;return hc.isServer?null:(d=o==null?void 0:o.createElement("div"))!=null?d:null}),l=k.useContext(eve),c=wR();sn(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),sn(()=>{if(a&&l)return l.register(a)},[l,a]),U0e(()=>{var d;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((d=s.parentElement)==null||d.removeChild(s)))});let u=Ui();return c?!s||!a?null:Ar.createPortal(u({ourProps:{ref:i},theirProps:n,slot:{},defaultTag:b8,name:"Portal"}),a):null});function Q0e(e,t){let n=Lo(t),{enabled:r=!0,...i}=e,o=Ui();return r?k.createElement(X0e,{...i,ref:n}):o({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:b8,name:"Portal"})}let Z0e=k.Fragment,y8=k.createContext(null);function J0e(e,t){let{target:n,...r}=e,i={ref:Lo(t)},o=Ui();return k.createElement(y8.Provider,{value:n},o({ourProps:i,theirProps:r,defaultTag:Z0e,name:"Popover.Group"}))}let eve=k.createContext(null),tve=xi(Q0e),nve=xi(J0e),rve=Object.assign(tve,{Group:nve});var ive=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ive||{}),ove=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(ove||{}),sve=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(sve||{}),ave=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=7]="UpdateVirtualConfiguration",e[e.SetInputElement=8]="SetInputElement",e[e.SetButtonElement=9]="SetButtonElement",e[e.SetOptionsElement=10]="SetOptionsElement",e))(ave||{});function Lw(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),i=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):Xye(r,s=>s.dataRef.current.domRef.current),o=n?i.indexOf(n):null;return o===-1&&(o=null),{options:i,activeOptionIndex:o}}let lve={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0,__demoMode:!1}}return{...e,comboboxState:0,__demoMode:!1}},3(e,t){return e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping}},2(e,t){var n,r,i,o;if((n=e.dataRef.current)!=null&&n.disabled||e.optionsElement&&!((r=e.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:c,disabled:u}=e.virtual,d=t.focus===Gn.Specific?t.idx:xI(t,{resolveItems:()=>c,resolveActiveIndex:()=>{var h,m;return(m=(h=e.activeOptionIndex)!=null?h:c.findIndex(b=>!u(b)))!=null?m:null},resolveDisabled:u,resolveId(){throw new Error("Function not implemented.")}}),p=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===d&&e.activationTrigger===p?e:{...e,activeOptionIndex:d,activationTrigger:p,isTyping:!1,__demoMode:!1}}let s=Lw(e);if(s.activeOptionIndex===null){let c=s.options.findIndex(u=>!u.dataRef.current.disabled);c!==-1&&(s.activeOptionIndex=c)}let a=t.focus===Gn.Specific?t.idx:xI(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled}),l=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===a&&e.activationTrigger===l?e:{...e,...s,isTyping:!1,activeOptionIndex:a,activationTrigger:l,__demoMode:!1}},4:(e,t)=>{var n,r,i;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let o=t.payload,s=Lw(e,l=>(l.push(o),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(o));let a={...e,...s,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},5:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(i=>i.id!==t.id)};let r=Lw(e,i=>{let o=i.findIndex(s=>s.id===t.id);return o!==-1&&i.splice(o,1),i});return{...e,...r,activationTrigger:2}},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n,r;if(e.virtual===null)return{...e,virtual:{options:t.options,disabled:(n=t.disabled)!=null?n:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let i=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?i=o:i=null}return{...e,activeOptionIndex:i,virtual:{options:t.options,disabled:(r=t.disabled)!=null?r:()=>!1}}},8:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},9:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},10:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},SR=k.createContext(null);SR.displayName="ComboboxActionsContext";function Hp(e){let t=k.useContext(SR);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Hp),n}return t}let v8=k.createContext(null);function cve(e){let t=Vd("VirtualProvider"),{options:n}=t.virtual,[r,i]=k.useMemo(()=>{let c=t.optionsElement;if(!c)return[0,0];let u=window.getComputedStyle(c);return[parseFloat(u.paddingBlockStart||u.paddingTop),parseFloat(u.paddingBlockEnd||u.paddingBottom)]},[t.optionsElement]),o=Fye({enabled:n.length!==0,scrollPaddingStart:r,scrollPaddingEnd:i,count:n.length,estimateSize(){return 40},getScrollElement(){return t.optionsElement},overscan:12}),[s,a]=k.useState(0);sn(()=>{a(c=>c+1)},[n]);let l=o.getVirtualItems();return l.length===0?null:k.createElement(v8.Provider,{value:o},k.createElement("div",{style:{position:"relative",width:"100%",height:`${o.getTotalSize()}px`},ref:c=>{c&&t.activationTrigger!==0&&t.activeOptionIndex!==null&&n.length>t.activeOptionIndex&&o.scrollToIndex(t.activeOptionIndex)}},l.map(c=>{var u;return k.createElement(k.Fragment,{key:c.key},k.cloneElement((u=e.children)==null?void 0:u.call(e,{...e.slot,option:n[c.index]}),{key:`${s}-${c.key}`,"data-index":c.index,"aria-setsize":n.length,"aria-posinset":c.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${c.start}px)`,overflowAnchor:"none"}}))})))}let Wh=k.createContext(null);Wh.displayName="ComboboxDataContext";function Vd(e){let t=k.useContext(Wh);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Vd),n}return t}function uve(e,t){return Oo(t.type,lve,e,t)}let dve=k.Fragment;function fve(e,t){var n,r;let i=fR(),{value:o,defaultValue:s,onChange:a,form:l,name:c,by:u,disabled:d=i||!1,onClose:p,__demoMode:h=!1,multiple:m=!1,immediate:b=!1,virtual:y=null,nullable:x,...w}=e,_=oye(s),[E=m?[]:void 0,C]=iye(o,a,_),[R,T]=k.useReducer(uve,{dataRef:k.createRef(),comboboxState:h?0:1,isTyping:!1,options:[],virtual:y?{options:y.options,disabled:(n=y.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:h}),M=k.useRef(!1),N=k.useRef({static:!1,hold:!1}),j=$ye(u),F=Ke(he=>y?u===null?y.options.indexOf(he):y.options.findIndex(_e=>j(_e,he)):R.options.findIndex(_e=>j(_e.dataRef.current.value,he))),$=k.useCallback(he=>Oo(H.mode,{1:()=>E.some(_e=>j(_e,he)),0:()=>j(E,he)}),[E]),Q=Ke(he=>R.activeOptionIndex===F(he)),H=k.useMemo(()=>({...R,immediate:b,optionsPropsRef:N,value:E,defaultValue:_,disabled:d,mode:m?1:0,virtual:y?R.virtual:null,get activeOptionIndex(){if(M.current&&R.activeOptionIndex===null&&(y?y.options.length>0:R.options.length>0)){if(y){let _e=y.options.findIndex(Ae=>{var Le,ke;return!((ke=(Le=y.disabled)==null?void 0:Le.call(y,Ae))!=null&&ke)});if(_e!==-1)return _e}let he=R.options.findIndex(_e=>!_e.dataRef.current.disabled);if(he!==-1)return he}return R.activeOptionIndex},calculateIndex:F,compare:j,isSelected:$,isActive:Q}),[E,_,d,m,h,R,y]);sn(()=>{var he;y&&T({type:7,options:y.options,disabled:(he=y.disabled)!=null?he:null})},[y,y==null?void 0:y.options,y==null?void 0:y.disabled]),sn(()=>{R.dataRef.current=H},[H]);let L=H.comboboxState===0;Jye(L,[H.buttonElement,H.inputElement,H.optionsElement],()=>J.closeCombobox());let G=k.useMemo(()=>{var he,_e,Ae;return{open:H.comboboxState===0,disabled:d,activeIndex:H.activeOptionIndex,activeOption:H.activeOptionIndex===null?null:H.virtual?H.virtual.options[(he=H.activeOptionIndex)!=null?he:0]:(Ae=(_e=H.options[H.activeOptionIndex])==null?void 0:_e.dataRef.current.value)!=null?Ae:null,value:E}},[H,d,E]),V=Ke(()=>{if(H.activeOptionIndex!==null){if(J.setIsTyping(!1),H.virtual)O(H.virtual.options[H.activeOptionIndex]);else{let{dataRef:he}=H.options[H.activeOptionIndex];O(he.current.value)}J.goToOption(Gn.Specific,H.activeOptionIndex)}}),B=Ke(()=>{T({type:0}),M.current=!0}),X=Ke(()=>{T({type:1}),M.current=!1,p==null||p()}),I=Ke(he=>{T({type:3,isTyping:he})}),q=Ke((he,_e,Ae)=>(M.current=!1,he===Gn.Specific?T({type:2,focus:Gn.Specific,idx:_e,trigger:Ae}):T({type:2,focus:he,trigger:Ae}))),U=Ke((he,_e)=>(T({type:4,payload:{id:he,dataRef:_e}}),()=>{H.isActive(_e.current.value)&&(M.current=!0),T({type:5,id:he})})),O=Ke(he=>Oo(H.mode,{0(){return C==null?void 0:C(he)},1(){let _e=H.value.slice(),Ae=_e.findIndex(Le=>j(Le,he));return Ae===-1?_e.push(he):_e.splice(Ae,1),C==null?void 0:C(_e)}})),ee=Ke(he=>{T({type:6,trigger:he})}),K=Ke(he=>{T({type:8,element:he})}),oe=Ke(he=>{T({type:9,element:he})}),Y=Ke(he=>{T({type:10,element:he})}),J=k.useMemo(()=>({onChange:O,registerOption:U,goToOption:q,setIsTyping:I,closeCombobox:X,openCombobox:B,setActivationTrigger:ee,selectActiveOption:V,setInputElement:K,setButtonElement:oe,setOptionsElement:Y}),[]),[se,ae]=xye(),ge=t===null?{}:{ref:t},ne=k.useCallback(()=>{if(_!==void 0)return C==null?void 0:C(_)},[C,_]),fe=Ui();return k.createElement(ae,{value:se,props:{htmlFor:(r=H.inputElement)==null?void 0:r.id},slot:{open:H.comboboxState===0,disabled:d}},k.createElement($0e,null,k.createElement(SR.Provider,{value:J},k.createElement(Wh.Provider,{value:H},k.createElement(m8,{value:Oo(H.comboboxState,{0:ko.Open,1:ko.Closed})},c!=null&&k.createElement(uye,{disabled:d,data:E!=null?{[c]:E}:{},form:l,onReset:ne}),fe({ourProps:ge,theirProps:w,slot:G,defaultTag:dve,name:"Combobox"}))))))}let hve="input";function pve(e,t){var n,r,i,o,s;let a=Vd("Combobox.Input"),l=Hp("Combobox.Input"),c=k.useId(),u=e8(),{id:d=u||`headlessui-combobox-input-${c}`,onChange:p,displayValue:h,disabled:m=a.disabled||!1,autoFocus:b=!1,type:y="text",...x}=e,w=k.useRef(null),_=Lo(w,t,L0e(),l.setInputElement),E=k0(a.inputElement),C=Hd(),R=Ke(()=>{l.onChange(null),a.optionsElement&&(a.optionsElement.scrollTop=0),l.goToOption(Gn.Nothing)}),T=k.useMemo(()=>{var O;return typeof h=="function"&&a.value!==void 0?(O=h(a.value))!=null?O:"":typeof a.value=="string"?a.value:""},[a.value,h]);fI(([O,ee],[K,oe])=>{if(a.isTyping)return;let Y=w.current;Y&&((oe===0&&ee===1||O!==K)&&(Y.value=O),requestAnimationFrame(()=>{if(a.isTyping||!Y||(E==null?void 0:E.activeElement)!==Y)return;let{selectionStart:J,selectionEnd:se}=Y;Math.abs((se??0)-(J??0))===0&&J===0&&Y.setSelectionRange(Y.value.length,Y.value.length)}))},[T,a.comboboxState,E,a.isTyping]),fI(([O],[ee])=>{if(O===0&&ee===1){if(a.isTyping)return;let K=w.current;if(!K)return;let oe=K.value,{selectionStart:Y,selectionEnd:J,selectionDirection:se}=K;K.value="",K.value=oe,se!==null?K.setSelectionRange(Y,J,se):K.setSelectionRange(Y,J)}},[a.comboboxState]);let M=k.useRef(!1),N=Ke(()=>{M.current=!0}),j=Ke(()=>{C.nextFrame(()=>{M.current=!1})}),F=Ke(O=>{switch(l.setIsTyping(!0),O.key){case Gr.Enter:if(a.comboboxState!==0||M.current)return;if(O.preventDefault(),O.stopPropagation(),a.activeOptionIndex===null){l.closeCombobox();return}l.selectActiveOption(),a.mode===0&&l.closeCombobox();break;case Gr.ArrowDown:return O.preventDefault(),O.stopPropagation(),Oo(a.comboboxState,{0:()=>l.goToOption(Gn.Next),1:()=>l.openCombobox()});case Gr.ArrowUp:return O.preventDefault(),O.stopPropagation(),Oo(a.comboboxState,{0:()=>l.goToOption(Gn.Previous),1:()=>{Ar.flushSync(()=>l.openCombobox()),a.value||l.goToOption(Gn.Last)}});case Gr.Home:if(O.shiftKey)break;return O.preventDefault(),O.stopPropagation(),l.goToOption(Gn.First);case Gr.PageUp:return O.preventDefault(),O.stopPropagation(),l.goToOption(Gn.First);case Gr.End:if(O.shiftKey)break;return O.preventDefault(),O.stopPropagation(),l.goToOption(Gn.Last);case Gr.PageDown:return O.preventDefault(),O.stopPropagation(),l.goToOption(Gn.Last);case Gr.Escape:return a.comboboxState!==0?void 0:(O.preventDefault(),a.optionsElement&&!a.optionsPropsRef.current.static&&O.stopPropagation(),a.mode===0&&a.value===null&&R(),l.closeCombobox());case Gr.Tab:if(a.comboboxState!==0)return;a.mode===0&&a.activationTrigger!==1&&l.selectActiveOption(),l.closeCombobox();break}}),$=Ke(O=>{p==null||p(O),a.mode===0&&O.target.value===""&&R(),l.openCombobox()}),Q=Ke(O=>{var ee,K,oe;let Y=(ee=O.relatedTarget)!=null?ee:Fl.find(J=>J!==O.currentTarget);if(!((K=a.optionsElement)!=null&&K.contains(Y))&&!((oe=a.buttonElement)!=null&&oe.contains(Y))&&a.comboboxState===0)return O.preventDefault(),a.mode===0&&a.value===null&&R(),l.closeCombobox()}),H=Ke(O=>{var ee,K,oe;let Y=(ee=O.relatedTarget)!=null?ee:Fl.find(J=>J!==O.currentTarget);(K=a.buttonElement)!=null&&K.contains(Y)||(oe=a.optionsElement)!=null&&oe.contains(Y)||a.disabled||a.immediate&&a.comboboxState!==0&&C.microTask(()=>{Ar.flushSync(()=>l.openCombobox()),l.setActivationTrigger(1)})}),L=T0(),G=mye(),{isFocused:V,focusProps:B}=qj({autoFocus:b}),{isHovered:X,hoverProps:I}=Gj({isDisabled:m}),q=k.useMemo(()=>({open:a.comboboxState===0,disabled:m,hover:X,focus:V,autofocus:b}),[a,X,V,b,m]),U=hR({ref:_,id:d,role:"combobox",type:y,"aria-controls":(n=a.optionsElement)==null?void 0:n.id,"aria-expanded":a.comboboxState===0,"aria-activedescendant":a.activeOptionIndex===null?void 0:a.virtual?(r=a.options.find(O=>!O.dataRef.current.disabled&&a.compare(O.dataRef.current.value,a.virtual.options[a.activeOptionIndex])))==null?void 0:r.id:(i=a.options[a.activeOptionIndex])==null?void 0:i.id,"aria-labelledby":L,"aria-describedby":G,"aria-autocomplete":"list",defaultValue:(s=(o=e.defaultValue)!=null?o:a.defaultValue!==void 0?h==null?void 0:h(a.defaultValue):null)!=null?s:a.defaultValue,disabled:m||void 0,autoFocus:b,onCompositionStart:N,onCompositionEnd:j,onKeyDown:F,onChange:$,onFocus:H,onBlur:Q},B,I);return Ui()({ourProps:U,theirProps:x,slot:q,defaultTag:hve,name:"Combobox.Input"})}let gve="button";function mve(e,t){var n;let r=Vd("Combobox.Button"),i=Hp("Combobox.Button"),o=Lo(t,i.setButtonElement),s=k.useId(),{id:a=`headlessui-combobox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:c=!1,...u}=e,d=u8(r.inputElement),p=Ke(T=>{switch(T.key){case Gr.Space:case Gr.Enter:T.preventDefault(),T.stopPropagation(),r.comboboxState===1&&Ar.flushSync(()=>i.openCombobox()),d();return;case Gr.ArrowDown:T.preventDefault(),T.stopPropagation(),r.comboboxState===1&&(Ar.flushSync(()=>i.openCombobox()),r.value||i.goToOption(Gn.First)),d();return;case Gr.ArrowUp:T.preventDefault(),T.stopPropagation(),r.comboboxState===1&&(Ar.flushSync(()=>i.openCombobox()),r.value||i.goToOption(Gn.Last)),d();return;case Gr.Escape:if(r.comboboxState!==0)return;T.preventDefault(),r.optionsElement&&!r.optionsPropsRef.current.static&&T.stopPropagation(),Ar.flushSync(()=>i.closeCombobox()),d();return;default:return}}),h=Ke(T=>{T.preventDefault(),!hye(T.currentTarget)&&(T.button===xR.Left&&(r.comboboxState===0?i.closeCombobox():i.openCombobox()),d())}),m=T0([a]),{isFocusVisible:b,focusProps:y}=qj({autoFocus:c}),{isHovered:x,hoverProps:w}=Gj({isDisabled:l}),{pressed:_,pressProps:E}=Zbe({disabled:l}),C=k.useMemo(()=>({open:r.comboboxState===0,active:_||r.comboboxState===0,disabled:l,value:r.value,hover:x,focus:b}),[r,x,b,_,l]),R=hR({ref:o,id:a,type:t0e(e,r.buttonElement),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsElement)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":m,disabled:l||void 0,autoFocus:c,onMouseDown:h,onKeyDown:p},y,w,E);return Ui()({ourProps:R,theirProps:u,slot:C,defaultTag:gve,name:"Combobox.Button"})}let bve="div",yve=sy.RenderStrategy|sy.Static;function vve(e,t){var n,r,i;let o=k.useId(),{id:s=`headlessui-combobox-options-${o}`,hold:a=!1,anchor:l,portal:c=!1,modal:u=!0,transition:d=!1,...p}=e,h=Vd("Combobox.Options"),m=Hp("Combobox.Options"),b=N0e(l);b&&(c=!0);let[y,x]=j0e(b),[w,_]=k.useState(null),E=F0e(),C=Lo(t,b?y:null,m.setOptionsElement,_),R=k0(h.optionsElement),T=vR(),[M,N]=f8(d,w,T!==null?(T&ko.Open)===ko.Open:h.comboboxState===0);Wye(M,h.inputElement,m.closeCombobox);let j=h.__demoMode?!1:u&&h.comboboxState===0;a0e(j,R);let F=h.__demoMode?!1:u&&h.comboboxState===0;Vye(F,{allowed:k.useCallback(()=>[h.inputElement,h.buttonElement,h.optionsElement],[h.inputElement,h.buttonElement,h.optionsElement])}),sn(()=>{var U;h.optionsPropsRef.current.static=(U=e.static)!=null?U:!1},[h.optionsPropsRef,e.static]),sn(()=>{h.optionsPropsRef.current.hold=a},[h.optionsPropsRef,a]),p0e(h.comboboxState===0,{container:h.optionsElement,accept(U){return U.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:U.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(U){U.setAttribute("role","none")}});let $=T0([(n=h.buttonElement)==null?void 0:n.id]),Q=k.useMemo(()=>({open:h.comboboxState===0,option:void 0}),[h.comboboxState]),H=Ke(()=>{m.setActivationTrigger(0)}),L=Ke(U=>{U.preventDefault(),m.setActivationTrigger(0)}),G=hR(b?E():{},{"aria-labelledby":$,role:"listbox","aria-multiselectable":h.mode===1?!0:void 0,id:s,ref:C,style:{...p.style,...x,"--input-width":oI(h.inputElement,!0).width,"--button-width":oI(h.buttonElement,!0).width},onWheel:h.activationTrigger===0?void 0:H,onMouseDown:L,...d8(N)}),V=M&&h.comboboxState===1,B=c_(V,(r=h.virtual)==null?void 0:r.options),X=c_(V,h.value),I=Ke(U=>h.compare(X,U));if(h.virtual){if(B===void 0)throw new Error("Missing `options` in virtual mode");Object.assign(p,{children:k.createElement(Wh.Provider,{value:B!==h.virtual.options?{...h,virtual:{...h.virtual,options:B}}:h},k.createElement(cve,{slot:Q},p.children))})}let q=Ui();return k.createElement(rve,{enabled:c?e.static||M:!1},k.createElement(Wh.Provider,{value:h.mode===1?h:{...h,isSelected:I}},q({ourProps:G,theirProps:{...p,children:k.createElement(H0e,{freeze:V},typeof p.children=="function"?(i=p.children)==null?void 0:i.call(p,Q):p.children)},slot:Q,defaultTag:bve,features:yve,visible:M,name:"Combobox.Options"})))}let xve="div";function wve(e,t){var n,r,i,o;let s=Vd("Combobox.Option"),a=Hp("Combobox.Option"),l=k.useId(),{id:c=`headlessui-combobox-option-${l}`,value:u,disabled:d=(i=(r=(n=s.virtual)==null?void 0:n.disabled)==null?void 0:r.call(n,u))!=null?i:!1,order:p=null,...h}=e,m=u8(s.inputElement),b=s.virtual?s.activeOptionIndex===s.calculateIndex(u):s.activeOptionIndex===null?!1:((o=s.options[s.activeOptionIndex])==null?void 0:o.id)===c,y=s.isSelected(u),x=k.useRef(null),w=cl({disabled:d,value:u,domRef:x,order:p}),_=k.useContext(v8),E=Lo(t,x,_?_.measureElement:null),C=Ke(()=>{a.setIsTyping(!1),a.onChange(u)});sn(()=>a.registerOption(c,w),[w,c]);let R=k.useRef(!(s.virtual||s.__demoMode));sn(()=>{if(!s.virtual&&!s.__demoMode)return ps().requestAnimationFrame(()=>{R.current=!0})},[s.virtual,s.__demoMode]),sn(()=>{if(R.current&&s.comboboxState===0&&b&&s.activationTrigger!==0)return ps().requestAnimationFrame(()=>{var L,G;(G=(L=x.current)==null?void 0:L.scrollIntoView)==null||G.call(L,{block:"nearest"})})},[x,b,s.comboboxState,s.activationTrigger,s.activeOptionIndex]);let T=Ke(L=>{L.preventDefault(),L.button===xR.Left&&(d||(C(),c8()||requestAnimationFrame(()=>m()),s.mode===0&&a.closeCombobox()))}),M=Ke(()=>{if(d)return a.goToOption(Gn.Nothing);let L=s.calculateIndex(u);a.goToOption(Gn.Specific,L)}),N=l0e(),j=Ke(L=>N.update(L)),F=Ke(L=>{if(!N.wasMoved(L)||d||b)return;let G=s.calculateIndex(u);a.goToOption(Gn.Specific,G,0)}),$=Ke(L=>{N.wasMoved(L)&&(d||b&&(s.optionsPropsRef.current.hold||a.goToOption(Gn.Nothing)))}),Q=k.useMemo(()=>({active:b,focus:b,selected:y,disabled:d}),[b,y,d]),H={id:c,ref:E,role:"option",tabIndex:d===!0?void 0:-1,"aria-disabled":d===!0?!0:void 0,"aria-selected":y,disabled:void 0,onMouseDown:T,onFocus:M,onPointerEnter:j,onMouseEnter:j,onPointerMove:F,onMouseMove:F,onPointerLeave:$,onMouseLeave:$};return Ui()({ourProps:H,theirProps:h,slot:Q,defaultTag:xve,name:"Combobox.Option"})}let Sve=xi(fve),x8=xi(mve),w8=xi(pve),_ve=Cye,S8=xi(vve),_8=xi(wve),Cve=Object.assign(Sve,{Input:w8,Button:x8,Label:_ve,Options:S8,Option:_8});function Eve(){let e=k.useRef(!1);return sn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function C8(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:R8)!==k.Fragment||k.Children.count(e.children)===1}let A0=k.createContext(null);A0.displayName="TransitionContext";var Rve=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Rve||{});function Pve(){let e=k.useContext(A0);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Tve(){let e=k.useContext(O0);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let O0=k.createContext(null);O0.displayName="NestingContext";function M0(e){return"children"in e?M0(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function E8(e,t){let n=cl(e),r=k.useRef([]),i=Eve(),o=Hd(),s=Ke((h,m=za.Hidden)=>{let b=r.current.findIndex(({el:y})=>y===h);b!==-1&&(Oo(m,{[za.Unmount](){r.current.splice(b,1)},[za.Hidden](){r.current[b].state="hidden"}}),o.microTask(()=>{var y;!M0(r)&&i.current&&((y=n.current)==null||y.call(n))}))}),a=Ke(h=>{let m=r.current.find(({el:b})=>b===h);return m?m.state!=="visible"&&(m.state="visible"):r.current.push({el:h,state:"visible"}),()=>s(h,za.Unmount)}),l=k.useRef([]),c=k.useRef(Promise.resolve()),u=k.useRef({enter:[],leave:[]}),d=Ke((h,m,b)=>{l.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([y])=>y!==h)),t==null||t.chains.current[m].push([h,new Promise(y=>{l.current.push(y)})]),t==null||t.chains.current[m].push([h,new Promise(y=>{Promise.all(u.current[m].map(([x,w])=>w)).then(()=>y())})]),m==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(m)):b(m)}),p=Ke((h,m,b)=>{Promise.all(u.current[m].splice(0).map(([y,x])=>x)).then(()=>{var y;(y=l.current.shift())==null||y()}).then(()=>b(m))});return k.useMemo(()=>({children:r,register:a,unregister:s,onStart:d,onStop:p,wait:c,chains:u}),[a,s,r,d,p,u,c])}let R8=k.Fragment,P8=sy.RenderStrategy;function kve(e,t){var n,r;let{transition:i=!0,beforeEnter:o,afterEnter:s,beforeLeave:a,afterLeave:l,enter:c,enterFrom:u,enterTo:d,entered:p,leave:h,leaveFrom:m,leaveTo:b,...y}=e,[x,w]=k.useState(null),_=k.useRef(null),E=C8(e),C=Lo(...E?[_,t,w]:t===null?[]:[t]),R=(n=y.unmount)==null||n?za.Unmount:za.Hidden,{show:T,appear:M,initial:N}=Pve(),[j,F]=k.useState(T?"visible":"hidden"),$=Tve(),{register:Q,unregister:H}=$;sn(()=>Q(_),[Q,_]),sn(()=>{if(R===za.Hidden&&_.current){if(T&&j!=="visible"){F("visible");return}return Oo(j,{hidden:()=>H(_),visible:()=>Q(_)})}},[j,_,Q,H,T,R]);let L=wR();sn(()=>{if(E&&L&&j==="visible"&&_.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,j,L,E]);let G=N&&!M,V=M&&T&&N,B=k.useRef(!1),X=E8(()=>{B.current||(F("hidden"),H(_))},$),I=Ke(Y=>{B.current=!0;let J=Y?"enter":"leave";X.onStart(_,J,se=>{se==="enter"?o==null||o():se==="leave"&&(a==null||a())})}),q=Ke(Y=>{let J=Y?"enter":"leave";B.current=!1,X.onStop(_,J,se=>{se==="enter"?s==null||s():se==="leave"&&(l==null||l())}),J==="leave"&&!M0(X)&&(F("hidden"),H(_))});k.useEffect(()=>{E&&i||(I(T),q(T))},[T,E,i]);let U=!(!i||!E||!L||G),[,O]=f8(U,x,T,{start:I,end:q}),ee=Ea({ref:C,className:((r=o_(y.className,V&&c,V&&u,O.enter&&c,O.enter&&O.closed&&u,O.enter&&!O.closed&&d,O.leave&&h,O.leave&&!O.closed&&m,O.leave&&O.closed&&b,!O.transition&&T&&p))==null?void 0:r.trim())||void 0,...d8(O)}),K=0;j==="visible"&&(K|=ko.Open),j==="hidden"&&(K|=ko.Closed),O.enter&&(K|=ko.Opening),O.leave&&(K|=ko.Closing);let oe=Ui();return k.createElement(O0.Provider,{value:X},k.createElement(m8,{value:K},oe({ourProps:ee,theirProps:y,defaultTag:R8,features:P8,visible:j==="visible",name:"Transition.Child"})))}function Ave(e,t){let{show:n,appear:r=!1,unmount:i=!0,...o}=e,s=k.useRef(null),a=C8(e),l=Lo(...a?[s,t]:t===null?[]:[t]);wR();let c=vR();if(n===void 0&&c!==null&&(n=(c&ko.Open)===ko.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=k.useState(n?"visible":"hidden"),p=E8(()=>{n||d("hidden")}),[h,m]=k.useState(!0),b=k.useRef([n]);sn(()=>{h!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),m(!1))},[b,n]);let y=k.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);sn(()=>{n?d("visible"):!M0(p)&&s.current!==null&&d("hidden")},[n,p]);let x={unmount:i},w=Ke(()=>{var C;h&&m(!1),(C=e.beforeEnter)==null||C.call(e)}),_=Ke(()=>{var C;h&&m(!1),(C=e.beforeLeave)==null||C.call(e)}),E=Ui();return k.createElement(O0.Provider,{value:p},k.createElement(A0.Provider,{value:y},E({ourProps:{...x,as:k.Fragment,children:k.createElement(T8,{ref:l,...x,...o,beforeEnter:w,beforeLeave:_})},theirProps:{},defaultTag:k.Fragment,features:P8,visible:u==="visible",name:"Transition"})))}function Ove(e,t){let n=k.useContext(A0)!==null,r=vR()!==null;return k.createElement(k.Fragment,null,!n&&r?k.createElement(u_,{ref:t,...e}):k.createElement(T8,{ref:t,...e}))}let u_=xi(Ave),T8=xi(kve),Mve=xi(Ove),Ive=Object.assign(u_,{Child:Mve,Root:u_});var _R="Checkbox",[Dve,KAe]=rr(_R),[Nve,Lve]=Dve(_R),k8=P.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=P.useState(null),m=it(t,E=>h(E)),b=P.useRef(!1),y=p?u||!!p.closest("form"):!0,[x=!1,w]=Dr({prop:i,defaultProp:o,onChange:c}),_=P.useRef(x);return P.useEffect(()=>{const E=p==null?void 0:p.form;if(E){const C=()=>w(_.current);return E.addEventListener("reset",C),()=>E.removeEventListener("reset",C)}},[p,w]),v.jsxs(Nve,{scope:n,state:x,disabled:a,children:[v.jsx(Fe.button,{type:"button",role:"checkbox","aria-checked":Va(x)?"mixed":x,"aria-required":s,"data-state":M8(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onKeyDown:Pe(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:Pe(e.onClick,E=>{w(C=>Va(C)?!0:!C),y&&(b.current=E.isPropagationStopped(),b.current||E.stopPropagation())})}),y&&v.jsx(Fve,{control:p,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Va(o)?!1:o})]})});k8.displayName=_R;var A8="CheckboxIndicator",O8=P.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Lve(A8,n);return v.jsx(Kn,{present:r||Va(o.state)||o.state===!0,children:v.jsx(Fe.span,{"data-state":M8(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});O8.displayName=A8;var Fve=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...o}=e,s=P.useRef(null),a=g0(n),l=s0(t);P.useEffect(()=>{const u=s.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&h){const m=new Event("click",{bubbles:r});u.indeterminate=Va(n),h.call(u,Va(n)?!1:n),u.dispatchEvent(m)}},[a,n,r]);const c=P.useRef(Va(n)?!1:n);return v.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??c.current,...o,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Va(e){return e==="indeterminate"}function M8(e){return Va(e)?"indeterminate":e?"checked":"unchecked"}var I8=k8,jve=O8;const I0=P.forwardRef(({className:e,...t},n)=>v.jsx(I8,{ref:n,className:me("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:v.jsx(jve,{className:me("flex items-center justify-center text-current"),children:v.jsx(Md,{className:"h-4 w-4"})})}));I0.displayName=I8.displayName;function $ve(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[i,o]=e.split(r);return{operation:r,value:o.trim()}}else return null}function zve(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,i=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return kd(e)?i:r}function Bve(e){const t=ye(o=>{var s,a;return(a=(s=o==null?void 0:o.dashboard)==null?void 0:s.filters)==null?void 0:a.find(l=>l.id===e)}),{query:n,setQuery:r,...i}=CR(t||{});return i}function CR(e){const[t,n]=k.useState([]),[r,i]=k.useState(""),o=ye(R=>R.filterValues),s=ye(R=>R.selectedSheetId),{addOrUpdateFilterValue:a,removeFilterValues:l}=Vn(),{data:c,isLoading:u,isFetching:d,isError:p}=Lj(e),h=k.useMemo(()=>{var T;return e.column?(T=c==null?void 0:c.records)==null?void 0:T.map(M=>{let N=e.column.split(".").slice(-1)[0].replace(/"/g,"");return M[N]===void 0&&(N=N.toLowerCase()),{id:M[N],value:M[N]}}):[]},[c,e.column]);k.useEffect(()=>{if(o){const R=o.find(T=>T.filterId===e.id);if(!R){n([]);return}if(R.operation==="in"){const T=h==null?void 0:h.filter(M=>R.values.includes(M.value));T&&n(T)}}},[c,s,o,e.id,h]),k.useEffect(()=>{if(o&&!o.find(T=>T.filterId===e.id)){n([]);return}},[o,e.id]);function m(R){const T=$ve(R[0].toString());if(!(T!=null&&T.value)||!(T!=null&&T.operation))return;const M={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Au(e),name:e.column,operation:T.operation,values:[Number(T.value)]};a(M)}function b(R){if(Array.isArray(R)||(R=[R]),R.length===1&&h.find(M=>M.value===R[0].value)===void 0){m(R);return}if(n(R),R.length===0){l(e.id);return}const T={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Au(e),operation:e.operation,values:R.map(M=>M.value)};a(T)}function y(){n([]),l(e.id)}function x(R){if(R){n(h);const T={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Au(e),operation:e.operation,values:h.map(M=>M.value)};a(T)}else y()}function w(){if(cp(e.dataType))return h;const R=r.toLowerCase().replace(/\s+/g,"");return r===""?h:h.filter(T=>T.value.toLowerCase().replace(/\s+/g,"").includes(R))}const _=w(),E=e.type==="single",C=t.length===(h==null?void 0:h.length);return{isLoading:u,isFetching:d,isError:p,records:h,selectedRecords:t,handleChange:b,handleClear:y,handleSelectAll:x,query:r,setQuery:i,filteredRecords:_,isSingleSelect:E,allSelected:C}}function Hve({filter:e}){var h,m,b,y,x,w;const t=ye(_=>_.themeStyle),{filteredRecords:n,isSingleSelect:r,allSelected:i,handleChange:o,handleSelectAll:s,query:a,setQuery:l,isLoading:c,isFetching:u,isError:d,selectedRecords:p}=CR(e);return c||u?v.jsx(Mu,{style:{borderRadius:(m=(h=t==null?void 0:t.chart)==null?void 0:h.options)==null?void 0:m.borderRadius},className:"h-8 w-full bg-foreground/10"}):d?v.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"}):v.jsx("div",{className:"w-full",children:v.jsx(Cve,{value:p,multiple:!r,onChange:o,children:v.jsxs("div",{className:"relative",children:[v.jsxs("div",{style:{borderRadius:(y=(b=t==null?void 0:t.chart)==null?void 0:b.options)==null?void 0:y.borderRadius},className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[v.jsx(w8,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:_=>_.map(C=>C.value).join(", "),onChange:_=>{l(_.target.value)}}),v.jsx(x8,{className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:v.jsx(mp,{className:"size-4 text-gray-400","aria-hidden":"true"})})]}),v.jsx(Ive,{as:k.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>l(""),children:v.jsxs(S8,{style:{borderRadius:(w=(x=t==null?void 0:t.chart)==null?void 0:x.options)==null?void 0:w.borderRadius},className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base text-foreground/80 shadow-lg focus:outline-none sm:text-sm",children:[e.type==="multiple"||e.type===void 0&&v.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-b-muted px-4 py-2",children:[v.jsx("span",{children:"Select All"}),v.jsx(I0,{className:"border-muted-foreground/50",checked:i,onCheckedChange:s})]}),(n==null?void 0:n.length)===0&&a!==""?v.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):n==null?void 0:n.map(_=>{var E,C;return v.jsx(_8,{style:{borderRadius:(C=(E=t==null?void 0:t.chart)==null?void 0:E.options)==null?void 0:C.borderRadius},className:({active:R})=>`relative m-1 cursor-default select-none py-2 pl-10 pr-4 ${R?"bg-muted":"text-foreground-900"}`,value:_,children:({selected:R,active:T})=>v.jsxs("div",{className:"",children:[v.jsx("span",{className:`block ${R?"font-medium":"font-normal"}`,children:typeof _.value=="boolean"?_.value?"True":"False":_.value}),R?v.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:v.jsx(FC,{className:"size-4","aria-hidden":"true"})}):null]})},_.value)})]})})]})})})}var ER="Radio",[Vve,D8]=rr(ER),[Wve,Uve]=Vve(ER),N8=P.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:s,value:a="on",onCheck:l,form:c,...u}=e,[d,p]=P.useState(null),h=it(t,y=>p(y)),m=P.useRef(!1),b=d?c||!!d.closest("form"):!0;return v.jsxs(Wve,{scope:n,checked:i,disabled:s,children:[v.jsx(Fe.button,{type:"button",role:"radio","aria-checked":i,"data-state":j8(i),"data-disabled":s?"":void 0,disabled:s,value:a,...u,ref:h,onClick:Pe(e.onClick,y=>{i||l==null||l(),b&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),b&&v.jsx(Gve,{control:d,bubbles:!m.current,name:r,value:a,checked:i,required:o,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});N8.displayName=ER;var L8="RadioIndicator",F8=P.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=Uve(L8,n);return v.jsx(Kn,{present:r||o.checked,children:v.jsx(Fe.span,{"data-state":j8(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t})})});F8.displayName=L8;var Gve=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=P.useRef(null),s=g0(n),a=s0(t);return P.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const p=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(p)}},[s,n,r]),v.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function j8(e){return e?"checked":"unchecked"}var qve=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],RR="RadioGroup",[Yve,XAe]=rr(RR,[Od,D8]),$8=Od(),z8=D8(),[Kve,Xve]=Yve(RR),B8=P.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...p}=e,h=$8(n),m=Nc(c),[b,y]=Dr({prop:o,defaultProp:i,onChange:d});return v.jsx(Kve,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:y,children:v.jsx(aC,{asChild:!0,...h,orientation:l,dir:m,loop:u,children:v.jsx(Fe.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:m,...p,ref:t})})})});B8.displayName=RR;var H8="RadioGroupItem",V8=P.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=Xve(H8,n),s=o.disabled||r,a=$8(n),l=z8(n),c=P.useRef(null),u=it(t,c),d=o.value===i.value,p=P.useRef(!1);return P.useEffect(()=>{const h=b=>{qve.includes(b.key)&&(p.current=!0)},m=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),v.jsx(lC,{asChild:!0,...a,focusable:!s,active:d,children:v.jsx(N8,{disabled:s,required:o.required,checked:d,...l,...i,name:o.name,ref:u,onCheck:()=>o.onValueChange(i.value),onKeyDown:Pe(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Pe(i.onFocus,()=>{var h;p.current&&((h=c.current)==null||h.click())})})})});V8.displayName=H8;var Qve="RadioGroupIndicator",W8=P.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=z8(n);return v.jsx(F8,{...i,...r,ref:t})});W8.displayName=Qve;var U8=B8,G8=V8,Zve=W8;const Uh=P.forwardRef(({className:e,...t},n)=>v.jsx(U8,{className:me("grid gap-2",e),...t,ref:n}));Uh.displayName=U8.displayName;const Gl=P.forwardRef(({className:e,...t},n)=>v.jsx(G8,{ref:n,className:me("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:v.jsx(Zve,{className:"flex items-center justify-center",children:v.jsx($C,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Gl.displayName=G8.displayName;function Jve({filter:e}){var o;const{filteredRecords:t,handleChange:n,selectedRecords:r}=CR(e);function i(s){n([{value:s,id:s}])}return v.jsx(Uh,{onValueChange:i,value:((o=r==null?void 0:r[0])==null?void 0:o.value)||"",className:"mt-2 flex gap-3 overflow-x-auto",children:t==null?void 0:t.map(s=>v.jsxs("div",{className:"flex gap-2",children:[v.jsx(Gl,{value:s.value,id:"r1"}),v.jsx(Sn,{className:"text-muted-foreground",htmlFor:"r1",children:s.value})]},s.value))})}function PR({filter:e}){return kd(e.dataType)?v.jsx(Abe,{filter:e}):e.uiType==="radio"&&e.type==="single"?v.jsx(Jve,{filter:e}):v.jsx(Hve,{filter:e})}function exe({frame:e}){const[t,n]=k.useState(!1),r=e==null?void 0:e.cards[0],{data:i}=Ga(r),o=e==null?void 0:e.cards[1],{data:s,isLoading:a,isFetching:l}=Ga(o);return(o==null?void 0:o.type)!=="text"?v.jsx(Gb,{card:r,data:(i==null?void 0:i.records)||[]}):v.jsxs(fc,{className:me("group relative overflow-y-auto",t?"m-4":"mx-0"),children:[t?v.jsx("div",{className:"overflow-y-auto break-words p-1",children:v.jsx(Zb,{card:o,data:(s==null?void 0:s.records)||[],isLoading:!1})}):v.jsx(Gb,{card:r,data:(i==null?void 0:i.records)||[]}),v.jsx("div",{className:me("fixed z-10",{"invisible bottom-4 right-4 group-hover:visible":t,"right-6 top-6":!t}),children:v.jsx(_0,{disabled:a||l,className:me("h-7 p-1"),pressed:t,onPressedChange:n,"aria-label":"Toggle bold",children:t?v.jsx(lL,{className:"size-4 text-muted-foreground/70"}):v.jsx(cL,{className:"size-4 text-muted-foreground/70"})})})]})}function txe({card:e,frame:t}){var H,L,G;const{customCards:n,placeholders:r}=Wi(),i=ye(V=>V.themeStyle),o=ye(V=>V.selectedSheetId),s=ye(V=>V.isDashboardEditing),a=ye(V=>V.selectedLensId),l=ye(V=>V.dashboard.filters),c=l==null?void 0:l.find(V=>V.id===t.filterId&&!V.hide),{setCardTitle:u,setCardDescription:d,setSelectedFrameId:p,updateFilter:h}=Vn(),{updateFrame:m}=Vn(),b=((H=e.customCardPreferences)==null?void 0:H.showCardHeader)??!0,{isError:y,isLoading:x,isFetching:w,cfg:_,visualKey:E,data:C,handleDatapointClick:R}=C4(e);function T(){var V,B,X;if(n&&n.length>0){const I=n.find(q=>q.cardId===e.id);if(I&&I.replaceDefault){const q=I.content;if(q)return v.jsx(q,{card:e})}}if(e.type==="kpi"){if(((V=t==null?void 0:t.cards)==null?void 0:V.length)===1)return v.jsx(Gb,{card:e,data:(C==null?void 0:C.records)||[]});if(((B=t==null?void 0:t.cards)==null?void 0:B.length)>1)return v.jsx(exe,{frame:t})}return e.type==="text"&&((X=t==null?void 0:t.cards)==null?void 0:X.length)===1?v.jsx(fc,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:v.jsx(Zb,{isLoading:x||w,card:e,data:(C==null?void 0:C.records)||[]})}):Q}function M(){return["{{ filters | where }}","{{ filters | and }}"].some(B=>{var X;return(X=e.sql)==null?void 0:X.includes(B)})?v.jsx(yde,{}):null}function N(){if(y)return v.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[v.jsx(pL,{className:"size-8 text-destructive"}),v.jsx("p",{className:"text-sm text-muted-foreground",children:"Error fetching data. Check your card settings."})]});if(C!=null&&C.records&&(C==null?void 0:C.records.length)===0)return r!=null&&r.NoRecords?v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:r.NoRecords}):v.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[v.jsx(xL,{className:"size-8 text-muted-foreground"}),v.jsx("p",{className:"text-sm text-muted-foreground",children:"No records to display"})]});if(e.type==="table"&&(C!=null&&C.records)&&(C==null?void 0:C.records.length)>0)return v.jsxs(fc,{className:"relative flex h-full min-h-0 w-full flex-1 grow basis-0",children:[v.jsx(U6,{card:e,data:(C==null?void 0:C.records)||[]}),v.jsx(Ip,{orientation:"horizontal"})]});if(e.type==="text")return v.jsx(fc,{className:"overflow-y-auto break-words pr-2",children:v.jsx(Zb,{isLoading:x||w,card:e,data:(C==null?void 0:C.records)||[]})});if(e.type==="custom")return v.jsx(ope,{frame:t,card:e});if(n&&n.length>0){const V=n.find(B=>B.cardId===e.id);if(V&&V.content){const B=V.content;return v.jsx(B,{card:e})}}if(_)return v.jsx(YE,{cfg:_,onDatapointClick:R},`${E}-${a}`)}function j(){if(n&&n.length>0){const V=n.find(B=>B.cardId===e.id);if(V&&V.footer){const B=V.footer;if(B)return v.jsx(B,{card:e})}}return null}function F(){var V,B,X;return v.jsx(dC,{value:t.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:I=>{const q={...t,activeCardId:I};m(o,q)},children:v.jsx(My,{style:{borderRadius:(B=(V=i==null?void 0:i.chart)==null?void 0:V.options)==null?void 0:B.borderRadius},className:"flex-end flex-wrap items-center",children:(X=t.cards.filter(I=>{var q;return!((q=I.tabTitle)!=null&&q.endsWith("__Header"))&&(I.displayTab===!0||I.displayTab===void 0)}))==null?void 0:X.map(I=>{var q,U;return v.jsx(Iy,{style:{borderRadius:(U=(q=i==null?void 0:i.chart)==null?void 0:q.options)==null?void 0:U.borderRadius},value:I.id,children:I.tabTitle||I.title},I.id)})})})}function $(){let V=t.cards.find(B=>B.type==="kpi"&&B.tabTitle===`${e.tabTitle}__Header`);return V||(V=t.cards.find(B=>B.type==="kpi"&&B.tabTitle==="All__Header")),V?v.jsx("div",{className:"flex items-end gap-2",children:v.jsx(Tue,{renderFilterInfo:M,card:V})}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{role:"card-title-container",className:"flex items-center gap-2",children:[v.jsx(os,{text:e.title,onSave:B=>u(o,e.id,B),children:v.jsx(Ad,{className:me("text-base",{}),children:e.title})}),(s||e.info)&&v.jsx(s3,{card:e}),e.refreshInterval&&v.jsxs(p3,{children:[v.jsx(g3,{className:"pr-1",children:v.jsx("div",{className:me("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":x||w})})}),v.jsx(LE,{side:"right",align:"center",children:v.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),M()]}),v.jsx("div",{role:"card-description-container",children:v.jsx(os,{text:(e==null?void 0:e.description)||"",onSave:B=>d(o,e.id,B),children:v.jsxs(oC,{className:me("",{}),children:[" ",e.description]})})})]})}if(!e.id)return null;const Q=v.jsxs(v.Fragment,{children:[b?v.jsx(Py,{children:v.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[v.jsx("div",{className:"grow",role:"header-container",children:$()}),v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.cards.length>1&&F(),v.jsx("div",{children:c&&v.jsxs("div",{style:{borderRadius:(G=(L=i==null?void 0:i.chart)==null?void 0:L.options)==null?void 0:G.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[!kd(c.dataType)&&v.jsx(os,{className:"my-1",containerClassName:"shrink-0",text:c.title||c.column,onSave:V=>h({...c,title:V}),children:v.jsx(Sn,{className:"px-3",children:c.title})}),v.jsx(PR,{filter:c})]})})]})]})}):v.jsx("div",{className:"h-8"}),v.jsx(Ty,{className:"relative flex min-h-0 grow flex-col",children:N()}),v.jsx(zN,{children:j()})]});return v.jsx("div",{className:me("flex h-full flex-col",{"animate-pulse":x||w}),children:T()})}function nxe({frame:e,footer:t,className:n,...r}){var b,y;const i=k.useRef(null),o=ye(x=>x.themeStyle),s=ye(x=>x.selectedFrameId),a=ye(x=>x.isDashboardEditing),{setSelectedFrameId:l}=Vn(),{setSelectedConnectionId:c,setSelectedDatabaseName:u,setSelectedSchemaName:d,setSelectedTableName:p}=gp(),h=e.cards.find(x=>x.id===e.activeCardId);qee(e,i);function m(x){x.stopPropagation(),l(e.id),h!=null&&h.connectionId&&c(h==null?void 0:h.connectionId),h!=null&&h.lastSelectedDatabase&&u(h==null?void 0:h.lastSelectedDatabase),h!=null&&h.lastSelectedSchema&&d(h==null?void 0:h.lastSelectedSchema),h!=null&&h.lastSelectedTable&&p(h==null?void 0:h.lastSelectedTable)}return v.jsx(Yy,{FallbackComponent:HC,children:v.jsxs("div",{tabIndex:-1,ref:i,role:"card-frame",onClick:m,style:{borderRadius:(y=(b=o==null?void 0:o.chart)==null?void 0:b.options)==null?void 0:y.borderRadius},className:me("relative flex h-full flex-col rounded-sm border bg-background shadow-sm",{"border-dashed border-foreground/50":s===e.id&&a},o==null?void 0:o.dashboardCard,n,"semaphor-card-frame"),...r,children:[v.jsx(_L,{frame:e}),v.jsx(txe,{card:h,frame:e},h.id)]})})}const TR=P.forwardRef(({className:e,...t},n)=>v.jsx("textarea",{className:me("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));TR.displayName="Textarea";function rxe({label:e,onCheckedChange:t,checked:n}){return v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(I0,{onCheckedChange:t,id:"terms",checked:n}),v.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function q8({text:e,className:t}){const[n,r]=k.useState(!1);return v.jsx(nr,{className:me("h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",t),variant:"ghost",size:"icon",onClick:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>{r(!1)},1e3)},children:n?v.jsx(FC,{className:"size-3.5"}):v.jsx(zC,{className:"size-3.5"})})}function ixe({filter:e}){const[t,n]=k.useState(e.sql),[r,i]=k.useState(!1),o=ye(h=>h.selectedSheetId),{updateFilter:s,updateFilterId:a}=Vn();function l(){const h={...e,sql:t};s(h),i(!1)}function c(h){console.log("operation",h);const m={...e,operation:h};s(m)}function u(h){const m={...e,type:h};s(m)}function d(h){const m={...e,uiType:h};s(m)}function p(h){if(!o)return;const m={...e,sheetId:h?o:void 0};s(m)}return v.jsxs(w0,{open:r,onOpenChange:i,children:[v.jsx(S0,{children:v.jsx(bL,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),v.jsxs(Mp,{onMouseDown:h=>h.stopPropagation(),onDoubleClick:h=>h.stopPropagation(),className:"z-50 m-2 w-full min-w-[350px] space-y-4",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("p",{className:"font-semibold text-foreground",children:e.column}),v.jsx("div",{className:"flex items-center gap-2",children:v.jsxs(Rp,{children:[v.jsx(Pp,{children:v.jsx(sL,{className:"size-5 cursor-pointer text-muted-foreground hover:text-foreground/80"})}),v.jsxs(zd,{align:"start",className:"flex w-auto items-center gap-2 px-3 py-2",children:[v.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:e.id}),v.jsx(q8,{text:e.id})]})]})})]}),v.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize filter operation and SQL"})]}),v.jsx(f0,{}),v.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sn,{children:"Type"}),v.jsxs(Uh,{onValueChange:u,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Gl,{value:"multiple",id:"r1"}),v.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Gl,{value:"single",id:"r2"}),v.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),e.type==="single"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx(Sn,{children:"Filter Element"}),v.jsxs(Uh,{onValueChange:d,value:e.uiType||"dropdown",className:"flex gap-3",defaultValue:"x",children:[v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Gl,{value:"dropdown",id:"r2"}),v.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Dropdown"})]}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Gl,{value:"radio",id:"r1"}),v.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Radio"})]})]})]})]}),v.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[v.jsxs("div",{className:"col-span-2 space-y-1",children:[v.jsx(Sn,{children:"Table Column"}),v.jsx(Sn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),v.jsxs("div",{className:"col-span-2 space-y-1",children:[v.jsx(Sn,{children:"Data Type"}),v.jsx(Sn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),v.jsxs("div",{className:"col-span-2 space-y-1",children:[v.jsx(Sn,{className:"text-sm",children:"Filter Operation"}),v.jsx(oxe,{updateFilterOperation:c,value:e.operation})]})]}),v.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[v.jsx(Sn,{className:"text-sm",children:"Values SQL"}),v.jsx(TR,{onKeyDown:h=>{h.stopPropagation()},value:t,onChange:h=>n(h.target.value),className:`min-w-full grow resize font-mono text-xs ${nh}`})]}),v.jsx("div",{children:v.jsx(rxe,{label:"Local to sheet",onCheckedChange:p,checked:!!e.sheetId})}),v.jsx("div",{className:"flex justify-end gap-2",children:v.jsxs(nr,{onClick:l,size:"sm",variant:"outline",children:[v.jsx(Md,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function oxe({value:e,updateFilterOperation:t}){return v.jsxs(Bs,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[v.jsx(Uo,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:v.jsx(Hs,{placeholder:"Operation"})}),v.jsxs(Go,{children:[v.jsx(Dn,{value:"=",children:"Equals"}),v.jsx(Dn,{value:"in",children:"Contains"}),v.jsx(Dn,{value:"like",children:"Like"})]})]})}function Y8({filter:e}){const t=ye(a=>a.isDashboardEditing),n=ye(a=>a.filterValues),r=n==null?void 0:n.some(a=>a.filterId===e.id),{removeFilterValues:i,removeFilter:o,updateFilter:s}=Vn();return v.jsx(os,{className:"my-1",text:e.title||e.column,onSave:a=>s({...e,title:a}),children:v.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[v.jsxs("div",{className:"flex grow items-center gap-2",children:[v.jsx(Sn,{className:"inline-block text-sm",children:e.title}),r&&v.jsx("button",{onClick:()=>i(e.id),className:"text-foreground/30 hover:text-foreground/50",children:v.jsx(BC,{className:"size-3.5"})}),t&&v.jsx("button",{className:"invisible group-hover:visible",onClick:()=>{s({...e,hide:!e.hide})},children:e.hide?v.jsx(rL,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"}):v.jsx(nL,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"})}),t&&v.jsx(ixe,{filter:e})]}),v.jsx("div",{className:"flex items-center gap-2",children:t&&v.jsx(jc,{onClick:()=>{i(e.id),o(e.id)},className:"size-3.5 cursor-pointer text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})]})})}var sxe=e=>{switch(e){case"success":return cxe;case"info":return dxe;case"warning":return uxe;case"error":return fxe;default:return null}},axe=Array(12).fill(0),lxe=({visible:e,className:t})=>k.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},k.createElement("div",{className:"sonner-spinner"},axe.map((n,r)=>k.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),cxe=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.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"})),uxe=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},k.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"})),dxe=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.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"})),fxe=k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},k.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"})),hxe=k.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"},k.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),k.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),pxe=()=>{let[e,t]=k.useState(document.hidden);return k.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},d_=1,gxe=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,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:d_++,o=this.toasts.find(a=>a.id===i),s=e.dismissible===void 0?!0:e.dismissible;return o?this.toasts=this.toasts.map(a=>a.id===i?(this.publish({...a,...e,id:i,title:n}),{...a,...e,id:i,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:i}),i},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(),i=n!==void 0,o,s=r.then(async l=>{if(o=["resolve",l],k.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(bxe(l)&&!l.ok){i=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:u})}else if(t.success!==void 0){i=!1;let c=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],t.error!==void 0){i=!1;let c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,c)=>s.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||d_++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Mi=new gxe,mxe=(e,t)=>{let n=(t==null?void 0:t.id)||d_++;return Mi.addToast({title:e,...t,id:n}),n},bxe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",yxe=mxe,vxe=()=>Mi.toasts,K8=Object.assign(yxe,{success:Mi.success,info:Mi.info,warning:Mi.warning,error:Mi.error,custom:Mi.custom,message:Mi.message,promise:Mi.promise,dismiss:Mi.dismiss,loading:Mi.loading},{getHistory:vxe});function xxe(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}xxe(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
391
- `);function Im(e){return e.label!==void 0}var wxe=3,Sxe="32px",_xe="16px",wI=4e3,Cxe=356,Exe=14,Rxe=20,Pxe=200;function xo(...e){return e.filter(Boolean).join(" ")}function Txe(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var kxe=e=>{var t,n,r,i,o,s,a,l,c,u,d;let{invert:p,toast:h,unstyled:m,interacting:b,setHeights:y,visibleToasts:x,heights:w,index:_,toasts:E,expanded:C,removeToast:R,defaultRichColors:T,closeButton:M,style:N,cancelButtonStyle:j,actionButtonStyle:F,className:$="",descriptionClassName:Q="",duration:H,position:L,gap:G,loadingIcon:V,expandByDefault:B,classNames:X,icons:I,closeButtonAriaLabel:q="Close toast",pauseWhenPageIsHidden:U}=e,[O,ee]=k.useState(null),[K,oe]=k.useState(null),[Y,J]=k.useState(!1),[se,ae]=k.useState(!1),[ge,ne]=k.useState(!1),[fe,he]=k.useState(!1),[_e,Ae]=k.useState(!1),[Le,ke]=k.useState(0),[Be,dt]=k.useState(0),Ct=k.useRef(h.duration||H||wI),an=k.useRef(null),mt=k.useRef(null),Wt=_===0,jt=_+1<=x,de=h.type,Ce=h.dismissible!==!1,He=h.className||"",Ge=h.descriptionClassName||"",at=k.useMemo(()=>w.findIndex(je=>je.toastId===h.id)||0,[w,h.id]),On=k.useMemo(()=>{var je;return(je=h.closeButton)!=null?je:M},[h.closeButton,M]),jn=k.useMemo(()=>h.duration||H||wI,[h.duration,H]),Pn=k.useRef(0),ln=k.useRef(0),$n=k.useRef(0),nn=k.useRef(null),[ir,Xn]=L.split("-"),Gi=k.useMemo(()=>w.reduce((je,wt,Ut)=>Ut>=at?je:je+wt.height,0),[w,at]),xr=pxe(),jo=h.invert||p,wr=de==="loading";ln.current=k.useMemo(()=>at*G+Gi,[at,Gi]),k.useEffect(()=>{Ct.current=jn},[jn]),k.useEffect(()=>{J(!0)},[]),k.useEffect(()=>{let je=mt.current;if(je){let wt=je.getBoundingClientRect().height;return dt(wt),y(Ut=>[{toastId:h.id,height:wt,position:h.position},...Ut]),()=>y(Ut=>Ut.filter(Qn=>Qn.toastId!==h.id))}},[y,h.id]),k.useLayoutEffect(()=>{if(!Y)return;let je=mt.current,wt=je.style.height;je.style.height="auto";let Ut=je.getBoundingClientRect().height;je.style.height=wt,dt(Ut),y(Qn=>Qn.find(Zn=>Zn.toastId===h.id)?Qn.map(Zn=>Zn.toastId===h.id?{...Zn,height:Ut}:Zn):[{toastId:h.id,height:Ut,position:h.position},...Qn])},[Y,h.title,h.description,y,h.id]);let Lr=k.useCallback(()=>{ae(!0),ke(ln.current),y(je=>je.filter(wt=>wt.toastId!==h.id)),setTimeout(()=>{R(h)},Pxe)},[h,R,y,ln]);k.useEffect(()=>{if(h.promise&&de==="loading"||h.duration===1/0||h.type==="loading")return;let je;return C||b||U&&xr?(()=>{if($n.current<Pn.current){let wt=new Date().getTime()-Pn.current;Ct.current=Ct.current-wt}$n.current=new Date().getTime()})():Ct.current!==1/0&&(Pn.current=new Date().getTime(),je=setTimeout(()=>{var wt;(wt=h.onAutoClose)==null||wt.call(h,h),Lr()},Ct.current)),()=>clearTimeout(je)},[C,b,h,de,U,xr,Lr]),k.useEffect(()=>{h.delete&&Lr()},[Lr,h.delete]);function dl(){var je,wt,Ut;return I!=null&&I.loading?k.createElement("div",{className:xo(X==null?void 0:X.loader,(je=h==null?void 0:h.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":de==="loading"},I.loading):V?k.createElement("div",{className:xo(X==null?void 0:X.loader,(wt=h==null?void 0:h.classNames)==null?void 0:wt.loader,"sonner-loader"),"data-visible":de==="loading"},V):k.createElement(lxe,{className:xo(X==null?void 0:X.loader,(Ut=h==null?void 0:h.classNames)==null?void 0:Ut.loader),visible:de==="loading"})}return k.createElement("li",{tabIndex:0,ref:mt,className:xo($,He,X==null?void 0:X.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[de],(n=h==null?void 0:h.classNames)==null?void 0:n[de]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:T,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":Y,"data-promise":!!h.promise,"data-swiped":_e,"data-removed":se,"data-visible":jt,"data-y-position":ir,"data-x-position":Xn,"data-index":_,"data-front":Wt,"data-swiping":ge,"data-dismissible":Ce,"data-type":de,"data-invert":jo,"data-swipe-out":fe,"data-swipe-direction":K,"data-expanded":!!(C||B&&Y),style:{"--index":_,"--toasts-before":_,"--z-index":E.length-_,"--offset":`${se?Le:ln.current}px`,"--initial-height":B?"auto":`${Be}px`,...N,...h.style},onPointerDown:je=>{wr||!Ce||(an.current=new Date,ke(ln.current),je.target.setPointerCapture(je.pointerId),je.target.tagName!=="BUTTON"&&(ne(!0),nn.current={x:je.clientX,y:je.clientY}))},onPointerUp:()=>{var je,wt,Ut,Qn;if(fe||!Ce)return;nn.current=null;let Zn=Number(((je=mt.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Fr=Number(((wt=mt.current)==null?void 0:wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),fr=new Date().getTime()-((Ut=an.current)==null?void 0:Ut.getTime()),or=O==="x"?Zn:Fr,yn=Math.abs(or)/fr;if(Math.abs(or)>=Rxe||yn>.11){ke(ln.current),(Qn=h.onDismiss)==null||Qn.call(h,h),oe(O==="x"?Zn>0?"right":"left":Fr>0?"down":"up"),Lr(),he(!0),Ae(!1);return}ne(!1),ee(null)},onPointerMove:je=>{var wt,Ut,Qn,Zn;if(!nn.current||!Ce||((wt=window.getSelection())==null?void 0:wt.toString().length)>0)return;let Fr=je.clientY-nn.current.y,fr=je.clientX-nn.current.x,or=(Ut=e.swipeDirections)!=null?Ut:Txe(L);!O&&(Math.abs(fr)>1||Math.abs(Fr)>1)&&ee(Math.abs(fr)>Math.abs(Fr)?"x":"y");let yn={x:0,y:0};O==="y"?(or.includes("top")||or.includes("bottom"))&&(or.includes("top")&&Fr<0||or.includes("bottom")&&Fr>0)&&(yn.y=Fr):O==="x"&&(or.includes("left")||or.includes("right"))&&(or.includes("left")&&fr<0||or.includes("right")&&fr>0)&&(yn.x=fr),(Math.abs(yn.x)>0||Math.abs(yn.y)>0)&&Ae(!0),(Qn=mt.current)==null||Qn.style.setProperty("--swipe-amount-x",`${yn.x}px`),(Zn=mt.current)==null||Zn.style.setProperty("--swipe-amount-y",`${yn.y}px`)}},On&&!h.jsx?k.createElement("button",{"aria-label":q,"data-disabled":wr,"data-close-button":!0,onClick:wr||!Ce?()=>{}:()=>{var je;Lr(),(je=h.onDismiss)==null||je.call(h,h)},className:xo(X==null?void 0:X.closeButton,(i=h==null?void 0:h.classNames)==null?void 0:i.closeButton)},(o=I==null?void 0:I.close)!=null?o:hxe):null,h.jsx||k.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:k.createElement(k.Fragment,null,de||h.icon||h.promise?k.createElement("div",{"data-icon":"",className:xo(X==null?void 0:X.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||dl():null,h.type!=="loading"?h.icon||(I==null?void 0:I[de])||sxe(de):null):null,k.createElement("div",{"data-content":"",className:xo(X==null?void 0:X.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},k.createElement("div",{"data-title":"",className:xo(X==null?void 0:X.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?k.createElement("div",{"data-description":"",className:xo(Q,Ge,X==null?void 0:X.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),k.isValidElement(h.cancel)?h.cancel:h.cancel&&Im(h.cancel)?k.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||j,onClick:je=>{var wt,Ut;Im(h.cancel)&&Ce&&((Ut=(wt=h.cancel).onClick)==null||Ut.call(wt,je),Lr())},className:xo(X==null?void 0:X.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,k.isValidElement(h.action)?h.action:h.action&&Im(h.action)?k.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||F,onClick:je=>{var wt,Ut;Im(h.action)&&((Ut=(wt=h.action).onClick)==null||Ut.call(wt,je),!je.defaultPrevented&&Lr())},className:xo(X==null?void 0:X.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function SI(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Axe(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,s=o?"--mobile-offset":"--offset",a=o?_xe:Sxe;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}var Oxe=k.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:s,className:a,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:p,style:h,visibleToasts:m=wxe,toastOptions:b,dir:y=SI(),gap:x=Exe,loadingIcon:w,icons:_,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:C}=e,[R,T]=k.useState([]),M=k.useMemo(()=>Array.from(new Set([r].concat(R.filter(U=>U.position).map(U=>U.position)))),[R,r]),[N,j]=k.useState([]),[F,$]=k.useState(!1),[Q,H]=k.useState(!1),[L,G]=k.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=k.useRef(null),B=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=k.useRef(null),I=k.useRef(!1),q=k.useCallback(U=>{T(O=>{var ee;return(ee=O.find(K=>K.id===U.id))!=null&&ee.delete||Mi.dismiss(U.id),O.filter(({id:K})=>K!==U.id)})},[]);return k.useEffect(()=>Mi.subscribe(U=>{if(U.dismiss){T(O=>O.map(ee=>ee.id===U.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{Ar.flushSync(()=>{T(O=>{let ee=O.findIndex(K=>K.id===U.id);return ee!==-1?[...O.slice(0,ee),{...O[ee],...U},...O.slice(ee+1)]:[U,...O]})})})}),[]),k.useEffect(()=>{if(u!=="system"){G(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:O})=>{G(O?"dark":"light")})}catch{U.addListener(({matches:ee})=>{try{G(ee?"dark":"light")}catch(K){console.error(K)}})}},[u]),k.useEffect(()=>{R.length<=1&&$(!1)},[R]),k.useEffect(()=>{let U=O=>{var ee,K;i.every(oe=>O[oe]||O.code===oe)&&($(!0),(ee=V.current)==null||ee.focus()),O.code==="Escape"&&(document.activeElement===V.current||(K=V.current)!=null&&K.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[i]),k.useEffect(()=>{if(V.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,I.current=!1)}},[V.current]),k.createElement("section",{ref:t,"aria-label":`${E} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((U,O)=>{var ee;let[K,oe]=U.split("-");return R.length?k.createElement("ol",{key:U,dir:y==="auto"?SI():y,tabIndex:-1,ref:V,className:a,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":K,"data-lifted":F&&R.length>1&&!o,"data-x-position":oe,style:{"--front-toast-height":`${((ee=N[0])==null?void 0:ee.height)||0}px`,"--width":`${Cxe}px`,"--gap":`${x}px`,...h,...Axe(l,c)},onBlur:Y=>{I.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(I.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||I.current||(I.current=!0,X.current=Y.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{Q||$(!1)},onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},R.filter(Y=>!Y.position&&O===0||Y.position===U).map((Y,J)=>{var se,ae;return k.createElement(kxe,{key:Y.id,icons:_,index:J,toast:Y,defaultRichColors:d,duration:(se=b==null?void 0:b.duration)!=null?se:p,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:n,visibleToasts:m,closeButton:(ae=b==null?void 0:b.closeButton)!=null?ae:s,interacting:Q,position:U,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,removeToast:q,toasts:R.filter(ge=>ge.position==Y.position),heights:N.filter(ge=>ge.position==Y.position),setHeights:j,expandByDefault:o,gap:x,loadingIcon:w,expanded:F,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});function Mxe(){const{getSelectedFrame:e,addFrame:t,setSelectedFrameId:n}=Vn(),r=ye(l=>l.dashboard.sheets),o=ye(l=>l.selectedSheetId)??(r==null?void 0:r[0].id),s=ye(l=>l.isDashboardEditing),a=ye(l=>l.isVisualEditing);k.useEffect(()=>{if(!s||a)return;async function l(d){const p=d.ctrlKey||d.metaKey;p&&d.key==="c"?(await c(),K8.success("Card copied to clipboard"),d.preventDefault()):p&&d.key==="v"&&(await u(),d.preventDefault())}async function c(){try{const d=e();d&&await navigator.clipboard.writeText(JSON.stringify(d))}catch(d){console.error("Failed to copy text:",d)}}async function u(){if(!o)return null;try{const d=await navigator.clipboard.readText();try{const p=JSON.parse(d);if(p&&p.id){p.id=Ua();const h=p.activeCardId;p.cards.forEach(m=>{const b=m.id;m.id=Ua(),b===h&&(p.activeCardId=m.id,m.title=`${m.title} (Copy)`)}),t(o,p),n(p.id)}}catch(p){console.error("Failed to parse clipboard contents: ",p)}return d}catch(d){return console.error("Failed to paste text:",d),null}}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,e,n,o,s,a])}const Ixe=Zk.WidthProvider(Zk.Responsive);function Dxe({sheet:e}){var y,x,w;const t=ye(_=>_.isDashboardEditing),n=ye(_=>_.currentBreakpoint),r=ye(_=>_.themeStyle);k.useState([]);const i=ye(_=>_.selectedSheetId);ye(_=>_.selectedLensId);const o=e.layouts,s=ye(_=>_.dashboard.filters),a=e.frames,{setSheetLayouts:l,setCurrentBreakpoint:c}=ye(_=>_.actions);k.useEffect(()=>{var _,E;document.documentElement.style.setProperty("--placeholder-border-radius",`${(E=(_=r==null?void 0:r.chart)==null?void 0:_.options)==null?void 0:E.borderRadius}px`)},[(x=(y=r==null?void 0:r.chart)==null?void 0:y.options)==null?void 0:x.borderRadius]),Mxe();function u(_){c(_)}function d(_,E){i===e.id&&l(i,E)}if(!i)return null;const p=(_,E)=>v.jsx(X8,{className:"after:content-none",ref:E,handleAxis:_}),h=_=>_&&(_==null?void 0:_.h)===1&&(_==null?void 0:_.w)===1?{..._,h:8,minH:7,w:7}:null;function m(){const _=s==null?void 0:s.filter(E=>(E.sheetId===i||!E.sheetId)&&!E.hide);return _==null?void 0:_.map(E=>{var T,M,N;const C=(T=o==null?void 0:o[n])==null?void 0:T.find(j=>j.i===E.id);if(E.location==="frame")return null;const R=h(C);return v.jsxs("div",{style:{borderRadius:(N=(M=r==null?void 0:r.chart)==null?void 0:M.options)==null?void 0:N.borderRadius},className:me("z-50 flex flex-col rounded-md border bg-background px-3 py-2"),...R?{"data-grid":R}:{},children:[v.jsx(Y8,{filter:E}),v.jsx(PR,{filter:E})]},E.id)})}function b(){return a==null?void 0:a.map(_=>v.jsx("div",{role:"dashboard-frame-container",className:me("group isolate overflow-hidden",r==null?void 0:r.dashboardCardContainer),children:v.jsx(Yy,{FallbackComponent:({error:E,resetErrorBoundary:C})=>v.jsx(Xee,{error:E,resetErrorBoundary:C,frame:_}),children:v.jsx(nxe,{frame:_})})},_.id))}return v.jsx(v.Fragment,{children:v.jsxs(Ixe,{margin:[10,10],isDraggable:t,resizeHandles:t?["sw","nw","ne","se","e","w"]:[],className:me((w=r==null?void 0:r.gridLayout)==null?void 0:w.className),layouts:o,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:u,onLayoutChange:d,resizeHandle:p,children:[m(),b()]})})}const X8=k.forwardRef(({className:e,handleAxis:t,...n},r)=>{var s,a;const i=ye(l=>l.themeStyle),o=(a=(s=i==null?void 0:i.chart)==null?void 0:s.options)==null?void 0:a.borderRadius;return v.jsx("div",{ref:r,className:me(`react-resizable-handle z-10 react-resizable-handle-${t} absolute border-foreground/40`,{"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0":t==="nw"&&o<11,"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne"&&o<11,"border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw"&&o<11,"border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se"&&o<11,"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0 group-hover:border-t-0":t==="e","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0 group-hover:border-t-0":t==="w"},e),...n})});X8.displayName="ResizeHandle";var Q8="vercel.ai.error",Nxe=Symbol.for(Q8),Z8,Lxe=class J8 extends Error{constructor({name:t,message:n,cause:r}){super(n),this[Z8]=!0,this.name=t,this.cause=r}static isInstance(t){return J8.hasMarker(t,Q8)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};Z8=Nxe;var Rd=Lxe;function e9(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var t9="AI_InvalidArgumentError",n9=`vercel.ai.error.${t9}`,Fxe=Symbol.for(n9),r9,jxe=class extends Rd{constructor({message:e,cause:t,argument:n}){super({name:t9,message:e,cause:t}),this[r9]=!0,this.argument=n}static isInstance(e){return Rd.hasMarker(e,n9)}};r9=Fxe;var i9="AI_JSONParseError",o9=`vercel.ai.error.${i9}`,$xe=Symbol.for(o9),s9,_I=class extends Rd{constructor({text:e,cause:t}){super({name:i9,message:`JSON parsing failed: Text: ${e}.
392
- Error message: ${e9(t)}`,cause:t}),this[s9]=!0,this.text=e}static isInstance(e){return Rd.hasMarker(e,o9)}};s9=$xe;var a9="AI_TypeValidationError",l9=`vercel.ai.error.${a9}`,zxe=Symbol.for(l9),c9,Bxe=class f_ extends Rd{constructor({value:t,cause:n}){super({name:a9,message:`Type validation failed: Value: ${JSON.stringify(t)}.
393
- Error message: ${e9(n)}`,cause:n}),this[c9]=!0,this.value=t}static isInstance(t){return Rd.hasMarker(t,l9)}static wrap({value:t,cause:n}){return f_.isInstance(n)&&n.value===t?n:new f_({value:t,cause:n})}};c9=zxe;var CI=Bxe;let Hxe=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r};var Wd={exports:{}};const Vxe=typeof Buffer<"u",EI=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,RI=/"(?: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 u9(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),Vxe&&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 i=n&&n.protoAction||"error",o=n&&n.constructorAction||"error";if(i==="ignore"&&o==="ignore")return r;if(i!=="ignore"&&o!=="ignore"){if(EI.test(e)===!1&&RI.test(e)===!1)return r}else if(i!=="ignore"&&o==="ignore"){if(EI.test(e)===!1)return r}else if(RI.test(e)===!1)return r;return d9(r,{protoAction:i,constructorAction:o,safe:n&&n.safe})}function d9(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let i=[e];for(;i.length;){const o=i;i=[];for(const s of o){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(const a in s){const l=s[a];l&&typeof l=="object"&&i.push(l)}}}return e}function kR(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return u9(e,t,n)}finally{Error.stackTraceLimit=r}}function Wxe(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return u9(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Wd.exports=kR;Wd.exports.default=kR;Wd.exports.parse=kR;Wd.exports.safeParse=Wxe;Wd.exports.scan=d9;var Uxe=Wd.exports;const Gxe=Ic(Uxe);var qxe=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=Hxe(n,t);if(e==null)return i;if(n.includes(r))throw new jxe({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return o=>`${e}${r}${i(o)}`},AR=qxe(),h_=Symbol.for("vercel.ai.validator");function Yxe(e){return{[h_]:!0,validate:e}}function Kxe(e){return typeof e=="object"&&e!==null&&h_ in e&&e[h_]===!0&&"validate"in e}function Xxe(e){return Kxe(e)?e:Qxe(e)}function Qxe(e){return Yxe(t=>{const n=e.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}})}function Zxe({value:e,schema:t}){const n=Xxe(t);try{if(n.validate==null)return{success:!0,value:e};const r=n.validate(e);return r.success?r:{success:!1,error:CI.wrap({value:e,cause:r.error})}}catch(r){return{success:!1,error:CI.wrap({value:e,cause:r})}}}function PI({text:e,schema:t}){try{const n=Gxe.parse(e);if(t==null)return{success:!0,value:n,rawValue:n};const r=Zxe({value:n,schema:t});return r.success?{...r,rawValue:n}:r}catch(n){return{success:!1,error:_I.isInstance(n)?n:new _I({text:e,cause:n})}}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var Gh={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},qh={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Yh={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}}},Kh={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}}}},Xh={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}}},Jxe=[Gh,qh,Yh,Kh,Xh];Gh.code+"",qh.code+"",Yh.code+"",Kh.code+"",Xh.code+"";Gh.name+"",Gh.code,qh.name+"",qh.code,Yh.name+"",Yh.code,Kh.name+"",Kh.code,Xh.name+"",Xh.code;Jxe.map(e=>e.code);function ewe({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}function twe(e){const t=["ROOT"];let n=-1,r=null;function i(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 o(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":i(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":{i(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(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,i(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":{i(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const d=e.substring(r,l+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l)):n=l;break}}}let a=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const u=e.substring(r,e.length);"true".startsWith(u)?a+="true".slice(u.length):"false".startsWith(u)?a+="false".slice(u.length):"null".startsWith(u)&&(a+="null".slice(u.length))}}return a}function nwe(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=PI({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=PI({text:twe(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var rwe={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},iwe={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},owe={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},swe={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}}},awe={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}}},lwe={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}}},cwe={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}}},uwe={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}}},dwe={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},fwe={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},hwe={code:"f",name:"start_step",parse:e=>{if(e==null||typeof e!="object"||!("messageId"in e)||typeof e.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},pwe={code:"g",name:"reasoning",parse:e=>{if(typeof e!="string")throw new Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},gwe={code:"h",name:"source",parse:e=>{if(e==null||typeof e!="object")throw new Error('"source" parts expect a Source object.');return{type:"source",value:e}}},mwe={code:"i",name:"redacted_reasoning",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string")throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},bwe={code:"j",name:"reasoning_signature",parse:e=>{if(e==null||typeof e!="object"||!("signature"in e)||typeof e.signature!="string")throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},OR=[rwe,iwe,owe,swe,awe,lwe,cwe,uwe,dwe,fwe,hwe,pwe,gwe,mwe,bwe],ywe=Object.fromEntries(OR.map(e=>[e.code,e]));Object.fromEntries(OR.map(e=>[e.name,e.code]));var vwe=OR.map(e=>e.code),xwe=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(!vwe.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,i=e.slice(t+1),o=JSON.parse(i);return ywe[r].parse(o)},wwe=10;function Swe(e,t){const n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return e.length=0,n}async function _we({stream:e,onTextPart:t,onReasoningPart:n,onReasoningSignaturePart:r,onRedactedReasoningPart:i,onSourcePart:o,onDataPart:s,onErrorPart:a,onToolCallStreamingStartPart:l,onToolCallDeltaPart:c,onToolCallPart:u,onToolResultPart:d,onMessageAnnotationsPart:p,onFinishMessagePart:h,onFinishStepPart:m,onStartStepPart:b}){const y=e.getReader(),x=new TextDecoder,w=[];let _=0;for(;;){const{value:E}=await y.read();if(E&&(w.push(E),_+=E.length,E[E.length-1]!==wwe))continue;if(w.length===0)break;const C=Swe(w,_);_=0;const R=x.decode(C,{stream:!0}).split(`
394
- `).filter(T=>T!=="").map(xwe);for(const{type:T,value:M}of R)switch(T){case"text":await(t==null?void 0:t(M));break;case"reasoning":await(n==null?void 0:n(M));break;case"reasoning_signature":await(r==null?void 0:r(M));break;case"redacted_reasoning":await(i==null?void 0:i(M));break;case"source":await(o==null?void 0:o(M));break;case"data":await(s==null?void 0:s(M));break;case"error":await(a==null?void 0:a(M));break;case"message_annotations":await(p==null?void 0:p(M));break;case"tool_call_streaming_start":await(l==null?void 0:l(M));break;case"tool_call_delta":await(c==null?void 0:c(M));break;case"tool_call":await(u==null?void 0:u(M));break;case"tool_result":await(d==null?void 0:d(M));break;case"finish_message":await(h==null?void 0:h(M));break;case"finish_step":await(m==null?void 0:m(M));break;case"start_step":await(b==null?void 0:b(M));break;default:{const N=T;throw new Error(`Unknown stream part type: ${N}`)}}}}async function Cwe({stream:e,update:t,onToolCall:n,onFinish:r,generateId:i=AR,getCurrentDate:o=()=>new Date,lastMessage:s}){var a,l;const c=(s==null?void 0:s.role)==="assistant";let u=c?1+((l=(a=s.toolInvocations)==null?void 0:a.reduce((R,T)=>{var M;return Math.max(R,(M=T.step)!=null?M:0)},0))!=null?l:0):0;const d=c?structuredClone(s):{id:i(),createdAt:o(),role:"assistant",content:"",parts:[]};let p,h,m;function b(R,T){const M=d.parts.find(N=>N.type==="tool-invocation"&&N.toolInvocation.toolCallId===R);M!=null?M.toolInvocation=T:d.parts.push({type:"tool-invocation",toolInvocation:T})}const y=[];let x=c?s==null?void 0:s.annotations:void 0;const w={};let _={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},E="unknown";function C(){const R=[...y];x!=null&&x.length&&(d.annotations=x);const T={...structuredClone(d),revisionId:i()};t({message:T,data:R,replaceLastMessage:c})}await _we({stream:e,onTextPart(R){p==null?(p={type:"text",text:R},d.parts.push(p)):p.text+=R,d.content+=R,C()},onReasoningPart(R){var T;m==null?(m={type:"text",text:R},h!=null&&h.details.push(m)):m.text+=R,h==null?(h={type:"reasoning",reasoning:R,details:[m]},d.parts.push(h)):h.reasoning+=R,d.reasoning=((T=d.reasoning)!=null?T:"")+R,C()},onReasoningSignaturePart(R){m!=null&&(m.signature=R.signature)},onRedactedReasoningPart(R){h==null&&(h={type:"reasoning",reasoning:"",details:[]},d.parts.push(h)),h.details.push({type:"redacted",data:R.data}),m=void 0,C()},onSourcePart(R){d.parts.push({type:"source",source:R}),C()},onToolCallStreamingStartPart(R){d.toolInvocations==null&&(d.toolInvocations=[]),w[R.toolCallId]={text:"",step:u,toolName:R.toolName,index:d.toolInvocations.length};const T={state:"partial-call",step:u,toolCallId:R.toolCallId,toolName:R.toolName,args:void 0};d.toolInvocations.push(T),b(R.toolCallId,T),C()},onToolCallDeltaPart(R){const T=w[R.toolCallId];T.text+=R.argsTextDelta;const{value:M}=nwe(T.text),N={state:"partial-call",step:T.step,toolCallId:R.toolCallId,toolName:T.toolName,args:M};d.toolInvocations[T.index]=N,b(R.toolCallId,N),C()},async onToolCallPart(R){const T={state:"call",step:u,...R};if(w[R.toolCallId]!=null?d.toolInvocations[w[R.toolCallId].index]=T:(d.toolInvocations==null&&(d.toolInvocations=[]),d.toolInvocations.push(T)),b(R.toolCallId,T),C(),n){const M=await n({toolCall:R});if(M!=null){const N={state:"result",step:u,...R,result:M};d.toolInvocations[d.toolInvocations.length-1]=N,b(R.toolCallId,N),C()}}},onToolResultPart(R){const T=d.toolInvocations;if(T==null)throw new Error("tool_result must be preceded by a tool_call");const M=T.findIndex(j=>j.toolCallId===R.toolCallId);if(M===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");const N={...T[M],state:"result",...R};T[M]=N,b(R.toolCallId,N),C()},onDataPart(R){y.push(...R),C()},onMessageAnnotationsPart(R){x==null?x=[...R]:x.push(...R),C()},onFinishStepPart(R){u+=1,p=R.isContinued?p:void 0,h=void 0,m=void 0},onStartStepPart(R){c||(d.id=R.messageId)},onFinishMessagePart(R){E=R.finishReason,R.usage!=null&&(_=ewe(R.usage))},onErrorPart(R){throw new Error(R)}}),r==null||r({message:d,finishReason:E,usage:_})}async function Ewe({stream:e,onTextPart:t}){const n=e.pipeThrough(new TextDecoderStream).getReader();for(;;){const{done:r,value:i}=await n.read();if(r)break;await t(i)}}async function Rwe({stream:e,update:t,onFinish:n,getCurrentDate:r=()=>new Date,generateId:i=AR}){const o={type:"text",text:""},s={id:i(),createdAt:r(),role:"assistant",content:"",parts:[o]};await Ewe({stream:e,onTextPart:a=>{s.content+=a,o.text+=a,t({message:{...s},data:[],replaceLastMessage:!1})}}),n==null||n(s,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"})}var Pwe=()=>fetch;async function Twe({api:e,body:t,streamProtocol:n="data",credentials:r,headers:i,abortController:o,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:d,fetch:p=Pwe(),lastMessage:h}){var m,b;const y=await p(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...i},signal:(m=o==null?void 0:o())==null?void 0:m.signal,credentials:r}).catch(x=>{throw s(),x});if(a)try{await a(y)}catch(x){throw x}if(!y.ok)throw s(),new Error((b=await y.text())!=null?b:"Failed to fetch the chat response.");if(!y.body)throw new Error("The response body is empty.");switch(n){case"text":{await Rwe({stream:y.body,update:l,onFinish:c,generateId:d});return}case"data":{await Cwe({stream:y.body,update:l,lastMessage:h,onToolCall:u,onFinish({message:x,finishReason:w,usage:_}){c&&x!=null&&c(x,{usage:_,finishReason:w})},generateId:d});return}default:{const x=n;throw new Error(`Unknown stream protocol: ${x}`)}}}function p_(e){return e==null?void 0:e.reduce((t,n)=>{var r;return Math.max(t,(r=n.step)!=null?r:0)},0)}function f9(e){var t;return(t=e.parts)!=null?t:[...e.toolInvocations?e.toolInvocations.map(n=>({type:"tool-invocation",toolInvocation:n})):[],...e.reasoning?[{type:"reasoning",reasoning:e.reasoning,details:[{type:"text",text:e.reasoning}]}]:[],...e.content?[{type:"text",text:e.content}]:[]]}function Fw(e){return e.map(t=>({...t,parts:f9(t)}))}async function TI(e){if(!e)return[];if(e instanceof FileList)return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,i=await new Promise((o,s)=>{const a=new FileReader;a.onload=l=>{var c;o((c=l.target)==null?void 0:c.result)},a.onerror=l=>s(l),a.readAsDataURL(t)});return{name:n,contentType:r,url:i}}));if(Array.isArray(e))return e;throw new Error("Invalid attachments type")}function kwe({originalMaxToolInvocationStep:e,originalMessageCount:t,maxSteps:n,messages:r}){var i;const o=r[r.length-1];return n>1&&o!=null&&(r.length>t||p_(o.toolInvocations)!==e)&&h9(o)&&!Awe(o)&&((i=p_(o.toolInvocations))!=null?i:0)<n}function Awe(e){let t=!1;return e.parts.forEach(n=>{n.type==="text"&&(t=!0),n.type==="tool-invocation"&&(t=!1)}),t}function h9(e){return e.role==="assistant"&&e.parts.filter(t=>t.type==="tool-invocation").every(t=>"result"in t.toolInvocation)}function Owe({messages:e,toolCallId:t,toolResult:n}){var r;const i=e[e.length-1],o=i.parts.find(a=>a.type==="tool-invocation"&&a.toolInvocation.toolCallId===t);if(o==null)return;const s={...o.toolInvocation,state:"result",result:n};o.toolInvocation=s,i.toolInvocations=(r=i.toolInvocations)==null?void 0:r.map(a=>a.toolCallId===t?s:a)}var p9=V_(),kI=Object.prototype.hasOwnProperty;function g_(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&g_(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(kI.call(e,n)&&++r&&!kI.call(t,n)||!(n in t)||!g_(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const qs=new WeakMap,Ba=()=>{},Kr=Ba(),m_=Object,Gt=e=>e===Kr,es=e=>typeof e=="function",tl=(e,t)=>({...e,...t}),g9=e=>es(e.then),jw={},Dm={},MR="undefined",D0=typeof window!=MR,b_=typeof document!=MR,Mwe=()=>D0&&typeof window.requestAnimationFrame!=MR,m9=(e,t)=>{const n=qs.get(e);return[()=>!Gt(t)&&e.get(t)||jw,r=>{if(!Gt(t)){const i=e.get(t);t in Dm||(Dm[t]=i),n[5](t,tl(i,r),i||jw)}},n[6],()=>!Gt(t)&&t in Dm?Dm[t]:!Gt(t)&&e.get(t)||jw]};let y_=!0;const Iwe=()=>y_,[v_,x_]=D0&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Ba,Ba],Dwe=()=>{const e=b_&&document.visibilityState;return Gt(e)||e!=="hidden"},Nwe=e=>(b_&&document.addEventListener("visibilitychange",e),v_("focus",e),()=>{b_&&document.removeEventListener("visibilitychange",e),x_("focus",e)}),Lwe=e=>{const t=()=>{y_=!0,e()},n=()=>{y_=!1};return v_("online",t),v_("offline",n),()=>{x_("online",t),x_("offline",n)}},Fwe={isOnline:Iwe,isVisible:Dwe},jwe={initFocus:Nwe,initReconnect:Lwe},AI=!k.useId,Qh=!D0||"Deno"in globalThis,$we=e=>Mwe()?window.requestAnimationFrame(e):setTimeout(e,1),$w=Qh?k.useEffect:k.useLayoutEffect,zw=typeof navigator<"u"&&navigator.connection,OI=!Qh&&zw&&(["slow-2g","2g"].includes(zw.effectiveType)||zw.saveData),Nm=new WeakMap,Bw=(e,t)=>m_.prototype.toString.call(e)===`[object ${t}]`;let zwe=0;const w_=e=>{const t=typeof e,n=Bw(e,"Date"),r=Bw(e,"RegExp"),i=Bw(e,"Object");let o,s;if(m_(e)===e&&!n&&!r){if(o=Nm.get(e),o)return o;if(o=++zwe+"~",Nm.set(e,o),Array.isArray(e)){for(o="@",s=0;s<e.length;s++)o+=w_(e[s])+",";Nm.set(e,o)}if(i){o="#";const a=m_.keys(e).sort();for(;!Gt(s=a.pop());)Gt(e[s])||(o+=s+":"+w_(e[s])+",");Nm.set(e,o)}}else o=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},IR=e=>{if(es(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?w_(e):"",[e,t]};let Bwe=0;const S_=()=>++Bwe,b9=0,y9=1,v9=2,Hwe=3;var Mf={__proto__:null,ERROR_REVALIDATE_EVENT:Hwe,FOCUS_EVENT:b9,MUTATE_EVENT:v9,RECONNECT_EVENT:y9};async function x9(...e){const[t,n,r,i]=e,o=tl({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const c=p=>typeof a=="function"?a(p):a!==!1,u=o.throwOnError;if(es(n)){const p=n,h=[],m=t.keys();for(const b of m)!/^\$(inf|sub)\$/.test(b)&&p(t.get(b)._k)&&h.push(b);return Promise.all(h.map(d))}return d(n);async function d(p){const[h]=IR(p);if(!h)return;const[m,b]=m9(t,h),[y,x,w,_]=qs.get(t),E=()=>{const Q=y[h];return(es(o.revalidate)?o.revalidate(m().data,p):o.revalidate!==!1)&&(delete w[h],delete _[h],Q&&Q[0])?Q[0](v9).then(()=>m().data):m().data};if(e.length<3)return E();let C=r,R;const T=S_();x[h]=[T,0];const M=!Gt(l),N=m(),j=N.data,F=N._c,$=Gt(F)?j:F;if(M&&(l=es(l)?l($,j):l,b({data:l,_c:$})),es(C))try{C=C($)}catch(Q){R=Q}if(C&&g9(C))if(C=await C.catch(Q=>{R=Q}),T!==x[h][0]){if(R)throw R;return C}else R&&M&&c(R)&&(s=!0,b({data:$,_c:Kr}));if(s&&!R)if(es(s)){const Q=s(C,$);b({data:Q,error:Kr,_c:Kr})}else b({data:C,error:Kr,_c:Kr});if(x[h][1]=S_(),Promise.resolve(E()).then(()=>{b({_c:Kr})}),R){if(u)throw R;return}return C}}const MI=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Vwe=(e,t)=>{if(!qs.has(e)){const n=tl(jwe,t),r={},i=x9.bind(Kr,e);let o=Ba;const s={},a=(u,d)=>{const p=s[u]||[];return s[u]=p,p.push(d),()=>p.splice(p.indexOf(d),1)},l=(u,d,p)=>{e.set(u,d);const h=s[u];if(h)for(const m of h)m(d,p)},c=()=>{if(!qs.has(e)&&(qs.set(e,[r,{},{},{},i,l,a]),!Qh)){const u=n.initFocus(setTimeout.bind(Kr,MI.bind(Kr,r,b9))),d=n.initReconnect(setTimeout.bind(Kr,MI.bind(Kr,r,y9)));o=()=>{u&&u(),d&&d(),qs.delete(e)}}};return c(),[e,i,c,o]}return[e,qs.get(e)[4]]},Wwe=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Gt(o)&&s>o||setTimeout(r,a,i)},Uwe=g_,[w9,Gwe]=Vwe(new Map),qwe=tl({onLoadingSlow:Ba,onSuccess:Ba,onError:Ba,onErrorRetry:Wwe,onDiscarded:Ba,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:OI?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:OI?5e3:3e3,compare:Uwe,isPaused:()=>!1,cache:w9,mutate:Gwe,fallback:{}},Fwe),Ywe=(e,t)=>{const n=tl(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=tl(i,s))}return n},Kwe=k.createContext({}),Xwe="$inf$",S9=D0&&window.__SWR_DEVTOOLS_USE__,Qwe=S9?window.__SWR_DEVTOOLS_USE__:[],Zwe=()=>{S9&&(window.__SWR_DEVTOOLS_REACT__=k)},Jwe=e=>es(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],e1e=()=>tl(qwe,k.useContext(Kwe)),t1e=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=IR(t),[,,,a]=qs.get(w9);if(s.startsWith(Xwe))return n(...o);const l=a[s];return Gt(l)?n(...o):(delete a[s],l)}),r),n1e=Qwe.concat(t1e),r1e=e=>function(...n){const r=e1e(),[i,o,s]=Jwe(n),a=Ywe(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(n1e);for(let d=u.length;d--;)l=u[d](l);return l(i,o||a.fetcher||null,a)},i1e=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};Zwe();const Hw=k.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Vw={dedupe:!0},o1e=(e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:p}=n,[h,m,b,y]=qs.get(r),[x,w]=IR(e),_=k.useRef(!1),E=k.useRef(!1),C=k.useRef(x),R=k.useRef(t),T=k.useRef(n),M=()=>T.current,N=()=>M().isVisible()&&M().isOnline(),[j,F,$,Q]=m9(r,x),H=k.useRef({}).current,L=Gt(s)?Gt(n.fallback)?Kr:n.fallback[x]:s,G=(ne,fe)=>{for(const he in H){const _e=he;if(_e==="data"){if(!i(ne[_e],fe[_e])&&(!Gt(ne[_e])||!i(K,fe[_e])))return!1}else if(fe[_e]!==ne[_e])return!1}return!0},V=k.useMemo(()=>{const ne=!x||!t?!1:Gt(a)?M().isPaused()||o?!1:l!==!1:a,fe=Be=>{const dt=tl(Be);return delete dt._k,ne?{isValidating:!0,isLoading:!0,...dt}:dt},he=j(),_e=Q(),Ae=fe(he),Le=he===_e?Ae:fe(_e);let ke=Ae;return[()=>{const Be=fe(j());return G(Be,ke)?(ke.data=Be.data,ke.isLoading=Be.isLoading,ke.isValidating=Be.isValidating,ke.error=Be.error,ke):(ke=Be,Be)},()=>Le]},[r,x]),B=p9.useSyncExternalStore(k.useCallback(ne=>$(x,(fe,he)=>{G(he,fe)||ne()}),[r,x]),V[0],V[1]),X=!_.current,I=h[x]&&h[x].length>0,q=B.data,U=Gt(q)?L&&g9(L)?Hw(L):L:q,O=B.error,ee=k.useRef(U),K=p?Gt(q)?ee.current:q:U,oe=I&&!Gt(O)?!1:X&&!Gt(a)?a:M().isPaused()?!1:o?Gt(U)?!1:l:Gt(U)||l,Y=!!(x&&t&&X&&oe),J=Gt(B.isValidating)?Y:B.isValidating,se=Gt(B.isLoading)?Y:B.isLoading,ae=k.useCallback(async ne=>{const fe=R.current;if(!x||!fe||E.current||M().isPaused())return!1;let he,_e,Ae=!0;const Le=ne||{},ke=!b[x]||!Le.dedupe,Be=()=>AI?!E.current&&x===C.current&&_.current:x===C.current,dt={isValidating:!1,isLoading:!1},Ct=()=>{F(dt)},an=()=>{const Wt=b[x];Wt&&Wt[1]===_e&&delete b[x]},mt={isValidating:!0};Gt(j().data)&&(mt.isLoading=!0);try{if(ke&&(F(mt),n.loadingTimeout&&Gt(j().data)&&setTimeout(()=>{Ae&&Be()&&M().onLoadingSlow(x,n)},n.loadingTimeout),b[x]=[fe(w),S_()]),[he,_e]=b[x],he=await he,ke&&setTimeout(an,n.dedupingInterval),!b[x]||b[x][1]!==_e)return ke&&Be()&&M().onDiscarded(x),!1;dt.error=Kr;const Wt=m[x];if(!Gt(Wt)&&(_e<=Wt[0]||_e<=Wt[1]||Wt[1]===0))return Ct(),ke&&Be()&&M().onDiscarded(x),!1;const jt=j().data;dt.data=i(jt,he)?jt:he,ke&&Be()&&M().onSuccess(he,x,n)}catch(Wt){an();const jt=M(),{shouldRetryOnError:de}=jt;jt.isPaused()||(dt.error=Wt,ke&&Be()&&(jt.onError(Wt,x,jt),(de===!0||es(de)&&de(Wt))&&(!M().revalidateOnFocus||!M().revalidateOnReconnect||N())&&jt.onErrorRetry(Wt,x,jt,Ce=>{const He=h[x];He&&He[0]&&He[0](Mf.ERROR_REVALIDATE_EVENT,Ce)},{retryCount:(Le.retryCount||0)+1,dedupe:!0})))}return Ae=!1,Ct(),!0},[x,r]),ge=k.useCallback((...ne)=>x9(r,C.current,...ne),[]);if($w(()=>{R.current=t,T.current=n,Gt(q)||(ee.current=q)}),$w(()=>{if(!x)return;const ne=ae.bind(Kr,Vw);let fe=0;const _e=i1e(x,h,(Ae,Le={})=>{if(Ae==Mf.FOCUS_EVENT){const ke=Date.now();M().revalidateOnFocus&&ke>fe&&N()&&(fe=ke+M().focusThrottleInterval,ne())}else if(Ae==Mf.RECONNECT_EVENT)M().revalidateOnReconnect&&N()&&ne();else{if(Ae==Mf.MUTATE_EVENT)return ae();if(Ae==Mf.ERROR_REVALIDATE_EVENT)return ae(Le)}});return E.current=!1,C.current=x,_.current=!0,F({_k:w}),oe&&(Gt(U)||Qh?ne():$we(ne)),()=>{E.current=!0,_e()}},[x]),$w(()=>{let ne;function fe(){const _e=es(c)?c(j().data):c;_e&&ne!==-1&&(ne=setTimeout(he,_e))}function he(){!j().error&&(u||M().isVisible())&&(d||M().isOnline())?ae(Vw).then(fe):fe()}return fe(),()=>{ne&&(clearTimeout(ne),ne=-1)}},[c,u,d,x]),k.useDebugValue(K),o&&Gt(U)&&x){if(!AI&&Qh)throw new Error("Fallback data is required when using Suspense in SSR.");R.current=t,T.current=n,E.current=!1;const ne=y[x];if(!Gt(ne)){const fe=ge(ne);Hw(fe)}if(Gt(O)){const fe=ae(Vw);Gt(K)||(fe.status="fulfilled",fe.value=!0),Hw(fe)}else throw O}return{mutate:ge,get data(){return H.data=!0,K},get error(){return H.error=!0,O},get isValidating(){return H.isValidating=!0,J},get isLoading(){return H.isLoading=!0,se}}},Lm=r1e(o1e);function s1e(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...o){clearTimeout(n);const s=Date.now(),a=s-r,l=t-a;l<=0?(r=s,e.apply(this,o)):n=setTimeout(()=>{r=Date.now(),e.apply(this,o)},l)}}var a1e=s1e;const l1e=Ic(a1e);function II(e,t){return t!=null?l1e(e,t):e}function _9({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:i,onToolCall:o,experimental_prepareRequestBody:s,maxSteps:a=1,streamProtocol:l="data",onResponse:c,onFinish:u,onError:d,credentials:p,headers:h,body:m,generateId:b=AR,fetch:y,keepLastMessageOnError:x=!0,experimental_throttle:w}={}){const[_]=k.useState(b),E=t??_,C=typeof e=="string"?[e,E]:E,[R]=k.useState([]),{data:T,mutate:M}=Lm([C,"messages"],null,{fallbackData:n!=null?Fw(n):R}),N=k.useRef(T||[]);k.useEffect(()=>{N.current=T||[]},[T]);const{data:j,mutate:F}=Lm([C,"streamData"],null),$=k.useRef(j);k.useEffect(()=>{$.current=j},[j]);const{data:Q="ready",mutate:H}=Lm([C,"status"],null),{data:L=void 0,mutate:G}=Lm([C,"error"],null),V=k.useRef(null),B=k.useRef({credentials:p,headers:h,body:m});k.useEffect(()=>{B.current={credentials:p,headers:h,body:m}},[p,h,m]);const X=k.useCallback(async ae=>{var ge,ne;H("submitted"),G(void 0);const fe=Fw(ae.messages),he=fe.length,_e=p_((ge=fe[fe.length-1])==null?void 0:ge.toolInvocations);try{const Le=new AbortController;V.current=Le;const ke=II(M,w),Be=II(F,w),dt=N.current;ke(fe,!1);const Ct=i?fe:fe.map(({role:mt,content:Wt,experimental_attachments:jt,data:de,annotations:Ce,toolInvocations:He,parts:Ge})=>({role:mt,content:Wt,...jt!==void 0&&{experimental_attachments:jt},...de!==void 0&&{data:de},...Ce!==void 0&&{annotations:Ce},...He!==void 0&&{toolInvocations:He},...Ge!==void 0&&{parts:Ge}})),an=$.current;await Twe({api:e,body:(ne=s==null?void 0:s({id:E,messages:fe,requestData:ae.data,requestBody:ae.body}))!=null?ne:{id:E,messages:Ct,data:ae.data,...B.current.body,...ae.body},streamProtocol:l,credentials:B.current.credentials,headers:{...B.current.headers,...ae.headers},abortController:()=>V.current,restoreMessagesOnFailure(){x||ke(dt,!1)},onResponse:c,onUpdate({message:mt,data:Wt,replaceLastMessage:jt}){H("streaming"),ke([...jt?fe.slice(0,fe.length-1):fe,mt],!1),Wt!=null&&Wt.length&&Be([...an??[],...Wt],!1)},onToolCall:o,onFinish:u,generateId:b,fetch:y,lastMessage:fe[fe.length-1]}),V.current=null,H("ready")}catch(Le){if(Le.name==="AbortError")return V.current=null,H("ready"),null;d&&Le instanceof Error&&d(Le),G(Le),H("error")}const Ae=N.current;kwe({originalMaxToolInvocationStep:_e,originalMessageCount:he,maxSteps:a,messages:Ae})&&await X({messages:Ae})},[M,H,e,B,c,u,d,G,F,$,l,i,s,o,a,N,V,b,y,x,w,E]),I=k.useCallback(async(ae,{data:ge,headers:ne,body:fe,experimental_attachments:he}={})=>{var _e,Ae;const Le=await TI(he),ke=N.current.concat({...ae,id:(_e=ae.id)!=null?_e:b(),createdAt:(Ae=ae.createdAt)!=null?Ae:new Date,experimental_attachments:Le.length>0?Le:void 0,parts:f9(ae)});return X({messages:ke,headers:ne,body:fe,data:ge})},[X,b]),q=k.useCallback(async({data:ae,headers:ge,body:ne}={})=>{const fe=N.current;if(fe.length===0)return null;const he=fe[fe.length-1];return X({messages:he.role==="assistant"?fe.slice(0,-1):fe,headers:ge,body:ne,data:ae})},[X]),U=k.useCallback(()=>{V.current&&(V.current.abort(),V.current=null)},[]),O=k.useCallback(ae=>{typeof ae=="function"&&(ae=ae(N.current));const ge=Fw(ae);M(ge,!1),N.current=ge},[M]),ee=k.useCallback(ae=>{typeof ae=="function"&&(ae=ae($.current)),F(ae,!1),$.current=ae},[F]),[K,oe]=k.useState(r),Y=k.useCallback(async(ae,ge={},ne)=>{var fe;if((fe=ae==null?void 0:ae.preventDefault)==null||fe.call(ae),!K&&!ge.allowEmptySubmit)return;ne&&(B.current={...B.current,...ne});const he=await TI(ge.experimental_attachments),Ae={messages:N.current.concat({id:b(),createdAt:new Date,role:"user",content:K,experimental_attachments:he.length>0?he:void 0,parts:[{type:"text",text:K}]}),headers:ge.headers,body:ge.body,data:ge.data};X(Ae),oe("")},[K,b,X]),J=ae=>{oe(ae.target.value)},se=k.useCallback(({toolCallId:ae,result:ge})=>{const ne=N.current;Owe({messages:ne,toolCallId:ae,toolResult:ge}),M(ne,!1);const fe=ne[ne.length-1];h9(fe)&&X({messages:ne})},[M,X]);return{messages:T??[],id:E,setMessages:O,data:j,setData:ee,error:L,append:I,reload:q,stop:U,input:K,setInput:oe,handleInputChange:J,handleSubmit:Y,isLoading:Q==="submitted"||Q==="streaming",status:Q,addToolResult:se}}var DR="Collapsible",[c1e,C9]=rr(DR),[u1e,NR]=c1e(DR),E9=P.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l=!1,c]=Dr({prop:r,defaultProp:i,onChange:s});return v.jsx(u1e,{scope:n,disabled:o,contentId:Yn(),open:l,onOpenToggle:P.useCallback(()=>c(u=>!u),[c]),children:v.jsx(Fe.div,{"data-state":$R(l),"data-disabled":o?"":void 0,...a,ref:t})})});E9.displayName=DR;var R9="CollapsibleTrigger",LR=P.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=NR(R9,n);return v.jsx(Fe.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":$R(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Pe(e.onClick,i.onOpenToggle)})});LR.displayName=R9;var FR="CollapsibleContent",jR=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=NR(FR,e.__scopeCollapsible);return v.jsx(Kn,{present:n||i.open,children:({present:o})=>v.jsx(d1e,{...r,ref:t,present:o})})});jR.displayName=FR;var d1e=P.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=NR(FR,n),[a,l]=P.useState(r),c=P.useRef(null),u=it(t,c),d=P.useRef(0),p=d.current,h=P.useRef(0),m=h.current,b=s.open||a,y=P.useRef(b),x=P.useRef(void 0);return P.useEffect(()=>{const w=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(w)},[]),yr(()=>{const w=c.current;if(w){x.current=x.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const _=w.getBoundingClientRect();d.current=_.height,h.current=_.width,y.current||(w.style.transitionDuration=x.current.transitionDuration,w.style.animationName=x.current.animationName),l(r)}},[s.open,r]),v.jsx(Fe.div,{"data-state":$R(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b,...o,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:b&&i})});function $R(e){return e?"open":"closed"}var P9=E9,f1e=LR,h1e=jR;const p1e=P9,g1e=LR,m1e=jR;function b1e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const y1e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v1e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,x1e={};function DI(e,t){return(x1e.jsx?v1e:y1e).test(e)}const w1e=/[ \t\n\f\r]/g;function S1e(e){return typeof e=="object"?e.type==="text"?NI(e.value):!1:NI(e)}function NI(e){return e.replace(w1e,"")===""}class Vp{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Vp.prototype.property={};Vp.prototype.normal={};Vp.prototype.space=null;function T9(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new Vp(n,r,t)}function __(e){return e.toLowerCase()}class go{constructor(t,n){this.property=t,this.attribute=n}}go.prototype.space=null;go.prototype.boolean=!1;go.prototype.booleanish=!1;go.prototype.overloadedBoolean=!1;go.prototype.number=!1;go.prototype.commaSeparated=!1;go.prototype.spaceSeparated=!1;go.prototype.commaOrSpaceSeparated=!1;go.prototype.mustUseProperty=!1;go.prototype.defined=!1;let _1e=0;const ct=Bc(),Un=Bc(),k9=Bc(),Te=Bc(),gn=Bc(),$u=Bc(),Ai=Bc();function Bc(){return 2**++_1e}const C_=Object.freeze(Object.defineProperty({__proto__:null,boolean:ct,booleanish:Un,commaOrSpaceSeparated:Ai,commaSeparated:$u,number:Te,overloadedBoolean:k9,spaceSeparated:gn},Symbol.toStringTag,{value:"Module"})),Ww=Object.keys(C_);class zR extends go{constructor(t,n,r,i){let o=-1;if(super(t,n),LI(this,"space",i),typeof r=="number")for(;++o<Ww.length;){const s=Ww[o];LI(this,Ww[o],(r&C_[s])===C_[s])}}}zR.prototype.defined=!0;function LI(e,t,n){n&&(e[t]=n)}const C1e={}.hasOwnProperty;function Ud(e){const t={},n={};let r;for(r in e.properties)if(C1e.call(e.properties,r)){const i=e.properties[r],o=new zR(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[__(r)]=r,n[__(o.attribute)]=r}return new Vp(t,n,e.space)}const A9=Ud({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}}),O9=Ud({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function M9(e,t){return t in e?e[t]:t}function I9(e,t){return M9(e,t.toLowerCase())}const D9=Ud({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:I9,properties:{xmlns:null,xmlnsXLink:null}}),N9=Ud({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Un,ariaAutoComplete:null,ariaBusy:Un,ariaChecked:Un,ariaColCount:Te,ariaColIndex:Te,ariaColSpan:Te,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:Te,ariaLive:null,ariaModal:Un,ariaMultiLine:Un,ariaMultiSelectable:Un,ariaOrientation:null,ariaOwns:gn,ariaPlaceholder:null,ariaPosInSet:Te,ariaPressed:Un,ariaReadOnly:Un,ariaRelevant:null,ariaRequired:Un,ariaRoleDescription:gn,ariaRowCount:Te,ariaRowIndex:Te,ariaRowSpan:Te,ariaSelected:Un,ariaSetSize:Te,ariaSort:null,ariaValueMax:Te,ariaValueMin:Te,ariaValueNow:Te,ariaValueText:null,role:null}}),E1e=Ud({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:I9,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$u,acceptCharset:gn,accessKey:gn,action:null,allow:null,allowFullScreen:ct,allowPaymentRequest:ct,allowUserMedia:ct,alt:null,as:null,async:ct,autoCapitalize:null,autoComplete:gn,autoFocus:ct,autoPlay:ct,blocking:gn,capture:null,charSet:null,checked:ct,cite:null,className:gn,cols:Te,colSpan:null,content:null,contentEditable:Un,controls:ct,controlsList:gn,coords:Te|$u,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ct,defer:ct,dir:null,dirName:null,disabled:ct,download:k9,draggable:Un,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ct,formTarget:null,headers:gn,height:Te,hidden:ct,high:Te,href:null,hrefLang:null,htmlFor:gn,httpEquiv:gn,id:null,imageSizes:null,imageSrcSet:null,inert:ct,inputMode:null,integrity:null,is:null,isMap:ct,itemId:null,itemProp:gn,itemRef:gn,itemScope:ct,itemType:gn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ct,low:Te,manifest:null,max:null,maxLength:Te,media:null,method:null,min:null,minLength:Te,multiple:ct,muted:ct,name:null,nonce:null,noModule:ct,noValidate:ct,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:ct,optimum:Te,pattern:null,ping:gn,placeholder:null,playsInline:ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ct,referrerPolicy:null,rel:gn,required:ct,reversed:ct,rows:Te,rowSpan:Te,sandbox:gn,scope:null,scoped:ct,seamless:ct,selected:ct,shadowRootClonable:ct,shadowRootDelegatesFocus:ct,shadowRootMode:null,shape:null,size:Te,sizes:null,slot:null,span:Te,spellCheck:Un,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Te,step:null,style:null,tabIndex:Te,target:null,title:null,translate:null,type:null,typeMustMatch:ct,useMap:null,value:Un,width:Te,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gn,axis:null,background:null,bgColor:null,border:Te,borderColor:null,bottomMargin:Te,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ct,declare:ct,event:null,face:null,frame:null,frameBorder:null,hSpace:Te,leftMargin:Te,link:null,longDesc:null,lowSrc:null,marginHeight:Te,marginWidth:Te,noResize:ct,noHref:ct,noShade:ct,noWrap:ct,object:null,profile:null,prompt:null,rev:null,rightMargin:Te,rules:null,scheme:null,scrolling:Un,standby:null,summary:null,text:null,topMargin:Te,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Te,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ct,disableRemotePlayback:ct,prefix:null,property:null,results:Te,security:null,unselectable:null}}),R1e=Ud({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:M9,properties:{about:Ai,accentHeight:Te,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Te,amplitude:Te,arabicForm:null,ascent:Te,attributeName:null,attributeType:null,azimuth:Te,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Te,by:null,calcMode:null,capHeight:Te,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:Te,diffuseConstant:Te,direction:null,display:null,dur:null,divisor:Te,dominantBaseline:null,download:ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:Te,enableBackground:null,end:null,event:null,exponent:Te,externalResourcesRequired:null,fill:null,fillOpacity:Te,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:Te,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Te,horizOriginX:Te,horizOriginY:Te,id:null,ideographic:Te,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Te,k:Te,k1:Te,k2:Te,k3:Te,k4:Te,kernelMatrix:Ai,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Te,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:Te,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:Te,overlineThickness:Te,paintOrder:null,panose1:null,path:null,pathLength:Te,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Te,pointsAtY:Te,pointsAtZ:Te,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ai,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ai,rev:Ai,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ai,requiredFeatures:Ai,requiredFonts:Ai,requiredFormats:Ai,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:Te,specularExponent:Te,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Te,strikethroughThickness:Te,string:null,stroke:null,strokeDashArray:Ai,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Te,strokeOpacity:Te,strokeWidth:null,style:null,surfaceScale:Te,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ai,tabIndex:Te,tableValues:null,target:null,targetX:Te,targetY:Te,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ai,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Te,underlineThickness:Te,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Te,values:null,vAlphabetic:Te,vMathematical:Te,vectorEffect:null,vHanging:Te,vIdeographic:Te,version:null,vertAdvY:Te,vertOriginX:Te,vertOriginY:Te,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Te,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),P1e=/^data[-\w.:]+$/i,FI=/-[a-z]/g,T1e=/[A-Z]/g;function k1e(e,t){const n=__(t);let r=t,i=go;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&P1e.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(FI,O1e);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!FI.test(o)){let s=o.replace(T1e,A1e);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=zR}return new i(r,t)}function A1e(e){return"-"+e.toLowerCase()}function O1e(e){return e.charAt(1).toUpperCase()}const M1e={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"},I1e=T9([O9,A9,D9,N9,E1e],"html"),BR=T9([O9,A9,D9,N9,R1e],"svg");function D1e(e){return e.join(" ").trim()}var L9={},jI=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,N1e=/\n/g,L1e=/^\s*/,F1e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,j1e=/^:\s*/,$1e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,z1e=/^[;\s]*/,B1e=/^\s+|\s+$/g,H1e=`
395
- `,$I="/",zI="*",jl="",V1e="comment",W1e="declaration",U1e=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var b=m.match(N1e);b&&(n+=b.length);var y=m.lastIndexOf(H1e);r=~y?m.length-y:r+m.length}function o(){var m={line:n,column:r};return function(b){return b.position=new s(m),c(),b}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var b=new Error(t.source+":"+n+":"+r+": "+m);if(b.reason=m,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(m){var b=m.exec(e);if(b){var y=b[0];return i(y),e=e.slice(y.length),b}}function c(){l(L1e)}function u(m){var b;for(m=m||[];b=d();)b!==!1&&m.push(b);return m}function d(){var m=o();if(!($I!=e.charAt(0)||zI!=e.charAt(1))){for(var b=2;jl!=e.charAt(b)&&(zI!=e.charAt(b)||$I!=e.charAt(b+1));)++b;if(b+=2,jl===e.charAt(b-1))return a("End of comment missing");var y=e.slice(2,b-2);return r+=2,i(y),e=e.slice(b),r+=2,m({type:V1e,comment:y})}}function p(){var m=o(),b=l(F1e);if(b){if(d(),!l(j1e))return a("property missing ':'");var y=l($1e),x=m({type:W1e,property:BI(b[0].replace(jI,jl)),value:y?BI(y[0].replace(jI,jl)):jl});return l(z1e),x}}function h(){var m=[];u(m);for(var b;b=p();)b!==!1&&(m.push(b),u(m));return m}return c(),h()};function BI(e){return e?e.replace(B1e,jl):jl}var G1e=Ra&&Ra.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(L9,"__esModule",{value:!0});var HI=L9.default=Y1e,q1e=G1e(U1e);function Y1e(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,q1e.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}const K1e=HI.default||HI,F9=j9("end"),HR=j9("start");function j9(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 X1e(e){const t=HR(e),n=F9(e);if(t&&n)return{start:t,end:n}}function xh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?VI(e.position):"start"in e||"end"in e?VI(e):"line"in e||"column"in e?E_(e):""}function E_(e){return WI(e&&e.line)+":"+WI(e&&e.column)}function VI(e){return E_(e&&e.start)+"-"+E_(e&&e.end)}function WI(e){return e&&typeof e=="number"?e:1}class Nr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=xh(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Nr.prototype.file="";Nr.prototype.name="";Nr.prototype.reason="";Nr.prototype.message="";Nr.prototype.stack="";Nr.prototype.column=void 0;Nr.prototype.line=void 0;Nr.prototype.ancestors=void 0;Nr.prototype.cause=void 0;Nr.prototype.fatal=void 0;Nr.prototype.place=void 0;Nr.prototype.ruleId=void 0;Nr.prototype.source=void 0;const VR={}.hasOwnProperty,Q1e=new Map,Z1e=/[A-Z]/g,J1e=/-([a-z])/g,eSe=new Set(["table","tbody","thead","tfoot","tr"]),tSe=new Set(["td","th"]),$9="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function nSe(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=uSe(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=cSe(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?BR:I1e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=z9(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function z9(e,t,n){if(t.type==="element")return rSe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return iSe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return sSe(e,t,n);if(t.type==="mdxjsEsm")return oSe(e,t);if(t.type==="root")return aSe(e,t,n);if(t.type==="text")return lSe(e,t)}function rSe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=BR,e.schema=i),e.ancestors.push(t);const o=H9(e,t.tagName,!1),s=dSe(e,t);let a=UR(e,t);return eSe.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!S1e(l):!0})),B9(e,s,o,t),WR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function iSe(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)}Zh(e,t.position)}function oSe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Zh(e,t.position)}function sSe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=BR,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:H9(e,t.name,!0),s=fSe(e,t),a=UR(e,t);return B9(e,s,o,t),WR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function aSe(e,t,n){const r={};return WR(r,UR(e,t)),e.create(t,e.Fragment,r,n)}function lSe(e,t){return t.value}function B9(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function WR(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function cSe(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function uSe(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=HR(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function dSe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&VR.call(t.properties,i)){const o=hSe(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&tSe.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function fSe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Zh(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Zh(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function UR(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Q1e;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=z9(e,o,s);a!==void 0&&n.push(a)}return n}function hSe(e,t,n){const r=k1e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?b1e(n):D1e(n)),r.property==="style"){let i=typeof n=="object"?n:pSe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=gSe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?M1e[r.property]||r.property:r.attribute,n]}}function pSe(e,t){const n={};try{K1e(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new Nr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=$9+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(J1e,bSe)),n[s]=o}}function H9(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=DI(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=DI(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return VR.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Zh(e)}function Zh(e,t){const n=new Nr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=$9+"#cannot-handle-mdx-estrees-without-createevaluater",n}function gSe(e){const t={};let n;for(n in e)VR.call(e,n)&&(t[mSe(n)]=e[n]);return t}function mSe(e){let t=e.replace(Z1e,ySe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function bSe(e,t){return t.toUpperCase()}function ySe(e){return"-"+e.toLowerCase()}const Uw={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"]},vSe={};function xSe(e,t){const n=vSe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return V9(e,r,i)}function V9(e,t,n){if(wSe(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 UI(e.children,t,n)}return Array.isArray(e)?UI(e,t,n):""}function UI(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=V9(e[i],t,n);return r.join("")}function wSe(e){return!!(e&&typeof e=="object")}const GI=document.createElement("i");function GR(e){const t="&"+e+";";GI.innerHTML=t;const n=GI.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function gs(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function oo(e,t){return e.length>0?(gs(e,e.length,0,t),e):t}const qI={}.hasOwnProperty;function SSe(e){const t={};let n=-1;for(;++n<e.length;)_Se(t,e[n]);return t}function _Se(e,t){let n;for(n in t){const i=(qI.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){qI.call(i,s)||(i[s]=[]);const a=o[s];CSe(i[s],Array.isArray(a)?a:a?[a]:[])}}}function CSe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);gs(e,0,0,r)}function W9(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 zu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ts=ul(/[A-Za-z]/),Li=ul(/[\dA-Za-z]/),ESe=ul(/[#-'*+\--9=?A-Z^-~]/);function R_(e){return e!==null&&(e<32||e===127)}const P_=ul(/\d/),RSe=ul(/[\dA-Fa-f]/),PSe=ul(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function yi(e){return e!==null&&(e<0||e===32)}function Kt(e){return e===-2||e===-1||e===32}const TSe=ul(new RegExp("\\p{P}|\\p{S}","u")),kSe=ul(/\s/);function ul(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Gd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Li(e.charCodeAt(n+1))&&Li(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function mn(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Kt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Kt(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const ASe={tokenize:OSe};function OSe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),mn(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return tt(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const MSe={tokenize:ISe},YI={tokenize:DSe};function ISe(e){const t=this,n=[];let r=0,i,o,s;return a;function a(_){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,c)(_)}return c(_)}function l(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&w();const E=t.events.length;let C=E,R;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){R=t.events[C][1].end;break}x(r);let T=E;for(;T<t.events.length;)t.events[T][1].end={...R},T++;return gs(t.events,C+1,0,t.events.slice(E)),t.events.length=T,c(_)}return a(_)}function c(_){if(r===n.length){if(!i)return p(_);if(i.currentConstruct&&i.currentConstruct.concrete)return m(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(YI,u,d)(_)}function u(_){return i&&w(),x(r),p(_)}function d(_){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(_)}function p(_){return t.containerState={},e.attempt(YI,h,m)(_)}function h(_){return r++,n.push([t.currentConstruct,t.containerState]),p(_)}function m(_){if(_===null){i&&w(),x(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(_)}function b(_){if(_===null){y(e.exit("chunkFlow"),!0),x(0),e.consume(_);return}return tt(_)?(e.consume(_),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(_),b)}function y(_,E){const C=t.sliceStream(_);if(E&&C.push(null),_.previous=o,o&&(o.next=_),o=_,i.defineSkip(_.start),i.write(C),t.parser.lazy[_.start.line]){let R=i.events.length;for(;R--;)if(i.events[R][1].start.offset<s&&(!i.events[R][1].end||i.events[R][1].end.offset>s))return;const T=t.events.length;let M=T,N,j;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(N){j=t.events[M][1].end;break}N=!0}for(x(r),R=T;R<t.events.length;)t.events[R][1].end={...j},R++;gs(t.events,M+1,0,t.events.slice(T)),t.events.length=R}}function x(_){let E=n.length;for(;E-- >_;){const C=n[E];t.containerState=C[1],C[0].exit.call(t,e)}n.length=_}function w(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function DSe(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 KI(e){if(e===null||yi(e)||kSe(e))return 1;if(TSe(e))return 2}function qR(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const T_={name:"attention",resolveAll:NSe,tokenize:LSe};function NSe(e,t){let n=-1,r,i,o,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};XI(d,-l),XI(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=oo(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=oo(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=oo(c,qR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=oo(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=oo(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,gs(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 LSe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=KI(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),u=KI(l),d=!u||u===2&&i||n.includes(l),p=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!p)),c._close=!!(o===42?p:p&&(u||!d)),t(l)}}function XI(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const FSe={name:"autolink",tokenize:jSe};function jSe(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return ts(h)?(e.consume(h),s):h===64?n(h):c(h)}function s(h){return h===43||h===45||h===46||Li(h)?(r=1,a(h)):c(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||Li(h))&&r++<32?(e.consume(h),a):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||R_(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):ESe(h)?(e.consume(h),c):n(h)}function u(h){return Li(h)?d(h):n(h)}function d(h){return h===46?(e.consume(h),r=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||Li(h))&&r++<63){const m=h===45?p:d;return e.consume(h),m}return n(h)}}const N0={partial:!0,tokenize:$Se};function $Se(e,t,n){return r;function r(o){return Kt(o)?mn(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||tt(o)?t(o):n(o)}}const U9={continuation:{tokenize:BSe},exit:HSe,name:"blockQuote",tokenize:zSe};function zSe(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Kt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function BSe(e,t,n){const r=this;return i;function i(s){return Kt(s)?mn(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(U9,t,n)(s)}}function HSe(e){e.exit("blockQuote")}const G9={name:"characterEscape",tokenize:VSe};function VSe(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return PSe(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const q9={name:"characterReference",tokenize:WSe};function WSe(e,t,n){const r=this;let i=0,o,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Li,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=RSe,u):(e.enter("characterReferenceValue"),o=7,s=P_,u(d))}function u(d){if(d===59&&i){const p=e.exit("characterReferenceValue");return s===Li&&!GR(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),u):n(d)}}const QI={partial:!0,tokenize:GSe},ZI={concrete:!0,name:"codeFenced",tokenize:USe};function USe(e,t,n){const r=this,i={partial:!0,tokenize:C};let o=0,s=0,a;return l;function l(R){return c(R)}function c(R){const T=r.events[r.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(R)}function u(R){return R===a?(s++,e.consume(R),u):s<3?n(R):(e.exit("codeFencedFenceSequence"),Kt(R)?mn(e,d,"whitespace")(R):d(R))}function d(R){return R===null||tt(R)?(e.exit("codeFencedFence"),r.interrupt?t(R):e.check(QI,b,E)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(R))}function p(R){return R===null||tt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(R)):Kt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),mn(e,h,"whitespace")(R)):R===96&&R===a?n(R):(e.consume(R),p)}function h(R){return R===null||tt(R)?d(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(R))}function m(R){return R===null||tt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(R)):R===96&&R===a?n(R):(e.consume(R),m)}function b(R){return e.attempt(i,E,y)(R)}function y(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),x}function x(R){return o>0&&Kt(R)?mn(e,w,"linePrefix",o+1)(R):w(R)}function w(R){return R===null||tt(R)?e.check(QI,b,E)(R):(e.enter("codeFlowValue"),_(R))}function _(R){return R===null||tt(R)?(e.exit("codeFlowValue"),w(R)):(e.consume(R),_)}function E(R){return e.exit("codeFenced"),t(R)}function C(R,T,M){let N=0;return j;function j(L){return R.enter("lineEnding"),R.consume(L),R.exit("lineEnding"),F}function F(L){return R.enter("codeFencedFence"),Kt(L)?mn(R,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):$(L)}function $(L){return L===a?(R.enter("codeFencedFenceSequence"),Q(L)):M(L)}function Q(L){return L===a?(N++,R.consume(L),Q):N>=s?(R.exit("codeFencedFenceSequence"),Kt(L)?mn(R,H,"whitespace")(L):H(L)):M(L)}function H(L){return L===null||tt(L)?(R.exit("codeFencedFence"),T(L)):M(L)}}}function GSe(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Gw={name:"codeIndented",tokenize:YSe},qSe={partial:!0,tokenize:KSe};function YSe(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),mn(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):tt(c)?e.attempt(qSe,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||tt(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function KSe(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):tt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):mn(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):tt(s)?i(s):n(s)}}const XSe={name:"codeText",previous:ZSe,resolve:QSe,tokenize:JSe};function QSe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ZSe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function JSe(e,t,n){let r=0,i,o;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):tt(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||tt(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class e_e{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&If(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),If(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),If(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);If(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);If(this.left,n.reverse())}}}function If(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Y9(e){const t={};let n=-1,r,i,o,s,a,l,c;const u=new e_e(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,t_e(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=u.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return gs(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function t_e(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let u,d,p=-1,h=n,m=0,b=0;const y=[b];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(b=p+1,y.push(b),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):y.pop(),p=y.length;p--;){const x=a.slice(y[p],y[p+1]),w=o.pop();l.push([w,w+x.length-1]),e.splice(w,2,x)}for(l.reverse(),p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const n_e={resolve:i_e,tokenize:o_e},r_e={partial:!0,tokenize:s_e};function i_e(e){return Y9(e),e}function o_e(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):tt(a)?e.check(r_e,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function s_e(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),mn(e,o,"linePrefix")}function o(s){if(s===null||tt(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function K9(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||R_(x)?n(x):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||tt(x)?n(x):(e.consume(x),x===92?m:h)}function m(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function b(x){return!u&&(x===null||x===41||yi(x))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,b):x===41?(e.consume(x),u--,b):x===null||x===32||x===40||R_(x)?n(x):(e.consume(x),x===92?y:b)}function y(x){return x===40||x===41||x===92?(e.consume(x),b):b(x)}}function X9(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),u}function u(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):tt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||tt(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!Kt(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function Q9(e,t,n,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===s?(e.exit(o),l(s)):p===null?n(p):tt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),mn(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||tt(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?d:u)}function d(p){return p===s||p===92?(e.consume(p),u):u(p)}}function wh(e,t){let n;return r;function r(i){return tt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Kt(i)?mn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const a_e={name:"definition",tokenize:c_e},l_e={partial:!0,tokenize:u_e};function c_e(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),s(h)}function s(h){return X9.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=zu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return yi(h)?wh(e,c)(h):c(h)}function c(h){return K9(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(l_e,d,d)(h)}function d(h){return Kt(h)?mn(e,p,"whitespace")(h):p(h)}function p(h){return h===null||tt(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function u_e(e,t,n){return r;function r(a){return yi(a)?wh(e,i)(a):n(a)}function i(a){return Q9(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Kt(a)?mn(e,s,"whitespace")(a):s(a)}function s(a){return a===null||tt(a)?t(a):n(a)}}const d_e={name:"hardBreakEscape",tokenize:f_e};function f_e(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return tt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const h_e={name:"headingAtx",resolve:p_e,tokenize:g_e};function p_e(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},gs(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function g_e(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||yi(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||tt(u)?(e.exit("atxHeading"),t(u)):Kt(u)?mn(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||yi(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const m_e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],JI=["pre","script","style","textarea"],b_e={concrete:!0,name:"htmlFlow",resolveTo:x_e,tokenize:w_e},y_e={partial:!0,tokenize:__e},v_e={partial:!0,tokenize:S_e};function x_e(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function w_e(e,t,n){const r=this;let i,o,s,a,l;return c;function c(O){return u(O)}function u(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),d}function d(O){return O===33?(e.consume(O),p):O===47?(e.consume(O),o=!0,b):O===63?(e.consume(O),i=3,r.interrupt?t:I):ts(O)?(e.consume(O),s=String.fromCharCode(O),y):n(O)}function p(O){return O===45?(e.consume(O),i=2,h):O===91?(e.consume(O),i=5,a=0,m):ts(O)?(e.consume(O),i=4,r.interrupt?t:I):n(O)}function h(O){return O===45?(e.consume(O),r.interrupt?t:I):n(O)}function m(O){const ee="CDATA[";return O===ee.charCodeAt(a++)?(e.consume(O),a===ee.length?r.interrupt?t:$:m):n(O)}function b(O){return ts(O)?(e.consume(O),s=String.fromCharCode(O),y):n(O)}function y(O){if(O===null||O===47||O===62||yi(O)){const ee=O===47,K=s.toLowerCase();return!ee&&!o&&JI.includes(K)?(i=1,r.interrupt?t(O):$(O)):m_e.includes(s.toLowerCase())?(i=6,ee?(e.consume(O),x):r.interrupt?t(O):$(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?w(O):_(O))}return O===45||Li(O)?(e.consume(O),s+=String.fromCharCode(O),y):n(O)}function x(O){return O===62?(e.consume(O),r.interrupt?t:$):n(O)}function w(O){return Kt(O)?(e.consume(O),w):j(O)}function _(O){return O===47?(e.consume(O),j):O===58||O===95||ts(O)?(e.consume(O),E):Kt(O)?(e.consume(O),_):j(O)}function E(O){return O===45||O===46||O===58||O===95||Li(O)?(e.consume(O),E):C(O)}function C(O){return O===61?(e.consume(O),R):Kt(O)?(e.consume(O),C):_(O)}function R(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),l=O,T):Kt(O)?(e.consume(O),R):M(O)}function T(O){return O===l?(e.consume(O),l=null,N):O===null||tt(O)?n(O):(e.consume(O),T)}function M(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||yi(O)?C(O):(e.consume(O),M)}function N(O){return O===47||O===62||Kt(O)?_(O):n(O)}function j(O){return O===62?(e.consume(O),F):n(O)}function F(O){return O===null||tt(O)?$(O):Kt(O)?(e.consume(O),F):n(O)}function $(O){return O===45&&i===2?(e.consume(O),G):O===60&&i===1?(e.consume(O),V):O===62&&i===4?(e.consume(O),q):O===63&&i===3?(e.consume(O),I):O===93&&i===5?(e.consume(O),X):tt(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(y_e,U,Q)(O)):O===null||tt(O)?(e.exit("htmlFlowData"),Q(O)):(e.consume(O),$)}function Q(O){return e.check(v_e,H,U)(O)}function H(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),L}function L(O){return O===null||tt(O)?Q(O):(e.enter("htmlFlowData"),$(O))}function G(O){return O===45?(e.consume(O),I):$(O)}function V(O){return O===47?(e.consume(O),s="",B):$(O)}function B(O){if(O===62){const ee=s.toLowerCase();return JI.includes(ee)?(e.consume(O),q):$(O)}return ts(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),B):$(O)}function X(O){return O===93?(e.consume(O),I):$(O)}function I(O){return O===62?(e.consume(O),q):O===45&&i===2?(e.consume(O),I):$(O)}function q(O){return O===null||tt(O)?(e.exit("htmlFlowData"),U(O)):(e.consume(O),q)}function U(O){return e.exit("htmlFlow"),t(O)}}function S_e(e,t,n){const r=this;return i;function i(s){return tt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function __e(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(N0,t,n)}}const C_e={name:"htmlText",tokenize:E_e};function E_e(e,t,n){const r=this;let i,o,s;return a;function a(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),l}function l(I){return I===33?(e.consume(I),c):I===47?(e.consume(I),C):I===63?(e.consume(I),_):ts(I)?(e.consume(I),M):n(I)}function c(I){return I===45?(e.consume(I),u):I===91?(e.consume(I),o=0,m):ts(I)?(e.consume(I),w):n(I)}function u(I){return I===45?(e.consume(I),h):n(I)}function d(I){return I===null?n(I):I===45?(e.consume(I),p):tt(I)?(s=d,V(I)):(e.consume(I),d)}function p(I){return I===45?(e.consume(I),h):d(I)}function h(I){return I===62?G(I):I===45?p(I):d(I)}function m(I){const q="CDATA[";return I===q.charCodeAt(o++)?(e.consume(I),o===q.length?b:m):n(I)}function b(I){return I===null?n(I):I===93?(e.consume(I),y):tt(I)?(s=b,V(I)):(e.consume(I),b)}function y(I){return I===93?(e.consume(I),x):b(I)}function x(I){return I===62?G(I):I===93?(e.consume(I),x):b(I)}function w(I){return I===null||I===62?G(I):tt(I)?(s=w,V(I)):(e.consume(I),w)}function _(I){return I===null?n(I):I===63?(e.consume(I),E):tt(I)?(s=_,V(I)):(e.consume(I),_)}function E(I){return I===62?G(I):_(I)}function C(I){return ts(I)?(e.consume(I),R):n(I)}function R(I){return I===45||Li(I)?(e.consume(I),R):T(I)}function T(I){return tt(I)?(s=T,V(I)):Kt(I)?(e.consume(I),T):G(I)}function M(I){return I===45||Li(I)?(e.consume(I),M):I===47||I===62||yi(I)?N(I):n(I)}function N(I){return I===47?(e.consume(I),G):I===58||I===95||ts(I)?(e.consume(I),j):tt(I)?(s=N,V(I)):Kt(I)?(e.consume(I),N):G(I)}function j(I){return I===45||I===46||I===58||I===95||Li(I)?(e.consume(I),j):F(I)}function F(I){return I===61?(e.consume(I),$):tt(I)?(s=F,V(I)):Kt(I)?(e.consume(I),F):N(I)}function $(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),i=I,Q):tt(I)?(s=$,V(I)):Kt(I)?(e.consume(I),$):(e.consume(I),H)}function Q(I){return I===i?(e.consume(I),i=void 0,L):I===null?n(I):tt(I)?(s=Q,V(I)):(e.consume(I),Q)}function H(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||yi(I)?N(I):(e.consume(I),H)}function L(I){return I===47||I===62||yi(I)?N(I):n(I)}function G(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function V(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),B}function B(I){return Kt(I)?mn(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):X(I)}function X(I){return e.enter("htmlTextData"),s(I)}}const YR={name:"labelEnd",resolveAll:k_e,resolveTo:A_e,tokenize:O_e},R_e={tokenize:M_e},P_e={tokenize:I_e},T_e={tokenize:D_e};function k_e(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&gs(e,0,e.length,n),e}function A_e(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=oo(a,e.slice(o+1,o+r+3)),a=oo(a,[["enter",u,t]]),a=oo(a,qR(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=oo(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=oo(a,e.slice(s+1)),a=oo(a,[["exit",l,t]]),gs(e,o,e.length,a),e}function O_e(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?d(p):(s=r.parser.defined.includes(zu(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(R_e,u,s?u:d)(p):p===91?e.attempt(P_e,u,s?c:d)(p):s?u(p):d(p)}function c(p){return e.attempt(T_e,u,d)(p)}function u(p){return t(p)}function d(p){return o._balanced=!0,n(p)}}function M_e(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return yi(d)?wh(e,o)(d):o(d)}function o(d){return d===41?u(d):K9(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return yi(d)?wh(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Q9(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return yi(d)?wh(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function I_e(e,t,n){const r=this;return i;function i(a){return X9.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(zu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function D_e(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const N_e={name:"labelStartImage",resolveAll:YR.resolveAll,tokenize:L_e};function L_e(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const F_e={name:"labelStartLink",resolveAll:YR.resolveAll,tokenize:j_e};function j_e(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const qw={name:"lineEnding",tokenize:$_e};function $_e(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),mn(e,t,"linePrefix")}}const lb={name:"thematicBreak",tokenize:z_e};function z_e(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||tt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Kt(c)?mn(e,a,"whitespace")(c):a(c))}}const ai={continuation:{tokenize:W_e},exit:G_e,name:"list",tokenize:V_e},B_e={partial:!0,tokenize:q_e},H_e={partial:!0,tokenize:U_e};function V_e(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:P_(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(lb,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return P_(h)&&++s<10?(e.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(N0,r.interrupt?n:u,e.attempt(B_e,p,d))}function u(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function d(h){return Kt(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function W_e(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(N0,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,mn(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Kt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(H_e,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,mn(e,e.attempt(ai,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function U_e(e,t,n){const r=this;return mn(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function G_e(e){e.exit(this.containerState.type)}function q_e(e,t,n){const r=this;return mn(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Kt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const eD={name:"setextUnderline",resolveTo:Y_e,tokenize:K_e};function Y_e(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function K_e(e,t,n){const r=this;let i;return o;function o(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"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Kt(c)?mn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||tt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const X_e={tokenize:Q_e};function Q_e(e){const t=this,n=e.attempt(N0,r,e.attempt(this.parser.constructs.flowInitial,i,mn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(n_e,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Z_e={resolveAll:J9()},J_e=Z9("string"),eCe=Z9("text");function Z9(e){return{resolveAll:J9(e==="text"?tCe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let p=-1;if(d)for(;++p<d.length;){const h=d[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function J9(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function tCe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const nCe={42:ai,43:ai,45:ai,48:ai,49:ai,50:ai,51:ai,52:ai,53:ai,54:ai,55:ai,56:ai,57:ai,62:U9},rCe={91:a_e},iCe={[-2]:Gw,[-1]:Gw,32:Gw},oCe={35:h_e,42:lb,45:[eD,lb],60:b_e,61:eD,95:lb,96:ZI,126:ZI},sCe={38:q9,92:G9},aCe={[-5]:qw,[-4]:qw,[-3]:qw,33:N_e,38:q9,42:T_,60:[FSe,C_e],91:F_e,92:[d_e,G9],93:YR,95:T_,96:XSe},lCe={null:[T_,Z_e]},cCe={null:[42,95]},uCe={null:[]},dCe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cCe,contentInitial:rCe,disable:uCe,document:nCe,flow:oCe,flowInitial:iCe,insideSpan:lCe,string:sCe,text:aCe},Symbol.toStringTag,{value:"Module"}));function fCe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:T(C),check:T(R),consume:w,enter:_,exit:E,interrupt:T(R,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(F){return s=oo(s,F),y(),s[s.length-1]!==null?[]:(M(t,0),c.events=qR(o,c.events,c),c.events)}function p(F,$){return pCe(h(F),$)}function h(F){return hCe(s,F)}function m(){const{_bufferIndex:F,_index:$,line:Q,column:H,offset:L}=r;return{_bufferIndex:F,_index:$,line:Q,column:H,offset:L}}function b(F){i[F.line]=F.column,j()}function y(){let F;for(;r._index<s.length;){const $=s[r._index];if(typeof $=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<$.length;)x($.charCodeAt(r._bufferIndex));else x($)}}function x(F){u=u(F)}function w(F){tt(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,j()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=F}function _(F,$){const Q=$||{};return Q.type=F,Q.start=m(),c.events.push(["enter",Q,c]),a.push(Q),Q}function E(F){const $=a.pop();return $.end=m(),c.events.push(["exit",$,c]),$}function C(F,$){M(F,$.from)}function R(F,$){$.restore()}function T(F,$){return Q;function Q(H,L,G){let V,B,X,I;return Array.isArray(H)?U(H):"tokenize"in H?U([H]):q(H);function q(oe){return Y;function Y(J){const se=J!==null&&oe[J],ae=J!==null&&oe.null,ge=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return U(ge)(J)}}function U(oe){return V=oe,B=0,oe.length===0?G:O(oe[B])}function O(oe){return Y;function Y(J){return I=N(),X=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?K():oe.tokenize.call($?Object.assign(Object.create(c),$):c,l,ee,K)(J)}}function ee(oe){return F(X,I),L}function K(oe){return I.restore(),++B<V.length?O(V[B]):G}}}function M(F,$){F.resolveAll&&!o.includes(F)&&o.push(F),F.resolve&&gs(c.events,$,c.events.length-$,F.resolve(c.events.slice($),c)),F.resolveTo&&(c.events=F.resolveTo(c.events,c))}function N(){const F=m(),$=c.previous,Q=c.currentConstruct,H=c.events.length,L=Array.from(a);return{from:H,restore:G};function G(){r=F,c.previous=$,c.currentConstruct=Q,c.events.length=H,a=L,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function hCe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function pCe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
396
- `;break}case-3:{s=`\r
397
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function gCe(e){const r={constructs:SSe([dCe,...(e||{}).extensions||[]]),content:i(ASe),defined:[],document:i(MSe),flow:i(X_e),lazy:{},string:i(J_e),text:i(eCe)};return r;function i(o){return s;function s(a){return fCe(r,o,a)}}}function mCe(e){for(;!Y9(e););return e}const tD=/[\0\t\n\r]/g;function bCe(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let c,u,d,p,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(tD.lastIndex=d,c=tD.exec(o),p=c&&c.index!==void 0?c.index:o.length,h=o.charCodeAt(p),!c){t=o.slice(d);break}if(h===10&&d===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<p&&(l.push(o.slice(d,p)),e+=p-d),h){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const yCe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function vCe(e){return e.replace(yCe,xCe)}function xCe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return W9(n.slice(o?2:1),o?16:10)}return GR(n)||e}const e7={}.hasOwnProperty;function wCe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),SCe(n)(mCe(gCe(n).document().write(bCe()(e,t,!0))))}function SCe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Be),autolinkProtocol:N,autolinkEmail:N,atxHeading:o(_e),blockQuote:o(ae),characterEscape:N,characterReference:N,codeFenced:o(ge),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ge,s),codeText:o(ne,s),codeTextData:N,data:N,codeFlowValue:N,definition:o(fe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(he),hardBreakEscape:o(Ae),hardBreakTrailing:o(Ae),htmlFlow:o(Le,s),htmlFlowData:N,htmlText:o(Le,s),htmlTextData:N,image:o(ke),label:s,link:o(Be),listItem:o(Ct),listItemValue:p,listOrdered:o(dt,d),listUnordered:o(dt),paragraph:o(an),reference:O,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(_e),strong:o(mt),thematicBreak:o(jt)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:se,autolinkProtocol:J,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:oe,characterReference:Y,codeFenced:l(y),codeFencedFence:b,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:j,codeIndented:l(x),codeText:l(L),codeTextData:j,data:j,definition:l(),definitionDestinationString:E,definitionLabelString:w,definitionTitleString:_,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(Q),htmlFlowData:j,htmlText:l(H),htmlTextData:j,image:l(V),label:X,labelText:B,lineEnding:F,link:l(G),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:I,resourceTitleString:q,resource:U,setextHeading:l(M),setextHeadingLineSequence:T,setextHeadingText:R,strong:l(),thematicBreak:l()}};t7(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(de){let Ce={type:"root",children:[]};const He={stack:[Ce],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},Ge=[];let at=-1;for(;++at<de.length;)if(de[at][1].type==="listOrdered"||de[at][1].type==="listUnordered")if(de[at][0]==="enter")Ge.push(at);else{const On=Ge.pop();at=i(de,On,at)}for(at=-1;++at<de.length;){const On=t[de[at][0]];e7.call(On,de[at][1].type)&&On[de[at][1].type].call(Object.assign({sliceSerialize:de[at][2].sliceSerialize},He),de[at][1])}if(He.tokenStack.length>0){const On=He.tokenStack[He.tokenStack.length-1];(On[1]||nD).call(He,void 0,On[0])}for(Ce.position={start:Sa(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:Sa(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)Ce=t.transforms[at](Ce)||Ce;return Ce}function i(de,Ce,He){let Ge=Ce-1,at=-1,On=!1,jn,Pn,ln,$n;for(;++Ge<=He;){const nn=de[Ge];switch(nn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{nn[0]==="enter"?at++:at--,$n=void 0;break}case"lineEndingBlank":{nn[0]==="enter"&&(jn&&!$n&&!at&&!ln&&(ln=Ge),$n=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$n=void 0}if(!at&&nn[0]==="enter"&&nn[1].type==="listItemPrefix"||at===-1&&nn[0]==="exit"&&(nn[1].type==="listUnordered"||nn[1].type==="listOrdered")){if(jn){let ir=Ge;for(Pn=void 0;ir--;){const Xn=de[ir];if(Xn[1].type==="lineEnding"||Xn[1].type==="lineEndingBlank"){if(Xn[0]==="exit")continue;Pn&&(de[Pn][1].type="lineEndingBlank",On=!0),Xn[1].type="lineEnding",Pn=ir}else if(!(Xn[1].type==="linePrefix"||Xn[1].type==="blockQuotePrefix"||Xn[1].type==="blockQuotePrefixWhitespace"||Xn[1].type==="blockQuoteMarker"||Xn[1].type==="listItemIndent"))break}ln&&(!Pn||ln<Pn)&&(jn._spread=!0),jn.end=Object.assign({},Pn?de[Pn][1].start:nn[1].end),de.splice(Pn||Ge,0,["exit",jn,nn[2]]),Ge++,He++}if(nn[1].type==="listItemPrefix"){const ir={type:"listItem",_spread:!1,start:Object.assign({},nn[1].start),end:void 0};jn=ir,de.splice(Ge,0,["enter",ir,nn[2]]),Ge++,He++,ln=void 0,$n=!0}}}return de[Ce][1]._spread=On,He}function o(de,Ce){return He;function He(Ge){a.call(this,de(Ge),Ge),Ce&&Ce.call(this,Ge)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(de,Ce,He){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([Ce,He||void 0]),de.position={start:Sa(Ce.start),end:void 0}}function l(de){return Ce;function Ce(He){de&&de.call(this,He),c.call(this,He)}}function c(de,Ce){const He=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==de.type&&(Ce?Ce.call(this,de,Ge[0]):(Ge[1]||nD).call(this,de,Ge[0]));else throw new Error("Cannot close `"+de.type+"` ("+xh({start:de.start,end:de.end})+"): it’s not open");He.position.end=Sa(de.end)}function u(){return xSe(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(de){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function h(){const de=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=de}function m(){const de=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=de}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const de=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const de=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=de.replace(/(\r?\n|\r)$/g,"")}function w(de){const Ce=this.resume(),He=this.stack[this.stack.length-1];He.label=Ce,He.identifier=zu(this.sliceSerialize(de)).toLowerCase()}function _(){const de=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=de}function E(){const de=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=de}function C(de){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const He=this.sliceSerialize(de).length;Ce.depth=He}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function T(de){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function N(de){const He=this.stack[this.stack.length-1].children;let Ge=He[He.length-1];(!Ge||Ge.type!=="text")&&(Ge=Wt(),Ge.position={start:Sa(de.start),end:void 0},He.push(Ge)),this.stack.push(Ge)}function j(de){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(de),Ce.position.end=Sa(de.end)}function F(de){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const He=Ce.children[Ce.children.length-1];He.position.end=Sa(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(N.call(this,de),j.call(this,de))}function $(){this.data.atHardBreak=!0}function Q(){const de=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=de}function H(){const de=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=de}function L(){const de=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=de}function G(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Ce,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function V(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Ce,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function B(de){const Ce=this.sliceSerialize(de),He=this.stack[this.stack.length-2];He.label=vCe(Ce),He.identifier=zu(Ce).toLowerCase()}function X(){const de=this.stack[this.stack.length-1],Ce=this.resume(),He=this.stack[this.stack.length-1];if(this.data.inReference=!0,He.type==="link"){const Ge=de.children;He.children=Ge}else He.alt=Ce}function I(){const de=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=de}function q(){const de=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=de}function U(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ee(de){const Ce=this.resume(),He=this.stack[this.stack.length-1];He.label=Ce,He.identifier=zu(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function K(de){this.data.characterReferenceType=de.type}function oe(de){const Ce=this.sliceSerialize(de),He=this.data.characterReferenceType;let Ge;He?(Ge=W9(Ce,He==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=GR(Ce);const at=this.stack[this.stack.length-1];at.value+=Ge}function Y(de){const Ce=this.stack.pop();Ce.position.end=Sa(de.end)}function J(de){j.call(this,de);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(de)}function se(de){j.call(this,de);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(de)}function ae(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function ne(){return{type:"inlineCode",value:""}}function fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function he(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function Ae(){return{type:"break"}}function Le(){return{type:"html",value:""}}function ke(){return{type:"image",title:null,url:"",alt:null}}function Be(){return{type:"link",title:null,url:"",children:[]}}function dt(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function Ct(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function an(){return{type:"paragraph",children:[]}}function mt(){return{type:"strong",children:[]}}function Wt(){return{type:"text",value:""}}function jt(){return{type:"thematicBreak"}}}function Sa(e){return{line:e.line,column:e.column,offset:e.offset}}function t7(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?t7(e,r):_Ce(e,r)}}function _Ce(e,t){let n;for(n in t)if(e7.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 nD(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+xh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+xh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+xh({start:t.start,end:t.end})+") is still open")}function CCe(e){const t=this;t.parser=n;function n(r){return wCe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ECe(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 RCe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
398
- `}]}function PCe(e,t){const n=t.value?t.value+`
399
- `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function TCe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kCe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ACe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Gd(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function OCe(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 MCe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function n7(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function ICe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return n7(e,t);const i={src:Gd(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function DCe(e,t){const n={src:Gd(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 NCe(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 LCe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return n7(e,t);const i={href:Gd(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function FCe(e,t){const n={href:Gd(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 jCe(e,t,n){const r=e.all(t),i=n?$Ce(n):r7(t),o={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
400
- `}),u.type==="element"&&u.tagName==="p"&&!i?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
401
- `});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function $Ce(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=r7(n[r])}return t}function r7(e){const t=e.spread;return t??e.children.length>1}function zCe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function BCe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HCe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function VCe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WCe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=HR(t.children[1]),l=F9(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function UCe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],p={},h=s?s[l]:void 0;h&&(p.align=h);let m={type:"element",tagName:o,properties:p,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function GCe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rD=9,iD=32;function qCe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(oD(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(oD(t.slice(i),i>0,!1)),o.join("")}function oD(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===rD||o===iD;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===rD||o===iD;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function YCe(e,t){const n={type:"text",value:qCe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function KCe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const XCe={blockquote:ECe,break:RCe,code:PCe,delete:TCe,emphasis:kCe,footnoteReference:ACe,heading:OCe,html:MCe,imageReference:ICe,image:DCe,inlineCode:NCe,linkReference:LCe,link:FCe,listItem:jCe,list:zCe,paragraph:BCe,root:HCe,strong:VCe,table:WCe,tableCell:GCe,tableRow:UCe,text:YCe,thematicBreak:KCe,toml:Fm,yaml:Fm,definition:Fm,footnoteDefinition:Fm};function Fm(){}const i7=-1,L0=0,ay=1,ly=2,KR=3,XR=4,QR=5,ZR=6,o7=7,s7=8,sD=typeof self=="object"?self:globalThis,QCe=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case L0:case i7:return n(s,i);case ay:{const a=n([],i);for(const l of s)a.push(r(l));return a}case ly:{const a=n({},i);for(const[l,c]of s)a[r(l)]=r(c);return a}case KR:return n(new Date(s),i);case XR:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case QR:{const a=n(new Map,i);for(const[l,c]of s)a.set(r(l),r(c));return a}case ZR:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case o7:{const{name:a,message:l}=s;return n(new sD[a](l),i)}case s7:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new sD[o](s),i)};return r},aD=e=>QCe(new Map,e)(0),mu="",{toString:ZCe}={},{keys:JCe}=Object,Df=e=>{const t=typeof e;if(t!=="object"||!e)return[L0,t];const n=ZCe.call(e).slice(8,-1);switch(n){case"Array":return[ay,mu];case"Object":return[ly,mu];case"Date":return[KR,mu];case"RegExp":return[XR,mu];case"Map":return[QR,mu];case"Set":return[ZR,mu]}return n.includes("Array")?[ay,n]:n.includes("Error")?[o7,n]:[ly,n]},jm=([e,t])=>e===L0&&(t==="function"||t==="symbol"),eEe=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Df(s);switch(a){case L0:{let u=s;switch(l){case"bigint":a=s7,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([i7],s)}return i([a,u],s)}case ay:{if(l)return i([l,[...s]],s);const u=[],d=i([a,u],s);for(const p of s)u.push(o(p));return d}case ly:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const u=[],d=i([a,u],s);for(const p of JCe(s))(e||!jm(Df(s[p])))&&u.push([o(p),o(s[p])]);return d}case KR:return i([a,s.toISOString()],s);case XR:{const{source:u,flags:d}=s;return i([a,{source:u,flags:d}],s)}case QR:{const u=[],d=i([a,u],s);for(const[p,h]of s)(e||!(jm(Df(p))||jm(Df(h))))&&u.push([o(p),o(h)]);return d}case ZR:{const u=[],d=i([a,u],s);for(const p of s)(e||!jm(Df(p)))&&u.push(o(p));return d}}const{message:c}=s;return i([a,{name:l,message:c}],s)};return o},lD=(e,{json:t,lossy:n}={})=>{const r=[];return eEe(!(t||n),!!t,new Map,r)(e),r},cy=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?aD(lD(e,t)):structuredClone(e):(e,t)=>aD(lD(e,t));function tEe(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 nEe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rEe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tEe,r=e.options.footnoteBackLabel||nEe,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),p=Gd(d.toLowerCase());let h=0;const m=[],b=e.footnoteCounts.get(d);for(;b!==void 0&&++h<=b;){m.length>0&&m.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,h);typeof w=="string"&&(w={type:"text",value:w}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const w=y.children[y.children.length-1];w&&w.type==="text"?w.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else u.push(...m);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...cy(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
402
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
403
- `}]}}const a7=function(e){if(e==null)return aEe;if(typeof e=="function")return F0(e);if(typeof e=="object")return Array.isArray(e)?iEe(e):oEe(e);if(typeof e=="string")return sEe(e);throw new Error("Expected function, string, or object as test")};function iEe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=a7(e[n]);return F0(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function oEe(e){const t=e;return F0(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function sEe(e){return F0(t);function t(n){return n&&n.type===e}}function F0(e){return t;function t(n,r,i){return!!(lEe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function aEe(){return!0}function lEe(e){return e!==null&&typeof e=="object"&&"type"in e}const l7=[],cEe=!0,cD=!1,uEe="skip";function dEe(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=a7(i),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const h=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=l7,m,b,y;if((!t||o(l,c,u[u.length-1]||void 0))&&(h=fEe(n(l,u)),h[0]===cD))return h;if("children"in l&&l.children){const x=l;if(x.children&&h[0]!==uEe)for(b=(r?x.children.length:-1)+s,y=u.concat(x);b>-1&&b<x.children.length;){const w=x.children[b];if(m=a(w,b,y)(),m[0]===cD)return m;b=typeof m[1]=="number"?m[1]:b+s}}return h}}}function fEe(e){return Array.isArray(e)?e:typeof e=="number"?[cEe,e]:e==null?l7:[e]}function c7(e,t,n,r){let i,o,s;typeof t=="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),dEe(e,o,a,i);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const k_={}.hasOwnProperty,hEe={};function pEe(e,t){const n=t||hEe,r=new Map,i=new Map,o=new Map,s={...XCe,...n.handlers},a={all:c,applyData:mEe,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:gEe,wrap:yEe};return c7(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,p=String(u.identifier).toUpperCase();d.has(p)||d.set(p,u)}}),a;function l(u,d){const p=u.type,h=a.handlers[p];if(k_.call(a.handlers,p)&&h)return h(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:b,...y}=u,x=cy(y);return x.children=a.all(u),x}return cy(u)}return(a.options.unknownHandler||bEe)(a,u,d)}function c(u){const d=[];if("children"in u){const p=u.children;let h=-1;for(;++h<p.length;){const m=a.one(p[h],u);if(m){if(h&&p[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=uD(m.value)),!Array.isArray(m)&&m.type==="element")){const b=m.children[0];b&&b.type==="text"&&(b.value=uD(b.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function gEe(e,t){e.position&&(t.position=X1e(e))}function mEe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,cy(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function bEe(e,t){const n=t.data||{},r="value"in t&&!(k_.call(n,"hProperties")||k_.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 yEe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
404
- `});++r<e.length;)r&&n.push({type:"text",value:`
405
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
406
- `}),n}function uD(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function dD(e,t){const n=pEe(e,t),r=n.one(e,void 0),i=rEe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
407
- `},i),o}function vEe(e,t){return e&&"run"in e?async function(n,r){const i=dD(n,{file:r,...t});await e.run(i,r)}:function(n,r){return dD(n,{file:r,...e||t})}}function fD(e){if(e)throw e}var cb=Object.prototype.hasOwnProperty,u7=Object.prototype.toString,hD=Object.defineProperty,pD=Object.getOwnPropertyDescriptor,gD=function(t){return typeof Array.isArray=="function"?Array.isArray(t):u7.call(t)==="[object Array]"},mD=function(t){if(!t||u7.call(t)!=="[object Object]")return!1;var n=cb.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&cb.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||cb.call(t,i)},bD=function(t,n){hD&&n.name==="__proto__"?hD(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},yD=function(t,n){if(n==="__proto__")if(cb.call(t,n)){if(pD)return pD(t,n).value}else return;return t[n]},xEe=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=yD(a,n),i=yD(t,n),a!==i&&(u&&i&&(mD(i)||(o=gD(i)))?(o?(o=!1,s=r&&gD(r)?r:[]):s=r&&mD(r)?r:{},bD(a,{name:n,newValue:e(u,s,i)})):typeof i<"u"&&bD(a,{name:n,newValue:i}));return a};const Yw=Ic(xEe);function A_(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 wEe(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const u=e[++o];let d=-1;if(l){s(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?SEe(u,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function SEe(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Wo={basename:_Ee,dirname:CEe,extname:EEe,join:REe,sep:"/"};function _Ee(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Wp(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function CEe(e){if(Wp(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 EEe(e){Wp(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function REe(...e){let t=-1,n;for(;++t<e.length;)Wp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":PEe(n)}function PEe(e){Wp(e);const t=e.codePointAt(0)===47;let n=TEe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function TEe(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===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("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Wp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const kEe={cwd:AEe};function AEe(){return"/"}function O_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function OEe(e){if(typeof e=="string")e=new URL(e);else if(!O_(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 MEe(e)}function MEe(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 i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Kw=["history","path","basename","stem","extname","dirname"];class d7{constructor(t){let n;t?O_(t)?n={path:t}:typeof t=="string"||IEe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":kEe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Kw.length;){const o=Kw[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Kw.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Wo.basename(this.path):void 0}set basename(t){Qw(t,"basename"),Xw(t,"basename"),this.path=Wo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wo.dirname(this.path):void 0}set dirname(t){vD(this.basename,"dirname"),this.path=Wo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wo.extname(this.path):void 0}set extname(t){if(Xw(t,"extname"),vD(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=Wo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){O_(t)&&(t=OEe(t)),Qw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wo.basename(this.path,this.extname):void 0}set stem(t){Qw(t,"stem"),Xw(t,"stem"),this.path=Wo.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Nr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Xw(e,t){if(e&&e.includes(Wo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wo.sep+"`")}function Qw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function vD(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function IEe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const DEe=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},NEe={}.hasOwnProperty;class JR extends DEe{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=wEe()}copy(){const t=new JR;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Yw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(e1("data",this.frozen),this.namespace[t]=n,this):NEe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(e1("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 i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=$m(t),r=this.parser||this.Parser;return Zw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Zw("process",this.parser||this.Parser),Jw("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=$m(t),l=r.parse(a);r.run(l,a,function(u,d,p){if(u||!d||!p)return c(u);const h=d,m=r.stringify(h,p);jEe(m)?p.value=m:p.result=m,c(u,p)});function c(u,d){u||!d?s(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Zw("processSync",this.parser||this.Parser),Jw("processSync",this.compiler||this.Compiler),this.process(t,i),wD("processSync","process",n),r;function i(o,s){n=!0,fD(o),r=s}}run(t,n,r){xD(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=$m(n);i.run(t,l,c);function c(u,d,p){const h=d||t;u?a(u):s?s(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),wD("runSync","run",r),i;function o(s,a){fD(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=$m(n),i=this.compiler||this.Compiler;return Jw("stringify",i),xD(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(e1("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=Yw(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===c){p=d;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[h,...m]=u;const b=r[p][1];A_(b)&&A_(h)&&(h=Yw(!0,b,h)),r[p]=[c,h,...m]}}}}const LEe=new JR().freeze();function Zw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Jw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function e1(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 xD(e){if(!A_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function wD(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function $m(e){return FEe(e)?e:new d7(e)}function FEe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jEe(e){return typeof e=="string"||$Ee(e)}function $Ee(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zEe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",SD=[],_D={allowDangerousHtml:!0},BEe=/^(https?|ircs?|mailto|xmpp)$/i,HEe=[{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 VEe(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||SD,l=e.remarkPlugins||SD,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,..._D}:_D,u=e.skipHtml,d=e.unwrapDisallowed,p=e.urlTransform||WEe,h=LEe().use(CCe).use(l).use(vEe,c).use(a),m=new d7;typeof r=="string"&&(m.value=r);for(const w of HEe)Object.hasOwn(e,w.from)&&(""+w.from+(w.to?"use `"+w.to+"` instead":"remove it")+zEe+w.id,void 0);const b=h.parse(m);let y=h.runSync(b,m);return i&&(y={type:"element",tagName:"div",properties:{className:i},children:y.type==="root"?y.children:[y]}),c7(y,x),nSe(y,{Fragment:v.Fragment,components:o,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function x(w,_,E){if(w.type==="raw"&&E&&typeof _=="number")return u?E.children.splice(_,1):E.children[_]={type:"text",value:w.value},_;if(w.type==="element"){let C;for(C in Uw)if(Object.hasOwn(Uw,C)&&Object.hasOwn(w.properties,C)){const R=w.properties[C],T=Uw[C];(T===null||T.includes(w.tagName))&&(w.properties[C]=p(String(R||""),C,w))}}if(w.type==="element"){let C=t?!t.includes(w.tagName):s?s.includes(w.tagName):!1;if(!C&&n&&typeof _=="number"&&(C=!n(w,_,E)),C&&E&&typeof _=="number")return d&&w.children?E.children.splice(_,1,...w.children):E.children.splice(_,1),_}}}function WEe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||BEe.test(e.slice(0,t))?e:""}var UEe=Object.create,j0=Object.defineProperty,GEe=Object.defineProperties,qEe=Object.getOwnPropertyDescriptor,YEe=Object.getOwnPropertyDescriptors,f7=Object.getOwnPropertyNames,uy=Object.getOwnPropertySymbols,KEe=Object.getPrototypeOf,e2=Object.prototype.hasOwnProperty,h7=Object.prototype.propertyIsEnumerable,CD=(e,t,n)=>t in e?j0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ls=(e,t)=>{for(var n in t||(t={}))e2.call(t,n)&&CD(e,n,t[n]);if(uy)for(var n of uy(t))h7.call(t,n)&&CD(e,n,t[n]);return e},$0=(e,t)=>GEe(e,YEe(t)),p7=(e,t)=>{var n={};for(var r in e)e2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uy)for(var r of uy(e))t.indexOf(r)<0&&h7.call(e,r)&&(n[r]=e[r]);return n},XEe=(e,t)=>function(){return t||(0,e[f7(e)[0]])((t={exports:{}}).exports,t),t.exports},QEe=(e,t)=>{for(var n in t)j0(e,n,{get:t[n],enumerable:!0})},ZEe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of f7(t))!e2.call(e,i)&&i!==n&&j0(e,i,{get:()=>t[i],enumerable:!(r=qEe(t,i))||r.enumerable});return e},JEe=(e,t,n)=>(n=e!=null?UEe(KEe(e)):{},ZEe(!e||!e.__esModule?j0(n,"default",{value:e,enumerable:!0}):n,e)),eRe=XEe({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,o={},s={util:{encode:function m(b){return b instanceof a?new a(b.type,m(b.content),b.alias):Array.isArray(b)?b.map(m):b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(m){return Object.prototype.toString.call(m).slice(8,-1)},objId:function(m){return m.__id||Object.defineProperty(m,"__id",{value:++i}),m.__id},clone:function m(b,y){y=y||{};var x,w;switch(s.util.type(b)){case"Object":if(w=s.util.objId(b),y[w])return y[w];x={},y[w]=x;for(var _ in b)b.hasOwnProperty(_)&&(x[_]=m(b[_],y));return x;case"Array":return w=s.util.objId(b),y[w]?y[w]:(x=[],y[w]=x,b.forEach(function(E,C){x[C]=m(E,y)}),x);default:return b}},getLanguage:function(m){for(;m;){var b=r.exec(m.className);if(b)return b[1].toLowerCase();m=m.parentElement}return"none"},setLanguage:function(m,b){m.className=m.className.replace(RegExp(r,"gi"),""),m.classList.add("language-"+b)},isActive:function(m,b,y){for(var x="no-"+b;m;){var w=m.classList;if(w.contains(b))return!0;if(w.contains(x))return!1;m=m.parentElement}return!!y}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(m,b){var y=s.util.clone(s.languages[m]);for(var x in b)y[x]=b[x];return y},insertBefore:function(m,b,y,x){x=x||s.languages;var w=x[m],_={};for(var E in w)if(w.hasOwnProperty(E)){if(E==b)for(var C in y)y.hasOwnProperty(C)&&(_[C]=y[C]);y.hasOwnProperty(E)||(_[E]=w[E])}var R=x[m];return x[m]=_,s.languages.DFS(s.languages,function(T,M){M===R&&T!=m&&(this[T]=_)}),_},DFS:function m(b,y,x,w){w=w||{};var _=s.util.objId;for(var E in b)if(b.hasOwnProperty(E)){y.call(b,E,b[E],x||E);var C=b[E],R=s.util.type(C);R==="Object"&&!w[_(C)]?(w[_(C)]=!0,m(C,y,null,w)):R==="Array"&&!w[_(C)]&&(w[_(C)]=!0,m(C,y,E,w))}}},plugins:{},highlight:function(m,b,y){var x={code:m,grammar:b,language:y};if(s.hooks.run("before-tokenize",x),!x.grammar)throw new Error('The language "'+x.language+'" has no grammar.');return x.tokens=s.tokenize(x.code,x.grammar),s.hooks.run("after-tokenize",x),a.stringify(s.util.encode(x.tokens),x.language)},tokenize:function(m,b){var y=b.rest;if(y){for(var x in y)b[x]=y[x];delete b.rest}var w=new u;return d(w,w.head,m),c(m,w,b,w.head,0),h(w)},hooks:{all:{},add:function(m,b){var y=s.hooks.all;y[m]=y[m]||[],y[m].push(b)},run:function(m,b){var y=s.hooks.all[m];if(!(!y||!y.length))for(var x=0,w;w=y[x++];)w(b)}},Token:a};function a(m,b,y,x){this.type=m,this.content=b,this.alias=y,this.length=(x||"").length|0}a.stringify=function m(b,y){if(typeof b=="string")return b;if(Array.isArray(b)){var x="";return b.forEach(function(R){x+=m(R,y)}),x}var w={type:b.type,content:m(b.content,y),tag:"span",classes:["token",b.type],attributes:{},language:y},_=b.alias;_&&(Array.isArray(_)?Array.prototype.push.apply(w.classes,_):w.classes.push(_)),s.hooks.run("wrap",w);var E="";for(var C in w.attributes)E+=" "+C+'="'+(w.attributes[C]||"").replace(/"/g,"&quot;")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+E+">"+w.content+"</"+w.tag+">"};function l(m,b,y,x){m.lastIndex=b;var w=m.exec(y);if(w&&x&&w[1]){var _=w[1].length;w.index+=_,w[0]=w[0].slice(_)}return w}function c(m,b,y,x,w,_){for(var E in y)if(!(!y.hasOwnProperty(E)||!y[E])){var C=y[E];C=Array.isArray(C)?C:[C];for(var R=0;R<C.length;++R){if(_&&_.cause==E+","+R)return;var T=C[R],M=T.inside,N=!!T.lookbehind,j=!!T.greedy,F=T.alias;if(j&&!T.pattern.global){var $=T.pattern.toString().match(/[imsuy]*$/)[0];T.pattern=RegExp(T.pattern.source,$+"g")}for(var Q=T.pattern||T,H=x.next,L=w;H!==b.tail&&!(_&&L>=_.reach);L+=H.value.length,H=H.next){var G=H.value;if(b.length>m.length)return;if(!(G instanceof a)){var V=1,B;if(j){if(B=l(Q,L,m,N),!B||B.index>=m.length)break;var U=B.index,X=B.index+B[0].length,I=L;for(I+=H.value.length;U>=I;)H=H.next,I+=H.value.length;if(I-=H.value.length,L=I,H.value instanceof a)continue;for(var q=H;q!==b.tail&&(I<X||typeof q.value=="string");q=q.next)V++,I+=q.value.length;V--,G=m.slice(L,I),B.index-=L}else if(B=l(Q,0,G,N),!B)continue;var U=B.index,O=B[0],ee=G.slice(0,U),K=G.slice(U+O.length),oe=L+G.length;_&&oe>_.reach&&(_.reach=oe);var Y=H.prev;ee&&(Y=d(b,Y,ee),L+=ee.length),p(b,Y,V);var J=new a(E,M?s.tokenize(O,M):O,F,O);if(H=d(b,Y,J),K&&d(b,H,K),V>1){var se={cause:E+","+R,reach:oe};c(m,b,y,H.prev,L,se),_&&se.reach>_.reach&&(_.reach=se.reach)}}}}}}function u(){var m={value:null,prev:null,next:null},b={value:null,prev:m,next:null};m.next=b,this.head=m,this.tail=b,this.length=0}function d(m,b,y){var x=b.next,w={value:y,prev:b,next:x};return b.next=w,x.prev=w,m.length++,w}function p(m,b,y){for(var x=b.next,w=0;w<y&&x!==m.tail;w++)x=x.next;b.next=x,x.prev=b,m.length-=w}function h(m){for(var b=[],y=m.head.next;y!==m.tail;)b.push(y.value),y=y.next;return b}return s}();t.exports=n,n.default=n}}),xe=JEe(eRe());xe.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},xe.languages.markup.tag.inside["attr-value"].inside.entity=xe.languages.markup.entity,xe.languages.markup.doctype.inside["internal-subset"].inside=xe.languages.markup,xe.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(xe.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:xe.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:xe.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},xe.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(xe.languages.markup.tag,"addAttribute",{value:function(e,t){xe.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:xe.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),xe.languages.html=xe.languages.markup,xe.languages.mathml=xe.languages.markup,xe.languages.svg=xe.languages.markup,xe.languages.xml=xe.languages.extend("markup",{}),xe.languages.ssml=xe.languages.xml,xe.languages.atom=xe.languages.xml,xe.languages.rss=xe.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(xe),xe.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},xe.languages.javascript=xe.languages.extend("clike",{"class-name":[xe.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),xe.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,xe.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:xe.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:xe.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:xe.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:xe.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:xe.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),xe.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:xe.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),xe.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),xe.languages.markup&&(xe.languages.markup.tag.addInlined("script","javascript"),xe.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),xe.languages.js=xe.languages.javascript,xe.languages.actionscript=xe.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),xe.languages.actionscript["class-name"].alias="function",delete xe.languages.actionscript.parameter,delete xe.languages.actionscript["literal-property"],xe.languages.markup&&xe.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:xe.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(xe),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(i){var o=function(d){d.inside||(d.inside={}),d.inside.rest=r},s="doc-comment";if(a=e.languages[i]){var a,l=a[s];if((l=l||(a=e.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[s])instanceof RegExp&&(l=a[s]={pattern:l}),Array.isArray(l))for(var c=0,u=l.length;c<u;c++)l[c]instanceof RegExp&&(l[c]={pattern:l[c]}),o(l[c]);else o(l)}})}}),t.addSupport(["java","javascript","php"],t)}(xe),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(xe),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(xe),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(a,l){l=(l||"").replace(/m/g,"")+"m";var c=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(c,l)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(o),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(xe),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(c){return c=c.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,s=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(c){["url","bold","italic","strike","code-snippet"].forEach(function(u){c!==u&&(e.languages.markdown[c].inside.content.inside[u]=e.languages.markdown[u])})}),e.hooks.add("after-tokenize",function(c){c.language!=="markdown"&&c.language!=="md"||function u(d){if(d&&typeof d!="string")for(var p=0,h=d.length;p<h;p++){var m,b=d[p];b.type!=="code"?u(b.content):(m=b.content[1],b=b.content[3],m&&b&&m.type==="code-language"&&b.type==="code-block"&&typeof m.content=="string"&&(m=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),m="language-"+(m=(/[a-z][\w-]*/i.exec(m)||[""])[0].toLowerCase()),b.alias?typeof b.alias=="string"?b.alias=[b.alias,m]:b.alias.push(m):b.alias=[m]))}}(c.tokens)}),e.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var u="",d=0,p=c.classes.length;d<p;d++){var h=c.classes[d],h=/language-(.+)/.exec(h);if(h){u=h[1];break}}var m,b=e.languages[u];b?c.content=e.highlight(function(y){return y=y.replace(s,""),y=y.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(x,w){var _;return(w=w.toLowerCase())[0]==="#"?(_=w[1]==="x"?parseInt(w.slice(2),16):Number(w.slice(1)),l(_)):a[w]||x})}(c.content),b,u):u&&u!=="none"&&e.plugins.autoloader&&(m="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),c.attributes.id=m,e.plugins.autoloader.loadLanguages(u,function(){var y=document.getElementById(m);y&&(y.innerHTML=e.highlight(y.textContent,e.languages[u],u))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(xe),xe.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:xe.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},xe.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(m){return typeof m!="string"&&m.type!=="comment"&&m.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(d(["definition-mutation","punctuation"])&&u(1).content==="("){n+=2;var o=p(/^\($/,/^\)$/);if(o===-1)continue;for(;n<o;n++){var s=u(0);s.type==="variable"&&(h(s,"variable-input"),i.push(s.content))}n=o+1}if(d(["punctuation","property-query"])&&u(0).content==="{"&&(n++,h(u(0),"property-mutation"),0<i.length)){var a=p(/^\{$/,/^\}$/);if(a!==-1)for(var l=n;l<a;l++){var c=t[l];c.type==="variable"&&0<=i.indexOf(c.content)&&h(c,"variable-input")}}}}function u(m){return t[n+m]}function d(m,b){b=b||0;for(var y=0;y<m.length;y++){var x=u(y+b);if(!x||x.type!==m[y])return}return 1}function p(m,b){for(var y=1,x=n;x<t.length;x++){var w=t[x],_=w.content;if(w.type==="punctuation"&&typeof _=="string"){if(m.test(_))y++;else if(b.test(_)&&--y===0)return x}}return-1}function h(m,b){var y=m.alias;y?Array.isArray(y)||(m.alias=y=[y]):m.alias=y=[],y.push(b)}}),xe.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,i=r.inside["interpolation-punctuation"],o=r.pattern.source;function s(d,p){if(e.languages[d])return{pattern:RegExp("((?:"+p+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:d}}}}function a(d,p,h){return d={code:d,grammar:p,language:h},e.hooks.run("before-tokenize",d),d.tokens=e.tokenize(d.code,d.grammar),e.hooks.run("after-tokenize",d),d.tokens}function l(d,p,h){var y=e.tokenize(d,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),m=0,b={},y=a(y.map(function(w){if(typeof w=="string")return w;for(var _,E,w=w.content;d.indexOf((E=m++,_="___"+h.toUpperCase()+"_"+E+"___"))!==-1;);return b[_]=w,_}).join(""),p,h),x=Object.keys(b);return m=0,function w(_){for(var E=0;E<_.length;E++){if(m>=x.length)return;var C,R,T,M,N,j,F,$=_[E];typeof $=="string"||typeof $.content=="string"?(C=x[m],(F=(j=typeof $=="string"?$:$.content).indexOf(C))!==-1&&(++m,R=j.substring(0,F),N=b[C],T=void 0,(M={})["interpolation-punctuation"]=i,(M=e.tokenize(N,M)).length===3&&((T=[1,1]).push.apply(T,a(M[1],e.languages.javascript,"javascript")),M.splice.apply(M,T)),T=new e.Token("interpolation",M,r.alias,N),M=j.substring(F+C.length),N=[],R&&N.push(R),N.push(T),M&&(w(j=[M]),N.push.apply(N,j)),typeof $=="string"?(_.splice.apply(_,[E,1].concat(N)),E+=N.length-1):$.content=N)):(F=$.content,Array.isArray(F)?w(F):w([F]))}}(y),new e.Token(h,y,"language-"+h,d)}e.languages.javascript["template-string"]=[s("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),s("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),s("svg",/\bsvg/.source),s("markdown",/\b(?:markdown|md)/.source),s("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),s("sql",/\bsql/.source),t].filter(Boolean);var c={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function u(d){return typeof d=="string"?d:Array.isArray(d)?d.map(u).join(""):u(d.content)}e.hooks.add("after-tokenize",function(d){d.language in c&&function p(h){for(var m=0,b=h.length;m<b;m++){var y,x,w,_=h[m];typeof _!="string"&&(y=_.content,Array.isArray(y)?_.type==="template-string"?(_=y[1],y.length===3&&typeof _!="string"&&_.type==="embedded-code"&&(x=u(_),_=_.alias,_=Array.isArray(_)?_[0]:_,w=e.languages[_])&&(y[1]=l(x,w,_))):p(y):typeof y!="string"&&p([y]))}}(d.tokens)})}(xe),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(xe),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(xe),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(xe),xe.languages.n4js=xe.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),xe.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),xe.languages.n4jsd=xe.languages.n4js,function(e){function t(s,a){return RegExp(s.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var o=n[r],i=e.languages.javascript[o],o=(i=e.util.type(i)==="RegExp"?e.languages.javascript[o]={pattern:i}:i).inside||{};(i.inside=o)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(xe),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(l,c){return l=l.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(l,c)}i=o(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function s(l){for(var c=[],u=0;u<l.length;u++){var d=l[u],p=!1;typeof d!="string"&&(d.type==="tag"&&d.content[0]&&d.content[0].type==="tag"?d.content[0].content[0].content==="</"?0<c.length&&c[c.length-1].tagName===a(d.content[0].content[1])&&c.pop():d.content[d.content.length-1].content!=="/>"&&c.push({tagName:a(d.content[0].content[1]),openedBraces:0}):0<c.length&&d.type==="punctuation"&&d.content==="{"?c[c.length-1].openedBraces++:0<c.length&&0<c[c.length-1].openedBraces&&d.type==="punctuation"&&d.content==="}"?c[c.length-1].openedBraces--:p=!0),(p||typeof d=="string")&&0<c.length&&c[c.length-1].openedBraces===0&&(p=a(d),u<l.length-1&&(typeof l[u+1]=="string"||l[u+1].type==="plain-text")&&(p+=a(l[u+1]),l.splice(u+1,1)),0<u&&(typeof l[u-1]=="string"||l[u-1].type==="plain-text")&&(p=a(l[u-1])+p,l.splice(u-1,1),u--),l[u]=new e.Token("plain-text",p,null,p)),d.content&&typeof d.content!="string"&&s(d.content)}}var a=function(l){return l?typeof l=="string"?l:typeof l.content=="string"?l.content:l.content.map(a).join(""):""};e.hooks.add("after-tokenize",function(l){l.language!=="jsx"&&l.language!=="tsx"||s(l.tokens)})}(xe),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(xe),xe.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},xe.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=xe.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(xe),xe.languages.c=xe.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),xe.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),xe.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},xe.languages.c.string],char:xe.languages.c.char,comment:xe.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:xe.languages.c}}}}),xe.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete xe.languages.c.boolean,xe.languages.objectivec=xe.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete xe.languages.objectivec["class-name"],xe.languages.objc=xe.languages.objectivec,xe.languages.reason=xe.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),xe.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete xe.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(xe),xe.languages.go=xe.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),xe.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete xe.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(xe),xe.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},xe.languages.python["string-interpolation"].inside.interpolation.inside.rest=xe.languages.python,xe.languages.py=xe.languages.python,xe.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},xe.languages.webmanifest=xe.languages.json;var M_={};QEe(M_,{dracula:()=>nRe,duotoneDark:()=>iRe,duotoneLight:()=>sRe,github:()=>lRe,gruvboxMaterialDark:()=>FRe,gruvboxMaterialLight:()=>$Re,jettwaveDark:()=>kRe,jettwaveLight:()=>ORe,nightOwl:()=>uRe,nightOwlLight:()=>fRe,oceanicNext:()=>pRe,okaidia:()=>mRe,oneDark:()=>IRe,oneLight:()=>NRe,palenight:()=>yRe,shadesOfPurple:()=>xRe,synthwave84:()=>SRe,ultramin:()=>CRe,vsDark:()=>g7,vsLight:()=>PRe});var tRe={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},nRe=tRe,rRe={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},iRe=rRe,oRe={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},sRe=oRe,aRe={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},lRe=aRe,cRe={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},uRe=cRe,dRe={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},fRe=dRe,Ti={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",punctuation:"#5FB3B3",tag:"#fc929e",function:"#79b6f2",className:"#FAC863",method:"#6699CC",operator:"#fc929e"},hRe={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:Ti.keyword}},{types:["attr-value"],style:{color:Ti.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:Ti.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:Ti.primitive}},{types:["boolean"],style:{color:Ti.boolean}},{types:["tag"],style:{color:Ti.tag}},{types:["string"],style:{color:Ti.string}},{types:["punctuation"],style:{color:Ti.string}},{types:["selector","char","builtin","inserted"],style:{color:Ti.char}},{types:["function"],style:{color:Ti.function}},{types:["operator","entity","url","variable"],style:{color:Ti.variable}},{types:["keyword"],style:{color:Ti.keyword}},{types:["atrule","class-name"],style:{color:Ti.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},pRe=hRe,gRe={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},mRe=gRe,bRe={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},yRe=bRe,vRe={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},xRe=vRe,wRe={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},SRe=wRe,_Re={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},CRe=_Re,ERe={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},g7=ERe,RRe={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},PRe=RRe,TRe={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},kRe=TRe,ARe={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},ORe=ARe,MRe={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},IRe=MRe,DRe={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},NRe=DRe,LRe={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},FRe=LRe,jRe={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},$Re=jRe,zRe=e=>k.useCallback(t=>{var n=t,{className:r,style:i,line:o}=n,s=p7(n,["className","style","line"]);const a=$0(ls({},s),{className:rd("token-line",r)});return typeof e=="object"&&"plain"in e&&(a.style=e.plain),typeof i=="object"&&(a.style=ls(ls({},a.style||{}),i)),a},[e]),BRe=e=>{const t=k.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(i=>e[i]))}},[e]);return k.useCallback(n=>{var r=n,{token:i,className:o,style:s}=r,a=p7(r,["token","className","style"]);const l=$0(ls({},a),{className:rd("token",...i.types,o),children:i.content,style:t(i)});return s!=null&&(l.style=ls(ls({},l.style||{}),s)),l},[t])},HRe=/\r\n|\r|\n/,ED=e=>{e.length===0?e.push({types:["plain"],content:`
408
- `,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
409
- `,e[0].empty=!0)},RD=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},VRe=e=>{const t=[[]],n=[e],r=[0],i=[e.length];let o=0,s=0,a=[];const l=[a];for(;s>-1;){for(;(o=r[s]++)<i[s];){let c,u=t[s];const p=n[s][o];if(typeof p=="string"?(u=s>0?u:["plain"],c=p):(u=RD(u,p.type),p.alias&&(u=RD(u,p.alias)),c=p.content),typeof c!="string"){s++,t.push(u),n.push(c),r.push(0),i.push(c.length);continue}const h=c.split(HRe),m=h.length;a.push({types:u,content:h[0]});for(let b=1;b<m;b++)ED(a),l.push(a=[]),a.push({types:u,content:h[b]})}s--,t.pop(),n.pop(),r.pop(),i.pop()}return ED(a),l},PD=VRe,WRe=({prism:e,code:t,grammar:n,language:r})=>k.useMemo(()=>{if(n==null)return PD([t]);const i={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",i),i.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",i),PD(i.tokens)},[t,n,r,e]),URe=(e,t)=>{const{plain:n}=e,r=e.styles.reduce((i,o)=>{const{languages:s,style:a}=o;return s&&!s.includes(t)||o.types.forEach(l=>{const c=ls(ls({},i[l]),a);i[l]=c}),i},{});return r.root=n,r.plain=$0(ls({},n),{backgroundColor:void 0}),r},GRe=URe,qRe=({children:e,language:t,code:n,theme:r,prism:i})=>{const o=t.toLowerCase(),s=GRe(r,o),a=zRe(s),l=BRe(s),c=i.languages[o],u=WRe({prism:i,language:o,code:n,grammar:c});return e({tokens:u,className:`prism-code language-${o}`,style:s!=null?s.root:{},getLineProps:a,getTokenProps:l})},YRe=e=>k.createElement(qRe,$0(ls({},e),{prism:e.prism||xe,theme:e.theme||g7,code:e.code,language:e.language}));/*! Bundled license information:
410
-
411
- prismjs/prism.js:
412
- (**
413
- * Prism: Lightweight, robust, elegant syntax highlighting
414
- *
415
- * @license MIT <https://opensource.org/licenses/MIT>
416
- * @author Lea Verou <https://lea.verou.me>
417
- * @namespace
418
- * @public
419
- *)
420
- */function KRe({message:e,onAddToDashboard:t}){var o;const n=(o=e==null?void 0:e.parts)==null?void 0:o.filter(s=>s.type==="tool-invocation"&&s.toolInvocation.toolName==="getData"&&s.toolInvocation.state==="result");if(!n)return null;const i=n.map(s=>s.toolInvocation).map(s=>{const a=s.result;if(a.status==="error")return null;const l=a.data.records;return{chartCfg:xE({cardType:s.args.chartType,data:l}),chartTitle:s.args.chartTitle,chartType:s.args.chartType,sql:s.args.sql,data:l,connectionId:s.args.connectionId}}).filter(s=>s!==null);return!i||i.length===0?null:v.jsx("div",{className:"",children:i.map((s,a)=>v.jsxs("div",{className:"group relative isolate flex h-[350px] w-[99%] grow flex-col",children:[v.jsxs(nr,{className:"invisible absolute right-0 top-0 z-10 h-8 p-2 group-hover:visible",onClick:()=>{t==null||t({sql:s.sql,data:s.data,cardCfg:s.chartCfg,cardTitle:s.chartTitle,connectionId:s.connectionId,cardType:s.chartType})},size:"sm",variant:"outline",children:[v.jsx(qy,{className:"mr-1 size-4"}),"Add"]}),v.jsx(YE,{cfg:s.chartCfg})]},a))})}function XRe({message:e,showTools:t}){var r;if(!t)return null;const n=(r=e==null?void 0:e.parts)==null?void 0:r.filter(i=>i.type==="tool-invocation");return v.jsx("div",{className:"space-y-3",children:n==null?void 0:n.map((i,o)=>{const s=i.toolInvocation;return v.jsxs(p1e,{children:[v.jsxs(g1e,{className:"rounded-md bg-green-200 p-1 px-2 font-mono text-xs text-black",children:[v.jsx("span",{className:"font-bold",children:"Tool:"})," ",s.toolName]}),v.jsx(m1e,{className:"mt-2 font-mono text-xs",children:v.jsxs("div",{className:"space-y-2 px-2",children:[v.jsxs("div",{className:"space-y-1",children:[v.jsx("span",{children:"Args:"}),v.jsx(dy,{language:"json",code:JSON.stringify(s.args,null,2)})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("span",{children:"Result:"}),v.jsx(dy,{language:"json",code:JSON.stringify(s.result,null,2)})]})]})})]},o)})})}function QRe({message:e}){return e.role!=="user"?null:v.jsxs("div",{className:"rounded-md bg-muted/50 p-3 text-sm",children:[v.jsx(wL,{className:"float-left mr-2 size-4"}),v.jsx("div",{children:e.content})]})}function ZRe({message:e}){if(e.role!=="system")return null;const t=e.content.split("|"),n=t[0],r=t[1]||"{}",i=JSON.parse(r);return v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{children:[v.jsx("span",{className:"font-bold",children:"System Message:"})," ",n]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("span",{className:"font-mono text-xs",children:"Scope:"}),v.jsx(dy,{language:"json",code:JSON.stringify(i,null,2)})]})]})}function JRe({message:e,handleRun:t}){if(e.role!=="assistant")return null;const n={p:({node:r,...i})=>v.jsx("p",{className:"text-sm",...i}),code:({node:r,...i})=>{var s,a;const o=(a=(s=r==null?void 0:r.children)==null?void 0:s[0])==null?void 0:a.value;return o&&/^#([0-9a-fA-F]{6})$/.test(o)?v.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs",style:{backgroundColor:o},...i}):v.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs",...i})},pre:r=>v.jsx(e2e,{...r,handleRun:t}),li:({node:r,...i})=>v.jsx("li",{className:"my-2 list-outside pl-4 text-sm",...i})};return v.jsx(VEe,{components:n,children:e.content.replace(/DuckDB/gi,"Semaphor")})}function m7({status:e,isLoading:t}){return t?v.jsx("div",{className:"flex items-center text-xs text-muted-foreground",children:e}):null}function b7({messages:e,showTools:t=!1,showSystemMessage:n=!1,handleRun:r,onAddToDashboard:i}){return e==null?void 0:e.map(o=>v.jsxs("div",{className:me("relative my-4 space-y-4 text-sm text-foreground/80"),children:[v.jsx(QRe,{message:o}),n&&v.jsx(ZRe,{message:o}),v.jsx(XRe,{message:o,showTools:t}),v.jsx(KRe,{onAddToDashboard:i,message:o}),v.jsx(JRe,{message:o,handleRun:r})]},o.id))}function e2e({children:e,handleRun:t}){const n=ye(a=>a.isVisualEditing),[r,i]=k.useState(!1);k.useRef(null);const o=()=>{navigator.clipboard.writeText(s).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},s=I_(e);return v.jsxs("pre",{className:"relative my-2 space-y-2 rounded-md bg-muted/50",children:[v.jsxs("div",{className:"float-right m-1.5",children:[v.jsx(nr,{className:"h-8 p-2 text-xs text-muted-foreground hover:text-foreground",onClick:o,size:"sm",variant:"ghost",children:r?v.jsx(Md,{className:"size-3"}):v.jsx(zC,{className:"size-3"})}),n&&v.jsx(nr,{className:"h-8 p-2 text-muted-foreground hover:text-foreground",onClick:()=>t==null?void 0:t(s),size:"sm",variant:"ghost",children:v.jsx(hL,{className:"size-3"})})]}),v.jsx(dy,{code:s})]})}function I_(e){return typeof e=="string"?e:Array.isArray(e)?e.map(I_).join(""):k.isValidElement(e)?I_(e.props.children):""}const dy=({code:e,language:t="sql"})=>{const n=ye(r=>r.theme);return v.jsx(YRe,{code:e,language:t,theme:n==="dark"?M_.vsDark:M_.oneLight,children:({className:r,style:i,tokens:o,getLineProps:s,getTokenProps:a})=>v.jsx("pre",{className:`${r} border-1 whitespace-pre-wrap rounded-md border border-muted p-2 text-xs`,style:{...i},children:o.map((l,c)=>v.jsx("div",{...s({line:l}),children:l.map((u,d)=>v.jsx("span",{...a({token:u})},d))},c))})})};function y7(e,t){return t||(e==="ready"?"":e==="error"?"Error":e==="streaming"?"":"Thinking...")}function t2e(e,t){return e.some(n=>n.tableName&&n.tableName===t.tableName||n.datamodelName&&n.datamodelName===t.datamodelName)}function n2e(e){return e.filter((n,r,i)=>r===i.findIndex(o=>o.tableName===n.tableName&&o.datamodelName===n.datamodelName))}function r2e(e,t){return e.filter(n=>!(n.connectionId===t.connectionId&&n.tableName===t.tableName&&n.datamodelName===t.datamodelName))}const v7=k.forwardRef(({input:e,handleInputChange:t,handleSubmit:n,isLoading:r,stop:i},o)=>v.jsxs("form",{onSubmit:n,className:"flex w-full items-center rounded-md border",children:[v.jsx(dc,{autoFocus:!0,ref:o,placeholder:"Type your question...",className:me("max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"),disabled:r,value:e,onChange:t}),v.jsxs("div",{className:"mr-2 flex items-center gap-2",children:[r===!0&&v.jsx(nr,{size:"sm",className:"h-7 rounded-full p-[9px]",onClick:()=>i(),children:v.jsx(uL,{className:"size-2.5 bg-background"})}),r===!1&&e&&v.jsx("button",{disabled:!e,className:"mr-3",children:v.jsx(mL,{className:"size-4 text-muted-foreground hover:text-foreground"})})]})]}));function i2e({handleChatBox:e}){const t=k.useRef(null),[n,r]=k.useState("");k.useState(!1);const i=ye(T=>T.dashboard.aiScopeTables);gp();const o=ye(T=>T.selectedSheetId),{addFrame:s,setSelectedFrameId:a,setIsDashboardEditing:l}=Vn(),{authToken:c}=Wi(),u=iC(),{messages:d,setMessages:p,reload:h,input:m,status:b,handleInputChange:y,handleSubmit:x,addToolResult:w,stop:_}=_9({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${c==null?void 0:c.accessToken}`},maxSteps:10,async onToolCall({toolCall:T}){if(T.toolName==="getTables")return r("Initializing..."),{tables:i||[]};if(T.toolName==="getSchemas"&&r("Analyzing..."),T.toolName==="getData"){r("Fetching...");const M=T.args;if(!(M!=null&&M.sql)||!(M!=null&&M.connectionId))return"Please provide sql, connectionId and table";try{return{status:"success",data:await u.fetchQuery({queryKey:["chat",M.connectionId,M.sql],queryFn:()=>Ry("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||(c==null?void 0:c.accessToken)||"",{connection_id:M.connectionId,sql:M.sql,cache_config:J_({})})})}}catch(N){return console.log("error",N.message),r("Error fetching data"),{status:"error",message:N.message}}}},onFinish(T,M){r(T.content),M.finishReason==="stop"&&r("")}}),E=()=>{var T;(T=t.current)==null||T.scrollIntoView({behavior:"smooth"})};k.useEffect(()=>{E()},[d]);function C({sql:T,data:M,cardCfg:N,cardTitle:j,connectionId:F,cardType:$}){if(!o)return;const Q={id:Ua(),title:j||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:$==="horizontalBar"?"y":"x"}},type:N.type,cfg:N,sql:T,data:M,connectionId:F},H={id:Ua(),cards:[Q],activeCardId:Q.id};l(!0),s(o,H,"start"),a(H.id)}const R=!["ready","error"].includes(b);return v.jsxs("div",{role:"chat-box",className:"flex h-full grow flex-col justify-between break-words rounded-md",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2 px-6 pb-3 pt-6",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx(Sn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),v.jsxs(Rp,{openDelay:0,children:[v.jsx(Pp,{children:v.jsx(SL,{className:"size-4 text-muted-foreground"})}),v.jsx(zd,{className:"w-70 p-2",children:v.jsx("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:v.jsxs("div",{children:[(i==null?void 0:i.length)===0&&v.jsx("p",{className:"text-sm",children:"No tables in scope"}),v.jsx("div",{className:"space-y-2",children:i==null?void 0:i.map((T,M)=>v.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[v.jsx(vL,{className:"size-3 text-muted-foreground/70"}),v.jsx("span",{children:xN({schemaName:T.schemaName||"",tableName:T.tableName||"",modelName:T.datamodelName||"",connectionType:T.connectionType||""})})]},M))})]})})})]})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(nr,{className:"h-7 p-2",size:"sm",variant:"ghost",onClick:()=>{p([]),h()},children:v.jsx(yL,{className:"size-4 text-muted-foreground"})}),v.jsx(nr,{className:"h-7 p-2",size:"sm",variant:"ghost",onClick:()=>e(!1),children:v.jsx(jc,{className:"size-4 text-muted-foreground"})})]})]}),v.jsxs(fc,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end px-6 py-3",children:[v.jsxs("div",{className:"pb-4",children:[v.jsx(b7,{messages:d,onAddToDashboard:C}),v.jsx(m7,{status:y7(b,n),isLoading:R}),v.jsx("div",{ref:t})]}),v.jsx(Ip,{orientation:"vertical"})]}),v.jsx("div",{className:"px-6 pb-6",children:v.jsx(v7,{stop:_,input:m,handleInputChange:y,handleSubmit:x,isLoading:R})})]})}const{createElement:Pd,createContext:o2e,createRef:QAe,forwardRef:x7,useCallback:li,useContext:w7,useEffect:pc,useImperativeHandle:S7,useLayoutEffect:s2e,useMemo:a2e,useRef:hi,useState:Bu}=P,TD=P[`useId${Math.random()}`.slice(0,5)],l2e=s2e,z0=o2e(null);z0.displayName="PanelGroupContext";const gc=l2e,c2e=typeof TD=="function"?TD:()=>null;let u2e=0;function t2(e=null){const t=c2e(),n=hi(e||t||null);return n.current===null&&(n.current=""+u2e++),e??n.current}function _7({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:p,style:h,tagName:m="div",...b}){const y=w7(z0);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:w,getPanelSize:_,getPanelStyle:E,groupId:C,isPanelCollapsed:R,reevaluatePanelConstraints:T,registerPanel:M,resizePanel:N,unregisterPanel:j}=y,F=t2(s),$=hi({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:F,idIsFromProps:s!==void 0,order:p});hi({didLogMissingDefaultSizeWarning:!1}),gc(()=>{const{callbacks:H,constraints:L}=$.current,G={...L};$.current.id=F,$.current.idIsFromProps=s!==void 0,$.current.order=p,H.onCollapse=c,H.onExpand=u,H.onResize=d,L.collapsedSize=n,L.collapsible=r,L.defaultSize=i,L.maxSize=a,L.minSize=l,(G.collapsedSize!==L.collapsedSize||G.collapsible!==L.collapsible||G.maxSize!==L.maxSize||G.minSize!==L.minSize)&&T($.current,G)}),gc(()=>{const H=$.current;return M(H),()=>{j(H)}},[p,F,M,j]),S7(o,()=>({collapse:()=>{x($.current)},expand:H=>{w($.current,H)},getId(){return F},getSize(){return _($.current)},isCollapsed(){return R($.current)},isExpanded(){return!R($.current)},resize:H=>{N($.current,H)}}),[x,w,_,R,F,N]);const Q=E($.current,i);return Pd(m,{...b,children:e,className:t,id:s,style:{...Q,...h},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":C,"data-panel-id":F,"data-panel-size":parseFloat(""+Q.flexGrow).toFixed(1)})}const C7=x7((e,t)=>Pd(_7,{...e,forwardedRef:t}));_7.displayName="Panel";C7.displayName="forwardRef(Panel)";let D_=null,ql=null;function d2e(e,t){if(t){const n=(t&k7)!==0,r=(t&A7)!==0,i=(t&O7)!==0,o=(t&M7)!==0;if(n)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function f2e(){ql!==null&&(document.head.removeChild(ql),D_=null,ql=null)}function t1(e,t){const n=d2e(e,t);D_!==n&&(D_=n,ql===null&&(ql=document.createElement("style"),document.head.appendChild(ql)),ql.innerHTML=`*{cursor: ${n}!important;}`)}function E7(e){return e.type==="keydown"}function R7(e){return e.type.startsWith("pointer")}function P7(e){return e.type.startsWith("mouse")}function B0(e){if(R7(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(P7(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function h2e(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function p2e(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function g2e(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:OD(e),b:OD(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;xt(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:AD(kD(n.a)),b:AD(kD(n.b))};if(i.a===i.b){const o=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let a=o.length;for(;a--;){const l=o[a];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(i.a-i.b)}const m2e=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function b2e(e){var t;const n=getComputedStyle((t=T7(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function y2e(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||b2e(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||m2e.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function kD(e){let t=e.length;for(;t--;){const n=e[t];if(xt(n,"Missing node"),y2e(n))return n}return null}function AD(e){return e&&Number(getComputedStyle(e).zIndex)||0}function OD(e){const t=[];for(;e;)t.push(e),e=T7(e);return t}function T7(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const k7=1,A7=2,O7=4,M7=8,v2e=h2e()==="coarse";let Mo=[],Hu=!1,Pa=new Map,H0=new Map;const Jh=new Set;function x2e(e,t,n,r,i){var o;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},l=(o=Pa.get(s))!==null&&o!==void 0?o:0;return Pa.set(s,l+1),Jh.add(a),fy(),function(){var u;H0.delete(e),Jh.delete(a);const d=(u=Pa.get(s))!==null&&u!==void 0?u:1;if(Pa.set(s,d-1),fy(),d===1&&Pa.delete(s),Mo.includes(a)){const p=Mo.indexOf(a);p>=0&&Mo.splice(p,1),r2(),i("up",!0,null)}}}function MD(e){const{target:t}=e,{x:n,y:r}=B0(e);Hu=!0,n2({target:t,x:n,y:r}),fy(),Mo.length>0&&(hy("down",e),e.preventDefault(),e.stopPropagation())}function Nf(e){const{x:t,y:n}=B0(e);if(Hu&&e.buttons===0&&(Hu=!1,hy("up",e)),!Hu){const{target:r}=e;n2({target:r,x:t,y:n})}hy("move",e),r2(),Mo.length>0&&e.preventDefault()}function bu(e){const{target:t}=e,{x:n,y:r}=B0(e);H0.clear(),Hu=!1,Mo.length>0&&e.preventDefault(),hy("up",e),n2({target:t,x:n,y:r}),r2(),fy()}function n2({target:e,x:t,y:n}){Mo.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),Jh.forEach(i=>{const{element:o,hitAreaMargins:s}=i,a=o.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=a,p=v2e?s.coarse:s.fine;if(t>=c-p&&t<=u+p&&n>=d-p&&n<=l+p){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&g2e(r,o)>0){let m=r,b=!1;for(;m&&!m.contains(o);){if(p2e(m.getBoundingClientRect(),a)){b=!0;break}m=m.parentElement}if(b)return}Mo.push(i)}})}function n1(e,t){H0.set(e,t)}function r2(){let e=!1,t=!1;Mo.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:t=!0});let n=0;H0.forEach(r=>{n|=r}),e&&t?t1("intersection",n):e?t1("horizontal",n):t?t1("vertical",n):f2e()}function fy(){Pa.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",bu),n.removeEventListener("pointerdown",MD),n.removeEventListener("pointerleave",Nf),n.removeEventListener("pointermove",Nf)}),window.removeEventListener("pointerup",bu),window.removeEventListener("pointercancel",bu),Jh.size>0&&(Hu?(Mo.length>0&&Pa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",bu),n.addEventListener("pointerleave",Nf),n.addEventListener("pointermove",Nf))}),window.addEventListener("pointerup",bu),window.addEventListener("pointercancel",bu)):Pa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",MD,{capture:!0}),n.addEventListener("pointermove",Nf))}))}function hy(e,t){Jh.forEach(n=>{const{setResizeHandlerState:r}=n,i=Mo.includes(n);r(e,i,t)})}function w2e(){const[e,t]=Bu(0);return li(()=>t(n=>n+1),[])}function xt(e,t){if(!e)throw console.error(t),Error(t)}const i2=10;function kc(e,t,n=i2){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Ys(e,t,n=i2){return kc(e,t,n)===0}function Ii(e,t,n){return kc(e,t,n)===0}function S2e(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const i=e[r],o=t[r];if(!Ii(i,o,n))return!1}return!0}function Pu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];xt(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(kc(n,a)<0)if(o){const l=(i+a)/2;kc(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(i2)),n}function Zf({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:o}){if(Ii(e,0))return t;const s=[...t],[a,l]=r;xt(a!=null,"Invalid first pivot index"),xt(l!=null,"Invalid second pivot index");let c=0;if(o==="keyboard"){{const d=e<0?l:a,p=n[d];xt(p,`Panel constraints not found for index ${d}`);const{collapsedSize:h=0,collapsible:m,minSize:b=0}=p;if(m){const y=t[d];if(xt(y!=null,`Previous layout not found for panel index ${d}`),Ii(y,h)){const x=b-y;kc(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?a:l,p=n[d];xt(p,`No panel constraints found for index ${d}`);const{collapsedSize:h=0,collapsible:m,minSize:b=0}=p;if(m){const y=t[d];if(xt(y!=null,`Previous layout not found for panel index ${d}`),Ii(y,b)){const x=y-h;kc(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const d=e<0?1:-1;let p=e<0?l:a,h=0;for(;;){const b=t[p];xt(b!=null,`Previous layout not found for panel index ${p}`);const x=Pu({panelConstraints:n,panelIndex:p,size:100})-b;if(h+=x,p+=d,p<0||p>=n.length)break}const m=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-m:m}{let p=e<0?a:l;for(;p>=0&&p<n.length;){const h=Math.abs(e)-Math.abs(c),m=t[p];xt(m!=null,`Previous layout not found for panel index ${p}`);const b=m-h,y=Pu({panelConstraints:n,panelIndex:p,size:b});if(!Ii(m,y)&&(c+=m-y,s[p]=y,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?p--:p++}}if(S2e(i,s))return i;{const d=e<0?l:a,p=t[d];xt(p!=null,`Previous layout not found for panel index ${d}`);const h=p+c,m=Pu({panelConstraints:n,panelIndex:d,size:h});if(s[d]=m,!Ii(m,h)){let b=h-m,x=e<0?l:a;for(;x>=0&&x<n.length;){const w=s[x];xt(w!=null,`Previous layout not found for panel index ${x}`);const _=w+b,E=Pu({panelConstraints:n,panelIndex:x,size:_});if(Ii(w,E)||(b-=E-w,s[x]=E),Ii(b,0))break;e>0?x--:x++}}}const u=s.reduce((d,p)=>p+d,0);return Ii(u,100)?s:i}function _2e({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];xt(a!=null,"No pivot index found"),t.forEach((d,p)=>{const{constraints:h}=d,{maxSize:m=100,minSize:b=0}=h;p===a?(r=b,i=m):(o+=b,s+=m)});const l=Math.min(i,100-o),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function ep(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function I7(e,t,n=document){const i=ep(e,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return i??null}function D7(e,t,n){const r=I7(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function N7(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function V0(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function C2e(e,t,n,r=document){var i,o,s,a;const l=V0(t,r),c=ep(e,r),u=l?c.indexOf(l):-1,d=(i=(o=n[u])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,p=(s=(a=n[u+1])===null||a===void 0?void 0:a.id)!==null&&s!==void 0?s:null;return[d,p]}function E2e({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:s}){hi({didWarnAboutMissingResizeHandle:!1}),gc(()=>{if(!o)return;const a=ep(n,o);for(let l=0;l<i.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=_2e({layout:r,panelsArray:i,pivotIndices:[l,l+1]}),p=a[l];if(p!=null){const h=i[l];xt(h,`No panel data found for index "${l}"`),p.setAttribute("aria-controls",h.id),p.setAttribute("aria-valuemax",""+Math.round(c)),p.setAttribute("aria-valuemin",""+Math.round(u)),p.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,i,o]),pc(()=>{if(!o)return;const a=t.current;xt(a,"Eager values not found");const{panelDataArray:l}=a,c=N7(n,o);xt(c!=null,`No group found for id "${n}"`);const u=ep(n,o);xt(u,`No resize handles found for group id "${n}"`);const d=u.map(p=>{const h=p.getAttribute("data-panel-resize-handle-id");xt(h,"Resize handle element has no handle id attribute");const[m,b]=C2e(n,h,l,o);if(m==null||b==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=l.findIndex(_=>_.id===m);if(w>=0){const _=l[w];xt(_,`No panel data found for index ${w}`);const E=r[w],{collapsedSize:C=0,collapsible:R,minSize:T=0}=_.constraints;if(E!=null&&R){const M=Zf({delta:Ii(E,C)?T-C:C-E,initialLayout:r,panelConstraints:l.map(N=>N.constraints),pivotIndices:D7(n,h,o),prevLayout:r,trigger:"keyboard"});r!==M&&s(M)}}break}}};return p.addEventListener("keydown",y),()=>{p.removeEventListener("keydown",y)}});return()=>{d.forEach(p=>p())}},[o,e,t,n,r,i,s])}function ID(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 L7(e,t){const n=e==="horizontal",{x:r,y:i}=B0(t);return n?r:i}function R2e(e,t,n,r,i){const o=n==="horizontal",s=V0(t,i);xt(s,`No resize handle element found for id "${t}"`);const a=s.getAttribute("data-panel-group-id");xt(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=L7(n,e),u=N7(a,i);xt(u,`No group element found for id "${a}"`);const d=u.getBoundingClientRect(),p=o?d.width:d.height;return(c-l)/p*100}function P2e(e,t,n,r,i,o){if(E7(e)){const s=n==="horizontal";let a=0;e.shiftKey?a=100:i!=null?a=i:a=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:a;break;case"ArrowLeft":l=s?-a:0;break;case"ArrowRight":l=s?a:0;break;case"ArrowUp":l=s?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:R2e(e,t,n,r,o)}function T2e({panelDataArray:e}){const t=Array(e.length),n=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const s=n[o];xt(s,`Panel constraints not found for index ${o}`);const{defaultSize:a}=s;a!=null&&(r++,t[o]=a,i-=a)}for(let o=0;o<e.length;o++){const s=n[o];xt(s,`Panel constraints not found for index ${o}`);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=i/l;r++,t[o]=c,i-=c}return t}function yu(e,t,n){t.forEach((r,i)=>{const o=e[i];xt(o,`Panel data not found for index ${i}`);const{callbacks:s,constraints:a,id:l}=o,{collapsedSize:c=0,collapsible:u}=a,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:p,onExpand:h,onResize:m}=s;m&&m(r,d),u&&(p||h)&&(h&&(d==null||Ys(d,c))&&!Ys(r,c)&&h(),p&&(d==null||!Ys(d,c))&&Ys(r,c)&&p())}})}function zm(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 k2e({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:o=3}){const s=n[i];let a;return s==null?a=e!=null?e.toPrecision(o):"1":r.length===1?a="1":a=s.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function A2e(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function DD(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 F7(e){return`react-resizable-panels:${e}`}function j7(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function $7(e,t){try{const n=F7(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function O2e(e,t,n){var r,i;const o=(r=$7(e,n))!==null&&r!==void 0?r:{},s=j7(t);return(i=o[s])!==null&&i!==void 0?i:null}function M2e(e,t,n,r,i){var o;const s=F7(e),a=j7(t),l=(o=$7(e,i))!==null&&o!==void 0?o:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function ND({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!Ii(r,100)&&n.length>0)for(let o=0;o<t.length;o++){const s=n[o];xt(s!=null,`No layout data found for index ${o}`);const a=100/r*s;n[o]=a}let i=0;for(let o=0;o<t.length;o++){const s=n[o];xt(s!=null,`No layout data found for index ${o}`);const a=Pu({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!Ii(i,0))for(let o=0;o<t.length;o++){const s=n[o];xt(s!=null,`No layout data found for index ${o}`);const a=s+i,l=Pu({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,Ii(i,0)))break}return n}const I2e=100,Jf={getItem:e=>(DD(Jf),Jf.getItem(e)),setItem:(e,t)=>{DD(Jf),Jf.setItem(e,t)}},LD={};function z7({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Jf,style:c,tagName:u="div",...d}){const p=t2(o),h=hi(null),[m,b]=Bu(null),[y,x]=Bu([]),w=w2e(),_=hi({}),E=hi(new Map),C=hi(0),R=hi({autoSaveId:e,direction:r,dragState:m,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),T=hi({layout:y,panelDataArray:[],panelDataArrayChanged:!1});hi({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),S7(i,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:O}=T.current;return O},setLayout:O=>{const{onLayout:ee}=R.current,{layout:K,panelDataArray:oe}=T.current,Y=ND({layout:O,panelConstraints:oe.map(J=>J.constraints)});ID(K,Y)||(x(Y),T.current.layout=Y,ee&&ee(Y),yu(oe,Y,_.current))}}),[]),gc(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=m,R.current.id=p,R.current.onLayout=s,R.current.storage=l}),E2e({committedValuesRef:R,eagerValuesRef:T,groupId:p,layout:y,panelDataArray:T.current.panelDataArray,setLayout:x,panelGroupElement:h.current}),pc(()=>{const{panelDataArray:O}=T.current;if(e){if(y.length===0||y.length!==O.length)return;let ee=LD[e];ee==null&&(ee=A2e(M2e,I2e),LD[e]=ee);const K=[...O],oe=new Map(E.current);ee(e,K,oe,y,l)}},[e,y,l]),pc(()=>{});const M=li(O=>{const{onLayout:ee}=R.current,{layout:K,panelDataArray:oe}=T.current;if(O.constraints.collapsible){const Y=oe.map(ge=>ge.constraints),{collapsedSize:J=0,panelSize:se,pivotIndices:ae}=Tl(oe,O,K);if(xt(se!=null,`Panel size not found for panel "${O.id}"`),!Ys(se,J)){E.current.set(O.id,se);const ne=xu(oe,O)===oe.length-1?se-J:J-se,fe=Zf({delta:ne,initialLayout:K,panelConstraints:Y,pivotIndices:ae,prevLayout:K,trigger:"imperative-api"});zm(K,fe)||(x(fe),T.current.layout=fe,ee&&ee(fe),yu(oe,fe,_.current))}}},[]),N=li((O,ee)=>{const{onLayout:K}=R.current,{layout:oe,panelDataArray:Y}=T.current;if(O.constraints.collapsible){const J=Y.map(he=>he.constraints),{collapsedSize:se=0,panelSize:ae=0,minSize:ge=0,pivotIndices:ne}=Tl(Y,O,oe),fe=ee??ge;if(Ys(ae,se)){const he=E.current.get(O.id),_e=he!=null&&he>=fe?he:fe,Le=xu(Y,O)===Y.length-1?ae-_e:_e-ae,ke=Zf({delta:Le,initialLayout:oe,panelConstraints:J,pivotIndices:ne,prevLayout:oe,trigger:"imperative-api"});zm(oe,ke)||(x(ke),T.current.layout=ke,K&&K(ke),yu(Y,ke,_.current))}}},[]),j=li(O=>{const{layout:ee,panelDataArray:K}=T.current,{panelSize:oe}=Tl(K,O,ee);return xt(oe!=null,`Panel size not found for panel "${O.id}"`),oe},[]),F=li((O,ee)=>{const{panelDataArray:K}=T.current,oe=xu(K,O);return k2e({defaultSize:ee,dragState:m,layout:y,panelData:K,panelIndex:oe})},[m,y]),$=li(O=>{const{layout:ee,panelDataArray:K}=T.current,{collapsedSize:oe=0,collapsible:Y,panelSize:J}=Tl(K,O,ee);return xt(J!=null,`Panel size not found for panel "${O.id}"`),Y===!0&&Ys(J,oe)},[]),Q=li(O=>{const{layout:ee,panelDataArray:K}=T.current,{collapsedSize:oe=0,collapsible:Y,panelSize:J}=Tl(K,O,ee);return xt(J!=null,`Panel size not found for panel "${O.id}"`),!Y||kc(J,oe)>0},[]),H=li(O=>{const{panelDataArray:ee}=T.current;ee.push(O),ee.sort((K,oe)=>{const Y=K.order,J=oe.order;return Y==null&&J==null?0:Y==null?-1:J==null?1:Y-J}),T.current.panelDataArrayChanged=!0,w()},[w]);gc(()=>{if(T.current.panelDataArrayChanged){T.current.panelDataArrayChanged=!1;const{autoSaveId:O,onLayout:ee,storage:K}=R.current,{layout:oe,panelDataArray:Y}=T.current;let J=null;if(O){const ae=O2e(O,Y,K);ae&&(E.current=new Map(Object.entries(ae.expandToSizes)),J=ae.layout)}J==null&&(J=T2e({panelDataArray:Y}));const se=ND({layout:J,panelConstraints:Y.map(ae=>ae.constraints)});ID(oe,se)||(x(se),T.current.layout=se,ee&&ee(se),yu(Y,se,_.current))}}),gc(()=>{const O=T.current;return()=>{O.layout=[]}},[]);const L=li(O=>{let ee=!1;const K=h.current;return K&&window.getComputedStyle(K,null).getPropertyValue("direction")==="rtl"&&(ee=!0),function(Y){Y.preventDefault();const J=h.current;if(!J)return()=>null;const{direction:se,dragState:ae,id:ge,keyboardResizeBy:ne,onLayout:fe}=R.current,{layout:he,panelDataArray:_e}=T.current,{initialLayout:Ae}=ae??{},Le=D7(ge,O,J);let ke=P2e(Y,O,se,ae,ne,J);const Be=se==="horizontal";Be&&ee&&(ke=-ke);const dt=_e.map(mt=>mt.constraints),Ct=Zf({delta:ke,initialLayout:Ae??he,panelConstraints:dt,pivotIndices:Le,prevLayout:he,trigger:E7(Y)?"keyboard":"mouse-or-touch"}),an=!zm(he,Ct);(R7(Y)||P7(Y))&&C.current!=ke&&(C.current=ke,!an&&ke!==0?Be?n1(O,ke<0?k7:A7):n1(O,ke<0?O7:M7):n1(O,0)),an&&(x(Ct),T.current.layout=Ct,fe&&fe(Ct),yu(_e,Ct,_.current))}},[]),G=li((O,ee)=>{const{onLayout:K}=R.current,{layout:oe,panelDataArray:Y}=T.current,J=Y.map(he=>he.constraints),{panelSize:se,pivotIndices:ae}=Tl(Y,O,oe);xt(se!=null,`Panel size not found for panel "${O.id}"`);const ne=xu(Y,O)===Y.length-1?se-ee:ee-se,fe=Zf({delta:ne,initialLayout:oe,panelConstraints:J,pivotIndices:ae,prevLayout:oe,trigger:"imperative-api"});zm(oe,fe)||(x(fe),T.current.layout=fe,K&&K(fe),yu(Y,fe,_.current))},[]),V=li((O,ee)=>{const{layout:K,panelDataArray:oe}=T.current,{collapsedSize:Y=0,collapsible:J}=ee,{collapsedSize:se=0,collapsible:ae,maxSize:ge=100,minSize:ne=0}=O.constraints,{panelSize:fe}=Tl(oe,O,K);fe!=null&&(J&&ae&&Ys(fe,Y)?Ys(Y,se)||G(O,se):fe<ne?G(O,ne):fe>ge&&G(O,ge))},[G]),B=li((O,ee)=>{const{direction:K}=R.current,{layout:oe}=T.current;if(!h.current)return;const Y=V0(O,h.current);xt(Y,`Drag handle element not found for id "${O}"`);const J=L7(K,ee);b({dragHandleId:O,dragHandleRect:Y.getBoundingClientRect(),initialCursorPosition:J,initialLayout:oe})},[]),X=li(()=>{b(null)},[]),I=li(O=>{const{panelDataArray:ee}=T.current,K=xu(ee,O);K>=0&&(ee.splice(K,1),delete _.current[O.id],T.current.panelDataArrayChanged=!0,w())},[w]),q=a2e(()=>({collapsePanel:M,direction:r,dragState:m,expandPanel:N,getPanelSize:j,getPanelStyle:F,groupId:p,isPanelCollapsed:$,isPanelExpanded:Q,reevaluatePanelConstraints:V,registerPanel:H,registerResizeHandle:L,resizePanel:G,startDragging:B,stopDragging:X,unregisterPanel:I,panelGroupElement:h.current}),[M,m,r,N,j,F,p,$,Q,V,H,L,G,B,X,I]),U={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Pd(z0.Provider,{value:q},Pd(u,{...d,children:t,className:n,id:o,ref:h,style:{...U,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const B7=x7((e,t)=>Pd(z7,{...e,forwardedRef:t}));z7.displayName="PanelGroup";B7.displayName="forwardRef(PanelGroup)";function xu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Tl(e,t,n){const r=xu(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:o}}function D2e({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){pc(()=>{if(e||n==null||r==null)return;const i=V0(t,r);if(i==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const a=i.getAttribute("data-panel-group-id");xt(a,`No group element found for id "${a}"`);const l=ep(a,r),c=I7(a,t,r);xt(c!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,e,t,n])}function o2({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:o,onDragging:s,onFocus:a,style:l={},tabIndex:c=0,tagName:u="div",...d}){var p,h;const m=hi(null),b=hi({onDragging:s});pc(()=>{b.current.onDragging=s});const y=w7(z0);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:x,groupId:w,registerResizeHandle:_,startDragging:E,stopDragging:C,panelGroupElement:R}=y,T=t2(i),[M,N]=Bu("inactive"),[j,F]=Bu(!1),[$,Q]=Bu(null),H=hi({state:M});gc(()=>{H.current.state=M}),pc(()=>{if(n)Q(null);else{const B=_(T);Q(()=>B)}},[n,T,_]);const L=(p=r==null?void 0:r.coarse)!==null&&p!==void 0?p:15,G=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return pc(()=>{if(n||$==null)return;const B=m.current;return xt(B,"Element ref not attached"),x2e(T,B,x,{coarse:L,fine:G},(I,q,U)=>{if(q)switch(I){case"down":{N("drag"),xt(U,'Expected event to be defined for "down" action'),E(T,U);const{onDragging:O}=b.current;O&&O(!0);break}case"move":{const{state:O}=H.current;O!=="drag"&&N("hover"),xt(U,'Expected event to be defined for "move" action'),$(U);break}case"up":{N("hover"),C();const{onDragging:O}=b.current;O&&O(!1);break}}else N("inactive")})},[L,x,n,G,_,T,$,E,C]),D2e({disabled:n,handleId:T,resizeHandler:$,panelGroupElement:R}),Pd(u,{...d,children:e,className:t,id:i,onBlur:()=>{F(!1),o==null||o()},onFocus:()=>{F(!0),a==null||a()},ref:m,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:c,"data-panel-group-direction":x,"data-panel-group-id":w,"data-resize-handle":"","data-resize-handle-active":M==="drag"?"pointer":j?"keyboard":void 0,"data-resize-handle-state":M,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":T})}o2.displayName="PanelResizeHandle";const H7=({className:e,...t})=>v.jsx(B7,{className:me("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),N_=C7,N2e=({withHandle:e,className:t,...n})=>v.jsx(o2,{className:me("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&v.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:v.jsx(oL,{className:"h-2.5 w-2.5"})})}),L2e=({withHandle:e,className:t,onTabClick:n,open:r,...i})=>v.jsx(o2,{className:me("relative flex w-px items-start justify-end bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",{"justify-start":r},t),...i,children:e&&!r&&v.jsx("div",{className:me("z-50 flex items-center justify-start",{"border-l":r}),children:v.jsx(nr,{variant:"secondary",className:me("h-7 p-0.5",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-0 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?v.jsx(Gy,{className:"size-4"}):v.jsx(jC,{className:"size-4"})})})});var s2="Dialog",[V7,W7]=rr(s2),[F2e,Fo]=V7(s2),U7=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=P.useRef(null),l=P.useRef(null),[c=!1,u]=Dr({prop:r,defaultProp:i,onChange:o});return v.jsx(F2e,{scope:t,triggerRef:a,contentRef:l,contentId:Yn(),titleId:Yn(),descriptionId:Yn(),open:c,onOpenChange:u,onOpenToggle:P.useCallback(()=>u(d=>!d),[u]),modal:s,children:n})};U7.displayName=s2;var G7="DialogTrigger",q7=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fo(G7,n),o=it(t,i.triggerRef);return v.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":c2(i.open),...r,ref:o,onClick:Pe(e.onClick,i.onOpenToggle)})});q7.displayName=G7;var a2="DialogPortal",[j2e,Y7]=V7(a2,{forceMount:void 0}),K7=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Fo(a2,t);return v.jsx(j2e,{scope:t,forceMount:n,children:P.Children.map(r,s=>v.jsx(Kn,{present:n||o.open,children:v.jsx(Ep,{asChild:!0,container:i,children:s})}))})};K7.displayName=a2;var py="DialogOverlay",X7=P.forwardRef((e,t)=>{const n=Y7(py,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Fo(py,e.__scopeDialog);return o.modal?v.jsx(Kn,{present:r||o.open,children:v.jsx($2e,{...i,ref:t})}):null});X7.displayName=py;var $2e=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fo(py,n);return v.jsx(kp,{as:ea,allowPinchZoom:!0,shards:[i.contentRef],children:v.jsx(Fe.div,{"data-state":c2(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ac="DialogContent",Q7=P.forwardRef((e,t)=>{const n=Y7(Ac,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Fo(Ac,e.__scopeDialog);return v.jsx(Kn,{present:r||o.open,children:o.modal?v.jsx(z2e,{...i,ref:t}):v.jsx(B2e,{...i,ref:t})})});Q7.displayName=Ac;var z2e=P.forwardRef((e,t)=>{const n=Fo(Ac,e.__scopeDialog),r=P.useRef(null),i=it(t,n.contentRef,r);return P.useEffect(()=>{const o=r.current;if(o)return m0(o)},[]),v.jsx(Z7,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault())})}),B2e=P.forwardRef((e,t)=>{const n=Fo(Ac,e.__scopeDialog),r=P.useRef(!1),i=P.useRef(!1);return v.jsx(Z7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Z7=P.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=Fo(Ac,n),l=P.useRef(null),c=it(t,l);return p0(),v.jsxs(v.Fragment,{children:[v.jsx(Tp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:v.jsx(zc,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":c2(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(V2e,{titleId:a.titleId}),v.jsx(U2e,{contentRef:l,descriptionId:a.descriptionId})]})]})}),l2="DialogTitle",J7=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fo(l2,n);return v.jsx(Fe.h2,{id:i.titleId,...r,ref:t})});J7.displayName=l2;var e$="DialogDescription",t$=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fo(e$,n);return v.jsx(Fe.p,{id:i.descriptionId,...r,ref:t})});t$.displayName=e$;var n$="DialogClose",r$=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fo(n$,n);return v.jsx(Fe.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,()=>i.onOpenChange(!1))})});r$.displayName=n$;function c2(e){return e?"open":"closed"}var i$="DialogTitleWarning",[H2e,o$]=eQ(i$,{contentName:Ac,titleName:l2,docsSlug:"dialog"}),V2e=({titleId:e})=>{const t=o$(i$),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
421
-
422
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
423
-
424
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return P.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},W2e="DialogDescriptionWarning",U2e=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${o$(W2e).contentName}}.`;return P.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},u2=U7,s$=q7,d2=K7,W0=X7,U0=Q7,f2=J7,h2=t$,p2=r$,a$="AlertDialog",[G2e,ZAe]=rr(a$,[W7]),oa=W7(),l$=e=>{const{__scopeAlertDialog:t,...n}=e,r=oa(t);return v.jsx(u2,{...r,...n,modal:!0})};l$.displayName=a$;var q2e="AlertDialogTrigger",Y2e=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=oa(n);return v.jsx(s$,{...i,...r,ref:t})});Y2e.displayName=q2e;var K2e="AlertDialogPortal",c$=e=>{const{__scopeAlertDialog:t,...n}=e,r=oa(t);return v.jsx(d2,{...r,...n})};c$.displayName=K2e;var X2e="AlertDialogOverlay",u$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=oa(n);return v.jsx(W0,{...i,...r,ref:t})});u$.displayName=X2e;var Vu="AlertDialogContent",[Q2e,Z2e]=G2e(Vu),d$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=oa(n),s=P.useRef(null),a=it(t,s),l=P.useRef(null);return v.jsx(H2e,{contentName:Vu,titleName:f$,docsSlug:"alert-dialog",children:v.jsx(Q2e,{scope:n,cancelRef:l,children:v.jsxs(U0,{role:"alertdialog",...o,...i,ref:a,onOpenAutoFocus:Pe(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[v.jsx(sC,{children:r}),v.jsx(ePe,{contentRef:s})]})})})});d$.displayName=Vu;var f$="AlertDialogTitle",h$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=oa(n);return v.jsx(f2,{...i,...r,ref:t})});h$.displayName=f$;var p$="AlertDialogDescription",g$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=oa(n);return v.jsx(h2,{...i,...r,ref:t})});g$.displayName=p$;var J2e="AlertDialogAction",m$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=oa(n);return v.jsx(p2,{...i,...r,ref:t})});m$.displayName=J2e;var b$="AlertDialogCancel",y$=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Z2e(b$,n),o=oa(n),s=it(t,i);return v.jsx(p2,{...o,...r,ref:s})});y$.displayName=b$;var ePe=({contentRef:e})=>{const t=`\`${Vu}\` requires a description for the component to be accessible for screen reader users.
425
-
426
- You can add a description to the \`${Vu}\` by passing a \`${p$}\` 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 \`${Vu}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
429
-
430
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return P.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},tPe=l$,nPe=c$,v$=u$,x$=d$,w$=m$,S$=y$,_$=h$,C$=g$;const rPe=tPe,iPe=nPe,E$=P.forwardRef(({className:e,...t},n)=>v.jsx(v$,{className:me("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));E$.displayName=v$.displayName;const R$=P.forwardRef(({className:e,...t},n)=>v.jsx(iPe,{children:v.jsxs(Dc,{children:[v.jsx(E$,{}),v.jsx(x$,{ref:n,className:me("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]})}));R$.displayName=x$.displayName;const P$=({className:e,...t})=>v.jsx("div",{className:me("flex flex-col space-y-2 text-center sm:text-left",e),...t});P$.displayName="AlertDialogHeader";const T$=({className:e,...t})=>v.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});T$.displayName="AlertDialogFooter";const k$=P.forwardRef(({className:e,...t},n)=>v.jsx(_$,{ref:n,className:me("text-lg font-semibold",e),...t}));k$.displayName=_$.displayName;const A$=P.forwardRef(({className:e,...t},n)=>v.jsx(C$,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));A$.displayName=C$.displayName;const O$=P.forwardRef(({className:e,...t},n)=>v.jsx(w$,{ref:n,className:me(Bh(),e),...t}));O$.displayName=w$.displayName;const M$=P.forwardRef(({className:e,...t},n)=>v.jsx(S$,{ref:n,className:me(Bh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));M$.displayName=S$.displayName;function oPe({open:e,setOpen:t}){const n=ye(o=>o.selectedSheetId),{deleteSheet:r}=Vn();function i(){n&&(r(n),t(!1))}return v.jsx(rPe,{open:e,onOpenChange:t,children:v.jsxs(R$,{children:[v.jsxs(P$,{children:[v.jsx(k$,{children:"Delete Sheet"}),v.jsx(A$,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),v.jsxs(T$,{children:[v.jsx(M$,{children:"Cancel"}),v.jsx(O$,{onClick:i,children:"Delete"})]})]})})}function I$(){var y,x;const[e,t]=k.useState(!1),n=ye(w=>{var _;return(_=w.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=Wi(),i=k.useRef(null),[o,s]=k.useState(!1),a=ye(w=>w.isDashboardEditing),l=ye(w=>w.themeStyle),c=ye(w=>w.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:d,addSheet:p}=Vn();if(!n)return null;function h(w){var _,E;w?((_=i.current)==null||_.resize(35),s(!0)):(s(!1),(E=i.current)==null||E.resize(0))}function m(){const w={id:Ua(),title:"New Sheet"};p(w)}function b(){return(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)?"hsl(var(--semaphor-muted))":(l==null?void 0:l.canvasTheme)==="clear"?"":l==null?void 0:l.canvasTheme}return v.jsxs(dC,{role:"dashboard-tabs-container",className:me("relative flex h-full flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:w=>{u(w)},value:c||n[0].id,children:[v.jsx("div",{children:(n.length>1||a)&&v.jsxs(My,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none border-b border-b-muted bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(w=>{var _,E;return v.jsx(os,{text:w.title,onSave:C=>d(w.id,C),children:v.jsxs(Iy,{style:{borderRadius:(E=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:E.borderRadius},onClick:()=>u(w.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:w.id,children:[w.title,a&&c===w.id&&n.length>1&&v.jsx(jc,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},w.id)}),a&&v.jsx("div",{style:{borderRadius:(x=(y=l==null?void 0:l.chart)==null?void 0:y.options)==null?void 0:x.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:m,children:v.jsx(qy,{className:"size-3"})})]})}),v.jsxs(H7,{className:"grow",direction:"horizontal",children:[v.jsx(N_,{children:v.jsx("div",{style:{},className:"h-full overflow-y-auto",children:n==null?void 0:n.map(w=>v.jsx(fC,{style:{backgroundColor:b()},className:me("mt-0",{}),value:w.id,children:v.jsx(Dxe,{sheet:w})},w.id))})}),r===!0&&v.jsxs(v.Fragment,{children:[v.jsx(L2e,{open:o,onTabClick:h,withHandle:!0}),v.jsx(N_,{onResize:w=>{w<1?s(!1):o||s(!0)},defaultSize:0,ref:i,children:v.jsx(i2e,{handleChatBox:h})})]})]}),v.jsx(oPe,{open:e,setOpen:t})]})}function D$({children:e}){return v.jsx(mX,{defaultTheme:"system",storageKey:"vite-ui-theme",children:v.jsx(Kue,{delayDuration:0,children:e})})}function N$(e){return v.jsx(Yy,{FallbackComponent:HC,children:v.jsx(FN,{dashboardProps:e,children:v.jsx(D$,{children:v.jsx(BN,{...e,children:v.jsx(I$,{})})})})})}var L_=["Enter"," "],sPe=["ArrowDown","PageUp","Home"],L$=["ArrowUp","PageDown","End"],aPe=[...sPe,...L$],lPe={ltr:[...L_,"ArrowRight"],rtl:[...L_,"ArrowLeft"]},cPe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Up="Menu",[tp,uPe,dPe]=Ay(Up),[Hc,F$]=rr(Up,[dPe,ws,Od]),G0=ws(),j$=Od(),[fPe,Vc]=Hc(Up),[hPe,Gp]=Hc(Up),$$=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=G0(t),[l,c]=P.useState(null),u=P.useRef(!1),d=tr(o),p=Nc(i);return P.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),v.jsx(Sp,{...a,children:v.jsx(fPe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:v.jsx(hPe,{scope:t,onClose:P.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:s,children:r})})})};$$.displayName=Up;var pPe="MenuAnchor",g2=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=G0(n);return v.jsx($d,{...i,...r,ref:t})});g2.displayName=pPe;var m2="MenuPortal",[gPe,z$]=Hc(m2,{forceMount:void 0}),B$=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Vc(m2,t);return v.jsx(gPe,{scope:t,forceMount:n,children:v.jsx(Kn,{present:n||o.open,children:v.jsx(Ep,{asChild:!0,container:i,children:r})})})};B$.displayName=m2;var uo="MenuContent",[mPe,b2]=Hc(uo),H$=P.forwardRef((e,t)=>{const n=z$(uo,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Vc(uo,e.__scopeMenu),s=Gp(uo,e.__scopeMenu);return v.jsx(tp.Provider,{scope:e.__scopeMenu,children:v.jsx(Kn,{present:r||o.open,children:v.jsx(tp.Slot,{scope:e.__scopeMenu,children:s.modal?v.jsx(bPe,{...i,ref:t}):v.jsx(yPe,{...i,ref:t})})})})}),bPe=P.forwardRef((e,t)=>{const n=Vc(uo,e.__scopeMenu),r=P.useRef(null),i=it(t,r);return P.useEffect(()=>{const o=r.current;if(o)return m0(o)},[]),v.jsx(y2,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),yPe=P.forwardRef((e,t)=>{const n=Vc(uo,e.__scopeMenu);return v.jsx(y2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),y2=P.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:m,...b}=e,y=Vc(uo,n),x=Gp(uo,n),w=G0(n),_=j$(n),E=uPe(n),[C,R]=P.useState(null),T=P.useRef(null),M=it(t,T,y.onContentChange),N=P.useRef(0),j=P.useRef(""),F=P.useRef(0),$=P.useRef(null),Q=P.useRef("right"),H=P.useRef(0),L=m?kp:P.Fragment,G=m?{as:ea,allowPinchZoom:!0}:void 0,V=X=>{var Y,J;const I=j.current+X,q=E().filter(se=>!se.disabled),U=document.activeElement,O=(Y=q.find(se=>se.ref.current===U))==null?void 0:Y.textValue,ee=q.map(se=>se.textValue),K=APe(ee,I,O),oe=(J=q.find(se=>se.textValue===K))==null?void 0:J.ref.current;(function se(ae){j.current=ae,window.clearTimeout(N.current),ae!==""&&(N.current=window.setTimeout(()=>se(""),1e3))})(I),oe&&setTimeout(()=>oe.focus())};P.useEffect(()=>()=>window.clearTimeout(N.current),[]),p0();const B=P.useCallback(X=>{var q,U;return Q.current===((q=$.current)==null?void 0:q.side)&&MPe(X,(U=$.current)==null?void 0:U.area)},[]);return v.jsx(mPe,{scope:n,searchRef:j,onItemEnter:P.useCallback(X=>{B(X)&&X.preventDefault()},[B]),onItemLeave:P.useCallback(X=>{var I;B(X)||((I=T.current)==null||I.focus(),R(null))},[B]),onTriggerLeave:P.useCallback(X=>{B(X)&&X.preventDefault()},[B]),pointerGraceTimerRef:F,onPointerGraceIntentChange:P.useCallback(X=>{$.current=X},[]),children:v.jsx(L,{...G,children:v.jsx(Tp,{asChild:!0,trapped:i,onMountAutoFocus:Pe(o,X=>{var I;X.preventDefault(),(I=T.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:v.jsx(zc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:v.jsx(aC,{asChild:!0,..._,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:R,onEntryFocus:Pe(l,X=>{x.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(_p,{role:"menu","aria-orientation":"vertical","data-state":iz(y.open),"data-radix-menu-content":"",dir:x.dir,...w,...b,ref:M,style:{outline:"none",...b.style},onKeyDown:Pe(b.onKeyDown,X=>{const q=X.target.closest("[data-radix-menu-content]")===X.currentTarget,U=X.ctrlKey||X.altKey||X.metaKey,O=X.key.length===1;q&&(X.key==="Tab"&&X.preventDefault(),!U&&O&&V(X.key));const ee=T.current;if(X.target!==ee||!aPe.includes(X.key))return;X.preventDefault();const oe=E().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);L$.includes(X.key)&&oe.reverse(),TPe(oe)}),onBlur:Pe(e.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(N.current),j.current="")}),onPointerMove:Pe(e.onPointerMove,np(X=>{const I=X.target,q=H.current!==X.clientX;if(X.currentTarget.contains(I)&&q){const U=X.clientX>H.current?"right":"left";Q.current=U,H.current=X.clientX}}))})})})})})})});H$.displayName=uo;var vPe="MenuGroup",v2=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(Fe.div,{role:"group",...r,ref:t})});v2.displayName=vPe;var xPe="MenuLabel",V$=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(Fe.div,{...r,ref:t})});V$.displayName=xPe;var gy="MenuItem",FD="menu.itemSelect",q0=P.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=P.useRef(null),s=Gp(gy,e.__scopeMenu),a=b2(gy,e.__scopeMenu),l=it(t,o),c=P.useRef(!1),u=()=>{const d=o.current;if(!n&&d){const p=new CustomEvent(FD,{bubbles:!0,cancelable:!0});d.addEventListener(FD,h=>r==null?void 0:r(h),{once:!0}),HN(d,p),p.defaultPrevented?c.current=!1:s.onClose()}};return v.jsx(W$,{...i,ref:l,disabled:n,onClick:Pe(e.onClick,u),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),c.current=!0},onPointerUp:Pe(e.onPointerUp,d=>{var p;c.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:Pe(e.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||L_.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});q0.displayName=gy;var W$=P.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=b2(gy,n),a=j$(n),l=P.useRef(null),c=it(t,l),[u,d]=P.useState(!1),[p,h]=P.useState("");return P.useEffect(()=>{const m=l.current;m&&h((m.textContent??"").trim())},[o.children]),v.jsx(tp.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:v.jsx(lC,{asChild:!0,...a,focusable:!r,children:v.jsx(Fe.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:c,onPointerMove:Pe(e.onPointerMove,np(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(e.onPointerLeave,np(m=>s.onItemLeave(m))),onFocus:Pe(e.onFocus,()=>d(!0)),onBlur:Pe(e.onBlur,()=>d(!1))})})})}),wPe="MenuCheckboxItem",U$=P.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return v.jsx(X$,{scope:e.__scopeMenu,checked:n,children:v.jsx(q0,{role:"menuitemcheckbox","aria-checked":my(n)?"mixed":n,...i,ref:t,"data-state":w2(n),onSelect:Pe(i.onSelect,()=>r==null?void 0:r(my(n)?!0:!n),{checkForDefaultPrevented:!1})})})});U$.displayName=wPe;var G$="MenuRadioGroup",[SPe,_Pe]=Hc(G$,{value:void 0,onValueChange:()=>{}}),q$=P.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=tr(r);return v.jsx(SPe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:v.jsx(v2,{...i,ref:t})})});q$.displayName=G$;var Y$="MenuRadioItem",K$=P.forwardRef((e,t)=>{const{value:n,...r}=e,i=_Pe(Y$,e.__scopeMenu),o=n===i.value;return v.jsx(X$,{scope:e.__scopeMenu,checked:o,children:v.jsx(q0,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":w2(o),onSelect:Pe(r.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})})});K$.displayName=Y$;var x2="MenuItemIndicator",[X$,CPe]=Hc(x2,{checked:!1}),Q$=P.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=CPe(x2,n);return v.jsx(Kn,{present:r||my(o.checked)||o.checked===!0,children:v.jsx(Fe.span,{...i,ref:t,"data-state":w2(o.checked)})})});Q$.displayName=x2;var EPe="MenuSeparator",Z$=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(Fe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Z$.displayName=EPe;var RPe="MenuArrow",J$=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=G0(n);return v.jsx(Cp,{...i,...r,ref:t})});J$.displayName=RPe;var PPe="MenuSub",[JAe,ez]=Hc(PPe),eh="MenuSubTrigger",tz=P.forwardRef((e,t)=>{const n=Vc(eh,e.__scopeMenu),r=Gp(eh,e.__scopeMenu),i=ez(eh,e.__scopeMenu),o=b2(eh,e.__scopeMenu),s=P.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},u=P.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return P.useEffect(()=>u,[u]),P.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),v.jsx(g2,{asChild:!0,...c,children:v.jsx(W$,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":iz(n.open),...e,ref:ky(t,i.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,np(d=>{o.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Pe(e.onPointerLeave,np(d=>{var h,m;u();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const b=(m=n.content)==null?void 0:m.dataset.side,y=b==="right",x=y?-5:5,w=p[y?"left":"right"],_=p[y?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:w,y:p.top},{x:_,y:p.top},{x:_,y:p.bottom},{x:w,y:p.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,d=>{var h;const p=o.searchRef.current!=="";e.disabled||p&&d.key===" "||lPe[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});tz.displayName=eh;var nz="MenuSubContent",rz=P.forwardRef((e,t)=>{const n=z$(uo,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Vc(uo,e.__scopeMenu),s=Gp(uo,e.__scopeMenu),a=ez(nz,e.__scopeMenu),l=P.useRef(null),c=it(t,l);return v.jsx(tp.Provider,{scope:e.__scopeMenu,children:v.jsx(Kn,{present:r||o.open,children:v.jsx(tp.Slot,{scope:e.__scopeMenu,children:v.jsx(y2,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Pe(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),p=cPe[s.dir].includes(u.key);d&&p&&(o.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});rz.displayName=nz;function iz(e){return e?"open":"closed"}function my(e){return e==="indeterminate"}function w2(e){return my(e)?"indeterminate":e?"checked":"unchecked"}function TPe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function kPe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function APe(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=kPe(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function OPe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(i=!i)}return i}function MPe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return OPe(n,t)}function np(e){return t=>t.pointerType==="mouse"?e(t):void 0}var IPe=$$,DPe=g2,NPe=B$,LPe=H$,FPe=v2,jPe=V$,$Pe=q0,zPe=U$,BPe=q$,HPe=K$,VPe=Q$,WPe=Z$,UPe=J$,GPe=tz,qPe=rz,S2="DropdownMenu",[YPe,eOe]=rr(S2,[F$]),Zr=F$(),[KPe,oz]=YPe(S2),sz=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=Zr(t),c=P.useRef(null),[u=!1,d]=Dr({prop:i,defaultProp:o,onChange:s});return v.jsx(KPe,{scope:t,triggerId:Yn(),triggerRef:c,contentId:Yn(),open:u,onOpenChange:d,onOpenToggle:P.useCallback(()=>d(p=>!p),[d]),modal:a,children:v.jsx(IPe,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};sz.displayName=S2;var az="DropdownMenuTrigger",lz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=oz(az,n),s=Zr(n);return v.jsx(DPe,{asChild:!0,...s,children:v.jsx(Fe.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:ky(t,o.triggerRef),onPointerDown:Pe(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Pe(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});lz.displayName=az;var XPe="DropdownMenuPortal",cz=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Zr(t);return v.jsx(NPe,{...r,...n})};cz.displayName=XPe;var uz="DropdownMenuContent",dz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oz(uz,n),o=Zr(n),s=P.useRef(!1);return v.jsx(LPe,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Pe(e.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Pe(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});dz.displayName=uz;var QPe="DropdownMenuGroup",ZPe=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return v.jsx(FPe,{...i,...r,ref:t})});ZPe.displayName=QPe;var JPe="DropdownMenuLabel",fz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return v.jsx(jPe,{...i,...r,ref:t})});fz.displayName=JPe;var eTe="DropdownMenuItem",hz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return v.jsx($Pe,{...i,...r,ref:t})});hz.displayName=eTe;var tTe="DropdownMenuCheckboxItem",pz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return v.jsx(zPe,{...i,...r,ref:t})});pz.displayName=tTe;var nTe="DropdownMenuRadioGroup",gz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return v.jsx(BPe,{...i,...r,ref:t})});gz.displayName=nTe;var rTe="DropdownMenuRadioItem",mz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return v.jsx(HPe,{...i,...r,ref:t})});mz.displayName=rTe;var iTe="DropdownMenuItemIndicator",bz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return v.jsx(VPe,{...i,...r,ref:t})});bz.displayName=iTe;var oTe="DropdownMenuSeparator",yz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return v.jsx(WPe,{...i,...r,ref:t})});yz.displayName=oTe;var sTe="DropdownMenuArrow",aTe=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return v.jsx(UPe,{...i,...r,ref:t})});aTe.displayName=sTe;var lTe="DropdownMenuSubTrigger",vz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return v.jsx(GPe,{...i,...r,ref:t})});vz.displayName=lTe;var cTe="DropdownMenuSubContent",xz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return v.jsx(qPe,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xz.displayName=cTe;var uTe=sz,dTe=lz,fTe=cz,wz=dz,Sz=fz,_z=hz,Cz=pz,hTe=gz,Ez=mz,Rz=bz,Pz=yz,Tz=vz,kz=xz;const pTe=uTe,gTe=dTe,mTe=hTe,bTe=P.forwardRef(({className:e,inset:t,children:n,...r},i)=>v.jsxs(Tz,{ref:i,className:me("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,v.jsx(Gy,{className:"ml-auto h-4 w-4"})]}));bTe.displayName=Tz.displayName;const yTe=P.forwardRef(({className:e,...t},n)=>v.jsx(Dc,{children:v.jsx(kz,{ref:n,className:me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));yTe.displayName=kz.displayName;const Az=P.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(fTe,{children:v.jsx(Dc,{children:v.jsx(wz,{ref:r,sideOffset:t,className:me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})}));Az.displayName=wz.displayName;const Oz=P.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(_z,{ref:r,className:me("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Oz.displayName=_z.displayName;const Mz=P.forwardRef(({className:e,children:t,checked:n,...r},i)=>v.jsxs(Cz,{ref:i,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(Rz,{children:v.jsx(Md,{className:"h-4 w-4"})})}),t]}));Mz.displayName=Cz.displayName;const Iz=P.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(Ez,{ref:r,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(Rz,{children:v.jsx($C,{className:"h-2 w-2 fill-current"})})}),t]}));Iz.displayName=Ez.displayName;const Dz=P.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(Sz,{ref:r,className:me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Dz.displayName=Sz.displayName;const Nz=P.forwardRef(({className:e,...t},n)=>v.jsx(Pz,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));Nz.displayName=Pz.displayName;const vTe=u2,xTe=s$,wTe=d2,Lz=P.forwardRef(({className:e,...t},n)=>v.jsx(W0,{ref:n,className:me("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Lz.displayName=W0.displayName;const Fz=P.forwardRef(({className:e,children:t,...n},r)=>v.jsx(wTe,{children:v.jsxs(Dc,{children:[v.jsx(Lz,{}),v.jsxs(U0,{ref:r,className:me("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,v.jsxs(p2,{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:[v.jsx(jc,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));Fz.displayName=U0.displayName;const jz=({className:e,...t})=>v.jsx("div",{className:me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});jz.displayName="DialogHeader";const $z=({className:e,...t})=>v.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});$z.displayName="DialogFooter";const zz=P.forwardRef(({className:e,...t},n)=>v.jsx(f2,{ref:n,className:me("text-lg font-semibold leading-none tracking-tight",e),...t}));zz.displayName=f2.displayName;const Bz=P.forwardRef(({className:e,...t},n)=>v.jsx(h2,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));Bz.displayName=h2.displayName;const Hz=k.forwardRef(({className:e,...t},n)=>v.jsx("div",{role:"editor-panel",ref:n,className:me("flex h-full grow",e),...t}));Hz.displayName="EditorPanel";const Vz=k.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:me("flex w-[300px] flex-col space-y-2",e),...t}));Vz.displayName="EditorAside";const Wz=k.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:me("grow",e),...t}));Wz.displayName="EditorMain";function STe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jD(Object(n),!0).forEach(function(r){STe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Te(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function CTe(e,t){if(e==null)return{};var n=_Te(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ETe(e,t){return RTe(e)||PTe(e,t)||TTe(e,t)||kTe()}function RTe(e){if(Array.isArray(e))return e}function PTe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function TTe(e,t){if(e){if(typeof e=="string")return zD(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 zD(e,t)}}function zD(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 kTe(){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 ATe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function HD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BD(Object(n),!0).forEach(function(r){ATe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OTe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(i,o){return o(i)},r)}}function th(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function by(e){return{}.toString.call(e).includes("Object")}function MTe(e){return!Object.keys(e).length}function rp(e){return typeof e=="function"}function ITe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function DTe(e,t){return by(t)||Wa("changeType"),Object.keys(t).some(function(n){return!ITe(e,n)})&&Wa("changeField"),t}function NTe(e){rp(e)||Wa("selectorType")}function LTe(e){rp(e)||by(e)||Wa("handlerType"),by(e)&&Object.values(e).some(function(t){return!rp(t)})&&Wa("handlersType")}function FTe(e){e||Wa("initialIsRequired"),by(e)||Wa("initialType"),MTe(e)&&Wa("initialContent")}function jTe(e,t){throw new Error(e[t]||e.default)}var $Te={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Wa=th(jTe)($Te),Bm={changes:DTe,selector:NTe,handler:LTe,initial:FTe};function zTe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Bm.initial(e),Bm.handler(t);var n={current:e},r=th(VTe)(n,t),i=th(HTe)(n),o=th(Bm.changes)(e),s=th(BTe)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return Bm.selector(c),c(n.current)}function l(c){OTe(r,i,o,s)(c)}return[a,l]}function BTe(e,t){return rp(t)?t(e.current):t}function HTe(e,t){return e.current=HD(HD({},e.current),t),t}function VTe(e,t,n){return rp(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var WTe={create:zTe},UTe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function GTe(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function qTe(e){return{}.toString.call(e).includes("Object")}function YTe(e){return e||VD("configIsRequired"),qTe(e)||VD("configType"),e.urls?(KTe(),{paths:{vs:e.urls.monacoBase}}):e}function KTe(){console.warn(Uz.deprecation)}function XTe(e,t){throw new Error(e[t]||e.default)}var Uz={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
- `},VD=GTe(XTe)(Uz),QTe={config:YTe},ZTe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function Gz(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],Gz(e[n],t[n]))}),$D($D({},e),t)}var JTe={type:"cancelation",msg:"operation is manually canceled"};function r1(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(JTe):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var eke=WTe.create({config:UTe,isInitialized:!1,resolve:null,reject:null,monaco:null}),qz=ETe(eke,2),qp=qz[0],Y0=qz[1];function tke(e){var t=QTe.config(e),n=t.monaco,r=CTe(t,["monaco"]);Y0(function(i){return{config:Gz(i.config,r),monaco:n}})}function nke(){var e=qp(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(Y0({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),r1(i1);if(window.monaco&&window.monaco.editor)return Yz(window.monaco),e.resolve(window.monaco),r1(i1);ZTe(rke,oke)(ske)}return r1(i1)}function rke(e){return document.body.appendChild(e)}function ike(e){var t=document.createElement("script");return e&&(t.src=e),t}function oke(e){var t=qp(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=ike("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function ske(){var e=qp(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){Yz(n),e.resolve(n)},function(n){e.reject(n)})}function Yz(e){qp().monaco||Y0({monaco:e})}function ake(){return qp(function(e){var t=e.monaco;return t})}var i1=new Promise(function(e,t){return Y0({resolve:e,reject:t})}),yy={config:tke,init:nke,__getMonacoInstance:ake},lke={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},o1=lke,cke={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},uke=cke;function dke({children:e}){return k.createElement("div",{style:uke.container},e)}var fke=dke,hke=fke;function pke({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return k.createElement("section",{style:{...o1.wrapper,width:e,height:t},...s},!n&&k.createElement(hke,null,r),k.createElement("div",{ref:i,style:{...o1.fullWidth,...!n&&o1.hide},className:o}))}var gke=pke,Kz=k.memo(gke);function mke(e){k.useEffect(e,[])}var _2=mke;function bke(e,t,n=!0){let r=k.useRef(!0);k.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Ni=bke;function Sh(){}function Tu(e,t,n,r){return yke(e,r)||vke(e,t,n,r)}function yke(e,t){return e.editor.getModel(Xz(e,t))}function vke(e,t,n,r){return e.editor.createModel(t,n,r?Xz(e,r):void 0)}function Xz(e,t){return e.Uri.parse(t)}function xke({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:p="100%",width:h="100%",className:m,wrapperProps:b={},beforeMount:y=Sh,onMount:x=Sh}){let[w,_]=k.useState(!1),[E,C]=k.useState(!0),R=k.useRef(null),T=k.useRef(null),M=k.useRef(null),N=k.useRef(x),j=k.useRef(y),F=k.useRef(!1);_2(()=>{let L=yy.init();return L.then(G=>(T.current=G)&&C(!1)).catch(G=>(G==null?void 0:G.type)!=="cancelation"&&console.error("Monaco initialization: error:",G)),()=>R.current?H():L.cancel()}),Ni(()=>{if(R.current&&T.current){let L=R.current.getOriginalEditor(),G=Tu(T.current,e||"",r||n||"text",o||"");G!==L.getModel()&&L.setModel(G)}},[o],w),Ni(()=>{if(R.current&&T.current){let L=R.current.getModifiedEditor(),G=Tu(T.current,t||"",i||n||"text",s||"");G!==L.getModel()&&L.setModel(G)}},[s],w),Ni(()=>{let L=R.current.getModifiedEditor();L.getOption(T.current.editor.EditorOption.readOnly)?L.setValue(t||""):t!==L.getValue()&&(L.executeEdits("",[{range:L.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),L.pushUndoStop())},[t],w),Ni(()=>{var L,G;(G=(L=R.current)==null?void 0:L.getModel())==null||G.original.setValue(e||"")},[e],w),Ni(()=>{let{original:L,modified:G}=R.current.getModel();T.current.editor.setModelLanguage(L,r||n||"text"),T.current.editor.setModelLanguage(G,i||n||"text")},[n,r,i],w),Ni(()=>{var L;(L=T.current)==null||L.editor.setTheme(c)},[c],w),Ni(()=>{var L;(L=R.current)==null||L.updateOptions(d)},[d],w);let $=k.useCallback(()=>{var V;if(!T.current)return;j.current(T.current);let L=Tu(T.current,e||"",r||n||"text",o||""),G=Tu(T.current,t||"",i||n||"text",s||"");(V=R.current)==null||V.setModel({original:L,modified:G})},[n,t,i,e,r,o,s]),Q=k.useCallback(()=>{var L;!F.current&&M.current&&(R.current=T.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...d}),$(),(L=T.current)==null||L.editor.setTheme(c),_(!0),F.current=!0)},[d,c,$]);k.useEffect(()=>{w&&N.current(R.current,T.current)},[w]),k.useEffect(()=>{!E&&!w&&Q()},[E,w,Q]);function H(){var G,V,B,X;let L=(G=R.current)==null?void 0:G.getModel();a||((V=L==null?void 0:L.original)==null||V.dispose()),l||((B=L==null?void 0:L.modified)==null||B.dispose()),(X=R.current)==null||X.dispose()}return k.createElement(Kz,{width:h,height:p,isEditorReady:w,loading:u,_ref:M,className:m,wrapperProps:b})}var wke=xke;k.memo(wke);function Ske(){let[e,t]=k.useState(yy.__getMonacoInstance());return _2(()=>{let n;return e||(n=yy.init(),n.then(r=>{t(r)})),()=>n==null?void 0:n.cancel()}),e}var _ke=Ske;function Cke(e){let t=k.useRef();return k.useEffect(()=>{t.current=e},[e]),t.current}var Eke=Cke,Hm=new Map;function Rke({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:p=!1,width:h="100%",height:m="100%",className:b,wrapperProps:y={},beforeMount:x=Sh,onMount:w=Sh,onChange:_,onValidate:E=Sh}){let[C,R]=k.useState(!1),[T,M]=k.useState(!0),N=k.useRef(null),j=k.useRef(null),F=k.useRef(null),$=k.useRef(w),Q=k.useRef(x),H=k.useRef(),L=k.useRef(r),G=Eke(o),V=k.useRef(!1),B=k.useRef(!1);_2(()=>{let q=yy.init();return q.then(U=>(N.current=U)&&M(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>j.current?I():q.cancel()}),Ni(()=>{var U,O,ee,K;let q=Tu(N.current,e||r||"",t||i||"",o||n||"");q!==((U=j.current)==null?void 0:U.getModel())&&(d&&Hm.set(G,(O=j.current)==null?void 0:O.saveViewState()),(ee=j.current)==null||ee.setModel(q),d&&((K=j.current)==null||K.restoreViewState(Hm.get(o))))},[o],C),Ni(()=>{var q;(q=j.current)==null||q.updateOptions(c)},[c],C),Ni(()=>{!j.current||r===void 0||(j.current.getOption(N.current.editor.EditorOption.readOnly)?j.current.setValue(r):r!==j.current.getValue()&&(B.current=!0,j.current.executeEdits("",[{range:j.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),j.current.pushUndoStop(),B.current=!1))},[r],C),Ni(()=>{var U,O;let q=(U=j.current)==null?void 0:U.getModel();q&&i&&((O=N.current)==null||O.editor.setModelLanguage(q,i))},[i],C),Ni(()=>{var q;a!==void 0&&((q=j.current)==null||q.revealLine(a))},[a],C),Ni(()=>{var q;(q=N.current)==null||q.editor.setTheme(s)},[s],C);let X=k.useCallback(()=>{var q;if(!(!F.current||!N.current)&&!V.current){Q.current(N.current);let U=o||n,O=Tu(N.current,r||e||"",t||i||"",U||"");j.current=(q=N.current)==null?void 0:q.editor.create(F.current,{model:O,automaticLayout:!0,...c},u),d&&j.current.restoreViewState(Hm.get(U)),N.current.editor.setTheme(s),a!==void 0&&j.current.revealLine(a),R(!0),V.current=!0}},[e,t,n,r,i,o,c,u,d,s,a]);k.useEffect(()=>{C&&$.current(j.current,N.current)},[C]),k.useEffect(()=>{!T&&!C&&X()},[T,C,X]),L.current=r,k.useEffect(()=>{var q,U;C&&_&&((q=H.current)==null||q.dispose(),H.current=(U=j.current)==null?void 0:U.onDidChangeModelContent(O=>{B.current||_(j.current.getValue(),O)}))},[C,_]),k.useEffect(()=>{if(C){let q=N.current.editor.onDidChangeMarkers(U=>{var ee;let O=(ee=j.current.getModel())==null?void 0:ee.uri;if(O&&U.find(K=>K.path===O.path)){let K=N.current.editor.getModelMarkers({resource:O});E==null||E(K)}});return()=>{q==null||q.dispose()}}return()=>{}},[C,E]);function I(){var q,U;(q=H.current)==null||q.dispose(),p?d&&Hm.set(o,j.current.saveViewState()):(U=j.current.getModel())==null||U.dispose(),j.current.dispose()}return k.createElement(Kz,{width:h,height:m,isEditorReady:C,loading:l,_ref:F,className:b,wrapperProps:y})}var Pke=Rke,Qz=k.memo(Pke),Tke=Qz,C2="Switch",[kke,tOe]=rr(C2),[Ake,Oke]=kke(C2),Zz=P.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=P.useState(null),m=it(t,_=>h(_)),b=P.useRef(!1),y=p?u||!!p.closest("form"):!0,[x=!1,w]=Dr({prop:i,defaultProp:o,onChange:c});return v.jsxs(Ake,{scope:n,checked:x,disabled:a,children:[v.jsx(Fe.button,{type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":tB(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onClick:Pe(e.onClick,_=>{w(E=>!E),y&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),y&&v.jsx(Mke,{control:p,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});Zz.displayName=C2;var Jz="SwitchThumb",eB=P.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Oke(Jz,n);return v.jsx(Fe.span,{"data-state":tB(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});eB.displayName=Jz;var Mke=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=P.useRef(null),s=g0(n),a=s0(t);return P.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const p=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(p)}},[s,n,r]),v.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function tB(e){return e?"checked":"unchecked"}var K0=Zz,nB=eB;const rB=P.forwardRef(({className:e,...t},n)=>v.jsx(K0,{className:me("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:v.jsx(nB,{className:me("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));rB.displayName=K0.displayName;const Ike=P.forwardRef(({className:e,...t},n)=>v.jsx(K0,{className:me("peer inline-flex h-4 w-8 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:v.jsx(nB,{className:me("pointer-events-none block h-3 w-3 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Ike.displayName=K0.displayName;var sa="Accordion",Dke=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[E2,Nke,Lke]=Ay(sa),[X0,nOe]=rr(sa,[Lke,C9]),R2=C9(),iB=k.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,o=r;return v.jsx(E2.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?v.jsx(zke,{...o,ref:t}):v.jsx($ke,{...i,ref:t})})});iB.displayName=sa;var[oB,Fke]=X0(sa),[sB,jke]=X0(sa,{collapsible:!1}),$ke=k.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...s}=e,[a,l]=Dr({prop:n,defaultProp:r,onChange:i});return v.jsx(oB,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:k.useCallback(()=>o&&l(""),[o,l]),children:v.jsx(sB,{scope:e.__scopeAccordion,collapsible:o,children:v.jsx(aB,{...s,ref:t})})})}),zke=k.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s=[],a]=Dr({prop:n,defaultProp:r,onChange:i}),l=k.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=k.useCallback(u=>a((d=[])=>d.filter(p=>p!==u)),[a]);return v.jsx(oB,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c,children:v.jsx(sB,{scope:e.__scopeAccordion,collapsible:!0,children:v.jsx(aB,{...o,ref:t})})})}),[Bke,Q0]=X0(sa),aB=k.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...s}=e,a=k.useRef(null),l=it(a,t),c=Nke(n),d=Nc(i)==="ltr",p=Pe(e.onKeyDown,h=>{var M;if(!Dke.includes(h.key))return;const m=h.target,b=c().filter(N=>{var j;return!((j=N.ref.current)!=null&&j.disabled)}),y=b.findIndex(N=>N.ref.current===m),x=b.length;if(y===-1)return;h.preventDefault();let w=y;const _=0,E=x-1,C=()=>{w=y+1,w>E&&(w=_)},R=()=>{w=y-1,w<_&&(w=E)};switch(h.key){case"Home":w=_;break;case"End":w=E;break;case"ArrowRight":o==="horizontal"&&(d?C():R());break;case"ArrowDown":o==="vertical"&&C();break;case"ArrowLeft":o==="horizontal"&&(d?R():C());break;case"ArrowUp":o==="vertical"&&R();break}const T=w%x;(M=b[T].ref.current)==null||M.focus()});return v.jsx(Bke,{scope:n,disabled:r,direction:i,orientation:o,children:v.jsx(E2.Slot,{scope:n,children:v.jsx(Fe.div,{...s,"data-orientation":o,ref:l,onKeyDown:r?void 0:p})})})}),vy="AccordionItem",[Hke,P2]=X0(vy),lB=k.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,o=Q0(vy,n),s=Fke(vy,n),a=R2(n),l=Yn(),c=r&&s.value.includes(r)||!1,u=o.disabled||e.disabled;return v.jsx(Hke,{scope:n,open:c,disabled:u,triggerId:l,children:v.jsx(P9,{"data-orientation":o.orientation,"data-state":pB(c),...a,...i,ref:t,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})})});lB.displayName=vy;var cB="AccordionHeader",uB=k.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=Q0(sa,n),o=P2(cB,n);return v.jsx(Fe.h3,{"data-orientation":i.orientation,"data-state":pB(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:t})});uB.displayName=cB;var F_="AccordionTrigger",dB=k.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=Q0(sa,n),o=P2(F_,n),s=jke(F_,n),a=R2(n);return v.jsx(E2.ItemSlot,{scope:n,children:v.jsx(f1e,{"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...a,...r,ref:t})})});dB.displayName=F_;var fB="AccordionContent",hB=k.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=Q0(sa,n),o=P2(fB,n),s=R2(n);return v.jsx(h1e,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...s,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});hB.displayName=fB;function pB(e){return e?"open":"closed"}var Vke=iB,Wke=lB,Uke=uB,gB=dB,mB=hB;const Gke=Vke,bB=P.forwardRef(({className:e,...t},n)=>v.jsx(Wke,{ref:n,className:me("border-b",e),...t}));bB.displayName="AccordionItem";const yB=P.forwardRef(({className:e,children:t,...n},r)=>v.jsx(Uke,{className:"flex",children:v.jsxs(gB,{ref:r,className:me("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,v.jsx(mp,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));yB.displayName=gB.displayName;const vB=P.forwardRef(({className:e,children:t,...n},r)=>v.jsx(mB,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:v.jsx("div",{className:me("pb-4 pt-0",e),children:t})}));vB.displayName=mB.displayName;var WD=1,qke=.9,Yke=.8,Kke=.17,s1=.1,a1=.999,Xke=.9999,Qke=.99,Zke=/[\\\/_+.#"@\[\(\{&]/,Jke=/[\\\/_+.#"@\[\(\{&]/g,eAe=/[\s-]/,xB=/[\s-]/g;function j_(e,t,n,r,i,o,s){if(o===t.length)return i===e.length?WD:Qke;var a=`${i},${o}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(o),c=n.indexOf(l,i),u=0,d,p,h,m;c>=0;)d=j_(e,t,n,r,c+1,o+1,s),d>u&&(c===i?d*=WD:Zke.test(e.charAt(c-1))?(d*=Yke,h=e.slice(i,c-1).match(Jke),h&&i>0&&(d*=Math.pow(a1,h.length))):eAe.test(e.charAt(c-1))?(d*=qke,m=e.slice(i,c-1).match(xB),m&&i>0&&(d*=Math.pow(a1,m.length))):(d*=Kke,i>0&&(d*=Math.pow(a1,c-i))),e.charAt(c)!==t.charAt(o)&&(d*=Xke)),(d<s1&&n.charAt(c-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(c-1)!==r.charAt(o))&&(p=j_(e,t,n,r,c+1,o+2,s),p*s1>d&&(d=p*s1)),d>u&&(u=d),c=n.indexOf(l,c+1);return s[a]=u,u}function UD(e){return e.toLowerCase().replace(xB," ")}function tAe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,j_(e,t,UD(e),UD(t),0,0,{})}var Lf='[cmdk-group=""]',l1='[cmdk-group-items=""]',nAe='[cmdk-group-heading=""]',T2='[cmdk-item=""]',GD=`${T2}:not([aria-disabled="true"])`,$_="cmdk-item-select",$l="data-value",rAe=(e,t,n)=>tAe(e,t,n),wB=P.createContext(void 0),Yp=()=>P.useContext(wB),SB=P.createContext(void 0),k2=()=>P.useContext(SB),_B=P.createContext(void 0),CB=P.forwardRef((e,t)=>{let n=wu(()=>{var U,O;return{search:"",value:(O=(U=e.value)!=null?U:e.defaultValue)!=null?O:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=wu(()=>new Set),i=wu(()=>new Map),o=wu(()=>new Map),s=wu(()=>new Set),a=EB(e),{label:l,children:c,value:u,onValueChange:d,filter:p,shouldFilter:h,loop:m,disablePointerSelection:b=!1,vimBindings:y=!0,...x}=e,w=Yn(),_=Yn(),E=Yn(),C=P.useRef(null),R=pAe();Oc(()=>{if(u!==void 0){let U=u.trim();n.current.value=U,T.emit()}},[u]),Oc(()=>{R(6,Q)},[]);let T=P.useMemo(()=>({subscribe:U=>(s.current.add(U),()=>s.current.delete(U)),snapshot:()=>n.current,setState:(U,O,ee)=>{var K,oe,Y;if(!Object.is(n.current[U],O)){if(n.current[U]=O,U==="search")$(),j(),R(1,F);else if(U==="value"&&(ee||R(5,Q),((K=a.current)==null?void 0:K.value)!==void 0)){let J=O??"";(Y=(oe=a.current).onValueChange)==null||Y.call(oe,J);return}T.emit()}},emit:()=>{s.current.forEach(U=>U())}}),[]),M=P.useMemo(()=>({value:(U,O,ee)=>{var K;O!==((K=o.current.get(U))==null?void 0:K.value)&&(o.current.set(U,{value:O,keywords:ee}),n.current.filtered.items.set(U,N(O,ee)),R(2,()=>{j(),T.emit()}))},item:(U,O)=>(r.current.add(U),O&&(i.current.has(O)?i.current.get(O).add(U):i.current.set(O,new Set([U]))),R(3,()=>{$(),j(),n.current.value||F(),T.emit()}),()=>{o.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let ee=H();R(4,()=>{$(),(ee==null?void 0:ee.getAttribute("id"))===U&&F(),T.emit()})}),group:U=>(i.current.has(U)||i.current.set(U,new Set),()=>{o.current.delete(U),i.current.delete(U)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:E,labelId:_,listInnerRef:C}),[]);function N(U,O){var ee,K;let oe=(K=(ee=a.current)==null?void 0:ee.filter)!=null?K:rAe;return U?oe(U,n.current.search,O):0}function j(){if(!n.current.search||a.current.shouldFilter===!1)return;let U=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(K=>{let oe=i.current.get(K),Y=0;oe.forEach(J=>{let se=U.get(J);Y=Math.max(se,Y)}),O.push([K,Y])});let ee=C.current;L().sort((K,oe)=>{var Y,J;let se=K.getAttribute("id"),ae=oe.getAttribute("id");return((Y=U.get(ae))!=null?Y:0)-((J=U.get(se))!=null?J:0)}).forEach(K=>{let oe=K.closest(l1);oe?oe.appendChild(K.parentElement===oe?K:K.closest(`${l1} > *`)):ee.appendChild(K.parentElement===ee?K:K.closest(`${l1} > *`))}),O.sort((K,oe)=>oe[1]-K[1]).forEach(K=>{var oe;let Y=(oe=C.current)==null?void 0:oe.querySelector(`${Lf}[${$l}="${encodeURIComponent(K[0])}"]`);Y==null||Y.parentElement.appendChild(Y)})}function F(){let U=L().find(ee=>ee.getAttribute("aria-disabled")!=="true"),O=U==null?void 0:U.getAttribute($l);T.setState("value",O||void 0)}function $(){var U,O,ee,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let Y of r.current){let J=(O=(U=o.current.get(Y))==null?void 0:U.value)!=null?O:"",se=(K=(ee=o.current.get(Y))==null?void 0:ee.keywords)!=null?K:[],ae=N(J,se);n.current.filtered.items.set(Y,ae),ae>0&&oe++}for(let[Y,J]of i.current)for(let se of J)if(n.current.filtered.items.get(se)>0){n.current.filtered.groups.add(Y);break}n.current.filtered.count=oe}function Q(){var U,O,ee;let K=H();K&&(((U=K.parentElement)==null?void 0:U.firstChild)===K&&((ee=(O=K.closest(Lf))==null?void 0:O.querySelector(nAe))==null||ee.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function H(){var U;return(U=C.current)==null?void 0:U.querySelector(`${T2}[aria-selected="true"]`)}function L(){var U;return Array.from(((U=C.current)==null?void 0:U.querySelectorAll(GD))||[])}function G(U){let O=L()[U];O&&T.setState("value",O.getAttribute($l))}function V(U){var O;let ee=H(),K=L(),oe=K.findIndex(J=>J===ee),Y=K[oe+U];(O=a.current)!=null&&O.loop&&(Y=oe+U<0?K[K.length-1]:oe+U===K.length?K[0]:K[oe+U]),Y&&T.setState("value",Y.getAttribute($l))}function B(U){let O=H(),ee=O==null?void 0:O.closest(Lf),K;for(;ee&&!K;)ee=U>0?fAe(ee,Lf):hAe(ee,Lf),K=ee==null?void 0:ee.querySelector(GD);K?T.setState("value",K.getAttribute($l)):V(U)}let X=()=>G(L().length-1),I=U=>{U.preventDefault(),U.metaKey?X():U.altKey?B(1):V(1)},q=U=>{U.preventDefault(),U.metaKey?G(0):U.altKey?B(-1):V(-1)};return P.createElement(Fe.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:U=>{var O;if((O=x.onKeyDown)==null||O.call(x,U),!U.defaultPrevented)switch(U.key){case"n":case"j":{y&&U.ctrlKey&&I(U);break}case"ArrowDown":{I(U);break}case"p":case"k":{y&&U.ctrlKey&&q(U);break}case"ArrowUp":{q(U);break}case"Home":{U.preventDefault(),G(0);break}case"End":{U.preventDefault(),X();break}case"Enter":if(!U.nativeEvent.isComposing&&U.keyCode!==229){U.preventDefault();let ee=H();if(ee){let K=new Event($_);ee.dispatchEvent(K)}}}}},P.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:mAe},l),Z0(e,U=>P.createElement(SB.Provider,{value:T},P.createElement(wB.Provider,{value:M},U))))}),iAe=P.forwardRef((e,t)=>{var n,r;let i=Yn(),o=P.useRef(null),s=P.useContext(_B),a=Yp(),l=EB(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Oc(()=>{if(!c)return a.item(i,s==null?void 0:s.id)},[c]);let u=RB(i,o,[e.value,e.children,o],e.keywords),d=k2(),p=Mc(R=>R.value&&R.value===u.current),h=Mc(R=>c||a.filter()===!1?!0:R.search?R.filtered.items.get(i)>0:!0);P.useEffect(()=>{let R=o.current;if(!(!R||e.disabled))return R.addEventListener($_,m),()=>R.removeEventListener($_,m)},[h,e.onSelect,e.disabled]);function m(){var R,T;b(),(T=(R=l.current).onSelect)==null||T.call(R,u.current)}function b(){d.setState("value",u.current,!0)}if(!h)return null;let{disabled:y,value:x,onSelect:w,forceMount:_,keywords:E,...C}=e;return P.createElement(Fe.div,{ref:ip([o,t]),...C,id:i,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!p,"data-disabled":!!y,"data-selected":!!p,onPointerMove:y||a.getDisablePointerSelection()?void 0:b,onClick:y?void 0:m},e.children)}),oAe=P.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=Yn(),a=P.useRef(null),l=P.useRef(null),c=Yn(),u=Yp(),d=Mc(h=>i||u.filter()===!1?!0:h.search?h.filtered.groups.has(s):!0);Oc(()=>u.group(s),[]),RB(s,a,[e.value,e.heading,l]);let p=P.useMemo(()=>({id:s,forceMount:i}),[i]);return P.createElement(Fe.div,{ref:ip([a,t]),...o,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&P.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Z0(e,h=>P.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},P.createElement(_B.Provider,{value:p},h))))}),sAe=P.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=P.useRef(null),o=Mc(s=>!s.search);return!n&&!o?null:P.createElement(Fe.div,{ref:ip([i,t]),...r,"cmdk-separator":"",role:"separator"})}),aAe=P.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=k2(),s=Mc(u=>u.search),a=Mc(u=>u.value),l=Yp(),c=P.useMemo(()=>{var u;let d=(u=l.listInnerRef.current)==null?void 0:u.querySelector(`${T2}[${$l}="${encodeURIComponent(a)}"]`);return d==null?void 0:d.getAttribute("id")},[]);return P.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),P.createElement(Fe.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:i?e.value:s,onChange:u=>{i||o.setState("search",u.target.value),n==null||n(u.target.value)}})}),lAe=P.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=P.useRef(null),s=P.useRef(null),a=Yp();return P.useEffect(()=>{if(s.current&&o.current){let l=s.current,c=o.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let p=l.offsetHeight;c.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return d.observe(l),()=>{cancelAnimationFrame(u),d.unobserve(l)}}},[]),P.createElement(Fe.div,{ref:ip([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},Z0(e,l=>P.createElement("div",{ref:ip([s,a.listInnerRef]),"cmdk-list-sizer":""},l)))}),cAe=P.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...a}=e;return P.createElement(u2,{open:n,onOpenChange:r},P.createElement(d2,{container:s},P.createElement(W0,{"cmdk-overlay":"",className:i}),P.createElement(U0,{"aria-label":e.label,"cmdk-dialog":"",className:o},P.createElement(CB,{ref:t,...a}))))}),uAe=P.forwardRef((e,t)=>Mc(n=>n.filtered.count===0)?P.createElement(Fe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),dAe=P.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return P.createElement(Fe.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Z0(e,s=>P.createElement("div",{"aria-hidden":!0},s)))}),wi=Object.assign(CB,{List:lAe,Item:iAe,Input:aAe,Group:oAe,Separator:sAe,Dialog:cAe,Empty:uAe,Loading:dAe});function fAe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function hAe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function EB(e){let t=P.useRef(e);return Oc(()=>{t.current=e}),t}var Oc=typeof window>"u"?P.useEffect:P.useLayoutEffect;function wu(e){let t=P.useRef();return t.current===void 0&&(t.current=e()),t}function ip(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Mc(e){let t=k2(),n=()=>e(t.snapshot());return p9.useSyncExternalStore(t.subscribe,n,n)}function RB(e,t,n,r=[]){let i=P.useRef(),o=Yp();return Oc(()=>{var s;let a=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():i.current}})(),l=r.map(c=>c.trim());o.value(e,a,l),(s=t.current)==null||s.setAttribute($l,a),i.current=a}),i}var pAe=()=>{let[e,t]=P.useState(),n=wu(()=>new Map);return Oc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function gAe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Z0({asChild:e,children:t},n){return e&&P.isValidElement(t)?P.cloneElement(gAe(t),{ref:t.ref},n(t.props.children)):n(t)}var mAe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const PB=P.forwardRef(({className:e,...t},n)=>v.jsx(wi,{ref:n,className:me("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));PB.displayName=wi.displayName;const TB=P.forwardRef(({className:e,...t},n)=>v.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[v.jsx(gL,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),v.jsx(wi.Input,{ref:n,className:me("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));TB.displayName=wi.Input.displayName;const kB=P.forwardRef(({className:e,...t},n)=>v.jsx(wi.List,{ref:n,className:me("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));kB.displayName=wi.List.displayName;const AB=P.forwardRef((e,t)=>v.jsx(wi.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));AB.displayName=wi.Empty.displayName;const OB=P.forwardRef(({className:e,...t},n)=>v.jsx(wi.Group,{ref:n,className:me("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));OB.displayName=wi.Group.displayName;const bAe=P.forwardRef(({className:e,...t},n)=>v.jsx(wi.Separator,{ref:n,className:me("-mx-1 h-px bg-border",e),...t}));bAe.displayName=wi.Separator.displayName;const MB=P.forwardRef(({className:e,...t},n)=>v.jsx(wi.Item,{ref:n,className:me("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));MB.displayName=wi.Item.displayName;var yAe=Object.defineProperty,vAe=(e,t,n)=>t in e?yAe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vm=(e,t,n)=>vAe(e,typeof t!="symbol"?t+"":t,n);const xAe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},wAe={stringify:e=>e.name,parse:(e,t,n)=>{const r=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof r=="function"?r.bind(n):void 0}},SAe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},_Ae={stringify:e=>`${e}`,parse:e=>parseFloat(e)},CAe={stringify:e=>e,parse:e=>e},c1={string:CAe,number:_Ae,boolean:xAe,function:wAe,json:SAe};function EAe(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,n,r)=>`${n}-${r.toLowerCase()}`)}const Wm=Symbol.for("r2wc.render"),Um=Symbol.for("r2wc.connected"),kl=Symbol.for("r2wc.context"),Ls=Symbol.for("r2wc.props");function RAe(e,t,n){var r,i,o;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const s=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),a=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),l={},c={},u={},d={};for(const h of s){l[h]=Array.isArray(t.props)?"string":t.props[h];const m=EAe(h);u[h]=m,d[m]=h}for(const h of a)c[h]=Array.isArray(t.events)?{}:t.events[h];class p extends HTMLElement{constructor(){super(),Vm(this,o,!0),Vm(this,i),Vm(this,r,{}),Vm(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Ls].container=this.container;for(const m of s){const b=u[m],y=this.getAttribute(b),x=l[m],w=x?c1[x]:null;w!=null&&w.parse&&y&&(this[Ls][m]=w.parse(y,b,this))}for(const m of a)this[Ls][m]=b=>{const y=m.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(y,{detail:b,...c[m]}))}}static get observedAttributes(){return Object.keys(d)}connectedCallback(){this[Um]=!0,this[Wm]()}disconnectedCallback(){this[Um]=!1,this[kl]&&n.unmount(this[kl]),delete this[kl]}attributeChangedCallback(m,b,y){const x=d[m],w=l[x],_=w?c1[w]:null;x in l&&_!=null&&_.parse&&y&&(this[Ls][x]=_.parse(y,m,this),this[Wm]())}[(o=Um,i=kl,r=Ls,Wm)](){this[Um]&&(this[kl]?n.update(this[kl],this[Ls]):this[kl]=n.mount(this.container,e,this[Ls]))}}for(const h of s){const m=u[h],b=l[h];Object.defineProperty(p.prototype,h,{enumerable:!0,configurable:!0,get(){return this[Ls][h]},set(y){this[Ls][h]=y;const x=b?c1[b]:null;if(x!=null&&x.stringify){const w=x.stringify(y,m,this);this.getAttribute(m)!==w&&this.setAttribute(m,w)}else this[Wm]()}})}return p}function PAe(e,t,n){const r=x1(e),i=k.createElement(t,n);return r.render(i),{root:r,ReactComponent:t}}function TAe({root:e,ReactComponent:t},n){const r=k.createElement(t,n);e.render(r)}function kAe({root:e}){e.unmount()}function AAe(e,t={}){return RAe(e,t,{mount:PAe,update:TAe,unmount:kAe})}const OAe={id:"string",version:"string",authToken:"json",placeholders:"json",defaultFilterValues:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onFilterValuesChange:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean",selectedSheetId:"string"},MAe=AAe(N$,{props:OAe});exports.Accordion=Gke;exports.AccordionContent=vB;exports.AccordionItem=bB;exports.AccordionTrigger=yB;exports.Button=nr;exports.Calendar=J5;exports.Card=$N;exports.CardContent=Ty;exports.CardDescription=oC;exports.CardHeader=Py;exports.CardTitle=Ad;exports.CaretSortIcon=dee;exports.ChartJsVisual=YE;exports.ChatInput=v7;exports.ChatStatus=m7;exports.Check=Md;exports.CheckIcon=FC;exports.Checkbox=I0;exports.ChevronDown=mp;exports.ChevronLeft=jC;exports.ChevronRight=Gy;exports.ChevronUp=eL;exports.Circle=$C;exports.ColorFormat=H6;exports.Command=PB;exports.CommandEmpty=AB;exports.CommandGroup=OB;exports.CommandInput=TB;exports.CommandItem=MB;exports.CommandList=kB;exports.Copy=zC;exports.CopyButton=q8;exports.Cross2Icon=Y5;exports.DATAMODEL_NAMESPCACE=Y_;exports.Dashboard=N$;exports.DashboardPanel=BN;exports.DashboardTabs=I$;exports.DashboardWC=MAe;exports.Dialog=vTe;exports.DialogContent=Fz;exports.DialogDescription=Bz;exports.DialogFooter=$z;exports.DialogHeader=jz;exports.DialogTitle=zz;exports.DialogTrigger=xTe;exports.Download=tL;exports.DropdownMenu=pTe;exports.DropdownMenuCheckboxItem=Mz;exports.DropdownMenuContent=Az;exports.DropdownMenuItem=Oz;exports.DropdownMenuLabel=Dz;exports.DropdownMenuRadioGroup=mTe;exports.DropdownMenuRadioItem=Iz;exports.DropdownMenuSeparator=Nz;exports.DropdownMenuTrigger=gTe;exports.Editable=os;exports.EditorAside=Vz;exports.EditorMain=Wz;exports.EditorPanel=Hz;exports.ErrorBoundary=Yy;exports.Eye=rL;exports.EyeOff=nL;exports.Fallback=HC;exports.FallbackEditorCard=Qee;exports.Filter=iL;exports.FilterComponent=PR;exports.FilterHeader=Y8;exports.FilterX=BC;exports.Ft=Tke;exports.GripVertical=oL;exports.HoverCard=Rp;exports.HoverCardContent=zd;exports.HoverCardTrigger=Pp;exports.Icon=Z5;exports.IdCard=sL;exports.Info=aL;exports.Input=dc;exports.KPICard=Gb;exports.LOCALE_CURRENCY_PAIRS=w1;exports.Label=Sn;exports.Le=_ke;exports.Lightbulb=cL;exports.LightbulbOff=lL;exports.MultiInputEmptyRenderer=Y6;exports.Octagon=uL;exports.Oe=Oxe;exports.PYTHON_DEFAULT_CODE=q_;exports.Pencil=dL;exports.Percent=fL;exports.Play=hL;exports.Plus=qy;exports.Popover=w0;exports.PopoverContent=Mp;exports.PopoverTrigger=S0;exports.PrintMessages=b7;exports.RadioGroup=Uh;exports.RadioGroupItem=Gl;exports.ResizableHandle=N2e;exports.ResizablePanel=N_;exports.ResizablePanelGroup=H7;exports.ScrollArea=fc;exports.ScrollBar=Ip;exports.Search=gL;exports.SearchX=pL;exports.Select=Bs;exports.SelectContent=Go;exports.SelectGroup=vu;exports.SelectItem=Dn;exports.SelectLabel=Ll;exports.SelectSeparator=gh;exports.SelectTrigger=Uo;exports.SelectValue=Hs;exports.SemaphorContextProvider=FN;exports.SemaphorQueryClient=NN;exports.SendHorizontal=mL;exports.Separator=f0;exports.Settings=bL;exports.SliderIcon=vee;exports.SquarePen=yL;exports.Switch=rB;exports.Table2=vL;exports.TableBody=$E;exports.TableCell=BE;exports.TableHead=zE;exports.TableHeader=jE;exports.TableRow=hh;exports.TableVisual=U6;exports.Tabs=dC;exports.TabsContent=fC;exports.TabsList=My;exports.TabsTrigger=Iy;exports.TextCard=Zb;exports.Textarea=TR;exports.Toggle=_0;exports.Tooltip=p3;exports.TooltipContent=LE;exports.TooltipTrigger=g3;exports.TooltipTrigger$1=NE;exports.TreePalm=xL;exports.TriangleDownIcon=K5;exports.TriangleUpIcon=X5;exports.UXProvider=D$;exports.UserRound=wL;exports.UserSearch=SL;exports.X=jc;exports._=tc;exports.ce=K8;exports.cn=me;exports.createChartConfig=xE;exports.createLucideIcon=Bt;exports.createSqlGenConfig=eX;exports.de=Qz;exports.dedup=n2e;exports.flexRender=WS;exports.fmt=X_;exports.getCanvasBackgroundColor=Eh;exports.getColumnDataType=tX;exports.getContrastColor=sd;exports.getCoreRowModel=M3;exports.getDefaultFilterSql=zve;exports.getFilterValueType=Au;exports.getFormattedTableNameForQuery=xN;exports.getKeys=lr;exports.getNumberAxis=WC;exports.getPaginationRowModel=I3;exports.getPlugins=pX;exports.getQualifiedTableName=Z_;exports.getRequest=lX;exports.getSortedRowModel=D3;exports.getSql=JK;exports.getStatus=y7;exports.getTenantAndEndUserId=cX;exports.getTokenParams=SN;exports.hslStringToHex=CL;exports.invalidateToken=fX;exports.isBooleanDataType=Q_;exports.isColumnInSqlGen=nX;exports.isDateDataType=kd;exports.isInAiScopeArray=t2e;exports.isNumberDataType=cp;exports.isObjectEmpty=aX;exports.isTextDataType=Cy;exports.jsxRuntimeExports=v;exports.loadManifest=G6;exports.pivotData=wb;exports.postRequest=Ry;exports.removeFromScopeArray=r2e;exports.removeRing=nh;exports.resolveDataType=Ey;exports.titleCase=dX;exports.useCard=uce;exports.useChat=_9;exports.useCustomVisual=q6;exports.useDashboardActions=Vn;exports.useDashboardCardQuery=Ga;exports.useDashboardStore=ye;exports.useDateFilterHook=kbe;exports.useEditorActions=gp;exports.useEditorStore=fi;exports.useQuery=dp;exports.useQueryClient=iC;exports.useReactTable=N3;exports.useSemaphorContext=Wi;exports.useTextFilterHook=Bve;exports.useTheme=CN;exports.useTopoJson=_4;exports.v4=Ua;