react-semaphor 0.0.228 → 0.0.229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{dashboard-plus-e01JfHQz.js → dashboard-plus-5-7yzt3Q.js} +2 -2
- package/dist/chunks/{dashboard-plus-lCYlvokP.js → dashboard-plus-Tqe1mSSw.js} +2 -2
- package/dist/chunks/{index-5I0YebI6.js → index-LiVhH7z4.js} +21 -21
- package/dist/chunks/{index-9atMGUeK.js → index-yvohbzaw.js} +13 -17
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +1 -1
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
*/var jE;function bj(){return jE||(jE=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function w(D){if(D===null||typeof D!="object")return null;var te=v&&D[v]||D[b];return typeof te=="function"?te:null}var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(D){{for(var te=arguments.length,ce=new Array(te>1?te-1:0),Oe=1;Oe<te;Oe++)ce[Oe-1]=arguments[Oe];S("error",D,ce)}}function S(D,te,ce){{var Oe=x.ReactDebugCurrentFrame,He=Oe.getStackAddendum();He!==""&&(te+="%s",ce=ce.concat([He]));var qe=ce.map(function(ze){return String(ze)});qe.unshift("Warning: "+te),Function.prototype.apply.call(console[D],console,qe)}}var C=!1,E=!1,P=!1,A=!1,k=!1,I;I=Symbol.for("react.module.reference");function $(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===i||k||D===o||D===c||D===u||A||D===g||C||E||P||typeof D=="object"&&D!==null&&(D.$$typeof===h||D.$$typeof===f||D.$$typeof===s||D.$$typeof===a||D.$$typeof===l||D.$$typeof===I||D.getModuleId!==void 0))}function L(D,te,ce){var Oe=D.displayName;if(Oe)return Oe;var He=te.displayName||te.name||"";return He!==""?ce+"("+He+")":ce}function j(D){return D.displayName||"Context"}function Q(D){if(D==null)return null;if(typeof D.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof D=="object")switch(D.$$typeof){case a:var te=D;return j(te)+".Consumer";case s:var ce=D;return j(ce._context)+".Provider";case l:return L(D,D.render,"ForwardRef");case f:var Oe=D.displayName||null;return Oe!==null?Oe:Q(D.type)||"Memo";case h:{var He=D,qe=He._payload,ze=He._init;try{return Q(ze(qe))}catch{return null}}}return null}var ee=Object.assign,B=0,Z,G,q,K,T,V,X;function N(){}N.__reactDisabledLog=!0;function ie(){{if(B===0){Z=console.log,G=console.info,q=console.warn,K=console.error,T=console.group,V=console.groupCollapsed,X=console.groupEnd;var D={configurable:!0,enumerable:!0,value:N,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}B++}}function fe(){{if(B--,B===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ee({},D,{value:Z}),info:ee({},D,{value:G}),warn:ee({},D,{value:q}),error:ee({},D,{value:K}),group:ee({},D,{value:T}),groupCollapsed:ee({},D,{value:V}),groupEnd:ee({},D,{value:X})})}B<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=x.ReactCurrentDispatcher,pe;function se(D,te,ce){{if(pe===void 0)try{throw Error()}catch(He){var Oe=He.stack.trim().match(/\n( *(at )?)/);pe=Oe&&Oe[1]||""}return`
|
|
10
10
|
`+pe+D}}var ne=!1,le;{var ye=typeof WeakMap=="function"?WeakMap:Map;le=new ye}function Y(D,te){if(!D||ne)return"";{var ce=le.get(D);if(ce!==void 0)return ce}var Oe;ne=!0;var He=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var qe;qe=ue.current,ue.current=null,ie();try{if(te){var ze=function(){throw Error()};if(Object.defineProperty(ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ze,[])}catch(ft){Oe=ft}Reflect.construct(D,[],ze)}else{try{ze.call()}catch(ft){Oe=ft}D.call(ze.prototype)}}else{try{throw Error()}catch(ft){Oe=ft}D()}}catch(ft){if(ft&&Oe&&typeof ft.stack=="string"){for(var Fe=ft.stack.split(`
|
|
11
11
|
`),Ae=Oe.stack.split(`
|
|
12
|
-
`),U=Fe.length-1,me=Ae.length-1;U>=1&&me>=0&&Fe[U]!==Ae[me];)me--;for(;U>=1&&me>=0;U--,me--)if(Fe[U]!==Ae[me]){if(U!==1||me!==1)do if(U--,me--,me<0||Fe[U]!==Ae[me]){var
|
|
13
|
-
`+Fe[U].replace(" at new "," at ");return D.displayName
|
|
12
|
+
`),U=Fe.length-1,me=Ae.length-1;U>=1&&me>=0&&Fe[U]!==Ae[me];)me--;for(;U>=1&&me>=0;U--,me--)if(Fe[U]!==Ae[me]){if(U!==1||me!==1)do if(U--,me--,me<0||Fe[U]!==Ae[me]){var $e=`
|
|
13
|
+
`+Fe[U].replace(" at new "," at ");return D.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",D.displayName)),typeof D=="function"&&le.set(D,$e),$e}while(U>=1&&me>=0);break}}}finally{ne=!1,ue.current=qe,fe(),Error.prepareStackTrace=He}var st=D?D.displayName||D.name:"",bn=st?se(st):"";return typeof D=="function"&&le.set(D,bn),bn}function be(D,te,ce){return Y(D,!1)}function _e(D){var te=D.prototype;return!!(te&&te.isReactComponent)}function Pe(D,te,ce){if(D==null)return"";if(typeof D=="function")return Y(D,_e(D));if(typeof D=="string")return se(D);switch(D){case c:return se("Suspense");case u:return se("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case l:return be(D.render);case f:return Pe(D.type,te,ce);case h:{var Oe=D,He=Oe._payload,qe=Oe._init;try{return Pe(qe(He),te,ce)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Ue={},Be=x.ReactDebugCurrentFrame;function Ie(D){if(D){var te=D._owner,ce=Pe(D.type,D._source,te?te.type:null);Be.setExtraStackFrame(ce)}else Be.setExtraStackFrame(null)}function Ke(D,te,ce,Oe,He){{var qe=Function.call.bind(Te);for(var ze in D)if(qe(D,ze)){var Fe=void 0;try{if(typeof D[ze]!="function"){var Ae=Error((Oe||"React class")+": "+ce+" type `"+ze+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[ze]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ae.name="Invariant Violation",Ae}Fe=D[ze](te,ze,Oe,ce,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(U){Fe=U}Fe&&!(Fe instanceof Error)&&(Ie(He),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Oe||"React class",ce,ze,typeof Fe),Ie(null)),Fe instanceof Error&&!(Fe.message in Ue)&&(Ue[Fe.message]=!0,Ie(He),_("Failed %s type: %s",ce,Fe.message),Ie(null))}}}var lt=Array.isArray;function It(D){return lt(D)}function At(D){{var te=typeof Symbol=="function"&&Symbol.toStringTag,ce=te&&D[Symbol.toStringTag]||D.constructor.name||"Object";return ce}}function Ht(D){try{return de(D),!1}catch{return!0}}function de(D){return""+D}function Ee(D){if(Ht(D))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",At(D)),de(D)}var Le=x.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},Ze,Wt,Zt;Zt={};function Kt(D){if(Te.call(D,"ref")){var te=Object.getOwnPropertyDescriptor(D,"ref").get;if(te&&te.isReactWarning)return!1}return D.ref!==void 0}function vn(D){if(Te.call(D,"key")){var te=Object.getOwnPropertyDescriptor(D,"key").get;if(te&&te.isReactWarning)return!1}return D.key!==void 0}function ln(D,te){if(typeof D.ref=="string"&&Le.current&&te&&Le.current.stateNode!==te){var ce=Q(Le.current.type);Zt[ce]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Q(Le.current.type),D.ref),Zt[ce]=!0)}}function Lt(D,te){{var ce=function(){Ze||(Ze=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",te))};ce.isReactWarning=!0,Object.defineProperty(D,"key",{get:ce,configurable:!0})}}function tn(D,te){{var ce=function(){Wt||(Wt=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",te))};ce.isReactWarning=!0,Object.defineProperty(D,"ref",{get:ce,configurable:!0})}}var xn=function(D,te,ce,Oe,He,qe,ze){var Fe={$$typeof:t,type:D,key:te,ref:ce,props:ze,_owner:qe};return Fe._store={},Object.defineProperty(Fe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Fe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.defineProperty(Fe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:He}),Object.freeze&&(Object.freeze(Fe.props),Object.freeze(Fe)),Fe};function nt(D,te,ce,Oe,He){{var qe,ze={},Fe=null,Ae=null;ce!==void 0&&(Ee(ce),Fe=""+ce),vn(te)&&(Ee(te.key),Fe=""+te.key),Kt(te)&&(Ae=te.ref,ln(te,He));for(qe in te)Te.call(te,qe)&&!Ge.hasOwnProperty(qe)&&(ze[qe]=te[qe]);if(D&&D.defaultProps){var U=D.defaultProps;for(qe in U)ze[qe]===void 0&&(ze[qe]=U[qe])}if(Fe||Ae){var me=typeof D=="function"?D.displayName||D.name||"Unknown":D;Fe&&Lt(ze,me),Ae&&tn(ze,me)}return xn(D,Fe,Ae,He,Oe,Le.current,ze)}}var ht=x.ReactCurrentOwner,$t=x.ReactDebugCurrentFrame;function Xt(D){if(D){var te=D._owner,ce=Pe(D.type,D._source,te?te.type:null);$t.setExtraStackFrame(ce)}else $t.setExtraStackFrame(null)}var bt;bt=!1;function Rn(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Lo(){{if(ht.current){var D=Q(ht.current.type);if(D)return`
|
|
14
14
|
|
|
15
15
|
Check the render method of \``+D+"`."}return""}}function ms(D){{if(D!==void 0){var te=D.fileName.replace(/^.*[\\\/]/,""),ce=D.lineNumber;return`
|
|
16
16
|
|
|
17
17
|
Check your code at `+te+":"+ce+"."}return""}}var Fo={};function Ai(D){{var te=Lo();if(!te){var ce=typeof D=="string"?D:D.displayName||D.name;ce&&(te=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+ce+">.")}return te}}function ni(D,te){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var ce=Ai(te);if(Fo[ce])return;Fo[ce]=!0;var Oe="";D&&D._owner&&D._owner!==ht.current&&(Oe=" It was passed a child from "+Q(D._owner.type)+"."),Xt(D),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ce,Oe),Xt(null)}}function $i(D,te){{if(typeof D!="object")return;if(It(D))for(var ce=0;ce<D.length;ce++){var Oe=D[ce];Rn(Oe)&&ni(Oe,te)}else if(Rn(D))D._store&&(D._store.validated=!0);else if(D){var He=w(D);if(typeof He=="function"&&He!==D.entries)for(var qe=He.call(D),ze;!(ze=qe.next()).done;)Rn(ze.value)&&ni(ze.value,te)}}}function vs(D){{var te=D.type;if(te==null||typeof te=="string")return;var ce;if(typeof te=="function")ce=te.propTypes;else if(typeof te=="object"&&(te.$$typeof===l||te.$$typeof===f))ce=te.propTypes;else return;if(ce){var Oe=Q(te);Ke(ce,D.props,"prop",Oe,D)}else if(te.PropTypes!==void 0&&!bt){bt=!0;var He=Q(te);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof te.getDefaultProps=="function"&&!te.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ri(D){{for(var te=Object.keys(D.props),ce=0;ce<te.length;ce++){var Oe=te[ce];if(Oe!=="children"&&Oe!=="key"){Xt(D),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),Xt(null);break}}D.ref!==null&&(Xt(D),_("Invalid attribute `ref` supplied to `React.Fragment`."),Xt(null))}}function ki(D,te,ce,Oe,He,qe){{var ze=$(D);if(!ze){var Fe="";(D===void 0||typeof D=="object"&&D!==null&&Object.keys(D).length===0)&&(Fe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ae=ms(He);Ae?Fe+=Ae:Fe+=Lo();var U;D===null?U="null":It(D)?U="array":D!==void 0&&D.$$typeof===t?(U="<"+(Q(D.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):U=typeof D,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",U,Fe)}var me=nt(D,te,ce,He,qe);if(me==null)return me;if(ze){var
|
|
19
|
+
Check the top-level render call using <`+ce+">.")}return te}}function ni(D,te){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var ce=Ai(te);if(Fo[ce])return;Fo[ce]=!0;var Oe="";D&&D._owner&&D._owner!==ht.current&&(Oe=" It was passed a child from "+Q(D._owner.type)+"."),Xt(D),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ce,Oe),Xt(null)}}function $i(D,te){{if(typeof D!="object")return;if(It(D))for(var ce=0;ce<D.length;ce++){var Oe=D[ce];Rn(Oe)&&ni(Oe,te)}else if(Rn(D))D._store&&(D._store.validated=!0);else if(D){var He=w(D);if(typeof He=="function"&&He!==D.entries)for(var qe=He.call(D),ze;!(ze=qe.next()).done;)Rn(ze.value)&&ni(ze.value,te)}}}function vs(D){{var te=D.type;if(te==null||typeof te=="string")return;var ce;if(typeof te=="function")ce=te.propTypes;else if(typeof te=="object"&&(te.$$typeof===l||te.$$typeof===f))ce=te.propTypes;else return;if(ce){var Oe=Q(te);Ke(ce,D.props,"prop",Oe,D)}else if(te.PropTypes!==void 0&&!bt){bt=!0;var He=Q(te);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof te.getDefaultProps=="function"&&!te.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ri(D){{for(var te=Object.keys(D.props),ce=0;ce<te.length;ce++){var Oe=te[ce];if(Oe!=="children"&&Oe!=="key"){Xt(D),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),Xt(null);break}}D.ref!==null&&(Xt(D),_("Invalid attribute `ref` supplied to `React.Fragment`."),Xt(null))}}function ki(D,te,ce,Oe,He,qe){{var ze=$(D);if(!ze){var Fe="";(D===void 0||typeof D=="object"&&D!==null&&Object.keys(D).length===0)&&(Fe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ae=ms(He);Ae?Fe+=Ae:Fe+=Lo();var U;D===null?U="null":It(D)?U="array":D!==void 0&&D.$$typeof===t?(U="<"+(Q(D.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):U=typeof D,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",U,Fe)}var me=nt(D,te,ce,He,qe);if(me==null)return me;if(ze){var $e=te.children;if($e!==void 0)if(Oe)if(It($e)){for(var st=0;st<$e.length;st++)$i($e[st],D);Object.freeze&&Object.freeze($e)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else $i($e,D)}return D===r?ri(me):vs(me),me}}function jn(D,te,ce){return ki(D,te,ce,!0)}function oi(D,te,ce){return ki(D,te,ce,!1)}var bs=oi,ys=jn;Du.Fragment=r,Du.jsx=bs,Du.jsxs=ys}()),Du}var Au={};/**
|
|
20
20
|
* @license React
|
|
21
21
|
* react-jsx-runtime.production.min.js
|
|
22
22
|
*
|
|
@@ -59,16 +59,16 @@ Check the top-level render call using <`+ce+">.")}return te}}function ni(D,te){{
|
|
|
59
59
|
*/var YE;function uz(){if(YE)return Tb;YE=1;var e=m,t=vw();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Tb.useSyncExternalStoreWithSelector=function(c,u,f,h,g){var v=i(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=a(function(){function x(P){if(!_){if(_=!0,S=P,P=h(P),g!==void 0&&b.hasValue){var A=b.value;if(g(A,P))return C=A}return C=P}if(A=C,r(S,P))return A;var k=h(P);return g!==void 0&&g(A,k)?A:(S=P,C=k)}var _=!1,S,C,E=f===void 0?null:f;return[function(){return x(u())},E===null?void 0:function(){return x(E())}]},[u,f,h,g]);var w=o(c,v[0],v[1]);return s(function(){b.hasValue=!0,b.value=w},[w]),l(w),w},Tb}process.env.NODE_ENV==="production"?g0.exports=uz():g0.exports=cz();var dz=g0.exports;const fz=nu(dz);var J2={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:hz}=m,{useSyncExternalStoreWithSelector:pz}=fz;let KE=!1;function gz(e,t=e.getState,n){(J2?"production":void 0)!=="production"&&n&&!KE&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),KE=!0);const r=pz(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return hz(r),r}const XE=e=>{(J2?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?sz(e):e,n=(r,o)=>gz(t,r,o);return Object.assign(n,t),n},Z2=e=>e?XE(e):XE;var eD=Symbol.for("immer-nothing"),QE=Symbol.for("immer-draftable"),ao=Symbol.for("immer-state"),mz=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 Mr(e,...t){if(process.env.NODE_ENV!=="production"){const n=mz[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 jc=Object.getPrototypeOf;function zc(e){return!!e&&!!e[ao]}function fl(e){var t;return e?tD(e)||Array.isArray(e)||!!e[QE]||!!((t=e.constructor)!=null&&t[QE])||nm(e)||rm(e):!1}var vz=Object.prototype.constructor.toString();function tD(e){if(!e||typeof e!="object")return!1;const t=jc(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)===vz}function Ed(e,t){tm(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function tm(e){const t=e[ao];return t?t.type_:Array.isArray(e)?1:nm(e)?2:rm(e)?3:0}function m0(e,t){return tm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function nD(e,t,n){const r=tm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function bz(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function nm(e){return e instanceof Map}function rm(e){return e instanceof Set}function La(e){return e.copy_||e.base_}function v0(e,t){if(nm(e))return new Map(e);if(rm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&tD(e))return jc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[ao];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(jc(e),n)}function bw(e,t=!1){return om(e)||zc(e)||!fl(e)||(tm(e)>1&&(e.set=e.add=e.clear=e.delete=yz),Object.freeze(e),t&&Ed(e,(n,r)=>bw(r,!0))),e}function yz(){Mr(2)}function om(e){return Object.isFrozen(e)}var xz={};function hl(e){const t=xz[e];return t||Mr(0,e),t}var Rd;function rD(){return Rd}function wz(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function JE(e,t){t&&(hl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function b0(e){y0(e),e.drafts_.forEach(_z),e.drafts_=null}function y0(e){e===Rd&&(Rd=e.parent_)}function ZE(e){return Rd=wz(Rd,e)}function _z(e){const t=e[ao];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function eR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[ao].modified_&&(b0(t),Mr(4)),fl(e)&&(e=dg(t,e),t.parent_||fg(t,e)),t.patches_&&hl("Patches").generateReplacementPatches_(n[ao].base_,e,t.patches_,t.inversePatches_)):e=dg(t,n,[]),b0(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==eD?e:void 0}function dg(e,t,n){if(om(t))return t;const r=t[ao];if(!r)return Ed(t,(o,i)=>tR(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return fg(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),Ed(i,(a,l)=>tR(e,r,o,a,l,n,s)),fg(e,o,!1),n&&e.patches_&&hl("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function tR(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Mr(5),zc(o)){const a=i&&t&&t.type_!==3&&!m0(t.assigned_,r)?i.concat(r):void 0,l=dg(e,o,a);if(nD(n,r,l),zc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(fl(o)&&!om(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;dg(e,o),(!t||!t.scope_.parent_)&&fg(e,o)}}function fg(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&bw(t,n)}function Sz(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:rD(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=yw;n&&(o=[r],i=Od);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var yw={get(e,t){if(t===ao)return e;const n=La(e);if(!m0(n,t))return Cz(e,n,t);const r=n[t];return e.finalized_||!fl(r)?r:r===Db(e.base_,t)?(Ab(e),e.copy_[t]=w0(r,e)):r},has(e,t){return t in La(e)},ownKeys(e){return Reflect.ownKeys(La(e))},set(e,t,n){const r=oD(La(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Db(La(e),t),i=o==null?void 0:o[ao];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(bz(n,o)&&(n!==void 0||m0(e.base_,t)))return!0;Ab(e),x0(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 Db(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ab(e),x0(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=La(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Mr(11)},getPrototypeOf(e){return jc(e.base_)},setPrototypeOf(){Mr(12)}},Od={};Ed(yw,(e,t)=>{Od[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Od.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Mr(13),Od.set.call(this,e,t,void 0)};Od.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Mr(14),yw.set.call(this,e[0],t,n,e[0])};function Db(e,t){const n=e[ao];return(n?La(n):e)[t]}function Cz(e,t,n){var o;const r=oD(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function oD(e,t){if(!(t in e))return;let n=jc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=jc(n)}}function x0(e){e.modified_||(e.modified_=!0,e.parent_&&x0(e.parent_))}function Ab(e){e.copy_||(e.copy_=v0(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ez=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Mr(6),r!==void 0&&typeof r!="function"&&Mr(7);let o;if(fl(t)){const i=ZE(this),s=w0(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?b0(i):y0(i)}return JE(i,r),eR(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===eD&&(o=void 0),this.autoFreeze_&&bw(o,!0),r){const i=[],s=[];hl("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Mr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){fl(e)||Mr(8),zc(e)&&(e=Rz(e));const t=ZE(this),n=w0(e,void 0);return n[ao].isManual_=!0,y0(t),n}finishDraft(e,t){const n=e&&e[ao];(!n||!n.isManual_)&&Mr(9);const{scope_:r}=n;return JE(r,t),eR(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=hl("Patches").applyPatches_;return zc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function w0(e,t){const n=nm(e)?hl("MapSet").proxyMap_(e,t):rm(e)?hl("MapSet").proxySet_(e,t):Sz(e,t);return(t?t.scope_:rD()).drafts_.push(n),n}function Rz(e){return zc(e)||Mr(10,e),iD(e)}function iD(e){if(!fl(e)||om(e))return e;const t=e[ao];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=v0(e,t.scope_.immer_.useStrictShallowCopy_)}else n=v0(e,!0);return Ed(n,(r,o)=>{nD(n,r,iD(o))}),t&&(t.finalized_=!1),n}var lo=new Ez,Oz=lo.produce;lo.produceWithPatches.bind(lo);lo.setAutoFreeze.bind(lo);lo.setUseStrictShallowCopy.bind(lo);lo.applyPatches.bind(lo);lo.createDraft.bind(lo);lo.finishDraft.bind(lo);const Pz=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?Oz(o):o;return t(a,i,...s)},e(r.setState,n,r)),sD=Pz;var _0,Uh=Mo;if(process.env.NODE_ENV==="production")_0=Uh.createRoot,Uh.hydrateRoot;else{var nR=Uh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;_0=function(e,t){nR.usingClientEntryPoint=!0;try{return Uh.createRoot(e,t)}finally{nR.usingClientEntryPoint=!1}}}var aD={},lD={},xw={exports:{}},dn=String,cD=function(){return{isColorSupported:!1,reset:dn,bold:dn,dim:dn,italic:dn,underline:dn,inverse:dn,hidden:dn,strikethrough:dn,black:dn,red:dn,green:dn,yellow:dn,blue:dn,magenta:dn,cyan:dn,white:dn,gray:dn,bgBlack:dn,bgRed:dn,bgGreen:dn,bgYellow:dn,bgBlue:dn,bgMagenta:dn,bgCyan:dn,bgWhite:dn}};xw.exports=cD();xw.exports.createColors=cD;var Tz=xw.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(Tz);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(lD);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(lD);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(aD);let $b=aD;var Dz=($b.__esModule?$b:{default:$b}).default;const Bt=nu(Dz),uD=`import pandas as pd
|
|
60
60
|
df = pd.DataFrame(data) # 'data' contains the query result
|
|
61
61
|
result = df.to_dict('records') # must return 'result' as [dict] type
|
|
62
|
-
`,dD="dm",S0=[{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"}],Az=[{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)"}]}],ww=["lg","md","sm","xs","xxs"],C0={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],borderColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:E0},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:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],borderColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],datalables:{color:E0}},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:Bt.slate[800]}},y:{grid:{display:!0,color:Bt.slate[800]}}}}}}};function E0(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Pd()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Pd()),Bc(n)}function Pd(){return
|
|
62
|
+
`,dD="dm",S0=[{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"}],Az=[{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)"}]}],ww=["lg","md","sm","xs","xxs"],C0={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],borderColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:E0},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:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],borderColor:[Bt.blue[500],Bt.teal[500],Bt.amber[500],Bt.red[500],Bt.indigo[500],Bt.green[500]],datalables:{color:E0}},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:Bt.slate[800]}},y:{grid:{display:!0,color:Bt.slate[800]}}}}}}};function E0(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Pd()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Pd()),Bc(n)}function Pd(){return ke.getState().theme==="dark"?"#000000":"#FFFFFF"}function Bc(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return Bt.gray[500];const f=u.replace("#",""),h=parseInt(f.substring(0,2),16),g=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=h,n+=g,r+=v,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const im=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],Vc=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],Pf=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],_w=["boolean"];function Sw(e){return e.match(/[A-Z]/)?`"${e}"`:e}function $z(e,t,n,r){const{measures:o,dimensions:i}=e,s=o==null?void 0:o.map(u=>`${u.calc}(${u.name}) as ${u.calc}_${u.name.replace(/"/g,"")}`).join(", "),a=(i==null?void 0:i.join(", "))||"";let l="";const c=r?`${dD}.${r}`:fD(t,n);if(s&&a)return l=`SELECT ${a}, COUNT(*) as count, ${s} FROM ${c} GROUP BY ${a} ORDER BY ${a} DESC`,l;if(!s&&a)return l=`SELECT ${a}, COUNT(*) as count FROM ${c} GROUP BY ${a} ORDER BY ${a} DESC`,l;if(s&&!a)return l=`SELECT ${s} FROM ${c}`,l}function kz(e,t,n="AVG"){var i,s,a,l;let r={};const o=Sw(e.column_name);return im.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),Vc.includes(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function hg(e){return im.includes(e.dataType)?"string":Vc.includes(e.dataType)?"number":Pf.includes(e.dataType)?"date":_w.includes(e.dataType)?"boolean":"string"}function Mz(e){let t;const n=e.data_type.toLowerCase();return im.includes(n)?t="T":Vc.includes(n)?t="#":Pf.includes(n)?t="D":_w.includes(n)?t="B":t="?",t}function Iz(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function fD(e,t){return t==="api"||e===Sw("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const Nz=e=>{const t=new Date(e);return!isNaN(t.getTime())},Lz=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Td=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?Nz(e)?t="date":Lz(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function Fz({get:e,dataPoint:t,card:n}){var h;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,f={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(h=n.preferences)==null?void 0:h.filterOnClickField,valueType:Td(u),operation:"=",values:[u]};if(l!=null&&l.find(g=>g.id===n.id)){const g=n.id;if(u==null){a(n),i(g);return}else s(f)}o(n),r(f)}var pg={exports:{}};/**
|
|
63
63
|
* @license
|
|
64
64
|
* Lodash <https://lodash.com/>
|
|
65
65
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
66
66
|
* Released under MIT license <https://lodash.com/license>
|
|
67
67
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
68
68
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
69
|
-
*/pg.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",f=1,h=2,g=4,v=1,b=2,w=1,x=2,_=4,S=8,C=16,E=32,P=64,A=128,k=256,I=512,$=30,L="...",j=800,Q=16,ee=1,B=2,Z=3,G=1/0,q=9007199254740991,K=17976931348623157e292,T=NaN,V=4294967295,X=V-1,N=V>>>1,ie=[["ary",A],["bind",w],["bindKey",x],["curry",S],["curryRight",C],["flip",I],["partial",E],["partialRight",P],["rearg",k]],fe="[object Arguments]",ue="[object Array]",pe="[object AsyncFunction]",se="[object Boolean]",ne="[object Date]",le="[object DOMException]",ye="[object Error]",Y="[object Function]",be="[object GeneratorFunction]",_e="[object Map]",Pe="[object Number]",Te="[object Null]",Ue="[object Object]",Be="[object Promise]",Ie="[object Proxy]",Ke="[object RegExp]",lt="[object Set]",It="[object String]",At="[object Symbol]",Ht="[object Undefined]",de="[object WeakMap]",Ee="[object WeakSet]",Le="[object ArrayBuffer]",Ge="[object DataView]",Ze="[object Float32Array]",Wt="[object Float64Array]",Zt="[object Int8Array]",Kt="[object Int16Array]",vn="[object Int32Array]",ln="[object Uint8Array]",Lt="[object Uint8ClampedArray]",tn="[object Uint16Array]",xn="[object Uint32Array]",nt=/\b__p \+= '';/g,ht=/\b(__p \+=) '' \+/g,$t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xt=/&(?:amp|lt|gt|quot|#39);/g,bt=/[&<>"']/g,Rn=RegExp(Xt.source),Lo=RegExp(bt.source),ms=/<%-([\s\S]+?)%>/g,Fo=/<%([\s\S]+?)%>/g,Ai=/<%=([\s\S]+?)%>/g,ni=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$i=/^\w*$/,vs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ri=/[\\^$.*+?()[\]{}|]/g,ki=RegExp(ri.source),jn=/^\s+/,oi=/\s/,bs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ys=/\{\n\/\* \[wrapped with (.+)\] \*/,D=/,? & /,te=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,Oe=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qe=/\w*$/,ze=/^[-+]0x[0-9a-f]+$/i,Fe=/^0b[01]+$/i,Ae=/^\[object .+?Constructor\]$/,U=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ke=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,st=/($^)/,bn=/['\n\r\u2028\u2029\\]/g,ft="\\ud800-\\udfff",tr="\\u0300-\\u036f",go="\\ufe20-\\ufe2f",ya="\\u20d0-\\u20ff",zn=tr+go+ya,hu="\\u2700-\\u27bf",pu="a-z\\xdf-\\xf6\\xf8-\\xff",fF="\\xac\\xb1\\xd7\\xf7",hF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",pF="\\u2000-\\u206f",gF=" \\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",vS="A-Z\\xc0-\\xd6\\xd8-\\xde",bS="\\ufe0e\\ufe0f",yS=fF+hF+pF+gF,gv="['’]",mF="["+ft+"]",xS="["+yS+"]",nh="["+zn+"]",wS="\\d+",vF="["+hu+"]",_S="["+pu+"]",SS="[^"+ft+yS+wS+hu+pu+vS+"]",mv="\\ud83c[\\udffb-\\udfff]",bF="(?:"+nh+"|"+mv+")",CS="[^"+ft+"]",vv="(?:\\ud83c[\\udde6-\\uddff]){2}",bv="[\\ud800-\\udbff][\\udc00-\\udfff]",Ml="["+vS+"]",ES="\\u200d",RS="(?:"+_S+"|"+SS+")",yF="(?:"+Ml+"|"+SS+")",OS="(?:"+gv+"(?:d|ll|m|re|s|t|ve))?",PS="(?:"+gv+"(?:D|LL|M|RE|S|T|VE))?",TS=bF+"?",DS="["+bS+"]?",xF="(?:"+ES+"(?:"+[CS,vv,bv].join("|")+")"+DS+TS+")*",wF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_F="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",AS=DS+TS+xF,SF="(?:"+[vF,vv,bv].join("|")+")"+AS,CF="(?:"+[CS+nh+"?",nh,vv,bv,mF].join("|")+")",EF=RegExp(gv,"g"),RF=RegExp(nh,"g"),yv=RegExp(mv+"(?="+mv+")|"+CF+AS,"g"),OF=RegExp([Ml+"?"+_S+"+"+OS+"(?="+[xS,Ml,"$"].join("|")+")",yF+"+"+PS+"(?="+[xS,Ml+RS,"$"].join("|")+")",Ml+"?"+RS+"+"+OS,Ml+"+"+PS,_F,wF,wS,SF].join("|"),"g"),PF=RegExp("["+ES+ft+zn+bS+"]"),TF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,DF=["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"],AF=-1,cn={};cn[Ze]=cn[Wt]=cn[Zt]=cn[Kt]=cn[vn]=cn[ln]=cn[Lt]=cn[tn]=cn[xn]=!0,cn[fe]=cn[ue]=cn[Le]=cn[se]=cn[Ge]=cn[ne]=cn[ye]=cn[Y]=cn[_e]=cn[Pe]=cn[Ue]=cn[Ke]=cn[lt]=cn[It]=cn[de]=!1;var rn={};rn[fe]=rn[ue]=rn[Le]=rn[Ge]=rn[se]=rn[ne]=rn[Ze]=rn[Wt]=rn[Zt]=rn[Kt]=rn[vn]=rn[_e]=rn[Pe]=rn[Ue]=rn[Ke]=rn[lt]=rn[It]=rn[At]=rn[ln]=rn[Lt]=rn[tn]=rn[xn]=!0,rn[ye]=rn[Y]=rn[de]=!1;var $F={À:"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"},kF={"&":"&","<":"<",">":">",'"':""","'":"'"},MF={"&":"&","<":"<",">":">",""":'"',"'":"'"},IF={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},NF=parseFloat,LF=parseInt,$S=typeof Vs=="object"&&Vs&&Vs.Object===Object&&Vs,FF=typeof self=="object"&&self&&self.Object===Object&&self,qn=$S||FF||Function("return this")(),xv=t&&!t.nodeType&&t,xa=xv&&!0&&e&&!e.nodeType&&e,kS=xa&&xa.exports===xv,wv=kS&&$S.process,mo=function(){try{var re=xa&&xa.require&&xa.require("util").types;return re||wv&&wv.binding&&wv.binding("util")}catch{}}(),MS=mo&&mo.isArrayBuffer,IS=mo&&mo.isDate,NS=mo&&mo.isMap,LS=mo&&mo.isRegExp,FS=mo&&mo.isSet,jS=mo&&mo.isTypedArray;function zr(re,ve,ge){switch(ge.length){case 0:return re.call(ve);case 1:return re.call(ve,ge[0]);case 2:return re.call(ve,ge[0],ge[1]);case 3:return re.call(ve,ge[0],ge[1],ge[2])}return re.apply(ve,ge)}function jF(re,ve,ge,We){for(var ct=-1,jt=re==null?0:re.length;++ct<jt;){var kn=re[ct];ve(We,kn,ge(kn),re)}return We}function vo(re,ve){for(var ge=-1,We=re==null?0:re.length;++ge<We&&ve(re[ge],ge,re)!==!1;);return re}function zF(re,ve){for(var ge=re==null?0:re.length;ge--&&ve(re[ge],ge,re)!==!1;);return re}function zS(re,ve){for(var ge=-1,We=re==null?0:re.length;++ge<We;)if(!ve(re[ge],ge,re))return!1;return!0}function xs(re,ve){for(var ge=-1,We=re==null?0:re.length,ct=0,jt=[];++ge<We;){var kn=re[ge];ve(kn,ge,re)&&(jt[ct++]=kn)}return jt}function rh(re,ve){var ge=re==null?0:re.length;return!!ge&&Il(re,ve,0)>-1}function _v(re,ve,ge){for(var We=-1,ct=re==null?0:re.length;++We<ct;)if(ge(ve,re[We]))return!0;return!1}function yn(re,ve){for(var ge=-1,We=re==null?0:re.length,ct=Array(We);++ge<We;)ct[ge]=ve(re[ge],ge,re);return ct}function ws(re,ve){for(var ge=-1,We=ve.length,ct=re.length;++ge<We;)re[ct+ge]=ve[ge];return re}function Sv(re,ve,ge,We){var ct=-1,jt=re==null?0:re.length;for(We&&jt&&(ge=re[++ct]);++ct<jt;)ge=ve(ge,re[ct],ct,re);return ge}function BF(re,ve,ge,We){var ct=re==null?0:re.length;for(We&&ct&&(ge=re[--ct]);ct--;)ge=ve(ge,re[ct],ct,re);return ge}function Cv(re,ve){for(var ge=-1,We=re==null?0:re.length;++ge<We;)if(ve(re[ge],ge,re))return!0;return!1}var VF=Ev("length");function HF(re){return re.split("")}function WF(re){return re.match(te)||[]}function BS(re,ve,ge){var We;return ge(re,function(ct,jt,kn){if(ve(ct,jt,kn))return We=jt,!1}),We}function oh(re,ve,ge,We){for(var ct=re.length,jt=ge+(We?1:-1);We?jt--:++jt<ct;)if(ve(re[jt],jt,re))return jt;return-1}function Il(re,ve,ge){return ve===ve?n3(re,ve,ge):oh(re,VS,ge)}function UF(re,ve,ge,We){for(var ct=ge-1,jt=re.length;++ct<jt;)if(We(re[ct],ve))return ct;return-1}function VS(re){return re!==re}function HS(re,ve){var ge=re==null?0:re.length;return ge?Ov(re,ve)/ge:T}function Ev(re){return function(ve){return ve==null?n:ve[re]}}function Rv(re){return function(ve){return re==null?n:re[ve]}}function WS(re,ve,ge,We,ct){return ct(re,function(jt,kn,nn){ge=We?(We=!1,jt):ve(ge,jt,kn,nn)}),ge}function qF(re,ve){var ge=re.length;for(re.sort(ve);ge--;)re[ge]=re[ge].value;return re}function Ov(re,ve){for(var ge,We=-1,ct=re.length;++We<ct;){var jt=ve(re[We]);jt!==n&&(ge=ge===n?jt:ge+jt)}return ge}function Pv(re,ve){for(var ge=-1,We=Array(re);++ge<re;)We[ge]=ve(ge);return We}function GF(re,ve){return yn(ve,function(ge){return[ge,re[ge]]})}function US(re){return re&&re.slice(0,KS(re)+1).replace(jn,"")}function Br(re){return function(ve){return re(ve)}}function Tv(re,ve){return yn(ve,function(ge){return re[ge]})}function gu(re,ve){return re.has(ve)}function qS(re,ve){for(var ge=-1,We=re.length;++ge<We&&Il(ve,re[ge],0)>-1;);return ge}function GS(re,ve){for(var ge=re.length;ge--&&Il(ve,re[ge],0)>-1;);return ge}function YF(re,ve){for(var ge=re.length,We=0;ge--;)re[ge]===ve&&++We;return We}var KF=Rv($F),XF=Rv(kF);function QF(re){return"\\"+IF[re]}function JF(re,ve){return re==null?n:re[ve]}function Nl(re){return PF.test(re)}function ZF(re){return TF.test(re)}function e3(re){for(var ve,ge=[];!(ve=re.next()).done;)ge.push(ve.value);return ge}function Dv(re){var ve=-1,ge=Array(re.size);return re.forEach(function(We,ct){ge[++ve]=[ct,We]}),ge}function YS(re,ve){return function(ge){return re(ve(ge))}}function _s(re,ve){for(var ge=-1,We=re.length,ct=0,jt=[];++ge<We;){var kn=re[ge];(kn===ve||kn===u)&&(re[ge]=u,jt[ct++]=ge)}return jt}function ih(re){var ve=-1,ge=Array(re.size);return re.forEach(function(We){ge[++ve]=We}),ge}function t3(re){var ve=-1,ge=Array(re.size);return re.forEach(function(We){ge[++ve]=[We,We]}),ge}function n3(re,ve,ge){for(var We=ge-1,ct=re.length;++We<ct;)if(re[We]===ve)return We;return-1}function r3(re,ve,ge){for(var We=ge+1;We--;)if(re[We]===ve)return We;return We}function Ll(re){return Nl(re)?i3(re):VF(re)}function jo(re){return Nl(re)?s3(re):HF(re)}function KS(re){for(var ve=re.length;ve--&&oi.test(re.charAt(ve)););return ve}var o3=Rv(MF);function i3(re){for(var ve=yv.lastIndex=0;yv.test(re);)++ve;return ve}function s3(re){return re.match(yv)||[]}function a3(re){return re.match(OF)||[]}var l3=function re(ve){ve=ve==null?qn:Fl.defaults(qn.Object(),ve,Fl.pick(qn,DF));var ge=ve.Array,We=ve.Date,ct=ve.Error,jt=ve.Function,kn=ve.Math,nn=ve.Object,Av=ve.RegExp,c3=ve.String,bo=ve.TypeError,sh=ge.prototype,u3=jt.prototype,jl=nn.prototype,ah=ve["__core-js_shared__"],lh=u3.toString,Qt=jl.hasOwnProperty,d3=0,XS=function(){var d=/[^.]+$/.exec(ah&&ah.keys&&ah.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),ch=jl.toString,f3=lh.call(nn),h3=qn._,p3=Av("^"+lh.call(Qt).replace(ri,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uh=kS?ve.Buffer:n,Ss=ve.Symbol,dh=ve.Uint8Array,QS=uh?uh.allocUnsafe:n,fh=YS(nn.getPrototypeOf,nn),JS=nn.create,ZS=jl.propertyIsEnumerable,hh=sh.splice,eC=Ss?Ss.isConcatSpreadable:n,mu=Ss?Ss.iterator:n,wa=Ss?Ss.toStringTag:n,ph=function(){try{var d=Ra(nn,"defineProperty");return d({},"",{}),d}catch{}}(),g3=ve.clearTimeout!==qn.clearTimeout&&ve.clearTimeout,m3=We&&We.now!==qn.Date.now&&We.now,v3=ve.setTimeout!==qn.setTimeout&&ve.setTimeout,gh=kn.ceil,mh=kn.floor,$v=nn.getOwnPropertySymbols,b3=uh?uh.isBuffer:n,tC=ve.isFinite,y3=sh.join,x3=YS(nn.keys,nn),Mn=kn.max,nr=kn.min,w3=We.now,_3=ve.parseInt,nC=kn.random,S3=sh.reverse,kv=Ra(ve,"DataView"),vu=Ra(ve,"Map"),Mv=Ra(ve,"Promise"),zl=Ra(ve,"Set"),bu=Ra(ve,"WeakMap"),yu=Ra(nn,"create"),vh=bu&&new bu,Bl={},C3=Oa(kv),E3=Oa(vu),R3=Oa(Mv),O3=Oa(zl),P3=Oa(bu),bh=Ss?Ss.prototype:n,xu=bh?bh.valueOf:n,rC=bh?bh.toString:n;function F(d){if(Sn(d)&&!ut(d)&&!(d instanceof kt)){if(d instanceof yo)return d;if(Qt.call(d,"__wrapped__"))return oE(d)}return new yo(d)}var Vl=function(){function d(){}return function(p){if(!wn(p))return{};if(JS)return JS(p);d.prototype=p;var y=new d;return d.prototype=n,y}}();function yh(){}function yo(d,p){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=n}F.templateSettings={escape:ms,evaluate:Fo,interpolate:Ai,variable:"",imports:{_:F}},F.prototype=yh.prototype,F.prototype.constructor=F,yo.prototype=Vl(yh.prototype),yo.prototype.constructor=yo;function kt(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=V,this.__views__=[]}function T3(){var d=new kt(this.__wrapped__);return d.__actions__=Sr(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=Sr(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=Sr(this.__views__),d}function D3(){if(this.__filtered__){var d=new kt(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function A3(){var d=this.__wrapped__.value(),p=this.__dir__,y=ut(d),R=p<0,M=y?d.length:0,z=H7(0,M,this.__views__),W=z.start,J=z.end,ae=J-W,xe=R?J:W-1,we=this.__iteratees__,Re=we.length,je=0,Ye=nr(ae,this.__takeCount__);if(!y||!R&&M==ae&&Ye==ae)return OC(d,this.__actions__);var et=[];e:for(;ae--&&je<Ye;){xe+=p;for(var yt=-1,tt=d[xe];++yt<Re;){var Pt=we[yt],Mt=Pt.iteratee,Wr=Pt.type,pr=Mt(tt);if(Wr==B)tt=pr;else if(!pr){if(Wr==ee)continue e;break e}}et[je++]=tt}return et}kt.prototype=Vl(yh.prototype),kt.prototype.constructor=kt;function _a(d){var p=-1,y=d==null?0:d.length;for(this.clear();++p<y;){var R=d[p];this.set(R[0],R[1])}}function $3(){this.__data__=yu?yu(null):{},this.size=0}function k3(d){var p=this.has(d)&&delete this.__data__[d];return this.size-=p?1:0,p}function M3(d){var p=this.__data__;if(yu){var y=p[d];return y===l?n:y}return Qt.call(p,d)?p[d]:n}function I3(d){var p=this.__data__;return yu?p[d]!==n:Qt.call(p,d)}function N3(d,p){var y=this.__data__;return this.size+=this.has(d)?0:1,y[d]=yu&&p===n?l:p,this}_a.prototype.clear=$3,_a.prototype.delete=k3,_a.prototype.get=M3,_a.prototype.has=I3,_a.prototype.set=N3;function Mi(d){var p=-1,y=d==null?0:d.length;for(this.clear();++p<y;){var R=d[p];this.set(R[0],R[1])}}function L3(){this.__data__=[],this.size=0}function F3(d){var p=this.__data__,y=xh(p,d);if(y<0)return!1;var R=p.length-1;return y==R?p.pop():hh.call(p,y,1),--this.size,!0}function j3(d){var p=this.__data__,y=xh(p,d);return y<0?n:p[y][1]}function z3(d){return xh(this.__data__,d)>-1}function B3(d,p){var y=this.__data__,R=xh(y,d);return R<0?(++this.size,y.push([d,p])):y[R][1]=p,this}Mi.prototype.clear=L3,Mi.prototype.delete=F3,Mi.prototype.get=j3,Mi.prototype.has=z3,Mi.prototype.set=B3;function Ii(d){var p=-1,y=d==null?0:d.length;for(this.clear();++p<y;){var R=d[p];this.set(R[0],R[1])}}function V3(){this.size=0,this.__data__={hash:new _a,map:new(vu||Mi),string:new _a}}function H3(d){var p=$h(this,d).delete(d);return this.size-=p?1:0,p}function W3(d){return $h(this,d).get(d)}function U3(d){return $h(this,d).has(d)}function q3(d,p){var y=$h(this,d),R=y.size;return y.set(d,p),this.size+=y.size==R?0:1,this}Ii.prototype.clear=V3,Ii.prototype.delete=H3,Ii.prototype.get=W3,Ii.prototype.has=U3,Ii.prototype.set=q3;function Sa(d){var p=-1,y=d==null?0:d.length;for(this.__data__=new Ii;++p<y;)this.add(d[p])}function G3(d){return this.__data__.set(d,l),this}function Y3(d){return this.__data__.has(d)}Sa.prototype.add=Sa.prototype.push=G3,Sa.prototype.has=Y3;function zo(d){var p=this.__data__=new Mi(d);this.size=p.size}function K3(){this.__data__=new Mi,this.size=0}function X3(d){var p=this.__data__,y=p.delete(d);return this.size=p.size,y}function Q3(d){return this.__data__.get(d)}function J3(d){return this.__data__.has(d)}function Z3(d,p){var y=this.__data__;if(y instanceof Mi){var R=y.__data__;if(!vu||R.length<o-1)return R.push([d,p]),this.size=++y.size,this;y=this.__data__=new Ii(R)}return y.set(d,p),this.size=y.size,this}zo.prototype.clear=K3,zo.prototype.delete=X3,zo.prototype.get=Q3,zo.prototype.has=J3,zo.prototype.set=Z3;function oC(d,p){var y=ut(d),R=!y&&Pa(d),M=!y&&!R&&Ps(d),z=!y&&!R&&!M&&ql(d),W=y||R||M||z,J=W?Pv(d.length,c3):[],ae=J.length;for(var xe in d)(p||Qt.call(d,xe))&&!(W&&(xe=="length"||M&&(xe=="offset"||xe=="parent")||z&&(xe=="buffer"||xe=="byteLength"||xe=="byteOffset")||ji(xe,ae)))&&J.push(xe);return J}function iC(d){var p=d.length;return p?d[Uv(0,p-1)]:n}function e7(d,p){return kh(Sr(d),Ca(p,0,d.length))}function t7(d){return kh(Sr(d))}function Iv(d,p,y){(y!==n&&!Bo(d[p],y)||y===n&&!(p in d))&&Ni(d,p,y)}function wu(d,p,y){var R=d[p];(!(Qt.call(d,p)&&Bo(R,y))||y===n&&!(p in d))&&Ni(d,p,y)}function xh(d,p){for(var y=d.length;y--;)if(Bo(d[y][0],p))return y;return-1}function n7(d,p,y,R){return Cs(d,function(M,z,W){p(R,M,y(M),W)}),R}function sC(d,p){return d&&si(p,Bn(p),d)}function r7(d,p){return d&&si(p,Er(p),d)}function Ni(d,p,y){p=="__proto__"&&ph?ph(d,p,{configurable:!0,enumerable:!0,value:y,writable:!0}):d[p]=y}function Nv(d,p){for(var y=-1,R=p.length,M=ge(R),z=d==null;++y<R;)M[y]=z?n:mb(d,p[y]);return M}function Ca(d,p,y){return d===d&&(y!==n&&(d=d<=y?d:y),p!==n&&(d=d>=p?d:p)),d}function xo(d,p,y,R,M,z){var W,J=p&f,ae=p&h,xe=p&g;if(y&&(W=M?y(d,R,M,z):y(d)),W!==n)return W;if(!wn(d))return d;var we=ut(d);if(we){if(W=U7(d),!J)return Sr(d,W)}else{var Re=rr(d),je=Re==Y||Re==be;if(Ps(d))return DC(d,J);if(Re==Ue||Re==fe||je&&!M){if(W=ae||je?{}:KC(d),!J)return ae?M7(d,r7(W,d)):k7(d,sC(W,d))}else{if(!rn[Re])return M?d:{};W=q7(d,Re,J)}}z||(z=new zo);var Ye=z.get(d);if(Ye)return Ye;z.set(d,W),CE(d)?d.forEach(function(tt){W.add(xo(tt,p,y,tt,d,z))}):_E(d)&&d.forEach(function(tt,Pt){W.set(Pt,xo(tt,p,y,Pt,d,z))});var et=xe?ae?nb:tb:ae?Er:Bn,yt=we?n:et(d);return vo(yt||d,function(tt,Pt){yt&&(Pt=tt,tt=d[Pt]),wu(W,Pt,xo(tt,p,y,Pt,d,z))}),W}function o7(d){var p=Bn(d);return function(y){return aC(y,d,p)}}function aC(d,p,y){var R=y.length;if(d==null)return!R;for(d=nn(d);R--;){var M=y[R],z=p[M],W=d[M];if(W===n&&!(M in d)||!z(W))return!1}return!0}function lC(d,p,y){if(typeof d!="function")throw new bo(s);return Pu(function(){d.apply(n,y)},p)}function _u(d,p,y,R){var M=-1,z=rh,W=!0,J=d.length,ae=[],xe=p.length;if(!J)return ae;y&&(p=yn(p,Br(y))),R?(z=_v,W=!1):p.length>=o&&(z=gu,W=!1,p=new Sa(p));e:for(;++M<J;){var we=d[M],Re=y==null?we:y(we);if(we=R||we!==0?we:0,W&&Re===Re){for(var je=xe;je--;)if(p[je]===Re)continue e;ae.push(we)}else z(p,Re,R)||ae.push(we)}return ae}var Cs=IC(ii),cC=IC(Fv,!0);function i7(d,p){var y=!0;return Cs(d,function(R,M,z){return y=!!p(R,M,z),y}),y}function wh(d,p,y){for(var R=-1,M=d.length;++R<M;){var z=d[R],W=p(z);if(W!=null&&(J===n?W===W&&!Hr(W):y(W,J)))var J=W,ae=z}return ae}function s7(d,p,y,R){var M=d.length;for(y=pt(y),y<0&&(y=-y>M?0:M+y),R=R===n||R>M?M:pt(R),R<0&&(R+=M),R=y>R?0:RE(R);y<R;)d[y++]=p;return d}function uC(d,p){var y=[];return Cs(d,function(R,M,z){p(R,M,z)&&y.push(R)}),y}function Gn(d,p,y,R,M){var z=-1,W=d.length;for(y||(y=Y7),M||(M=[]);++z<W;){var J=d[z];p>0&&y(J)?p>1?Gn(J,p-1,y,R,M):ws(M,J):R||(M[M.length]=J)}return M}var Lv=NC(),dC=NC(!0);function ii(d,p){return d&&Lv(d,p,Bn)}function Fv(d,p){return d&&dC(d,p,Bn)}function _h(d,p){return xs(p,function(y){return zi(d[y])})}function Ea(d,p){p=Rs(p,d);for(var y=0,R=p.length;d!=null&&y<R;)d=d[ai(p[y++])];return y&&y==R?d:n}function fC(d,p,y){var R=p(d);return ut(d)?R:ws(R,y(d))}function fr(d){return d==null?d===n?Ht:Te:wa&&wa in nn(d)?V7(d):t6(d)}function jv(d,p){return d>p}function a7(d,p){return d!=null&&Qt.call(d,p)}function l7(d,p){return d!=null&&p in nn(d)}function c7(d,p,y){return d>=nr(p,y)&&d<Mn(p,y)}function zv(d,p,y){for(var R=y?_v:rh,M=d[0].length,z=d.length,W=z,J=ge(z),ae=1/0,xe=[];W--;){var we=d[W];W&&p&&(we=yn(we,Br(p))),ae=nr(we.length,ae),J[W]=!y&&(p||M>=120&&we.length>=120)?new Sa(W&&we):n}we=d[0];var Re=-1,je=J[0];e:for(;++Re<M&&xe.length<ae;){var Ye=we[Re],et=p?p(Ye):Ye;if(Ye=y||Ye!==0?Ye:0,!(je?gu(je,et):R(xe,et,y))){for(W=z;--W;){var yt=J[W];if(!(yt?gu(yt,et):R(d[W],et,y)))continue e}je&&je.push(et),xe.push(Ye)}}return xe}function u7(d,p,y,R){return ii(d,function(M,z,W){p(R,y(M),z,W)}),R}function Su(d,p,y){p=Rs(p,d),d=ZC(d,p);var R=d==null?d:d[ai(_o(p))];return R==null?n:zr(R,d,y)}function hC(d){return Sn(d)&&fr(d)==fe}function d7(d){return Sn(d)&&fr(d)==Le}function f7(d){return Sn(d)&&fr(d)==ne}function Cu(d,p,y,R,M){return d===p?!0:d==null||p==null||!Sn(d)&&!Sn(p)?d!==d&&p!==p:h7(d,p,y,R,Cu,M)}function h7(d,p,y,R,M,z){var W=ut(d),J=ut(p),ae=W?ue:rr(d),xe=J?ue:rr(p);ae=ae==fe?Ue:ae,xe=xe==fe?Ue:xe;var we=ae==Ue,Re=xe==Ue,je=ae==xe;if(je&&Ps(d)){if(!Ps(p))return!1;W=!0,we=!1}if(je&&!we)return z||(z=new zo),W||ql(d)?qC(d,p,y,R,M,z):z7(d,p,ae,y,R,M,z);if(!(y&v)){var Ye=we&&Qt.call(d,"__wrapped__"),et=Re&&Qt.call(p,"__wrapped__");if(Ye||et){var yt=Ye?d.value():d,tt=et?p.value():p;return z||(z=new zo),M(yt,tt,y,R,z)}}return je?(z||(z=new zo),B7(d,p,y,R,M,z)):!1}function p7(d){return Sn(d)&&rr(d)==_e}function Bv(d,p,y,R){var M=y.length,z=M,W=!R;if(d==null)return!z;for(d=nn(d);M--;){var J=y[M];if(W&&J[2]?J[1]!==d[J[0]]:!(J[0]in d))return!1}for(;++M<z;){J=y[M];var ae=J[0],xe=d[ae],we=J[1];if(W&&J[2]){if(xe===n&&!(ae in d))return!1}else{var Re=new zo;if(R)var je=R(xe,we,ae,d,p,Re);if(!(je===n?Cu(we,xe,v|b,R,Re):je))return!1}}return!0}function pC(d){if(!wn(d)||X7(d))return!1;var p=zi(d)?p3:Ae;return p.test(Oa(d))}function g7(d){return Sn(d)&&fr(d)==Ke}function m7(d){return Sn(d)&&rr(d)==lt}function v7(d){return Sn(d)&&jh(d.length)&&!!cn[fr(d)]}function gC(d){return typeof d=="function"?d:d==null?Rr:typeof d=="object"?ut(d)?bC(d[0],d[1]):vC(d):LE(d)}function Vv(d){if(!Ou(d))return x3(d);var p=[];for(var y in nn(d))Qt.call(d,y)&&y!="constructor"&&p.push(y);return p}function b7(d){if(!wn(d))return e6(d);var p=Ou(d),y=[];for(var R in d)R=="constructor"&&(p||!Qt.call(d,R))||y.push(R);return y}function Hv(d,p){return d<p}function mC(d,p){var y=-1,R=Cr(d)?ge(d.length):[];return Cs(d,function(M,z,W){R[++y]=p(M,z,W)}),R}function vC(d){var p=ob(d);return p.length==1&&p[0][2]?QC(p[0][0],p[0][1]):function(y){return y===d||Bv(y,d,p)}}function bC(d,p){return sb(d)&&XC(p)?QC(ai(d),p):function(y){var R=mb(y,d);return R===n&&R===p?vb(y,d):Cu(p,R,v|b)}}function Sh(d,p,y,R,M){d!==p&&Lv(p,function(z,W){if(M||(M=new zo),wn(z))y7(d,p,W,y,Sh,R,M);else{var J=R?R(lb(d,W),z,W+"",d,p,M):n;J===n&&(J=z),Iv(d,W,J)}},Er)}function y7(d,p,y,R,M,z,W){var J=lb(d,y),ae=lb(p,y),xe=W.get(ae);if(xe){Iv(d,y,xe);return}var we=z?z(J,ae,y+"",d,p,W):n,Re=we===n;if(Re){var je=ut(ae),Ye=!je&&Ps(ae),et=!je&&!Ye&&ql(ae);we=ae,je||Ye||et?ut(J)?we=J:On(J)?we=Sr(J):Ye?(Re=!1,we=DC(ae,!0)):et?(Re=!1,we=AC(ae,!0)):we=[]:Tu(ae)||Pa(ae)?(we=J,Pa(J)?we=OE(J):(!wn(J)||zi(J))&&(we=KC(ae))):Re=!1}Re&&(W.set(ae,we),M(we,ae,R,z,W),W.delete(ae)),Iv(d,y,we)}function yC(d,p){var y=d.length;if(y)return p+=p<0?y:0,ji(p,y)?d[p]:n}function xC(d,p,y){p.length?p=yn(p,function(z){return ut(z)?function(W){return Ea(W,z.length===1?z[0]:z)}:z}):p=[Rr];var R=-1;p=yn(p,Br(Je()));var M=mC(d,function(z,W,J){var ae=yn(p,function(xe){return xe(z)});return{criteria:ae,index:++R,value:z}});return qF(M,function(z,W){return $7(z,W,y)})}function x7(d,p){return wC(d,p,function(y,R){return vb(d,R)})}function wC(d,p,y){for(var R=-1,M=p.length,z={};++R<M;){var W=p[R],J=Ea(d,W);y(J,W)&&Eu(z,Rs(W,d),J)}return z}function w7(d){return function(p){return Ea(p,d)}}function Wv(d,p,y,R){var M=R?UF:Il,z=-1,W=p.length,J=d;for(d===p&&(p=Sr(p)),y&&(J=yn(d,Br(y)));++z<W;)for(var ae=0,xe=p[z],we=y?y(xe):xe;(ae=M(J,we,ae,R))>-1;)J!==d&&hh.call(J,ae,1),hh.call(d,ae,1);return d}function _C(d,p){for(var y=d?p.length:0,R=y-1;y--;){var M=p[y];if(y==R||M!==z){var z=M;ji(M)?hh.call(d,M,1):Yv(d,M)}}return d}function Uv(d,p){return d+mh(nC()*(p-d+1))}function _7(d,p,y,R){for(var M=-1,z=Mn(gh((p-d)/(y||1)),0),W=ge(z);z--;)W[R?z:++M]=d,d+=y;return W}function qv(d,p){var y="";if(!d||p<1||p>q)return y;do p%2&&(y+=d),p=mh(p/2),p&&(d+=d);while(p);return y}function St(d,p){return cb(JC(d,p,Rr),d+"")}function S7(d){return iC(Gl(d))}function C7(d,p){var y=Gl(d);return kh(y,Ca(p,0,y.length))}function Eu(d,p,y,R){if(!wn(d))return d;p=Rs(p,d);for(var M=-1,z=p.length,W=z-1,J=d;J!=null&&++M<z;){var ae=ai(p[M]),xe=y;if(ae==="__proto__"||ae==="constructor"||ae==="prototype")return d;if(M!=W){var we=J[ae];xe=R?R(we,ae,J):n,xe===n&&(xe=wn(we)?we:ji(p[M+1])?[]:{})}wu(J,ae,xe),J=J[ae]}return d}var SC=vh?function(d,p){return vh.set(d,p),d}:Rr,E7=ph?function(d,p){return ph(d,"toString",{configurable:!0,enumerable:!1,value:yb(p),writable:!0})}:Rr;function R7(d){return kh(Gl(d))}function wo(d,p,y){var R=-1,M=d.length;p<0&&(p=-p>M?0:M+p),y=y>M?M:y,y<0&&(y+=M),M=p>y?0:y-p>>>0,p>>>=0;for(var z=ge(M);++R<M;)z[R]=d[R+p];return z}function O7(d,p){var y;return Cs(d,function(R,M,z){return y=p(R,M,z),!y}),!!y}function Ch(d,p,y){var R=0,M=d==null?R:d.length;if(typeof p=="number"&&p===p&&M<=N){for(;R<M;){var z=R+M>>>1,W=d[z];W!==null&&!Hr(W)&&(y?W<=p:W<p)?R=z+1:M=z}return M}return Gv(d,p,Rr,y)}function Gv(d,p,y,R){var M=0,z=d==null?0:d.length;if(z===0)return 0;p=y(p);for(var W=p!==p,J=p===null,ae=Hr(p),xe=p===n;M<z;){var we=mh((M+z)/2),Re=y(d[we]),je=Re!==n,Ye=Re===null,et=Re===Re,yt=Hr(Re);if(W)var tt=R||et;else xe?tt=et&&(R||je):J?tt=et&&je&&(R||!Ye):ae?tt=et&&je&&!Ye&&(R||!yt):Ye||yt?tt=!1:tt=R?Re<=p:Re<p;tt?M=we+1:z=we}return nr(z,X)}function CC(d,p){for(var y=-1,R=d.length,M=0,z=[];++y<R;){var W=d[y],J=p?p(W):W;if(!y||!Bo(J,ae)){var ae=J;z[M++]=W===0?0:W}}return z}function EC(d){return typeof d=="number"?d:Hr(d)?T:+d}function Vr(d){if(typeof d=="string")return d;if(ut(d))return yn(d,Vr)+"";if(Hr(d))return rC?rC.call(d):"";var p=d+"";return p=="0"&&1/d==-G?"-0":p}function Es(d,p,y){var R=-1,M=rh,z=d.length,W=!0,J=[],ae=J;if(y)W=!1,M=_v;else if(z>=o){var xe=p?null:F7(d);if(xe)return ih(xe);W=!1,M=gu,ae=new Sa}else ae=p?[]:J;e:for(;++R<z;){var we=d[R],Re=p?p(we):we;if(we=y||we!==0?we:0,W&&Re===Re){for(var je=ae.length;je--;)if(ae[je]===Re)continue e;p&&ae.push(Re),J.push(we)}else M(ae,Re,y)||(ae!==J&&ae.push(Re),J.push(we))}return J}function Yv(d,p){return p=Rs(p,d),d=ZC(d,p),d==null||delete d[ai(_o(p))]}function RC(d,p,y,R){return Eu(d,p,y(Ea(d,p)),R)}function Eh(d,p,y,R){for(var M=d.length,z=R?M:-1;(R?z--:++z<M)&&p(d[z],z,d););return y?wo(d,R?0:z,R?z+1:M):wo(d,R?z+1:0,R?M:z)}function OC(d,p){var y=d;return y instanceof kt&&(y=y.value()),Sv(p,function(R,M){return M.func.apply(M.thisArg,ws([R],M.args))},y)}function Kv(d,p,y){var R=d.length;if(R<2)return R?Es(d[0]):[];for(var M=-1,z=ge(R);++M<R;)for(var W=d[M],J=-1;++J<R;)J!=M&&(z[M]=_u(z[M]||W,d[J],p,y));return Es(Gn(z,1),p,y)}function PC(d,p,y){for(var R=-1,M=d.length,z=p.length,W={};++R<M;){var J=R<z?p[R]:n;y(W,d[R],J)}return W}function Xv(d){return On(d)?d:[]}function Qv(d){return typeof d=="function"?d:Rr}function Rs(d,p){return ut(d)?d:sb(d,p)?[d]:rE(Ut(d))}var P7=St;function Os(d,p,y){var R=d.length;return y=y===n?R:y,!p&&y>=R?d:wo(d,p,y)}var TC=g3||function(d){return qn.clearTimeout(d)};function DC(d,p){if(p)return d.slice();var y=d.length,R=QS?QS(y):new d.constructor(y);return d.copy(R),R}function Jv(d){var p=new d.constructor(d.byteLength);return new dh(p).set(new dh(d)),p}function T7(d,p){var y=p?Jv(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.byteLength)}function D7(d){var p=new d.constructor(d.source,qe.exec(d));return p.lastIndex=d.lastIndex,p}function A7(d){return xu?nn(xu.call(d)):{}}function AC(d,p){var y=p?Jv(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.length)}function $C(d,p){if(d!==p){var y=d!==n,R=d===null,M=d===d,z=Hr(d),W=p!==n,J=p===null,ae=p===p,xe=Hr(p);if(!J&&!xe&&!z&&d>p||z&&W&&ae&&!J&&!xe||R&&W&&ae||!y&&ae||!M)return 1;if(!R&&!z&&!xe&&d<p||xe&&y&&M&&!R&&!z||J&&y&&M||!W&&M||!ae)return-1}return 0}function $7(d,p,y){for(var R=-1,M=d.criteria,z=p.criteria,W=M.length,J=y.length;++R<W;){var ae=$C(M[R],z[R]);if(ae){if(R>=J)return ae;var xe=y[R];return ae*(xe=="desc"?-1:1)}}return d.index-p.index}function kC(d,p,y,R){for(var M=-1,z=d.length,W=y.length,J=-1,ae=p.length,xe=Mn(z-W,0),we=ge(ae+xe),Re=!R;++J<ae;)we[J]=p[J];for(;++M<W;)(Re||M<z)&&(we[y[M]]=d[M]);for(;xe--;)we[J++]=d[M++];return we}function MC(d,p,y,R){for(var M=-1,z=d.length,W=-1,J=y.length,ae=-1,xe=p.length,we=Mn(z-J,0),Re=ge(we+xe),je=!R;++M<we;)Re[M]=d[M];for(var Ye=M;++ae<xe;)Re[Ye+ae]=p[ae];for(;++W<J;)(je||M<z)&&(Re[Ye+y[W]]=d[M++]);return Re}function Sr(d,p){var y=-1,R=d.length;for(p||(p=ge(R));++y<R;)p[y]=d[y];return p}function si(d,p,y,R){var M=!y;y||(y={});for(var z=-1,W=p.length;++z<W;){var J=p[z],ae=R?R(y[J],d[J],J,y,d):n;ae===n&&(ae=d[J]),M?Ni(y,J,ae):wu(y,J,ae)}return y}function k7(d,p){return si(d,ib(d),p)}function M7(d,p){return si(d,GC(d),p)}function Rh(d,p){return function(y,R){var M=ut(y)?jF:n7,z=p?p():{};return M(y,d,Je(R,2),z)}}function Hl(d){return St(function(p,y){var R=-1,M=y.length,z=M>1?y[M-1]:n,W=M>2?y[2]:n;for(z=d.length>3&&typeof z=="function"?(M--,z):n,W&&hr(y[0],y[1],W)&&(z=M<3?n:z,M=1),p=nn(p);++R<M;){var J=y[R];J&&d(p,J,R,z)}return p})}function IC(d,p){return function(y,R){if(y==null)return y;if(!Cr(y))return d(y,R);for(var M=y.length,z=p?M:-1,W=nn(y);(p?z--:++z<M)&&R(W[z],z,W)!==!1;);return y}}function NC(d){return function(p,y,R){for(var M=-1,z=nn(p),W=R(p),J=W.length;J--;){var ae=W[d?J:++M];if(y(z[ae],ae,z)===!1)break}return p}}function I7(d,p,y){var R=p&w,M=Ru(d);function z(){var W=this&&this!==qn&&this instanceof z?M:d;return W.apply(R?y:this,arguments)}return z}function LC(d){return function(p){p=Ut(p);var y=Nl(p)?jo(p):n,R=y?y[0]:p.charAt(0),M=y?Os(y,1).join(""):p.slice(1);return R[d]()+M}}function Wl(d){return function(p){return Sv(IE(ME(p).replace(EF,"")),d,"")}}function Ru(d){return function(){var p=arguments;switch(p.length){case 0:return new d;case 1:return new d(p[0]);case 2:return new d(p[0],p[1]);case 3:return new d(p[0],p[1],p[2]);case 4:return new d(p[0],p[1],p[2],p[3]);case 5:return new d(p[0],p[1],p[2],p[3],p[4]);case 6:return new d(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new d(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var y=Vl(d.prototype),R=d.apply(y,p);return wn(R)?R:y}}function N7(d,p,y){var R=Ru(d);function M(){for(var z=arguments.length,W=ge(z),J=z,ae=Ul(M);J--;)W[J]=arguments[J];var xe=z<3&&W[0]!==ae&&W[z-1]!==ae?[]:_s(W,ae);if(z-=xe.length,z<y)return VC(d,p,Oh,M.placeholder,n,W,xe,n,n,y-z);var we=this&&this!==qn&&this instanceof M?R:d;return zr(we,this,W)}return M}function FC(d){return function(p,y,R){var M=nn(p);if(!Cr(p)){var z=Je(y,3);p=Bn(p),y=function(J){return z(M[J],J,M)}}var W=d(p,y,R);return W>-1?M[z?p[W]:W]:n}}function jC(d){return Fi(function(p){var y=p.length,R=y,M=yo.prototype.thru;for(d&&p.reverse();R--;){var z=p[R];if(typeof z!="function")throw new bo(s);if(M&&!W&&Ah(z)=="wrapper")var W=new yo([],!0)}for(R=W?R:y;++R<y;){z=p[R];var J=Ah(z),ae=J=="wrapper"?rb(z):n;ae&&ab(ae[0])&&ae[1]==(A|S|E|k)&&!ae[4].length&&ae[9]==1?W=W[Ah(ae[0])].apply(W,ae[3]):W=z.length==1&&ab(z)?W[J]():W.thru(z)}return function(){var xe=arguments,we=xe[0];if(W&&xe.length==1&&ut(we))return W.plant(we).value();for(var Re=0,je=y?p[Re].apply(this,xe):we;++Re<y;)je=p[Re].call(this,je);return je}})}function Oh(d,p,y,R,M,z,W,J,ae,xe){var we=p&A,Re=p&w,je=p&x,Ye=p&(S|C),et=p&I,yt=je?n:Ru(d);function tt(){for(var Pt=arguments.length,Mt=ge(Pt),Wr=Pt;Wr--;)Mt[Wr]=arguments[Wr];if(Ye)var pr=Ul(tt),Ur=YF(Mt,pr);if(R&&(Mt=kC(Mt,R,M,Ye)),z&&(Mt=MC(Mt,z,W,Ye)),Pt-=Ur,Ye&&Pt<xe){var Pn=_s(Mt,pr);return VC(d,p,Oh,tt.placeholder,y,Mt,Pn,J,ae,xe-Pt)}var Vo=Re?y:this,Vi=je?Vo[d]:d;return Pt=Mt.length,J?Mt=n6(Mt,J):et&&Pt>1&&Mt.reverse(),we&&ae<Pt&&(Mt.length=ae),this&&this!==qn&&this instanceof tt&&(Vi=yt||Ru(Vi)),Vi.apply(Vo,Mt)}return tt}function zC(d,p){return function(y,R){return u7(y,d,p(R),{})}}function Ph(d,p){return function(y,R){var M;if(y===n&&R===n)return p;if(y!==n&&(M=y),R!==n){if(M===n)return R;typeof y=="string"||typeof R=="string"?(y=Vr(y),R=Vr(R)):(y=EC(y),R=EC(R)),M=d(y,R)}return M}}function Zv(d){return Fi(function(p){return p=yn(p,Br(Je())),St(function(y){var R=this;return d(p,function(M){return zr(M,R,y)})})})}function Th(d,p){p=p===n?" ":Vr(p);var y=p.length;if(y<2)return y?qv(p,d):p;var R=qv(p,gh(d/Ll(p)));return Nl(p)?Os(jo(R),0,d).join(""):R.slice(0,d)}function L7(d,p,y,R){var M=p&w,z=Ru(d);function W(){for(var J=-1,ae=arguments.length,xe=-1,we=R.length,Re=ge(we+ae),je=this&&this!==qn&&this instanceof W?z:d;++xe<we;)Re[xe]=R[xe];for(;ae--;)Re[xe++]=arguments[++J];return zr(je,M?y:this,Re)}return W}function BC(d){return function(p,y,R){return R&&typeof R!="number"&&hr(p,y,R)&&(y=R=n),p=Bi(p),y===n?(y=p,p=0):y=Bi(y),R=R===n?p<y?1:-1:Bi(R),_7(p,y,R,d)}}function Dh(d){return function(p,y){return typeof p=="string"&&typeof y=="string"||(p=So(p),y=So(y)),d(p,y)}}function VC(d,p,y,R,M,z,W,J,ae,xe){var we=p&S,Re=we?W:n,je=we?n:W,Ye=we?z:n,et=we?n:z;p|=we?E:P,p&=~(we?P:E),p&_||(p&=~(w|x));var yt=[d,p,M,Ye,Re,et,je,J,ae,xe],tt=y.apply(n,yt);return ab(d)&&eE(tt,yt),tt.placeholder=R,tE(tt,d,p)}function eb(d){var p=kn[d];return function(y,R){if(y=So(y),R=R==null?0:nr(pt(R),292),R&&tC(y)){var M=(Ut(y)+"e").split("e"),z=p(M[0]+"e"+(+M[1]+R));return M=(Ut(z)+"e").split("e"),+(M[0]+"e"+(+M[1]-R))}return p(y)}}var F7=zl&&1/ih(new zl([,-0]))[1]==G?function(d){return new zl(d)}:_b;function HC(d){return function(p){var y=rr(p);return y==_e?Dv(p):y==lt?t3(p):GF(p,d(p))}}function Li(d,p,y,R,M,z,W,J){var ae=p&x;if(!ae&&typeof d!="function")throw new bo(s);var xe=R?R.length:0;if(xe||(p&=~(E|P),R=M=n),W=W===n?W:Mn(pt(W),0),J=J===n?J:pt(J),xe-=M?M.length:0,p&P){var we=R,Re=M;R=M=n}var je=ae?n:rb(d),Ye=[d,p,y,R,M,we,Re,z,W,J];if(je&&Z7(Ye,je),d=Ye[0],p=Ye[1],y=Ye[2],R=Ye[3],M=Ye[4],J=Ye[9]=Ye[9]===n?ae?0:d.length:Mn(Ye[9]-xe,0),!J&&p&(S|C)&&(p&=~(S|C)),!p||p==w)var et=I7(d,p,y);else p==S||p==C?et=N7(d,p,J):(p==E||p==(w|E))&&!M.length?et=L7(d,p,y,R):et=Oh.apply(n,Ye);var yt=je?SC:eE;return tE(yt(et,Ye),d,p)}function WC(d,p,y,R){return d===n||Bo(d,jl[y])&&!Qt.call(R,y)?p:d}function UC(d,p,y,R,M,z){return wn(d)&&wn(p)&&(z.set(p,d),Sh(d,p,n,UC,z),z.delete(p)),d}function j7(d){return Tu(d)?n:d}function qC(d,p,y,R,M,z){var W=y&v,J=d.length,ae=p.length;if(J!=ae&&!(W&&ae>J))return!1;var xe=z.get(d),we=z.get(p);if(xe&&we)return xe==p&&we==d;var Re=-1,je=!0,Ye=y&b?new Sa:n;for(z.set(d,p),z.set(p,d);++Re<J;){var et=d[Re],yt=p[Re];if(R)var tt=W?R(yt,et,Re,p,d,z):R(et,yt,Re,d,p,z);if(tt!==n){if(tt)continue;je=!1;break}if(Ye){if(!Cv(p,function(Pt,Mt){if(!gu(Ye,Mt)&&(et===Pt||M(et,Pt,y,R,z)))return Ye.push(Mt)})){je=!1;break}}else if(!(et===yt||M(et,yt,y,R,z))){je=!1;break}}return z.delete(d),z.delete(p),je}function z7(d,p,y,R,M,z,W){switch(y){case Ge:if(d.byteLength!=p.byteLength||d.byteOffset!=p.byteOffset)return!1;d=d.buffer,p=p.buffer;case Le:return!(d.byteLength!=p.byteLength||!z(new dh(d),new dh(p)));case se:case ne:case Pe:return Bo(+d,+p);case ye:return d.name==p.name&&d.message==p.message;case Ke:case It:return d==p+"";case _e:var J=Dv;case lt:var ae=R&v;if(J||(J=ih),d.size!=p.size&&!ae)return!1;var xe=W.get(d);if(xe)return xe==p;R|=b,W.set(d,p);var we=qC(J(d),J(p),R,M,z,W);return W.delete(d),we;case At:if(xu)return xu.call(d)==xu.call(p)}return!1}function B7(d,p,y,R,M,z){var W=y&v,J=tb(d),ae=J.length,xe=tb(p),we=xe.length;if(ae!=we&&!W)return!1;for(var Re=ae;Re--;){var je=J[Re];if(!(W?je in p:Qt.call(p,je)))return!1}var Ye=z.get(d),et=z.get(p);if(Ye&&et)return Ye==p&&et==d;var yt=!0;z.set(d,p),z.set(p,d);for(var tt=W;++Re<ae;){je=J[Re];var Pt=d[je],Mt=p[je];if(R)var Wr=W?R(Mt,Pt,je,p,d,z):R(Pt,Mt,je,d,p,z);if(!(Wr===n?Pt===Mt||M(Pt,Mt,y,R,z):Wr)){yt=!1;break}tt||(tt=je=="constructor")}if(yt&&!tt){var pr=d.constructor,Ur=p.constructor;pr!=Ur&&"constructor"in d&&"constructor"in p&&!(typeof pr=="function"&&pr instanceof pr&&typeof Ur=="function"&&Ur instanceof Ur)&&(yt=!1)}return z.delete(d),z.delete(p),yt}function Fi(d){return cb(JC(d,n,aE),d+"")}function tb(d){return fC(d,Bn,ib)}function nb(d){return fC(d,Er,GC)}var rb=vh?function(d){return vh.get(d)}:_b;function Ah(d){for(var p=d.name+"",y=Bl[p],R=Qt.call(Bl,p)?y.length:0;R--;){var M=y[R],z=M.func;if(z==null||z==d)return M.name}return p}function Ul(d){var p=Qt.call(F,"placeholder")?F:d;return p.placeholder}function Je(){var d=F.iteratee||xb;return d=d===xb?gC:d,arguments.length?d(arguments[0],arguments[1]):d}function $h(d,p){var y=d.__data__;return K7(p)?y[typeof p=="string"?"string":"hash"]:y.map}function ob(d){for(var p=Bn(d),y=p.length;y--;){var R=p[y],M=d[R];p[y]=[R,M,XC(M)]}return p}function Ra(d,p){var y=JF(d,p);return pC(y)?y:n}function V7(d){var p=Qt.call(d,wa),y=d[wa];try{d[wa]=n;var R=!0}catch{}var M=ch.call(d);return R&&(p?d[wa]=y:delete d[wa]),M}var ib=$v?function(d){return d==null?[]:(d=nn(d),xs($v(d),function(p){return ZS.call(d,p)}))}:Sb,GC=$v?function(d){for(var p=[];d;)ws(p,ib(d)),d=fh(d);return p}:Sb,rr=fr;(kv&&rr(new kv(new ArrayBuffer(1)))!=Ge||vu&&rr(new vu)!=_e||Mv&&rr(Mv.resolve())!=Be||zl&&rr(new zl)!=lt||bu&&rr(new bu)!=de)&&(rr=function(d){var p=fr(d),y=p==Ue?d.constructor:n,R=y?Oa(y):"";if(R)switch(R){case C3:return Ge;case E3:return _e;case R3:return Be;case O3:return lt;case P3:return de}return p});function H7(d,p,y){for(var R=-1,M=y.length;++R<M;){var z=y[R],W=z.size;switch(z.type){case"drop":d+=W;break;case"dropRight":p-=W;break;case"take":p=nr(p,d+W);break;case"takeRight":d=Mn(d,p-W);break}}return{start:d,end:p}}function W7(d){var p=d.match(ys);return p?p[1].split(D):[]}function YC(d,p,y){p=Rs(p,d);for(var R=-1,M=p.length,z=!1;++R<M;){var W=ai(p[R]);if(!(z=d!=null&&y(d,W)))break;d=d[W]}return z||++R!=M?z:(M=d==null?0:d.length,!!M&&jh(M)&&ji(W,M)&&(ut(d)||Pa(d)))}function U7(d){var p=d.length,y=new d.constructor(p);return p&&typeof d[0]=="string"&&Qt.call(d,"index")&&(y.index=d.index,y.input=d.input),y}function KC(d){return typeof d.constructor=="function"&&!Ou(d)?Vl(fh(d)):{}}function q7(d,p,y){var R=d.constructor;switch(p){case Le:return Jv(d);case se:case ne:return new R(+d);case Ge:return T7(d,y);case Ze:case Wt:case Zt:case Kt:case vn:case ln:case Lt:case tn:case xn:return AC(d,y);case _e:return new R;case Pe:case It:return new R(d);case Ke:return D7(d);case lt:return new R;case At:return A7(d)}}function G7(d,p){var y=p.length;if(!y)return d;var R=y-1;return p[R]=(y>1?"& ":"")+p[R],p=p.join(y>2?", ":" "),d.replace(bs,`{
|
|
69
|
+
*/pg.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",f=1,h=2,g=4,v=1,b=2,w=1,x=2,_=4,S=8,C=16,E=32,P=64,A=128,k=256,I=512,$=30,L="...",j=800,Q=16,ee=1,B=2,Z=3,G=1/0,q=9007199254740991,K=17976931348623157e292,T=NaN,V=4294967295,X=V-1,N=V>>>1,ie=[["ary",A],["bind",w],["bindKey",x],["curry",S],["curryRight",C],["flip",I],["partial",E],["partialRight",P],["rearg",k]],fe="[object Arguments]",ue="[object Array]",pe="[object AsyncFunction]",se="[object Boolean]",ne="[object Date]",le="[object DOMException]",ye="[object Error]",Y="[object Function]",be="[object GeneratorFunction]",_e="[object Map]",Pe="[object Number]",Te="[object Null]",Ue="[object Object]",Be="[object Promise]",Ie="[object Proxy]",Ke="[object RegExp]",lt="[object Set]",It="[object String]",At="[object Symbol]",Ht="[object Undefined]",de="[object WeakMap]",Ee="[object WeakSet]",Le="[object ArrayBuffer]",Ge="[object DataView]",Ze="[object Float32Array]",Wt="[object Float64Array]",Zt="[object Int8Array]",Kt="[object Int16Array]",vn="[object Int32Array]",ln="[object Uint8Array]",Lt="[object Uint8ClampedArray]",tn="[object Uint16Array]",xn="[object Uint32Array]",nt=/\b__p \+= '';/g,ht=/\b(__p \+=) '' \+/g,$t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xt=/&(?:amp|lt|gt|quot|#39);/g,bt=/[&<>"']/g,Rn=RegExp(Xt.source),Lo=RegExp(bt.source),ms=/<%-([\s\S]+?)%>/g,Fo=/<%([\s\S]+?)%>/g,Ai=/<%=([\s\S]+?)%>/g,ni=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$i=/^\w*$/,vs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ri=/[\\^$.*+?()[\]{}|]/g,ki=RegExp(ri.source),jn=/^\s+/,oi=/\s/,bs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ys=/\{\n\/\* \[wrapped with (.+)\] \*/,D=/,? & /,te=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,Oe=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qe=/\w*$/,ze=/^[-+]0x[0-9a-f]+$/i,Fe=/^0b[01]+$/i,Ae=/^\[object .+?Constructor\]$/,U=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,$e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,st=/($^)/,bn=/['\n\r\u2028\u2029\\]/g,ft="\\ud800-\\udfff",tr="\\u0300-\\u036f",go="\\ufe20-\\ufe2f",ya="\\u20d0-\\u20ff",zn=tr+go+ya,hu="\\u2700-\\u27bf",pu="a-z\\xdf-\\xf6\\xf8-\\xff",fF="\\xac\\xb1\\xd7\\xf7",hF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",pF="\\u2000-\\u206f",gF=" \\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",vS="A-Z\\xc0-\\xd6\\xd8-\\xde",bS="\\ufe0e\\ufe0f",yS=fF+hF+pF+gF,gv="['’]",mF="["+ft+"]",xS="["+yS+"]",nh="["+zn+"]",wS="\\d+",vF="["+hu+"]",_S="["+pu+"]",SS="[^"+ft+yS+wS+hu+pu+vS+"]",mv="\\ud83c[\\udffb-\\udfff]",bF="(?:"+nh+"|"+mv+")",CS="[^"+ft+"]",vv="(?:\\ud83c[\\udde6-\\uddff]){2}",bv="[\\ud800-\\udbff][\\udc00-\\udfff]",Ml="["+vS+"]",ES="\\u200d",RS="(?:"+_S+"|"+SS+")",yF="(?:"+Ml+"|"+SS+")",OS="(?:"+gv+"(?:d|ll|m|re|s|t|ve))?",PS="(?:"+gv+"(?:D|LL|M|RE|S|T|VE))?",TS=bF+"?",DS="["+bS+"]?",xF="(?:"+ES+"(?:"+[CS,vv,bv].join("|")+")"+DS+TS+")*",wF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_F="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",AS=DS+TS+xF,SF="(?:"+[vF,vv,bv].join("|")+")"+AS,CF="(?:"+[CS+nh+"?",nh,vv,bv,mF].join("|")+")",EF=RegExp(gv,"g"),RF=RegExp(nh,"g"),yv=RegExp(mv+"(?="+mv+")|"+CF+AS,"g"),OF=RegExp([Ml+"?"+_S+"+"+OS+"(?="+[xS,Ml,"$"].join("|")+")",yF+"+"+PS+"(?="+[xS,Ml+RS,"$"].join("|")+")",Ml+"?"+RS+"+"+OS,Ml+"+"+PS,_F,wF,wS,SF].join("|"),"g"),PF=RegExp("["+ES+ft+zn+bS+"]"),TF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,DF=["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"],AF=-1,cn={};cn[Ze]=cn[Wt]=cn[Zt]=cn[Kt]=cn[vn]=cn[ln]=cn[Lt]=cn[tn]=cn[xn]=!0,cn[fe]=cn[ue]=cn[Le]=cn[se]=cn[Ge]=cn[ne]=cn[ye]=cn[Y]=cn[_e]=cn[Pe]=cn[Ue]=cn[Ke]=cn[lt]=cn[It]=cn[de]=!1;var rn={};rn[fe]=rn[ue]=rn[Le]=rn[Ge]=rn[se]=rn[ne]=rn[Ze]=rn[Wt]=rn[Zt]=rn[Kt]=rn[vn]=rn[_e]=rn[Pe]=rn[Ue]=rn[Ke]=rn[lt]=rn[It]=rn[At]=rn[ln]=rn[Lt]=rn[tn]=rn[xn]=!0,rn[ye]=rn[Y]=rn[de]=!1;var $F={À:"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"},kF={"&":"&","<":"<",">":">",'"':""","'":"'"},MF={"&":"&","<":"<",">":">",""":'"',"'":"'"},IF={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},NF=parseFloat,LF=parseInt,$S=typeof Vs=="object"&&Vs&&Vs.Object===Object&&Vs,FF=typeof self=="object"&&self&&self.Object===Object&&self,qn=$S||FF||Function("return this")(),xv=t&&!t.nodeType&&t,xa=xv&&!0&&e&&!e.nodeType&&e,kS=xa&&xa.exports===xv,wv=kS&&$S.process,mo=function(){try{var re=xa&&xa.require&&xa.require("util").types;return re||wv&&wv.binding&&wv.binding("util")}catch{}}(),MS=mo&&mo.isArrayBuffer,IS=mo&&mo.isDate,NS=mo&&mo.isMap,LS=mo&&mo.isRegExp,FS=mo&&mo.isSet,jS=mo&&mo.isTypedArray;function zr(re,ve,ge){switch(ge.length){case 0:return re.call(ve);case 1:return re.call(ve,ge[0]);case 2:return re.call(ve,ge[0],ge[1]);case 3:return re.call(ve,ge[0],ge[1],ge[2])}return re.apply(ve,ge)}function jF(re,ve,ge,We){for(var ct=-1,jt=re==null?0:re.length;++ct<jt;){var kn=re[ct];ve(We,kn,ge(kn),re)}return We}function vo(re,ve){for(var ge=-1,We=re==null?0:re.length;++ge<We&&ve(re[ge],ge,re)!==!1;);return re}function zF(re,ve){for(var ge=re==null?0:re.length;ge--&&ve(re[ge],ge,re)!==!1;);return re}function zS(re,ve){for(var ge=-1,We=re==null?0:re.length;++ge<We;)if(!ve(re[ge],ge,re))return!1;return!0}function xs(re,ve){for(var ge=-1,We=re==null?0:re.length,ct=0,jt=[];++ge<We;){var kn=re[ge];ve(kn,ge,re)&&(jt[ct++]=kn)}return jt}function rh(re,ve){var ge=re==null?0:re.length;return!!ge&&Il(re,ve,0)>-1}function _v(re,ve,ge){for(var We=-1,ct=re==null?0:re.length;++We<ct;)if(ge(ve,re[We]))return!0;return!1}function yn(re,ve){for(var ge=-1,We=re==null?0:re.length,ct=Array(We);++ge<We;)ct[ge]=ve(re[ge],ge,re);return ct}function ws(re,ve){for(var ge=-1,We=ve.length,ct=re.length;++ge<We;)re[ct+ge]=ve[ge];return re}function Sv(re,ve,ge,We){var ct=-1,jt=re==null?0:re.length;for(We&&jt&&(ge=re[++ct]);++ct<jt;)ge=ve(ge,re[ct],ct,re);return ge}function BF(re,ve,ge,We){var ct=re==null?0:re.length;for(We&&ct&&(ge=re[--ct]);ct--;)ge=ve(ge,re[ct],ct,re);return ge}function Cv(re,ve){for(var ge=-1,We=re==null?0:re.length;++ge<We;)if(ve(re[ge],ge,re))return!0;return!1}var VF=Ev("length");function HF(re){return re.split("")}function WF(re){return re.match(te)||[]}function BS(re,ve,ge){var We;return ge(re,function(ct,jt,kn){if(ve(ct,jt,kn))return We=jt,!1}),We}function oh(re,ve,ge,We){for(var ct=re.length,jt=ge+(We?1:-1);We?jt--:++jt<ct;)if(ve(re[jt],jt,re))return jt;return-1}function Il(re,ve,ge){return ve===ve?n3(re,ve,ge):oh(re,VS,ge)}function UF(re,ve,ge,We){for(var ct=ge-1,jt=re.length;++ct<jt;)if(We(re[ct],ve))return ct;return-1}function VS(re){return re!==re}function HS(re,ve){var ge=re==null?0:re.length;return ge?Ov(re,ve)/ge:T}function Ev(re){return function(ve){return ve==null?n:ve[re]}}function Rv(re){return function(ve){return re==null?n:re[ve]}}function WS(re,ve,ge,We,ct){return ct(re,function(jt,kn,nn){ge=We?(We=!1,jt):ve(ge,jt,kn,nn)}),ge}function qF(re,ve){var ge=re.length;for(re.sort(ve);ge--;)re[ge]=re[ge].value;return re}function Ov(re,ve){for(var ge,We=-1,ct=re.length;++We<ct;){var jt=ve(re[We]);jt!==n&&(ge=ge===n?jt:ge+jt)}return ge}function Pv(re,ve){for(var ge=-1,We=Array(re);++ge<re;)We[ge]=ve(ge);return We}function GF(re,ve){return yn(ve,function(ge){return[ge,re[ge]]})}function US(re){return re&&re.slice(0,KS(re)+1).replace(jn,"")}function Br(re){return function(ve){return re(ve)}}function Tv(re,ve){return yn(ve,function(ge){return re[ge]})}function gu(re,ve){return re.has(ve)}function qS(re,ve){for(var ge=-1,We=re.length;++ge<We&&Il(ve,re[ge],0)>-1;);return ge}function GS(re,ve){for(var ge=re.length;ge--&&Il(ve,re[ge],0)>-1;);return ge}function YF(re,ve){for(var ge=re.length,We=0;ge--;)re[ge]===ve&&++We;return We}var KF=Rv($F),XF=Rv(kF);function QF(re){return"\\"+IF[re]}function JF(re,ve){return re==null?n:re[ve]}function Nl(re){return PF.test(re)}function ZF(re){return TF.test(re)}function e3(re){for(var ve,ge=[];!(ve=re.next()).done;)ge.push(ve.value);return ge}function Dv(re){var ve=-1,ge=Array(re.size);return re.forEach(function(We,ct){ge[++ve]=[ct,We]}),ge}function YS(re,ve){return function(ge){return re(ve(ge))}}function _s(re,ve){for(var ge=-1,We=re.length,ct=0,jt=[];++ge<We;){var kn=re[ge];(kn===ve||kn===u)&&(re[ge]=u,jt[ct++]=ge)}return jt}function ih(re){var ve=-1,ge=Array(re.size);return re.forEach(function(We){ge[++ve]=We}),ge}function t3(re){var ve=-1,ge=Array(re.size);return re.forEach(function(We){ge[++ve]=[We,We]}),ge}function n3(re,ve,ge){for(var We=ge-1,ct=re.length;++We<ct;)if(re[We]===ve)return We;return-1}function r3(re,ve,ge){for(var We=ge+1;We--;)if(re[We]===ve)return We;return We}function Ll(re){return Nl(re)?i3(re):VF(re)}function jo(re){return Nl(re)?s3(re):HF(re)}function KS(re){for(var ve=re.length;ve--&&oi.test(re.charAt(ve)););return ve}var o3=Rv(MF);function i3(re){for(var ve=yv.lastIndex=0;yv.test(re);)++ve;return ve}function s3(re){return re.match(yv)||[]}function a3(re){return re.match(OF)||[]}var l3=function re(ve){ve=ve==null?qn:Fl.defaults(qn.Object(),ve,Fl.pick(qn,DF));var ge=ve.Array,We=ve.Date,ct=ve.Error,jt=ve.Function,kn=ve.Math,nn=ve.Object,Av=ve.RegExp,c3=ve.String,bo=ve.TypeError,sh=ge.prototype,u3=jt.prototype,jl=nn.prototype,ah=ve["__core-js_shared__"],lh=u3.toString,Qt=jl.hasOwnProperty,d3=0,XS=function(){var d=/[^.]+$/.exec(ah&&ah.keys&&ah.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),ch=jl.toString,f3=lh.call(nn),h3=qn._,p3=Av("^"+lh.call(Qt).replace(ri,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uh=kS?ve.Buffer:n,Ss=ve.Symbol,dh=ve.Uint8Array,QS=uh?uh.allocUnsafe:n,fh=YS(nn.getPrototypeOf,nn),JS=nn.create,ZS=jl.propertyIsEnumerable,hh=sh.splice,eC=Ss?Ss.isConcatSpreadable:n,mu=Ss?Ss.iterator:n,wa=Ss?Ss.toStringTag:n,ph=function(){try{var d=Ra(nn,"defineProperty");return d({},"",{}),d}catch{}}(),g3=ve.clearTimeout!==qn.clearTimeout&&ve.clearTimeout,m3=We&&We.now!==qn.Date.now&&We.now,v3=ve.setTimeout!==qn.setTimeout&&ve.setTimeout,gh=kn.ceil,mh=kn.floor,$v=nn.getOwnPropertySymbols,b3=uh?uh.isBuffer:n,tC=ve.isFinite,y3=sh.join,x3=YS(nn.keys,nn),Mn=kn.max,nr=kn.min,w3=We.now,_3=ve.parseInt,nC=kn.random,S3=sh.reverse,kv=Ra(ve,"DataView"),vu=Ra(ve,"Map"),Mv=Ra(ve,"Promise"),zl=Ra(ve,"Set"),bu=Ra(ve,"WeakMap"),yu=Ra(nn,"create"),vh=bu&&new bu,Bl={},C3=Oa(kv),E3=Oa(vu),R3=Oa(Mv),O3=Oa(zl),P3=Oa(bu),bh=Ss?Ss.prototype:n,xu=bh?bh.valueOf:n,rC=bh?bh.toString:n;function F(d){if(Sn(d)&&!ut(d)&&!(d instanceof kt)){if(d instanceof yo)return d;if(Qt.call(d,"__wrapped__"))return oE(d)}return new yo(d)}var Vl=function(){function d(){}return function(p){if(!wn(p))return{};if(JS)return JS(p);d.prototype=p;var y=new d;return d.prototype=n,y}}();function yh(){}function yo(d,p){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=n}F.templateSettings={escape:ms,evaluate:Fo,interpolate:Ai,variable:"",imports:{_:F}},F.prototype=yh.prototype,F.prototype.constructor=F,yo.prototype=Vl(yh.prototype),yo.prototype.constructor=yo;function kt(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=V,this.__views__=[]}function T3(){var d=new kt(this.__wrapped__);return d.__actions__=Sr(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=Sr(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=Sr(this.__views__),d}function D3(){if(this.__filtered__){var d=new kt(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function A3(){var d=this.__wrapped__.value(),p=this.__dir__,y=ut(d),R=p<0,M=y?d.length:0,z=H7(0,M,this.__views__),W=z.start,J=z.end,ae=J-W,xe=R?J:W-1,we=this.__iteratees__,Re=we.length,je=0,Ye=nr(ae,this.__takeCount__);if(!y||!R&&M==ae&&Ye==ae)return OC(d,this.__actions__);var et=[];e:for(;ae--&&je<Ye;){xe+=p;for(var yt=-1,tt=d[xe];++yt<Re;){var Pt=we[yt],Mt=Pt.iteratee,Wr=Pt.type,pr=Mt(tt);if(Wr==B)tt=pr;else if(!pr){if(Wr==ee)continue e;break e}}et[je++]=tt}return et}kt.prototype=Vl(yh.prototype),kt.prototype.constructor=kt;function _a(d){var p=-1,y=d==null?0:d.length;for(this.clear();++p<y;){var R=d[p];this.set(R[0],R[1])}}function $3(){this.__data__=yu?yu(null):{},this.size=0}function k3(d){var p=this.has(d)&&delete this.__data__[d];return this.size-=p?1:0,p}function M3(d){var p=this.__data__;if(yu){var y=p[d];return y===l?n:y}return Qt.call(p,d)?p[d]:n}function I3(d){var p=this.__data__;return yu?p[d]!==n:Qt.call(p,d)}function N3(d,p){var y=this.__data__;return this.size+=this.has(d)?0:1,y[d]=yu&&p===n?l:p,this}_a.prototype.clear=$3,_a.prototype.delete=k3,_a.prototype.get=M3,_a.prototype.has=I3,_a.prototype.set=N3;function Mi(d){var p=-1,y=d==null?0:d.length;for(this.clear();++p<y;){var R=d[p];this.set(R[0],R[1])}}function L3(){this.__data__=[],this.size=0}function F3(d){var p=this.__data__,y=xh(p,d);if(y<0)return!1;var R=p.length-1;return y==R?p.pop():hh.call(p,y,1),--this.size,!0}function j3(d){var p=this.__data__,y=xh(p,d);return y<0?n:p[y][1]}function z3(d){return xh(this.__data__,d)>-1}function B3(d,p){var y=this.__data__,R=xh(y,d);return R<0?(++this.size,y.push([d,p])):y[R][1]=p,this}Mi.prototype.clear=L3,Mi.prototype.delete=F3,Mi.prototype.get=j3,Mi.prototype.has=z3,Mi.prototype.set=B3;function Ii(d){var p=-1,y=d==null?0:d.length;for(this.clear();++p<y;){var R=d[p];this.set(R[0],R[1])}}function V3(){this.size=0,this.__data__={hash:new _a,map:new(vu||Mi),string:new _a}}function H3(d){var p=$h(this,d).delete(d);return this.size-=p?1:0,p}function W3(d){return $h(this,d).get(d)}function U3(d){return $h(this,d).has(d)}function q3(d,p){var y=$h(this,d),R=y.size;return y.set(d,p),this.size+=y.size==R?0:1,this}Ii.prototype.clear=V3,Ii.prototype.delete=H3,Ii.prototype.get=W3,Ii.prototype.has=U3,Ii.prototype.set=q3;function Sa(d){var p=-1,y=d==null?0:d.length;for(this.__data__=new Ii;++p<y;)this.add(d[p])}function G3(d){return this.__data__.set(d,l),this}function Y3(d){return this.__data__.has(d)}Sa.prototype.add=Sa.prototype.push=G3,Sa.prototype.has=Y3;function zo(d){var p=this.__data__=new Mi(d);this.size=p.size}function K3(){this.__data__=new Mi,this.size=0}function X3(d){var p=this.__data__,y=p.delete(d);return this.size=p.size,y}function Q3(d){return this.__data__.get(d)}function J3(d){return this.__data__.has(d)}function Z3(d,p){var y=this.__data__;if(y instanceof Mi){var R=y.__data__;if(!vu||R.length<o-1)return R.push([d,p]),this.size=++y.size,this;y=this.__data__=new Ii(R)}return y.set(d,p),this.size=y.size,this}zo.prototype.clear=K3,zo.prototype.delete=X3,zo.prototype.get=Q3,zo.prototype.has=J3,zo.prototype.set=Z3;function oC(d,p){var y=ut(d),R=!y&&Pa(d),M=!y&&!R&&Ps(d),z=!y&&!R&&!M&&ql(d),W=y||R||M||z,J=W?Pv(d.length,c3):[],ae=J.length;for(var xe in d)(p||Qt.call(d,xe))&&!(W&&(xe=="length"||M&&(xe=="offset"||xe=="parent")||z&&(xe=="buffer"||xe=="byteLength"||xe=="byteOffset")||ji(xe,ae)))&&J.push(xe);return J}function iC(d){var p=d.length;return p?d[Uv(0,p-1)]:n}function e7(d,p){return kh(Sr(d),Ca(p,0,d.length))}function t7(d){return kh(Sr(d))}function Iv(d,p,y){(y!==n&&!Bo(d[p],y)||y===n&&!(p in d))&&Ni(d,p,y)}function wu(d,p,y){var R=d[p];(!(Qt.call(d,p)&&Bo(R,y))||y===n&&!(p in d))&&Ni(d,p,y)}function xh(d,p){for(var y=d.length;y--;)if(Bo(d[y][0],p))return y;return-1}function n7(d,p,y,R){return Cs(d,function(M,z,W){p(R,M,y(M),W)}),R}function sC(d,p){return d&&si(p,Bn(p),d)}function r7(d,p){return d&&si(p,Er(p),d)}function Ni(d,p,y){p=="__proto__"&&ph?ph(d,p,{configurable:!0,enumerable:!0,value:y,writable:!0}):d[p]=y}function Nv(d,p){for(var y=-1,R=p.length,M=ge(R),z=d==null;++y<R;)M[y]=z?n:mb(d,p[y]);return M}function Ca(d,p,y){return d===d&&(y!==n&&(d=d<=y?d:y),p!==n&&(d=d>=p?d:p)),d}function xo(d,p,y,R,M,z){var W,J=p&f,ae=p&h,xe=p&g;if(y&&(W=M?y(d,R,M,z):y(d)),W!==n)return W;if(!wn(d))return d;var we=ut(d);if(we){if(W=U7(d),!J)return Sr(d,W)}else{var Re=rr(d),je=Re==Y||Re==be;if(Ps(d))return DC(d,J);if(Re==Ue||Re==fe||je&&!M){if(W=ae||je?{}:KC(d),!J)return ae?M7(d,r7(W,d)):k7(d,sC(W,d))}else{if(!rn[Re])return M?d:{};W=q7(d,Re,J)}}z||(z=new zo);var Ye=z.get(d);if(Ye)return Ye;z.set(d,W),CE(d)?d.forEach(function(tt){W.add(xo(tt,p,y,tt,d,z))}):_E(d)&&d.forEach(function(tt,Pt){W.set(Pt,xo(tt,p,y,Pt,d,z))});var et=xe?ae?nb:tb:ae?Er:Bn,yt=we?n:et(d);return vo(yt||d,function(tt,Pt){yt&&(Pt=tt,tt=d[Pt]),wu(W,Pt,xo(tt,p,y,Pt,d,z))}),W}function o7(d){var p=Bn(d);return function(y){return aC(y,d,p)}}function aC(d,p,y){var R=y.length;if(d==null)return!R;for(d=nn(d);R--;){var M=y[R],z=p[M],W=d[M];if(W===n&&!(M in d)||!z(W))return!1}return!0}function lC(d,p,y){if(typeof d!="function")throw new bo(s);return Pu(function(){d.apply(n,y)},p)}function _u(d,p,y,R){var M=-1,z=rh,W=!0,J=d.length,ae=[],xe=p.length;if(!J)return ae;y&&(p=yn(p,Br(y))),R?(z=_v,W=!1):p.length>=o&&(z=gu,W=!1,p=new Sa(p));e:for(;++M<J;){var we=d[M],Re=y==null?we:y(we);if(we=R||we!==0?we:0,W&&Re===Re){for(var je=xe;je--;)if(p[je]===Re)continue e;ae.push(we)}else z(p,Re,R)||ae.push(we)}return ae}var Cs=IC(ii),cC=IC(Fv,!0);function i7(d,p){var y=!0;return Cs(d,function(R,M,z){return y=!!p(R,M,z),y}),y}function wh(d,p,y){for(var R=-1,M=d.length;++R<M;){var z=d[R],W=p(z);if(W!=null&&(J===n?W===W&&!Hr(W):y(W,J)))var J=W,ae=z}return ae}function s7(d,p,y,R){var M=d.length;for(y=pt(y),y<0&&(y=-y>M?0:M+y),R=R===n||R>M?M:pt(R),R<0&&(R+=M),R=y>R?0:RE(R);y<R;)d[y++]=p;return d}function uC(d,p){var y=[];return Cs(d,function(R,M,z){p(R,M,z)&&y.push(R)}),y}function Gn(d,p,y,R,M){var z=-1,W=d.length;for(y||(y=Y7),M||(M=[]);++z<W;){var J=d[z];p>0&&y(J)?p>1?Gn(J,p-1,y,R,M):ws(M,J):R||(M[M.length]=J)}return M}var Lv=NC(),dC=NC(!0);function ii(d,p){return d&&Lv(d,p,Bn)}function Fv(d,p){return d&&dC(d,p,Bn)}function _h(d,p){return xs(p,function(y){return zi(d[y])})}function Ea(d,p){p=Rs(p,d);for(var y=0,R=p.length;d!=null&&y<R;)d=d[ai(p[y++])];return y&&y==R?d:n}function fC(d,p,y){var R=p(d);return ut(d)?R:ws(R,y(d))}function fr(d){return d==null?d===n?Ht:Te:wa&&wa in nn(d)?V7(d):t6(d)}function jv(d,p){return d>p}function a7(d,p){return d!=null&&Qt.call(d,p)}function l7(d,p){return d!=null&&p in nn(d)}function c7(d,p,y){return d>=nr(p,y)&&d<Mn(p,y)}function zv(d,p,y){for(var R=y?_v:rh,M=d[0].length,z=d.length,W=z,J=ge(z),ae=1/0,xe=[];W--;){var we=d[W];W&&p&&(we=yn(we,Br(p))),ae=nr(we.length,ae),J[W]=!y&&(p||M>=120&&we.length>=120)?new Sa(W&&we):n}we=d[0];var Re=-1,je=J[0];e:for(;++Re<M&&xe.length<ae;){var Ye=we[Re],et=p?p(Ye):Ye;if(Ye=y||Ye!==0?Ye:0,!(je?gu(je,et):R(xe,et,y))){for(W=z;--W;){var yt=J[W];if(!(yt?gu(yt,et):R(d[W],et,y)))continue e}je&&je.push(et),xe.push(Ye)}}return xe}function u7(d,p,y,R){return ii(d,function(M,z,W){p(R,y(M),z,W)}),R}function Su(d,p,y){p=Rs(p,d),d=ZC(d,p);var R=d==null?d:d[ai(_o(p))];return R==null?n:zr(R,d,y)}function hC(d){return Sn(d)&&fr(d)==fe}function d7(d){return Sn(d)&&fr(d)==Le}function f7(d){return Sn(d)&&fr(d)==ne}function Cu(d,p,y,R,M){return d===p?!0:d==null||p==null||!Sn(d)&&!Sn(p)?d!==d&&p!==p:h7(d,p,y,R,Cu,M)}function h7(d,p,y,R,M,z){var W=ut(d),J=ut(p),ae=W?ue:rr(d),xe=J?ue:rr(p);ae=ae==fe?Ue:ae,xe=xe==fe?Ue:xe;var we=ae==Ue,Re=xe==Ue,je=ae==xe;if(je&&Ps(d)){if(!Ps(p))return!1;W=!0,we=!1}if(je&&!we)return z||(z=new zo),W||ql(d)?qC(d,p,y,R,M,z):z7(d,p,ae,y,R,M,z);if(!(y&v)){var Ye=we&&Qt.call(d,"__wrapped__"),et=Re&&Qt.call(p,"__wrapped__");if(Ye||et){var yt=Ye?d.value():d,tt=et?p.value():p;return z||(z=new zo),M(yt,tt,y,R,z)}}return je?(z||(z=new zo),B7(d,p,y,R,M,z)):!1}function p7(d){return Sn(d)&&rr(d)==_e}function Bv(d,p,y,R){var M=y.length,z=M,W=!R;if(d==null)return!z;for(d=nn(d);M--;){var J=y[M];if(W&&J[2]?J[1]!==d[J[0]]:!(J[0]in d))return!1}for(;++M<z;){J=y[M];var ae=J[0],xe=d[ae],we=J[1];if(W&&J[2]){if(xe===n&&!(ae in d))return!1}else{var Re=new zo;if(R)var je=R(xe,we,ae,d,p,Re);if(!(je===n?Cu(we,xe,v|b,R,Re):je))return!1}}return!0}function pC(d){if(!wn(d)||X7(d))return!1;var p=zi(d)?p3:Ae;return p.test(Oa(d))}function g7(d){return Sn(d)&&fr(d)==Ke}function m7(d){return Sn(d)&&rr(d)==lt}function v7(d){return Sn(d)&&jh(d.length)&&!!cn[fr(d)]}function gC(d){return typeof d=="function"?d:d==null?Rr:typeof d=="object"?ut(d)?bC(d[0],d[1]):vC(d):LE(d)}function Vv(d){if(!Ou(d))return x3(d);var p=[];for(var y in nn(d))Qt.call(d,y)&&y!="constructor"&&p.push(y);return p}function b7(d){if(!wn(d))return e6(d);var p=Ou(d),y=[];for(var R in d)R=="constructor"&&(p||!Qt.call(d,R))||y.push(R);return y}function Hv(d,p){return d<p}function mC(d,p){var y=-1,R=Cr(d)?ge(d.length):[];return Cs(d,function(M,z,W){R[++y]=p(M,z,W)}),R}function vC(d){var p=ob(d);return p.length==1&&p[0][2]?QC(p[0][0],p[0][1]):function(y){return y===d||Bv(y,d,p)}}function bC(d,p){return sb(d)&&XC(p)?QC(ai(d),p):function(y){var R=mb(y,d);return R===n&&R===p?vb(y,d):Cu(p,R,v|b)}}function Sh(d,p,y,R,M){d!==p&&Lv(p,function(z,W){if(M||(M=new zo),wn(z))y7(d,p,W,y,Sh,R,M);else{var J=R?R(lb(d,W),z,W+"",d,p,M):n;J===n&&(J=z),Iv(d,W,J)}},Er)}function y7(d,p,y,R,M,z,W){var J=lb(d,y),ae=lb(p,y),xe=W.get(ae);if(xe){Iv(d,y,xe);return}var we=z?z(J,ae,y+"",d,p,W):n,Re=we===n;if(Re){var je=ut(ae),Ye=!je&&Ps(ae),et=!je&&!Ye&&ql(ae);we=ae,je||Ye||et?ut(J)?we=J:On(J)?we=Sr(J):Ye?(Re=!1,we=DC(ae,!0)):et?(Re=!1,we=AC(ae,!0)):we=[]:Tu(ae)||Pa(ae)?(we=J,Pa(J)?we=OE(J):(!wn(J)||zi(J))&&(we=KC(ae))):Re=!1}Re&&(W.set(ae,we),M(we,ae,R,z,W),W.delete(ae)),Iv(d,y,we)}function yC(d,p){var y=d.length;if(y)return p+=p<0?y:0,ji(p,y)?d[p]:n}function xC(d,p,y){p.length?p=yn(p,function(z){return ut(z)?function(W){return Ea(W,z.length===1?z[0]:z)}:z}):p=[Rr];var R=-1;p=yn(p,Br(Je()));var M=mC(d,function(z,W,J){var ae=yn(p,function(xe){return xe(z)});return{criteria:ae,index:++R,value:z}});return qF(M,function(z,W){return $7(z,W,y)})}function x7(d,p){return wC(d,p,function(y,R){return vb(d,R)})}function wC(d,p,y){for(var R=-1,M=p.length,z={};++R<M;){var W=p[R],J=Ea(d,W);y(J,W)&&Eu(z,Rs(W,d),J)}return z}function w7(d){return function(p){return Ea(p,d)}}function Wv(d,p,y,R){var M=R?UF:Il,z=-1,W=p.length,J=d;for(d===p&&(p=Sr(p)),y&&(J=yn(d,Br(y)));++z<W;)for(var ae=0,xe=p[z],we=y?y(xe):xe;(ae=M(J,we,ae,R))>-1;)J!==d&&hh.call(J,ae,1),hh.call(d,ae,1);return d}function _C(d,p){for(var y=d?p.length:0,R=y-1;y--;){var M=p[y];if(y==R||M!==z){var z=M;ji(M)?hh.call(d,M,1):Yv(d,M)}}return d}function Uv(d,p){return d+mh(nC()*(p-d+1))}function _7(d,p,y,R){for(var M=-1,z=Mn(gh((p-d)/(y||1)),0),W=ge(z);z--;)W[R?z:++M]=d,d+=y;return W}function qv(d,p){var y="";if(!d||p<1||p>q)return y;do p%2&&(y+=d),p=mh(p/2),p&&(d+=d);while(p);return y}function St(d,p){return cb(JC(d,p,Rr),d+"")}function S7(d){return iC(Gl(d))}function C7(d,p){var y=Gl(d);return kh(y,Ca(p,0,y.length))}function Eu(d,p,y,R){if(!wn(d))return d;p=Rs(p,d);for(var M=-1,z=p.length,W=z-1,J=d;J!=null&&++M<z;){var ae=ai(p[M]),xe=y;if(ae==="__proto__"||ae==="constructor"||ae==="prototype")return d;if(M!=W){var we=J[ae];xe=R?R(we,ae,J):n,xe===n&&(xe=wn(we)?we:ji(p[M+1])?[]:{})}wu(J,ae,xe),J=J[ae]}return d}var SC=vh?function(d,p){return vh.set(d,p),d}:Rr,E7=ph?function(d,p){return ph(d,"toString",{configurable:!0,enumerable:!1,value:yb(p),writable:!0})}:Rr;function R7(d){return kh(Gl(d))}function wo(d,p,y){var R=-1,M=d.length;p<0&&(p=-p>M?0:M+p),y=y>M?M:y,y<0&&(y+=M),M=p>y?0:y-p>>>0,p>>>=0;for(var z=ge(M);++R<M;)z[R]=d[R+p];return z}function O7(d,p){var y;return Cs(d,function(R,M,z){return y=p(R,M,z),!y}),!!y}function Ch(d,p,y){var R=0,M=d==null?R:d.length;if(typeof p=="number"&&p===p&&M<=N){for(;R<M;){var z=R+M>>>1,W=d[z];W!==null&&!Hr(W)&&(y?W<=p:W<p)?R=z+1:M=z}return M}return Gv(d,p,Rr,y)}function Gv(d,p,y,R){var M=0,z=d==null?0:d.length;if(z===0)return 0;p=y(p);for(var W=p!==p,J=p===null,ae=Hr(p),xe=p===n;M<z;){var we=mh((M+z)/2),Re=y(d[we]),je=Re!==n,Ye=Re===null,et=Re===Re,yt=Hr(Re);if(W)var tt=R||et;else xe?tt=et&&(R||je):J?tt=et&&je&&(R||!Ye):ae?tt=et&&je&&!Ye&&(R||!yt):Ye||yt?tt=!1:tt=R?Re<=p:Re<p;tt?M=we+1:z=we}return nr(z,X)}function CC(d,p){for(var y=-1,R=d.length,M=0,z=[];++y<R;){var W=d[y],J=p?p(W):W;if(!y||!Bo(J,ae)){var ae=J;z[M++]=W===0?0:W}}return z}function EC(d){return typeof d=="number"?d:Hr(d)?T:+d}function Vr(d){if(typeof d=="string")return d;if(ut(d))return yn(d,Vr)+"";if(Hr(d))return rC?rC.call(d):"";var p=d+"";return p=="0"&&1/d==-G?"-0":p}function Es(d,p,y){var R=-1,M=rh,z=d.length,W=!0,J=[],ae=J;if(y)W=!1,M=_v;else if(z>=o){var xe=p?null:F7(d);if(xe)return ih(xe);W=!1,M=gu,ae=new Sa}else ae=p?[]:J;e:for(;++R<z;){var we=d[R],Re=p?p(we):we;if(we=y||we!==0?we:0,W&&Re===Re){for(var je=ae.length;je--;)if(ae[je]===Re)continue e;p&&ae.push(Re),J.push(we)}else M(ae,Re,y)||(ae!==J&&ae.push(Re),J.push(we))}return J}function Yv(d,p){return p=Rs(p,d),d=ZC(d,p),d==null||delete d[ai(_o(p))]}function RC(d,p,y,R){return Eu(d,p,y(Ea(d,p)),R)}function Eh(d,p,y,R){for(var M=d.length,z=R?M:-1;(R?z--:++z<M)&&p(d[z],z,d););return y?wo(d,R?0:z,R?z+1:M):wo(d,R?z+1:0,R?M:z)}function OC(d,p){var y=d;return y instanceof kt&&(y=y.value()),Sv(p,function(R,M){return M.func.apply(M.thisArg,ws([R],M.args))},y)}function Kv(d,p,y){var R=d.length;if(R<2)return R?Es(d[0]):[];for(var M=-1,z=ge(R);++M<R;)for(var W=d[M],J=-1;++J<R;)J!=M&&(z[M]=_u(z[M]||W,d[J],p,y));return Es(Gn(z,1),p,y)}function PC(d,p,y){for(var R=-1,M=d.length,z=p.length,W={};++R<M;){var J=R<z?p[R]:n;y(W,d[R],J)}return W}function Xv(d){return On(d)?d:[]}function Qv(d){return typeof d=="function"?d:Rr}function Rs(d,p){return ut(d)?d:sb(d,p)?[d]:rE(Ut(d))}var P7=St;function Os(d,p,y){var R=d.length;return y=y===n?R:y,!p&&y>=R?d:wo(d,p,y)}var TC=g3||function(d){return qn.clearTimeout(d)};function DC(d,p){if(p)return d.slice();var y=d.length,R=QS?QS(y):new d.constructor(y);return d.copy(R),R}function Jv(d){var p=new d.constructor(d.byteLength);return new dh(p).set(new dh(d)),p}function T7(d,p){var y=p?Jv(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.byteLength)}function D7(d){var p=new d.constructor(d.source,qe.exec(d));return p.lastIndex=d.lastIndex,p}function A7(d){return xu?nn(xu.call(d)):{}}function AC(d,p){var y=p?Jv(d.buffer):d.buffer;return new d.constructor(y,d.byteOffset,d.length)}function $C(d,p){if(d!==p){var y=d!==n,R=d===null,M=d===d,z=Hr(d),W=p!==n,J=p===null,ae=p===p,xe=Hr(p);if(!J&&!xe&&!z&&d>p||z&&W&&ae&&!J&&!xe||R&&W&&ae||!y&&ae||!M)return 1;if(!R&&!z&&!xe&&d<p||xe&&y&&M&&!R&&!z||J&&y&&M||!W&&M||!ae)return-1}return 0}function $7(d,p,y){for(var R=-1,M=d.criteria,z=p.criteria,W=M.length,J=y.length;++R<W;){var ae=$C(M[R],z[R]);if(ae){if(R>=J)return ae;var xe=y[R];return ae*(xe=="desc"?-1:1)}}return d.index-p.index}function kC(d,p,y,R){for(var M=-1,z=d.length,W=y.length,J=-1,ae=p.length,xe=Mn(z-W,0),we=ge(ae+xe),Re=!R;++J<ae;)we[J]=p[J];for(;++M<W;)(Re||M<z)&&(we[y[M]]=d[M]);for(;xe--;)we[J++]=d[M++];return we}function MC(d,p,y,R){for(var M=-1,z=d.length,W=-1,J=y.length,ae=-1,xe=p.length,we=Mn(z-J,0),Re=ge(we+xe),je=!R;++M<we;)Re[M]=d[M];for(var Ye=M;++ae<xe;)Re[Ye+ae]=p[ae];for(;++W<J;)(je||M<z)&&(Re[Ye+y[W]]=d[M++]);return Re}function Sr(d,p){var y=-1,R=d.length;for(p||(p=ge(R));++y<R;)p[y]=d[y];return p}function si(d,p,y,R){var M=!y;y||(y={});for(var z=-1,W=p.length;++z<W;){var J=p[z],ae=R?R(y[J],d[J],J,y,d):n;ae===n&&(ae=d[J]),M?Ni(y,J,ae):wu(y,J,ae)}return y}function k7(d,p){return si(d,ib(d),p)}function M7(d,p){return si(d,GC(d),p)}function Rh(d,p){return function(y,R){var M=ut(y)?jF:n7,z=p?p():{};return M(y,d,Je(R,2),z)}}function Hl(d){return St(function(p,y){var R=-1,M=y.length,z=M>1?y[M-1]:n,W=M>2?y[2]:n;for(z=d.length>3&&typeof z=="function"?(M--,z):n,W&&hr(y[0],y[1],W)&&(z=M<3?n:z,M=1),p=nn(p);++R<M;){var J=y[R];J&&d(p,J,R,z)}return p})}function IC(d,p){return function(y,R){if(y==null)return y;if(!Cr(y))return d(y,R);for(var M=y.length,z=p?M:-1,W=nn(y);(p?z--:++z<M)&&R(W[z],z,W)!==!1;);return y}}function NC(d){return function(p,y,R){for(var M=-1,z=nn(p),W=R(p),J=W.length;J--;){var ae=W[d?J:++M];if(y(z[ae],ae,z)===!1)break}return p}}function I7(d,p,y){var R=p&w,M=Ru(d);function z(){var W=this&&this!==qn&&this instanceof z?M:d;return W.apply(R?y:this,arguments)}return z}function LC(d){return function(p){p=Ut(p);var y=Nl(p)?jo(p):n,R=y?y[0]:p.charAt(0),M=y?Os(y,1).join(""):p.slice(1);return R[d]()+M}}function Wl(d){return function(p){return Sv(IE(ME(p).replace(EF,"")),d,"")}}function Ru(d){return function(){var p=arguments;switch(p.length){case 0:return new d;case 1:return new d(p[0]);case 2:return new d(p[0],p[1]);case 3:return new d(p[0],p[1],p[2]);case 4:return new d(p[0],p[1],p[2],p[3]);case 5:return new d(p[0],p[1],p[2],p[3],p[4]);case 6:return new d(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new d(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var y=Vl(d.prototype),R=d.apply(y,p);return wn(R)?R:y}}function N7(d,p,y){var R=Ru(d);function M(){for(var z=arguments.length,W=ge(z),J=z,ae=Ul(M);J--;)W[J]=arguments[J];var xe=z<3&&W[0]!==ae&&W[z-1]!==ae?[]:_s(W,ae);if(z-=xe.length,z<y)return VC(d,p,Oh,M.placeholder,n,W,xe,n,n,y-z);var we=this&&this!==qn&&this instanceof M?R:d;return zr(we,this,W)}return M}function FC(d){return function(p,y,R){var M=nn(p);if(!Cr(p)){var z=Je(y,3);p=Bn(p),y=function(J){return z(M[J],J,M)}}var W=d(p,y,R);return W>-1?M[z?p[W]:W]:n}}function jC(d){return Fi(function(p){var y=p.length,R=y,M=yo.prototype.thru;for(d&&p.reverse();R--;){var z=p[R];if(typeof z!="function")throw new bo(s);if(M&&!W&&Ah(z)=="wrapper")var W=new yo([],!0)}for(R=W?R:y;++R<y;){z=p[R];var J=Ah(z),ae=J=="wrapper"?rb(z):n;ae&&ab(ae[0])&&ae[1]==(A|S|E|k)&&!ae[4].length&&ae[9]==1?W=W[Ah(ae[0])].apply(W,ae[3]):W=z.length==1&&ab(z)?W[J]():W.thru(z)}return function(){var xe=arguments,we=xe[0];if(W&&xe.length==1&&ut(we))return W.plant(we).value();for(var Re=0,je=y?p[Re].apply(this,xe):we;++Re<y;)je=p[Re].call(this,je);return je}})}function Oh(d,p,y,R,M,z,W,J,ae,xe){var we=p&A,Re=p&w,je=p&x,Ye=p&(S|C),et=p&I,yt=je?n:Ru(d);function tt(){for(var Pt=arguments.length,Mt=ge(Pt),Wr=Pt;Wr--;)Mt[Wr]=arguments[Wr];if(Ye)var pr=Ul(tt),Ur=YF(Mt,pr);if(R&&(Mt=kC(Mt,R,M,Ye)),z&&(Mt=MC(Mt,z,W,Ye)),Pt-=Ur,Ye&&Pt<xe){var Pn=_s(Mt,pr);return VC(d,p,Oh,tt.placeholder,y,Mt,Pn,J,ae,xe-Pt)}var Vo=Re?y:this,Vi=je?Vo[d]:d;return Pt=Mt.length,J?Mt=n6(Mt,J):et&&Pt>1&&Mt.reverse(),we&&ae<Pt&&(Mt.length=ae),this&&this!==qn&&this instanceof tt&&(Vi=yt||Ru(Vi)),Vi.apply(Vo,Mt)}return tt}function zC(d,p){return function(y,R){return u7(y,d,p(R),{})}}function Ph(d,p){return function(y,R){var M;if(y===n&&R===n)return p;if(y!==n&&(M=y),R!==n){if(M===n)return R;typeof y=="string"||typeof R=="string"?(y=Vr(y),R=Vr(R)):(y=EC(y),R=EC(R)),M=d(y,R)}return M}}function Zv(d){return Fi(function(p){return p=yn(p,Br(Je())),St(function(y){var R=this;return d(p,function(M){return zr(M,R,y)})})})}function Th(d,p){p=p===n?" ":Vr(p);var y=p.length;if(y<2)return y?qv(p,d):p;var R=qv(p,gh(d/Ll(p)));return Nl(p)?Os(jo(R),0,d).join(""):R.slice(0,d)}function L7(d,p,y,R){var M=p&w,z=Ru(d);function W(){for(var J=-1,ae=arguments.length,xe=-1,we=R.length,Re=ge(we+ae),je=this&&this!==qn&&this instanceof W?z:d;++xe<we;)Re[xe]=R[xe];for(;ae--;)Re[xe++]=arguments[++J];return zr(je,M?y:this,Re)}return W}function BC(d){return function(p,y,R){return R&&typeof R!="number"&&hr(p,y,R)&&(y=R=n),p=Bi(p),y===n?(y=p,p=0):y=Bi(y),R=R===n?p<y?1:-1:Bi(R),_7(p,y,R,d)}}function Dh(d){return function(p,y){return typeof p=="string"&&typeof y=="string"||(p=So(p),y=So(y)),d(p,y)}}function VC(d,p,y,R,M,z,W,J,ae,xe){var we=p&S,Re=we?W:n,je=we?n:W,Ye=we?z:n,et=we?n:z;p|=we?E:P,p&=~(we?P:E),p&_||(p&=~(w|x));var yt=[d,p,M,Ye,Re,et,je,J,ae,xe],tt=y.apply(n,yt);return ab(d)&&eE(tt,yt),tt.placeholder=R,tE(tt,d,p)}function eb(d){var p=kn[d];return function(y,R){if(y=So(y),R=R==null?0:nr(pt(R),292),R&&tC(y)){var M=(Ut(y)+"e").split("e"),z=p(M[0]+"e"+(+M[1]+R));return M=(Ut(z)+"e").split("e"),+(M[0]+"e"+(+M[1]-R))}return p(y)}}var F7=zl&&1/ih(new zl([,-0]))[1]==G?function(d){return new zl(d)}:_b;function HC(d){return function(p){var y=rr(p);return y==_e?Dv(p):y==lt?t3(p):GF(p,d(p))}}function Li(d,p,y,R,M,z,W,J){var ae=p&x;if(!ae&&typeof d!="function")throw new bo(s);var xe=R?R.length:0;if(xe||(p&=~(E|P),R=M=n),W=W===n?W:Mn(pt(W),0),J=J===n?J:pt(J),xe-=M?M.length:0,p&P){var we=R,Re=M;R=M=n}var je=ae?n:rb(d),Ye=[d,p,y,R,M,we,Re,z,W,J];if(je&&Z7(Ye,je),d=Ye[0],p=Ye[1],y=Ye[2],R=Ye[3],M=Ye[4],J=Ye[9]=Ye[9]===n?ae?0:d.length:Mn(Ye[9]-xe,0),!J&&p&(S|C)&&(p&=~(S|C)),!p||p==w)var et=I7(d,p,y);else p==S||p==C?et=N7(d,p,J):(p==E||p==(w|E))&&!M.length?et=L7(d,p,y,R):et=Oh.apply(n,Ye);var yt=je?SC:eE;return tE(yt(et,Ye),d,p)}function WC(d,p,y,R){return d===n||Bo(d,jl[y])&&!Qt.call(R,y)?p:d}function UC(d,p,y,R,M,z){return wn(d)&&wn(p)&&(z.set(p,d),Sh(d,p,n,UC,z),z.delete(p)),d}function j7(d){return Tu(d)?n:d}function qC(d,p,y,R,M,z){var W=y&v,J=d.length,ae=p.length;if(J!=ae&&!(W&&ae>J))return!1;var xe=z.get(d),we=z.get(p);if(xe&&we)return xe==p&&we==d;var Re=-1,je=!0,Ye=y&b?new Sa:n;for(z.set(d,p),z.set(p,d);++Re<J;){var et=d[Re],yt=p[Re];if(R)var tt=W?R(yt,et,Re,p,d,z):R(et,yt,Re,d,p,z);if(tt!==n){if(tt)continue;je=!1;break}if(Ye){if(!Cv(p,function(Pt,Mt){if(!gu(Ye,Mt)&&(et===Pt||M(et,Pt,y,R,z)))return Ye.push(Mt)})){je=!1;break}}else if(!(et===yt||M(et,yt,y,R,z))){je=!1;break}}return z.delete(d),z.delete(p),je}function z7(d,p,y,R,M,z,W){switch(y){case Ge:if(d.byteLength!=p.byteLength||d.byteOffset!=p.byteOffset)return!1;d=d.buffer,p=p.buffer;case Le:return!(d.byteLength!=p.byteLength||!z(new dh(d),new dh(p)));case se:case ne:case Pe:return Bo(+d,+p);case ye:return d.name==p.name&&d.message==p.message;case Ke:case It:return d==p+"";case _e:var J=Dv;case lt:var ae=R&v;if(J||(J=ih),d.size!=p.size&&!ae)return!1;var xe=W.get(d);if(xe)return xe==p;R|=b,W.set(d,p);var we=qC(J(d),J(p),R,M,z,W);return W.delete(d),we;case At:if(xu)return xu.call(d)==xu.call(p)}return!1}function B7(d,p,y,R,M,z){var W=y&v,J=tb(d),ae=J.length,xe=tb(p),we=xe.length;if(ae!=we&&!W)return!1;for(var Re=ae;Re--;){var je=J[Re];if(!(W?je in p:Qt.call(p,je)))return!1}var Ye=z.get(d),et=z.get(p);if(Ye&&et)return Ye==p&&et==d;var yt=!0;z.set(d,p),z.set(p,d);for(var tt=W;++Re<ae;){je=J[Re];var Pt=d[je],Mt=p[je];if(R)var Wr=W?R(Mt,Pt,je,p,d,z):R(Pt,Mt,je,d,p,z);if(!(Wr===n?Pt===Mt||M(Pt,Mt,y,R,z):Wr)){yt=!1;break}tt||(tt=je=="constructor")}if(yt&&!tt){var pr=d.constructor,Ur=p.constructor;pr!=Ur&&"constructor"in d&&"constructor"in p&&!(typeof pr=="function"&&pr instanceof pr&&typeof Ur=="function"&&Ur instanceof Ur)&&(yt=!1)}return z.delete(d),z.delete(p),yt}function Fi(d){return cb(JC(d,n,aE),d+"")}function tb(d){return fC(d,Bn,ib)}function nb(d){return fC(d,Er,GC)}var rb=vh?function(d){return vh.get(d)}:_b;function Ah(d){for(var p=d.name+"",y=Bl[p],R=Qt.call(Bl,p)?y.length:0;R--;){var M=y[R],z=M.func;if(z==null||z==d)return M.name}return p}function Ul(d){var p=Qt.call(F,"placeholder")?F:d;return p.placeholder}function Je(){var d=F.iteratee||xb;return d=d===xb?gC:d,arguments.length?d(arguments[0],arguments[1]):d}function $h(d,p){var y=d.__data__;return K7(p)?y[typeof p=="string"?"string":"hash"]:y.map}function ob(d){for(var p=Bn(d),y=p.length;y--;){var R=p[y],M=d[R];p[y]=[R,M,XC(M)]}return p}function Ra(d,p){var y=JF(d,p);return pC(y)?y:n}function V7(d){var p=Qt.call(d,wa),y=d[wa];try{d[wa]=n;var R=!0}catch{}var M=ch.call(d);return R&&(p?d[wa]=y:delete d[wa]),M}var ib=$v?function(d){return d==null?[]:(d=nn(d),xs($v(d),function(p){return ZS.call(d,p)}))}:Sb,GC=$v?function(d){for(var p=[];d;)ws(p,ib(d)),d=fh(d);return p}:Sb,rr=fr;(kv&&rr(new kv(new ArrayBuffer(1)))!=Ge||vu&&rr(new vu)!=_e||Mv&&rr(Mv.resolve())!=Be||zl&&rr(new zl)!=lt||bu&&rr(new bu)!=de)&&(rr=function(d){var p=fr(d),y=p==Ue?d.constructor:n,R=y?Oa(y):"";if(R)switch(R){case C3:return Ge;case E3:return _e;case R3:return Be;case O3:return lt;case P3:return de}return p});function H7(d,p,y){for(var R=-1,M=y.length;++R<M;){var z=y[R],W=z.size;switch(z.type){case"drop":d+=W;break;case"dropRight":p-=W;break;case"take":p=nr(p,d+W);break;case"takeRight":d=Mn(d,p-W);break}}return{start:d,end:p}}function W7(d){var p=d.match(ys);return p?p[1].split(D):[]}function YC(d,p,y){p=Rs(p,d);for(var R=-1,M=p.length,z=!1;++R<M;){var W=ai(p[R]);if(!(z=d!=null&&y(d,W)))break;d=d[W]}return z||++R!=M?z:(M=d==null?0:d.length,!!M&&jh(M)&&ji(W,M)&&(ut(d)||Pa(d)))}function U7(d){var p=d.length,y=new d.constructor(p);return p&&typeof d[0]=="string"&&Qt.call(d,"index")&&(y.index=d.index,y.input=d.input),y}function KC(d){return typeof d.constructor=="function"&&!Ou(d)?Vl(fh(d)):{}}function q7(d,p,y){var R=d.constructor;switch(p){case Le:return Jv(d);case se:case ne:return new R(+d);case Ge:return T7(d,y);case Ze:case Wt:case Zt:case Kt:case vn:case ln:case Lt:case tn:case xn:return AC(d,y);case _e:return new R;case Pe:case It:return new R(d);case Ke:return D7(d);case lt:return new R;case At:return A7(d)}}function G7(d,p){var y=p.length;if(!y)return d;var R=y-1;return p[R]=(y>1?"& ":"")+p[R],p=p.join(y>2?", ":" "),d.replace(bs,`{
|
|
70
70
|
/* [wrapped with `+p+`] */
|
|
71
|
-
`)}function Y7(d){return ut(d)||Pa(d)||!!(eC&&d&&d[eC])}function ji(d,p){var y=typeof d;return p=p??q,!!p&&(y=="number"||y!="symbol"&&me.test(d))&&d>-1&&d%1==0&&d<p}function hr(d,p,y){if(!wn(y))return!1;var R=typeof p;return(R=="number"?Cr(y)&&ji(p,y.length):R=="string"&&p in y)?Bo(y[p],d):!1}function sb(d,p){if(ut(d))return!1;var y=typeof d;return y=="number"||y=="symbol"||y=="boolean"||d==null||Hr(d)?!0:$i.test(d)||!ni.test(d)||p!=null&&d in nn(p)}function K7(d){var p=typeof d;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?d!=="__proto__":d===null}function ab(d){var p=Ah(d),y=F[p];if(typeof y!="function"||!(p in kt.prototype))return!1;if(d===y)return!0;var R=rb(y);return!!R&&d===R[0]}function X7(d){return!!XS&&XS in d}var Q7=ah?zi:Cb;function Ou(d){var p=d&&d.constructor,y=typeof p=="function"&&p.prototype||jl;return d===y}function XC(d){return d===d&&!wn(d)}function QC(d,p){return function(y){return y==null?!1:y[d]===p&&(p!==n||d in nn(y))}}function J7(d){var p=Lh(d,function(R){return y.size===c&&y.clear(),R}),y=p.cache;return p}function Z7(d,p){var y=d[1],R=p[1],M=y|R,z=M<(w|x|A),W=R==A&&y==S||R==A&&y==k&&d[7].length<=p[8]||R==(A|k)&&p[7].length<=p[8]&&y==S;if(!(z||W))return d;R&w&&(d[2]=p[2],M|=y&w?0:_);var J=p[3];if(J){var ae=d[3];d[3]=ae?kC(ae,J,p[4]):J,d[4]=ae?_s(d[3],u):p[4]}return J=p[5],J&&(ae=d[5],d[5]=ae?MC(ae,J,p[6]):J,d[6]=ae?_s(d[5],u):p[6]),J=p[7],J&&(d[7]=J),R&A&&(d[8]=d[8]==null?p[8]:nr(d[8],p[8])),d[9]==null&&(d[9]=p[9]),d[0]=p[0],d[1]=M,d}function e6(d){var p=[];if(d!=null)for(var y in nn(d))p.push(y);return p}function t6(d){return ch.call(d)}function JC(d,p,y){return p=Mn(p===n?d.length-1:p,0),function(){for(var R=arguments,M=-1,z=Mn(R.length-p,0),W=ge(z);++M<z;)W[M]=R[p+M];M=-1;for(var J=ge(p+1);++M<p;)J[M]=R[M];return J[p]=y(W),zr(d,this,J)}}function ZC(d,p){return p.length<2?d:Ea(d,wo(p,0,-1))}function n6(d,p){for(var y=d.length,R=nr(p.length,y),M=Sr(d);R--;){var z=p[R];d[R]=ji(z,y)?M[z]:n}return d}function lb(d,p){if(!(p==="constructor"&&typeof d[p]=="function")&&p!="__proto__")return d[p]}var eE=nE(SC),Pu=v3||function(d,p){return qn.setTimeout(d,p)},cb=nE(E7);function tE(d,p,y){var R=p+"";return cb(d,G7(R,r6(W7(R),y)))}function nE(d){var p=0,y=0;return function(){var R=w3(),M=Q-(R-y);if(y=R,M>0){if(++p>=j)return arguments[0]}else p=0;return d.apply(n,arguments)}}function kh(d,p){var y=-1,R=d.length,M=R-1;for(p=p===n?R:p;++y<p;){var z=Uv(y,M),W=d[z];d[z]=d[y],d[y]=W}return d.length=p,d}var rE=J7(function(d){var p=[];return d.charCodeAt(0)===46&&p.push(""),d.replace(vs,function(y,R,M,z){p.push(M?z.replace(Oe,"$1"):R||y)}),p});function ai(d){if(typeof d=="string"||Hr(d))return d;var p=d+"";return p=="0"&&1/d==-G?"-0":p}function Oa(d){if(d!=null){try{return lh.call(d)}catch{}try{return d+""}catch{}}return""}function r6(d,p){return vo(ie,function(y){var R="_."+y[0];p&y[1]&&!rh(d,R)&&d.push(R)}),d.sort()}function oE(d){if(d instanceof kt)return d.clone();var p=new yo(d.__wrapped__,d.__chain__);return p.__actions__=Sr(d.__actions__),p.__index__=d.__index__,p.__values__=d.__values__,p}function o6(d,p,y){(y?hr(d,p,y):p===n)?p=1:p=Mn(pt(p),0);var R=d==null?0:d.length;if(!R||p<1)return[];for(var M=0,z=0,W=ge(gh(R/p));M<R;)W[z++]=wo(d,M,M+=p);return W}function i6(d){for(var p=-1,y=d==null?0:d.length,R=0,M=[];++p<y;){var z=d[p];z&&(M[R++]=z)}return M}function s6(){var d=arguments.length;if(!d)return[];for(var p=ge(d-1),y=arguments[0],R=d;R--;)p[R-1]=arguments[R];return ws(ut(y)?Sr(y):[y],Gn(p,1))}var a6=St(function(d,p){return On(d)?_u(d,Gn(p,1,On,!0)):[]}),l6=St(function(d,p){var y=_o(p);return On(y)&&(y=n),On(d)?_u(d,Gn(p,1,On,!0),Je(y,2)):[]}),c6=St(function(d,p){var y=_o(p);return On(y)&&(y=n),On(d)?_u(d,Gn(p,1,On,!0),n,y):[]});function u6(d,p,y){var R=d==null?0:d.length;return R?(p=y||p===n?1:pt(p),wo(d,p<0?0:p,R)):[]}function d6(d,p,y){var R=d==null?0:d.length;return R?(p=y||p===n?1:pt(p),p=R-p,wo(d,0,p<0?0:p)):[]}function f6(d,p){return d&&d.length?Eh(d,Je(p,3),!0,!0):[]}function h6(d,p){return d&&d.length?Eh(d,Je(p,3),!0):[]}function p6(d,p,y,R){var M=d==null?0:d.length;return M?(y&&typeof y!="number"&&hr(d,p,y)&&(y=0,R=M),s7(d,p,y,R)):[]}function iE(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=y==null?0:pt(y);return M<0&&(M=Mn(R+M,0)),oh(d,Je(p,3),M)}function sE(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=R-1;return y!==n&&(M=pt(y),M=y<0?Mn(R+M,0):nr(M,R-1)),oh(d,Je(p,3),M,!0)}function aE(d){var p=d==null?0:d.length;return p?Gn(d,1):[]}function g6(d){var p=d==null?0:d.length;return p?Gn(d,G):[]}function m6(d,p){var y=d==null?0:d.length;return y?(p=p===n?1:pt(p),Gn(d,p)):[]}function v6(d){for(var p=-1,y=d==null?0:d.length,R={};++p<y;){var M=d[p];R[M[0]]=M[1]}return R}function lE(d){return d&&d.length?d[0]:n}function b6(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=y==null?0:pt(y);return M<0&&(M=Mn(R+M,0)),Il(d,p,M)}function y6(d){var p=d==null?0:d.length;return p?wo(d,0,-1):[]}var x6=St(function(d){var p=yn(d,Xv);return p.length&&p[0]===d[0]?zv(p):[]}),w6=St(function(d){var p=_o(d),y=yn(d,Xv);return p===_o(y)?p=n:y.pop(),y.length&&y[0]===d[0]?zv(y,Je(p,2)):[]}),_6=St(function(d){var p=_o(d),y=yn(d,Xv);return p=typeof p=="function"?p:n,p&&y.pop(),y.length&&y[0]===d[0]?zv(y,n,p):[]});function S6(d,p){return d==null?"":y3.call(d,p)}function _o(d){var p=d==null?0:d.length;return p?d[p-1]:n}function C6(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=R;return y!==n&&(M=pt(y),M=M<0?Mn(R+M,0):nr(M,R-1)),p===p?r3(d,p,M):oh(d,VS,M,!0)}function E6(d,p){return d&&d.length?yC(d,pt(p)):n}var R6=St(cE);function cE(d,p){return d&&d.length&&p&&p.length?Wv(d,p):d}function O6(d,p,y){return d&&d.length&&p&&p.length?Wv(d,p,Je(y,2)):d}function P6(d,p,y){return d&&d.length&&p&&p.length?Wv(d,p,n,y):d}var T6=Fi(function(d,p){var y=d==null?0:d.length,R=Nv(d,p);return _C(d,yn(p,function(M){return ji(M,y)?+M:M}).sort($C)),R});function D6(d,p){var y=[];if(!(d&&d.length))return y;var R=-1,M=[],z=d.length;for(p=Je(p,3);++R<z;){var W=d[R];p(W,R,d)&&(y.push(W),M.push(R))}return _C(d,M),y}function ub(d){return d==null?d:S3.call(d)}function A6(d,p,y){var R=d==null?0:d.length;return R?(y&&typeof y!="number"&&hr(d,p,y)?(p=0,y=R):(p=p==null?0:pt(p),y=y===n?R:pt(y)),wo(d,p,y)):[]}function $6(d,p){return Ch(d,p)}function k6(d,p,y){return Gv(d,p,Je(y,2))}function M6(d,p){var y=d==null?0:d.length;if(y){var R=Ch(d,p);if(R<y&&Bo(d[R],p))return R}return-1}function I6(d,p){return Ch(d,p,!0)}function N6(d,p,y){return Gv(d,p,Je(y,2),!0)}function L6(d,p){var y=d==null?0:d.length;if(y){var R=Ch(d,p,!0)-1;if(Bo(d[R],p))return R}return-1}function F6(d){return d&&d.length?CC(d):[]}function j6(d,p){return d&&d.length?CC(d,Je(p,2)):[]}function z6(d){var p=d==null?0:d.length;return p?wo(d,1,p):[]}function B6(d,p,y){return d&&d.length?(p=y||p===n?1:pt(p),wo(d,0,p<0?0:p)):[]}function V6(d,p,y){var R=d==null?0:d.length;return R?(p=y||p===n?1:pt(p),p=R-p,wo(d,p<0?0:p,R)):[]}function H6(d,p){return d&&d.length?Eh(d,Je(p,3),!1,!0):[]}function W6(d,p){return d&&d.length?Eh(d,Je(p,3)):[]}var U6=St(function(d){return Es(Gn(d,1,On,!0))}),q6=St(function(d){var p=_o(d);return On(p)&&(p=n),Es(Gn(d,1,On,!0),Je(p,2))}),G6=St(function(d){var p=_o(d);return p=typeof p=="function"?p:n,Es(Gn(d,1,On,!0),n,p)});function Y6(d){return d&&d.length?Es(d):[]}function K6(d,p){return d&&d.length?Es(d,Je(p,2)):[]}function X6(d,p){return p=typeof p=="function"?p:n,d&&d.length?Es(d,n,p):[]}function db(d){if(!(d&&d.length))return[];var p=0;return d=xs(d,function(y){if(On(y))return p=Mn(y.length,p),!0}),Pv(p,function(y){return yn(d,Ev(y))})}function uE(d,p){if(!(d&&d.length))return[];var y=db(d);return p==null?y:yn(y,function(R){return zr(p,n,R)})}var Q6=St(function(d,p){return On(d)?_u(d,p):[]}),J6=St(function(d){return Kv(xs(d,On))}),Z6=St(function(d){var p=_o(d);return On(p)&&(p=n),Kv(xs(d,On),Je(p,2))}),e9=St(function(d){var p=_o(d);return p=typeof p=="function"?p:n,Kv(xs(d,On),n,p)}),t9=St(db);function n9(d,p){return PC(d||[],p||[],wu)}function r9(d,p){return PC(d||[],p||[],Eu)}var o9=St(function(d){var p=d.length,y=p>1?d[p-1]:n;return y=typeof y=="function"?(d.pop(),y):n,uE(d,y)});function dE(d){var p=F(d);return p.__chain__=!0,p}function i9(d,p){return p(d),d}function Mh(d,p){return p(d)}var s9=Fi(function(d){var p=d.length,y=p?d[0]:0,R=this.__wrapped__,M=function(z){return Nv(z,d)};return p>1||this.__actions__.length||!(R instanceof kt)||!ji(y)?this.thru(M):(R=R.slice(y,+y+(p?1:0)),R.__actions__.push({func:Mh,args:[M],thisArg:n}),new yo(R,this.__chain__).thru(function(z){return p&&!z.length&&z.push(n),z}))});function a9(){return dE(this)}function l9(){return new yo(this.value(),this.__chain__)}function c9(){this.__values__===n&&(this.__values__=EE(this.value()));var d=this.__index__>=this.__values__.length,p=d?n:this.__values__[this.__index__++];return{done:d,value:p}}function u9(){return this}function d9(d){for(var p,y=this;y instanceof yh;){var R=oE(y);R.__index__=0,R.__values__=n,p?M.__wrapped__=R:p=R;var M=R;y=y.__wrapped__}return M.__wrapped__=d,p}function f9(){var d=this.__wrapped__;if(d instanceof kt){var p=d;return this.__actions__.length&&(p=new kt(this)),p=p.reverse(),p.__actions__.push({func:Mh,args:[ub],thisArg:n}),new yo(p,this.__chain__)}return this.thru(ub)}function h9(){return OC(this.__wrapped__,this.__actions__)}var p9=Rh(function(d,p,y){Qt.call(d,y)?++d[y]:Ni(d,y,1)});function g9(d,p,y){var R=ut(d)?zS:i7;return y&&hr(d,p,y)&&(p=n),R(d,Je(p,3))}function m9(d,p){var y=ut(d)?xs:uC;return y(d,Je(p,3))}var v9=FC(iE),b9=FC(sE);function y9(d,p){return Gn(Ih(d,p),1)}function x9(d,p){return Gn(Ih(d,p),G)}function w9(d,p,y){return y=y===n?1:pt(y),Gn(Ih(d,p),y)}function fE(d,p){var y=ut(d)?vo:Cs;return y(d,Je(p,3))}function hE(d,p){var y=ut(d)?zF:cC;return y(d,Je(p,3))}var _9=Rh(function(d,p,y){Qt.call(d,y)?d[y].push(p):Ni(d,y,[p])});function S9(d,p,y,R){d=Cr(d)?d:Gl(d),y=y&&!R?pt(y):0;var M=d.length;return y<0&&(y=Mn(M+y,0)),zh(d)?y<=M&&d.indexOf(p,y)>-1:!!M&&Il(d,p,y)>-1}var C9=St(function(d,p,y){var R=-1,M=typeof p=="function",z=Cr(d)?ge(d.length):[];return Cs(d,function(W){z[++R]=M?zr(p,W,y):Su(W,p,y)}),z}),E9=Rh(function(d,p,y){Ni(d,y,p)});function Ih(d,p){var y=ut(d)?yn:mC;return y(d,Je(p,3))}function R9(d,p,y,R){return d==null?[]:(ut(p)||(p=p==null?[]:[p]),y=R?n:y,ut(y)||(y=y==null?[]:[y]),xC(d,p,y))}var O9=Rh(function(d,p,y){d[y?0:1].push(p)},function(){return[[],[]]});function P9(d,p,y){var R=ut(d)?Sv:WS,M=arguments.length<3;return R(d,Je(p,4),y,M,Cs)}function T9(d,p,y){var R=ut(d)?BF:WS,M=arguments.length<3;return R(d,Je(p,4),y,M,cC)}function D9(d,p){var y=ut(d)?xs:uC;return y(d,Fh(Je(p,3)))}function A9(d){var p=ut(d)?iC:S7;return p(d)}function $9(d,p,y){(y?hr(d,p,y):p===n)?p=1:p=pt(p);var R=ut(d)?e7:C7;return R(d,p)}function k9(d){var p=ut(d)?t7:R7;return p(d)}function M9(d){if(d==null)return 0;if(Cr(d))return zh(d)?Ll(d):d.length;var p=rr(d);return p==_e||p==lt?d.size:Vv(d).length}function I9(d,p,y){var R=ut(d)?Cv:O7;return y&&hr(d,p,y)&&(p=n),R(d,Je(p,3))}var N9=St(function(d,p){if(d==null)return[];var y=p.length;return y>1&&hr(d,p[0],p[1])?p=[]:y>2&&hr(p[0],p[1],p[2])&&(p=[p[0]]),xC(d,Gn(p,1),[])}),Nh=m3||function(){return qn.Date.now()};function L9(d,p){if(typeof p!="function")throw new bo(s);return d=pt(d),function(){if(--d<1)return p.apply(this,arguments)}}function pE(d,p,y){return p=y?n:p,p=d&&p==null?d.length:p,Li(d,A,n,n,n,n,p)}function gE(d,p){var y;if(typeof p!="function")throw new bo(s);return d=pt(d),function(){return--d>0&&(y=p.apply(this,arguments)),d<=1&&(p=n),y}}var fb=St(function(d,p,y){var R=w;if(y.length){var M=_s(y,Ul(fb));R|=E}return Li(d,R,p,y,M)}),mE=St(function(d,p,y){var R=w|x;if(y.length){var M=_s(y,Ul(mE));R|=E}return Li(p,R,d,y,M)});function vE(d,p,y){p=y?n:p;var R=Li(d,S,n,n,n,n,n,p);return R.placeholder=vE.placeholder,R}function bE(d,p,y){p=y?n:p;var R=Li(d,C,n,n,n,n,n,p);return R.placeholder=bE.placeholder,R}function yE(d,p,y){var R,M,z,W,J,ae,xe=0,we=!1,Re=!1,je=!0;if(typeof d!="function")throw new bo(s);p=So(p)||0,wn(y)&&(we=!!y.leading,Re="maxWait"in y,z=Re?Mn(So(y.maxWait)||0,p):z,je="trailing"in y?!!y.trailing:je);function Ye(Pn){var Vo=R,Vi=M;return R=M=n,xe=Pn,W=d.apply(Vi,Vo),W}function et(Pn){return xe=Pn,J=Pu(Pt,p),we?Ye(Pn):W}function yt(Pn){var Vo=Pn-ae,Vi=Pn-xe,FE=p-Vo;return Re?nr(FE,z-Vi):FE}function tt(Pn){var Vo=Pn-ae,Vi=Pn-xe;return ae===n||Vo>=p||Vo<0||Re&&Vi>=z}function Pt(){var Pn=Nh();if(tt(Pn))return Mt(Pn);J=Pu(Pt,yt(Pn))}function Mt(Pn){return J=n,je&&R?Ye(Pn):(R=M=n,W)}function Wr(){J!==n&&TC(J),xe=0,R=ae=M=J=n}function pr(){return J===n?W:Mt(Nh())}function Ur(){var Pn=Nh(),Vo=tt(Pn);if(R=arguments,M=this,ae=Pn,Vo){if(J===n)return et(ae);if(Re)return TC(J),J=Pu(Pt,p),Ye(ae)}return J===n&&(J=Pu(Pt,p)),W}return Ur.cancel=Wr,Ur.flush=pr,Ur}var F9=St(function(d,p){return lC(d,1,p)}),j9=St(function(d,p,y){return lC(d,So(p)||0,y)});function z9(d){return Li(d,I)}function Lh(d,p){if(typeof d!="function"||p!=null&&typeof p!="function")throw new bo(s);var y=function(){var R=arguments,M=p?p.apply(this,R):R[0],z=y.cache;if(z.has(M))return z.get(M);var W=d.apply(this,R);return y.cache=z.set(M,W)||z,W};return y.cache=new(Lh.Cache||Ii),y}Lh.Cache=Ii;function Fh(d){if(typeof d!="function")throw new bo(s);return function(){var p=arguments;switch(p.length){case 0:return!d.call(this);case 1:return!d.call(this,p[0]);case 2:return!d.call(this,p[0],p[1]);case 3:return!d.call(this,p[0],p[1],p[2])}return!d.apply(this,p)}}function B9(d){return gE(2,d)}var V9=P7(function(d,p){p=p.length==1&&ut(p[0])?yn(p[0],Br(Je())):yn(Gn(p,1),Br(Je()));var y=p.length;return St(function(R){for(var M=-1,z=nr(R.length,y);++M<z;)R[M]=p[M].call(this,R[M]);return zr(d,this,R)})}),hb=St(function(d,p){var y=_s(p,Ul(hb));return Li(d,E,n,p,y)}),xE=St(function(d,p){var y=_s(p,Ul(xE));return Li(d,P,n,p,y)}),H9=Fi(function(d,p){return Li(d,k,n,n,n,p)});function W9(d,p){if(typeof d!="function")throw new bo(s);return p=p===n?p:pt(p),St(d,p)}function U9(d,p){if(typeof d!="function")throw new bo(s);return p=p==null?0:Mn(pt(p),0),St(function(y){var R=y[p],M=Os(y,0,p);return R&&ws(M,R),zr(d,this,M)})}function q9(d,p,y){var R=!0,M=!0;if(typeof d!="function")throw new bo(s);return wn(y)&&(R="leading"in y?!!y.leading:R,M="trailing"in y?!!y.trailing:M),yE(d,p,{leading:R,maxWait:p,trailing:M})}function G9(d){return pE(d,1)}function Y9(d,p){return hb(Qv(p),d)}function K9(){if(!arguments.length)return[];var d=arguments[0];return ut(d)?d:[d]}function X9(d){return xo(d,g)}function Q9(d,p){return p=typeof p=="function"?p:n,xo(d,g,p)}function J9(d){return xo(d,f|g)}function Z9(d,p){return p=typeof p=="function"?p:n,xo(d,f|g,p)}function e4(d,p){return p==null||aC(d,p,Bn(p))}function Bo(d,p){return d===p||d!==d&&p!==p}var t4=Dh(jv),n4=Dh(function(d,p){return d>=p}),Pa=hC(function(){return arguments}())?hC:function(d){return Sn(d)&&Qt.call(d,"callee")&&!ZS.call(d,"callee")},ut=ge.isArray,r4=MS?Br(MS):d7;function Cr(d){return d!=null&&jh(d.length)&&!zi(d)}function On(d){return Sn(d)&&Cr(d)}function o4(d){return d===!0||d===!1||Sn(d)&&fr(d)==se}var Ps=b3||Cb,i4=IS?Br(IS):f7;function s4(d){return Sn(d)&&d.nodeType===1&&!Tu(d)}function a4(d){if(d==null)return!0;if(Cr(d)&&(ut(d)||typeof d=="string"||typeof d.splice=="function"||Ps(d)||ql(d)||Pa(d)))return!d.length;var p=rr(d);if(p==_e||p==lt)return!d.size;if(Ou(d))return!Vv(d).length;for(var y in d)if(Qt.call(d,y))return!1;return!0}function l4(d,p){return Cu(d,p)}function c4(d,p,y){y=typeof y=="function"?y:n;var R=y?y(d,p):n;return R===n?Cu(d,p,n,y):!!R}function pb(d){if(!Sn(d))return!1;var p=fr(d);return p==ye||p==le||typeof d.message=="string"&&typeof d.name=="string"&&!Tu(d)}function u4(d){return typeof d=="number"&&tC(d)}function zi(d){if(!wn(d))return!1;var p=fr(d);return p==Y||p==be||p==pe||p==Ie}function wE(d){return typeof d=="number"&&d==pt(d)}function jh(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=q}function wn(d){var p=typeof d;return d!=null&&(p=="object"||p=="function")}function Sn(d){return d!=null&&typeof d=="object"}var _E=NS?Br(NS):p7;function d4(d,p){return d===p||Bv(d,p,ob(p))}function f4(d,p,y){return y=typeof y=="function"?y:n,Bv(d,p,ob(p),y)}function h4(d){return SE(d)&&d!=+d}function p4(d){if(Q7(d))throw new ct(i);return pC(d)}function g4(d){return d===null}function m4(d){return d==null}function SE(d){return typeof d=="number"||Sn(d)&&fr(d)==Pe}function Tu(d){if(!Sn(d)||fr(d)!=Ue)return!1;var p=fh(d);if(p===null)return!0;var y=Qt.call(p,"constructor")&&p.constructor;return typeof y=="function"&&y instanceof y&&lh.call(y)==f3}var gb=LS?Br(LS):g7;function v4(d){return wE(d)&&d>=-q&&d<=q}var CE=FS?Br(FS):m7;function zh(d){return typeof d=="string"||!ut(d)&&Sn(d)&&fr(d)==It}function Hr(d){return typeof d=="symbol"||Sn(d)&&fr(d)==At}var ql=jS?Br(jS):v7;function b4(d){return d===n}function y4(d){return Sn(d)&&rr(d)==de}function x4(d){return Sn(d)&&fr(d)==Ee}var w4=Dh(Hv),_4=Dh(function(d,p){return d<=p});function EE(d){if(!d)return[];if(Cr(d))return zh(d)?jo(d):Sr(d);if(mu&&d[mu])return e3(d[mu]());var p=rr(d),y=p==_e?Dv:p==lt?ih:Gl;return y(d)}function Bi(d){if(!d)return d===0?d:0;if(d=So(d),d===G||d===-G){var p=d<0?-1:1;return p*K}return d===d?d:0}function pt(d){var p=Bi(d),y=p%1;return p===p?y?p-y:p:0}function RE(d){return d?Ca(pt(d),0,V):0}function So(d){if(typeof d=="number")return d;if(Hr(d))return T;if(wn(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=wn(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=US(d);var y=Fe.test(d);return y||U.test(d)?LF(d.slice(2),y?2:8):ze.test(d)?T:+d}function OE(d){return si(d,Er(d))}function S4(d){return d?Ca(pt(d),-q,q):d===0?d:0}function Ut(d){return d==null?"":Vr(d)}var C4=Hl(function(d,p){if(Ou(p)||Cr(p)){si(p,Bn(p),d);return}for(var y in p)Qt.call(p,y)&&wu(d,y,p[y])}),PE=Hl(function(d,p){si(p,Er(p),d)}),Bh=Hl(function(d,p,y,R){si(p,Er(p),d,R)}),E4=Hl(function(d,p,y,R){si(p,Bn(p),d,R)}),R4=Fi(Nv);function O4(d,p){var y=Vl(d);return p==null?y:sC(y,p)}var P4=St(function(d,p){d=nn(d);var y=-1,R=p.length,M=R>2?p[2]:n;for(M&&hr(p[0],p[1],M)&&(R=1);++y<R;)for(var z=p[y],W=Er(z),J=-1,ae=W.length;++J<ae;){var xe=W[J],we=d[xe];(we===n||Bo(we,jl[xe])&&!Qt.call(d,xe))&&(d[xe]=z[xe])}return d}),T4=St(function(d){return d.push(n,UC),zr(TE,n,d)});function D4(d,p){return BS(d,Je(p,3),ii)}function A4(d,p){return BS(d,Je(p,3),Fv)}function $4(d,p){return d==null?d:Lv(d,Je(p,3),Er)}function k4(d,p){return d==null?d:dC(d,Je(p,3),Er)}function M4(d,p){return d&&ii(d,Je(p,3))}function I4(d,p){return d&&Fv(d,Je(p,3))}function N4(d){return d==null?[]:_h(d,Bn(d))}function L4(d){return d==null?[]:_h(d,Er(d))}function mb(d,p,y){var R=d==null?n:Ea(d,p);return R===n?y:R}function F4(d,p){return d!=null&&YC(d,p,a7)}function vb(d,p){return d!=null&&YC(d,p,l7)}var j4=zC(function(d,p,y){p!=null&&typeof p.toString!="function"&&(p=ch.call(p)),d[p]=y},yb(Rr)),z4=zC(function(d,p,y){p!=null&&typeof p.toString!="function"&&(p=ch.call(p)),Qt.call(d,p)?d[p].push(y):d[p]=[y]},Je),B4=St(Su);function Bn(d){return Cr(d)?oC(d):Vv(d)}function Er(d){return Cr(d)?oC(d,!0):b7(d)}function V4(d,p){var y={};return p=Je(p,3),ii(d,function(R,M,z){Ni(y,p(R,M,z),R)}),y}function H4(d,p){var y={};return p=Je(p,3),ii(d,function(R,M,z){Ni(y,M,p(R,M,z))}),y}var W4=Hl(function(d,p,y){Sh(d,p,y)}),TE=Hl(function(d,p,y,R){Sh(d,p,y,R)}),U4=Fi(function(d,p){var y={};if(d==null)return y;var R=!1;p=yn(p,function(z){return z=Rs(z,d),R||(R=z.length>1),z}),si(d,nb(d),y),R&&(y=xo(y,f|h|g,j7));for(var M=p.length;M--;)Yv(y,p[M]);return y});function q4(d,p){return DE(d,Fh(Je(p)))}var G4=Fi(function(d,p){return d==null?{}:x7(d,p)});function DE(d,p){if(d==null)return{};var y=yn(nb(d),function(R){return[R]});return p=Je(p),wC(d,y,function(R,M){return p(R,M[0])})}function Y4(d,p,y){p=Rs(p,d);var R=-1,M=p.length;for(M||(M=1,d=n);++R<M;){var z=d==null?n:d[ai(p[R])];z===n&&(R=M,z=y),d=zi(z)?z.call(d):z}return d}function K4(d,p,y){return d==null?d:Eu(d,p,y)}function X4(d,p,y,R){return R=typeof R=="function"?R:n,d==null?d:Eu(d,p,y,R)}var AE=HC(Bn),$E=HC(Er);function Q4(d,p,y){var R=ut(d),M=R||Ps(d)||ql(d);if(p=Je(p,4),y==null){var z=d&&d.constructor;M?y=R?new z:[]:wn(d)?y=zi(z)?Vl(fh(d)):{}:y={}}return(M?vo:ii)(d,function(W,J,ae){return p(y,W,J,ae)}),y}function J4(d,p){return d==null?!0:Yv(d,p)}function Z4(d,p,y){return d==null?d:RC(d,p,Qv(y))}function e8(d,p,y,R){return R=typeof R=="function"?R:n,d==null?d:RC(d,p,Qv(y),R)}function Gl(d){return d==null?[]:Tv(d,Bn(d))}function t8(d){return d==null?[]:Tv(d,Er(d))}function n8(d,p,y){return y===n&&(y=p,p=n),y!==n&&(y=So(y),y=y===y?y:0),p!==n&&(p=So(p),p=p===p?p:0),Ca(So(d),p,y)}function r8(d,p,y){return p=Bi(p),y===n?(y=p,p=0):y=Bi(y),d=So(d),c7(d,p,y)}function o8(d,p,y){if(y&&typeof y!="boolean"&&hr(d,p,y)&&(p=y=n),y===n&&(typeof p=="boolean"?(y=p,p=n):typeof d=="boolean"&&(y=d,d=n)),d===n&&p===n?(d=0,p=1):(d=Bi(d),p===n?(p=d,d=0):p=Bi(p)),d>p){var R=d;d=p,p=R}if(y||d%1||p%1){var M=nC();return nr(d+M*(p-d+NF("1e-"+((M+"").length-1))),p)}return Uv(d,p)}var i8=Wl(function(d,p,y){return p=p.toLowerCase(),d+(y?kE(p):p)});function kE(d){return bb(Ut(d).toLowerCase())}function ME(d){return d=Ut(d),d&&d.replace(ke,KF).replace(RF,"")}function s8(d,p,y){d=Ut(d),p=Vr(p);var R=d.length;y=y===n?R:Ca(pt(y),0,R);var M=y;return y-=p.length,y>=0&&d.slice(y,M)==p}function a8(d){return d=Ut(d),d&&Lo.test(d)?d.replace(bt,XF):d}function l8(d){return d=Ut(d),d&&ki.test(d)?d.replace(ri,"\\$&"):d}var c8=Wl(function(d,p,y){return d+(y?"-":"")+p.toLowerCase()}),u8=Wl(function(d,p,y){return d+(y?" ":"")+p.toLowerCase()}),d8=LC("toLowerCase");function f8(d,p,y){d=Ut(d),p=pt(p);var R=p?Ll(d):0;if(!p||R>=p)return d;var M=(p-R)/2;return Th(mh(M),y)+d+Th(gh(M),y)}function h8(d,p,y){d=Ut(d),p=pt(p);var R=p?Ll(d):0;return p&&R<p?d+Th(p-R,y):d}function p8(d,p,y){d=Ut(d),p=pt(p);var R=p?Ll(d):0;return p&&R<p?Th(p-R,y)+d:d}function g8(d,p,y){return y||p==null?p=0:p&&(p=+p),_3(Ut(d).replace(jn,""),p||0)}function m8(d,p,y){return(y?hr(d,p,y):p===n)?p=1:p=pt(p),qv(Ut(d),p)}function v8(){var d=arguments,p=Ut(d[0]);return d.length<3?p:p.replace(d[1],d[2])}var b8=Wl(function(d,p,y){return d+(y?"_":"")+p.toLowerCase()});function y8(d,p,y){return y&&typeof y!="number"&&hr(d,p,y)&&(p=y=n),y=y===n?V:y>>>0,y?(d=Ut(d),d&&(typeof p=="string"||p!=null&&!gb(p))&&(p=Vr(p),!p&&Nl(d))?Os(jo(d),0,y):d.split(p,y)):[]}var x8=Wl(function(d,p,y){return d+(y?" ":"")+bb(p)});function w8(d,p,y){return d=Ut(d),y=y==null?0:Ca(pt(y),0,d.length),p=Vr(p),d.slice(y,y+p.length)==p}function _8(d,p,y){var R=F.templateSettings;y&&hr(d,p,y)&&(p=n),d=Ut(d),p=Bh({},p,R,WC);var M=Bh({},p.imports,R.imports,WC),z=Bn(M),W=Tv(M,z),J,ae,xe=0,we=p.interpolate||st,Re="__p += '",je=Av((p.escape||st).source+"|"+we.source+"|"+(we===Ai?He:st).source+"|"+(p.evaluate||st).source+"|$","g"),Ye="//# sourceURL="+(Qt.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++AF+"]")+`
|
|
71
|
+
`)}function Y7(d){return ut(d)||Pa(d)||!!(eC&&d&&d[eC])}function ji(d,p){var y=typeof d;return p=p??q,!!p&&(y=="number"||y!="symbol"&&me.test(d))&&d>-1&&d%1==0&&d<p}function hr(d,p,y){if(!wn(y))return!1;var R=typeof p;return(R=="number"?Cr(y)&&ji(p,y.length):R=="string"&&p in y)?Bo(y[p],d):!1}function sb(d,p){if(ut(d))return!1;var y=typeof d;return y=="number"||y=="symbol"||y=="boolean"||d==null||Hr(d)?!0:$i.test(d)||!ni.test(d)||p!=null&&d in nn(p)}function K7(d){var p=typeof d;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?d!=="__proto__":d===null}function ab(d){var p=Ah(d),y=F[p];if(typeof y!="function"||!(p in kt.prototype))return!1;if(d===y)return!0;var R=rb(y);return!!R&&d===R[0]}function X7(d){return!!XS&&XS in d}var Q7=ah?zi:Cb;function Ou(d){var p=d&&d.constructor,y=typeof p=="function"&&p.prototype||jl;return d===y}function XC(d){return d===d&&!wn(d)}function QC(d,p){return function(y){return y==null?!1:y[d]===p&&(p!==n||d in nn(y))}}function J7(d){var p=Lh(d,function(R){return y.size===c&&y.clear(),R}),y=p.cache;return p}function Z7(d,p){var y=d[1],R=p[1],M=y|R,z=M<(w|x|A),W=R==A&&y==S||R==A&&y==k&&d[7].length<=p[8]||R==(A|k)&&p[7].length<=p[8]&&y==S;if(!(z||W))return d;R&w&&(d[2]=p[2],M|=y&w?0:_);var J=p[3];if(J){var ae=d[3];d[3]=ae?kC(ae,J,p[4]):J,d[4]=ae?_s(d[3],u):p[4]}return J=p[5],J&&(ae=d[5],d[5]=ae?MC(ae,J,p[6]):J,d[6]=ae?_s(d[5],u):p[6]),J=p[7],J&&(d[7]=J),R&A&&(d[8]=d[8]==null?p[8]:nr(d[8],p[8])),d[9]==null&&(d[9]=p[9]),d[0]=p[0],d[1]=M,d}function e6(d){var p=[];if(d!=null)for(var y in nn(d))p.push(y);return p}function t6(d){return ch.call(d)}function JC(d,p,y){return p=Mn(p===n?d.length-1:p,0),function(){for(var R=arguments,M=-1,z=Mn(R.length-p,0),W=ge(z);++M<z;)W[M]=R[p+M];M=-1;for(var J=ge(p+1);++M<p;)J[M]=R[M];return J[p]=y(W),zr(d,this,J)}}function ZC(d,p){return p.length<2?d:Ea(d,wo(p,0,-1))}function n6(d,p){for(var y=d.length,R=nr(p.length,y),M=Sr(d);R--;){var z=p[R];d[R]=ji(z,y)?M[z]:n}return d}function lb(d,p){if(!(p==="constructor"&&typeof d[p]=="function")&&p!="__proto__")return d[p]}var eE=nE(SC),Pu=v3||function(d,p){return qn.setTimeout(d,p)},cb=nE(E7);function tE(d,p,y){var R=p+"";return cb(d,G7(R,r6(W7(R),y)))}function nE(d){var p=0,y=0;return function(){var R=w3(),M=Q-(R-y);if(y=R,M>0){if(++p>=j)return arguments[0]}else p=0;return d.apply(n,arguments)}}function kh(d,p){var y=-1,R=d.length,M=R-1;for(p=p===n?R:p;++y<p;){var z=Uv(y,M),W=d[z];d[z]=d[y],d[y]=W}return d.length=p,d}var rE=J7(function(d){var p=[];return d.charCodeAt(0)===46&&p.push(""),d.replace(vs,function(y,R,M,z){p.push(M?z.replace(Oe,"$1"):R||y)}),p});function ai(d){if(typeof d=="string"||Hr(d))return d;var p=d+"";return p=="0"&&1/d==-G?"-0":p}function Oa(d){if(d!=null){try{return lh.call(d)}catch{}try{return d+""}catch{}}return""}function r6(d,p){return vo(ie,function(y){var R="_."+y[0];p&y[1]&&!rh(d,R)&&d.push(R)}),d.sort()}function oE(d){if(d instanceof kt)return d.clone();var p=new yo(d.__wrapped__,d.__chain__);return p.__actions__=Sr(d.__actions__),p.__index__=d.__index__,p.__values__=d.__values__,p}function o6(d,p,y){(y?hr(d,p,y):p===n)?p=1:p=Mn(pt(p),0);var R=d==null?0:d.length;if(!R||p<1)return[];for(var M=0,z=0,W=ge(gh(R/p));M<R;)W[z++]=wo(d,M,M+=p);return W}function i6(d){for(var p=-1,y=d==null?0:d.length,R=0,M=[];++p<y;){var z=d[p];z&&(M[R++]=z)}return M}function s6(){var d=arguments.length;if(!d)return[];for(var p=ge(d-1),y=arguments[0],R=d;R--;)p[R-1]=arguments[R];return ws(ut(y)?Sr(y):[y],Gn(p,1))}var a6=St(function(d,p){return On(d)?_u(d,Gn(p,1,On,!0)):[]}),l6=St(function(d,p){var y=_o(p);return On(y)&&(y=n),On(d)?_u(d,Gn(p,1,On,!0),Je(y,2)):[]}),c6=St(function(d,p){var y=_o(p);return On(y)&&(y=n),On(d)?_u(d,Gn(p,1,On,!0),n,y):[]});function u6(d,p,y){var R=d==null?0:d.length;return R?(p=y||p===n?1:pt(p),wo(d,p<0?0:p,R)):[]}function d6(d,p,y){var R=d==null?0:d.length;return R?(p=y||p===n?1:pt(p),p=R-p,wo(d,0,p<0?0:p)):[]}function f6(d,p){return d&&d.length?Eh(d,Je(p,3),!0,!0):[]}function h6(d,p){return d&&d.length?Eh(d,Je(p,3),!0):[]}function p6(d,p,y,R){var M=d==null?0:d.length;return M?(y&&typeof y!="number"&&hr(d,p,y)&&(y=0,R=M),s7(d,p,y,R)):[]}function iE(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=y==null?0:pt(y);return M<0&&(M=Mn(R+M,0)),oh(d,Je(p,3),M)}function sE(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=R-1;return y!==n&&(M=pt(y),M=y<0?Mn(R+M,0):nr(M,R-1)),oh(d,Je(p,3),M,!0)}function aE(d){var p=d==null?0:d.length;return p?Gn(d,1):[]}function g6(d){var p=d==null?0:d.length;return p?Gn(d,G):[]}function m6(d,p){var y=d==null?0:d.length;return y?(p=p===n?1:pt(p),Gn(d,p)):[]}function v6(d){for(var p=-1,y=d==null?0:d.length,R={};++p<y;){var M=d[p];R[M[0]]=M[1]}return R}function lE(d){return d&&d.length?d[0]:n}function b6(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=y==null?0:pt(y);return M<0&&(M=Mn(R+M,0)),Il(d,p,M)}function y6(d){var p=d==null?0:d.length;return p?wo(d,0,-1):[]}var x6=St(function(d){var p=yn(d,Xv);return p.length&&p[0]===d[0]?zv(p):[]}),w6=St(function(d){var p=_o(d),y=yn(d,Xv);return p===_o(y)?p=n:y.pop(),y.length&&y[0]===d[0]?zv(y,Je(p,2)):[]}),_6=St(function(d){var p=_o(d),y=yn(d,Xv);return p=typeof p=="function"?p:n,p&&y.pop(),y.length&&y[0]===d[0]?zv(y,n,p):[]});function S6(d,p){return d==null?"":y3.call(d,p)}function _o(d){var p=d==null?0:d.length;return p?d[p-1]:n}function C6(d,p,y){var R=d==null?0:d.length;if(!R)return-1;var M=R;return y!==n&&(M=pt(y),M=M<0?Mn(R+M,0):nr(M,R-1)),p===p?r3(d,p,M):oh(d,VS,M,!0)}function E6(d,p){return d&&d.length?yC(d,pt(p)):n}var R6=St(cE);function cE(d,p){return d&&d.length&&p&&p.length?Wv(d,p):d}function O6(d,p,y){return d&&d.length&&p&&p.length?Wv(d,p,Je(y,2)):d}function P6(d,p,y){return d&&d.length&&p&&p.length?Wv(d,p,n,y):d}var T6=Fi(function(d,p){var y=d==null?0:d.length,R=Nv(d,p);return _C(d,yn(p,function(M){return ji(M,y)?+M:M}).sort($C)),R});function D6(d,p){var y=[];if(!(d&&d.length))return y;var R=-1,M=[],z=d.length;for(p=Je(p,3);++R<z;){var W=d[R];p(W,R,d)&&(y.push(W),M.push(R))}return _C(d,M),y}function ub(d){return d==null?d:S3.call(d)}function A6(d,p,y){var R=d==null?0:d.length;return R?(y&&typeof y!="number"&&hr(d,p,y)?(p=0,y=R):(p=p==null?0:pt(p),y=y===n?R:pt(y)),wo(d,p,y)):[]}function $6(d,p){return Ch(d,p)}function k6(d,p,y){return Gv(d,p,Je(y,2))}function M6(d,p){var y=d==null?0:d.length;if(y){var R=Ch(d,p);if(R<y&&Bo(d[R],p))return R}return-1}function I6(d,p){return Ch(d,p,!0)}function N6(d,p,y){return Gv(d,p,Je(y,2),!0)}function L6(d,p){var y=d==null?0:d.length;if(y){var R=Ch(d,p,!0)-1;if(Bo(d[R],p))return R}return-1}function F6(d){return d&&d.length?CC(d):[]}function j6(d,p){return d&&d.length?CC(d,Je(p,2)):[]}function z6(d){var p=d==null?0:d.length;return p?wo(d,1,p):[]}function B6(d,p,y){return d&&d.length?(p=y||p===n?1:pt(p),wo(d,0,p<0?0:p)):[]}function V6(d,p,y){var R=d==null?0:d.length;return R?(p=y||p===n?1:pt(p),p=R-p,wo(d,p<0?0:p,R)):[]}function H6(d,p){return d&&d.length?Eh(d,Je(p,3),!1,!0):[]}function W6(d,p){return d&&d.length?Eh(d,Je(p,3)):[]}var U6=St(function(d){return Es(Gn(d,1,On,!0))}),q6=St(function(d){var p=_o(d);return On(p)&&(p=n),Es(Gn(d,1,On,!0),Je(p,2))}),G6=St(function(d){var p=_o(d);return p=typeof p=="function"?p:n,Es(Gn(d,1,On,!0),n,p)});function Y6(d){return d&&d.length?Es(d):[]}function K6(d,p){return d&&d.length?Es(d,Je(p,2)):[]}function X6(d,p){return p=typeof p=="function"?p:n,d&&d.length?Es(d,n,p):[]}function db(d){if(!(d&&d.length))return[];var p=0;return d=xs(d,function(y){if(On(y))return p=Mn(y.length,p),!0}),Pv(p,function(y){return yn(d,Ev(y))})}function uE(d,p){if(!(d&&d.length))return[];var y=db(d);return p==null?y:yn(y,function(R){return zr(p,n,R)})}var Q6=St(function(d,p){return On(d)?_u(d,p):[]}),J6=St(function(d){return Kv(xs(d,On))}),Z6=St(function(d){var p=_o(d);return On(p)&&(p=n),Kv(xs(d,On),Je(p,2))}),e9=St(function(d){var p=_o(d);return p=typeof p=="function"?p:n,Kv(xs(d,On),n,p)}),t9=St(db);function n9(d,p){return PC(d||[],p||[],wu)}function r9(d,p){return PC(d||[],p||[],Eu)}var o9=St(function(d){var p=d.length,y=p>1?d[p-1]:n;return y=typeof y=="function"?(d.pop(),y):n,uE(d,y)});function dE(d){var p=F(d);return p.__chain__=!0,p}function i9(d,p){return p(d),d}function Mh(d,p){return p(d)}var s9=Fi(function(d){var p=d.length,y=p?d[0]:0,R=this.__wrapped__,M=function(z){return Nv(z,d)};return p>1||this.__actions__.length||!(R instanceof kt)||!ji(y)?this.thru(M):(R=R.slice(y,+y+(p?1:0)),R.__actions__.push({func:Mh,args:[M],thisArg:n}),new yo(R,this.__chain__).thru(function(z){return p&&!z.length&&z.push(n),z}))});function a9(){return dE(this)}function l9(){return new yo(this.value(),this.__chain__)}function c9(){this.__values__===n&&(this.__values__=EE(this.value()));var d=this.__index__>=this.__values__.length,p=d?n:this.__values__[this.__index__++];return{done:d,value:p}}function u9(){return this}function d9(d){for(var p,y=this;y instanceof yh;){var R=oE(y);R.__index__=0,R.__values__=n,p?M.__wrapped__=R:p=R;var M=R;y=y.__wrapped__}return M.__wrapped__=d,p}function f9(){var d=this.__wrapped__;if(d instanceof kt){var p=d;return this.__actions__.length&&(p=new kt(this)),p=p.reverse(),p.__actions__.push({func:Mh,args:[ub],thisArg:n}),new yo(p,this.__chain__)}return this.thru(ub)}function h9(){return OC(this.__wrapped__,this.__actions__)}var p9=Rh(function(d,p,y){Qt.call(d,y)?++d[y]:Ni(d,y,1)});function g9(d,p,y){var R=ut(d)?zS:i7;return y&&hr(d,p,y)&&(p=n),R(d,Je(p,3))}function m9(d,p){var y=ut(d)?xs:uC;return y(d,Je(p,3))}var v9=FC(iE),b9=FC(sE);function y9(d,p){return Gn(Ih(d,p),1)}function x9(d,p){return Gn(Ih(d,p),G)}function w9(d,p,y){return y=y===n?1:pt(y),Gn(Ih(d,p),y)}function fE(d,p){var y=ut(d)?vo:Cs;return y(d,Je(p,3))}function hE(d,p){var y=ut(d)?zF:cC;return y(d,Je(p,3))}var _9=Rh(function(d,p,y){Qt.call(d,y)?d[y].push(p):Ni(d,y,[p])});function S9(d,p,y,R){d=Cr(d)?d:Gl(d),y=y&&!R?pt(y):0;var M=d.length;return y<0&&(y=Mn(M+y,0)),zh(d)?y<=M&&d.indexOf(p,y)>-1:!!M&&Il(d,p,y)>-1}var C9=St(function(d,p,y){var R=-1,M=typeof p=="function",z=Cr(d)?ge(d.length):[];return Cs(d,function(W){z[++R]=M?zr(p,W,y):Su(W,p,y)}),z}),E9=Rh(function(d,p,y){Ni(d,y,p)});function Ih(d,p){var y=ut(d)?yn:mC;return y(d,Je(p,3))}function R9(d,p,y,R){return d==null?[]:(ut(p)||(p=p==null?[]:[p]),y=R?n:y,ut(y)||(y=y==null?[]:[y]),xC(d,p,y))}var O9=Rh(function(d,p,y){d[y?0:1].push(p)},function(){return[[],[]]});function P9(d,p,y){var R=ut(d)?Sv:WS,M=arguments.length<3;return R(d,Je(p,4),y,M,Cs)}function T9(d,p,y){var R=ut(d)?BF:WS,M=arguments.length<3;return R(d,Je(p,4),y,M,cC)}function D9(d,p){var y=ut(d)?xs:uC;return y(d,Fh(Je(p,3)))}function A9(d){var p=ut(d)?iC:S7;return p(d)}function $9(d,p,y){(y?hr(d,p,y):p===n)?p=1:p=pt(p);var R=ut(d)?e7:C7;return R(d,p)}function k9(d){var p=ut(d)?t7:R7;return p(d)}function M9(d){if(d==null)return 0;if(Cr(d))return zh(d)?Ll(d):d.length;var p=rr(d);return p==_e||p==lt?d.size:Vv(d).length}function I9(d,p,y){var R=ut(d)?Cv:O7;return y&&hr(d,p,y)&&(p=n),R(d,Je(p,3))}var N9=St(function(d,p){if(d==null)return[];var y=p.length;return y>1&&hr(d,p[0],p[1])?p=[]:y>2&&hr(p[0],p[1],p[2])&&(p=[p[0]]),xC(d,Gn(p,1),[])}),Nh=m3||function(){return qn.Date.now()};function L9(d,p){if(typeof p!="function")throw new bo(s);return d=pt(d),function(){if(--d<1)return p.apply(this,arguments)}}function pE(d,p,y){return p=y?n:p,p=d&&p==null?d.length:p,Li(d,A,n,n,n,n,p)}function gE(d,p){var y;if(typeof p!="function")throw new bo(s);return d=pt(d),function(){return--d>0&&(y=p.apply(this,arguments)),d<=1&&(p=n),y}}var fb=St(function(d,p,y){var R=w;if(y.length){var M=_s(y,Ul(fb));R|=E}return Li(d,R,p,y,M)}),mE=St(function(d,p,y){var R=w|x;if(y.length){var M=_s(y,Ul(mE));R|=E}return Li(p,R,d,y,M)});function vE(d,p,y){p=y?n:p;var R=Li(d,S,n,n,n,n,n,p);return R.placeholder=vE.placeholder,R}function bE(d,p,y){p=y?n:p;var R=Li(d,C,n,n,n,n,n,p);return R.placeholder=bE.placeholder,R}function yE(d,p,y){var R,M,z,W,J,ae,xe=0,we=!1,Re=!1,je=!0;if(typeof d!="function")throw new bo(s);p=So(p)||0,wn(y)&&(we=!!y.leading,Re="maxWait"in y,z=Re?Mn(So(y.maxWait)||0,p):z,je="trailing"in y?!!y.trailing:je);function Ye(Pn){var Vo=R,Vi=M;return R=M=n,xe=Pn,W=d.apply(Vi,Vo),W}function et(Pn){return xe=Pn,J=Pu(Pt,p),we?Ye(Pn):W}function yt(Pn){var Vo=Pn-ae,Vi=Pn-xe,FE=p-Vo;return Re?nr(FE,z-Vi):FE}function tt(Pn){var Vo=Pn-ae,Vi=Pn-xe;return ae===n||Vo>=p||Vo<0||Re&&Vi>=z}function Pt(){var Pn=Nh();if(tt(Pn))return Mt(Pn);J=Pu(Pt,yt(Pn))}function Mt(Pn){return J=n,je&&R?Ye(Pn):(R=M=n,W)}function Wr(){J!==n&&TC(J),xe=0,R=ae=M=J=n}function pr(){return J===n?W:Mt(Nh())}function Ur(){var Pn=Nh(),Vo=tt(Pn);if(R=arguments,M=this,ae=Pn,Vo){if(J===n)return et(ae);if(Re)return TC(J),J=Pu(Pt,p),Ye(ae)}return J===n&&(J=Pu(Pt,p)),W}return Ur.cancel=Wr,Ur.flush=pr,Ur}var F9=St(function(d,p){return lC(d,1,p)}),j9=St(function(d,p,y){return lC(d,So(p)||0,y)});function z9(d){return Li(d,I)}function Lh(d,p){if(typeof d!="function"||p!=null&&typeof p!="function")throw new bo(s);var y=function(){var R=arguments,M=p?p.apply(this,R):R[0],z=y.cache;if(z.has(M))return z.get(M);var W=d.apply(this,R);return y.cache=z.set(M,W)||z,W};return y.cache=new(Lh.Cache||Ii),y}Lh.Cache=Ii;function Fh(d){if(typeof d!="function")throw new bo(s);return function(){var p=arguments;switch(p.length){case 0:return!d.call(this);case 1:return!d.call(this,p[0]);case 2:return!d.call(this,p[0],p[1]);case 3:return!d.call(this,p[0],p[1],p[2])}return!d.apply(this,p)}}function B9(d){return gE(2,d)}var V9=P7(function(d,p){p=p.length==1&&ut(p[0])?yn(p[0],Br(Je())):yn(Gn(p,1),Br(Je()));var y=p.length;return St(function(R){for(var M=-1,z=nr(R.length,y);++M<z;)R[M]=p[M].call(this,R[M]);return zr(d,this,R)})}),hb=St(function(d,p){var y=_s(p,Ul(hb));return Li(d,E,n,p,y)}),xE=St(function(d,p){var y=_s(p,Ul(xE));return Li(d,P,n,p,y)}),H9=Fi(function(d,p){return Li(d,k,n,n,n,p)});function W9(d,p){if(typeof d!="function")throw new bo(s);return p=p===n?p:pt(p),St(d,p)}function U9(d,p){if(typeof d!="function")throw new bo(s);return p=p==null?0:Mn(pt(p),0),St(function(y){var R=y[p],M=Os(y,0,p);return R&&ws(M,R),zr(d,this,M)})}function q9(d,p,y){var R=!0,M=!0;if(typeof d!="function")throw new bo(s);return wn(y)&&(R="leading"in y?!!y.leading:R,M="trailing"in y?!!y.trailing:M),yE(d,p,{leading:R,maxWait:p,trailing:M})}function G9(d){return pE(d,1)}function Y9(d,p){return hb(Qv(p),d)}function K9(){if(!arguments.length)return[];var d=arguments[0];return ut(d)?d:[d]}function X9(d){return xo(d,g)}function Q9(d,p){return p=typeof p=="function"?p:n,xo(d,g,p)}function J9(d){return xo(d,f|g)}function Z9(d,p){return p=typeof p=="function"?p:n,xo(d,f|g,p)}function e4(d,p){return p==null||aC(d,p,Bn(p))}function Bo(d,p){return d===p||d!==d&&p!==p}var t4=Dh(jv),n4=Dh(function(d,p){return d>=p}),Pa=hC(function(){return arguments}())?hC:function(d){return Sn(d)&&Qt.call(d,"callee")&&!ZS.call(d,"callee")},ut=ge.isArray,r4=MS?Br(MS):d7;function Cr(d){return d!=null&&jh(d.length)&&!zi(d)}function On(d){return Sn(d)&&Cr(d)}function o4(d){return d===!0||d===!1||Sn(d)&&fr(d)==se}var Ps=b3||Cb,i4=IS?Br(IS):f7;function s4(d){return Sn(d)&&d.nodeType===1&&!Tu(d)}function a4(d){if(d==null)return!0;if(Cr(d)&&(ut(d)||typeof d=="string"||typeof d.splice=="function"||Ps(d)||ql(d)||Pa(d)))return!d.length;var p=rr(d);if(p==_e||p==lt)return!d.size;if(Ou(d))return!Vv(d).length;for(var y in d)if(Qt.call(d,y))return!1;return!0}function l4(d,p){return Cu(d,p)}function c4(d,p,y){y=typeof y=="function"?y:n;var R=y?y(d,p):n;return R===n?Cu(d,p,n,y):!!R}function pb(d){if(!Sn(d))return!1;var p=fr(d);return p==ye||p==le||typeof d.message=="string"&&typeof d.name=="string"&&!Tu(d)}function u4(d){return typeof d=="number"&&tC(d)}function zi(d){if(!wn(d))return!1;var p=fr(d);return p==Y||p==be||p==pe||p==Ie}function wE(d){return typeof d=="number"&&d==pt(d)}function jh(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=q}function wn(d){var p=typeof d;return d!=null&&(p=="object"||p=="function")}function Sn(d){return d!=null&&typeof d=="object"}var _E=NS?Br(NS):p7;function d4(d,p){return d===p||Bv(d,p,ob(p))}function f4(d,p,y){return y=typeof y=="function"?y:n,Bv(d,p,ob(p),y)}function h4(d){return SE(d)&&d!=+d}function p4(d){if(Q7(d))throw new ct(i);return pC(d)}function g4(d){return d===null}function m4(d){return d==null}function SE(d){return typeof d=="number"||Sn(d)&&fr(d)==Pe}function Tu(d){if(!Sn(d)||fr(d)!=Ue)return!1;var p=fh(d);if(p===null)return!0;var y=Qt.call(p,"constructor")&&p.constructor;return typeof y=="function"&&y instanceof y&&lh.call(y)==f3}var gb=LS?Br(LS):g7;function v4(d){return wE(d)&&d>=-q&&d<=q}var CE=FS?Br(FS):m7;function zh(d){return typeof d=="string"||!ut(d)&&Sn(d)&&fr(d)==It}function Hr(d){return typeof d=="symbol"||Sn(d)&&fr(d)==At}var ql=jS?Br(jS):v7;function b4(d){return d===n}function y4(d){return Sn(d)&&rr(d)==de}function x4(d){return Sn(d)&&fr(d)==Ee}var w4=Dh(Hv),_4=Dh(function(d,p){return d<=p});function EE(d){if(!d)return[];if(Cr(d))return zh(d)?jo(d):Sr(d);if(mu&&d[mu])return e3(d[mu]());var p=rr(d),y=p==_e?Dv:p==lt?ih:Gl;return y(d)}function Bi(d){if(!d)return d===0?d:0;if(d=So(d),d===G||d===-G){var p=d<0?-1:1;return p*K}return d===d?d:0}function pt(d){var p=Bi(d),y=p%1;return p===p?y?p-y:p:0}function RE(d){return d?Ca(pt(d),0,V):0}function So(d){if(typeof d=="number")return d;if(Hr(d))return T;if(wn(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=wn(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=US(d);var y=Fe.test(d);return y||U.test(d)?LF(d.slice(2),y?2:8):ze.test(d)?T:+d}function OE(d){return si(d,Er(d))}function S4(d){return d?Ca(pt(d),-q,q):d===0?d:0}function Ut(d){return d==null?"":Vr(d)}var C4=Hl(function(d,p){if(Ou(p)||Cr(p)){si(p,Bn(p),d);return}for(var y in p)Qt.call(p,y)&&wu(d,y,p[y])}),PE=Hl(function(d,p){si(p,Er(p),d)}),Bh=Hl(function(d,p,y,R){si(p,Er(p),d,R)}),E4=Hl(function(d,p,y,R){si(p,Bn(p),d,R)}),R4=Fi(Nv);function O4(d,p){var y=Vl(d);return p==null?y:sC(y,p)}var P4=St(function(d,p){d=nn(d);var y=-1,R=p.length,M=R>2?p[2]:n;for(M&&hr(p[0],p[1],M)&&(R=1);++y<R;)for(var z=p[y],W=Er(z),J=-1,ae=W.length;++J<ae;){var xe=W[J],we=d[xe];(we===n||Bo(we,jl[xe])&&!Qt.call(d,xe))&&(d[xe]=z[xe])}return d}),T4=St(function(d){return d.push(n,UC),zr(TE,n,d)});function D4(d,p){return BS(d,Je(p,3),ii)}function A4(d,p){return BS(d,Je(p,3),Fv)}function $4(d,p){return d==null?d:Lv(d,Je(p,3),Er)}function k4(d,p){return d==null?d:dC(d,Je(p,3),Er)}function M4(d,p){return d&&ii(d,Je(p,3))}function I4(d,p){return d&&Fv(d,Je(p,3))}function N4(d){return d==null?[]:_h(d,Bn(d))}function L4(d){return d==null?[]:_h(d,Er(d))}function mb(d,p,y){var R=d==null?n:Ea(d,p);return R===n?y:R}function F4(d,p){return d!=null&&YC(d,p,a7)}function vb(d,p){return d!=null&&YC(d,p,l7)}var j4=zC(function(d,p,y){p!=null&&typeof p.toString!="function"&&(p=ch.call(p)),d[p]=y},yb(Rr)),z4=zC(function(d,p,y){p!=null&&typeof p.toString!="function"&&(p=ch.call(p)),Qt.call(d,p)?d[p].push(y):d[p]=[y]},Je),B4=St(Su);function Bn(d){return Cr(d)?oC(d):Vv(d)}function Er(d){return Cr(d)?oC(d,!0):b7(d)}function V4(d,p){var y={};return p=Je(p,3),ii(d,function(R,M,z){Ni(y,p(R,M,z),R)}),y}function H4(d,p){var y={};return p=Je(p,3),ii(d,function(R,M,z){Ni(y,M,p(R,M,z))}),y}var W4=Hl(function(d,p,y){Sh(d,p,y)}),TE=Hl(function(d,p,y,R){Sh(d,p,y,R)}),U4=Fi(function(d,p){var y={};if(d==null)return y;var R=!1;p=yn(p,function(z){return z=Rs(z,d),R||(R=z.length>1),z}),si(d,nb(d),y),R&&(y=xo(y,f|h|g,j7));for(var M=p.length;M--;)Yv(y,p[M]);return y});function q4(d,p){return DE(d,Fh(Je(p)))}var G4=Fi(function(d,p){return d==null?{}:x7(d,p)});function DE(d,p){if(d==null)return{};var y=yn(nb(d),function(R){return[R]});return p=Je(p),wC(d,y,function(R,M){return p(R,M[0])})}function Y4(d,p,y){p=Rs(p,d);var R=-1,M=p.length;for(M||(M=1,d=n);++R<M;){var z=d==null?n:d[ai(p[R])];z===n&&(R=M,z=y),d=zi(z)?z.call(d):z}return d}function K4(d,p,y){return d==null?d:Eu(d,p,y)}function X4(d,p,y,R){return R=typeof R=="function"?R:n,d==null?d:Eu(d,p,y,R)}var AE=HC(Bn),$E=HC(Er);function Q4(d,p,y){var R=ut(d),M=R||Ps(d)||ql(d);if(p=Je(p,4),y==null){var z=d&&d.constructor;M?y=R?new z:[]:wn(d)?y=zi(z)?Vl(fh(d)):{}:y={}}return(M?vo:ii)(d,function(W,J,ae){return p(y,W,J,ae)}),y}function J4(d,p){return d==null?!0:Yv(d,p)}function Z4(d,p,y){return d==null?d:RC(d,p,Qv(y))}function e8(d,p,y,R){return R=typeof R=="function"?R:n,d==null?d:RC(d,p,Qv(y),R)}function Gl(d){return d==null?[]:Tv(d,Bn(d))}function t8(d){return d==null?[]:Tv(d,Er(d))}function n8(d,p,y){return y===n&&(y=p,p=n),y!==n&&(y=So(y),y=y===y?y:0),p!==n&&(p=So(p),p=p===p?p:0),Ca(So(d),p,y)}function r8(d,p,y){return p=Bi(p),y===n?(y=p,p=0):y=Bi(y),d=So(d),c7(d,p,y)}function o8(d,p,y){if(y&&typeof y!="boolean"&&hr(d,p,y)&&(p=y=n),y===n&&(typeof p=="boolean"?(y=p,p=n):typeof d=="boolean"&&(y=d,d=n)),d===n&&p===n?(d=0,p=1):(d=Bi(d),p===n?(p=d,d=0):p=Bi(p)),d>p){var R=d;d=p,p=R}if(y||d%1||p%1){var M=nC();return nr(d+M*(p-d+NF("1e-"+((M+"").length-1))),p)}return Uv(d,p)}var i8=Wl(function(d,p,y){return p=p.toLowerCase(),d+(y?kE(p):p)});function kE(d){return bb(Ut(d).toLowerCase())}function ME(d){return d=Ut(d),d&&d.replace($e,KF).replace(RF,"")}function s8(d,p,y){d=Ut(d),p=Vr(p);var R=d.length;y=y===n?R:Ca(pt(y),0,R);var M=y;return y-=p.length,y>=0&&d.slice(y,M)==p}function a8(d){return d=Ut(d),d&&Lo.test(d)?d.replace(bt,XF):d}function l8(d){return d=Ut(d),d&&ki.test(d)?d.replace(ri,"\\$&"):d}var c8=Wl(function(d,p,y){return d+(y?"-":"")+p.toLowerCase()}),u8=Wl(function(d,p,y){return d+(y?" ":"")+p.toLowerCase()}),d8=LC("toLowerCase");function f8(d,p,y){d=Ut(d),p=pt(p);var R=p?Ll(d):0;if(!p||R>=p)return d;var M=(p-R)/2;return Th(mh(M),y)+d+Th(gh(M),y)}function h8(d,p,y){d=Ut(d),p=pt(p);var R=p?Ll(d):0;return p&&R<p?d+Th(p-R,y):d}function p8(d,p,y){d=Ut(d),p=pt(p);var R=p?Ll(d):0;return p&&R<p?Th(p-R,y)+d:d}function g8(d,p,y){return y||p==null?p=0:p&&(p=+p),_3(Ut(d).replace(jn,""),p||0)}function m8(d,p,y){return(y?hr(d,p,y):p===n)?p=1:p=pt(p),qv(Ut(d),p)}function v8(){var d=arguments,p=Ut(d[0]);return d.length<3?p:p.replace(d[1],d[2])}var b8=Wl(function(d,p,y){return d+(y?"_":"")+p.toLowerCase()});function y8(d,p,y){return y&&typeof y!="number"&&hr(d,p,y)&&(p=y=n),y=y===n?V:y>>>0,y?(d=Ut(d),d&&(typeof p=="string"||p!=null&&!gb(p))&&(p=Vr(p),!p&&Nl(d))?Os(jo(d),0,y):d.split(p,y)):[]}var x8=Wl(function(d,p,y){return d+(y?" ":"")+bb(p)});function w8(d,p,y){return d=Ut(d),y=y==null?0:Ca(pt(y),0,d.length),p=Vr(p),d.slice(y,y+p.length)==p}function _8(d,p,y){var R=F.templateSettings;y&&hr(d,p,y)&&(p=n),d=Ut(d),p=Bh({},p,R,WC);var M=Bh({},p.imports,R.imports,WC),z=Bn(M),W=Tv(M,z),J,ae,xe=0,we=p.interpolate||st,Re="__p += '",je=Av((p.escape||st).source+"|"+we.source+"|"+(we===Ai?He:st).source+"|"+(p.evaluate||st).source+"|$","g"),Ye="//# sourceURL="+(Qt.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++AF+"]")+`
|
|
72
72
|
`;d.replace(je,function(tt,Pt,Mt,Wr,pr,Ur){return Mt||(Mt=Wr),Re+=d.slice(xe,Ur).replace(bn,QF),Pt&&(J=!0,Re+=`' +
|
|
73
73
|
__e(`+Pt+`) +
|
|
74
74
|
'`),pr&&(ae=!0,Re+=`';
|
|
@@ -85,7 +85,7 @@ __p += '`),Mt&&(Re+=`' +
|
|
|
85
85
|
function print() { __p += __j.call(arguments, '') }
|
|
86
86
|
`:`;
|
|
87
87
|
`)+Re+`return __p
|
|
88
|
-
}`;var yt=NE(function(){return jt(z,Ye+"return "+Re).apply(n,W)});if(yt.source=Re,pb(yt))throw yt;return yt}function S8(d){return Ut(d).toLowerCase()}function C8(d){return Ut(d).toUpperCase()}function E8(d,p,y){if(d=Ut(d),d&&(y||p===n))return US(d);if(!d||!(p=Vr(p)))return d;var R=jo(d),M=jo(p),z=qS(R,M),W=GS(R,M)+1;return Os(R,z,W).join("")}function R8(d,p,y){if(d=Ut(d),d&&(y||p===n))return d.slice(0,KS(d)+1);if(!d||!(p=Vr(p)))return d;var R=jo(d),M=GS(R,jo(p))+1;return Os(R,0,M).join("")}function O8(d,p,y){if(d=Ut(d),d&&(y||p===n))return d.replace(jn,"");if(!d||!(p=Vr(p)))return d;var R=jo(d),M=qS(R,jo(p));return Os(R,M).join("")}function P8(d,p){var y=$,R=L;if(wn(p)){var M="separator"in p?p.separator:M;y="length"in p?pt(p.length):y,R="omission"in p?Vr(p.omission):R}d=Ut(d);var z=d.length;if(Nl(d)){var W=jo(d);z=W.length}if(y>=z)return d;var J=y-Ll(R);if(J<1)return R;var ae=W?Os(W,0,J).join(""):d.slice(0,J);if(M===n)return ae+R;if(W&&(J+=ae.length-J),gb(M)){if(d.slice(J).search(M)){var xe,we=ae;for(M.global||(M=Av(M.source,Ut(qe.exec(M))+"g")),M.lastIndex=0;xe=M.exec(we);)var Re=xe.index;ae=ae.slice(0,Re===n?J:Re)}}else if(d.indexOf(Vr(M),J)!=J){var je=ae.lastIndexOf(M);je>-1&&(ae=ae.slice(0,je))}return ae+R}function T8(d){return d=Ut(d),d&&Rn.test(d)?d.replace(Xt,o3):d}var D8=Wl(function(d,p,y){return d+(y?" ":"")+p.toUpperCase()}),bb=LC("toUpperCase");function IE(d,p,y){return d=Ut(d),p=y?n:p,p===n?ZF(d)?a3(d):WF(d):d.match(p)||[]}var NE=St(function(d,p){try{return zr(d,n,p)}catch(y){return pb(y)?y:new ct(y)}}),A8=Fi(function(d,p){return vo(p,function(y){y=ai(y),Ni(d,y,fb(d[y],d))}),d});function $8(d){var p=d==null?0:d.length,y=Je();return d=p?yn(d,function(R){if(typeof R[1]!="function")throw new bo(s);return[y(R[0]),R[1]]}):[],St(function(R){for(var M=-1;++M<p;){var z=d[M];if(zr(z[0],this,R))return zr(z[1],this,R)}})}function k8(d){return o7(xo(d,f))}function yb(d){return function(){return d}}function M8(d,p){return d==null||d!==d?p:d}var I8=jC(),N8=jC(!0);function Rr(d){return d}function xb(d){return gC(typeof d=="function"?d:xo(d,f))}function L8(d){return vC(xo(d,f))}function F8(d,p){return bC(d,xo(p,f))}var j8=St(function(d,p){return function(y){return Su(y,d,p)}}),z8=St(function(d,p){return function(y){return Su(d,y,p)}});function wb(d,p,y){var R=Bn(p),M=_h(p,R);y==null&&!(wn(p)&&(M.length||!R.length))&&(y=p,p=d,d=this,M=_h(p,Bn(p)));var z=!(wn(y)&&"chain"in y)||!!y.chain,W=zi(d);return vo(M,function(J){var ae=p[J];d[J]=ae,W&&(d.prototype[J]=function(){var xe=this.__chain__;if(z||xe){var we=d(this.__wrapped__),Re=we.__actions__=Sr(this.__actions__);return Re.push({func:ae,args:arguments,thisArg:d}),we.__chain__=xe,we}return ae.apply(d,ws([this.value()],arguments))})}),d}function B8(){return qn._===this&&(qn._=h3),this}function _b(){}function V8(d){return d=pt(d),St(function(p){return yC(p,d)})}var H8=Zv(yn),W8=Zv(zS),U8=Zv(Cv);function LE(d){return sb(d)?Ev(ai(d)):w7(d)}function q8(d){return function(p){return d==null?n:Ea(d,p)}}var G8=BC(),Y8=BC(!0);function Sb(){return[]}function Cb(){return!1}function K8(){return{}}function X8(){return""}function Q8(){return!0}function J8(d,p){if(d=pt(d),d<1||d>q)return[];var y=V,R=nr(d,V);p=Je(p),d-=V;for(var M=Pv(R,p);++y<d;)p(y);return M}function Z8(d){return ut(d)?yn(d,ai):Hr(d)?[d]:Sr(rE(Ut(d)))}function ej(d){var p=++d3;return Ut(d)+p}var tj=Ph(function(d,p){return d+p},0),nj=eb("ceil"),rj=Ph(function(d,p){return d/p},1),oj=eb("floor");function ij(d){return d&&d.length?wh(d,Rr,jv):n}function sj(d,p){return d&&d.length?wh(d,Je(p,2),jv):n}function aj(d){return HS(d,Rr)}function lj(d,p){return HS(d,Je(p,2))}function cj(d){return d&&d.length?wh(d,Rr,Hv):n}function uj(d,p){return d&&d.length?wh(d,Je(p,2),Hv):n}var dj=Ph(function(d,p){return d*p},1),fj=eb("round"),hj=Ph(function(d,p){return d-p},0);function pj(d){return d&&d.length?Ov(d,Rr):0}function gj(d,p){return d&&d.length?Ov(d,Je(p,2)):0}return F.after=L9,F.ary=pE,F.assign=C4,F.assignIn=PE,F.assignInWith=Bh,F.assignWith=E4,F.at=R4,F.before=gE,F.bind=fb,F.bindAll=A8,F.bindKey=mE,F.castArray=K9,F.chain=dE,F.chunk=o6,F.compact=i6,F.concat=s6,F.cond=$8,F.conforms=k8,F.constant=yb,F.countBy=p9,F.create=O4,F.curry=vE,F.curryRight=bE,F.debounce=yE,F.defaults=P4,F.defaultsDeep=T4,F.defer=F9,F.delay=j9,F.difference=a6,F.differenceBy=l6,F.differenceWith=c6,F.drop=u6,F.dropRight=d6,F.dropRightWhile=f6,F.dropWhile=h6,F.fill=p6,F.filter=m9,F.flatMap=y9,F.flatMapDeep=x9,F.flatMapDepth=w9,F.flatten=aE,F.flattenDeep=g6,F.flattenDepth=m6,F.flip=z9,F.flow=I8,F.flowRight=N8,F.fromPairs=v6,F.functions=N4,F.functionsIn=L4,F.groupBy=_9,F.initial=y6,F.intersection=x6,F.intersectionBy=w6,F.intersectionWith=_6,F.invert=j4,F.invertBy=z4,F.invokeMap=C9,F.iteratee=xb,F.keyBy=E9,F.keys=Bn,F.keysIn=Er,F.map=Ih,F.mapKeys=V4,F.mapValues=H4,F.matches=L8,F.matchesProperty=F8,F.memoize=Lh,F.merge=W4,F.mergeWith=TE,F.method=j8,F.methodOf=z8,F.mixin=wb,F.negate=Fh,F.nthArg=V8,F.omit=U4,F.omitBy=q4,F.once=B9,F.orderBy=R9,F.over=H8,F.overArgs=V9,F.overEvery=W8,F.overSome=U8,F.partial=hb,F.partialRight=xE,F.partition=O9,F.pick=G4,F.pickBy=DE,F.property=LE,F.propertyOf=q8,F.pull=R6,F.pullAll=cE,F.pullAllBy=O6,F.pullAllWith=P6,F.pullAt=T6,F.range=G8,F.rangeRight=Y8,F.rearg=H9,F.reject=D9,F.remove=D6,F.rest=W9,F.reverse=ub,F.sampleSize=$9,F.set=K4,F.setWith=X4,F.shuffle=k9,F.slice=A6,F.sortBy=N9,F.sortedUniq=F6,F.sortedUniqBy=j6,F.split=y8,F.spread=U9,F.tail=z6,F.take=B6,F.takeRight=V6,F.takeRightWhile=H6,F.takeWhile=W6,F.tap=i9,F.throttle=q9,F.thru=Mh,F.toArray=EE,F.toPairs=AE,F.toPairsIn=$E,F.toPath=Z8,F.toPlainObject=OE,F.transform=Q4,F.unary=G9,F.union=U6,F.unionBy=q6,F.unionWith=G6,F.uniq=Y6,F.uniqBy=K6,F.uniqWith=X6,F.unset=J4,F.unzip=db,F.unzipWith=uE,F.update=Z4,F.updateWith=e8,F.values=Gl,F.valuesIn=t8,F.without=Q6,F.words=IE,F.wrap=Y9,F.xor=J6,F.xorBy=Z6,F.xorWith=e9,F.zip=t9,F.zipObject=n9,F.zipObjectDeep=r9,F.zipWith=o9,F.entries=AE,F.entriesIn=$E,F.extend=PE,F.extendWith=Bh,wb(F,F),F.add=tj,F.attempt=NE,F.camelCase=i8,F.capitalize=kE,F.ceil=nj,F.clamp=n8,F.clone=X9,F.cloneDeep=J9,F.cloneDeepWith=Z9,F.cloneWith=Q9,F.conformsTo=e4,F.deburr=ME,F.defaultTo=M8,F.divide=rj,F.endsWith=s8,F.eq=Bo,F.escape=a8,F.escapeRegExp=l8,F.every=g9,F.find=v9,F.findIndex=iE,F.findKey=D4,F.findLast=b9,F.findLastIndex=sE,F.findLastKey=A4,F.floor=oj,F.forEach=fE,F.forEachRight=hE,F.forIn=$4,F.forInRight=k4,F.forOwn=M4,F.forOwnRight=I4,F.get=mb,F.gt=t4,F.gte=n4,F.has=F4,F.hasIn=vb,F.head=lE,F.identity=Rr,F.includes=S9,F.indexOf=b6,F.inRange=r8,F.invoke=B4,F.isArguments=Pa,F.isArray=ut,F.isArrayBuffer=r4,F.isArrayLike=Cr,F.isArrayLikeObject=On,F.isBoolean=o4,F.isBuffer=Ps,F.isDate=i4,F.isElement=s4,F.isEmpty=a4,F.isEqual=l4,F.isEqualWith=c4,F.isError=pb,F.isFinite=u4,F.isFunction=zi,F.isInteger=wE,F.isLength=jh,F.isMap=_E,F.isMatch=d4,F.isMatchWith=f4,F.isNaN=h4,F.isNative=p4,F.isNil=m4,F.isNull=g4,F.isNumber=SE,F.isObject=wn,F.isObjectLike=Sn,F.isPlainObject=Tu,F.isRegExp=gb,F.isSafeInteger=v4,F.isSet=CE,F.isString=zh,F.isSymbol=Hr,F.isTypedArray=ql,F.isUndefined=b4,F.isWeakMap=y4,F.isWeakSet=x4,F.join=S6,F.kebabCase=c8,F.last=_o,F.lastIndexOf=C6,F.lowerCase=u8,F.lowerFirst=d8,F.lt=w4,F.lte=_4,F.max=ij,F.maxBy=sj,F.mean=aj,F.meanBy=lj,F.min=cj,F.minBy=uj,F.stubArray=Sb,F.stubFalse=Cb,F.stubObject=K8,F.stubString=X8,F.stubTrue=Q8,F.multiply=dj,F.nth=E6,F.noConflict=B8,F.noop=_b,F.now=Nh,F.pad=f8,F.padEnd=h8,F.padStart=p8,F.parseInt=g8,F.random=o8,F.reduce=P9,F.reduceRight=T9,F.repeat=m8,F.replace=v8,F.result=Y4,F.round=fj,F.runInContext=re,F.sample=A9,F.size=M9,F.snakeCase=b8,F.some=I9,F.sortedIndex=$6,F.sortedIndexBy=k6,F.sortedIndexOf=M6,F.sortedLastIndex=I6,F.sortedLastIndexBy=N6,F.sortedLastIndexOf=L6,F.startCase=x8,F.startsWith=w8,F.subtract=hj,F.sum=pj,F.sumBy=gj,F.template=_8,F.times=J8,F.toFinite=Bi,F.toInteger=pt,F.toLength=RE,F.toLower=S8,F.toNumber=So,F.toSafeInteger=S4,F.toString=Ut,F.toUpper=C8,F.trim=E8,F.trimEnd=R8,F.trimStart=O8,F.truncate=P8,F.unescape=T8,F.uniqueId=ej,F.upperCase=D8,F.upperFirst=bb,F.each=fE,F.eachRight=hE,F.first=lE,wb(F,function(){var d={};return ii(F,function(p,y){Qt.call(F.prototype,y)||(d[y]=p)}),d}(),{chain:!1}),F.VERSION=r,vo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){F[d].placeholder=F}),vo(["drop","take"],function(d,p){kt.prototype[d]=function(y){y=y===n?1:Mn(pt(y),0);var R=this.__filtered__&&!p?new kt(this):this.clone();return R.__filtered__?R.__takeCount__=nr(y,R.__takeCount__):R.__views__.push({size:nr(y,V),type:d+(R.__dir__<0?"Right":"")}),R},kt.prototype[d+"Right"]=function(y){return this.reverse()[d](y).reverse()}}),vo(["filter","map","takeWhile"],function(d,p){var y=p+1,R=y==ee||y==Z;kt.prototype[d]=function(M){var z=this.clone();return z.__iteratees__.push({iteratee:Je(M,3),type:y}),z.__filtered__=z.__filtered__||R,z}}),vo(["head","last"],function(d,p){var y="take"+(p?"Right":"");kt.prototype[d]=function(){return this[y](1).value()[0]}}),vo(["initial","tail"],function(d,p){var y="drop"+(p?"":"Right");kt.prototype[d]=function(){return this.__filtered__?new kt(this):this[y](1)}}),kt.prototype.compact=function(){return this.filter(Rr)},kt.prototype.find=function(d){return this.filter(d).head()},kt.prototype.findLast=function(d){return this.reverse().find(d)},kt.prototype.invokeMap=St(function(d,p){return typeof d=="function"?new kt(this):this.map(function(y){return Su(y,d,p)})}),kt.prototype.reject=function(d){return this.filter(Fh(Je(d)))},kt.prototype.slice=function(d,p){d=pt(d);var y=this;return y.__filtered__&&(d>0||p<0)?new kt(y):(d<0?y=y.takeRight(-d):d&&(y=y.drop(d)),p!==n&&(p=pt(p),y=p<0?y.dropRight(-p):y.take(p-d)),y)},kt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},kt.prototype.toArray=function(){return this.take(V)},ii(kt.prototype,function(d,p){var y=/^(?:filter|find|map|reject)|While$/.test(p),R=/^(?:head|last)$/.test(p),M=F[R?"take"+(p=="last"?"Right":""):p],z=R||/^find/.test(p);M&&(F.prototype[p]=function(){var W=this.__wrapped__,J=R?[1]:arguments,ae=W instanceof kt,xe=J[0],we=ae||ut(W),Re=function(Pt){var Mt=M.apply(F,ws([Pt],J));return R&&je?Mt[0]:Mt};we&&y&&typeof xe=="function"&&xe.length!=1&&(ae=we=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=z&&!je,yt=ae&&!Ye;if(!z&&we){W=yt?W:new kt(this);var tt=d.apply(W,J);return tt.__actions__.push({func:Mh,args:[Re],thisArg:n}),new yo(tt,je)}return et&&yt?d.apply(this,J):(tt=this.thru(Re),et?R?tt.value()[0]:tt.value():tt)})}),vo(["pop","push","shift","sort","splice","unshift"],function(d){var p=sh[d],y=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",R=/^(?:pop|shift)$/.test(d);F.prototype[d]=function(){var M=arguments;if(R&&!this.__chain__){var z=this.value();return p.apply(ut(z)?z:[],M)}return this[y](function(W){return p.apply(ut(W)?W:[],M)})}}),ii(kt.prototype,function(d,p){var y=F[p];if(y){var R=y.name+"";Qt.call(Bl,R)||(Bl[R]=[]),Bl[R].push({name:p,func:y})}}),Bl[Oh(n,x).name]=[{name:"wrapper",func:n}],kt.prototype.clone=T3,kt.prototype.reverse=D3,kt.prototype.value=A3,F.prototype.at=s9,F.prototype.chain=a9,F.prototype.commit=l9,F.prototype.next=c9,F.prototype.plant=d9,F.prototype.reverse=f9,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=h9,F.prototype.first=F.prototype.head,mu&&(F.prototype[mu]=u9),F},Fl=l3();xa?((xa.exports=Fl)._=Fl,xv._=Fl):qn._=Fl}).call(Vs)})(pg,pg.exports);var uc=pg.exports;const ol=nu(uc);function rR({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10};return t||(t={}),ww.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]});const c=t[l].reduce((u,f)=>Math.max(u,f.y+f.h),0);a.y=a.y===0?0:c,t[l].push(a)}),t}function oR(e,t){t&&ww.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const $e=Z2()(sD((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:C0},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{deleteSheet:n=>{e(r=>{var i,s,a,l;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(c=>c.id===n);o!==void 0&&o>-1&&((s=r.dashboard.sheets)==null||s.splice(o,1),r.selectedSheetId=(l=(a=r.dashboard.sheets)==null?void 0:a[0])==null?void 0:l.id)})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{ww.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&uc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&uc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&uc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&uc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(h=>h.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&uc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n];const o=(s=r.dashboard.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId);rR({id:n.id,layouts:o==null?void 0:o.layouts,y:0,initialHeight:8,minH:7,w:10})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1);const l=(s=r.dashboard.sheets)==null?void 0:s.find(c=>c.id===r.selectedSheetId);oR(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(g=>g.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(g=>g.id===r);if(a){const g=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===o.id);g>-1&&((h=a.cards)==null||h.splice(g,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0,h=0;o==="start"&&(f=0),rR({id:r.id,layouts:s.layouts,minH:10,x:h,y:f}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),oR(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(g=>g.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.splice(s,1),(h=o.onRemoveCard)==null||h.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{Fz({card:n,dataPoint:r,set:e,get:t})}}}))),co=()=>$e(e=>e.actions);var Tf=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(){}},Hc=typeof window>"u"||"Deno"in window;function Po(){}function jz(e,t){return typeof e=="function"?e(t):e}function R0(e){return typeof e=="number"&&e>=0&&e!==1/0}function hD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function iR(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Cw(s,t.options))return!1}else if(!Ad(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function sR(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Dd(t.options.mutationKey)!==Dd(i))return!1}else if(!Ad(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Cw(e,t){return((t==null?void 0:t.queryKeyHashFn)||Dd)(e)}function Dd(e){return JSON.stringify(e,(t,n)=>P0(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Ad(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ad(e[n],t[n])):!1}function pD(e,t){if(e===t)return e;const n=aR(e)&&aR(t);if(n||P0(e)&&P0(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=pD(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function O0(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function aR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function P0(e){if(!lR(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!lR(n)||!n.hasOwnProperty("isPrototypeOf"))}function lR(e){return Object.prototype.toString.call(e)==="[object Object]"}function zz(e){return new Promise(t=>{setTimeout(t,e)})}function T0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?pD(e,t):t}function Bz(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Vz(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xa,Hs,Cc,I2,Hz=(I2=class extends Tf{constructor(){super();Xe(this,Xa,void 0);Xe(this,Hs,void 0);Xe(this,Cc,void 0);Ve(this,Cc,t=>{if(!Hc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){oe(this,Hs)||this.setEventListener(oe(this,Cc))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Hs))==null||t.call(this),Ve(this,Hs,void 0))}setEventListener(t){var n;Ve(this,Cc,t),(n=oe(this,Hs))==null||n.call(this),Ve(this,Hs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){oe(this,Xa)!==t&&(Ve(this,Xa,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof oe(this,Xa)=="boolean"?oe(this,Xa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Xa=new WeakMap,Hs=new WeakMap,Cc=new WeakMap,I2),gg=new Hz,Ec,Ws,Rc,N2,Wz=(N2=class extends Tf{constructor(){super();Xe(this,Ec,!0);Xe(this,Ws,void 0);Xe(this,Rc,void 0);Ve(this,Rc,t=>{if(!Hc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){oe(this,Ws)||this.setEventListener(oe(this,Rc))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Ws))==null||t.call(this),Ve(this,Ws,void 0))}setEventListener(t){var n;Ve(this,Rc,t),(n=oe(this,Ws))==null||n.call(this),Ve(this,Ws,t(this.setOnline.bind(this)))}setOnline(t){oe(this,Ec)!==t&&(Ve(this,Ec,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return oe(this,Ec)}},Ec=new WeakMap,Ws=new WeakMap,Rc=new WeakMap,N2),mg=new Wz;function Uz(e){return Math.min(1e3*2**e,3e4)}function sm(e){return(e??"online")==="online"?mg.isOnline():!0}var gD=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function kb(e){return e instanceof gD}function mD(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((w,x)=>{i=w,s=x}),l=w=>{var x;r||(g(new gD(w)),(x=e.abort)==null||x.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!gg.isFocused()||e.networkMode!=="always"&&!mg.isOnline(),h=w=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,w),o==null||o(),i(w))},g=w=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,w),o==null||o(),s(w))},v=()=>new Promise(w=>{var x;o=_=>{const S=r||!f();return S&&w(_),S},(x=e.onPause)==null||x.call(e)}).then(()=>{var w;o=void 0,r||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(r)return;let w;try{w=e.fn()}catch(x){w=Promise.reject(x)}Promise.resolve(w).then(h).catch(x=>{var P;if(r)return;const _=e.retry??(Hc?0:3),S=e.retryDelay??Uz,C=typeof S=="function"?S(n,x):S,E=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,x);if(t||!E){g(x);return}n++,(P=e.onFail)==null||P.call(e,n,x),zz(C).then(()=>{if(f())return v()}).then(()=>{t?g(x):b()})})};return sm(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function qz(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},s=h=>{let g;t++;try{g=h()}finally{t--,t||c()}return g},a=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...g)=>{a(()=>{h(...g)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(g=>{n(g)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var Xn=qz(),Qa,L2,vD=(L2=class{constructor(){Xe(this,Qa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),R0(this.gcTime)&&Ve(this,Qa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Hc?1/0:5*60*1e3))}clearGcTimeout(){oe(this,Qa)&&(clearTimeout(oe(this,Qa)),Ve(this,Qa,void 0))}},Qa=new WeakMap,L2),Oc,Pc,Eo,Us,Ro,Vn,gf,Ja,Tc,Xp,Go,qi,F2,Gz=(F2=class extends vD{constructor(t){super();Xe(this,Tc);Xe(this,Go);Xe(this,Oc,void 0);Xe(this,Pc,void 0);Xe(this,Eo,void 0);Xe(this,Us,void 0);Xe(this,Ro,void 0);Xe(this,Vn,void 0);Xe(this,gf,void 0);Xe(this,Ja,void 0);Ve(this,Ja,!1),Ve(this,gf,t.defaultOptions),Ct(this,Tc,Xp).call(this,t.options),Ve(this,Vn,[]),Ve(this,Eo,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,Oc,t.state||Yz(this.options)),this.state=oe(this,Oc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!oe(this,Vn).length&&this.state.fetchStatus==="idle"&&oe(this,Eo).remove(this)}setData(t,n){const r=T0(this.state.data,t,this.options);return Ct(this,Go,qi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ct(this,Go,qi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=oe(this,Us);return(r=oe(this,Ro))==null||r.cancel(t),n?n.then(Po).catch(Po):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(oe(this,Oc))}isActive(){return oe(this,Vn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||oe(this,Vn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!hD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=oe(this,Vn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,Ro))==null||n.continue()}onOnline(){var n;const t=oe(this,Vn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,Ro))==null||n.continue()}addObserver(t){oe(this,Vn).includes(t)||(oe(this,Vn).push(t),this.clearGcTimeout(),oe(this,Eo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){oe(this,Vn).includes(t)&&(Ve(this,Vn,oe(this,Vn).filter(n=>n!==t)),oe(this,Vn).length||(oe(this,Ro)&&(oe(this,Ja)?oe(this,Ro).cancel({revert:!0}):oe(this,Ro).cancelRetry()),this.scheduleGc()),oe(this,Eo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return oe(this,Vn).length}invalidate(){this.state.isInvalidated||Ct(this,Go,qi).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(oe(this,Us))return(c=oe(this,Ro))==null||c.continueRetry(),oe(this,Us)}if(t&&Ct(this,Tc,Xp).call(this,t),!this.options.queryFn){const g=oe(this,Vn).find(v=>v.options.queryFn);g&&Ct(this,Tc,Xp).call(this,g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(Ve(this,Ja,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,Ja,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ve(this,Pc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Ct(this,Go,qi).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=g=>{var v,b,w,x;kb(g)&&g.silent||Ct(this,Go,qi).call(this,{type:"error",error:g}),kb(g)||((b=(v=oe(this,Eo).config).onError)==null||b.call(v,g,this),(x=(w=oe(this,Eo).config).onSettled)==null||x.call(w,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Ro,mD({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var v,b,w,x;if(typeof g>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(b=(v=oe(this,Eo).config).onSuccess)==null||b.call(v,g,this),(x=(w=oe(this,Eo).config).onSettled)==null||x.call(w,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,v)=>{Ct(this,Go,qi).call(this,{type:"failed",failureCount:g,error:v})},onPause:()=>{Ct(this,Go,qi).call(this,{type:"pause"})},onContinue:()=>{Ct(this,Go,qi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Us,oe(this,Ro).promise),oe(this,Us)}},Oc=new WeakMap,Pc=new WeakMap,Eo=new WeakMap,Us=new WeakMap,Ro=new WeakMap,Vn=new WeakMap,gf=new WeakMap,Ja=new WeakMap,Tc=new WeakSet,Xp=function(t){this.options={...oe(this,gf),...t},this.updateGcTime(this.options.gcTime)},Go=new WeakSet,qi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:sm(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return kb(o)&&o.revert&&oe(this,Pc)?{...oe(this,Pc),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Xn.batch(()=>{oe(this,Vn).forEach(r=>{r.onQueryUpdate()}),oe(this,Eo).notify({query:this,type:"updated",action:t})})},F2);function Yz(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var fi,j2,bD=(j2=class extends Tf{constructor(t={}){super();Xe(this,fi,void 0);this.config=t,Ve(this,fi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Cw(o,n);let s=this.get(i);return s||(s=new Gz({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){oe(this,fi).has(t.queryHash)||(oe(this,fi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=oe(this,fi).get(t.queryHash);n&&(t.destroy(),n===t&&oe(this,fi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Xn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return oe(this,fi).get(t)}getAll(){return[...oe(this,fi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>iR(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>iR(t,r)):n}notify(t){Xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Xn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Xn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fi=new WeakMap,j2),hi,mf,Xr,Dc,pi,Ls,z2,Kz=(z2=class extends vD{constructor(t){super();Xe(this,pi);Xe(this,hi,void 0);Xe(this,mf,void 0);Xe(this,Xr,void 0);Xe(this,Dc,void 0);this.mutationId=t.mutationId,Ve(this,mf,t.defaultOptions),Ve(this,Xr,t.mutationCache),Ve(this,hi,[]),this.state=t.state||Xz(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...oe(this,mf),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){oe(this,hi).includes(t)||(oe(this,hi).push(t),this.clearGcTimeout(),oe(this,Xr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,hi,oe(this,hi).filter(n=>n!==t)),this.scheduleGc(),oe(this,Xr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){oe(this,hi).length||(this.state.status==="pending"?this.scheduleGc():oe(this,Xr).remove(this))}continue(){var t;return((t=oe(this,Dc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,h,g,v,b,w,x,_,S,C,E,P,A;const n=()=>(Ve(this,Dc,mD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,I)=>{Ct(this,pi,Ls).call(this,{type:"failed",failureCount:k,error:I})},onPause:()=>{Ct(this,pi,Ls).call(this,{type:"pause"})},onContinue:()=>{Ct(this,pi,Ls).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),oe(this,Dc).promise),r=this.state.status==="pending";try{if(!r){Ct(this,pi,Ls).call(this,{type:"pending",variables:t}),await((i=(o=oe(this,Xr).config).onMutate)==null?void 0:i.call(o,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Ct(this,pi,Ls).call(this,{type:"pending",context:I,variables:t})}const k=await n();return await((c=(l=oe(this,Xr).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,k,t,this.state.context)),await((g=(h=oe(this,Xr).config).onSettled)==null?void 0:g.call(h,k,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,k,null,t,this.state.context)),Ct(this,pi,Ls).call(this,{type:"success",data:k}),k}catch(k){try{throw await((x=(w=oe(this,Xr).config).onError)==null?void 0:x.call(w,k,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,k,t,this.state.context)),await((E=(C=oe(this,Xr).config).onSettled)==null?void 0:E.call(C,void 0,k,this.state.variables,this.state.context,this)),await((A=(P=this.options).onSettled)==null?void 0:A.call(P,void 0,k,t,this.state.context)),k}finally{Ct(this,pi,Ls).call(this,{type:"error",error:k})}}}},hi=new WeakMap,mf=new WeakMap,Xr=new WeakMap,Dc=new WeakMap,pi=new WeakSet,Ls=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!sm(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Xn.batch(()=>{oe(this,hi).forEach(r=>{r.onMutationUpdate(t)}),oe(this,Xr).notify({mutation:this,type:"updated",action:t})})},z2);function Xz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Oo,vf,Za,B2,Qz=(B2=class extends Tf{constructor(t={}){super();Xe(this,Oo,void 0);Xe(this,vf,void 0);Xe(this,Za,void 0);this.config=t,Ve(this,Oo,[]),Ve(this,vf,0)}build(t,n,r){const o=new Kz({mutationCache:this,mutationId:++Vh(this,vf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){oe(this,Oo).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,Oo,oe(this,Oo).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Xn.batch(()=>{oe(this,Oo).forEach(t=>{this.remove(t)})})}getAll(){return oe(this,Oo)}find(t){const n={exact:!0,...t};return oe(this,Oo).find(r=>sR(n,r))}findAll(t={}){return oe(this,Oo).filter(n=>sR(t,n))}notify(t){Xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,Za,(oe(this,Za)??Promise.resolve()).then(()=>{const t=oe(this,Oo).filter(n=>n.state.isPaused);return Xn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Po)),Promise.resolve()))}).then(()=>{Ve(this,Za,void 0)})),oe(this,Za)}},Oo=new WeakMap,vf=new WeakMap,Za=new WeakMap,B2);function Jz(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,w,x,_;const o=t.options,i=(w=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:w.direction,s=((x=t.state.data)==null?void 0:x.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(S,C,E)=>{if(c)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const P={queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};u(P);const A=await f(P),{maxPages:k}=t.options,I=E?Vz:Bz;return{pages:I(S.pages,A,k),pageParams:I(S.pageParams,C,k)}};let g;if(i&&s.length){const S=i==="backward",C=S?Zz:cR,E={pages:s,pageParams:a},P=C(o,E);g=await h(E,P,S)}else{g=await h(l,a[0]??o.initialPageParam);const S=e??s.length;for(let C=1;C<S;C++){const E=cR(o,g);g=await h(g,E)}}return g};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function cR(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function Zz(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var In,qs,Gs,Ac,$c,Ys,kc,Mc,V2,eB=(V2=class{constructor(e={}){Xe(this,In,void 0);Xe(this,qs,void 0);Xe(this,Gs,void 0);Xe(this,Ac,void 0);Xe(this,$c,void 0);Xe(this,Ys,void 0);Xe(this,kc,void 0);Xe(this,Mc,void 0);Ve(this,In,e.queryCache||new bD),Ve(this,qs,e.mutationCache||new Qz),Ve(this,Gs,e.defaultOptions||{}),Ve(this,Ac,new Map),Ve(this,$c,new Map),Ve(this,Ys,0)}mount(){Vh(this,Ys)._++,oe(this,Ys)===1&&(Ve(this,kc,gg.subscribe(()=>{gg.isFocused()&&(this.resumePausedMutations(),oe(this,In).onFocus())})),Ve(this,Mc,mg.subscribe(()=>{mg.isOnline()&&(this.resumePausedMutations(),oe(this,In).onOnline())})))}unmount(){var e,t;Vh(this,Ys)._--,oe(this,Ys)===0&&((e=oe(this,kc))==null||e.call(this),Ve(this,kc,void 0),(t=oe(this,Mc))==null||t.call(this),Ve(this,Mc,void 0))}isFetching(e){return oe(this,In).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return oe(this,qs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=oe(this,In).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=oe(this,In).find({queryKey:e}),o=r==null?void 0:r.state.data,i=jz(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return oe(this,In).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Xn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=oe(this,In).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=oe(this,In);Xn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=oe(this,In),r={type:"active",...e};return Xn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Xn.batch(()=>oe(this,In).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Po).catch(Po)}invalidateQueries(e={},t={}){return Xn.batch(()=>{if(oe(this,In).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Xn.batch(()=>oe(this,In).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Po)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Po)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=oe(this,In).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Po).catch(Po)}fetchInfiniteQuery(e){return e.behavior=Jz(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Po).catch(Po)}resumePausedMutations(){return oe(this,qs).resumePausedMutations()}getQueryCache(){return oe(this,In)}getMutationCache(){return oe(this,qs)}getDefaultOptions(){return oe(this,Gs)}setDefaultOptions(e){Ve(this,Gs,e)}setQueryDefaults(e,t){oe(this,Ac).set(Dd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...oe(this,Ac).values()];let n={};return t.forEach(r=>{Ad(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){oe(this,$c).set(Dd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...oe(this,$c).values()];let n={};return t.forEach(r=>{Ad(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...oe(this,Gs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Cw(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...oe(this,Gs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){oe(this,In).clear(),oe(this,qs).clear()}},In=new WeakMap,qs=new WeakMap,Gs=new WeakMap,Ac=new WeakMap,$c=new WeakMap,Ys=new WeakMap,kc=new WeakMap,Mc=new WeakMap,V2),$r,fn,bf,vr,el,Ic,gi,yf,Nc,Lc,tl,nl,Ks,Fc,rl,ed,xf,D0,wf,A0,_f,$0,Sf,k0,Cf,M0,Ef,I0,Rf,N0,em,yD,H2,tB=(H2=class extends Tf{constructor(t,n){super();Xe(this,rl);Xe(this,xf);Xe(this,wf);Xe(this,_f);Xe(this,Sf);Xe(this,Cf);Xe(this,Ef);Xe(this,Rf);Xe(this,em);Xe(this,$r,void 0);Xe(this,fn,void 0);Xe(this,bf,void 0);Xe(this,vr,void 0);Xe(this,el,void 0);Xe(this,Ic,void 0);Xe(this,gi,void 0);Xe(this,yf,void 0);Xe(this,Nc,void 0);Xe(this,Lc,void 0);Xe(this,tl,void 0);Xe(this,nl,void 0);Xe(this,Ks,void 0);Xe(this,Fc,new Set);this.options=n,Ve(this,$r,t),Ve(this,gi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(oe(this,fn).addObserver(this),uR(oe(this,fn),this.options)?Ct(this,rl,ed).call(this):this.updateResult(),Ct(this,Sf,k0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L0(oe(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L0(oe(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ct(this,Cf,M0).call(this),Ct(this,Ef,I0).call(this),oe(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=oe(this,fn);if(this.options=oe(this,$r).defaultQueryOptions(t),O0(r,this.options)||oe(this,$r).getQueryCache().notify({type:"observerOptionsUpdated",query:oe(this,fn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Ct(this,Rf,N0).call(this);const i=this.hasListeners();i&&dR(oe(this,fn),o,this.options,r)&&Ct(this,rl,ed).call(this),this.updateResult(n),i&&(oe(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ct(this,xf,D0).call(this);const s=Ct(this,wf,A0).call(this);i&&(oe(this,fn)!==o||this.options.enabled!==r.enabled||s!==oe(this,Ks))&&Ct(this,_f,$0).call(this,s)}getOptimisticResult(t){const n=oe(this,$r).getQueryCache().build(oe(this,$r),t),r=this.createResult(n,t);return rB(this,r)&&(Ve(this,vr,r),Ve(this,Ic,this.options),Ve(this,el,oe(this,fn).state)),r}getCurrentResult(){return oe(this,vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(oe(this,Fc).add(r),t[r])})}),n}getCurrentQuery(){return oe(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=oe(this,$r).defaultQueryOptions(t),r=oe(this,$r).getQueryCache().build(oe(this,$r),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ct(this,rl,ed).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),oe(this,vr)))}createResult(t,n){var P;const r=oe(this,fn),o=this.options,i=oe(this,vr),s=oe(this,el),a=oe(this,Ic),c=t!==r?t.state:oe(this,bf),{state:u}=t;let{error:f,errorUpdatedAt:h,fetchStatus:g,status:v}=u,b=!1,w;if(n._optimisticResults){const A=this.hasListeners(),k=!A&&uR(t,n),I=A&&dR(t,r,n,o);(k||I)&&(g=sm(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===oe(this,yf))w=oe(this,Nc);else try{Ve(this,yf,n.select),w=n.select(u.data),w=T0(i==null?void 0:i.data,w,n),Ve(this,Nc,w),Ve(this,gi,null)}catch(A){Ve(this,gi,A)}else w=u.data;if(typeof n.placeholderData<"u"&&typeof w>"u"&&v==="pending"){let A;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=i.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((P=oe(this,Lc))==null?void 0:P.state.data,oe(this,Lc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ve(this,gi,null)}catch(k){Ve(this,gi,k)}typeof A<"u"&&(v="success",w=T0(i==null?void 0:i.data,A,n),b=!0)}oe(this,gi)&&(f=oe(this,gi),w=oe(this,Nc),h=Date.now(),v="error");const x=g==="fetching",_=v==="pending",S=v==="error",C=_&&x;return{status:v,fetchStatus:g,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:C,isLoading:C,data:w,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:b,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:Ew(t,n),refetch:this.refetch}}updateResult(t){const n=oe(this,vr),r=this.createResult(oe(this,fn),this.options);if(Ve(this,el,oe(this,fn).state),Ve(this,Ic,this.options),oe(this,el).data!==void 0&&Ve(this,Lc,oe(this,fn)),O0(r,n))return;Ve(this,vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!oe(this,Fc).size)return!0;const l=new Set(a??oe(this,Fc));return this.options.throwOnError&&l.add("error"),Object.keys(oe(this,vr)).some(c=>{const u=c;return oe(this,vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ct(this,em,yD).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ct(this,Sf,k0).call(this)}},$r=new WeakMap,fn=new WeakMap,bf=new WeakMap,vr=new WeakMap,el=new WeakMap,Ic=new WeakMap,gi=new WeakMap,yf=new WeakMap,Nc=new WeakMap,Lc=new WeakMap,tl=new WeakMap,nl=new WeakMap,Ks=new WeakMap,Fc=new WeakMap,rl=new WeakSet,ed=function(t){Ct(this,Rf,N0).call(this);let n=oe(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Po)),n},xf=new WeakSet,D0=function(){if(Ct(this,Cf,M0).call(this),Hc||oe(this,vr).isStale||!R0(this.options.staleTime))return;const n=hD(oe(this,vr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,tl,setTimeout(()=>{oe(this,vr).isStale||this.updateResult()},n))},wf=new WeakSet,A0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(oe(this,fn)):this.options.refetchInterval)??!1},_f=new WeakSet,$0=function(t){Ct(this,Ef,I0).call(this),Ve(this,Ks,t),!(Hc||this.options.enabled===!1||!R0(oe(this,Ks))||oe(this,Ks)===0)&&Ve(this,nl,setInterval(()=>{(this.options.refetchIntervalInBackground||gg.isFocused())&&Ct(this,rl,ed).call(this)},oe(this,Ks)))},Sf=new WeakSet,k0=function(){Ct(this,xf,D0).call(this),Ct(this,_f,$0).call(this,Ct(this,wf,A0).call(this))},Cf=new WeakSet,M0=function(){oe(this,tl)&&(clearTimeout(oe(this,tl)),Ve(this,tl,void 0))},Ef=new WeakSet,I0=function(){oe(this,nl)&&(clearInterval(oe(this,nl)),Ve(this,nl,void 0))},Rf=new WeakSet,N0=function(){const t=oe(this,$r).getQueryCache().build(oe(this,$r),this.options);if(t===oe(this,fn))return;const n=oe(this,fn);Ve(this,fn,t),Ve(this,bf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},em=new WeakSet,yD=function(t){Xn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(oe(this,vr))}),oe(this,$r).getQueryCache().notify({query:oe(this,fn),type:"observerResultsUpdated"})})},H2);function nB(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function uR(e,t){return nB(e,t)||e.state.dataUpdatedAt>0&&L0(e,t,t.refetchOnMount)}function L0(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ew(e,t)}return!1}function dR(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Ew(e,n)}function Ew(e,t){return e.isStaleByTime(t.staleTime)}function rB(e,t){return!O0(e.getCurrentResult(),t)}var xD=H.createContext(void 0),wD=e=>{const t=H.useContext(xD);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},oB=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),H.createElement(xD.Provider,{value:e},t)),_D=H.createContext(!1),iB=()=>H.useContext(_D);_D.Provider;function sB(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var aB=H.createContext(sB()),lB=()=>H.useContext(aB);function cB(e,t){return typeof e=="function"?e(...t):!!e}var uB=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},dB=e=>{H.useEffect(()=>{e.clearReset()},[e])},fB=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&cB(n,[e.error,r]),hB=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},pB=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,gB=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function mB(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=wD(n),o=iB(),i=lB(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",hB(s),uB(s,i),dB(i);const[a]=H.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(H.useSyncExternalStore(H.useCallback(c=>{const u=o?()=>{}:a.subscribe(Xn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),H.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),pB(s,l))throw gB(s,a,i);if(fB({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Df(e,t){return mB(e,tB,t)}const vB={theme:"system",setTheme:()=>null},SD=m.createContext(vB);function bB({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return O.jsx(SD.Provider,{...r,value:s,children:e})}const CD=()=>{const e=m.useContext(SD);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function yB(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function ED(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function fR(e,t){const n=ED(e);return n==="dark"?ol.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function xB({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=Df({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>yB(e==null?void 0:e.accessToken),enabled:!1}),{theme:c,setTheme:u}=CD(),f=$e(A=>A.dashboard.globalStyle),{setDashboard:h,setSelectedSheetId:g,setStyle:v,setOnSaveFunction:b}=$e(A=>A.actions);$e(A=>A.actions.setCustomCards);const w=$e(A=>A.actions.setFilterValues),x=$e(A=>A.actions.setBookmarkKey),_=$e(A=>A.actions.setAuthToken),S=$e(A=>A.actions.setThemeStyle),C=$e(A=>A.actions.setDashboardTheme),E=$e(A=>A.actions.setOnEvent);m.useEffect(()=>{if(c){const A=ED(c);C(A)}},[c,C]),m.useEffect(()=>{n&&u(n)},[n,u]);function P(){const A=ol.cloneDeep(C0),k=ol.merge(A,f);if(t){const I=ol.merge(k,t),$=fR(c,I);S($),v(I)}else{const I=fR(c,k);S(I),v(C0)}}return m.useEffect(()=>{i&&i.dashboard&&P()},[c,t,f]),m.useEffect(()=>{var L;if(!i||!i.dashboard)return;const A=i.dashboard,k=DL(A.id),I=JSON.parse(localStorage.getItem(k)||"[]"),$=I.find(j=>j.default===!0);if($)h($.template),P(),x($.name),$.filterValues&&w($.filterValues);else{h(A),P();const j=I.find(Q=>(Q==null?void 0:Q.name)==="Original");j?j.template=A:I.push({name:"Original",template:A,default:!1}),localStorage.setItem(k,JSON.stringify(I))}g((L=A.sheets)==null?void 0:L[0].id)},[i,h,g,w,x]),m.useEffect(()=>{r&&b(r),o&&E(o)},[r,b,o,E]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function am({className:e,...t}){return O.jsx("div",{className:Ce("animate-pulse rounded-md bg-muted",e),...t})}const Rw=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Rw.displayName="Card";const lm=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("flex flex-col space-y-1.5 p-6",e),...t}));lm.displayName="CardHeader";const Af=H.forwardRef(({className:e,...t},n)=>O.jsx("h3",{ref:n,className:Ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));Af.displayName="CardTitle";const Ow=H.forwardRef(({className:e,...t},n)=>O.jsx("p",{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));Ow.displayName="CardDescription";const cm=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("px-6 pt-0",e),...t}));cm.displayName="CardContent";const Pw=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("flex items-center p-6 pt-0",e),...t}));Pw.displayName="CardFooter";function RD({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,showAssistant:h,...g}){$e(_=>_.selectedSheetId);const v=$e(_=>_.themeStyle),b=$e(_=>_.isSessionExpired),{isLoading:w,isError:x}=xB({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return w||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?O.jsx(o,{message:"loading"}):O.jsx("div",{className:"flex items-center gap-3",children:O.jsx(am,{className:"h-1 w-full dark:h-[2px]"})})):x?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),O.jsx(i,{})):O.jsx("div",{children:"Error"})):b?(r==null||r({type:"error",message:"Session Expired"}),O.jsx("div",{className:"flex h-full items-center justify-center",children:O.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[O.jsx(Af,{children:"Session Expired"}),O.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):O.jsx("div",{className:Ce("flex h-full flex-col justify-between",v==null?void 0:v.dashboardPanel,e),role:"dashboard-panel",...g})}function he(){return he=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},he.apply(this,arguments)}function Me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Zn(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:g,...v}=f,b=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:w},g)}function u(f,h){const g=(h==null?void 0:h[e][l])||a,v=m.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,wB(o,...t)]}function wB(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function _B(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cs(...e){return t=>e.forEach(n=>_B(n,t))}function _t(...e){return m.useCallback(cs(...e),e)}const F0=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(CB);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(j0,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(j0,he({},r,{ref:t}),n)});F0.displayName="Slot";const j0=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...EB(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});j0.displayName="SlotClone";const SB=({children:e})=>m.createElement(m.Fragment,null,e);function CB(e){return m.isValidElement(e)&&e.type===SB}function EB(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function um(e){const t=e+"CollectionProvider",[n,r]=Zn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:v,children:b}=g,w=m.useRef(null),x=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:x,collectionRef:w},b)},a=e+"CollectionSlot",l=m.forwardRef((g,v)=>{const{scope:b,children:w}=g,x=i(a,b),_=_t(v,x.collectionRef);return m.createElement(F0,{ref:_},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((g,v)=>{const{scope:b,children:w,...x}=g,_=m.useRef(null),S=_t(v,_),C=i(c,b);return m.useEffect(()=>(C.itemMap.set(_,{ref:_,...x}),()=>void C.itemMap.delete(_))),m.createElement(F0,{[u]:"",ref:S},w)});function h(g){const v=i(e+"CollectionConsumer",g);return m.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((C,E)=>x.indexOf(C.ref.current)-x.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},h,r]}const ur=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},RB=H.useId||(()=>{});let OB=0;function Jo(e){const[t,n]=H.useState(RB());return ur(()=>{e||n(r=>r??String(OB++))},[e]),e||(t?`radix-${t}`:"")}const OD=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(TB);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(z0,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(z0,he({},r,{ref:t}),n)});OD.displayName="Slot";const z0=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...DB(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});z0.displayName="SlotClone";const PB=({children:e})=>m.createElement(m.Fragment,null,e);function TB(e){return m.isValidElement(e)&&e.type===PB}function DB(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const AB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=AB.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?OD:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,he({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function PD(e,t){e&&Mo.flushSync(()=>e.dispatchEvent(t))}function Ln(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function wr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=$B({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Ln(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function $B({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=Ln(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const kB=m.createContext(void 0);function _l(e){const t=m.useContext(kB);return e||t||"ltr"}const Mb="rovingFocusGroup.onEntryFocus",MB={bubbles:!1,cancelable:!0},Tw="RovingFocusGroup",[B0,TD,IB]=um(Tw),[NB,ou]=Zn(Tw,[IB]),[LB,FB]=NB(Tw),jB=m.forwardRef((e,t)=>m.createElement(B0.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(B0.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(zB,he({},e,{ref:t}))))),zB=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),h=_t(t,f),g=_l(i),[v=null,b]=wr({prop:s,defaultProp:a,onChange:l}),[w,x]=m.useState(!1),_=Ln(c),S=TD(n),C=m.useRef(!1),[E,P]=m.useState(0);return m.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Mb,_),()=>A.removeEventListener(Mb,_)},[_]),m.createElement(LB,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(A=>b(A),[b]),onItemShiftTab:m.useCallback(()=>x(!0),[]),onFocusableItemAdd:m.useCallback(()=>P(A=>A+1),[]),onFocusableItemRemove:m.useCallback(()=>P(A=>A-1),[])},m.createElement(Qe.div,he({tabIndex:w||E===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{C.current=!0}),onFocus:Me(e.onFocus,A=>{const k=!C.current;if(A.target===A.currentTarget&&k&&!w){const I=new CustomEvent(Mb,MB);if(A.currentTarget.dispatchEvent(I),!I.defaultPrevented){const $=S().filter(B=>B.focusable),L=$.find(B=>B.active),j=$.find(B=>B.id===v),ee=[L,j,...$].filter(Boolean).map(B=>B.ref.current);DD(ee)}}C.current=!1}),onBlur:Me(e.onBlur,()=>x(!1))})))}),BB="RovingFocusGroupItem",VB=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Jo(),l=i||a,c=FB(BB,n),u=c.currentTabStopId===l,f=TD(n),{onFocusableItemAdd:h,onFocusableItemRemove:g}=c;return m.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),m.createElement(B0.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,he({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Me(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Me(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Me(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=UB(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let x=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const _=x.indexOf(v.currentTarget);x=c.loop?qB(x,_+1):x.slice(_+1)}setTimeout(()=>DD(x))}})})))}),HB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WB(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function UB(e,t,n){const r=WB(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return HB[r]}function DD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function qB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Dw=jB,Aw=VB;function GB(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const er=e=>{const{present:t,children:n}=e,r=YB(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=_t(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};er.displayName="Presence";function YB(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=GB(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=qh(r.current);i.current=a==="mounted"?c:"none"},[a]),ur(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,g=qh(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ur(()=>{if(t){const c=f=>{const g=qh(r.current).includes(f.animationName);f.target===t&&g&&Mo.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=qh(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function qh(e){return(e==null?void 0:e.animationName)||"none"}const AD="Tabs",[KB,iye]=Zn(AD,[ou]),$D=ou(),[XB,$w]=KB(AD),QB=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=_l(a),[f,h]=wr({prop:r,onChange:o,defaultProp:i});return m.createElement(XB,{scope:n,baseId:Jo(),value:f,onValueChange:h,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,he({dir:u,"data-orientation":s},c,{ref:t})))}),JB="TabsList",ZB=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=$w(JB,n),s=$D(n);return m.createElement(Dw,he({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,he({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),eV="TabsTrigger",tV=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=$w(eV,n),a=$D(n),l=kD(s.baseId,r),c=MD(s.baseId,r),u=r===s.value;return m.createElement(Aw,he({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,he({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:Me(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Me(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),nV="TabsContent",rV=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=$w(nV,n),l=kD(a.baseId,r),c=MD(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),m.createElement(er,{present:o||u},({present:h})=>m.createElement(Qe.div,he({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),h&&i))});function kD(e,t){return`${e}-trigger-${t}`}function MD(e,t){return`${e}-content-${t}`}const oV=QB,ID=ZB,ND=tV,LD=rV,kw=oV,dm=H.forwardRef(({className:e,...t},n)=>O.jsx(ID,{ref:n,className:Ce("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));dm.displayName=ID.displayName;const fm=H.forwardRef(({className:e,...t},n)=>O.jsx(ND,{ref:n,className:Ce("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}));fm.displayName=ND.displayName;const Mw=H.forwardRef(({className:e,...t},n)=>O.jsx(LD,{ref:n,className:Ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Mw.displayName=LD.displayName;var FD={exports:{}},$f={},V0={exports:{}};(function(e,t){(function(n,r){r(t)})(Vs,function(n){function r(se){return function(le,ye,Y,be,_e,Pe,Te){return se(le,ye,Te)}}function o(se){return function(le,ye,Y,be){if(!le||!ye||typeof le!="object"||typeof ye!="object")return se(le,ye,Y,be);var _e=be.get(le),Pe=be.get(ye);if(_e&&Pe)return _e===ye&&Pe===le;be.set(le,ye),be.set(ye,le);var Te=se(le,ye,Y,be);return be.delete(le),be.delete(ye),Te}}function i(se,ne){var le={};for(var ye in se)le[ye]=se[ye];for(var ye in ne)le[ye]=ne[ye];return le}function s(se){return se.constructor===Object||se.constructor==null}function a(se){return typeof se.then=="function"}function l(se,ne){return se===ne||se!==se&&ne!==ne}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",h="[object RegExp]",g="[object Map]",v="[object Number]",b="[object Object]",w="[object Set]",x="[object String]",_=Object.prototype.toString;function S(se){var ne=se.areArraysEqual,le=se.areDatesEqual,ye=se.areMapsEqual,Y=se.areObjectsEqual,be=se.areRegExpsEqual,_e=se.areSetsEqual,Pe=se.createIsNestedEqual,Te=Pe(Ue);function Ue(Be,Ie,Ke){if(Be===Ie)return!0;if(!Be||!Ie||typeof Be!="object"||typeof Ie!="object")return Be!==Be&&Ie!==Ie;if(s(Be)&&s(Ie))return Y(Be,Ie,Te,Ke);var lt=Array.isArray(Be),It=Array.isArray(Ie);if(lt||It)return lt===It&&ne(Be,Ie,Te,Ke);var At=_.call(Be);return At!==_.call(Ie)?!1:At===f?le(Be,Ie,Te,Ke):At===h?be(Be,Ie,Te,Ke):At===g?ye(Be,Ie,Te,Ke):At===w?_e(Be,Ie,Te,Ke):At===b||At===c?a(Be)||a(Ie)?!1:Y(Be,Ie,Te,Ke):At===u||At===v||At===x?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function C(se,ne,le,ye){var Y=se.length;if(ne.length!==Y)return!1;for(;Y-- >0;)if(!le(se[Y],ne[Y],Y,Y,se,ne,ye))return!1;return!0}var E=o(C);function P(se,ne){return l(se.valueOf(),ne.valueOf())}function A(se,ne,le,ye){var Y=se.size===ne.size;if(!Y)return!1;if(!se.size)return!0;var be={},_e=0;return se.forEach(function(Pe,Te){if(Y){var Ue=!1,Be=0;ne.forEach(function(Ie,Ke){!Ue&&!be[Be]&&(Ue=le(Te,Ke,_e,Be,se,ne,ye)&&le(Pe,Ie,Te,Ke,se,ne,ye))&&(be[Be]=!0),Be++}),_e++,Y=Ue}}),Y}var k=o(A),I="_owner",$=Object.prototype.hasOwnProperty;function L(se,ne,le,ye){var Y=Object.keys(se),be=Y.length;if(Object.keys(ne).length!==be)return!1;for(var _e;be-- >0;){if(_e=Y[be],_e===I){var Pe=!!se.$$typeof,Te=!!ne.$$typeof;if((Pe||Te)&&Pe!==Te)return!1}if(!$.call(ne,_e)||!le(se[_e],ne[_e],_e,_e,se,ne,ye))return!1}return!0}var j=o(L);function Q(se,ne){return se.source===ne.source&&se.flags===ne.flags}function ee(se,ne,le,ye){var Y=se.size===ne.size;if(!Y)return!1;if(!se.size)return!0;var be={};return se.forEach(function(_e,Pe){if(Y){var Te=!1,Ue=0;ne.forEach(function(Be,Ie){!Te&&!be[Ue]&&(Te=le(_e,Be,Pe,Ie,se,ne,ye))&&(be[Ue]=!0),Ue++}),Y=Te}}),Y}var B=o(ee),Z=Object.freeze({areArraysEqual:C,areDatesEqual:P,areMapsEqual:A,areObjectsEqual:L,areRegExpsEqual:Q,areSetsEqual:ee,createIsNestedEqual:r}),G=Object.freeze({areArraysEqual:E,areDatesEqual:P,areMapsEqual:k,areObjectsEqual:j,areRegExpsEqual:Q,areSetsEqual:B,createIsNestedEqual:r}),q=S(Z);function K(se,ne){return q(se,ne,void 0)}var T=S(i(Z,{createIsNestedEqual:function(){return l}}));function V(se,ne){return T(se,ne,void 0)}var X=S(G);function N(se,ne){return X(se,ne,new WeakMap)}var ie=S(i(G,{createIsNestedEqual:function(){return l}}));function fe(se,ne){return ie(se,ne,new WeakMap)}function ue(se){return S(i(Z,se(Z)))}function pe(se){var ne=S(i(G,se(G)));return function(le,ye,Y){return Y===void 0&&(Y=new WeakMap),ne(le,ye,Y)}}n.circularDeepEqual=N,n.circularShallowEqual=fe,n.createCustomCircularEqual=pe,n.createCustomEqual=ue,n.deepEqual=K,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(V0,V0.exports);var Iw=V0.exports;const Nw=gw(xj);var Ot={},iV=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(Ot,"__esModule",{value:!0});Ot.bottom=Lw;Ot.childrenEqual=cV;Ot.cloneLayout=jD;Ot.cloneLayoutItem=il;Ot.collides=hm;Ot.compact=BD;Ot.compactItem=VD;Ot.compactType=SV;Ot.correctBounds=HD;Ot.fastPositionEqual=dV;Ot.fastRGLPropsEqual=void 0;Ot.getAllCollisions=WD;Ot.getFirstCollision=qa;Ot.getLayoutItem=Fw;Ot.getStatics=jw;Ot.modifyLayout=zD;Ot.moveElement=nd;Ot.moveElementAwayFromCollision=W0;Ot.noop=void 0;Ot.perc=hV;Ot.resizeItemInDirection=yV;Ot.setTopLeft=wV;Ot.setTransform=xV;Ot.sortLayoutItems=Uw;Ot.sortLayoutItemsByColRow=KD;Ot.sortLayoutItemsByRowCol=YD;Ot.synchronizeLayoutWithChildren=_V;Ot.validateLayout=XD;Ot.withLayoutItem=lV;var hR=Iw,td=sV(m);function sV(e){return e&&e.__esModule?e:{default:e}}const aV=process.env.NODE_ENV==="production";function Lw(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function jD(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=il(e[n]);return t}function zD(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function lV(e,t,n){let r=Fw(e,t);return r?(r=n(il(r)),e=zD(e,r),[e,r]):[e,null]}function il(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 cV(e,t){return(0,hR.deepEqual)(td.default.Children.map(e,n=>n==null?void 0:n.key),td.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,hR.deepEqual)(td.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),td.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const uV=iV;Ot.fastRGLPropsEqual=uV;function dV(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function hm(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 BD(e,t,n,r){const o=jw(e),i=Uw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=il(i[a]);c.static||(c=VD(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const fV={x:"w",y:"h"};function H0(e,t,n,r){const o=fV[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;hm(t,a)&&H0(e,a,n+t[o],r)}}t[r]=n}function VD(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Lw(e),t.y);t.y>0&&!qa(e,t);)t.y--;else if(a)for(;t.x>0&&!qa(e,t);)t.x--;let l;for(;(l=qa(e,t))&&!(n===null&&i);)if(a?H0(o,t,l.x+l.w,"x"):H0(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!qa(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function HD(e,t){const n=jw(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;qa(n,i);)i.y++}return e}function Fw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function qa(e,t){for(let n=0,r=e.length;n<r;n++)if(hm(e[n],t))return e[n]}function WD(e,t){return e.filter(n=>hm(n,t))}function jw(e){return e.filter(t=>t.static)}function nd(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=Uw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const g=WD(f,t),v=g.length>0;if(v&&l)return jD(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let b=0,w=g.length;b<w;b++){const x=g[b];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(x.i," at [").concat(x.x,",").concat(x.y,"]"),!x.moved&&(x.static?e=W0(e,x,t,o,s):e=W0(e,t,x,o,s))}return e}function W0(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=qa(e,f),g=h&&h.y+h.h>t.y,v=h&&t.x+t.w>h.x;if(h){if(g&&a)return nd(e,n,void 0,t.y+1,r,l,o);if(g&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return nd(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),nd(e,n,s?f.x:void 0,a?f.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:nd(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function hV(e){return e*100+"%"}const UD=(e,t,n,r)=>e+n>r?t:n,qD=(e,t,n)=>e<0?t:n,GD=e=>Math.max(0,e),zw=e=>Math.max(0,e),Bw=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:qD(s,e.height,o),top:zw(s)}},Vw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:UD(e.left,e.width,s,n),left:GD(o)}},Hw=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:UD(e.left,e.width,i,n),top:zw(r),left:GD(s)}},Ww=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:qD(r,e.height,i),top:zw(r)}},pV=function(){return Bw(arguments.length<=0?void 0:arguments[0],Vw(...arguments))},gV=function(){return Bw(arguments.length<=0?void 0:arguments[0],Hw(...arguments))},mV=function(){return Ww(arguments.length<=0?void 0:arguments[0],Vw(...arguments))},vV=function(){return Ww(arguments.length<=0?void 0:arguments[0],Hw(...arguments))},bV={n:Bw,ne:pV,e:Vw,se:mV,s:Ww,sw:vV,w:Hw,nw:gV};function yV(e,t,n,r){const o=bV[e];return o?o(t,{...t,...n},r):n}function xV(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function wV(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function Uw(e,t){return t==="horizontal"?KD(e):t==="vertical"?YD(e):e}function YD(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 KD(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 _V(e,t,n,r,o){e=e||[];const i=[];td.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Fw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(il(l)):c?(aV||XD([c],"ReactGridLayout.children"),i.push(il({...c,i:a.key}))):i.push(il({w:1,h:1,x:0,y:Lw(i),i:String(a.key)}))});const s=HD(i,{cols:n});return o?s:BD(s,r,n)}function XD(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function SV(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const CV=()=>{};Ot.noop=CV;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.calcGridColWidth=pm;Ri.calcGridItemPosition=EV;Ri.calcGridItemWHPx=U0;Ri.calcWH=OV;Ri.calcXY=RV;Ri.clamp=Ga;function pm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function U0(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function EV(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=pm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=U0(r,c,s[0]),u.height=U0(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function RV(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=pm(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Ga(u,0,s-r),f=Ga(f,0,l-o),{x:u,y:f}}function OV(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=pm(e);let f=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),g=Ga(f,0,l-r),v=Ga(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=Ga(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=Ga(h,0,a)),{w:g,h:v}}function Ga(e,t,n){return Math.max(Math.min(e,n),t)}var gm={},q0={exports:{}},Ib,pR;function qw(){if(pR)return Ib;pR=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ib=e,Ib}var Nb,gR;function PV(){if(gR)return Nb;gR=1;var e=qw();function t(){}function n(){}return n.resetWarningCache=t,Nb=function(){function r(s,a,l,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Nb}var Gh={exports:{}},qt={};/** @license React v16.13.1
|
|
88
|
+
}`;var yt=NE(function(){return jt(z,Ye+"return "+Re).apply(n,W)});if(yt.source=Re,pb(yt))throw yt;return yt}function S8(d){return Ut(d).toLowerCase()}function C8(d){return Ut(d).toUpperCase()}function E8(d,p,y){if(d=Ut(d),d&&(y||p===n))return US(d);if(!d||!(p=Vr(p)))return d;var R=jo(d),M=jo(p),z=qS(R,M),W=GS(R,M)+1;return Os(R,z,W).join("")}function R8(d,p,y){if(d=Ut(d),d&&(y||p===n))return d.slice(0,KS(d)+1);if(!d||!(p=Vr(p)))return d;var R=jo(d),M=GS(R,jo(p))+1;return Os(R,0,M).join("")}function O8(d,p,y){if(d=Ut(d),d&&(y||p===n))return d.replace(jn,"");if(!d||!(p=Vr(p)))return d;var R=jo(d),M=qS(R,jo(p));return Os(R,M).join("")}function P8(d,p){var y=$,R=L;if(wn(p)){var M="separator"in p?p.separator:M;y="length"in p?pt(p.length):y,R="omission"in p?Vr(p.omission):R}d=Ut(d);var z=d.length;if(Nl(d)){var W=jo(d);z=W.length}if(y>=z)return d;var J=y-Ll(R);if(J<1)return R;var ae=W?Os(W,0,J).join(""):d.slice(0,J);if(M===n)return ae+R;if(W&&(J+=ae.length-J),gb(M)){if(d.slice(J).search(M)){var xe,we=ae;for(M.global||(M=Av(M.source,Ut(qe.exec(M))+"g")),M.lastIndex=0;xe=M.exec(we);)var Re=xe.index;ae=ae.slice(0,Re===n?J:Re)}}else if(d.indexOf(Vr(M),J)!=J){var je=ae.lastIndexOf(M);je>-1&&(ae=ae.slice(0,je))}return ae+R}function T8(d){return d=Ut(d),d&&Rn.test(d)?d.replace(Xt,o3):d}var D8=Wl(function(d,p,y){return d+(y?" ":"")+p.toUpperCase()}),bb=LC("toUpperCase");function IE(d,p,y){return d=Ut(d),p=y?n:p,p===n?ZF(d)?a3(d):WF(d):d.match(p)||[]}var NE=St(function(d,p){try{return zr(d,n,p)}catch(y){return pb(y)?y:new ct(y)}}),A8=Fi(function(d,p){return vo(p,function(y){y=ai(y),Ni(d,y,fb(d[y],d))}),d});function $8(d){var p=d==null?0:d.length,y=Je();return d=p?yn(d,function(R){if(typeof R[1]!="function")throw new bo(s);return[y(R[0]),R[1]]}):[],St(function(R){for(var M=-1;++M<p;){var z=d[M];if(zr(z[0],this,R))return zr(z[1],this,R)}})}function k8(d){return o7(xo(d,f))}function yb(d){return function(){return d}}function M8(d,p){return d==null||d!==d?p:d}var I8=jC(),N8=jC(!0);function Rr(d){return d}function xb(d){return gC(typeof d=="function"?d:xo(d,f))}function L8(d){return vC(xo(d,f))}function F8(d,p){return bC(d,xo(p,f))}var j8=St(function(d,p){return function(y){return Su(y,d,p)}}),z8=St(function(d,p){return function(y){return Su(d,y,p)}});function wb(d,p,y){var R=Bn(p),M=_h(p,R);y==null&&!(wn(p)&&(M.length||!R.length))&&(y=p,p=d,d=this,M=_h(p,Bn(p)));var z=!(wn(y)&&"chain"in y)||!!y.chain,W=zi(d);return vo(M,function(J){var ae=p[J];d[J]=ae,W&&(d.prototype[J]=function(){var xe=this.__chain__;if(z||xe){var we=d(this.__wrapped__),Re=we.__actions__=Sr(this.__actions__);return Re.push({func:ae,args:arguments,thisArg:d}),we.__chain__=xe,we}return ae.apply(d,ws([this.value()],arguments))})}),d}function B8(){return qn._===this&&(qn._=h3),this}function _b(){}function V8(d){return d=pt(d),St(function(p){return yC(p,d)})}var H8=Zv(yn),W8=Zv(zS),U8=Zv(Cv);function LE(d){return sb(d)?Ev(ai(d)):w7(d)}function q8(d){return function(p){return d==null?n:Ea(d,p)}}var G8=BC(),Y8=BC(!0);function Sb(){return[]}function Cb(){return!1}function K8(){return{}}function X8(){return""}function Q8(){return!0}function J8(d,p){if(d=pt(d),d<1||d>q)return[];var y=V,R=nr(d,V);p=Je(p),d-=V;for(var M=Pv(R,p);++y<d;)p(y);return M}function Z8(d){return ut(d)?yn(d,ai):Hr(d)?[d]:Sr(rE(Ut(d)))}function ej(d){var p=++d3;return Ut(d)+p}var tj=Ph(function(d,p){return d+p},0),nj=eb("ceil"),rj=Ph(function(d,p){return d/p},1),oj=eb("floor");function ij(d){return d&&d.length?wh(d,Rr,jv):n}function sj(d,p){return d&&d.length?wh(d,Je(p,2),jv):n}function aj(d){return HS(d,Rr)}function lj(d,p){return HS(d,Je(p,2))}function cj(d){return d&&d.length?wh(d,Rr,Hv):n}function uj(d,p){return d&&d.length?wh(d,Je(p,2),Hv):n}var dj=Ph(function(d,p){return d*p},1),fj=eb("round"),hj=Ph(function(d,p){return d-p},0);function pj(d){return d&&d.length?Ov(d,Rr):0}function gj(d,p){return d&&d.length?Ov(d,Je(p,2)):0}return F.after=L9,F.ary=pE,F.assign=C4,F.assignIn=PE,F.assignInWith=Bh,F.assignWith=E4,F.at=R4,F.before=gE,F.bind=fb,F.bindAll=A8,F.bindKey=mE,F.castArray=K9,F.chain=dE,F.chunk=o6,F.compact=i6,F.concat=s6,F.cond=$8,F.conforms=k8,F.constant=yb,F.countBy=p9,F.create=O4,F.curry=vE,F.curryRight=bE,F.debounce=yE,F.defaults=P4,F.defaultsDeep=T4,F.defer=F9,F.delay=j9,F.difference=a6,F.differenceBy=l6,F.differenceWith=c6,F.drop=u6,F.dropRight=d6,F.dropRightWhile=f6,F.dropWhile=h6,F.fill=p6,F.filter=m9,F.flatMap=y9,F.flatMapDeep=x9,F.flatMapDepth=w9,F.flatten=aE,F.flattenDeep=g6,F.flattenDepth=m6,F.flip=z9,F.flow=I8,F.flowRight=N8,F.fromPairs=v6,F.functions=N4,F.functionsIn=L4,F.groupBy=_9,F.initial=y6,F.intersection=x6,F.intersectionBy=w6,F.intersectionWith=_6,F.invert=j4,F.invertBy=z4,F.invokeMap=C9,F.iteratee=xb,F.keyBy=E9,F.keys=Bn,F.keysIn=Er,F.map=Ih,F.mapKeys=V4,F.mapValues=H4,F.matches=L8,F.matchesProperty=F8,F.memoize=Lh,F.merge=W4,F.mergeWith=TE,F.method=j8,F.methodOf=z8,F.mixin=wb,F.negate=Fh,F.nthArg=V8,F.omit=U4,F.omitBy=q4,F.once=B9,F.orderBy=R9,F.over=H8,F.overArgs=V9,F.overEvery=W8,F.overSome=U8,F.partial=hb,F.partialRight=xE,F.partition=O9,F.pick=G4,F.pickBy=DE,F.property=LE,F.propertyOf=q8,F.pull=R6,F.pullAll=cE,F.pullAllBy=O6,F.pullAllWith=P6,F.pullAt=T6,F.range=G8,F.rangeRight=Y8,F.rearg=H9,F.reject=D9,F.remove=D6,F.rest=W9,F.reverse=ub,F.sampleSize=$9,F.set=K4,F.setWith=X4,F.shuffle=k9,F.slice=A6,F.sortBy=N9,F.sortedUniq=F6,F.sortedUniqBy=j6,F.split=y8,F.spread=U9,F.tail=z6,F.take=B6,F.takeRight=V6,F.takeRightWhile=H6,F.takeWhile=W6,F.tap=i9,F.throttle=q9,F.thru=Mh,F.toArray=EE,F.toPairs=AE,F.toPairsIn=$E,F.toPath=Z8,F.toPlainObject=OE,F.transform=Q4,F.unary=G9,F.union=U6,F.unionBy=q6,F.unionWith=G6,F.uniq=Y6,F.uniqBy=K6,F.uniqWith=X6,F.unset=J4,F.unzip=db,F.unzipWith=uE,F.update=Z4,F.updateWith=e8,F.values=Gl,F.valuesIn=t8,F.without=Q6,F.words=IE,F.wrap=Y9,F.xor=J6,F.xorBy=Z6,F.xorWith=e9,F.zip=t9,F.zipObject=n9,F.zipObjectDeep=r9,F.zipWith=o9,F.entries=AE,F.entriesIn=$E,F.extend=PE,F.extendWith=Bh,wb(F,F),F.add=tj,F.attempt=NE,F.camelCase=i8,F.capitalize=kE,F.ceil=nj,F.clamp=n8,F.clone=X9,F.cloneDeep=J9,F.cloneDeepWith=Z9,F.cloneWith=Q9,F.conformsTo=e4,F.deburr=ME,F.defaultTo=M8,F.divide=rj,F.endsWith=s8,F.eq=Bo,F.escape=a8,F.escapeRegExp=l8,F.every=g9,F.find=v9,F.findIndex=iE,F.findKey=D4,F.findLast=b9,F.findLastIndex=sE,F.findLastKey=A4,F.floor=oj,F.forEach=fE,F.forEachRight=hE,F.forIn=$4,F.forInRight=k4,F.forOwn=M4,F.forOwnRight=I4,F.get=mb,F.gt=t4,F.gte=n4,F.has=F4,F.hasIn=vb,F.head=lE,F.identity=Rr,F.includes=S9,F.indexOf=b6,F.inRange=r8,F.invoke=B4,F.isArguments=Pa,F.isArray=ut,F.isArrayBuffer=r4,F.isArrayLike=Cr,F.isArrayLikeObject=On,F.isBoolean=o4,F.isBuffer=Ps,F.isDate=i4,F.isElement=s4,F.isEmpty=a4,F.isEqual=l4,F.isEqualWith=c4,F.isError=pb,F.isFinite=u4,F.isFunction=zi,F.isInteger=wE,F.isLength=jh,F.isMap=_E,F.isMatch=d4,F.isMatchWith=f4,F.isNaN=h4,F.isNative=p4,F.isNil=m4,F.isNull=g4,F.isNumber=SE,F.isObject=wn,F.isObjectLike=Sn,F.isPlainObject=Tu,F.isRegExp=gb,F.isSafeInteger=v4,F.isSet=CE,F.isString=zh,F.isSymbol=Hr,F.isTypedArray=ql,F.isUndefined=b4,F.isWeakMap=y4,F.isWeakSet=x4,F.join=S6,F.kebabCase=c8,F.last=_o,F.lastIndexOf=C6,F.lowerCase=u8,F.lowerFirst=d8,F.lt=w4,F.lte=_4,F.max=ij,F.maxBy=sj,F.mean=aj,F.meanBy=lj,F.min=cj,F.minBy=uj,F.stubArray=Sb,F.stubFalse=Cb,F.stubObject=K8,F.stubString=X8,F.stubTrue=Q8,F.multiply=dj,F.nth=E6,F.noConflict=B8,F.noop=_b,F.now=Nh,F.pad=f8,F.padEnd=h8,F.padStart=p8,F.parseInt=g8,F.random=o8,F.reduce=P9,F.reduceRight=T9,F.repeat=m8,F.replace=v8,F.result=Y4,F.round=fj,F.runInContext=re,F.sample=A9,F.size=M9,F.snakeCase=b8,F.some=I9,F.sortedIndex=$6,F.sortedIndexBy=k6,F.sortedIndexOf=M6,F.sortedLastIndex=I6,F.sortedLastIndexBy=N6,F.sortedLastIndexOf=L6,F.startCase=x8,F.startsWith=w8,F.subtract=hj,F.sum=pj,F.sumBy=gj,F.template=_8,F.times=J8,F.toFinite=Bi,F.toInteger=pt,F.toLength=RE,F.toLower=S8,F.toNumber=So,F.toSafeInteger=S4,F.toString=Ut,F.toUpper=C8,F.trim=E8,F.trimEnd=R8,F.trimStart=O8,F.truncate=P8,F.unescape=T8,F.uniqueId=ej,F.upperCase=D8,F.upperFirst=bb,F.each=fE,F.eachRight=hE,F.first=lE,wb(F,function(){var d={};return ii(F,function(p,y){Qt.call(F.prototype,y)||(d[y]=p)}),d}(),{chain:!1}),F.VERSION=r,vo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){F[d].placeholder=F}),vo(["drop","take"],function(d,p){kt.prototype[d]=function(y){y=y===n?1:Mn(pt(y),0);var R=this.__filtered__&&!p?new kt(this):this.clone();return R.__filtered__?R.__takeCount__=nr(y,R.__takeCount__):R.__views__.push({size:nr(y,V),type:d+(R.__dir__<0?"Right":"")}),R},kt.prototype[d+"Right"]=function(y){return this.reverse()[d](y).reverse()}}),vo(["filter","map","takeWhile"],function(d,p){var y=p+1,R=y==ee||y==Z;kt.prototype[d]=function(M){var z=this.clone();return z.__iteratees__.push({iteratee:Je(M,3),type:y}),z.__filtered__=z.__filtered__||R,z}}),vo(["head","last"],function(d,p){var y="take"+(p?"Right":"");kt.prototype[d]=function(){return this[y](1).value()[0]}}),vo(["initial","tail"],function(d,p){var y="drop"+(p?"":"Right");kt.prototype[d]=function(){return this.__filtered__?new kt(this):this[y](1)}}),kt.prototype.compact=function(){return this.filter(Rr)},kt.prototype.find=function(d){return this.filter(d).head()},kt.prototype.findLast=function(d){return this.reverse().find(d)},kt.prototype.invokeMap=St(function(d,p){return typeof d=="function"?new kt(this):this.map(function(y){return Su(y,d,p)})}),kt.prototype.reject=function(d){return this.filter(Fh(Je(d)))},kt.prototype.slice=function(d,p){d=pt(d);var y=this;return y.__filtered__&&(d>0||p<0)?new kt(y):(d<0?y=y.takeRight(-d):d&&(y=y.drop(d)),p!==n&&(p=pt(p),y=p<0?y.dropRight(-p):y.take(p-d)),y)},kt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},kt.prototype.toArray=function(){return this.take(V)},ii(kt.prototype,function(d,p){var y=/^(?:filter|find|map|reject)|While$/.test(p),R=/^(?:head|last)$/.test(p),M=F[R?"take"+(p=="last"?"Right":""):p],z=R||/^find/.test(p);M&&(F.prototype[p]=function(){var W=this.__wrapped__,J=R?[1]:arguments,ae=W instanceof kt,xe=J[0],we=ae||ut(W),Re=function(Pt){var Mt=M.apply(F,ws([Pt],J));return R&&je?Mt[0]:Mt};we&&y&&typeof xe=="function"&&xe.length!=1&&(ae=we=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=z&&!je,yt=ae&&!Ye;if(!z&&we){W=yt?W:new kt(this);var tt=d.apply(W,J);return tt.__actions__.push({func:Mh,args:[Re],thisArg:n}),new yo(tt,je)}return et&&yt?d.apply(this,J):(tt=this.thru(Re),et?R?tt.value()[0]:tt.value():tt)})}),vo(["pop","push","shift","sort","splice","unshift"],function(d){var p=sh[d],y=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",R=/^(?:pop|shift)$/.test(d);F.prototype[d]=function(){var M=arguments;if(R&&!this.__chain__){var z=this.value();return p.apply(ut(z)?z:[],M)}return this[y](function(W){return p.apply(ut(W)?W:[],M)})}}),ii(kt.prototype,function(d,p){var y=F[p];if(y){var R=y.name+"";Qt.call(Bl,R)||(Bl[R]=[]),Bl[R].push({name:p,func:y})}}),Bl[Oh(n,x).name]=[{name:"wrapper",func:n}],kt.prototype.clone=T3,kt.prototype.reverse=D3,kt.prototype.value=A3,F.prototype.at=s9,F.prototype.chain=a9,F.prototype.commit=l9,F.prototype.next=c9,F.prototype.plant=d9,F.prototype.reverse=f9,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=h9,F.prototype.first=F.prototype.head,mu&&(F.prototype[mu]=u9),F},Fl=l3();xa?((xa.exports=Fl)._=Fl,xv._=Fl):qn._=Fl}).call(Vs)})(pg,pg.exports);var uc=pg.exports;const ol=nu(uc);function rR({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10};return t||(t={}),ww.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]});const c=t[l].reduce((u,f)=>Math.max(u,f.y+f.h),0);a.y=a.y===0?0:c,t[l].push(a)}),t}function oR(e,t){t&&ww.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const ke=Z2()(sD((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:C0},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{deleteSheet:n=>{e(r=>{var i,s,a,l;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(c=>c.id===n);o!==void 0&&o>-1&&((s=r.dashboard.sheets)==null||s.splice(o,1),r.selectedSheetId=(l=(a=r.dashboard.sheets)==null?void 0:a[0])==null?void 0:l.id)})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{ww.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&uc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&uc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&uc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&uc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(h=>h.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&uc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n];const o=(s=r.dashboard.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId);rR({id:n.id,layouts:o==null?void 0:o.layouts,y:0,initialHeight:8,minH:7,w:10})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1);const l=(s=r.dashboard.sheets)==null?void 0:s.find(c=>c.id===r.selectedSheetId);oR(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(g=>g.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(g=>g.id===r);if(a){const g=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===o.id);g>-1&&((h=a.cards)==null||h.splice(g,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0,h=0;o==="start"&&(f=0),rR({id:r.id,layouts:s.layouts,minH:10,x:h,y:f}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),oR(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(g=>g.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.splice(s,1),(h=o.onRemoveCard)==null||h.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{Fz({card:n,dataPoint:r,set:e,get:t})}}}))),co=()=>ke(e=>e.actions);var Tf=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(){}},Hc=typeof window>"u"||"Deno"in window;function Po(){}function jz(e,t){return typeof e=="function"?e(t):e}function R0(e){return typeof e=="number"&&e>=0&&e!==1/0}function hD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function iR(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Cw(s,t.options))return!1}else if(!Ad(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function sR(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Dd(t.options.mutationKey)!==Dd(i))return!1}else if(!Ad(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Cw(e,t){return((t==null?void 0:t.queryKeyHashFn)||Dd)(e)}function Dd(e){return JSON.stringify(e,(t,n)=>P0(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Ad(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ad(e[n],t[n])):!1}function pD(e,t){if(e===t)return e;const n=aR(e)&&aR(t);if(n||P0(e)&&P0(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=pD(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function O0(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function aR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function P0(e){if(!lR(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!lR(n)||!n.hasOwnProperty("isPrototypeOf"))}function lR(e){return Object.prototype.toString.call(e)==="[object Object]"}function zz(e){return new Promise(t=>{setTimeout(t,e)})}function T0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?pD(e,t):t}function Bz(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Vz(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xa,Hs,Cc,I2,Hz=(I2=class extends Tf{constructor(){super();Xe(this,Xa,void 0);Xe(this,Hs,void 0);Xe(this,Cc,void 0);Ve(this,Cc,t=>{if(!Hc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){oe(this,Hs)||this.setEventListener(oe(this,Cc))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Hs))==null||t.call(this),Ve(this,Hs,void 0))}setEventListener(t){var n;Ve(this,Cc,t),(n=oe(this,Hs))==null||n.call(this),Ve(this,Hs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){oe(this,Xa)!==t&&(Ve(this,Xa,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof oe(this,Xa)=="boolean"?oe(this,Xa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Xa=new WeakMap,Hs=new WeakMap,Cc=new WeakMap,I2),gg=new Hz,Ec,Ws,Rc,N2,Wz=(N2=class extends Tf{constructor(){super();Xe(this,Ec,!0);Xe(this,Ws,void 0);Xe(this,Rc,void 0);Ve(this,Rc,t=>{if(!Hc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){oe(this,Ws)||this.setEventListener(oe(this,Rc))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Ws))==null||t.call(this),Ve(this,Ws,void 0))}setEventListener(t){var n;Ve(this,Rc,t),(n=oe(this,Ws))==null||n.call(this),Ve(this,Ws,t(this.setOnline.bind(this)))}setOnline(t){oe(this,Ec)!==t&&(Ve(this,Ec,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return oe(this,Ec)}},Ec=new WeakMap,Ws=new WeakMap,Rc=new WeakMap,N2),mg=new Wz;function Uz(e){return Math.min(1e3*2**e,3e4)}function sm(e){return(e??"online")==="online"?mg.isOnline():!0}var gD=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function kb(e){return e instanceof gD}function mD(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((w,x)=>{i=w,s=x}),l=w=>{var x;r||(g(new gD(w)),(x=e.abort)==null||x.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!gg.isFocused()||e.networkMode!=="always"&&!mg.isOnline(),h=w=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,w),o==null||o(),i(w))},g=w=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,w),o==null||o(),s(w))},v=()=>new Promise(w=>{var x;o=_=>{const S=r||!f();return S&&w(_),S},(x=e.onPause)==null||x.call(e)}).then(()=>{var w;o=void 0,r||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(r)return;let w;try{w=e.fn()}catch(x){w=Promise.reject(x)}Promise.resolve(w).then(h).catch(x=>{var P;if(r)return;const _=e.retry??(Hc?0:3),S=e.retryDelay??Uz,C=typeof S=="function"?S(n,x):S,E=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,x);if(t||!E){g(x);return}n++,(P=e.onFail)==null||P.call(e,n,x),zz(C).then(()=>{if(f())return v()}).then(()=>{t?g(x):b()})})};return sm(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function qz(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},s=h=>{let g;t++;try{g=h()}finally{t--,t||c()}return g},a=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...g)=>{a(()=>{h(...g)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(g=>{n(g)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var Xn=qz(),Qa,L2,vD=(L2=class{constructor(){Xe(this,Qa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),R0(this.gcTime)&&Ve(this,Qa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Hc?1/0:5*60*1e3))}clearGcTimeout(){oe(this,Qa)&&(clearTimeout(oe(this,Qa)),Ve(this,Qa,void 0))}},Qa=new WeakMap,L2),Oc,Pc,Eo,Us,Ro,Vn,gf,Ja,Tc,Xp,Go,qi,F2,Gz=(F2=class extends vD{constructor(t){super();Xe(this,Tc);Xe(this,Go);Xe(this,Oc,void 0);Xe(this,Pc,void 0);Xe(this,Eo,void 0);Xe(this,Us,void 0);Xe(this,Ro,void 0);Xe(this,Vn,void 0);Xe(this,gf,void 0);Xe(this,Ja,void 0);Ve(this,Ja,!1),Ve(this,gf,t.defaultOptions),Ct(this,Tc,Xp).call(this,t.options),Ve(this,Vn,[]),Ve(this,Eo,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,Oc,t.state||Yz(this.options)),this.state=oe(this,Oc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!oe(this,Vn).length&&this.state.fetchStatus==="idle"&&oe(this,Eo).remove(this)}setData(t,n){const r=T0(this.state.data,t,this.options);return Ct(this,Go,qi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ct(this,Go,qi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=oe(this,Us);return(r=oe(this,Ro))==null||r.cancel(t),n?n.then(Po).catch(Po):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(oe(this,Oc))}isActive(){return oe(this,Vn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||oe(this,Vn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!hD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=oe(this,Vn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,Ro))==null||n.continue()}onOnline(){var n;const t=oe(this,Vn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,Ro))==null||n.continue()}addObserver(t){oe(this,Vn).includes(t)||(oe(this,Vn).push(t),this.clearGcTimeout(),oe(this,Eo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){oe(this,Vn).includes(t)&&(Ve(this,Vn,oe(this,Vn).filter(n=>n!==t)),oe(this,Vn).length||(oe(this,Ro)&&(oe(this,Ja)?oe(this,Ro).cancel({revert:!0}):oe(this,Ro).cancelRetry()),this.scheduleGc()),oe(this,Eo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return oe(this,Vn).length}invalidate(){this.state.isInvalidated||Ct(this,Go,qi).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(oe(this,Us))return(c=oe(this,Ro))==null||c.continueRetry(),oe(this,Us)}if(t&&Ct(this,Tc,Xp).call(this,t),!this.options.queryFn){const g=oe(this,Vn).find(v=>v.options.queryFn);g&&Ct(this,Tc,Xp).call(this,g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(Ve(this,Ja,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,Ja,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ve(this,Pc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Ct(this,Go,qi).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=g=>{var v,b,w,x;kb(g)&&g.silent||Ct(this,Go,qi).call(this,{type:"error",error:g}),kb(g)||((b=(v=oe(this,Eo).config).onError)==null||b.call(v,g,this),(x=(w=oe(this,Eo).config).onSettled)==null||x.call(w,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Ro,mD({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var v,b,w,x;if(typeof g>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(b=(v=oe(this,Eo).config).onSuccess)==null||b.call(v,g,this),(x=(w=oe(this,Eo).config).onSettled)==null||x.call(w,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,v)=>{Ct(this,Go,qi).call(this,{type:"failed",failureCount:g,error:v})},onPause:()=>{Ct(this,Go,qi).call(this,{type:"pause"})},onContinue:()=>{Ct(this,Go,qi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Us,oe(this,Ro).promise),oe(this,Us)}},Oc=new WeakMap,Pc=new WeakMap,Eo=new WeakMap,Us=new WeakMap,Ro=new WeakMap,Vn=new WeakMap,gf=new WeakMap,Ja=new WeakMap,Tc=new WeakSet,Xp=function(t){this.options={...oe(this,gf),...t},this.updateGcTime(this.options.gcTime)},Go=new WeakSet,qi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:sm(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return kb(o)&&o.revert&&oe(this,Pc)?{...oe(this,Pc),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Xn.batch(()=>{oe(this,Vn).forEach(r=>{r.onQueryUpdate()}),oe(this,Eo).notify({query:this,type:"updated",action:t})})},F2);function Yz(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var fi,j2,bD=(j2=class extends Tf{constructor(t={}){super();Xe(this,fi,void 0);this.config=t,Ve(this,fi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Cw(o,n);let s=this.get(i);return s||(s=new Gz({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){oe(this,fi).has(t.queryHash)||(oe(this,fi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=oe(this,fi).get(t.queryHash);n&&(t.destroy(),n===t&&oe(this,fi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Xn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return oe(this,fi).get(t)}getAll(){return[...oe(this,fi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>iR(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>iR(t,r)):n}notify(t){Xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Xn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Xn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fi=new WeakMap,j2),hi,mf,Xr,Dc,pi,Ls,z2,Kz=(z2=class extends vD{constructor(t){super();Xe(this,pi);Xe(this,hi,void 0);Xe(this,mf,void 0);Xe(this,Xr,void 0);Xe(this,Dc,void 0);this.mutationId=t.mutationId,Ve(this,mf,t.defaultOptions),Ve(this,Xr,t.mutationCache),Ve(this,hi,[]),this.state=t.state||Xz(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...oe(this,mf),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){oe(this,hi).includes(t)||(oe(this,hi).push(t),this.clearGcTimeout(),oe(this,Xr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,hi,oe(this,hi).filter(n=>n!==t)),this.scheduleGc(),oe(this,Xr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){oe(this,hi).length||(this.state.status==="pending"?this.scheduleGc():oe(this,Xr).remove(this))}continue(){var t;return((t=oe(this,Dc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,h,g,v,b,w,x,_,S,C,E,P,A;const n=()=>(Ve(this,Dc,mD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,I)=>{Ct(this,pi,Ls).call(this,{type:"failed",failureCount:k,error:I})},onPause:()=>{Ct(this,pi,Ls).call(this,{type:"pause"})},onContinue:()=>{Ct(this,pi,Ls).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),oe(this,Dc).promise),r=this.state.status==="pending";try{if(!r){Ct(this,pi,Ls).call(this,{type:"pending",variables:t}),await((i=(o=oe(this,Xr).config).onMutate)==null?void 0:i.call(o,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Ct(this,pi,Ls).call(this,{type:"pending",context:I,variables:t})}const k=await n();return await((c=(l=oe(this,Xr).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,k,t,this.state.context)),await((g=(h=oe(this,Xr).config).onSettled)==null?void 0:g.call(h,k,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,k,null,t,this.state.context)),Ct(this,pi,Ls).call(this,{type:"success",data:k}),k}catch(k){try{throw await((x=(w=oe(this,Xr).config).onError)==null?void 0:x.call(w,k,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,k,t,this.state.context)),await((E=(C=oe(this,Xr).config).onSettled)==null?void 0:E.call(C,void 0,k,this.state.variables,this.state.context,this)),await((A=(P=this.options).onSettled)==null?void 0:A.call(P,void 0,k,t,this.state.context)),k}finally{Ct(this,pi,Ls).call(this,{type:"error",error:k})}}}},hi=new WeakMap,mf=new WeakMap,Xr=new WeakMap,Dc=new WeakMap,pi=new WeakSet,Ls=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!sm(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Xn.batch(()=>{oe(this,hi).forEach(r=>{r.onMutationUpdate(t)}),oe(this,Xr).notify({mutation:this,type:"updated",action:t})})},z2);function Xz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Oo,vf,Za,B2,Qz=(B2=class extends Tf{constructor(t={}){super();Xe(this,Oo,void 0);Xe(this,vf,void 0);Xe(this,Za,void 0);this.config=t,Ve(this,Oo,[]),Ve(this,vf,0)}build(t,n,r){const o=new Kz({mutationCache:this,mutationId:++Vh(this,vf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){oe(this,Oo).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,Oo,oe(this,Oo).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Xn.batch(()=>{oe(this,Oo).forEach(t=>{this.remove(t)})})}getAll(){return oe(this,Oo)}find(t){const n={exact:!0,...t};return oe(this,Oo).find(r=>sR(n,r))}findAll(t={}){return oe(this,Oo).filter(n=>sR(t,n))}notify(t){Xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,Za,(oe(this,Za)??Promise.resolve()).then(()=>{const t=oe(this,Oo).filter(n=>n.state.isPaused);return Xn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Po)),Promise.resolve()))}).then(()=>{Ve(this,Za,void 0)})),oe(this,Za)}},Oo=new WeakMap,vf=new WeakMap,Za=new WeakMap,B2);function Jz(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,w,x,_;const o=t.options,i=(w=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:w.direction,s=((x=t.state.data)==null?void 0:x.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(S,C,E)=>{if(c)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const P={queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};u(P);const A=await f(P),{maxPages:k}=t.options,I=E?Vz:Bz;return{pages:I(S.pages,A,k),pageParams:I(S.pageParams,C,k)}};let g;if(i&&s.length){const S=i==="backward",C=S?Zz:cR,E={pages:s,pageParams:a},P=C(o,E);g=await h(E,P,S)}else{g=await h(l,a[0]??o.initialPageParam);const S=e??s.length;for(let C=1;C<S;C++){const E=cR(o,g);g=await h(g,E)}}return g};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function cR(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function Zz(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var In,qs,Gs,Ac,$c,Ys,kc,Mc,V2,eB=(V2=class{constructor(e={}){Xe(this,In,void 0);Xe(this,qs,void 0);Xe(this,Gs,void 0);Xe(this,Ac,void 0);Xe(this,$c,void 0);Xe(this,Ys,void 0);Xe(this,kc,void 0);Xe(this,Mc,void 0);Ve(this,In,e.queryCache||new bD),Ve(this,qs,e.mutationCache||new Qz),Ve(this,Gs,e.defaultOptions||{}),Ve(this,Ac,new Map),Ve(this,$c,new Map),Ve(this,Ys,0)}mount(){Vh(this,Ys)._++,oe(this,Ys)===1&&(Ve(this,kc,gg.subscribe(()=>{gg.isFocused()&&(this.resumePausedMutations(),oe(this,In).onFocus())})),Ve(this,Mc,mg.subscribe(()=>{mg.isOnline()&&(this.resumePausedMutations(),oe(this,In).onOnline())})))}unmount(){var e,t;Vh(this,Ys)._--,oe(this,Ys)===0&&((e=oe(this,kc))==null||e.call(this),Ve(this,kc,void 0),(t=oe(this,Mc))==null||t.call(this),Ve(this,Mc,void 0))}isFetching(e){return oe(this,In).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return oe(this,qs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=oe(this,In).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=oe(this,In).find({queryKey:e}),o=r==null?void 0:r.state.data,i=jz(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return oe(this,In).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Xn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=oe(this,In).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=oe(this,In);Xn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=oe(this,In),r={type:"active",...e};return Xn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Xn.batch(()=>oe(this,In).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Po).catch(Po)}invalidateQueries(e={},t={}){return Xn.batch(()=>{if(oe(this,In).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Xn.batch(()=>oe(this,In).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Po)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Po)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=oe(this,In).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Po).catch(Po)}fetchInfiniteQuery(e){return e.behavior=Jz(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Po).catch(Po)}resumePausedMutations(){return oe(this,qs).resumePausedMutations()}getQueryCache(){return oe(this,In)}getMutationCache(){return oe(this,qs)}getDefaultOptions(){return oe(this,Gs)}setDefaultOptions(e){Ve(this,Gs,e)}setQueryDefaults(e,t){oe(this,Ac).set(Dd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...oe(this,Ac).values()];let n={};return t.forEach(r=>{Ad(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){oe(this,$c).set(Dd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...oe(this,$c).values()];let n={};return t.forEach(r=>{Ad(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...oe(this,Gs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Cw(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...oe(this,Gs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){oe(this,In).clear(),oe(this,qs).clear()}},In=new WeakMap,qs=new WeakMap,Gs=new WeakMap,Ac=new WeakMap,$c=new WeakMap,Ys=new WeakMap,kc=new WeakMap,Mc=new WeakMap,V2),$r,fn,bf,vr,el,Ic,gi,yf,Nc,Lc,tl,nl,Ks,Fc,rl,ed,xf,D0,wf,A0,_f,$0,Sf,k0,Cf,M0,Ef,I0,Rf,N0,em,yD,H2,tB=(H2=class extends Tf{constructor(t,n){super();Xe(this,rl);Xe(this,xf);Xe(this,wf);Xe(this,_f);Xe(this,Sf);Xe(this,Cf);Xe(this,Ef);Xe(this,Rf);Xe(this,em);Xe(this,$r,void 0);Xe(this,fn,void 0);Xe(this,bf,void 0);Xe(this,vr,void 0);Xe(this,el,void 0);Xe(this,Ic,void 0);Xe(this,gi,void 0);Xe(this,yf,void 0);Xe(this,Nc,void 0);Xe(this,Lc,void 0);Xe(this,tl,void 0);Xe(this,nl,void 0);Xe(this,Ks,void 0);Xe(this,Fc,new Set);this.options=n,Ve(this,$r,t),Ve(this,gi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(oe(this,fn).addObserver(this),uR(oe(this,fn),this.options)?Ct(this,rl,ed).call(this):this.updateResult(),Ct(this,Sf,k0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L0(oe(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L0(oe(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ct(this,Cf,M0).call(this),Ct(this,Ef,I0).call(this),oe(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=oe(this,fn);if(this.options=oe(this,$r).defaultQueryOptions(t),O0(r,this.options)||oe(this,$r).getQueryCache().notify({type:"observerOptionsUpdated",query:oe(this,fn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Ct(this,Rf,N0).call(this);const i=this.hasListeners();i&&dR(oe(this,fn),o,this.options,r)&&Ct(this,rl,ed).call(this),this.updateResult(n),i&&(oe(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ct(this,xf,D0).call(this);const s=Ct(this,wf,A0).call(this);i&&(oe(this,fn)!==o||this.options.enabled!==r.enabled||s!==oe(this,Ks))&&Ct(this,_f,$0).call(this,s)}getOptimisticResult(t){const n=oe(this,$r).getQueryCache().build(oe(this,$r),t),r=this.createResult(n,t);return rB(this,r)&&(Ve(this,vr,r),Ve(this,Ic,this.options),Ve(this,el,oe(this,fn).state)),r}getCurrentResult(){return oe(this,vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(oe(this,Fc).add(r),t[r])})}),n}getCurrentQuery(){return oe(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=oe(this,$r).defaultQueryOptions(t),r=oe(this,$r).getQueryCache().build(oe(this,$r),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ct(this,rl,ed).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),oe(this,vr)))}createResult(t,n){var P;const r=oe(this,fn),o=this.options,i=oe(this,vr),s=oe(this,el),a=oe(this,Ic),c=t!==r?t.state:oe(this,bf),{state:u}=t;let{error:f,errorUpdatedAt:h,fetchStatus:g,status:v}=u,b=!1,w;if(n._optimisticResults){const A=this.hasListeners(),k=!A&&uR(t,n),I=A&&dR(t,r,n,o);(k||I)&&(g=sm(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===oe(this,yf))w=oe(this,Nc);else try{Ve(this,yf,n.select),w=n.select(u.data),w=T0(i==null?void 0:i.data,w,n),Ve(this,Nc,w),Ve(this,gi,null)}catch(A){Ve(this,gi,A)}else w=u.data;if(typeof n.placeholderData<"u"&&typeof w>"u"&&v==="pending"){let A;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=i.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((P=oe(this,Lc))==null?void 0:P.state.data,oe(this,Lc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ve(this,gi,null)}catch(k){Ve(this,gi,k)}typeof A<"u"&&(v="success",w=T0(i==null?void 0:i.data,A,n),b=!0)}oe(this,gi)&&(f=oe(this,gi),w=oe(this,Nc),h=Date.now(),v="error");const x=g==="fetching",_=v==="pending",S=v==="error",C=_&&x;return{status:v,fetchStatus:g,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:C,isLoading:C,data:w,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:b,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:Ew(t,n),refetch:this.refetch}}updateResult(t){const n=oe(this,vr),r=this.createResult(oe(this,fn),this.options);if(Ve(this,el,oe(this,fn).state),Ve(this,Ic,this.options),oe(this,el).data!==void 0&&Ve(this,Lc,oe(this,fn)),O0(r,n))return;Ve(this,vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!oe(this,Fc).size)return!0;const l=new Set(a??oe(this,Fc));return this.options.throwOnError&&l.add("error"),Object.keys(oe(this,vr)).some(c=>{const u=c;return oe(this,vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ct(this,em,yD).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ct(this,Sf,k0).call(this)}},$r=new WeakMap,fn=new WeakMap,bf=new WeakMap,vr=new WeakMap,el=new WeakMap,Ic=new WeakMap,gi=new WeakMap,yf=new WeakMap,Nc=new WeakMap,Lc=new WeakMap,tl=new WeakMap,nl=new WeakMap,Ks=new WeakMap,Fc=new WeakMap,rl=new WeakSet,ed=function(t){Ct(this,Rf,N0).call(this);let n=oe(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Po)),n},xf=new WeakSet,D0=function(){if(Ct(this,Cf,M0).call(this),Hc||oe(this,vr).isStale||!R0(this.options.staleTime))return;const n=hD(oe(this,vr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,tl,setTimeout(()=>{oe(this,vr).isStale||this.updateResult()},n))},wf=new WeakSet,A0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(oe(this,fn)):this.options.refetchInterval)??!1},_f=new WeakSet,$0=function(t){Ct(this,Ef,I0).call(this),Ve(this,Ks,t),!(Hc||this.options.enabled===!1||!R0(oe(this,Ks))||oe(this,Ks)===0)&&Ve(this,nl,setInterval(()=>{(this.options.refetchIntervalInBackground||gg.isFocused())&&Ct(this,rl,ed).call(this)},oe(this,Ks)))},Sf=new WeakSet,k0=function(){Ct(this,xf,D0).call(this),Ct(this,_f,$0).call(this,Ct(this,wf,A0).call(this))},Cf=new WeakSet,M0=function(){oe(this,tl)&&(clearTimeout(oe(this,tl)),Ve(this,tl,void 0))},Ef=new WeakSet,I0=function(){oe(this,nl)&&(clearInterval(oe(this,nl)),Ve(this,nl,void 0))},Rf=new WeakSet,N0=function(){const t=oe(this,$r).getQueryCache().build(oe(this,$r),this.options);if(t===oe(this,fn))return;const n=oe(this,fn);Ve(this,fn,t),Ve(this,bf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},em=new WeakSet,yD=function(t){Xn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(oe(this,vr))}),oe(this,$r).getQueryCache().notify({query:oe(this,fn),type:"observerResultsUpdated"})})},H2);function nB(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function uR(e,t){return nB(e,t)||e.state.dataUpdatedAt>0&&L0(e,t,t.refetchOnMount)}function L0(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ew(e,t)}return!1}function dR(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Ew(e,n)}function Ew(e,t){return e.isStaleByTime(t.staleTime)}function rB(e,t){return!O0(e.getCurrentResult(),t)}var xD=H.createContext(void 0),wD=e=>{const t=H.useContext(xD);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},oB=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),H.createElement(xD.Provider,{value:e},t)),_D=H.createContext(!1),iB=()=>H.useContext(_D);_D.Provider;function sB(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var aB=H.createContext(sB()),lB=()=>H.useContext(aB);function cB(e,t){return typeof e=="function"?e(...t):!!e}var uB=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},dB=e=>{H.useEffect(()=>{e.clearReset()},[e])},fB=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&cB(n,[e.error,r]),hB=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},pB=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,gB=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function mB(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=wD(n),o=iB(),i=lB(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",hB(s),uB(s,i),dB(i);const[a]=H.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(H.useSyncExternalStore(H.useCallback(c=>{const u=o?()=>{}:a.subscribe(Xn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),H.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),pB(s,l))throw gB(s,a,i);if(fB({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Df(e,t){return mB(e,tB,t)}const vB={theme:"system",setTheme:()=>null},SD=m.createContext(vB);function bB({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return O.jsx(SD.Provider,{...r,value:s,children:e})}const CD=()=>{const e=m.useContext(SD);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function yB(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function ED(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function fR(e,t){const n=ED(e);return n==="dark"?ol.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function xB({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=Df({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>yB(e==null?void 0:e.accessToken),enabled:!1}),{theme:c,setTheme:u}=CD(),f=ke(A=>A.dashboard.globalStyle),{setDashboard:h,setSelectedSheetId:g,setStyle:v,setOnSaveFunction:b}=ke(A=>A.actions);ke(A=>A.actions.setCustomCards);const w=ke(A=>A.actions.setFilterValues),x=ke(A=>A.actions.setBookmarkKey),_=ke(A=>A.actions.setAuthToken),S=ke(A=>A.actions.setThemeStyle),C=ke(A=>A.actions.setDashboardTheme),E=ke(A=>A.actions.setOnEvent);m.useEffect(()=>{if(c){const A=ED(c);C(A)}},[c,C]),m.useEffect(()=>{n&&u(n)},[n,u]);function P(){const A=ol.cloneDeep(C0),k=ol.merge(A,f);if(t){const I=ol.merge(k,t),$=fR(c,I);S($),v(I)}else{const I=fR(c,k);S(I),v(C0)}}return m.useEffect(()=>{i&&i.dashboard&&P()},[c,t,f]),m.useEffect(()=>{var L;if(!i||!i.dashboard)return;const A=i.dashboard,k=DL(A.id),I=JSON.parse(localStorage.getItem(k)||"[]"),$=I.find(j=>j.default===!0);if($)h($.template),P(),x($.name),$.filterValues&&w($.filterValues);else{h(A),P();const j=I.find(Q=>(Q==null?void 0:Q.name)==="Original");j?j.template=A:I.push({name:"Original",template:A,default:!1}),localStorage.setItem(k,JSON.stringify(I))}g((L=A.sheets)==null?void 0:L[0].id)},[i,h,g,w,x]),m.useEffect(()=>{r&&b(r),o&&E(o)},[r,b,o,E]),m.useEffect(()=>{e&&e.accessToken&&(_(e),s())},[e,s,_]),{isLoading:a,isError:l}}function am({className:e,...t}){return O.jsx("div",{className:Ce("animate-pulse rounded-md bg-muted",e),...t})}const Rw=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Rw.displayName="Card";const lm=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("flex flex-col space-y-1.5 p-6",e),...t}));lm.displayName="CardHeader";const Af=H.forwardRef(({className:e,...t},n)=>O.jsx("h3",{ref:n,className:Ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));Af.displayName="CardTitle";const Ow=H.forwardRef(({className:e,...t},n)=>O.jsx("p",{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));Ow.displayName="CardDescription";const cm=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("px-6 pt-0",e),...t}));cm.displayName="CardContent";const Pw=H.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce("flex items-center p-6 pt-0",e),...t}));Pw.displayName="CardFooter";function RD({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,showAssistant:h,...g}){ke(_=>_.selectedSheetId);const v=ke(_=>_.themeStyle),b=ke(_=>_.isSessionExpired),{isLoading:w,isError:x}=xB({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return w||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?O.jsx(o,{message:"loading"}):O.jsx("div",{className:"flex items-center gap-3",children:O.jsx(am,{className:"h-1 w-full dark:h-[2px]"})})):x?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),O.jsx(i,{})):O.jsx("div",{children:"Error"})):b?(r==null||r({type:"error",message:"Session Expired"}),O.jsx("div",{className:"flex h-full items-center justify-center",children:O.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[O.jsx(Af,{children:"Session Expired"}),O.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):O.jsx("div",{className:Ce("flex h-full flex-col justify-between",v==null?void 0:v.dashboardPanel,e),role:"dashboard-panel",...g})}function he(){return he=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},he.apply(this,arguments)}function Me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Zn(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:g,...v}=f,b=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:w},g)}function u(f,h){const g=(h==null?void 0:h[e][l])||a,v=m.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,wB(o,...t)]}function wB(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function _B(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cs(...e){return t=>e.forEach(n=>_B(n,t))}function _t(...e){return m.useCallback(cs(...e),e)}const F0=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(CB);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(j0,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(j0,he({},r,{ref:t}),n)});F0.displayName="Slot";const j0=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...EB(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});j0.displayName="SlotClone";const SB=({children:e})=>m.createElement(m.Fragment,null,e);function CB(e){return m.isValidElement(e)&&e.type===SB}function EB(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function um(e){const t=e+"CollectionProvider",[n,r]=Zn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:v,children:b}=g,w=m.useRef(null),x=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:x,collectionRef:w},b)},a=e+"CollectionSlot",l=m.forwardRef((g,v)=>{const{scope:b,children:w}=g,x=i(a,b),_=_t(v,x.collectionRef);return m.createElement(F0,{ref:_},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((g,v)=>{const{scope:b,children:w,...x}=g,_=m.useRef(null),S=_t(v,_),C=i(c,b);return m.useEffect(()=>(C.itemMap.set(_,{ref:_,...x}),()=>void C.itemMap.delete(_))),m.createElement(F0,{[u]:"",ref:S},w)});function h(g){const v=i(e+"CollectionConsumer",g);return m.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((C,E)=>x.indexOf(C.ref.current)-x.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},h,r]}const ur=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},RB=H.useId||(()=>{});let OB=0;function Jo(e){const[t,n]=H.useState(RB());return ur(()=>{e||n(r=>r??String(OB++))},[e]),e||(t?`radix-${t}`:"")}const OD=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(TB);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(z0,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(z0,he({},r,{ref:t}),n)});OD.displayName="Slot";const z0=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...DB(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});z0.displayName="SlotClone";const PB=({children:e})=>m.createElement(m.Fragment,null,e);function TB(e){return m.isValidElement(e)&&e.type===PB}function DB(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const AB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=AB.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?OD:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,he({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function PD(e,t){e&&Mo.flushSync(()=>e.dispatchEvent(t))}function Ln(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function wr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=$B({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Ln(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function $B({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=Ln(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const kB=m.createContext(void 0);function _l(e){const t=m.useContext(kB);return e||t||"ltr"}const Mb="rovingFocusGroup.onEntryFocus",MB={bubbles:!1,cancelable:!0},Tw="RovingFocusGroup",[B0,TD,IB]=um(Tw),[NB,ou]=Zn(Tw,[IB]),[LB,FB]=NB(Tw),jB=m.forwardRef((e,t)=>m.createElement(B0.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(B0.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(zB,he({},e,{ref:t}))))),zB=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),h=_t(t,f),g=_l(i),[v=null,b]=wr({prop:s,defaultProp:a,onChange:l}),[w,x]=m.useState(!1),_=Ln(c),S=TD(n),C=m.useRef(!1),[E,P]=m.useState(0);return m.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Mb,_),()=>A.removeEventListener(Mb,_)},[_]),m.createElement(LB,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(A=>b(A),[b]),onItemShiftTab:m.useCallback(()=>x(!0),[]),onFocusableItemAdd:m.useCallback(()=>P(A=>A+1),[]),onFocusableItemRemove:m.useCallback(()=>P(A=>A-1),[])},m.createElement(Qe.div,he({tabIndex:w||E===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{C.current=!0}),onFocus:Me(e.onFocus,A=>{const k=!C.current;if(A.target===A.currentTarget&&k&&!w){const I=new CustomEvent(Mb,MB);if(A.currentTarget.dispatchEvent(I),!I.defaultPrevented){const $=S().filter(B=>B.focusable),L=$.find(B=>B.active),j=$.find(B=>B.id===v),ee=[L,j,...$].filter(Boolean).map(B=>B.ref.current);DD(ee)}}C.current=!1}),onBlur:Me(e.onBlur,()=>x(!1))})))}),BB="RovingFocusGroupItem",VB=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Jo(),l=i||a,c=FB(BB,n),u=c.currentTabStopId===l,f=TD(n),{onFocusableItemAdd:h,onFocusableItemRemove:g}=c;return m.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),m.createElement(B0.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,he({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Me(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Me(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Me(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=UB(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let x=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const _=x.indexOf(v.currentTarget);x=c.loop?qB(x,_+1):x.slice(_+1)}setTimeout(()=>DD(x))}})})))}),HB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WB(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function UB(e,t,n){const r=WB(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return HB[r]}function DD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function qB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Dw=jB,Aw=VB;function GB(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const er=e=>{const{present:t,children:n}=e,r=YB(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=_t(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};er.displayName="Presence";function YB(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=GB(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=qh(r.current);i.current=a==="mounted"?c:"none"},[a]),ur(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,g=qh(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ur(()=>{if(t){const c=f=>{const g=qh(r.current).includes(f.animationName);f.target===t&&g&&Mo.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=qh(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function qh(e){return(e==null?void 0:e.animationName)||"none"}const AD="Tabs",[KB,iye]=Zn(AD,[ou]),$D=ou(),[XB,$w]=KB(AD),QB=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=_l(a),[f,h]=wr({prop:r,onChange:o,defaultProp:i});return m.createElement(XB,{scope:n,baseId:Jo(),value:f,onValueChange:h,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,he({dir:u,"data-orientation":s},c,{ref:t})))}),JB="TabsList",ZB=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=$w(JB,n),s=$D(n);return m.createElement(Dw,he({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,he({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),eV="TabsTrigger",tV=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=$w(eV,n),a=$D(n),l=kD(s.baseId,r),c=MD(s.baseId,r),u=r===s.value;return m.createElement(Aw,he({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,he({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:Me(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Me(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),nV="TabsContent",rV=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=$w(nV,n),l=kD(a.baseId,r),c=MD(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),m.createElement(er,{present:o||u},({present:h})=>m.createElement(Qe.div,he({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),h&&i))});function kD(e,t){return`${e}-trigger-${t}`}function MD(e,t){return`${e}-content-${t}`}const oV=QB,ID=ZB,ND=tV,LD=rV,kw=oV,dm=H.forwardRef(({className:e,...t},n)=>O.jsx(ID,{ref:n,className:Ce("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));dm.displayName=ID.displayName;const fm=H.forwardRef(({className:e,...t},n)=>O.jsx(ND,{ref:n,className:Ce("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}));fm.displayName=ND.displayName;const Mw=H.forwardRef(({className:e,...t},n)=>O.jsx(LD,{ref:n,className:Ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Mw.displayName=LD.displayName;var FD={exports:{}},$f={},V0={exports:{}};(function(e,t){(function(n,r){r(t)})(Vs,function(n){function r(se){return function(le,ye,Y,be,_e,Pe,Te){return se(le,ye,Te)}}function o(se){return function(le,ye,Y,be){if(!le||!ye||typeof le!="object"||typeof ye!="object")return se(le,ye,Y,be);var _e=be.get(le),Pe=be.get(ye);if(_e&&Pe)return _e===ye&&Pe===le;be.set(le,ye),be.set(ye,le);var Te=se(le,ye,Y,be);return be.delete(le),be.delete(ye),Te}}function i(se,ne){var le={};for(var ye in se)le[ye]=se[ye];for(var ye in ne)le[ye]=ne[ye];return le}function s(se){return se.constructor===Object||se.constructor==null}function a(se){return typeof se.then=="function"}function l(se,ne){return se===ne||se!==se&&ne!==ne}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",h="[object RegExp]",g="[object Map]",v="[object Number]",b="[object Object]",w="[object Set]",x="[object String]",_=Object.prototype.toString;function S(se){var ne=se.areArraysEqual,le=se.areDatesEqual,ye=se.areMapsEqual,Y=se.areObjectsEqual,be=se.areRegExpsEqual,_e=se.areSetsEqual,Pe=se.createIsNestedEqual,Te=Pe(Ue);function Ue(Be,Ie,Ke){if(Be===Ie)return!0;if(!Be||!Ie||typeof Be!="object"||typeof Ie!="object")return Be!==Be&&Ie!==Ie;if(s(Be)&&s(Ie))return Y(Be,Ie,Te,Ke);var lt=Array.isArray(Be),It=Array.isArray(Ie);if(lt||It)return lt===It&&ne(Be,Ie,Te,Ke);var At=_.call(Be);return At!==_.call(Ie)?!1:At===f?le(Be,Ie,Te,Ke):At===h?be(Be,Ie,Te,Ke):At===g?ye(Be,Ie,Te,Ke):At===w?_e(Be,Ie,Te,Ke):At===b||At===c?a(Be)||a(Ie)?!1:Y(Be,Ie,Te,Ke):At===u||At===v||At===x?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function C(se,ne,le,ye){var Y=se.length;if(ne.length!==Y)return!1;for(;Y-- >0;)if(!le(se[Y],ne[Y],Y,Y,se,ne,ye))return!1;return!0}var E=o(C);function P(se,ne){return l(se.valueOf(),ne.valueOf())}function A(se,ne,le,ye){var Y=se.size===ne.size;if(!Y)return!1;if(!se.size)return!0;var be={},_e=0;return se.forEach(function(Pe,Te){if(Y){var Ue=!1,Be=0;ne.forEach(function(Ie,Ke){!Ue&&!be[Be]&&(Ue=le(Te,Ke,_e,Be,se,ne,ye)&&le(Pe,Ie,Te,Ke,se,ne,ye))&&(be[Be]=!0),Be++}),_e++,Y=Ue}}),Y}var k=o(A),I="_owner",$=Object.prototype.hasOwnProperty;function L(se,ne,le,ye){var Y=Object.keys(se),be=Y.length;if(Object.keys(ne).length!==be)return!1;for(var _e;be-- >0;){if(_e=Y[be],_e===I){var Pe=!!se.$$typeof,Te=!!ne.$$typeof;if((Pe||Te)&&Pe!==Te)return!1}if(!$.call(ne,_e)||!le(se[_e],ne[_e],_e,_e,se,ne,ye))return!1}return!0}var j=o(L);function Q(se,ne){return se.source===ne.source&&se.flags===ne.flags}function ee(se,ne,le,ye){var Y=se.size===ne.size;if(!Y)return!1;if(!se.size)return!0;var be={};return se.forEach(function(_e,Pe){if(Y){var Te=!1,Ue=0;ne.forEach(function(Be,Ie){!Te&&!be[Ue]&&(Te=le(_e,Be,Pe,Ie,se,ne,ye))&&(be[Ue]=!0),Ue++}),Y=Te}}),Y}var B=o(ee),Z=Object.freeze({areArraysEqual:C,areDatesEqual:P,areMapsEqual:A,areObjectsEqual:L,areRegExpsEqual:Q,areSetsEqual:ee,createIsNestedEqual:r}),G=Object.freeze({areArraysEqual:E,areDatesEqual:P,areMapsEqual:k,areObjectsEqual:j,areRegExpsEqual:Q,areSetsEqual:B,createIsNestedEqual:r}),q=S(Z);function K(se,ne){return q(se,ne,void 0)}var T=S(i(Z,{createIsNestedEqual:function(){return l}}));function V(se,ne){return T(se,ne,void 0)}var X=S(G);function N(se,ne){return X(se,ne,new WeakMap)}var ie=S(i(G,{createIsNestedEqual:function(){return l}}));function fe(se,ne){return ie(se,ne,new WeakMap)}function ue(se){return S(i(Z,se(Z)))}function pe(se){var ne=S(i(G,se(G)));return function(le,ye,Y){return Y===void 0&&(Y=new WeakMap),ne(le,ye,Y)}}n.circularDeepEqual=N,n.circularShallowEqual=fe,n.createCustomCircularEqual=pe,n.createCustomEqual=ue,n.deepEqual=K,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(V0,V0.exports);var Iw=V0.exports;const Nw=gw(xj);var Ot={},iV=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(Ot,"__esModule",{value:!0});Ot.bottom=Lw;Ot.childrenEqual=cV;Ot.cloneLayout=jD;Ot.cloneLayoutItem=il;Ot.collides=hm;Ot.compact=BD;Ot.compactItem=VD;Ot.compactType=SV;Ot.correctBounds=HD;Ot.fastPositionEqual=dV;Ot.fastRGLPropsEqual=void 0;Ot.getAllCollisions=WD;Ot.getFirstCollision=qa;Ot.getLayoutItem=Fw;Ot.getStatics=jw;Ot.modifyLayout=zD;Ot.moveElement=nd;Ot.moveElementAwayFromCollision=W0;Ot.noop=void 0;Ot.perc=hV;Ot.resizeItemInDirection=yV;Ot.setTopLeft=wV;Ot.setTransform=xV;Ot.sortLayoutItems=Uw;Ot.sortLayoutItemsByColRow=KD;Ot.sortLayoutItemsByRowCol=YD;Ot.synchronizeLayoutWithChildren=_V;Ot.validateLayout=XD;Ot.withLayoutItem=lV;var hR=Iw,td=sV(m);function sV(e){return e&&e.__esModule?e:{default:e}}const aV=process.env.NODE_ENV==="production";function Lw(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function jD(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=il(e[n]);return t}function zD(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function lV(e,t,n){let r=Fw(e,t);return r?(r=n(il(r)),e=zD(e,r),[e,r]):[e,null]}function il(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 cV(e,t){return(0,hR.deepEqual)(td.default.Children.map(e,n=>n==null?void 0:n.key),td.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,hR.deepEqual)(td.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),td.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const uV=iV;Ot.fastRGLPropsEqual=uV;function dV(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function hm(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 BD(e,t,n,r){const o=jw(e),i=Uw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=il(i[a]);c.static||(c=VD(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const fV={x:"w",y:"h"};function H0(e,t,n,r){const o=fV[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;hm(t,a)&&H0(e,a,n+t[o],r)}}t[r]=n}function VD(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Lw(e),t.y);t.y>0&&!qa(e,t);)t.y--;else if(a)for(;t.x>0&&!qa(e,t);)t.x--;let l;for(;(l=qa(e,t))&&!(n===null&&i);)if(a?H0(o,t,l.x+l.w,"x"):H0(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!qa(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function HD(e,t){const n=jw(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;qa(n,i);)i.y++}return e}function Fw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function qa(e,t){for(let n=0,r=e.length;n<r;n++)if(hm(e[n],t))return e[n]}function WD(e,t){return e.filter(n=>hm(n,t))}function jw(e){return e.filter(t=>t.static)}function nd(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=Uw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const g=WD(f,t),v=g.length>0;if(v&&l)return jD(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let b=0,w=g.length;b<w;b++){const x=g[b];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(x.i," at [").concat(x.x,",").concat(x.y,"]"),!x.moved&&(x.static?e=W0(e,x,t,o,s):e=W0(e,t,x,o,s))}return e}function W0(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=qa(e,f),g=h&&h.y+h.h>t.y,v=h&&t.x+t.w>h.x;if(h){if(g&&a)return nd(e,n,void 0,t.y+1,r,l,o);if(g&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return nd(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),nd(e,n,s?f.x:void 0,a?f.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:nd(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function hV(e){return e*100+"%"}const UD=(e,t,n,r)=>e+n>r?t:n,qD=(e,t,n)=>e<0?t:n,GD=e=>Math.max(0,e),zw=e=>Math.max(0,e),Bw=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:qD(s,e.height,o),top:zw(s)}},Vw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:UD(e.left,e.width,s,n),left:GD(o)}},Hw=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:UD(e.left,e.width,i,n),top:zw(r),left:GD(s)}},Ww=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:qD(r,e.height,i),top:zw(r)}},pV=function(){return Bw(arguments.length<=0?void 0:arguments[0],Vw(...arguments))},gV=function(){return Bw(arguments.length<=0?void 0:arguments[0],Hw(...arguments))},mV=function(){return Ww(arguments.length<=0?void 0:arguments[0],Vw(...arguments))},vV=function(){return Ww(arguments.length<=0?void 0:arguments[0],Hw(...arguments))},bV={n:Bw,ne:pV,e:Vw,se:mV,s:Ww,sw:vV,w:Hw,nw:gV};function yV(e,t,n,r){const o=bV[e];return o?o(t,{...t,...n},r):n}function xV(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function wV(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function Uw(e,t){return t==="horizontal"?KD(e):t==="vertical"?YD(e):e}function YD(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 KD(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 _V(e,t,n,r,o){e=e||[];const i=[];td.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Fw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(il(l)):c?(aV||XD([c],"ReactGridLayout.children"),i.push(il({...c,i:a.key}))):i.push(il({w:1,h:1,x:0,y:Lw(i),i:String(a.key)}))});const s=HD(i,{cols:n});return o?s:BD(s,r,n)}function XD(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function SV(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const CV=()=>{};Ot.noop=CV;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.calcGridColWidth=pm;Ri.calcGridItemPosition=EV;Ri.calcGridItemWHPx=U0;Ri.calcWH=OV;Ri.calcXY=RV;Ri.clamp=Ga;function pm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function U0(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function EV(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=pm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=U0(r,c,s[0]),u.height=U0(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function RV(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=pm(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Ga(u,0,s-r),f=Ga(f,0,l-o),{x:u,y:f}}function OV(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=pm(e);let f=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),g=Ga(f,0,l-r),v=Ga(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=Ga(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=Ga(h,0,a)),{w:g,h:v}}function Ga(e,t,n){return Math.max(Math.min(e,n),t)}var gm={},q0={exports:{}},Ib,pR;function qw(){if(pR)return Ib;pR=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ib=e,Ib}var Nb,gR;function PV(){if(gR)return Nb;gR=1;var e=qw();function t(){}function n(){}return n.resetWarningCache=t,Nb=function(){function r(s,a,l,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Nb}var Gh={exports:{}},qt={};/** @license React v16.13.1
|
|
89
89
|
* react-is.development.js
|
|
90
90
|
*
|
|
91
91
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -106,7 +106,7 @@ object-assign
|
|
|
106
106
|
*/var Lb,yR;function AV(){if(yR)return Lb;yR=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Lb=o()?Object.assign:function(i,s){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},Lb}var Fb,xR;function JD(){return xR||(xR=1,Fb=Function.call.bind(Object.prototype.hasOwnProperty)),Fb}var jb,wR;function $V(){if(wR)return jb;wR=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=qw(),n={},r=JD();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[u](s,u,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var g=c?c():"";e("Failed "+a+" type: "+f.message+(g??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},jb=o,jb}var zb,_R;function kV(){if(_R)return zb;_R=1;var e=QD(),t=AV(),n=qw(),r=JD(),o=$V(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return zb=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var V=T&&(c&&T[c]||T[u]);if(typeof V=="function")return V}var h="<<anonymous>>",g={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:_(),arrayOf:S,element:C(),elementType:E(),instanceOf:P,node:$(),objectOf:k,oneOf:A,oneOfType:I,shape:j,exact:Q};function v(T,V){return T===V?T!==0||1/T===1/V:T!==T&&V!==V}function b(T,V){this.message=T,this.data=V&&typeof V=="object"?V:{},this.stack=""}b.prototype=Error.prototype;function w(T){if(process.env.NODE_ENV!=="production")var V={},X=0;function N(fe,ue,pe,se,ne,le,ye){if(se=se||h,le=le||pe,ye!==n){if(l){var Y=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 Y.name="Invariant Violation",Y}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var be=se+":"+pe;!V[be]&&X<3&&(i("You are manually calling a React.PropTypes validation function for the `"+le+"` prop on `"+se+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[be]=!0,X++)}}return ue[pe]==null?fe?ue[pe]===null?new b("The "+ne+" `"+le+"` is marked as required "+("in `"+se+"`, but its value is `null`.")):new b("The "+ne+" `"+le+"` is marked as required in "+("`"+se+"`, but its value is `undefined`.")):null:T(ue,pe,se,ne,le)}var ie=N.bind(null,!1);return ie.isRequired=N.bind(null,!0),ie}function x(T){function V(X,N,ie,fe,ue,pe){var se=X[N],ne=Z(se);if(ne!==T){var le=G(se);return new b("Invalid "+fe+" `"+ue+"` of type "+("`"+le+"` supplied to `"+ie+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return w(V)}function _(){return w(s)}function S(T){function V(X,N,ie,fe,ue){if(typeof T!="function")return new b("Property `"+ue+"` of component `"+ie+"` has invalid PropType notation inside arrayOf.");var pe=X[N];if(!Array.isArray(pe)){var se=Z(pe);return new b("Invalid "+fe+" `"+ue+"` of type "+("`"+se+"` supplied to `"+ie+"`, expected an array."))}for(var ne=0;ne<pe.length;ne++){var le=T(pe,ne,ie,fe,ue+"["+ne+"]",n);if(le instanceof Error)return le}return null}return w(V)}function C(){function T(V,X,N,ie,fe){var ue=V[X];if(!a(ue)){var pe=Z(ue);return new b("Invalid "+ie+" `"+fe+"` of type "+("`"+pe+"` supplied to `"+N+"`, expected a single ReactElement."))}return null}return w(T)}function E(){function T(V,X,N,ie,fe){var ue=V[X];if(!e.isValidElementType(ue)){var pe=Z(ue);return new b("Invalid "+ie+" `"+fe+"` of type "+("`"+pe+"` supplied to `"+N+"`, expected a single ReactElement type."))}return null}return w(T)}function P(T){function V(X,N,ie,fe,ue){if(!(X[N]instanceof T)){var pe=T.name||h,se=K(X[N]);return new b("Invalid "+fe+" `"+ue+"` of type "+("`"+se+"` supplied to `"+ie+"`, expected ")+("instance of `"+pe+"`."))}return null}return w(V)}function A(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function V(X,N,ie,fe,ue){for(var pe=X[N],se=0;se<T.length;se++)if(v(pe,T[se]))return null;var ne=JSON.stringify(T,function(ye,Y){var be=G(Y);return be==="symbol"?String(Y):Y});return new b("Invalid "+fe+" `"+ue+"` of value `"+String(pe)+"` "+("supplied to `"+ie+"`, expected one of "+ne+"."))}return w(V)}function k(T){function V(X,N,ie,fe,ue){if(typeof T!="function")return new b("Property `"+ue+"` of component `"+ie+"` has invalid PropType notation inside objectOf.");var pe=X[N],se=Z(pe);if(se!=="object")return new b("Invalid "+fe+" `"+ue+"` of type "+("`"+se+"` supplied to `"+ie+"`, expected an object."));for(var ne in pe)if(r(pe,ne)){var le=T(pe,ne,ie,fe,ue+"."+ne,n);if(le instanceof Error)return le}return null}return w(V)}function I(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var V=0;V<T.length;V++){var X=T[V];if(typeof X!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+q(X)+" at index "+V+"."),s}function N(ie,fe,ue,pe,se){for(var ne=[],le=0;le<T.length;le++){var ye=T[le],Y=ye(ie,fe,ue,pe,se,n);if(Y==null)return null;Y.data&&r(Y.data,"expectedType")&&ne.push(Y.data.expectedType)}var be=ne.length>0?", expected one of type ["+ne.join(", ")+"]":"";return new b("Invalid "+pe+" `"+se+"` supplied to "+("`"+ue+"`"+be+"."))}return w(N)}function $(){function T(V,X,N,ie,fe){return ee(V[X])?null:new b("Invalid "+ie+" `"+fe+"` supplied to "+("`"+N+"`, expected a ReactNode."))}return w(T)}function L(T,V,X,N,ie){return new b((T||"React class")+": "+V+" type `"+X+"."+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ie+"`.")}function j(T){function V(X,N,ie,fe,ue){var pe=X[N],se=Z(pe);if(se!=="object")return new b("Invalid "+fe+" `"+ue+"` of type `"+se+"` "+("supplied to `"+ie+"`, expected `object`."));for(var ne in T){var le=T[ne];if(typeof le!="function")return L(ie,fe,ue,ne,G(le));var ye=le(pe,ne,ie,fe,ue+"."+ne,n);if(ye)return ye}return null}return w(V)}function Q(T){function V(X,N,ie,fe,ue){var pe=X[N],se=Z(pe);if(se!=="object")return new b("Invalid "+fe+" `"+ue+"` of type `"+se+"` "+("supplied to `"+ie+"`, expected `object`."));var ne=t({},X[N],T);for(var le in ne){var ye=T[le];if(r(T,le)&&typeof ye!="function")return L(ie,fe,ue,le,G(ye));if(!ye)return new b("Invalid "+fe+" `"+ue+"` key `"+le+"` supplied to `"+ie+"`.\nBad object: "+JSON.stringify(X[N],null," ")+`
|
|
107
107
|
Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Y=ye(pe,le,ie,fe,ue+"."+le,n);if(Y)return Y}return null}return w(V)}function ee(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(ee);if(T===null||a(T))return!0;var V=f(T);if(V){var X=V.call(T),N;if(V!==T.entries){for(;!(N=X.next()).done;)if(!ee(N.value))return!1}else for(;!(N=X.next()).done;){var ie=N.value;if(ie&&!ee(ie[1]))return!1}}else return!1;return!0;default:return!1}}function B(T,V){return T==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function Z(T){var V=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":B(V,T)?"symbol":V}function G(T){if(typeof T>"u"||T===null)return""+T;var V=Z(T);if(V==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return V}function q(T){var V=G(T);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function K(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return g.checkPropTypes=o,g.resetWarningCache=o.resetWarningCache,g.PropTypes=g,g},zb}if(process.env.NODE_ENV!=="production"){var MV=QD(),IV=!0;q0.exports=kV()(MV.isElement,IV)}else q0.exports=PV()();var pa=q0.exports,mm={exports:{}},ZD={};function eA(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=eA(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function SR(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=eA(e))&&(r&&(r+=" "),r+=t);return r}const NV=Object.freeze(Object.defineProperty({__proto__:null,clsx:SR,default:SR},Symbol.toStringTag,{value:"Module"})),LV=gw(NV);var En={},Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.dontSetMe=VV;Oi.findInArray=FV;Oi.int=BV;Oi.isFunction=jV;Oi.isNum=zV;function FV(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function jV(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function zV(e){return typeof e=="number"&&!isNaN(e)}function BV(e){return parseInt(e,10)}function VV(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 Sl={};Object.defineProperty(Sl,"__esModule",{value:!0});Sl.browserPrefixToKey=nA;Sl.browserPrefixToStyle=HV;Sl.default=void 0;Sl.getPrefix=tA;const Bb=["Moz","Webkit","O","ms"];function tA(){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<Bb.length;r++)if(nA(t,Bb[r])in n)return Bb[r];return""}function nA(e,t){return t?"".concat(t).concat(WV(e)):e}function HV(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function WV(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}Sl.default=tA();Object.defineProperty(En,"__esModule",{value:!0});En.addClassName=iA;En.addEvent=GV;En.addUserSelectStyles=oH;En.createCSSTransform=eH;En.createSVGTransform=tH;En.getTouch=nH;En.getTouchIdentifier=rH;En.getTranslation=Gw;En.innerHeight=QV;En.innerWidth=JV;En.matchesSelector=oA;En.matchesSelectorAndParentsTo=qV;En.offsetXYFromParent=ZV;En.outerHeight=KV;En.outerWidth=XV;En.removeClassName=sA;En.removeEvent=YV;En.removeUserSelectStyles=iH;var io=Oi,CR=UV(Sl);function rA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(rA=function(r){return r?n:t})(e)}function UV(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=rA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let Yh="";function oA(e,t){return Yh||(Yh=(0,io.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,io.isFunction)(e[n])})),(0,io.isFunction)(e[Yh])?e[Yh](t):!1}function qV(e,t,n){let r=e;do{if(oA(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function GV(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function YV(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function KV(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,io.int)(n.borderTopWidth),t+=(0,io.int)(n.borderBottomWidth),t}function XV(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,io.int)(n.borderLeftWidth),t+=(0,io.int)(n.borderRightWidth),t}function QV(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,io.int)(n.paddingTop),t-=(0,io.int)(n.paddingBottom),t}function JV(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,io.int)(n.paddingLeft),t-=(0,io.int)(n.paddingRight),t}function ZV(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function eH(e,t){const n=Gw(e,t,"px");return{[(0,CR.browserPrefixToKey)("transform",CR.default)]:n}}function tH(e,t){return Gw(e,t,"")}function Gw(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function nH(e,t){return e.targetTouches&&(0,io.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,io.findInArray)(e.changedTouches,n=>t===n.identifier)}function rH(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function oH(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
108
108
|
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
109
|
-
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&iA(e.body,"react-draggable-transparent-selection")}function iH(e){if(e)try{if(e.body&&sA(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 iA(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function sA(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Pi={};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.canDragX=lH;Pi.canDragY=cH;Pi.createCoreData=dH;Pi.createDraggableData=fH;Pi.getBoundPosition=sH;Pi.getControlPosition=uH;Pi.snapToGrid=aH;var qr=Oi,hc=En;function sH(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:hH(r);const o=Yw(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,qr.int)(u.paddingLeft)+(0,qr.int)(c.marginLeft),top:-o.offsetTop+(0,qr.int)(u.paddingTop)+(0,qr.int)(c.marginTop),right:(0,hc.innerWidth)(l)-(0,hc.outerWidth)(o)-o.offsetLeft+(0,qr.int)(u.paddingRight)-(0,qr.int)(c.marginRight),bottom:(0,hc.innerHeight)(l)-(0,hc.outerHeight)(o)-o.offsetTop+(0,qr.int)(u.paddingBottom)-(0,qr.int)(c.marginBottom)}}return(0,qr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,qr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,qr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,qr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function aH(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function lH(e){return e.props.axis==="both"||e.props.axis==="x"}function cH(e){return e.props.axis==="both"||e.props.axis==="y"}function uH(e,t,n){const r=typeof t=="number"?(0,hc.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=Yw(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,hc.offsetXYFromParent)(r||e,i,n.props.scale)}function dH(e,t,n){const r=!(0,qr.isNum)(e.lastX),o=Yw(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function fH(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 hH(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Yw(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var vm={},bm={};Object.defineProperty(bm,"__esModule",{value:!0});bm.default=pH;function pH(){}Object.defineProperty(vm,"__esModule",{value:!0});vm.default=void 0;var Vb=mH(m),Or=Kw(pa),gH=Kw(Mo),or=En,As=Pi,Hb=Oi,Mu=Kw(bm);function Kw(e){return e&&e.__esModule?e:{default:e}}function aA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(aA=function(r){return r?n:t})(e)}function mH(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=aA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function mr(e,t,n){return t=vH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vH(e){var t=bH(e,"string");return typeof t=="symbol"?t:String(t)}function bH(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 $s=Wo.mouse,ym=class extends Vb.Component{constructor(){super(...arguments),mr(this,"dragging",!1),mr(this,"lastX",NaN),mr(this,"lastY",NaN),mr(this,"touchIdentifier",null),mr(this,"mounted",!1),mr(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,or.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,or.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,or.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,As.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,As.createCoreData)(this,s,a);(0,Mu.default)("DraggableCore: handleDragStart: %j",l),(0,Mu.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,or.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,or.addEvent)(r,$s.move,this.handleDrag),(0,or.addEvent)(r,$s.stop,this.handleDragStop))}),mr(this,"handleDrag",t=>{const n=(0,As.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,As.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,As.createCoreData)(this,r,o);if((0,Mu.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),mr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,As.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,As.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,As.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,or.removeUserSelectStyles)(a.ownerDocument),(0,Mu.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Mu.default)("DraggableCore: Removing handlers"),(0,or.removeEvent)(a.ownerDocument,$s.move,this.handleDrag),(0,or.removeEvent)(a.ownerDocument,$s.stop,this.handleDragStop))}),mr(this,"onMouseDown",t=>($s=Wo.mouse,this.handleDragStart(t))),mr(this,"onMouseUp",t=>($s=Wo.mouse,this.handleDragStop(t))),mr(this,"onTouchStart",t=>($s=Wo.touch,this.handleDragStart(t))),mr(this,"onTouchEnd",t=>($s=Wo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,or.addEvent)(t,Wo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,or.removeEvent)(n,Wo.mouse.move,this.handleDrag),(0,or.removeEvent)(n,Wo.touch.move,this.handleDrag),(0,or.removeEvent)(n,Wo.mouse.stop,this.handleDragStop),(0,or.removeEvent)(n,Wo.touch.stop,this.handleDragStop),(0,or.removeEvent)(t,Wo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,or.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:gH.default.findDOMNode(this)}render(){return Vb.cloneElement(Vb.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};vm.default=ym;mr(ym,"displayName","DraggableCore");mr(ym,"propTypes",{allowAnyClick:Or.default.bool,children:Or.default.node.isRequired,disabled:Or.default.bool,enableUserSelectHack:Or.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:Or.default.arrayOf(Or.default.number),handle:Or.default.string,cancel:Or.default.string,nodeRef:Or.default.object,onStart:Or.default.func,onDrag:Or.default.func,onStop:Or.default.func,onMouseDown:Or.default.func,scale:Or.default.number,className:Hb.dontSetMe,style:Hb.dontSetMe,transform:Hb.dontSetMe});mr(ym,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=h(m),n=u(pa),r=u(Mo),o=u(LV),i=En,s=Pi,a=Oi,l=u(vm),c=u(bm);function u(_){return _&&_.__esModule?_:{default:_}}function f(_){if(typeof WeakMap!="function")return null;var S=new WeakMap,C=new WeakMap;return(f=function(E){return E?C:S})(_)}function h(_,S){if(!S&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var C=f(S);if(C&&C.has(_))return C.get(_);var E={},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in _)if(A!=="default"&&Object.prototype.hasOwnProperty.call(_,A)){var k=P?Object.getOwnPropertyDescriptor(_,A):null;k&&(k.get||k.set)?Object.defineProperty(E,A,k):E[A]=_[A]}return E.default=_,C&&C.set(_,E),E}function g(){return g=Object.assign?Object.assign.bind():function(_){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(_[E]=C[E])}return _},g.apply(this,arguments)}function v(_,S,C){return S=b(S),S in _?Object.defineProperty(_,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[S]=C,_}function b(_){var S=w(_,"string");return typeof S=="symbol"?S:String(S)}function w(_,S){if(typeof _!="object"||_===null)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var E=C.call(_,S||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(_)}class x extends t.Component{static getDerivedStateFromProps(S,C){let{position:E}=S,{prevPropsPosition:P}=C;return E&&(!P||E.x!==P.x||E.y!==P.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:P}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(S){super(S),v(this,"onDragStart",(C,E)=>{if((0,c.default)("Draggable: onDragStart: %j",E),this.props.onStart(C,(0,s.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(C,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const P=(0,s.createDraggableData)(this,E),A={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:I,y:$}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[L,j]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=L,A.y=j,A.slackX=this.state.slackX+(I-A.x),A.slackY=this.state.slackY+($-A.y),P.x=A.x,P.y=A.y,P.deltaX=A.x-this.state.x,P.deltaY=A.y-this.state.y}if(this.props.onDrag(C,P)===!1)return!1;this.setState(A)}),v(this,"onDragStop",(C,E)=>{if(!this.state.dragging||this.props.onStop(C,(0,s.createDraggableData)(this,E))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",E);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:I,y:$}=this.props.position;A.x=I,A.y=$}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var S,C;return(S=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:C,children:E,defaultPosition:P,defaultClassName:A,defaultClassNameDragging:k,defaultClassNameDragged:I,position:$,positionOffset:L,scale:j,...Q}=this.props;let ee={},B=null;const G=!!!$||this.state.dragging,q=$||P,K={x:(0,s.canDragX)(this)&&G?this.state.x:q.x,y:(0,s.canDragY)(this)&&G?this.state.y:q.y};this.state.isElementSVG?B=(0,i.createSVGTransform)(K,L):ee=(0,i.createCSSTransform)(K,L);const T=(0,o.default)(E.props.className||"",A,{[k]:this.state.dragging,[I]:this.state.dragged});return t.createElement(l.default,g({},Q,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:T,style:{...E.props.style,...ee},transform:B}))}}e.default=x,v(x,"displayName","Draggable"),v(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}),v(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})})(ZD);const{default:lA,DraggableCore:yH}=ZD;mm.exports=lA;mm.exports.default=lA;mm.exports.DraggableCore=yH;var cA=mm.exports,xm={exports:{}},kf={},Xw={};Xw.__esModule=!0;Xw.cloneElement=EH;var xH=wH(m);function wH(e){return e&&e.__esModule?e:{default:e}}function ER(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function RR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ER(Object(n),!0).forEach(function(r){_H(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ER(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _H(e,t,n){return t=SH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SH(e){var t=CH(e,"string");return typeof t=="symbol"?t:String(t)}function CH(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 EH(e,t){return t.style&&e.props.style&&(t.style=RR(RR({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),xH.default.cloneElement(e,t)}var Mf={};Mf.__esModule=!0;Mf.resizableProps=void 0;var gt=RH(pa);function RH(e){return e&&e.__esModule?e:{default:e}}var OH={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 o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=gt.default.number).isRequired.apply(i,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 o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=gt.default.number).isRequired.apply(i,n)}return gt.default.number.apply(gt.default,n)}};Mf.resizableProps=OH;kf.__esModule=!0;kf.default=void 0;var Iu=$H(m),PH=cA,TH=Xw,DH=Mf,AH=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function uA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(uA=function(o){return o?n:t})(e)}function $H(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=uA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function G0(){return G0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G0.apply(this,arguments)}function kH(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function OR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Wb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OR(Object(n),!0).forEach(function(r){MH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MH(e,t,n){return t=IH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IH(e){var t=NH(e,"string");return typeof t=="symbol"?t:String(t)}function NH(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 LH(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Y0(e,t)}function Y0(e,t){return Y0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Y0(e,t)}var Qw=function(e){LH(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,f=o-this.props.width,h=i-this.props.height;Math.abs(f)>Math.abs(h*u)?i=o/u:o=i*u}var g=o,v=i,b=this.slack||[0,0],w=b[0],x=b[1];return o+=w,i+=x,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[w+(g-o),x+(v-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;o==="onResizeStart"&&s.resetData();var h=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",g=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!h&&!g)){var v=i[0],b=i[i.length-1],w=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var x=w.left-s.lastHandleRect.left;u+=x}if(v==="n"){var _=w.top-s.lastHandleRect.top;f+=_}}s.lastHandleRect=w,b==="w"&&(u=-u),v==="n"&&(f=-f);var S=s.props.width+(h?u/s.props.transformScale:0),C=s.props.height+(g?f/s.props.transformScale:0),E=s.runConstraints(S,C);S=E[0],C=E[1];var P=S!==s.props.width||C!==s.props.height,A=typeof s.props[o]=="function"?s.props[o]:null,k=o==="onResize"&&!P;A&&!k&&(a.persist==null||a.persist(),A(a,{node:c,size:{width:S,height:C},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Iu.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=Wb({ref:i},a?{}:{handleAxis:o});return Iu.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=kH(i,AH);return(0,TH.cloneElement)(s,Wb(Wb({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var h,g=(h=o.handleRefs[f])!=null?h:o.handleRefs[f]=Iu.createRef();return Iu.createElement(PH.DraggableCore,G0({},l,{nodeRef:g,key:"resizableHandle-"+f,onStop:o.resizeHandler("onResizeStop",f),onStart:o.resizeHandler("onResizeStart",f),onDrag:o.resizeHandler("onResize",f)}),o.renderResizeHandle(f,g))}))}))},t}(Iu.Component);kf.default=Qw;Qw.propTypes=DH.resizableProps;Qw.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var wm={};wm.__esModule=!0;wm.default=void 0;var Ub=VH(m),FH=dA(pa),jH=dA(kf),zH=Mf,BH=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function dA(e){return e&&e.__esModule?e:{default:e}}function fA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(fA=function(o){return o?n:t})(e)}function VH(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=fA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function K0(){return K0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K0.apply(this,arguments)}function PR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function vg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PR(Object(n),!0).forEach(function(r){HH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HH(e,t,n){return t=WH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WH(e){var t=UH(e,"string");return typeof t=="symbol"?t:String(t)}function UH(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 qH(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function GH(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,X0(e,t)}function X0(e,t){return X0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},X0(e,t)}var hA=function(e){GH(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,f=o.maxConstraints,h=o.lockAspectRatio,g=o.axis;o.width,o.height;var v=o.resizeHandles,b=o.style,w=o.transformScale,x=qH(o,BH);return Ub.createElement(jH.default,{axis:g,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:h,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:w,width:this.state.width},Ub.createElement("div",K0({},x,{style:vg(vg({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Ub.Component);wm.default=hA;hA.propTypes=vg(vg({},zH.resizableProps),{},{children:FH.default.element});xm.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};xm.exports.Resizable=kf.default;xm.exports.ResizableBox=wm.default;var YH=xm.exports,os={};Object.defineProperty(os,"__esModule",{value:!0});os.resizeHandleType=os.resizeHandleAxesType=os.default=void 0;var wt=pA(pa),KH=pA(m);function pA(e){return e&&e.__esModule?e:{default:e}}const gA=wt.default.arrayOf(wt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));os.resizeHandleAxesType=gA;const mA=wt.default.oneOfType([wt.default.node,wt.default.func]);os.resizeHandleType=mA;var XH={className:wt.default.string,style:wt.default.object,width:wt.default.number,autoSize:wt.default.bool,cols:wt.default.number,draggableCancel:wt.default.string,draggableHandle:wt.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:wt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Ot.validateLayout(t,"layout")},margin:wt.default.arrayOf(wt.default.number),containerPadding:wt.default.arrayOf(wt.default.number),rowHeight:wt.default.number,maxRows:wt.default.number,isBounded:wt.default.bool,isDraggable:wt.default.bool,isResizable:wt.default.bool,allowOverlap:wt.default.bool,preventCollision:wt.default.bool,useCSSTransforms:wt.default.bool,transformScale:wt.default.number,isDroppable:wt.default.bool,resizeHandles:gA,resizeHandle:mA,onLayoutChange:wt.default.func,onDragStart:wt.default.func,onDrag:wt.default.func,onDragStop:wt.default.func,onResizeStart:wt.default.func,onResize:wt.default.func,onResizeStop:wt.default.func,onDrop:wt.default.func,droppingItem:wt.default.shape({i:wt.default.string.isRequired,w:wt.default.number.isRequired,h:wt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};KH.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:wt.default.any};os.default=XH;Object.defineProperty(gm,"__esModule",{value:!0});gm.default=void 0;var Yl=Jw(m),zt=Jw(pa),QH=cA,JH=YH,Kl=Ot,Yn=Ri,TR=os,ZH=Jw(Nw);function Jw(e){return e&&e.__esModule?e:{default:e}}function ci(e,t,n){return t=eW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eW(e){var t=tW(e,"string");return typeof t=="symbol"?t:String(t)}function tW(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 Zw extends Yl.default.Component{constructor(){super(...arguments),ci(this,"state",{resizing:null,dragging:null,className:""}),ci(this,"elementRef",Yl.default.createRef()),ci(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,f=l.left/i,h=c.top/i,g=l.top/i;s.left=u-f+a.scrollLeft,s.top=h-g+a.scrollTop,this.setState({dragging:s});const{x:v,y:b}=(0,Yn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,b,{e:t,node:r,newPosition:s})}),ci(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:f,h,containerWidth:g}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:S,rowHeight:C}=this.props,E=_.clientHeight-(0,Yn.calcGridItemWHPx)(h,C,S[1]);a=(0,Yn.clamp)(a,0,E);const P=(0,Yn.calcGridColWidth)(v),A=g-(0,Yn.calcGridItemWHPx)(f,P,S[0]);l=(0,Yn.clamp)(l,0,A)}}const b={top:a,left:l};this.setState({dragging:b});const{x:w,y:x}=(0,Yn.calcXY)(v,a,l,f,h);return s.call(this,u,w,x,{e:t,node:r,newPosition:b})}),ci(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:f,y:h}=(0,Yn.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,f,h,{e:t,node:r,newPosition:u})}),ci(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),ci(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),ci(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,Yn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,Yn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Kl.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,Kl.setTransform)(t):(i=(0,Kl.setTopLeft)(t),n&&(i.left=(0,Kl.perc)(t.left/r),i.width=(0,Kl.perc)(t.width/r))),i}mixinDraggable(t,n){return Yl.default.createElement(QH.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:f}=this.props,h=this.getPositionParams(),g=(0,Yn.calcGridItemPosition)(h,0,0,o,0).width,v=(0,Yn.calcGridItemPosition)(h,0,0,i,s),b=(0,Yn.calcGridItemPosition)(h,0,0,a,l),w=[v.width,v.height],x=[Math.min(b.width,g),Math.min(b.height,1/0)];return Yl.default.createElement(JH.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:w,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:f},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:f,maxH:h,minH:g,containerWidth:v}=this.props,{minW:b,maxW:w}=this.props;let x=s;i&&(x=(0,Kl.resizeItemInDirection)(a,r,s,v),this.setState({resizing:o==="onResizeStop"?null:x}));let{w:_,h:S}=(0,Yn.calcWH)(this.getPositionParams(),x.width,x.height,c,u,a);_=(0,Yn.clamp)(_,Math.max(b,1),w),S=(0,Yn.clamp)(S,g,h),l.call(this,f,_,S,{e:t,node:i,size:x,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Yn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Yl.default.Children.only(this.props.children);let f=Yl.default.cloneElement(u,{ref:this.elementRef,className:(0,ZH.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,i),f}}gm.default=Zw;ci(Zw,"propTypes",{children:zt.default.element,cols:zt.default.number.isRequired,containerWidth:zt.default.number.isRequired,rowHeight:zt.default.number.isRequired,margin:zt.default.array.isRequired,maxRows:zt.default.number.isRequired,containerPadding:zt.default.array.isRequired,x:zt.default.number.isRequired,y:zt.default.number.isRequired,w:zt.default.number.isRequired,h:zt.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:zt.default.string.isRequired,resizeHandles:TR.resizeHandleAxesType,resizeHandle:TR.resizeHandleType,onDragStop:zt.default.func,onDragStart:zt.default.func,onDrag:zt.default.func,onResizeStop:zt.default.func,onResizeStart:zt.default.func,onResize:zt.default.func,isDraggable:zt.default.bool.isRequired,isResizable:zt.default.bool.isRequired,isBounded:zt.default.bool.isRequired,static:zt.default.bool,useCSSTransforms:zt.default.bool.isRequired,transformScale:zt.default.number,className:zt.default.string,handle:zt.default.string,cancel:zt.default.string,droppingPosition:zt.default.shape({e:zt.default.object.isRequired,left:zt.default.number.isRequired,top:zt.default.number.isRequired})});ci(Zw,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty($f,"__esModule",{value:!0});$f.default=void 0;var Ta=iW(m),qb=Iw,nW=e1(Nw),it=Ot,rW=Ri,DR=e1(gm),oW=e1(os);function e1(e){return e&&e.__esModule?e:{default:e}}function vA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(vA=function(r){return r?n:t})(e)}function iW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=vA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function ir(e,t,n){return t=sW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sW(e){var t=aW(e,"string");return typeof t=="symbol"?t:String(t)}function aW(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 AR="react-grid-layout";let bA=!1;try{bA=/firefox/i.test(navigator.userAgent)}catch{}class _m extends Ta.Component{constructor(){super(...arguments),ir(this,"state",{activeDrag:null,layout:(0,it.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,it.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),ir(this,"dragEnterCounter",0),ir(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,it.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),ir(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:f}=this.props,h=(0,it.getLayoutItem)(l,t);if(!h)return;const g={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t},v=!0;l=(0,it.moveElement)(l,h,n,r,v,f,(0,it.compactType)(this.props),c,u),this.props.onDrag(l,a,h,g,i,s),this.setState({layout:u?l:(0,it.compact)(l,(0,it.compactType)(this.props),c),activeDrag:g})}),ir(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:f}=this.props,h=(0,it.getLayoutItem)(l,t);if(!h)return;const g=!0;l=(0,it.moveElement)(l,h,n,r,g,u,(0,it.compactType)(this.props),c,f);const v=f?l:(0,it.compact)(l,(0,it.compactType)(this.props),c);this.props.onDragStop(v,a,h,null,i,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),ir(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,it.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),ir(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:f,preventCollision:h,allowOverlap:g}=this.props;let v=!1,b,w,x;const[_,S]=(0,it.withLayoutItem)(u,t,E=>{let P;return w=E.x,x=E.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(w=E.x+(E.w-n),n=E.x!==w&&w<0?E.w:n,w=w<0?0:w),["ne","n","nw"].indexOf(l)!==-1&&(x=E.y+(E.h-r),r=E.y!==x&&x<0?E.h:r,x=x<0?0:x),v=!0),h&&!g&&(P=(0,it.getAllCollisions)(u,{...E,w:n,h:r,x:w,y:x}).filter(k=>k.i!==E.i).length>0,P&&(x=E.y,r=E.h,w=E.x,n=E.w,v=!1)),E.w=n,E.h=r,E});if(!S)return;b=_,v&&(b=(0,it.moveElement)(_,S,w,x,!0,this.props.preventCollision,(0,it.compactType)(this.props),f,g));const C={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(b,c,S,C,i,s),this.setState({layout:g?b:(0,it.compact)(b,(0,it.compactType)(this.props),f),activeDrag:C})}),ir(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,f=(0,it.getLayoutItem)(a,t),h=u?a:(0,it.compact)(a,(0,it.compactType)(this.props),c);this.props.onResizeStop(h,l,f,null,i,s);const{oldLayout:g}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,g)}),ir(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),bA&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(AR)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:f}=this.props,h=o==null?void 0:o(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const g={...r,...h},{layout:v}=this.state,{layerX:b,layerY:w}=t.nativeEvent,x={left:b/f,top:w/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=b||S!=w)&&this.setState({droppingPosition:x})}}else{const _={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},S=(0,rW.calcXY)(_,w,b,g.w,g.h);this.setState({droppingDOMNode:Ta.createElement("div",{key:g.i}),droppingPosition:x,layout:[...v,{...g,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),ir(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,it.compact)(r.filter(i=>i.i!==t.i),(0,it.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ir(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ir(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),ir(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,qb.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,it.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,it.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,it.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,it.fastRGLPropsEqual)(this.props,t,qb.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,it.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,qb.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Ta.createElement(DR.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Ta.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,it.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:f,isBounded:h,useCSSTransforms:g,transformScale:v,draggableCancel:b,draggableHandle:w,resizeHandles:x,resizeHandle:_}=this.props,{mounted:S,droppingPosition:C}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,P=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,A=r.resizeHandles||x,k=E&&h&&r.isBounded!==!1;return Ta.createElement(DR.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:w,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:P,isBounded:k,useCSSTransforms:g&&S,usePercentages:!S,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?C:void 0,resizeHandles:A,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,nW.default)(AR,t),s={height:this.containerHeight(),...n};return Ta.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:it.noop,onDragLeave:r?this.onDragLeave:it.noop,onDragEnter:r?this.onDragEnter:it.noop,onDragOver:r?this.onDragOver:it.noop},Ta.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}$f.default=_m;ir(_m,"displayName","ReactGridLayout");ir(_m,"propTypes",oW.default);ir(_m,"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:it.noop,onDragStart:it.noop,onDrag:it.noop,onDragStop:it.noop,onResizeStart:it.noop,onResize:it.noop,onResizeStop:it.noop,onDrop:it.noop,onDropDragOver:it.noop});var Sm={},Cl={};Object.defineProperty(Cl,"__esModule",{value:!0});Cl.findOrGenerateResponsiveLayout=uW;Cl.getBreakpointFromWidth=lW;Cl.getColsFromBreakpoint=cW;Cl.sortBreakpoints=t1;var Kh=Ot;function lW(e,t){const n=t1(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function cW(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function uW(e,t,n,r,o,i){if(e[n])return(0,Kh.cloneLayout)(e[n]);let s=e[r];const a=t1(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,Kh.cloneLayout)(s||[]),(0,Kh.compact)((0,Kh.correctBounds)(s,{cols:o}),i,o)}function t1(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Sm,"__esModule",{value:!0});Sm.default=void 0;var $R=fW(m),Pr=yA(pa),Gb=Iw,vc=Ot,Da=Cl,dW=yA($f);function yA(e){return e&&e.__esModule?e:{default:e}}function xA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(xA=function(r){return r?n:t})(e)}function fW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=xA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Q0(){return Q0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q0.apply(this,arguments)}function bg(e,t,n){return t=hW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hW(e){var t=pW(e,"string");return typeof t=="symbol"?t:String(t)}function pW(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 kR=e=>Object.prototype.toString.call(e);function Xh(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class n1 extends $R.Component{constructor(){super(...arguments),bg(this,"state",this.generateInitialState()),bg(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,Da.getBreakpointFromWidth)(n,t),s=(0,Da.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Da.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Gb.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Da.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,Gb.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Gb.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,Da.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Da.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,vc.cloneLayout)(this.state.layout));let h=(0,Da.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);h=(0,vc.synchronizeLayoutWithChildren)(h,this.props.children,l,i,this.props.allowOverlap),c[s]=h,this.props.onLayoutChange(h,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:h,cols:l})}const u=Xh(this.props.margin,s),f=Xh(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return $R.createElement(dW.default,Q0({},u,{margin:Xh(i,this.state.breakpoint),containerPadding:Xh(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Sm.default=n1;bg(n1,"propTypes",{breakpoint:Pr.default.string,breakpoints:Pr.default.object,allowOverlap:Pr.default.bool,cols:Pr.default.object,margin:Pr.default.oneOfType([Pr.default.array,Pr.default.object]),containerPadding:Pr.default.oneOfType([Pr.default.array,Pr.default.object]),layouts(e,t){if(kR(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+kR(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,vc.validateLayout)(e.layouts[n],"layouts."+n)})},width:Pr.default.number.isRequired,onBreakpointChange:Pr.default.func,onLayoutChange:Pr.default.func,onWidthChange:Pr.default.func});bg(n1,"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:vc.noop,onLayoutChange:vc.noop,onWidthChange:vc.noop});var r1={},wA=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),J0=typeof window<"u"&&typeof document<"u"&&window.document===document,yg=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")()}(),gW=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(yg):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),mW=2;function vW(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){gW(i)}function a(){var l=Date.now();if(n){if(l-o<mW)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var bW=20,yW=["top","right","bottom","left","width","height","size","weight"],xW=typeof MutationObserver<"u",wW=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=vW(this.refresh.bind(this),bW)}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(){!J0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),xW?(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(){!J0||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=yW.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),_A=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Wc=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||yg},SA=Cm(0,0,0,0);function xg(e){return parseFloat(e)||0}function MR(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+xg(i)},0)}function _W(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=xg(s)}return n}function SW(e){var t=e.getBBox();return Cm(0,0,t.width,t.height)}function CW(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return SA;var r=Wc(e).getComputedStyle(e),o=_W(r),i=o.left+o.right,s=o.top+o.bottom,a=xg(r.width),l=xg(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=MR(r,"left","right")+i),Math.round(l+s)!==n&&(l-=MR(r,"top","bottom")+s)),!RW(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return Cm(o.left,o.top,a,l)}var EW=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Wc(e).SVGGraphicsElement}:function(e){return e instanceof Wc(e).SVGElement&&typeof e.getBBox=="function"}}();function RW(e){return e===Wc(e).document.documentElement}function OW(e){return J0?EW(e)?SW(e):CW(e):SA}function PW(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return _A(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function Cm(e,t,n,r){return{x:e,y:t,width:n,height:r}}var TW=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Cm(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=OW(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}(),DW=function(){function e(t,n){var r=PW(n);_A(this,{target:t,contentRect:r})}return e}(),AW=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new wA,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 Wc(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new TW(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 Wc(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 DW(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}(),CA=typeof WeakMap<"u"?new WeakMap:new wA,EA=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=wW.getInstance(),r=new AW(t,n,this);CA.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){EA.prototype[e]=function(){var t;return(t=CA.get(this))[e].apply(t,arguments)}});var $W=function(){return typeof yg.ResizeObserver<"u"?yg.ResizeObserver:EA}();const kW=Object.freeze(Object.defineProperty({__proto__:null,default:$W},Symbol.toStringTag,{value:"Module"})),MW=gw(kW);Object.defineProperty(r1,"__esModule",{value:!0});r1.default=VW;var Qh=FW(m),IW=o1(pa),NW=o1(MW),LW=o1(Nw);function o1(e){return e&&e.__esModule?e:{default:e}}function RA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(RA=function(r){return r?n:t})(e)}function FW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=RA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Z0(){return Z0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z0.apply(this,arguments)}function Xl(e,t,n){return t=jW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jW(e){var t=zW(e,"string");return typeof t=="symbol"?t:String(t)}function zW(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 BW="react-grid-layout";function VW(e){var t;return t=class extends Qh.Component{constructor(){super(...arguments),Xl(this,"state",{width:1280}),Xl(this,"elementRef",Qh.createRef()),Xl(this,"mounted",!1),Xl(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new NW.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?Qh.createElement("div",{className:(0,LW.default)(this.props.className,BW),style:this.props.style,ref:this.elementRef}):Qh.createElement(e,Z0({innerRef:this.elementRef},o,this.state))}},Xl(t,"defaultProps",{measureBeforeMount:!1}),Xl(t,"propTypes",{measureBeforeMount:IW.default.bool}),t}(function(e){e.exports=$f.default,e.exports.utils=Ot,e.exports.calculateUtils=Ri,e.exports.Responsive=Sm.default,e.exports.Responsive.utils=Cl,e.exports.WidthProvider=r1.default})(FD);var IR=FD.exports;function is({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),c=$e(h=>h.isDashboardEditing),u=h=>{h.stopPropagation(),c&&s(!0)};function f(){return o==="textarea"?O.jsx("textarea",{className:Ce(" grow px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:h=>l(h.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:h=>{h.key==="Enter"&&h.shiftKey||(h.key==="Enter"||h.key==="Tab")&&(s(!1),r(a))}}):O.jsx("input",{onMouseDown:h=>h.stopPropagation(),type:"text",className:Ce("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:h=>l(h.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:h=>{(h.key==="Enter"||h.key==="Tab")&&(s(!1),r(a))}})}return O.jsx("div",{className:"flex",role:"editable",onDoubleClick:u,children:i?f():e})}/*!
|
|
109
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&iA(e.body,"react-draggable-transparent-selection")}function iH(e){if(e)try{if(e.body&&sA(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 iA(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function sA(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Pi={};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.canDragX=lH;Pi.canDragY=cH;Pi.createCoreData=dH;Pi.createDraggableData=fH;Pi.getBoundPosition=sH;Pi.getControlPosition=uH;Pi.snapToGrid=aH;var qr=Oi,hc=En;function sH(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:hH(r);const o=Yw(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,qr.int)(u.paddingLeft)+(0,qr.int)(c.marginLeft),top:-o.offsetTop+(0,qr.int)(u.paddingTop)+(0,qr.int)(c.marginTop),right:(0,hc.innerWidth)(l)-(0,hc.outerWidth)(o)-o.offsetLeft+(0,qr.int)(u.paddingRight)-(0,qr.int)(c.marginRight),bottom:(0,hc.innerHeight)(l)-(0,hc.outerHeight)(o)-o.offsetTop+(0,qr.int)(u.paddingBottom)-(0,qr.int)(c.marginBottom)}}return(0,qr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,qr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,qr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,qr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function aH(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function lH(e){return e.props.axis==="both"||e.props.axis==="x"}function cH(e){return e.props.axis==="both"||e.props.axis==="y"}function uH(e,t,n){const r=typeof t=="number"?(0,hc.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=Yw(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,hc.offsetXYFromParent)(r||e,i,n.props.scale)}function dH(e,t,n){const r=!(0,qr.isNum)(e.lastX),o=Yw(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function fH(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 hH(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Yw(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var vm={},bm={};Object.defineProperty(bm,"__esModule",{value:!0});bm.default=pH;function pH(){}Object.defineProperty(vm,"__esModule",{value:!0});vm.default=void 0;var Vb=mH(m),Or=Kw(pa),gH=Kw(Mo),or=En,As=Pi,Hb=Oi,Mu=Kw(bm);function Kw(e){return e&&e.__esModule?e:{default:e}}function aA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(aA=function(r){return r?n:t})(e)}function mH(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=aA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function mr(e,t,n){return t=vH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vH(e){var t=bH(e,"string");return typeof t=="symbol"?t:String(t)}function bH(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 $s=Wo.mouse,ym=class extends Vb.Component{constructor(){super(...arguments),mr(this,"dragging",!1),mr(this,"lastX",NaN),mr(this,"lastY",NaN),mr(this,"touchIdentifier",null),mr(this,"mounted",!1),mr(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,or.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,or.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,or.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,As.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,As.createCoreData)(this,s,a);(0,Mu.default)("DraggableCore: handleDragStart: %j",l),(0,Mu.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,or.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,or.addEvent)(r,$s.move,this.handleDrag),(0,or.addEvent)(r,$s.stop,this.handleDragStop))}),mr(this,"handleDrag",t=>{const n=(0,As.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,As.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,As.createCoreData)(this,r,o);if((0,Mu.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),mr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,As.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,As.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,As.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,or.removeUserSelectStyles)(a.ownerDocument),(0,Mu.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Mu.default)("DraggableCore: Removing handlers"),(0,or.removeEvent)(a.ownerDocument,$s.move,this.handleDrag),(0,or.removeEvent)(a.ownerDocument,$s.stop,this.handleDragStop))}),mr(this,"onMouseDown",t=>($s=Wo.mouse,this.handleDragStart(t))),mr(this,"onMouseUp",t=>($s=Wo.mouse,this.handleDragStop(t))),mr(this,"onTouchStart",t=>($s=Wo.touch,this.handleDragStart(t))),mr(this,"onTouchEnd",t=>($s=Wo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,or.addEvent)(t,Wo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,or.removeEvent)(n,Wo.mouse.move,this.handleDrag),(0,or.removeEvent)(n,Wo.touch.move,this.handleDrag),(0,or.removeEvent)(n,Wo.mouse.stop,this.handleDragStop),(0,or.removeEvent)(n,Wo.touch.stop,this.handleDragStop),(0,or.removeEvent)(t,Wo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,or.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:gH.default.findDOMNode(this)}render(){return Vb.cloneElement(Vb.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};vm.default=ym;mr(ym,"displayName","DraggableCore");mr(ym,"propTypes",{allowAnyClick:Or.default.bool,children:Or.default.node.isRequired,disabled:Or.default.bool,enableUserSelectHack:Or.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:Or.default.arrayOf(Or.default.number),handle:Or.default.string,cancel:Or.default.string,nodeRef:Or.default.object,onStart:Or.default.func,onDrag:Or.default.func,onStop:Or.default.func,onMouseDown:Or.default.func,scale:Or.default.number,className:Hb.dontSetMe,style:Hb.dontSetMe,transform:Hb.dontSetMe});mr(ym,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=h(m),n=u(pa),r=u(Mo),o=u(LV),i=En,s=Pi,a=Oi,l=u(vm),c=u(bm);function u(_){return _&&_.__esModule?_:{default:_}}function f(_){if(typeof WeakMap!="function")return null;var S=new WeakMap,C=new WeakMap;return(f=function(E){return E?C:S})(_)}function h(_,S){if(!S&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var C=f(S);if(C&&C.has(_))return C.get(_);var E={},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in _)if(A!=="default"&&Object.prototype.hasOwnProperty.call(_,A)){var k=P?Object.getOwnPropertyDescriptor(_,A):null;k&&(k.get||k.set)?Object.defineProperty(E,A,k):E[A]=_[A]}return E.default=_,C&&C.set(_,E),E}function g(){return g=Object.assign?Object.assign.bind():function(_){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(_[E]=C[E])}return _},g.apply(this,arguments)}function v(_,S,C){return S=b(S),S in _?Object.defineProperty(_,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[S]=C,_}function b(_){var S=w(_,"string");return typeof S=="symbol"?S:String(S)}function w(_,S){if(typeof _!="object"||_===null)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var E=C.call(_,S||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(_)}class x extends t.Component{static getDerivedStateFromProps(S,C){let{position:E}=S,{prevPropsPosition:P}=C;return E&&(!P||E.x!==P.x||E.y!==P.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:P}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(S){super(S),v(this,"onDragStart",(C,E)=>{if((0,c.default)("Draggable: onDragStart: %j",E),this.props.onStart(C,(0,s.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(C,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const P=(0,s.createDraggableData)(this,E),A={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:I,y:$}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[L,j]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=L,A.y=j,A.slackX=this.state.slackX+(I-A.x),A.slackY=this.state.slackY+($-A.y),P.x=A.x,P.y=A.y,P.deltaX=A.x-this.state.x,P.deltaY=A.y-this.state.y}if(this.props.onDrag(C,P)===!1)return!1;this.setState(A)}),v(this,"onDragStop",(C,E)=>{if(!this.state.dragging||this.props.onStop(C,(0,s.createDraggableData)(this,E))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",E);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:I,y:$}=this.props.position;A.x=I,A.y=$}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var S,C;return(S=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:C,children:E,defaultPosition:P,defaultClassName:A,defaultClassNameDragging:k,defaultClassNameDragged:I,position:$,positionOffset:L,scale:j,...Q}=this.props;let ee={},B=null;const G=!!!$||this.state.dragging,q=$||P,K={x:(0,s.canDragX)(this)&&G?this.state.x:q.x,y:(0,s.canDragY)(this)&&G?this.state.y:q.y};this.state.isElementSVG?B=(0,i.createSVGTransform)(K,L):ee=(0,i.createCSSTransform)(K,L);const T=(0,o.default)(E.props.className||"",A,{[k]:this.state.dragging,[I]:this.state.dragged});return t.createElement(l.default,g({},Q,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:T,style:{...E.props.style,...ee},transform:B}))}}e.default=x,v(x,"displayName","Draggable"),v(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}),v(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})})(ZD);const{default:lA,DraggableCore:yH}=ZD;mm.exports=lA;mm.exports.default=lA;mm.exports.DraggableCore=yH;var cA=mm.exports,xm={exports:{}},kf={},Xw={};Xw.__esModule=!0;Xw.cloneElement=EH;var xH=wH(m);function wH(e){return e&&e.__esModule?e:{default:e}}function ER(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function RR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ER(Object(n),!0).forEach(function(r){_H(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ER(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _H(e,t,n){return t=SH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SH(e){var t=CH(e,"string");return typeof t=="symbol"?t:String(t)}function CH(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 EH(e,t){return t.style&&e.props.style&&(t.style=RR(RR({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),xH.default.cloneElement(e,t)}var Mf={};Mf.__esModule=!0;Mf.resizableProps=void 0;var gt=RH(pa);function RH(e){return e&&e.__esModule?e:{default:e}}var OH={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 o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=gt.default.number).isRequired.apply(i,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 o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=gt.default.number).isRequired.apply(i,n)}return gt.default.number.apply(gt.default,n)}};Mf.resizableProps=OH;kf.__esModule=!0;kf.default=void 0;var Iu=$H(m),PH=cA,TH=Xw,DH=Mf,AH=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function uA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(uA=function(o){return o?n:t})(e)}function $H(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=uA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function G0(){return G0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G0.apply(this,arguments)}function kH(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function OR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Wb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OR(Object(n),!0).forEach(function(r){MH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MH(e,t,n){return t=IH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IH(e){var t=NH(e,"string");return typeof t=="symbol"?t:String(t)}function NH(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 LH(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Y0(e,t)}function Y0(e,t){return Y0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Y0(e,t)}var Qw=function(e){LH(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,f=o-this.props.width,h=i-this.props.height;Math.abs(f)>Math.abs(h*u)?i=o/u:o=i*u}var g=o,v=i,b=this.slack||[0,0],w=b[0],x=b[1];return o+=w,i+=x,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[w+(g-o),x+(v-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;o==="onResizeStart"&&s.resetData();var h=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",g=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!h&&!g)){var v=i[0],b=i[i.length-1],w=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var x=w.left-s.lastHandleRect.left;u+=x}if(v==="n"){var _=w.top-s.lastHandleRect.top;f+=_}}s.lastHandleRect=w,b==="w"&&(u=-u),v==="n"&&(f=-f);var S=s.props.width+(h?u/s.props.transformScale:0),C=s.props.height+(g?f/s.props.transformScale:0),E=s.runConstraints(S,C);S=E[0],C=E[1];var P=S!==s.props.width||C!==s.props.height,A=typeof s.props[o]=="function"?s.props[o]:null,k=o==="onResize"&&!P;A&&!k&&(a.persist==null||a.persist(),A(a,{node:c,size:{width:S,height:C},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Iu.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=Wb({ref:i},a?{}:{handleAxis:o});return Iu.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=kH(i,AH);return(0,TH.cloneElement)(s,Wb(Wb({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var h,g=(h=o.handleRefs[f])!=null?h:o.handleRefs[f]=Iu.createRef();return Iu.createElement(PH.DraggableCore,G0({},l,{nodeRef:g,key:"resizableHandle-"+f,onStop:o.resizeHandler("onResizeStop",f),onStart:o.resizeHandler("onResizeStart",f),onDrag:o.resizeHandler("onResize",f)}),o.renderResizeHandle(f,g))}))}))},t}(Iu.Component);kf.default=Qw;Qw.propTypes=DH.resizableProps;Qw.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var wm={};wm.__esModule=!0;wm.default=void 0;var Ub=VH(m),FH=dA(pa),jH=dA(kf),zH=Mf,BH=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function dA(e){return e&&e.__esModule?e:{default:e}}function fA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(fA=function(o){return o?n:t})(e)}function VH(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=fA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function K0(){return K0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K0.apply(this,arguments)}function PR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function vg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PR(Object(n),!0).forEach(function(r){HH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HH(e,t,n){return t=WH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WH(e){var t=UH(e,"string");return typeof t=="symbol"?t:String(t)}function UH(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 qH(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function GH(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,X0(e,t)}function X0(e,t){return X0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},X0(e,t)}var hA=function(e){GH(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,f=o.maxConstraints,h=o.lockAspectRatio,g=o.axis;o.width,o.height;var v=o.resizeHandles,b=o.style,w=o.transformScale,x=qH(o,BH);return Ub.createElement(jH.default,{axis:g,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:h,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:w,width:this.state.width},Ub.createElement("div",K0({},x,{style:vg(vg({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Ub.Component);wm.default=hA;hA.propTypes=vg(vg({},zH.resizableProps),{},{children:FH.default.element});xm.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};xm.exports.Resizable=kf.default;xm.exports.ResizableBox=wm.default;var YH=xm.exports,os={};Object.defineProperty(os,"__esModule",{value:!0});os.resizeHandleType=os.resizeHandleAxesType=os.default=void 0;var wt=pA(pa),KH=pA(m);function pA(e){return e&&e.__esModule?e:{default:e}}const gA=wt.default.arrayOf(wt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));os.resizeHandleAxesType=gA;const mA=wt.default.oneOfType([wt.default.node,wt.default.func]);os.resizeHandleType=mA;var XH={className:wt.default.string,style:wt.default.object,width:wt.default.number,autoSize:wt.default.bool,cols:wt.default.number,draggableCancel:wt.default.string,draggableHandle:wt.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:wt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Ot.validateLayout(t,"layout")},margin:wt.default.arrayOf(wt.default.number),containerPadding:wt.default.arrayOf(wt.default.number),rowHeight:wt.default.number,maxRows:wt.default.number,isBounded:wt.default.bool,isDraggable:wt.default.bool,isResizable:wt.default.bool,allowOverlap:wt.default.bool,preventCollision:wt.default.bool,useCSSTransforms:wt.default.bool,transformScale:wt.default.number,isDroppable:wt.default.bool,resizeHandles:gA,resizeHandle:mA,onLayoutChange:wt.default.func,onDragStart:wt.default.func,onDrag:wt.default.func,onDragStop:wt.default.func,onResizeStart:wt.default.func,onResize:wt.default.func,onResizeStop:wt.default.func,onDrop:wt.default.func,droppingItem:wt.default.shape({i:wt.default.string.isRequired,w:wt.default.number.isRequired,h:wt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};KH.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:wt.default.any};os.default=XH;Object.defineProperty(gm,"__esModule",{value:!0});gm.default=void 0;var Yl=Jw(m),zt=Jw(pa),QH=cA,JH=YH,Kl=Ot,Yn=Ri,TR=os,ZH=Jw(Nw);function Jw(e){return e&&e.__esModule?e:{default:e}}function ci(e,t,n){return t=eW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eW(e){var t=tW(e,"string");return typeof t=="symbol"?t:String(t)}function tW(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 Zw extends Yl.default.Component{constructor(){super(...arguments),ci(this,"state",{resizing:null,dragging:null,className:""}),ci(this,"elementRef",Yl.default.createRef()),ci(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,f=l.left/i,h=c.top/i,g=l.top/i;s.left=u-f+a.scrollLeft,s.top=h-g+a.scrollTop,this.setState({dragging:s});const{x:v,y:b}=(0,Yn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,b,{e:t,node:r,newPosition:s})}),ci(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:f,h,containerWidth:g}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:S,rowHeight:C}=this.props,E=_.clientHeight-(0,Yn.calcGridItemWHPx)(h,C,S[1]);a=(0,Yn.clamp)(a,0,E);const P=(0,Yn.calcGridColWidth)(v),A=g-(0,Yn.calcGridItemWHPx)(f,P,S[0]);l=(0,Yn.clamp)(l,0,A)}}const b={top:a,left:l};this.setState({dragging:b});const{x:w,y:x}=(0,Yn.calcXY)(v,a,l,f,h);return s.call(this,u,w,x,{e:t,node:r,newPosition:b})}),ci(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:f,y:h}=(0,Yn.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,f,h,{e:t,node:r,newPosition:u})}),ci(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),ci(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),ci(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,Yn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,Yn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Kl.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,Kl.setTransform)(t):(i=(0,Kl.setTopLeft)(t),n&&(i.left=(0,Kl.perc)(t.left/r),i.width=(0,Kl.perc)(t.width/r))),i}mixinDraggable(t,n){return Yl.default.createElement(QH.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:f}=this.props,h=this.getPositionParams(),g=(0,Yn.calcGridItemPosition)(h,0,0,o,0).width,v=(0,Yn.calcGridItemPosition)(h,0,0,i,s),b=(0,Yn.calcGridItemPosition)(h,0,0,a,l),w=[v.width,v.height],x=[Math.min(b.width,g),Math.min(b.height,1/0)];return Yl.default.createElement(JH.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:w,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:f},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:f,maxH:h,minH:g,containerWidth:v}=this.props,{minW:b,maxW:w}=this.props;let x=s;i&&(x=(0,Kl.resizeItemInDirection)(a,r,s,v),this.setState({resizing:o==="onResizeStop"?null:x}));let{w:_,h:S}=(0,Yn.calcWH)(this.getPositionParams(),x.width,x.height,c,u,a);_=(0,Yn.clamp)(_,Math.max(b,1),w),S=(0,Yn.clamp)(S,g,h),l.call(this,f,_,S,{e:t,node:i,size:x,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Yn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=Yl.default.Children.only(this.props.children);let f=Yl.default.cloneElement(u,{ref:this.elementRef,className:(0,ZH.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,i),f}}gm.default=Zw;ci(Zw,"propTypes",{children:zt.default.element,cols:zt.default.number.isRequired,containerWidth:zt.default.number.isRequired,rowHeight:zt.default.number.isRequired,margin:zt.default.array.isRequired,maxRows:zt.default.number.isRequired,containerPadding:zt.default.array.isRequired,x:zt.default.number.isRequired,y:zt.default.number.isRequired,w:zt.default.number.isRequired,h:zt.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:zt.default.string.isRequired,resizeHandles:TR.resizeHandleAxesType,resizeHandle:TR.resizeHandleType,onDragStop:zt.default.func,onDragStart:zt.default.func,onDrag:zt.default.func,onResizeStop:zt.default.func,onResizeStart:zt.default.func,onResize:zt.default.func,isDraggable:zt.default.bool.isRequired,isResizable:zt.default.bool.isRequired,isBounded:zt.default.bool.isRequired,static:zt.default.bool,useCSSTransforms:zt.default.bool.isRequired,transformScale:zt.default.number,className:zt.default.string,handle:zt.default.string,cancel:zt.default.string,droppingPosition:zt.default.shape({e:zt.default.object.isRequired,left:zt.default.number.isRequired,top:zt.default.number.isRequired})});ci(Zw,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty($f,"__esModule",{value:!0});$f.default=void 0;var Ta=iW(m),qb=Iw,nW=e1(Nw),it=Ot,rW=Ri,DR=e1(gm),oW=e1(os);function e1(e){return e&&e.__esModule?e:{default:e}}function vA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(vA=function(r){return r?n:t})(e)}function iW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=vA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function ir(e,t,n){return t=sW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sW(e){var t=aW(e,"string");return typeof t=="symbol"?t:String(t)}function aW(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 AR="react-grid-layout";let bA=!1;try{bA=/firefox/i.test(navigator.userAgent)}catch{}class _m extends Ta.Component{constructor(){super(...arguments),ir(this,"state",{activeDrag:null,layout:(0,it.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,it.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),ir(this,"dragEnterCounter",0),ir(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,it.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),ir(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:f}=this.props,h=(0,it.getLayoutItem)(l,t);if(!h)return;const g={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:t},v=!0;l=(0,it.moveElement)(l,h,n,r,v,f,(0,it.compactType)(this.props),c,u),this.props.onDrag(l,a,h,g,i,s),this.setState({layout:u?l:(0,it.compact)(l,(0,it.compactType)(this.props),c),activeDrag:g})}),ir(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:f}=this.props,h=(0,it.getLayoutItem)(l,t);if(!h)return;const g=!0;l=(0,it.moveElement)(l,h,n,r,g,u,(0,it.compactType)(this.props),c,f);const v=f?l:(0,it.compact)(l,(0,it.compactType)(this.props),c);this.props.onDragStop(v,a,h,null,i,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,b)}),ir(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,it.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),ir(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:f,preventCollision:h,allowOverlap:g}=this.props;let v=!1,b,w,x;const[_,S]=(0,it.withLayoutItem)(u,t,E=>{let P;return w=E.x,x=E.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(w=E.x+(E.w-n),n=E.x!==w&&w<0?E.w:n,w=w<0?0:w),["ne","n","nw"].indexOf(l)!==-1&&(x=E.y+(E.h-r),r=E.y!==x&&x<0?E.h:r,x=x<0?0:x),v=!0),h&&!g&&(P=(0,it.getAllCollisions)(u,{...E,w:n,h:r,x:w,y:x}).filter(k=>k.i!==E.i).length>0,P&&(x=E.y,r=E.h,w=E.x,n=E.w,v=!1)),E.w=n,E.h=r,E});if(!S)return;b=_,v&&(b=(0,it.moveElement)(_,S,w,x,!0,this.props.preventCollision,(0,it.compactType)(this.props),f,g));const C={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(b,c,S,C,i,s),this.setState({layout:g?b:(0,it.compact)(b,(0,it.compactType)(this.props),f),activeDrag:C})}),ir(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,f=(0,it.getLayoutItem)(a,t),h=u?a:(0,it.compact)(a,(0,it.compactType)(this.props),c);this.props.onResizeStop(h,l,f,null,i,s);const{oldLayout:g}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,g)}),ir(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),bA&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(AR)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:f}=this.props,h=o==null?void 0:o(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const g={...r,...h},{layout:v}=this.state,{layerX:b,layerY:w}=t.nativeEvent,x={left:b/f,top:w/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=b||S!=w)&&this.setState({droppingPosition:x})}}else{const _={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},S=(0,rW.calcXY)(_,w,b,g.w,g.h);this.setState({droppingDOMNode:Ta.createElement("div",{key:g.i}),droppingPosition:x,layout:[...v,{...g,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),ir(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,it.compact)(r.filter(i=>i.i!==t.i),(0,it.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ir(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ir(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),ir(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,qb.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,it.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,it.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,it.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,it.fastRGLPropsEqual)(this.props,t,qb.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,it.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,qb.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Ta.createElement(DR.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Ta.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,it.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:f,isBounded:h,useCSSTransforms:g,transformScale:v,draggableCancel:b,draggableHandle:w,resizeHandles:x,resizeHandle:_}=this.props,{mounted:S,droppingPosition:C}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,P=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,A=r.resizeHandles||x,k=E&&h&&r.isBounded!==!1;return Ta.createElement(DR.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:w,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:P,isBounded:k,useCSSTransforms:g&&S,usePercentages:!S,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?C:void 0,resizeHandles:A,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,nW.default)(AR,t),s={height:this.containerHeight(),...n};return Ta.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:it.noop,onDragLeave:r?this.onDragLeave:it.noop,onDragEnter:r?this.onDragEnter:it.noop,onDragOver:r?this.onDragOver:it.noop},Ta.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}$f.default=_m;ir(_m,"displayName","ReactGridLayout");ir(_m,"propTypes",oW.default);ir(_m,"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:it.noop,onDragStart:it.noop,onDrag:it.noop,onDragStop:it.noop,onResizeStart:it.noop,onResize:it.noop,onResizeStop:it.noop,onDrop:it.noop,onDropDragOver:it.noop});var Sm={},Cl={};Object.defineProperty(Cl,"__esModule",{value:!0});Cl.findOrGenerateResponsiveLayout=uW;Cl.getBreakpointFromWidth=lW;Cl.getColsFromBreakpoint=cW;Cl.sortBreakpoints=t1;var Kh=Ot;function lW(e,t){const n=t1(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function cW(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function uW(e,t,n,r,o,i){if(e[n])return(0,Kh.cloneLayout)(e[n]);let s=e[r];const a=t1(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,Kh.cloneLayout)(s||[]),(0,Kh.compact)((0,Kh.correctBounds)(s,{cols:o}),i,o)}function t1(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Sm,"__esModule",{value:!0});Sm.default=void 0;var $R=fW(m),Pr=yA(pa),Gb=Iw,vc=Ot,Da=Cl,dW=yA($f);function yA(e){return e&&e.__esModule?e:{default:e}}function xA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(xA=function(r){return r?n:t})(e)}function fW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=xA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Q0(){return Q0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q0.apply(this,arguments)}function bg(e,t,n){return t=hW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hW(e){var t=pW(e,"string");return typeof t=="symbol"?t:String(t)}function pW(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 kR=e=>Object.prototype.toString.call(e);function Xh(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class n1 extends $R.Component{constructor(){super(...arguments),bg(this,"state",this.generateInitialState()),bg(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,Da.getBreakpointFromWidth)(n,t),s=(0,Da.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Da.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Gb.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Da.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,Gb.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Gb.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,Da.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Da.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,vc.cloneLayout)(this.state.layout));let h=(0,Da.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);h=(0,vc.synchronizeLayoutWithChildren)(h,this.props.children,l,i,this.props.allowOverlap),c[s]=h,this.props.onLayoutChange(h,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:h,cols:l})}const u=Xh(this.props.margin,s),f=Xh(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return $R.createElement(dW.default,Q0({},u,{margin:Xh(i,this.state.breakpoint),containerPadding:Xh(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Sm.default=n1;bg(n1,"propTypes",{breakpoint:Pr.default.string,breakpoints:Pr.default.object,allowOverlap:Pr.default.bool,cols:Pr.default.object,margin:Pr.default.oneOfType([Pr.default.array,Pr.default.object]),containerPadding:Pr.default.oneOfType([Pr.default.array,Pr.default.object]),layouts(e,t){if(kR(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+kR(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,vc.validateLayout)(e.layouts[n],"layouts."+n)})},width:Pr.default.number.isRequired,onBreakpointChange:Pr.default.func,onLayoutChange:Pr.default.func,onWidthChange:Pr.default.func});bg(n1,"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:vc.noop,onLayoutChange:vc.noop,onWidthChange:vc.noop});var r1={},wA=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),J0=typeof window<"u"&&typeof document<"u"&&window.document===document,yg=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")()}(),gW=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(yg):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),mW=2;function vW(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){gW(i)}function a(){var l=Date.now();if(n){if(l-o<mW)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var bW=20,yW=["top","right","bottom","left","width","height","size","weight"],xW=typeof MutationObserver<"u",wW=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=vW(this.refresh.bind(this),bW)}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(){!J0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),xW?(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(){!J0||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=yW.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),_A=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Wc=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||yg},SA=Cm(0,0,0,0);function xg(e){return parseFloat(e)||0}function MR(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+xg(i)},0)}function _W(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=xg(s)}return n}function SW(e){var t=e.getBBox();return Cm(0,0,t.width,t.height)}function CW(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return SA;var r=Wc(e).getComputedStyle(e),o=_W(r),i=o.left+o.right,s=o.top+o.bottom,a=xg(r.width),l=xg(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=MR(r,"left","right")+i),Math.round(l+s)!==n&&(l-=MR(r,"top","bottom")+s)),!RW(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return Cm(o.left,o.top,a,l)}var EW=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Wc(e).SVGGraphicsElement}:function(e){return e instanceof Wc(e).SVGElement&&typeof e.getBBox=="function"}}();function RW(e){return e===Wc(e).document.documentElement}function OW(e){return J0?EW(e)?SW(e):CW(e):SA}function PW(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return _A(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function Cm(e,t,n,r){return{x:e,y:t,width:n,height:r}}var TW=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Cm(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=OW(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}(),DW=function(){function e(t,n){var r=PW(n);_A(this,{target:t,contentRect:r})}return e}(),AW=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new wA,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 Wc(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new TW(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 Wc(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 DW(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}(),CA=typeof WeakMap<"u"?new WeakMap:new wA,EA=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=wW.getInstance(),r=new AW(t,n,this);CA.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){EA.prototype[e]=function(){var t;return(t=CA.get(this))[e].apply(t,arguments)}});var $W=function(){return typeof yg.ResizeObserver<"u"?yg.ResizeObserver:EA}();const kW=Object.freeze(Object.defineProperty({__proto__:null,default:$W},Symbol.toStringTag,{value:"Module"})),MW=gw(kW);Object.defineProperty(r1,"__esModule",{value:!0});r1.default=VW;var Qh=FW(m),IW=o1(pa),NW=o1(MW),LW=o1(Nw);function o1(e){return e&&e.__esModule?e:{default:e}}function RA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(RA=function(r){return r?n:t})(e)}function FW(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=RA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Z0(){return Z0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z0.apply(this,arguments)}function Xl(e,t,n){return t=jW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jW(e){var t=zW(e,"string");return typeof t=="symbol"?t:String(t)}function zW(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 BW="react-grid-layout";function VW(e){var t;return t=class extends Qh.Component{constructor(){super(...arguments),Xl(this,"state",{width:1280}),Xl(this,"elementRef",Qh.createRef()),Xl(this,"mounted",!1),Xl(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new NW.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?Qh.createElement("div",{className:(0,LW.default)(this.props.className,BW),style:this.props.style,ref:this.elementRef}):Qh.createElement(e,Z0({innerRef:this.elementRef},o,this.state))}},Xl(t,"defaultProps",{measureBeforeMount:!1}),Xl(t,"propTypes",{measureBeforeMount:IW.default.bool}),t}(function(e){e.exports=$f.default,e.exports.utils=Ot,e.exports.calculateUtils=Ri,e.exports.Responsive=Sm.default,e.exports.Responsive.utils=Cl,e.exports.WidthProvider=r1.default})(FD);var IR=FD.exports;function is({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),c=ke(h=>h.isDashboardEditing),u=h=>{h.stopPropagation(),c&&s(!0)};function f(){return o==="textarea"?O.jsx("textarea",{className:Ce(" grow px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:h=>l(h.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:h=>{h.key==="Enter"&&h.shiftKey||(h.key==="Enter"||h.key==="Tab")&&(s(!1),r(a))}}):O.jsx("input",{onMouseDown:h=>h.stopPropagation(),type:"text",className:Ce("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:h=>l(h.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:h=>{(h.key==="Enter"||h.key==="Tab")&&(s(!1),r(a))}})}return O.jsx("div",{className:"flex",role:"editable",onDoubleClick:u,children:i?f():e})}/*!
|
|
110
110
|
* @kurkle/color v0.3.2
|
|
111
111
|
* https://github.com/kurkle/color#readme
|
|
112
112
|
* (c) 2023 Jukka Kurkela
|
|
@@ -129,7 +129,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Y=ye(pe,le,ie,fe,ue+
|
|
|
129
129
|
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
130
130
|
* Released under the MIT license
|
|
131
131
|
*/var sP=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}(),vd={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
|
|
132
|
-
`)):Array.isArray(n)?e.push.apply(e,n):Rt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),o=r.length,i=e.font,s=0,a;for(e.font=n.string,a=0;a<o;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=i,{height:o*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],o,i,s,a;for(o=0,s=t.length;o<s;++o)a=t[o],i=n.indexOf(a),i===-1?r.push([a,1]):n.splice(i,1);for(o=0,s=n.length;o<s;++o)r.push([n[o],-1]);return r},rasterize:function(e){return Math.round(e*sP)/sP}};function sy(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var o=e.x-n,i=e.y-r,s=Math.sqrt(o*o+i*i);return{x:s?o/s:0,y:s?i/s:-1}}function YK(e,t,n,r,o){switch(o){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:o*=Math.PI/180,n=Math.cos(o),r=Math.sin(o);break}return{x:e,y:t,vx:n,vy:r}}var KK=0,S$=1,C$=2,E$=4,R$=8;function fp(e,t,n){var r=KK;return e<n.left?r|=S$:e>n.right&&(r|=C$),t<n.top?r|=R$:t>n.bottom&&(r|=E$),r}function XK(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=fp(n,r,t),a=fp(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&R$?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&E$?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&C$?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&S$&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=fp(n,r,t)):(o=c,i=u,a=fp(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function hp(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=XK(r,t.area)),n==="start"?(o=r.x0,i=r.y0):n==="end"?(o=r.x1,i=r.y1):(o=(r.x0+r.x1)/2,i=(r.y0+r.y1)/2),YK(o,i,e.vx,e.vy,t.align)}var pp={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),o=Math.sin(n),i=e.innerRadius,s=e.outerRadius;return hp({x0:e.x+r*i,y0:e.y+o*i,x1:e.x+r*s,y1:e.y+o*s,vx:r,vy:o},t)},point:function(e,t){var n=sy(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return hp({x0:e.x-r,y0:e.y-o,x1:e.x+r,y1:e.y+o,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=sy(e,t.origin),r=e.x,o=e.y,i=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(o=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),hp({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=sy(e,t.origin);return hp({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)}},rs=vd.rasterize;function QK(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,o=e.size.width,i=-o/2,s=-r/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:o+n.width+t*2,h:r+n.height+t*2},text:{x:i,y:s,w:o,h:r}}}function JK(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 ZK(e){return e instanceof pc?pp.arc:e instanceof gd?pp.point:e instanceof md?pp.bar:pp.fallback}function eX(e,t,n,r,o,i){var s=Math.PI/2;if(i){var a=Math.min(i,o/2,r/2),l=t+a,c=n+a,u=t+r-a,f=n+o-a;e.moveTo(t,c),l<u&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<f?(e.arc(l,c,a,-Math.PI,0),e.arc(l,f,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function tX(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),eX(e,rs(t.x)+i/2,rs(t.y)+i/2,rs(t.w)-i,rs(t.h)-i,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),o&&i&&(e.strokeStyle=o,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function nX(e,t,n){var r=n.lineHeight,o=e.w,i=e.x,s=e.y+r/2;return t==="center"?i+=o/2:(t==="end"||t==="right")&&(i+=o),{h:r,w:o,x:i,y:s}}function rX(e,t,n){var r=e.shadowBlur,o=n.stroked,i=rs(n.x),s=rs(n.y),a=rs(n.w);o&&e.strokeText(t,i,s,a),n.filled&&(r&&o&&(e.shadowBlur=0),e.fillText(t,i,s,a),r&&o&&(e.shadowBlur=r))}function oX(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,f=c&&u,h;if(!(!l||!s&&!f))for(n=nX(n,o,a),e.font=a.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=i),f&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),h=0,l=t.length;h<l;++h)rX(e,t[h],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*h})}var O$=function(e,t,n,r){var o=this;o._config=e,o._index=r,o._model=null,o._rects=null,o._ctx=t,o._el=n};_i(O$.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=$n(hn([n.font,{}],r,i)),a=hn([n.color,_n.color],r,i);return{align:hn([n.align,"center"],r,i),anchor:hn([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:hn([n.backgroundColor,null],r,i),borderColor:hn([n.borderColor,null],r,i),borderRadius:hn([n.borderRadius,0],r,i),borderWidth:hn([n.borderWidth,0],r,i),clamp:hn([n.clamp,!1],r,i),clip:hn([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:hn([n.offset,4],r,i),opacity:hn([n.opacity,1],r,i),origin:JK(o._el,r),padding:Jn(hn([n.padding,4],r,i)),positioner:ZK(o._el),rotation:hn([n.rotation,0],r,i)*(Math.PI/180),size:vd.textSize(o._ctx,t,s),textAlign:hn([n.textAlign,"start"],r,i),textShadowBlur:hn([n.textShadowBlur,0],r,i),textShadowColor:hn([n.textShadowColor,a],r,i),textStrokeColor:hn([n.textStrokeColor,a],r,i),textStrokeWidth:hn([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,c=hn([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=dt(en(i.formatter,[s,e]),s),l=Rt(a)?[]:vd.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=QK(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,o=n._model,i=n._rects,s;this.visible()&&(r.save(),o.clip&&(s=o.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=vd.bound(0,o.opacity,1),r.translate(rs(t.x),rs(t.y)),r.rotate(o.rotation),tX(r,i.frame,o),oX(r,o.lines,i.text,o),r.restore())}});var iX=Number.MIN_SAFE_INTEGER||-9007199254740991,sX=Number.MAX_SAFE_INTEGER||9007199254740991;function Bu(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t.x,s=t.y;return{x:i+r*(e.x-i)-o*(e.y-s),y:s+o*(e.x-i)+r*(e.y-s)}}function aP(e,t){var n=sX,r=iX,o=t.origin,i,s,a,l,c;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function gp(e,t){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/o,vy:(t.y-e.y)/o,origin:e,ln:o}}var P$=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};_i(P$.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=Bu(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=[gp(t[0],t[1]),gp(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(gp(n[0],n[1]),gp(n[0],n[3])),o=0;o<r.length;++o)if(i=aP(t,r[o]),s=aP(n,r[o]),i.max<s.min||s.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Bu({x:t.x,y:t.y},r,n),Bu({x:t.x+t.w,y:t.y},r,n),Bu({x:t.x+t.w,y:t.y+t.h},r,n),Bu({x:t.x,y:t.y+t.h},r,n)]}});function T$(e,t,n){var r=t.positioner(e,t),o=r.vx,i=r.vy;if(!o&&!i)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*f,u*=i*f,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function aX(e,t){var n,r,o,i;for(n=e.length-1;n>=0;--n)for(o=e[n].$layout,r=n-1;r>=0&&o._visible;--r)i=e[r].$layout,i._visible&&o._box.intersects(i._box)&&t(o,i);return e}function lX(e){var t,n,r,o,i,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],o=r.$layout,o._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),i=r.geometry(),s=T$(a,r.model(),i),o._box.update(s,i,r.rotation()));return aX(e,function(l,c){var u=l._hidable,f=c._hidable;u&&f||f?c._visible=!1:u&&(l._visible=!1)})}var bd={prepare:function(e){var t=[],n,r,o,i,s;for(n=0,o=e.length;n<o;++n)for(r=0,i=e[n].length;r<i;++r)s=e[n][r],t.push(s),s.$layout={_box:new P$,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,o,i,s;for(n=0,r=e.length;n<r;++n)o=e[n],i=o.model(),s=o.$layout,s._hidable=i&&i.display==="auto",s._visible=o.visible(),t|=s._hidable;t&&lX(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,o,i,s,a;for(n=0,r=t.length;n<r;++n)o=t[n],i=o.$layout,i._visible&&(s=o.geometry(),a=T$(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},cX=function(e){if(Rt(e))return null;var t=e,n,r,o;if(Dt(e))if(!Rt(e.label))t=e.label;else if(!Rt(e.r))t=e.r;else for(t="",n=Object.keys(e),o=0,r=n.length;o<r;++o)t+=(o!==0?", ":"")+n[o]+": "+e[n[o]];return""+t},uX={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:cX,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},Ar="$datalabels",D$="$default";function dX(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=_i({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(_i({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return Yt(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||D$]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function gx(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&en(s,[o,r])===!0&&(e[Ar]._dirty=!0,n.update(o)))}}function fX(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&gx(e,t.leave,n,o),i&&gx(e,t.enter,r,o))}function hX(e,t){var n=e[Ar],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=bd.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,fX(e,r,o,i,t)}}function pX(e,t){var n=e[Ar],r=n._listeners.click,o=r&&bd.lookup(n._labels,t);o&&gx(e,r,o,t)}var gX={id:"datalabels",defaults:uX,beforeInit:function(e){e[Ar]={_actives:[]}},beforeUpdate:function(e){var t=e[Ar];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Ar],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=dX(a,n),c=t.meta.data||[],u=e.ctx,f,h,g,v,b,w,x,_;for(u.save(),f=0,g=c.length;f<g;++f)if(x=c[f],x[Ar]=[],s&&x&&e.getDataVisibility(f)&&!x.skip)for(h=0,v=l.labels.length;h<v;++h)b=l.labels[h],w=b._key,_=new O$(b,u,x,f),_.$groups={_set:r,_key:w||D$},_.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},_.update(_.$context),x[Ar].push(_),i.push(_);u.restore(),_i(o._listeners,l.listeners,{merger:function(S,C,E){C[S]=C[S]||{},C[S][t.index]=E[S],o._listened=!0}})},afterUpdate:function(e){e[Ar]._labels=bd.prepare(e[Ar]._datasets)},afterDatasetsDraw:function(e){bd.draw(e,e[Ar]._labels)},beforeEvent:function(e,t){if(e[Ar]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":hX(e,n);break;case"click":pX(e,n);break}}},afterEvent:function(e){var t=e[Ar],n=t._actives,r=t._actives=e.getActiveElements(),o=vd.arrayDiff(n,r),i,s,a,l,c,u,f;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(f=c[0].element[Ar]||[],a=0,l=f.length;a<l;++a)u=f[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(bd.update(t._labels),e.render()),delete t._dirty}};To.register(...GK);To.register(gX);function _1({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,o]=m.useState(),i=$e(l=>l.themeStyle);m.useEffect(()=>{var u,f,h,g;(f=(u=i==null?void 0:i.chart)==null?void 0:u.font)!=null&&f.family&&(To.defaults.font={...To.defaults.font,...(h=i==null?void 0:i.chart)==null?void 0:h.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(g=n==null?void 0:n.current)==null?void 0:g.getContext("2d");if(!l)return;let c;try{c=new To(l,e),o(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=i==null?void 0:i.chart)==null?void 0:a.font]);function s(l){var u,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const h=c[0].datasetIndex,g=c[0].index,v=(f=(u=c[0].element)==null?void 0:u.$context)==null?void 0:f.raw;t==null||t(r,h,g,v)}}return O.jsx("div",{onClick:s,className:"relative h-[99%]",children:O.jsx("canvas",{ref:n})})}function jr(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var mX=["color"],A$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,mX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),vX=["color"],bX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,vX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),yX=["color"],xX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,yX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),wX=["color"],$$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,wX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),_X=["color"],SX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,_X);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),CX=["color"],EX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,CX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),RX=["color"],OX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,RX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),PX=["color"],TX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,PX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),DX=["color"],k$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,DX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),AX=["color"],$X=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,AX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),kX=["color"],MX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,kX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),IX=["color"],NX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,IX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),LX=["color"],S1=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,LX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),FX=["color"],C1=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,FX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let mp;const jX=new Uint8Array(16);function zX(){if(!mp&&(mp=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!mp))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mp(jX)}const Kn=[];for(let e=0;e<256;++e)Kn.push((e+256).toString(16).slice(1));function BX(e,t=0){return Kn[e[t+0]]+Kn[e[t+1]]+Kn[e[t+2]]+Kn[e[t+3]]+"-"+Kn[e[t+4]]+Kn[e[t+5]]+"-"+Kn[e[t+6]]+Kn[e[t+7]]+"-"+Kn[e[t+8]]+Kn[e[t+9]]+"-"+Kn[e[t+10]]+Kn[e[t+11]]+Kn[e[t+12]]+Kn[e[t+13]]+Kn[e[t+14]]+Kn[e[t+15]]}const VX=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lP={randomUUID:VX};function la(e,t,n){if(lP.randomUUID&&!t&&!e)return lP.randomUUID();e=e||{};const r=e.random||(e.rng||zX)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return BX(r)}const br=Z2()(sD((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:la(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:la(),cards:[],activeCardId:""},actions:{setChartOrientation:n=>{e(r=>{var s,a,l,c,u,f;const o=r.card.preferences;let i={};((s=o==null?void 0:o.chartOptions)==null?void 0:s.indexAxis)!==n&&(i={x:(l=(a=o==null?void 0:o.chartOptions)==null?void 0:a.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(f=o==null?void 0:o.chartOptions)==null?void 0:f.scales,...i},indexAxis:n}}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,o,i)=>{e(s=>{var a,l,c;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{...(c=(l=s.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},updateCardInFrame:n=>{e(r=>{r.frame.cards=r.frame.cards.map(o=>o.id===n.id?n:o)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,indexAxis:"y"}})})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedDatamodelId:n=>{var r,o;e(i=>{i.selectedDatamodelId=n,i.card.datamodelId=n}),(o=(r=t()).onDatamodelChange)==null||o.call(r,n)},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),Dm=()=>br(e=>e.actions);function HX(e,t,n){var l,c,u,f;const r=n==null?void 0:n.datasetOptions,o=$e.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,s=(f=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:f.borderColor;return e.map((h,g)=>{var _;const v=r==null?void 0:r.find(S=>S.idx===g),b=i==null?void 0:i[g%i.length],w=s==null?void 0:s[g%s.length];return{label:h.charAt(0).toUpperCase()+h.slice(1),data:t.map(S=>S[h]),...v,datalabels:{...v==null?void 0:v.datalabels,color:WX((_=v==null?void 0:v.datalabels)==null?void 0:_.align,b)},backgroundColor:b,borderColor:w}})}function WX(e,t){return Bc(e==="end"||e==="start"?Pd():t)}function UX(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=ar(e);let r=[];const o=$e.getState().themeStyle,i=(l=(a=o==null?void 0:o.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const f=e.map(h=>({x:h[t[0]],y:h[t[1]],r:h[t[2]],label:h[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:f}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(h=>h[n==null?void 0:n[1]]))].map((h,g)=>{const v=e.filter(b=>b[n==null?void 0:n[1]]===h);return{label:h,data:v.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[g%i.length],borderColor:s==null?void 0:s[g%s.length]}})),r}function qX(e){var c,u,f,h;const{dimensionKeys:t,metricKeys:n}=ar(e),r=$e.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(h=(f=r==null?void 0:r.chart)==null?void 0:f.dataset)==null?void 0:h.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(g=>g==null?void 0:g[s]))].map((g,v)=>({label:g,data:e.filter(b=>(b==null?void 0:b[s])===g).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:o==null?void 0:o[v%o.length],borderColor:i==null?void 0:i[v%i.length],borderSkipped:!1}))}function GX(e,t){var s,a,l,c;const n=$e.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(f=>f[u]),backgroundColor:t.map((f,h)=>r==null?void 0:r[h%r.length]),borderColor:t.map((f,h)=>o==null?void 0:o[h%o.length])}))}function YX(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function ar(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=YX(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,f,h,g;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((f=e==null?void 0:e[1])==null?void 0:f[i])=="string"||typeof((h=e==null?void 0:e[2])==null?void 0:h[i])&&typeof((g=e==null?void 0:e[2])==null?void 0:g[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function og(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,s)=>({...i,...n[s],data:i.data,label:i.label})):e}function Tg({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const o=e.reduce((i,s)=>{const a=s[t],l=s[n],c=s[r];return i[a]||(i[a]={[t]:a}),i[a][l]=c,i},{});return Object.values(o)}function qo(e,t){var s;const n=$e.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=ol.cloneDeep(r);return ol.merge(o,e,t)}function mx(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
|
|
132
|
+
`)):Array.isArray(n)?e.push.apply(e,n):Rt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),o=r.length,i=e.font,s=0,a;for(e.font=n.string,a=0;a<o;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=i,{height:o*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],o,i,s,a;for(o=0,s=t.length;o<s;++o)a=t[o],i=n.indexOf(a),i===-1?r.push([a,1]):n.splice(i,1);for(o=0,s=n.length;o<s;++o)r.push([n[o],-1]);return r},rasterize:function(e){return Math.round(e*sP)/sP}};function sy(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var o=e.x-n,i=e.y-r,s=Math.sqrt(o*o+i*i);return{x:s?o/s:0,y:s?i/s:-1}}function YK(e,t,n,r,o){switch(o){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:o*=Math.PI/180,n=Math.cos(o),r=Math.sin(o);break}return{x:e,y:t,vx:n,vy:r}}var KK=0,S$=1,C$=2,E$=4,R$=8;function fp(e,t,n){var r=KK;return e<n.left?r|=S$:e>n.right&&(r|=C$),t<n.top?r|=R$:t>n.bottom&&(r|=E$),r}function XK(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=fp(n,r,t),a=fp(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&R$?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&E$?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&C$?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&S$&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=fp(n,r,t)):(o=c,i=u,a=fp(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function hp(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=XK(r,t.area)),n==="start"?(o=r.x0,i=r.y0):n==="end"?(o=r.x1,i=r.y1):(o=(r.x0+r.x1)/2,i=(r.y0+r.y1)/2),YK(o,i,e.vx,e.vy,t.align)}var pp={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),o=Math.sin(n),i=e.innerRadius,s=e.outerRadius;return hp({x0:e.x+r*i,y0:e.y+o*i,x1:e.x+r*s,y1:e.y+o*s,vx:r,vy:o},t)},point:function(e,t){var n=sy(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return hp({x0:e.x-r,y0:e.y-o,x1:e.x+r,y1:e.y+o,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=sy(e,t.origin),r=e.x,o=e.y,i=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(o=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),hp({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=sy(e,t.origin);return hp({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)}},rs=vd.rasterize;function QK(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,o=e.size.width,i=-o/2,s=-r/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:o+n.width+t*2,h:r+n.height+t*2},text:{x:i,y:s,w:o,h:r}}}function JK(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 ZK(e){return e instanceof pc?pp.arc:e instanceof gd?pp.point:e instanceof md?pp.bar:pp.fallback}function eX(e,t,n,r,o,i){var s=Math.PI/2;if(i){var a=Math.min(i,o/2,r/2),l=t+a,c=n+a,u=t+r-a,f=n+o-a;e.moveTo(t,c),l<u&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<f?(e.arc(l,c,a,-Math.PI,0),e.arc(l,f,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function tX(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),eX(e,rs(t.x)+i/2,rs(t.y)+i/2,rs(t.w)-i,rs(t.h)-i,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),o&&i&&(e.strokeStyle=o,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function nX(e,t,n){var r=n.lineHeight,o=e.w,i=e.x,s=e.y+r/2;return t==="center"?i+=o/2:(t==="end"||t==="right")&&(i+=o),{h:r,w:o,x:i,y:s}}function rX(e,t,n){var r=e.shadowBlur,o=n.stroked,i=rs(n.x),s=rs(n.y),a=rs(n.w);o&&e.strokeText(t,i,s,a),n.filled&&(r&&o&&(e.shadowBlur=0),e.fillText(t,i,s,a),r&&o&&(e.shadowBlur=r))}function oX(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,f=c&&u,h;if(!(!l||!s&&!f))for(n=nX(n,o,a),e.font=a.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=i),f&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),h=0,l=t.length;h<l;++h)rX(e,t[h],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*h})}var O$=function(e,t,n,r){var o=this;o._config=e,o._index=r,o._model=null,o._rects=null,o._ctx=t,o._el=n};_i(O$.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=$n(hn([n.font,{}],r,i)),a=hn([n.color,_n.color],r,i);return{align:hn([n.align,"center"],r,i),anchor:hn([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:hn([n.backgroundColor,null],r,i),borderColor:hn([n.borderColor,null],r,i),borderRadius:hn([n.borderRadius,0],r,i),borderWidth:hn([n.borderWidth,0],r,i),clamp:hn([n.clamp,!1],r,i),clip:hn([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:hn([n.offset,4],r,i),opacity:hn([n.opacity,1],r,i),origin:JK(o._el,r),padding:Jn(hn([n.padding,4],r,i)),positioner:ZK(o._el),rotation:hn([n.rotation,0],r,i)*(Math.PI/180),size:vd.textSize(o._ctx,t,s),textAlign:hn([n.textAlign,"start"],r,i),textShadowBlur:hn([n.textShadowBlur,0],r,i),textShadowColor:hn([n.textShadowColor,a],r,i),textStrokeColor:hn([n.textStrokeColor,a],r,i),textStrokeWidth:hn([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,c=hn([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=dt(en(i.formatter,[s,e]),s),l=Rt(a)?[]:vd.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=QK(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,o=n._model,i=n._rects,s;this.visible()&&(r.save(),o.clip&&(s=o.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=vd.bound(0,o.opacity,1),r.translate(rs(t.x),rs(t.y)),r.rotate(o.rotation),tX(r,i.frame,o),oX(r,o.lines,i.text,o),r.restore())}});var iX=Number.MIN_SAFE_INTEGER||-9007199254740991,sX=Number.MAX_SAFE_INTEGER||9007199254740991;function Bu(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t.x,s=t.y;return{x:i+r*(e.x-i)-o*(e.y-s),y:s+o*(e.x-i)+r*(e.y-s)}}function aP(e,t){var n=sX,r=iX,o=t.origin,i,s,a,l,c;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function gp(e,t){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/o,vy:(t.y-e.y)/o,origin:e,ln:o}}var P$=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};_i(P$.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=Bu(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=[gp(t[0],t[1]),gp(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(gp(n[0],n[1]),gp(n[0],n[3])),o=0;o<r.length;++o)if(i=aP(t,r[o]),s=aP(n,r[o]),i.max<s.min||s.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[Bu({x:t.x,y:t.y},r,n),Bu({x:t.x+t.w,y:t.y},r,n),Bu({x:t.x+t.w,y:t.y+t.h},r,n),Bu({x:t.x,y:t.y+t.h},r,n)]}});function T$(e,t,n){var r=t.positioner(e,t),o=r.vx,i=r.vy;if(!o&&!i)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*f,u*=i*f,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function aX(e,t){var n,r,o,i;for(n=e.length-1;n>=0;--n)for(o=e[n].$layout,r=n-1;r>=0&&o._visible;--r)i=e[r].$layout,i._visible&&o._box.intersects(i._box)&&t(o,i);return e}function lX(e){var t,n,r,o,i,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],o=r.$layout,o._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),i=r.geometry(),s=T$(a,r.model(),i),o._box.update(s,i,r.rotation()));return aX(e,function(l,c){var u=l._hidable,f=c._hidable;u&&f||f?c._visible=!1:u&&(l._visible=!1)})}var bd={prepare:function(e){var t=[],n,r,o,i,s;for(n=0,o=e.length;n<o;++n)for(r=0,i=e[n].length;r<i;++r)s=e[n][r],t.push(s),s.$layout={_box:new P$,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,o,i,s;for(n=0,r=e.length;n<r;++n)o=e[n],i=o.model(),s=o.$layout,s._hidable=i&&i.display==="auto",s._visible=o.visible(),t|=s._hidable;t&&lX(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,o,i,s,a;for(n=0,r=t.length;n<r;++n)o=t[n],i=o.$layout,i._visible&&(s=o.geometry(),a=T$(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},cX=function(e){if(Rt(e))return null;var t=e,n,r,o;if(Dt(e))if(!Rt(e.label))t=e.label;else if(!Rt(e.r))t=e.r;else for(t="",n=Object.keys(e),o=0,r=n.length;o<r;++o)t+=(o!==0?", ":"")+n[o]+": "+e[n[o]];return""+t},uX={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:cX,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},Ar="$datalabels",D$="$default";function dX(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=_i({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(_i({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return Yt(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||D$]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function gx(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&en(s,[o,r])===!0&&(e[Ar]._dirty=!0,n.update(o)))}}function fX(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&gx(e,t.leave,n,o),i&&gx(e,t.enter,r,o))}function hX(e,t){var n=e[Ar],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=bd.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,fX(e,r,o,i,t)}}function pX(e,t){var n=e[Ar],r=n._listeners.click,o=r&&bd.lookup(n._labels,t);o&&gx(e,r,o,t)}var gX={id:"datalabels",defaults:uX,beforeInit:function(e){e[Ar]={_actives:[]}},beforeUpdate:function(e){var t=e[Ar];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Ar],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=dX(a,n),c=t.meta.data||[],u=e.ctx,f,h,g,v,b,w,x,_;for(u.save(),f=0,g=c.length;f<g;++f)if(x=c[f],x[Ar]=[],s&&x&&e.getDataVisibility(f)&&!x.skip)for(h=0,v=l.labels.length;h<v;++h)b=l.labels[h],w=b._key,_=new O$(b,u,x,f),_.$groups={_set:r,_key:w||D$},_.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},_.update(_.$context),x[Ar].push(_),i.push(_);u.restore(),_i(o._listeners,l.listeners,{merger:function(S,C,E){C[S]=C[S]||{},C[S][t.index]=E[S],o._listened=!0}})},afterUpdate:function(e){e[Ar]._labels=bd.prepare(e[Ar]._datasets)},afterDatasetsDraw:function(e){bd.draw(e,e[Ar]._labels)},beforeEvent:function(e,t){if(e[Ar]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":hX(e,n);break;case"click":pX(e,n);break}}},afterEvent:function(e){var t=e[Ar],n=t._actives,r=t._actives=e.getActiveElements(),o=vd.arrayDiff(n,r),i,s,a,l,c,u,f;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(f=c[0].element[Ar]||[],a=0,l=f.length;a<l;++a)u=f[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(bd.update(t._labels),e.render()),delete t._dirty}};To.register(...GK);To.register(gX);function _1({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,o]=m.useState(),i=ke(l=>l.themeStyle);m.useEffect(()=>{var u,f,h,g;(f=(u=i==null?void 0:i.chart)==null?void 0:u.font)!=null&&f.family&&(To.defaults.font={...To.defaults.font,...(h=i==null?void 0:i.chart)==null?void 0:h.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(g=n==null?void 0:n.current)==null?void 0:g.getContext("2d");if(!l)return;let c;try{c=new To(l,e),o(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=i==null?void 0:i.chart)==null?void 0:a.font]);function s(l){var u,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const h=c[0].datasetIndex,g=c[0].index,v=(f=(u=c[0].element)==null?void 0:u.$context)==null?void 0:f.raw;t==null||t(r,h,g,v)}}return O.jsx("div",{onClick:s,className:"relative h-[99%]",children:O.jsx("canvas",{ref:n})})}function jr(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var mX=["color"],A$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,mX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),vX=["color"],bX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,vX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),yX=["color"],xX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,yX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),wX=["color"],$$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,wX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),_X=["color"],SX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,_X);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),CX=["color"],EX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,CX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),RX=["color"],OX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,RX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),PX=["color"],TX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,PX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),DX=["color"],k$=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,DX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),AX=["color"],$X=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,AX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),kX=["color"],MX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,kX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),IX=["color"],NX=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,IX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),LX=["color"],S1=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,LX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),FX=["color"],C1=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,FX);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let mp;const jX=new Uint8Array(16);function zX(){if(!mp&&(mp=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!mp))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mp(jX)}const Kn=[];for(let e=0;e<256;++e)Kn.push((e+256).toString(16).slice(1));function BX(e,t=0){return Kn[e[t+0]]+Kn[e[t+1]]+Kn[e[t+2]]+Kn[e[t+3]]+"-"+Kn[e[t+4]]+Kn[e[t+5]]+"-"+Kn[e[t+6]]+Kn[e[t+7]]+"-"+Kn[e[t+8]]+Kn[e[t+9]]+"-"+Kn[e[t+10]]+Kn[e[t+11]]+Kn[e[t+12]]+Kn[e[t+13]]+Kn[e[t+14]]+Kn[e[t+15]]}const VX=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lP={randomUUID:VX};function la(e,t,n){if(lP.randomUUID&&!t&&!e)return lP.randomUUID();e=e||{};const r=e.random||(e.rng||zX)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return BX(r)}const br=Z2()(sD((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:la(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:la(),cards:[],activeCardId:""},actions:{setChartOrientation:n=>{e(r=>{var s,a,l,c,u,f;const o=r.card.preferences;let i={};((s=o==null?void 0:o.chartOptions)==null?void 0:s.indexAxis)!==n&&(i={x:(l=(a=o==null?void 0:o.chartOptions)==null?void 0:a.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(f=o==null?void 0:o.chartOptions)==null?void 0:f.scales,...i},indexAxis:n}}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,o,i)=>{e(s=>{var a,l,c;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{...(c=(l=s.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},updateCardInFrame:n=>{e(r=>{r.frame.cards=r.frame.cards.map(o=>o.id===n.id?n:o)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,indexAxis:"y"}})})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedDatamodelId:n=>{var r,o;e(i=>{i.selectedDatamodelId=n,i.card.datamodelId=n}),(o=(r=t()).onDatamodelChange)==null||o.call(r,n)},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),Dm=()=>br(e=>e.actions);function HX(e,t,n){var l,c,u,f;const r=n==null?void 0:n.datasetOptions,o=ke.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,s=(f=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:f.borderColor;return e.map((h,g)=>{var _;const v=r==null?void 0:r.find(S=>S.idx===g),b=i==null?void 0:i[g%i.length],w=s==null?void 0:s[g%s.length];return{label:h.charAt(0).toUpperCase()+h.slice(1),data:t.map(S=>S[h]),...v,datalabels:{...v==null?void 0:v.datalabels,color:WX((_=v==null?void 0:v.datalabels)==null?void 0:_.align,b)},backgroundColor:b,borderColor:w}})}function WX(e,t){return Bc(e==="end"||e==="start"?Pd():t)}function UX(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=ar(e);let r=[];const o=ke.getState().themeStyle,i=(l=(a=o==null?void 0:o.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const f=e.map(h=>({x:h[t[0]],y:h[t[1]],r:h[t[2]],label:h[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:f}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(h=>h[n==null?void 0:n[1]]))].map((h,g)=>{const v=e.filter(b=>b[n==null?void 0:n[1]]===h);return{label:h,data:v.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[g%i.length],borderColor:s==null?void 0:s[g%s.length]}})),r}function qX(e){var c,u,f,h;const{dimensionKeys:t,metricKeys:n}=ar(e),r=ke.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(h=(f=r==null?void 0:r.chart)==null?void 0:f.dataset)==null?void 0:h.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(g=>g==null?void 0:g[s]))].map((g,v)=>({label:g,data:e.filter(b=>(b==null?void 0:b[s])===g).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:o==null?void 0:o[v%o.length],borderColor:i==null?void 0:i[v%i.length],borderSkipped:!1}))}function GX(e,t){var s,a,l,c;const n=ke.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(f=>f[u]),backgroundColor:t.map((f,h)=>r==null?void 0:r[h%r.length]),borderColor:t.map((f,h)=>o==null?void 0:o[h%o.length])}))}function YX(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function ar(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=YX(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,f,h,g;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((f=e==null?void 0:e[1])==null?void 0:f[i])=="string"||typeof((h=e==null?void 0:e[2])==null?void 0:h[i])&&typeof((g=e==null?void 0:e[2])==null?void 0:g[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function og(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,s)=>({...i,...n[s],data:i.data,label:i.label})):e}function Tg({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const o=e.reduce((i,s)=>{const a=s[t],l=s[n],c=s[r];return i[a]||(i[a]={[t]:a}),i[a][l]=c,i},{});return Object.values(o)}function qo(e,t){var s;const n=ke.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=ol.cloneDeep(r);return ol.merge(o,e,t)}function mx(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
|
|
133
133
|
* @license lucide-react v0.379.0 - ISC
|
|
134
134
|
*
|
|
135
135
|
* This source code is licensed under the ISC license.
|
|
@@ -250,8 +250,8 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Y=ye(pe,le,ie,fe,ue+
|
|
|
250
250
|
* This source code is licensed under the ISC license.
|
|
251
251
|
* See the LICENSE file in the root directory of this source tree.
|
|
252
252
|
*/const $m=Dn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),aQ=({data:e,filename:t="output.csv"})=>{const n=()=>{if(e.length===0)return;const r=[],o=Object.keys(e[0]);r.push(o.join(","));for(const c of e){const u=o.map(f=>`"${(""+c[f]).replace(/"/g,'""')}"`);r.push(u.join(","))}const i=r.join(`
|
|
253
|
-
`),s=new Blob([i],{type:"text/csv"}),a=window.URL.createObjectURL(s),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",a),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return O.jsx(ZX,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function lQ({frame:e}){var S;const t=$e(C=>C.isDashboardEditing),n=$e(C=>C.filterValues),r=$e(C=>C.isVisualEditing),o=$e(C=>C.selectedSheetId);$e(C=>C.currentBreakpoint);const{removeFrame:i}=$e(C=>C.actions),s=$e(C=>C.actions.setIsVisualEditing),a=br(C=>C.actions.setFilterValues),l=br(C=>C.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:f}=br(C=>C.actions),h=br(C=>C.actions.setSelectedConnectionId),g=br(C=>C.actions.setSelectedDatamodelId),v=br(C=>C.actions.setSelectedDatabaseName),b=br(C=>C.actions.setSelectedSchemaName),w=br(C=>C.actions.setSelectedTableName),x=e.cards.find(C=>C.id===e.activeCardId);function _(){s(!r),c(x);const{dimensionKeys:C}=ar((x==null?void 0:x.data)||[]);f(C),u(e),x!=null&&x.connectionId&&h(x==null?void 0:x.connectionId),x!=null&&x.datamodelId&&x.datamodelId!=="none"&&(g(x==null?void 0:x.datamodelId),v("")),x!=null&&x.lastSelectedDatabase&&x.lastSelectedDatabase!=="none"&&(v(x==null?void 0:x.lastSelectedDatabase),g("")),x!=null&&x.lastSelectedSchema&&b(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&w(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return O.jsx("section",{className:"absolute right-2 top-2 z-10",children:O.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?O.jsx(EX,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):O.jsx(OX,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&O.jsx($$,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((S=x.preferences)==null?void 0:S.allowDownload)===!0&&O.jsx(aQ,{data:(x==null?void 0:x.data)||[],filename:x.title})]})})}function cQ(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const bx="dismissableLayer.update",uQ="dismissableLayer.pointerDownOutside",dQ="dismissableLayer.focusOutside";let cP;const fQ=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jf=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=m.useContext(fQ),[f,h]=m.useState(null),g=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),b=_t(t,k=>h(k)),w=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=w.indexOf(x),S=f?w.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,P=hQ(k=>{const I=k.target,$=[...u.branches].some(L=>L.contains(I));!E||$||(i==null||i(k),a==null||a(k),k.defaultPrevented||l==null||l())},g),A=pQ(k=>{const I=k.target;[...u.branches].some(L=>L.contains(I))||(s==null||s(k),a==null||a(k),k.defaultPrevented||l==null||l())},g);return cQ(k=>{S===u.layers.size-1&&(o==null||o(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},g),m.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(cP=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),uP(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=cP)}},[f,g,r,u]),m.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),uP())},[f,u]),m.useEffect(()=>{const k=()=>v({});return document.addEventListener(bx,k),()=>document.removeEventListener(bx,k)},[]),m.createElement(Qe.div,he({},c,{ref:b,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:Me(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Me(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Me(e.onPointerDownCapture,P.onPointerDownCapture)}))});function hQ(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){j$(uQ,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pQ(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&j$(dQ,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function uP(){const e=new CustomEvent(bx);document.dispatchEvent(e)}function j$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?PD(o,i):o.dispatchEvent(i)}const gQ=["top","right","bottom","left"],ca=Math.min,no=Math.max,Dg=Math.round,vp=Math.floor,ua=e=>({x:e,y:e}),mQ={left:"right",right:"left",bottom:"top",top:"bottom"},vQ={start:"end",end:"start"};function yx(e,t,n){return no(e,ca(t,n))}function ss(e,t){return typeof e=="function"?e(t):e}function as(e){return e.split("-")[0]}function iu(e){return e.split("-")[1]}function P1(e){return e==="x"?"y":"x"}function T1(e){return e==="y"?"height":"width"}function su(e){return["top","bottom"].includes(as(e))?"y":"x"}function D1(e){return P1(su(e))}function bQ(e,t,n){n===void 0&&(n=!1);const r=iu(e),o=D1(e),i=T1(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ag(s)),[s,Ag(s)]}function yQ(e){const t=Ag(e);return[xx(e),t,xx(t)]}function xx(e){return e.replace(/start|end/g,t=>vQ[t])}function xQ(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function wQ(e,t,n,r){const o=iu(e);let i=xQ(as(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(xx)))),i}function Ag(e){return e.replace(/left|right|bottom|top/g,t=>mQ[t])}function _Q(e){return{top:0,right:0,bottom:0,left:0,...e}}function z$(e){return typeof e!="number"?_Q(e):{top:e,right:e,bottom:e,left:e}}function $g(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function dP(e,t,n){let{reference:r,floating:o}=e;const i=su(t),s=D1(t),a=T1(s),l=as(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-o.width,y:f};break;default:g={x:r.x,y:r.y}}switch(iu(t)){case"start":g[s]-=h*(n&&c?-1:1);break;case"end":g[s]+=h*(n&&c?-1:1);break}return g}const SQ=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=dP(c,r,l),h=r,g={},v=0;for(let b=0;b<a.length;b++){const{name:w,fn:x}=a[b],{x:_,y:S,data:C,reset:E}=await x({x:u,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=_??u,f=S??f,g={...g,[w]:{...g[w],...C}},E&&v<=50){v++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:f}=dP(c,h,l)),b=-1;continue}}return{x:u,y:f,placement:h,strategy:o,middlewareData:g}};async function jd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=ss(t,e),v=z$(g),w=a[h?f==="floating"?"reference":"floating":f],x=$g(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=f==="floating"?{...s.floating,x:r,y:o}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),C=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=$g(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(x.top-E.top+v.top)/C.y,bottom:(E.bottom-x.bottom+v.bottom)/C.y,left:(x.left-E.left+v.left)/C.x,right:(E.right-x.right+v.right)/C.x}}const fP=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=ss(e,t)||{};if(c==null)return{};const f=z$(u),h={x:n,y:r},g=D1(o),v=T1(g),b=await s.getDimensions(c),w=g==="y",x=w?"top":"left",_=w?"bottom":"right",S=w?"clientHeight":"clientWidth",C=i.reference[v]+i.reference[g]-h[g]-i.floating[v],E=h[g]-i.reference[g],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=P?P[S]:0;(!A||!await(s.isElement==null?void 0:s.isElement(P)))&&(A=a.floating[S]||i.floating[v]);const k=C/2-E/2,I=A/2-b[v]/2-1,$=ca(f[x],I),L=ca(f[_],I),j=$,Q=A-b[v]-L,ee=A/2-b[v]/2+k,B=yx(j,ee,Q),Z=!l.arrow&&iu(o)!=null&&ee!=B&&i.reference[v]/2-(ee<j?$:L)-b[v]/2<0,G=Z?ee<j?ee-j:ee-Q:0;return{[g]:h[g]+G,data:{[g]:B,centerOffset:ee-B-G,...Z&&{alignmentOffset:G}},reset:Z}}}),CQ=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...w}=ss(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=as(o),_=as(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=h||(_||!b?[Ag(a)]:yQ(a));!h&&v!=="none"&&C.push(...wQ(a,b,v,S));const E=[a,...C],P=await jd(t,w),A=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&A.push(P[x]),f){const j=bQ(o,s,S);A.push(P[j[0]],P[j[1]])}if(k=[...k,{placement:o,overflows:A}],!A.every(j=>j<=0)){var I,$;const j=(((I=i.flip)==null?void 0:I.index)||0)+1,Q=E[j];if(Q)return{data:{index:j,overflows:k},reset:{placement:Q}};let ee=($=k.filter(B=>B.overflows[0]<=0).sort((B,Z)=>B.overflows[1]-Z.overflows[1])[0])==null?void 0:$.placement;if(!ee)switch(g){case"bestFit":{var L;const B=(L=k.map(Z=>[Z.placement,Z.overflows.filter(G=>G>0).reduce((G,q)=>G+q,0)]).sort((Z,G)=>Z[1]-G[1])[0])==null?void 0:L[0];B&&(ee=B);break}case"initialPlacement":ee=a;break}if(o!==ee)return{reset:{placement:ee}}}return{}}}};function hP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pP(e){return gQ.some(t=>e[t]>=0)}const EQ=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ss(e,t);switch(r){case"referenceHidden":{const i=await jd(t,{...o,elementContext:"reference"}),s=hP(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:pP(s)}}}case"escaped":{const i=await jd(t,{...o,altBoundary:!0}),s=hP(i,n.floating);return{data:{escapedOffsets:s,escaped:pP(s)}}}default:return{}}}}};async function RQ(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=as(n),a=iu(n),l=su(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,f=ss(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*u,y:h*c}:{x:h*c,y:g*u}}const OQ=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await RQ(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},PQ=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:w=>{let{x,y:_}=w;return{x,y:_}}},...l}=ss(e,t),c={x:n,y:r},u=await jd(t,l),f=su(as(o)),h=P1(f);let g=c[h],v=c[f];if(i){const w=h==="y"?"top":"left",x=h==="y"?"bottom":"right",_=g+u[w],S=g-u[x];g=yx(_,g,S)}if(s){const w=f==="y"?"top":"left",x=f==="y"?"bottom":"right",_=v+u[w],S=v-u[x];v=yx(_,v,S)}const b=a.fn({...t,[h]:g,[f]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},TQ=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ss(e,t),u={x:n,y:r},f=su(o),h=P1(f);let g=u[h],v=u[f];const b=ss(a,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const S=h==="y"?"height":"width",C=i.reference[h]-i.floating[S]+w.mainAxis,E=i.reference[h]+i.reference[S]-w.mainAxis;g<C?g=C:g>E&&(g=E)}if(c){var x,_;const S=h==="y"?"width":"height",C=["top","left"].includes(as(o)),E=i.reference[f]-i.floating[S]+(C&&((x=s.offset)==null?void 0:x[f])||0)+(C?0:w.crossAxis),P=i.reference[f]+i.reference[S]+(C?0:((_=s.offset)==null?void 0:_[f])||0)-(C?w.crossAxis:0);v<E?v=E:v>P&&(v=P)}return{[h]:g,[f]:v}}}},DQ=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=ss(e,t),l=await jd(t,a),c=as(n),u=iu(n),f=su(n)==="y",{width:h,height:g}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(b=c,v=u==="end"?"top":"bottom");const w=g-l[v],x=h-l[b],_=!t.middlewareData.shift;let S=w,C=x;if(f){const P=h-l.left-l.right;C=u||_?ca(x,P):P}else{const P=g-l.top-l.bottom;S=u||_?ca(w,P):P}if(_&&!u){const P=no(l.left,0),A=no(l.right,0),k=no(l.top,0),I=no(l.bottom,0);f?C=h-2*(P!==0||A!==0?P+A:no(l.left,l.right)):S=g-2*(k!==0||I!==0?k+I:no(l.top,l.bottom))}await s({...t,availableWidth:C,availableHeight:S});const E=await o.getDimensions(i.floating);return h!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function da(e){return B$(e)?(e.nodeName||"").toLowerCase():"#document"}function so(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ds(e){var t;return(t=(B$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function B$(e){return e instanceof Node||e instanceof so(e).Node}function ls(e){return e instanceof Element||e instanceof so(e).Element}function Si(e){return e instanceof HTMLElement||e instanceof so(e).HTMLElement}function gP(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof so(e).ShadowRoot}function zf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$o(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function AQ(e){return["table","td","th"].includes(da(e))}function A1(e){const t=$1(),n=$o(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function $Q(e){let t=Yc(e);for(;Si(t)&&!km(t);){if(A1(t))return t;t=Yc(t)}return null}function $1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function km(e){return["html","body","#document"].includes(da(e))}function $o(e){return so(e).getComputedStyle(e)}function Mm(e){return ls(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Yc(e){if(da(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gP(e)&&e.host||ds(e);return gP(t)?t.host:t}function V$(e){const t=Yc(e);return km(t)?e.ownerDocument?e.ownerDocument.body:e.body:Si(t)&&zf(t)?t:V$(t)}function zd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=V$(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=so(o);return i?t.concat(s,s.visualViewport||[],zf(o)?o:[],s.frameElement&&n?zd(s.frameElement):[]):t.concat(o,zd(o,[],n))}function H$(e){const t=$o(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Si(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Dg(n)!==i||Dg(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function k1(e){return ls(e)?e:e.contextElement}function yc(e){const t=k1(e);if(!Si(t))return ua(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=H$(t);let s=(i?Dg(n.width):n.width)/r,a=(i?Dg(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const kQ=ua(0);function W$(e){const t=so(e);return!$1()||!t.visualViewport?kQ:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function MQ(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==so(e)?!1:t}function ml(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=k1(e);let s=ua(1);t&&(r?ls(r)&&(s=yc(r)):s=yc(e));const a=MQ(i,n,r)?W$(i):ua(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const h=so(i),g=r&&ls(r)?so(r):r;let v=h.frameElement;for(;v&&r&&g!==h;){const b=yc(v),w=v.getBoundingClientRect(),x=$o(v),_=w.left+(v.clientLeft+parseFloat(x.paddingLeft))*b.x,S=w.top+(v.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,f*=b.y,l+=_,c+=S,v=so(v).frameElement}}return $g({width:u,height:f,x:l,y:c})}function IQ(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Si(n),i=ds(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=ua(1);const l=ua(0);if((o||!o&&r!=="fixed")&&((da(n)!=="body"||zf(i))&&(s=Mm(n)),Si(n))){const c=ml(n);a=yc(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function NQ(e){return Array.from(e.getClientRects())}function U$(e){return ml(ds(e)).left+Mm(e).scrollLeft}function LQ(e){const t=ds(e),n=Mm(e),r=e.ownerDocument.body,o=no(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=no(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+U$(e);const a=-n.scrollTop;return $o(r).direction==="rtl"&&(s+=no(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function FQ(e,t){const n=so(e),r=ds(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=$1();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function jQ(e,t){const n=ml(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Si(e)?yc(e):ua(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function mP(e,t,n){let r;if(t==="viewport")r=FQ(e,n);else if(t==="document")r=LQ(ds(e));else if(ls(t))r=jQ(t,n);else{const o=W$(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return $g(r)}function q$(e,t){const n=Yc(e);return n===t||!ls(n)||km(n)?!1:$o(n).position==="fixed"||q$(n,t)}function zQ(e,t){const n=t.get(e);if(n)return n;let r=zd(e,[],!1).filter(a=>ls(a)&&da(a)!=="body"),o=null;const i=$o(e).position==="fixed";let s=i?Yc(e):e;for(;ls(s)&&!km(s);){const a=$o(s),l=A1(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||zf(s)&&!l&&q$(e,s))?r=r.filter(u=>u!==s):o=a,s=Yc(s)}return t.set(e,r),r}function BQ(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?zQ(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=mP(t,u,o);return c.top=no(f.top,c.top),c.right=ca(f.right,c.right),c.bottom=ca(f.bottom,c.bottom),c.left=no(f.left,c.left),c},mP(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function VQ(e){return H$(e)}function HQ(e,t,n){const r=Si(t),o=ds(t),i=n==="fixed",s=ml(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=ua(0);if(r||!r&&!i)if((da(t)!=="body"||zf(o))&&(a=Mm(t)),r){const c=ml(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=U$(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function vP(e,t){return!Si(e)||$o(e).position==="fixed"?null:t?t(e):e.offsetParent}function G$(e,t){const n=so(e);if(!Si(e))return n;let r=vP(e,t);for(;r&&AQ(r)&&$o(r).position==="static";)r=vP(r,t);return r&&(da(r)==="html"||da(r)==="body"&&$o(r).position==="static"&&!A1(r))?n:r||$Q(e)||n}const WQ=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||G$,i=this.getDimensions;return{reference:HQ(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function UQ(e){return $o(e).direction==="rtl"}const qQ={convertOffsetParentRelativeRectToViewportRelativeRect:IQ,getDocumentElement:ds,getClippingRect:BQ,getOffsetParent:G$,getElementRects:WQ,getClientRects:NQ,getDimensions:VQ,getScale:yc,isElement:ls,isRTL:UQ};function GQ(e,t){let n=null,r;const o=ds(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:f,height:h}=e.getBoundingClientRect();if(a||t(),!f||!h)return;const g=vp(u),v=vp(o.clientWidth-(c+f)),b=vp(o.clientHeight-(u+h)),w=vp(c),_={rootMargin:-g+"px "+-v+"px "+-b+"px "+-w+"px",threshold:no(0,ca(1,l))||1};let S=!0;function C(E){const P=E[0].intersectionRatio;if(P!==l){if(!S)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(C,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return s(!0),i}function YQ(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=k1(e),u=o||i?[...c?zd(c):[],...zd(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=c&&a?GQ(c,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(x=>{let[_]=x;_&&_.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{g&&g.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let v,b=l?ml(e):null;l&&w();function w(){const x=ml(e);b&&(x.x!==b.x||x.y!==b.y||x.width!==b.width||x.height!==b.height)&&n(),b=x,v=requestAnimationFrame(w)}return n(),()=>{u.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f&&f(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(v)}}const KQ=(e,t,n)=>{const r=new Map,o={platform:qQ,...n},i={...o.platform,_c:r};return SQ(e,t,{...o,platform:i})},XQ=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?fP({element:r.current,padding:o}).fn(n):{}:r?fP({element:r,padding:o}).fn(n):{}}}};var ig=typeof document<"u"?m.useLayoutEffect:m.useEffect;function kg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!kg(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!kg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Y$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bP(e,t){const n=Y$(e);return Math.round(t*n)/n}function yP(e){const t=H.useRef(e);return ig(()=>{t.current=e}),t}function QQ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=H.useState(r);kg(h,r)||g(r);const[v,b]=H.useState(null),[w,x]=H.useState(null),_=H.useCallback(Z=>{Z!=P.current&&(P.current=Z,b(Z))},[b]),S=H.useCallback(Z=>{Z!==A.current&&(A.current=Z,x(Z))},[x]),C=i||v,E=s||w,P=H.useRef(null),A=H.useRef(null),k=H.useRef(u),I=yP(l),$=yP(o),L=H.useCallback(()=>{if(!P.current||!A.current)return;const Z={placement:t,strategy:n,middleware:h};$.current&&(Z.platform=$.current),KQ(P.current,A.current,Z).then(G=>{const q={...G,isPositioned:!0};j.current&&!kg(k.current,q)&&(k.current=q,pw.flushSync(()=>{f(q)}))})},[h,t,n,$]);ig(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(Z=>({...Z,isPositioned:!1})))},[c]);const j=H.useRef(!1);ig(()=>(j.current=!0,()=>{j.current=!1}),[]),ig(()=>{if(C&&(P.current=C),E&&(A.current=E),C&&E){if(I.current)return I.current(C,E,L);L()}},[C,E,L,I]);const Q=H.useMemo(()=>({reference:P,floating:A,setReference:_,setFloating:S}),[_,S]),ee=H.useMemo(()=>({reference:C,floating:E}),[C,E]),B=H.useMemo(()=>{const Z={position:n,left:0,top:0};if(!ee.floating)return Z;const G=bP(ee.floating,u.x),q=bP(ee.floating,u.y);return a?{...Z,transform:"translate("+G+"px, "+q+"px)",...Y$(ee.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:q}},[n,a,ee.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:L,refs:Q,elements:ee,floatingStyles:B}),[u,L,Q,ee,B])}function Im(e){const[t,n]=m.useState(void 0);return ur(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const K$="Popper",[X$,Ti]=Zn(K$),[JQ,Q$]=X$(K$),ZQ=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(JQ,{scope:t,anchor:r,onAnchorChange:o},n)},eJ="PopperAnchor",tJ=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Q$(eJ,n),s=m.useRef(null),a=_t(t,s);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(Qe.div,he({},o,{ref:a}))}),J$="PopperContent",[nJ,dye]=X$(J$),rJ=m.forwardRef((e,t)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:h=0,align:g="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:w=!0,collisionBoundary:x=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:P,...A}=e,k=Q$(J$,u),[I,$]=m.useState(null),L=_t(t,Pe=>$(Pe)),[j,Q]=m.useState(null),ee=Im(j),B=(n=ee==null?void 0:ee.width)!==null&&n!==void 0?n:0,Z=(r=ee==null?void 0:ee.height)!==null&&r!==void 0?r:0,G=f+(g!=="center"?"-"+g:""),q=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},K=Array.isArray(x)?x:[x],T=K.length>0,V={padding:q,boundary:K.filter(oJ),altBoundary:T},{refs:X,floatingStyles:N,placement:ie,isPositioned:fe,middlewareData:ue}=QQ({strategy:"fixed",placement:G,whileElementsMounted:(...Pe)=>YQ(...Pe,{animationFrame:E==="always"}),elements:{reference:k.anchor},middleware:[OQ({mainAxis:h+Z,alignmentAxis:v}),w&&PQ({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?TQ():void 0,...V}),w&&CQ({...V}),DQ({...V,apply:({elements:Pe,rects:Te,availableWidth:Ue,availableHeight:Be})=>{const{width:Ie,height:Ke}=Te.reference,lt=Pe.floating.style;lt.setProperty("--radix-popper-available-width",`${Ue}px`),lt.setProperty("--radix-popper-available-height",`${Be}px`),lt.setProperty("--radix-popper-anchor-width",`${Ie}px`),lt.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),j&&XQ({element:j,padding:b}),iJ({arrowWidth:B,arrowHeight:Z}),C&&EQ({strategy:"referenceHidden",...V})]}),[pe,se]=Z$(ie),ne=Ln(P);ur(()=>{fe&&(ne==null||ne())},[fe,ne]);const le=(o=ue.arrow)===null||o===void 0?void 0:o.x,ye=(i=ue.arrow)===null||i===void 0?void 0:i.y,Y=((s=ue.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[be,_e]=m.useState();return ur(()=>{I&&_e(window.getComputedStyle(I).zIndex)},[I]),m.createElement("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:fe?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(a=ue.transformOrigin)===null||a===void 0?void 0:a.x,(l=ue.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(nJ,{scope:u,placedSide:pe,onArrowChange:Q,arrowX:le,arrowY:ye,shouldHideArrow:Y},m.createElement(Qe.div,he({"data-side":pe,"data-align":se},A,{ref:L,style:{...A.style,animation:fe?void 0:"none",opacity:(c=ue.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function oJ(e){return e!==null}const iJ=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,h=f?0:e.arrowWidth,g=f?0:e.arrowHeight,[v,b]=Z$(a),w={start:"0%",center:"50%",end:"100%"}[b],x=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+h/2,_=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+g/2;let S="",C="";return v==="bottom"?(S=f?w:`${x}px`,C=`${-g}px`):v==="top"?(S=f?w:`${x}px`,C=`${l.floating.height+g}px`):v==="right"?(S=`${-g}px`,C=f?w:`${_}px`):v==="left"&&(S=`${l.floating.width+g}px`,C=f?w:`${_}px`),{data:{x:S,y:C}}}});function Z$(e){const[t,n="center"]=e.split("-");return[t,n]}const Bf=ZQ,Vf=tJ,Hf=rJ,M1=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?Mo.createPortal(m.createElement(Qe.div,he({},o,{ref:t})),r):null}),sJ=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(aJ);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(wx,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(wx,he({},r,{ref:t}),n)});sJ.displayName="Slot";const wx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...lJ(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});wx.displayName="SlotClone";const ek=({children:e})=>m.createElement(m.Fragment,null,e);function aJ(e){return m.isValidElement(e)&&e.type===ek}function lJ(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const tk=m.forwardRef((e,t)=>m.createElement(Qe.span,he({},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}}))),cJ=tk,[Nm,fye]=Zn("Tooltip",[Ti]),I1=Ti(),uJ="TooltipProvider",dJ=700,_x="tooltip.open",[fJ,N1]=Nm(uJ),hJ=e=>{const{__scopeTooltip:t,delayDuration:n=dJ,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(fJ,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:o},i)},L1="Tooltip",[pJ,Lm]=Nm(L1),gJ=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=N1(L1,e.__scopeTooltip),c=I1(t),[u,f]=m.useState(null),h=Jo(),g=m.useRef(0),v=s??l.disableHoverableContent,b=a??l.delayDuration,w=m.useRef(!1),[x=!1,_]=wr({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(_x))):l.onClose(),i==null||i(A)}}),S=m.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),C=m.useCallback(()=>{window.clearTimeout(g.current),w.current=!1,_(!0)},[_]),E=m.useCallback(()=>{window.clearTimeout(g.current),_(!1)},[_]),P=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{w.current=!0,_(!0)},b)},[b,_]);return m.useEffect(()=>()=>window.clearTimeout(g.current),[]),m.createElement(Bf,c,m.createElement(pJ,{scope:t,contentId:h,open:x,stateAttribute:S,trigger:u,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?P():C()},[l.isOpenDelayed,P,C]),onTriggerLeave:m.useCallback(()=>{v?E():window.clearTimeout(g.current)},[E,v]),onOpen:C,onClose:E,disableHoverableContent:v},n))},xP="TooltipTrigger",nk=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Lm(xP,n),i=N1(xP,n),s=I1(n),a=m.useRef(null),l=_t(t,a,o.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(Vf,he({asChild:!0},s),m.createElement(Qe.button,he({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:Me(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Me(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Me(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Me(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Me(e.onBlur,o.onClose),onClick:Me(e.onClick,o.onClose)})))}),mJ="TooltipPortal",[hye,vJ]=Nm(mJ,{forceMount:void 0}),Bd="TooltipContent",bJ=m.forwardRef((e,t)=>{const n=vJ(Bd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Lm(Bd,e.__scopeTooltip);return m.createElement(er,{present:r||s.open},s.disableHoverableContent?m.createElement(rk,he({side:o},i,{ref:t})):m.createElement(yJ,he({side:o},i,{ref:t})))}),yJ=m.forwardRef((e,t)=>{const n=Lm(Bd,e.__scopeTooltip),r=N1(Bd,e.__scopeTooltip),o=m.useRef(null),i=_t(t,o),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,h=m.useCallback(()=>{a(null),f(!1)},[f]),g=m.useCallback((v,b)=>{const w=v.currentTarget,x={x:v.clientX,y:v.clientY},_=wJ(x,w.getBoundingClientRect()),S=_J(x,_),C=SJ(b.getBoundingClientRect()),E=EJ([...S,...C]);a(E),f(!0)},[f]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(l&&u){const v=w=>g(w,u),b=w=>g(w,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",b)}}},[l,u,g,h]),m.useEffect(()=>{if(s){const v=b=>{const w=b.target,x={x:b.clientX,y:b.clientY},_=(l==null?void 0:l.contains(w))||(u==null?void 0:u.contains(w)),S=!CJ(x,s);_?h():S&&(h(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,s,c,h]),m.createElement(rk,he({},e,{ref:i}))}),[xJ,pye]=Nm(L1,{isInside:!1}),rk=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Lm(Bd,n),c=I1(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(_x,u),()=>document.removeEventListener(_x,u)),[u]),m.useEffect(()=>{if(l.trigger){const f=h=>{const g=h.target;g!=null&&g.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u},m.createElement(Hf,he({"data-state":l.stateAttribute},c,a,{ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),m.createElement(ek,null,r),m.createElement(xJ,{scope:n,isInside:!0},m.createElement(cJ,{id:l.contentId,role:"tooltip"},o||r))))});function wJ(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function _J(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 SJ(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function CJ(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function EJ(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),RJ(t)}function RJ(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const OJ=hJ,PJ=gJ,TJ=nk,ok=bJ,DJ=OJ,ik=PJ,sk=TJ,F1=H.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(ok,{ref:r,sideOffset:t,className:Ce("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}));F1.displayName=ok.displayName;function ll({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const c=t;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&i==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&i==="en-IN"?(s=1e5,a="L"):e>=1e6?(s=1e6,a="M"):e>=1e3&&(s=1e3,a="K"));const u=e/s,f={maximumFractionDigits:c,minimumFractionDigits:c};if(o){f.style="currency",f.currency=o;try{new Intl.NumberFormat(i,f).format(0)}catch{f.currency="USD"}}try{new Intl.NumberFormat(i,f).format(0)}catch{l="en-US"}let g=new Intl.NumberFormat(l,f).format(u);return n&&(g+=a),g}function ak(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function lk({card:e}){var w,x,_,S,C,E,P,A,k,I,$,L,j,Q,ee,B,Z,G,q,K,T,V,X,N;const t=$e(ie=>ie.actions.setCardTitle),n=$e(ie=>ie.actions.setCardDescription),r=$e(ie=>ie.isVisualEditing),o=br(ie=>ie.card),i=br(ie=>ie.actions.setCard);br(ie=>ie.actions.setNumberFormat);const s=$e(ie=>ie.selectedSheetId),a=e.data,l=(x=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:x.colorRanges,{metricKeys:c}=ar(a||[]),u=(_=a==null?void 0:a[0])==null?void 0:_[c==null?void 0:c[0]],f=(S=a==null?void 0:a[0])==null?void 0:S[c==null?void 0:c[1]],h=!!e.data&&e.data.length>0;function g(ie){r?i({...o,title:ie}):t(s,e.id,ie)}function v(ie){r?i({...o,description:ie}):n(s,e.id,ie)}const b=f&&f-u!==0?(u-f)/f:null;return O.jsxs("div",{className:"kpi-card flex grow flex-col overflow-scroll",children:[O.jsxs(lm,{className:"grow pb-3",children:[O.jsx(is,{text:r?o.title:e.title,onSave:g,children:O.jsx("div",{className:"flex items-center gap-2",children:O.jsx(Af,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),h&&O.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[O.jsx("p",{style:{color:ak(u,l)},className:"text-3xl font-semibold",children:ll({number:u,decimalPlaces:((E=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:E.decimalPlaces)||0,useSuffix:!!((A=(P=e.preferences)==null?void 0:P.formatNumber)!=null&&A.suffix),customSuffix:((I=(k=e.preferences)==null?void 0:k.formatNumber)==null?void 0:I.suffix)||"",locale:((L=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:L.locale)||"",currency:((Q=(j=e.preferences)==null?void 0:j.formatNumber)==null?void 0:Q.currency)||""})}),f&&O.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",ll({number:f,decimalPlaces:((B=(ee=e.preferences)==null?void 0:ee.formatNumber)==null?void 0:B.decimalPlaces)||0,useSuffix:!!((G=(Z=e.preferences)==null?void 0:Z.formatNumber)!=null&&G.suffix),customSuffix:((K=(q=e.preferences)==null?void 0:q.formatNumber)==null?void 0:K.suffix)||"",locale:((V=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:V.locale)||"",currency:((N=(X=e.preferences)==null?void 0:X.formatNumber)==null?void 0:N.currency)||""})]})]})]}),b&&O.jsxs(cm,{className:"grow items-start gap-1 pb-4 text-sm",children:[O.jsx(AJ,{children:b}),O.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[b>0?"up ":"down ",O.jsx(is,{text:e.description||"",onSave:v,children:e.description})]})]})]})}function AJ({children:e}){const t=e>0?O.jsx(C1,{className:"h-4 w-4"}):O.jsx(S1,{className:"h-4 w-4"}),n=`${Math.abs(e*100).toFixed(0)}%`;return O.jsxs("div",{className:Ce("flex items-center",{"text-green-600":e>0,"text-destructive":e<0}),children:[t,O.jsx("span",{className:"ml-[1px]",children:n})]})}var Kc=1e3,Xc=Kc*60,Qc=Xc*60,vl=Qc*24,$J=vl*7,kJ=vl*365.25,MJ=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return IJ(e);if(n==="number"&&isFinite(e))return t.long?LJ(e):NJ(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function IJ(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*kJ;case"weeks":case"week":case"w":return n*$J;case"days":case"day":case"d":return n*vl;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Qc;case"minutes":case"minute":case"mins":case"min":case"m":return n*Xc;case"seconds":case"second":case"secs":case"sec":case"s":return n*Kc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function NJ(e){var t=Math.abs(e);return t>=vl?Math.round(e/vl)+"d":t>=Qc?Math.round(e/Qc)+"h":t>=Xc?Math.round(e/Xc)+"m":t>=Kc?Math.round(e/Kc)+"s":e+"ms"}function LJ(e){var t=Math.abs(e);return t>=vl?bp(e,t,vl,"day"):t>=Qc?bp(e,t,Qc,"hour"):t>=Xc?bp(e,t,Xc,"minute"):t>=Kc?bp(e,t,Kc,"second"):e+" ms"}function bp(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const FJ=nu(MJ);function ck({children:e}){const{setIsSessionExpired:t}=co(),n=new eB({queryCache:new bD({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return O.jsx(oB,{client:n,children:e})}const au=m.forwardRef(({children:e,className:t,...n},r)=>O.jsx("div",{className:Ce("semaphor-scope",t),ref:r,...n,children:e})),jJ={id:"",authToken:void 0},uk=m.createContext(jJ),dk=({children:e,dashboardProps:t})=>O.jsx(ck,{children:O.jsx(uk.Provider,{value:t,children:O.jsx(au,{style:{height:"100%"},children:e})})});function ma(){const e=m.useContext(uk);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function zJ(e){$e(u=>u.bookmarkKey),$e(u=>u.selectedSheetId);const t=$e(u=>u.dashboard.baseQueries),n=$e(u=>u.actions.getCardSheet),r=$e(u=>u.actions.getSelectedFrame()),{authToken:o}=ma(),i=$e(u=>u.authToken),s=$e(u=>u.filterValues);$e(u=>u.isDashboardEditing);const a=FJ((e==null?void 0:e.refreshInterval)||"0");n(e.id);const l=Q2(e.sql,t);return Df({queryKey:[e.id,l,JSON.stringify(s),r?r.activeCardId:""],queryFn:()=>Of("https://semaphor.cloud/api/v1/query",(o==null?void 0:o.accessToken)||(i==null?void 0:i.accessToken)||"",{connection_id:e.connectionId,sql:l,python:e.python===uD?"":e.python,active_filters:s}),refetchInterval:a,enabled:!!e.connectionId})}function Ia({data:e,cfg:t,customCfg:n,preferences:r}){const{dimensionKeys:o,metricKeys:i}=ar(e),s=HX(i,e,r),a=og(s,n),l=o[0],c=mx(e,l);j1(r,t),fk(r);const u=hk(t,r),f=qo((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions),h=qo(u,f),g=qo(h,(n==null?void 0:n.options)||{});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:a},options:g}}function j1(e,t){var o,i,s;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((s=e==null?void 0:e.chartOptions)==null?void 0:s.indexAxis)==="x"?"y":"x":n}function fk(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 hk(e,t){var i,s,a,l,c,u,f,h,g,v,b,w;const n=j1(t,e),r=fk(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.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 _,S,C,E;return ll({number:Number(x),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}},[r]:{...(g=(h=(f=e==null?void 0:e.options)==null?void 0:f.scales)==null?void 0:h[r])==null?void 0:g.ticks,callback:null}},plugins:{...(v=e==null?void 0:e.options)==null?void 0:v.plugins,datalabels:{...(w=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:w.datalabels,formatter:function(x){var _,S,C,E;return ll({number:Number(x),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}}}}function BJ(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function VJ(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}}}}}function HJ(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function WJ(e,t=!1){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}}}}}function UJ(e,t){var r,o,i,s;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(o=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:o.x,display:!0,stacked:!0},y:{...(s=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:s.y,display:!0,stacked:t==="stackedBar"}}}}}function qJ(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function GJ(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:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function YJ(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function KJ(e){const n=new Function("getDatalabelColor",e)(E0);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}function z1({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s}){var a,l,c;if(t==="bar"){const u=HJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const u=BJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pyramid"){const u=VJ(n),{dimensionKeys:f,metricKeys:h}=ar(e),g=Tg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:h[0]}),v=Ia({data:g,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s}),b="x2";return{...v,data:{...v.data,datasets:v.data.datasets.map((x,_)=>_===1?{...x,xAxisID:b}:x)},options:{...v.options,scales:{...(a=v==null?void 0:v.options)==null?void 0:a.scales,[b]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const u=UJ(n,t),{dimensionKeys:f,metricKeys:h}=ar(e),g=Tg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:h[0]});return Ia({data:g,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const u=qJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="range"){const u=WJ(n),f=qX(e),h=og(f,r),{plugins:g,options:v}=KJ((s==null?void 0:s.customVisualCode)||""),b=qo((u==null?void 0:u.options)||{},(n==null?void 0:n.options)||{}),w=qo(b,(s==null?void 0:s.chartOptions)||{}),x=qo(w,(r==null?void 0:r.options)||{}),_=qo(x,v),S=hk(n,s),C=qo(_,S),E={...C,plugins:{...C==null?void 0:C.plugins,datalabels:{...(l=C==null?void 0:C.plugins)==null?void 0:l.datalabels,formatter:($,L)=>$.map(Q=>{var ee,B,Z,G;return ll({number:Number(Q),decimalPlaces:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.decimalPlaces)||0,useSuffix:!!((B=s==null?void 0:s.numberAxisFormat)!=null&&B.suffix),customSuffix:"",locale:((Z=s==null?void 0:s.numberAxisFormat)==null?void 0:Z.locale)||"",currency:((G=s==null?void 0:s.numberAxisFormat)==null?void 0:G.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:P}=ar(e),A=P[0];return{type:"bar",data:{labels:[...new Set(mx(e,A))],datasets:h},options:E,plugins:[...g]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const u=GJ(t,n),{dimensionKeys:f,metricKeys:h}=ar(e),g=GX(h,e),v=og(g,r),b=f[0],w=mx(e,b),x=qo((u==null?void 0:u.options)||{},(r==null?void 0:r.options)||{}),_=qo(x,(s==null?void 0:s.chartOptions)||{}),S={..._,plugins:{..._.plugins,datalabels:{...(c=_.plugins)==null?void 0:c.datalabels,formatter:(P,A)=>{var k,I,$,L;return ll({number:Number(P),decimalPlaces:((k=s==null?void 0:s.numberAxisFormat)==null?void 0:k.decimalPlaces)||0,useSuffix:!!((I=s==null?void 0:s.numberAxisFormat)!=null&&I.suffix),customSuffix:"",locale:(($=s==null?void 0:s.numberAxisFormat)==null?void 0:$.locale)||"",currency:((L=s==null?void 0:s.numberAxisFormat)==null?void 0:L.currency)||""})}}}};return{type:t,data:{labels:w,datasets:v},options:S,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(P,A,k){var Z,G,q,K;const{ctx:I,data:$}=P;I.save();const L=P.getDatasetMeta(0).data[0].x,j=P.getDatasetMeta(0).data[0].y,Q=Bc(Pd());I.font="1.2rem Arial",I.fontWeight="bolder",I.fillStyle=Q,I.textAlign="center",I.textBaseline="middle";const ee=$.datasets[0].data.reduce((T,V)=>T+V,0),B=ll({number:Number(ee),decimalPlaces:((Z=s==null?void 0:s.numberAxisFormat)==null?void 0:Z.decimalPlaces)||0,useSuffix:!!((G=s==null?void 0:s.numberAxisFormat)!=null&&G.suffix),customSuffix:"",locale:((q=s==null?void 0:s.numberAxisFormat)==null?void 0:q.locale)||"",currency:((K=s==null?void 0:s.numberAxisFormat)==null?void 0:K.currency)||""});I.fillText(B,L,j)}}:""]}}if(t==="radar"){const u=YJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:u}=ar(e);if(u.length<3){console.log("Bubble charts require 3 numeric columns");return}const f=UX(e),h=og(f,r),g={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:u[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:u[1]},beginAtZero:!0,ticks:{precision:0}}}},v=qo(g,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:h},options:v}}return Ia({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function XJ({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=$e.getState().theme;if(!o)return;const a=s==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&JJ(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&ZJ(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&QJ({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function QJ(e){var a,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:s}=e;i?(l=(a=t==null?void 0:t.data)==null?void 0:a.datasets)==null||l.forEach((f,h)=>{var g,v;typeof f.backgroundColor=="string"&&(f.backgroundColor=new Array(f.data.length).fill(f.backgroundColor),f.borderColor=new Array(f.data.length).fill(f.borderColor)),f.backgroundColor=(g=f==null?void 0:f.backgroundColor)==null?void 0:g.map((b,w)=>w===n&&h===r?b:s),f.borderColor=(v=f==null?void 0:f.borderColor)==null?void 0:v.map((b,w)=>w===n&&h===r?b:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((f,h)=>{var g,v,b,w,x,_;f.backgroundColor=new Array(f.data.length).fill((b=(v=(g=o==null?void 0:o.data)==null?void 0:g.datasets)==null?void 0:v[h])==null?void 0:b.backgroundColor),f.borderColor=new Array(f.data.length).fill((_=(x=(w=o==null?void 0:o.data)==null?void 0:w.datasets)==null?void 0:x[h])==null?void 0:_.borderColor)}),t==null||t.update()}function JJ(e,t,n,r,o){var i,s,a,l;console.log("clicked index",t),r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,f;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,g)=>g===t?h:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((h,g)=>g===t?h:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,h,g,v,b,w;c.backgroundColor=new Array(c.data.length).fill((g=(h=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:h[u])==null?void 0:g.backgroundColor),c.borderColor=new Array(c.data.length).fill((w=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:w.borderColor)}),e==null||e.update()}function ZJ(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,f;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,g)=>g===t?h:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((h,g)=>g===t?h:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,h,g,v,b,w,x,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(g=(h=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:h[u])==null?void 0:g.backgroundColor,c.borderColor=(w=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:w.borderColor),c.backgroundColor=(x=c==null?void 0:c.backgroundColor)==null?void 0:x.map((S,C)=>{var E;return(E=n.data.datasets[u].backgroundColor)==null?void 0:E[C]}),c.borderColor=(_=c==null?void 0:c.borderColor)==null?void 0:_.map((S,C)=>{var E;return(E=n.data.datasets[u].borderColor)==null?void 0:E[C]})}),e==null||e.update()}function eZ(e,t,n,r){var o,i;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=ar(e.data);if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const l=s[0],c=(o=e.data[n])==null?void 0:o[l];return[{columnName:l,columnValue:c,metric:a[t],value:r}]}if(["stackedBar","pyramid"].includes(e.type)){const l=Tg({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),c=s[0],u=(i=l[n])==null?void 0:i[c],f=s[1],{metricKeys:h}=ar(l),g=h[t];return[{columnName:c,columnValue:u,metric:a[0],value:r},{columnName:f,columnValue:g,metric:a[0],value:r}]}if(e.type==="bubble"||e.type==="scatter"){const l=s[0],c=r.label;return[{columnName:l,columnValue:c,metric1:a[0],value1:r.x,metric2:a[1],value2:r.y,metric3:a==null?void 0:a[2],value3:r==null?void 0:r.r}]}}catch(s){console.error("Error in getAdhocFilter",s)}}function tZ(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=co(),r=n(e),o=B1(r||t),i={...r,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[]};return{...o,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[],card:i}}function B1(e){var ee,B,Z,G;const{onChartElementClicked:t}=ma(),[n,r]=m.useState(0),o=((ee=e==null?void 0:e.preferences)==null?void 0:ee.filterOnClickColumnIndex)===void 0?0:(B=e.preferences)==null?void 0:B.filterOnClickColumnIndex,i=$e(q=>q.bookmarkKey);$e(q=>q.isVisualEditing);const s=$e(q=>q.filteringCards),a=$e(q=>q.selectedSheetId);$e(q=>q.selectedCardId),$e(q=>q.isDashboardEditing);const l=$e(q=>q.themeStyle),c=$e(q=>q.filterValues),u=m.useRef(c),f=(Z=e==null?void 0:e.preferences)==null?void 0:Z.onClickFilter,{addFrame:h,addFilteringCard:g,setFrameCardData:v,getCardFrame:b,addOrUpdateFilterValue:w,addOrUpdateFilterValues:x,removeFilterValue:_,removeFilteringCard:S}=co(),{data:C,isLoading:E,isFetching:P,isError:A,refetch:k}=zJ(e),I=s==null?void 0:s.find(q=>q.id===e.id),$=((G=b(e.id))==null?void 0:G.cards)||[],L=($==null?void 0:$.length)==1;let j;e.data&&e.data.length>0&&(j=z1({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences})),m.useEffect(()=>{!C||!C.records||I&&L||v(a,e.id,(C==null?void 0:C.records)||[])},[C,a,e.id,v,c]),m.useEffect(()=>{e.data&&(I&&L||r(n+1))},[JSON.stringify(e.data),e.type,e.cfg,e.customCfg,e.preferences,l]),m.useEffect(()=>{e.connectionId&&!I&&(u.current=c)},[c,i]);function Q(q,K,T,V){var ie,fe;let X=!1;if(!e.data)return;const N=eZ(e,K,T,V);if(console.log("fieldValues",N),t==null||t(e,N),!!(((ie=e==null?void 0:e.preferences)==null?void 0:ie.onClickFilter)??[]).length){if(I){const ue=e.id;_(ue),S(e)}else{if(X=!0,!N)return;const ue=[];N.forEach((pe,se)=>{const ne=f==null?void 0:f.find(ye=>ye.columnIndex===se);if(!ne)return;const le={filterId:e.id+"-"+pe.columnName,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:pe.columnName,expression:ne.expression,valueType:Td(N[ne.columnIndex].columnValue),operation:"=",values:[N[ne.columnIndex].columnValue]};ue.push(le)}),e.id,e==null||e.connectionId,e.lastSelectedTable,N[o].columnName,(fe=e.preferences)==null||fe.filterOnClickField,Td(N[o].columnValue),N[o].columnValue,x(ue),g(e)}XJ({chart:q,elementIndex:T,datasetIndex:K,cardType:e.type,cfg:j,apply:X})}}return{isError:A,isLoading:E,isFetching:P,data:C,visualKey:n,handleDatapointClick:Q,cfg:j}}var nZ=e=>{switch(e){case"success":return iZ;case"info":return aZ;case"warning":return sZ;case"error":return lZ;default:return null}},rZ=Array(12).fill(0),oZ=({visible:e})=>m.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},m.createElement("div",{className:"sonner-spinner"},rZ.map((t,n)=>m.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),iZ=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),sZ=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),aZ=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),lZ=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),cZ=()=>{let[e,t]=m.useState(document.hidden);return m.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Sx=1,uZ=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;let{message:r,...o}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Sx++,s=this.toasts.find(l=>l.id===i),a=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:r}),{...l,...t,id:i,dismissible:a,title:r}):l):this.addToast({title:r,...o,dismissible:a,id:i}),i},this.dismiss=t=>(t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:t,dismiss:!0})),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let o=t instanceof Promise?t:t(),i=r!==void 0;return o.then(async s=>{if(fZ(s)&&!s.ok){i=!1;let a=typeof n.error=="function"?await n.error(`HTTP error! status: ${s.status}`):n.error,l=typeof n.description=="function"?await n.description(`HTTP error! status: ${s.status}`):n.description;this.create({id:r,type:"error",message:a,description:l})}else if(n.success!==void 0){i=!1;let a=typeof n.success=="function"?await n.success(s):n.success,l=typeof n.description=="function"?await n.description(s):n.description;this.create({id:r,type:"success",message:a,description:l})}}).catch(async s=>{if(n.error!==void 0){i=!1;let a=typeof n.error=="function"?await n.error(s):n.error,l=typeof n.description=="function"?await n.description(s):n.description;this.create({id:r,type:"error",message:a,description:l})}}).finally(()=>{var s;i&&(this.dismiss(r),r=void 0),(s=n.finally)==null||s.call(n)}),r},this.custom=(t,n)=>{let r=(n==null?void 0:n.id)||Sx++;return this.create({jsx:t(r),id:r,...n}),r},this.subscribers=[],this.toasts=[]}},Qr=new uZ,dZ=(e,t)=>{let n=(t==null?void 0:t.id)||Sx++;return Qr.addToast({title:e,...t,id:n}),n},fZ=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",hZ=dZ,pZ=()=>Qr.toasts,pk=Object.assign(hZ,{success:Qr.success,info:Qr.info,warning:Qr.warning,error:Qr.error,custom:Qr.custom,message:Qr.message,promise:Qr.promise,dismiss:Qr.dismiss,loading:Qr.loading},{getHistory:pZ});function gZ(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}gZ(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
254
|
-
`);function yp(e){return e.label!==void 0}var mZ=3,vZ="32px",bZ=4e3,yZ=356,xZ=14,wZ=20,_Z=200;function SZ(...e){return e.filter(Boolean).join(" ")}var CZ=e=>{var t,n,r,o,i,s,a,l,c,u;let{invert:f,toast:h,unstyled:g,interacting:v,setHeights:b,visibleToasts:w,heights:x,index:_,toasts:S,expanded:C,removeToast:E,defaultRichColors:P,closeButton:A,style:k,cancelButtonStyle:I,actionButtonStyle:$,className:L="",descriptionClassName:j="",duration:Q,position:ee,gap:B,loadingIcon:Z,expandByDefault:G,classNames:q,icons:K,closeButtonAriaLabel:T="Close toast",pauseWhenPageIsHidden:V,cn:X}=e,[N,ie]=m.useState(!1),[fe,ue]=m.useState(!1),[pe,se]=m.useState(!1),[ne,le]=m.useState(!1),[ye,Y]=m.useState(0),[be,_e]=m.useState(0),Pe=m.useRef(null),Te=m.useRef(null),Ue=_===0,Be=_+1<=w,Ie=h.type,Ke=h.dismissible!==!1,lt=h.className||"",It=h.descriptionClassName||"",At=m.useMemo(()=>x.findIndex(nt=>nt.toastId===h.id)||0,[x,h.id]),Ht=m.useMemo(()=>{var nt;return(nt=h.closeButton)!=null?nt:A},[h.closeButton,A]),de=m.useMemo(()=>h.duration||Q||bZ,[h.duration,Q]),Ee=m.useRef(0),Le=m.useRef(0),Ge=m.useRef(0),Ze=m.useRef(null),[Wt,Zt]=ee.split("-"),Kt=m.useMemo(()=>x.reduce((nt,ht,$t)=>$t>=At?nt:nt+ht.height,0),[x,At]),vn=cZ(),ln=h.invert||f,Lt=Ie==="loading";Le.current=m.useMemo(()=>At*B+Kt,[At,Kt]),m.useEffect(()=>{ie(!0)},[]),m.useLayoutEffect(()=>{if(!N)return;let nt=Te.current,ht=nt.style.height;nt.style.height="auto";let $t=nt.getBoundingClientRect().height;nt.style.height=ht,_e($t),b(Xt=>Xt.find(bt=>bt.toastId===h.id)?Xt.map(bt=>bt.toastId===h.id?{...bt,height:$t}:bt):[{toastId:h.id,height:$t,position:h.position},...Xt])},[N,h.title,h.description,b,h.id]);let tn=m.useCallback(()=>{ue(!0),Y(Le.current),b(nt=>nt.filter(ht=>ht.toastId!==h.id)),setTimeout(()=>{E(h)},_Z)},[h,E,b,Le]);m.useEffect(()=>{if(h.promise&&Ie==="loading"||h.duration===1/0||h.type==="loading")return;let nt,ht=de;return C||v||V&&vn?(()=>{if(Ge.current<Ee.current){let $t=new Date().getTime()-Ee.current;ht=ht-$t}Ge.current=new Date().getTime()})():ht!==1/0&&(Ee.current=new Date().getTime(),nt=setTimeout(()=>{var $t;($t=h.onAutoClose)==null||$t.call(h,h),tn()},ht)),()=>clearTimeout(nt)},[C,v,G,h,de,tn,h.promise,Ie,V,vn]),m.useEffect(()=>{let nt=Te.current;if(nt){let ht=nt.getBoundingClientRect().height;return _e(ht),b($t=>[{toastId:h.id,height:ht,position:h.position},...$t]),()=>b($t=>$t.filter(Xt=>Xt.toastId!==h.id))}},[b,h.id]),m.useEffect(()=>{h.delete&&tn()},[tn,h.delete]);function xn(){return K!=null&&K.loading?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},K.loading):Z?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},Z):m.createElement(oZ,{visible:Ie==="loading"})}return m.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Te,className:X(L,lt,q==null?void 0:q.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,q==null?void 0:q.default,q==null?void 0:q[Ie],(n=h==null?void 0:h.classNames)==null?void 0:n[Ie]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:P,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":N,"data-promise":!!h.promise,"data-removed":fe,"data-visible":Be,"data-y-position":Wt,"data-x-position":Zt,"data-index":_,"data-front":Ue,"data-swiping":pe,"data-dismissible":Ke,"data-type":Ie,"data-invert":ln,"data-swipe-out":ne,"data-expanded":!!(C||G&&N),style:{"--index":_,"--toasts-before":_,"--z-index":S.length-_,"--offset":`${fe?ye:Le.current}px`,"--initial-height":G?"auto":`${be}px`,...k,...h.style},onPointerDown:nt=>{Lt||!Ke||(Pe.current=new Date,Y(Le.current),nt.target.setPointerCapture(nt.pointerId),nt.target.tagName!=="BUTTON"&&(se(!0),Ze.current={x:nt.clientX,y:nt.clientY}))},onPointerUp:()=>{var nt,ht,$t,Xt;if(ne||!Ke)return;Ze.current=null;let bt=Number(((nt=Te.current)==null?void 0:nt.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Rn=new Date().getTime()-((ht=Pe.current)==null?void 0:ht.getTime()),Lo=Math.abs(bt)/Rn;if(Math.abs(bt)>=wZ||Lo>.11){Y(Le.current),($t=h.onDismiss)==null||$t.call(h,h),tn(),le(!0);return}(Xt=Te.current)==null||Xt.style.setProperty("--swipe-amount","0px"),se(!1)},onPointerMove:nt=>{var ht;if(!Ze.current||!Ke)return;let $t=nt.clientY-Ze.current.y,Xt=nt.clientX-Ze.current.x,bt=(Wt==="top"?Math.min:Math.max)(0,$t),Rn=nt.pointerType==="touch"?10:2;Math.abs(bt)>Rn?(ht=Te.current)==null||ht.style.setProperty("--swipe-amount",`${$t}px`):Math.abs(Xt)>Rn&&(Ze.current=null)}},Ht&&!h.jsx?m.createElement("button",{"aria-label":T,"data-disabled":Lt,"data-close-button":!0,onClick:Lt||!Ke?()=>{}:()=>{var nt;tn(),(nt=h.onDismiss)==null||nt.call(h,h)},className:X(q==null?void 0:q.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},m.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||m.isValidElement(h.title)?h.jsx||h.title:m.createElement(m.Fragment,null,Ie||h.icon||h.promise?m.createElement("div",{"data-icon":"",className:X(q==null?void 0:q.icon,(i=h==null?void 0:h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||xn():null,h.type!=="loading"?h.icon||(K==null?void 0:K[Ie])||nZ(Ie):null):null,m.createElement("div",{"data-content":"",className:X(q==null?void 0:q.content,(s=h==null?void 0:h.classNames)==null?void 0:s.content)},m.createElement("div",{"data-title":"",className:X(q==null?void 0:q.title,(a=h==null?void 0:h.classNames)==null?void 0:a.title)},h.title),h.description?m.createElement("div",{"data-description":"",className:X(j,It,q==null?void 0:q.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},h.description):null),m.isValidElement(h.cancel)?h.cancel:h.cancel&&yp(h.cancel)?m.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||I,onClick:nt=>{var ht,$t;yp(h.cancel)&&Ke&&(($t=(ht=h.cancel).onClick)==null||$t.call(ht,nt),tn())},className:X(q==null?void 0:q.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,m.isValidElement(h.action)?h.action:h.action&&yp(h.action)?m.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||$,onClick:nt=>{var ht,$t;yp(h.action)&&(nt.defaultPrevented||(($t=(ht=h.action).onClick)==null||$t.call(ht,nt),tn()))},className:X(q==null?void 0:q.actionButton,(u=h==null?void 0:h.classNames)==null?void 0:u.actionButton)},h.action.label):null))};function wP(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var EZ=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:s,offset:a,theme:l="light",richColors:c,duration:u,style:f,visibleToasts:h=mZ,toastOptions:g,dir:v=wP(),gap:b=xZ,loadingIcon:w,icons:x,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S,cn:C=SZ}=e,[E,P]=m.useState([]),A=m.useMemo(()=>Array.from(new Set([n].concat(E.filter(V=>V.position).map(V=>V.position)))),[E,n]),[k,I]=m.useState([]),[$,L]=m.useState(!1),[j,Q]=m.useState(!1),[ee,B]=m.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=m.useRef(null),G=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=m.useRef(null),K=m.useRef(!1),T=m.useCallback(V=>{var X;(X=E.find(N=>N.id===V.id))!=null&&X.delete||Qr.dismiss(V.id),P(N=>N.filter(({id:ie})=>ie!==V.id))},[E]);return m.useEffect(()=>Qr.subscribe(V=>{if(V.dismiss){P(X=>X.map(N=>N.id===V.id?{...N,delete:!0}:N));return}setTimeout(()=>{Mo.flushSync(()=>{P(X=>{let N=X.findIndex(ie=>ie.id===V.id);return N!==-1?[...X.slice(0,N),{...X[N],...V},...X.slice(N+1)]:[V,...X]})})})}),[]),m.useEffect(()=>{if(l!=="system"){B(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:V})=>{B(V?"dark":"light")})},[l]),m.useEffect(()=>{E.length<=1&&L(!1)},[E]),m.useEffect(()=>{let V=X=>{var N,ie;r.every(fe=>X[fe]||X.code===fe)&&(L(!0),(N=Z.current)==null||N.focus()),X.code==="Escape"&&(document.activeElement===Z.current||(ie=Z.current)!=null&&ie.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[r]),m.useEffect(()=>{if(Z.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,K.current=!1)}},[Z.current]),E.length?m.createElement("section",{"aria-label":`${_} ${G}`,tabIndex:-1},A.map((V,X)=>{var N;let[ie,fe]=V.split("-");return m.createElement("ol",{key:V,dir:v==="auto"?wP():v,tabIndex:-1,ref:Z,className:s,"data-sonner-toaster":!0,"data-theme":ee,"data-y-position":ie,"data-x-position":fe,style:{"--front-toast-height":`${((N=k[0])==null?void 0:N.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||vZ,"--width":`${yZ}px`,"--gap":`${b}px`,...f},onBlur:ue=>{K.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(K.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||K.current||(K.current=!0,q.current=ue.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{j||L(!1)},onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||Q(!0)},onPointerUp:()=>Q(!1)},E.filter(ue=>!ue.position&&X===0||ue.position===V).map((ue,pe)=>{var se,ne;return m.createElement(CZ,{key:ue.id,icons:x,index:pe,toast:ue,defaultRichColors:c,duration:(se=g==null?void 0:g.duration)!=null?se:u,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:t,visibleToasts:h,closeButton:(ne=g==null?void 0:g.closeButton)!=null?ne:i,interacting:j,position:V,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:T,toasts:E.filter(le=>le.position==ue.position),heights:k.filter(le=>le.position==ue.position),setHeights:I,expandByDefault:o,gap:b,loadingIcon:w,expanded:$,pauseWhenPageIsHidden:S,cn:C})}))})):null};function RZ(e,t){const n=$e(u=>u.selectedSheetId),r=$e(u=>u.selectedFrameId),o=$e(u=>u.isDashboardEditing),i=$e(u=>u.isVisualEditing),{addFrame:s,getSelectedFrame:a,setSelectedFrameId:l}=$e(u=>u.actions);m.useEffect(()=>{const u=h=>{if(o&&((h.metaKey||h.ctrlKey)&&h.key==="c"&&(navigator.clipboard.writeText(JSON.stringify(a())),pk.success("Card copied to clipboard")),(h.ctrlKey||h.metaKey)&&h.key==="v")){console.log("Ctrl+V has been pressed");try{navigator.clipboard.readText().then(g=>{try{const v=JSON.parse(g);if(v&&v.id){v.id=la();const b=v.activeCardId;v.cards.forEach(w=>{const x=w.id;w.id=la(),x===b&&(v.activeCardId=w.id,w.title=`${w.title} (Copy)`)}),s(n,v),l(v.id)}}catch(v){console.error("Failed to parse clipboard contents: ",v)}})}catch(g){console.error("Failed to read clipboard contents: ",g)}}},f=t==null?void 0:t.current;return f==null||f.addEventListener("keydown",u),()=>{f==null||f.removeEventListener("keydown",u)}},[o,n,a,s,t,l]),m.useEffect(()=>{r===e.id&&o&&!i&&c()},[r,e.id,o,i]);function c(){const u=t==null?void 0:t.current;u==null||u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}let ay;const gk="HoverCard",[mk,mye]=Zn(gk,[Ti]),V1=Ti(),[OZ,H1]=mk(gk),PZ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=V1(t),c=m.useRef(0),u=m.useRef(0),f=m.useRef(!1),h=m.useRef(!1),[g=!1,v]=wr({prop:r,defaultProp:o,onChange:i}),b=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),w=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!h.current&&(u.current=window.setTimeout(()=>v(!1),a))},[a,v]),x=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(OZ,{scope:t,open:g,onOpenChange:v,onOpen:b,onClose:w,onDismiss:x,hasSelectionRef:f,isPointerDownOnContentRef:h},m.createElement(Bf,l,n))},TZ="HoverCardTrigger",DZ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=H1(TZ,n),i=V1(n);return m.createElement(Vf,he({asChild:!0},i),m.createElement(Qe.a,he({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:Me(e.onPointerEnter,Mg(o.onOpen)),onPointerLeave:Me(e.onPointerLeave,Mg(o.onClose)),onFocus:Me(e.onFocus,o.onOpen),onBlur:Me(e.onBlur,o.onClose),onTouchStart:Me(e.onTouchStart,s=>s.preventDefault())})))}),AZ="HoverCardPortal",[vye,$Z]=mk(AZ,{forceMount:void 0}),Cx="HoverCardContent",kZ=m.forwardRef((e,t)=>{const n=$Z(Cx,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=H1(Cx,e.__scopeHoverCard);return m.createElement(er,{present:r||i.open},m.createElement(MZ,he({"data-state":i.open?"open":"closed"},o,{onPointerEnter:Me(e.onPointerEnter,Mg(i.onOpen)),onPointerLeave:Me(e.onPointerLeave,Mg(i.onClose)),ref:t})))}),MZ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=H1(Cx,n),c=V1(n),u=m.useRef(null),f=_t(t,u),[h,g]=m.useState(!1);return m.useEffect(()=>{if(h){const v=document.body;return ay=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=ay,v.style.webkitUserSelect=ay}}},[h]),m.useEffect(()=>{if(u.current){const v=()=>{g(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var b;((b=document.getSelection())===null||b===void 0?void 0:b.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{u.current&&IZ(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Me(i,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Hf,he({},c,a,{onPointerDown:Me(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&g(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function Mg(e){return t=>t.pointerType==="touch"?void 0:e()}function IZ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const NZ=PZ,LZ=DZ,vk=kZ,W1=NZ,U1=LZ,Fm=H.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>O.jsx(vk,{ref:o,align:t,sideOffset:n,className:Ce("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}));Fm.displayName=vk.displayName;function FZ({card:e}){const{setCardInfo:t}=co();return O.jsxs(W1,{openDelay:0,children:[O.jsx(U1,{children:O.jsx(nQ,{className:"size-4 text-muted-foreground/40"})}),O.jsx(Fm,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:O.jsx(is,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:O.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}const q1=H.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>O.jsx("div",{style:n,className:Ce("relative w-full overflow-auto",t),children:O.jsx("table",{ref:o,className:Ce("w-full caption-bottom text-sm",e),...r})}));q1.displayName="Table";const G1=H.forwardRef(({className:e,...t},n)=>O.jsx("thead",{ref:n,className:Ce("[&_tr]:border-b",e),...t}));G1.displayName="TableHeader";const Y1=H.forwardRef(({className:e,...t},n)=>O.jsx("tbody",{ref:n,className:Ce("[&_tr:last-child]:border-0",e),...t}));Y1.displayName="TableBody";const jZ=H.forwardRef(({className:e,...t},n)=>O.jsx("tfoot",{ref:n,className:Ce("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));jZ.displayName="TableFooter";const yd=H.forwardRef(({className:e,...t},n)=>O.jsx("tr",{ref:n,className:Ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));yd.displayName="TableRow";const K1=H.forwardRef(({className:e,...t},n)=>O.jsx("th",{ref:n,className:Ce("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));K1.displayName="TableHead";const Ig=H.forwardRef(({className:e,...t},n)=>O.jsx("td",{ref:n,className:Ce("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ig.displayName="TableCell";const zZ=H.forwardRef(({className:e,...t},n)=>O.jsx("caption",{ref:n,className:Ce("mt-4 text-sm text-muted-foreground",e),...t}));zZ.displayName="TableCaption";/**
|
|
253
|
+
`),s=new Blob([i],{type:"text/csv"}),a=window.URL.createObjectURL(s),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",a),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return O.jsx(ZX,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function lQ({frame:e}){var S;const t=ke(C=>C.isDashboardEditing),n=ke(C=>C.filterValues),r=ke(C=>C.isVisualEditing),o=ke(C=>C.selectedSheetId);ke(C=>C.currentBreakpoint);const{removeFrame:i}=ke(C=>C.actions),s=ke(C=>C.actions.setIsVisualEditing),a=br(C=>C.actions.setFilterValues),l=br(C=>C.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:f}=br(C=>C.actions),h=br(C=>C.actions.setSelectedConnectionId),g=br(C=>C.actions.setSelectedDatamodelId),v=br(C=>C.actions.setSelectedDatabaseName),b=br(C=>C.actions.setSelectedSchemaName),w=br(C=>C.actions.setSelectedTableName),x=e.cards.find(C=>C.id===e.activeCardId);function _(){s(!r),c(x);const{dimensionKeys:C}=ar((x==null?void 0:x.data)||[]);f(C),u(e),x!=null&&x.connectionId&&h(x==null?void 0:x.connectionId),x!=null&&x.datamodelId&&x.datamodelId!=="none"&&(g(x==null?void 0:x.datamodelId),v("")),x!=null&&x.lastSelectedDatabase&&x.lastSelectedDatabase!=="none"&&(v(x==null?void 0:x.lastSelectedDatabase),g("")),x!=null&&x.lastSelectedSchema&&b(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&w(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return O.jsx("section",{className:"absolute right-2 top-2 z-10",children:O.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?O.jsx(EX,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):O.jsx(OX,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&O.jsx($$,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((S=x.preferences)==null?void 0:S.allowDownload)===!0&&O.jsx(aQ,{data:(x==null?void 0:x.data)||[],filename:x.title})]})})}function cQ(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const bx="dismissableLayer.update",uQ="dismissableLayer.pointerDownOutside",dQ="dismissableLayer.focusOutside";let cP;const fQ=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jf=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=m.useContext(fQ),[f,h]=m.useState(null),g=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),b=_t(t,k=>h(k)),w=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=w.indexOf(x),S=f?w.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,P=hQ(k=>{const I=k.target,$=[...u.branches].some(L=>L.contains(I));!E||$||(i==null||i(k),a==null||a(k),k.defaultPrevented||l==null||l())},g),A=pQ(k=>{const I=k.target;[...u.branches].some(L=>L.contains(I))||(s==null||s(k),a==null||a(k),k.defaultPrevented||l==null||l())},g);return cQ(k=>{S===u.layers.size-1&&(o==null||o(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},g),m.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(cP=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),uP(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=cP)}},[f,g,r,u]),m.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),uP())},[f,u]),m.useEffect(()=>{const k=()=>v({});return document.addEventListener(bx,k),()=>document.removeEventListener(bx,k)},[]),m.createElement(Qe.div,he({},c,{ref:b,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:Me(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Me(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Me(e.onPointerDownCapture,P.onPointerDownCapture)}))});function hQ(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){j$(uQ,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pQ(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&j$(dQ,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function uP(){const e=new CustomEvent(bx);document.dispatchEvent(e)}function j$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?PD(o,i):o.dispatchEvent(i)}const gQ=["top","right","bottom","left"],ca=Math.min,no=Math.max,Dg=Math.round,vp=Math.floor,ua=e=>({x:e,y:e}),mQ={left:"right",right:"left",bottom:"top",top:"bottom"},vQ={start:"end",end:"start"};function yx(e,t,n){return no(e,ca(t,n))}function ss(e,t){return typeof e=="function"?e(t):e}function as(e){return e.split("-")[0]}function iu(e){return e.split("-")[1]}function P1(e){return e==="x"?"y":"x"}function T1(e){return e==="y"?"height":"width"}function su(e){return["top","bottom"].includes(as(e))?"y":"x"}function D1(e){return P1(su(e))}function bQ(e,t,n){n===void 0&&(n=!1);const r=iu(e),o=D1(e),i=T1(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ag(s)),[s,Ag(s)]}function yQ(e){const t=Ag(e);return[xx(e),t,xx(t)]}function xx(e){return e.replace(/start|end/g,t=>vQ[t])}function xQ(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function wQ(e,t,n,r){const o=iu(e);let i=xQ(as(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(xx)))),i}function Ag(e){return e.replace(/left|right|bottom|top/g,t=>mQ[t])}function _Q(e){return{top:0,right:0,bottom:0,left:0,...e}}function z$(e){return typeof e!="number"?_Q(e):{top:e,right:e,bottom:e,left:e}}function $g(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function dP(e,t,n){let{reference:r,floating:o}=e;const i=su(t),s=D1(t),a=T1(s),l=as(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-o.width,y:f};break;default:g={x:r.x,y:r.y}}switch(iu(t)){case"start":g[s]-=h*(n&&c?-1:1);break;case"end":g[s]+=h*(n&&c?-1:1);break}return g}const SQ=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=dP(c,r,l),h=r,g={},v=0;for(let b=0;b<a.length;b++){const{name:w,fn:x}=a[b],{x:_,y:S,data:C,reset:E}=await x({x:u,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=_??u,f=S??f,g={...g,[w]:{...g[w],...C}},E&&v<=50){v++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:f}=dP(c,h,l)),b=-1;continue}}return{x:u,y:f,placement:h,strategy:o,middlewareData:g}};async function jd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=ss(t,e),v=z$(g),w=a[h?f==="floating"?"reference":"floating":f],x=$g(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=f==="floating"?{...s.floating,x:r,y:o}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),C=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=$g(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(x.top-E.top+v.top)/C.y,bottom:(E.bottom-x.bottom+v.bottom)/C.y,left:(x.left-E.left+v.left)/C.x,right:(E.right-x.right+v.right)/C.x}}const fP=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=ss(e,t)||{};if(c==null)return{};const f=z$(u),h={x:n,y:r},g=D1(o),v=T1(g),b=await s.getDimensions(c),w=g==="y",x=w?"top":"left",_=w?"bottom":"right",S=w?"clientHeight":"clientWidth",C=i.reference[v]+i.reference[g]-h[g]-i.floating[v],E=h[g]-i.reference[g],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=P?P[S]:0;(!A||!await(s.isElement==null?void 0:s.isElement(P)))&&(A=a.floating[S]||i.floating[v]);const k=C/2-E/2,I=A/2-b[v]/2-1,$=ca(f[x],I),L=ca(f[_],I),j=$,Q=A-b[v]-L,ee=A/2-b[v]/2+k,B=yx(j,ee,Q),Z=!l.arrow&&iu(o)!=null&&ee!=B&&i.reference[v]/2-(ee<j?$:L)-b[v]/2<0,G=Z?ee<j?ee-j:ee-Q:0;return{[g]:h[g]+G,data:{[g]:B,centerOffset:ee-B-G,...Z&&{alignmentOffset:G}},reset:Z}}}),CQ=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...w}=ss(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=as(o),_=as(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=h||(_||!b?[Ag(a)]:yQ(a));!h&&v!=="none"&&C.push(...wQ(a,b,v,S));const E=[a,...C],P=await jd(t,w),A=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&A.push(P[x]),f){const j=bQ(o,s,S);A.push(P[j[0]],P[j[1]])}if(k=[...k,{placement:o,overflows:A}],!A.every(j=>j<=0)){var I,$;const j=(((I=i.flip)==null?void 0:I.index)||0)+1,Q=E[j];if(Q)return{data:{index:j,overflows:k},reset:{placement:Q}};let ee=($=k.filter(B=>B.overflows[0]<=0).sort((B,Z)=>B.overflows[1]-Z.overflows[1])[0])==null?void 0:$.placement;if(!ee)switch(g){case"bestFit":{var L;const B=(L=k.map(Z=>[Z.placement,Z.overflows.filter(G=>G>0).reduce((G,q)=>G+q,0)]).sort((Z,G)=>Z[1]-G[1])[0])==null?void 0:L[0];B&&(ee=B);break}case"initialPlacement":ee=a;break}if(o!==ee)return{reset:{placement:ee}}}return{}}}};function hP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pP(e){return gQ.some(t=>e[t]>=0)}const EQ=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ss(e,t);switch(r){case"referenceHidden":{const i=await jd(t,{...o,elementContext:"reference"}),s=hP(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:pP(s)}}}case"escaped":{const i=await jd(t,{...o,altBoundary:!0}),s=hP(i,n.floating);return{data:{escapedOffsets:s,escaped:pP(s)}}}default:return{}}}}};async function RQ(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=as(n),a=iu(n),l=su(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,f=ss(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*u,y:h*c}:{x:h*c,y:g*u}}const OQ=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await RQ(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},PQ=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:w=>{let{x,y:_}=w;return{x,y:_}}},...l}=ss(e,t),c={x:n,y:r},u=await jd(t,l),f=su(as(o)),h=P1(f);let g=c[h],v=c[f];if(i){const w=h==="y"?"top":"left",x=h==="y"?"bottom":"right",_=g+u[w],S=g-u[x];g=yx(_,g,S)}if(s){const w=f==="y"?"top":"left",x=f==="y"?"bottom":"right",_=v+u[w],S=v-u[x];v=yx(_,v,S)}const b=a.fn({...t,[h]:g,[f]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},TQ=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ss(e,t),u={x:n,y:r},f=su(o),h=P1(f);let g=u[h],v=u[f];const b=ss(a,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const S=h==="y"?"height":"width",C=i.reference[h]-i.floating[S]+w.mainAxis,E=i.reference[h]+i.reference[S]-w.mainAxis;g<C?g=C:g>E&&(g=E)}if(c){var x,_;const S=h==="y"?"width":"height",C=["top","left"].includes(as(o)),E=i.reference[f]-i.floating[S]+(C&&((x=s.offset)==null?void 0:x[f])||0)+(C?0:w.crossAxis),P=i.reference[f]+i.reference[S]+(C?0:((_=s.offset)==null?void 0:_[f])||0)-(C?w.crossAxis:0);v<E?v=E:v>P&&(v=P)}return{[h]:g,[f]:v}}}},DQ=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=ss(e,t),l=await jd(t,a),c=as(n),u=iu(n),f=su(n)==="y",{width:h,height:g}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(b=c,v=u==="end"?"top":"bottom");const w=g-l[v],x=h-l[b],_=!t.middlewareData.shift;let S=w,C=x;if(f){const P=h-l.left-l.right;C=u||_?ca(x,P):P}else{const P=g-l.top-l.bottom;S=u||_?ca(w,P):P}if(_&&!u){const P=no(l.left,0),A=no(l.right,0),k=no(l.top,0),I=no(l.bottom,0);f?C=h-2*(P!==0||A!==0?P+A:no(l.left,l.right)):S=g-2*(k!==0||I!==0?k+I:no(l.top,l.bottom))}await s({...t,availableWidth:C,availableHeight:S});const E=await o.getDimensions(i.floating);return h!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function da(e){return B$(e)?(e.nodeName||"").toLowerCase():"#document"}function so(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ds(e){var t;return(t=(B$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function B$(e){return e instanceof Node||e instanceof so(e).Node}function ls(e){return e instanceof Element||e instanceof so(e).Element}function Si(e){return e instanceof HTMLElement||e instanceof so(e).HTMLElement}function gP(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof so(e).ShadowRoot}function zf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$o(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function AQ(e){return["table","td","th"].includes(da(e))}function A1(e){const t=$1(),n=$o(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function $Q(e){let t=Yc(e);for(;Si(t)&&!km(t);){if(A1(t))return t;t=Yc(t)}return null}function $1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function km(e){return["html","body","#document"].includes(da(e))}function $o(e){return so(e).getComputedStyle(e)}function Mm(e){return ls(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Yc(e){if(da(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gP(e)&&e.host||ds(e);return gP(t)?t.host:t}function V$(e){const t=Yc(e);return km(t)?e.ownerDocument?e.ownerDocument.body:e.body:Si(t)&&zf(t)?t:V$(t)}function zd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=V$(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=so(o);return i?t.concat(s,s.visualViewport||[],zf(o)?o:[],s.frameElement&&n?zd(s.frameElement):[]):t.concat(o,zd(o,[],n))}function H$(e){const t=$o(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Si(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Dg(n)!==i||Dg(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function k1(e){return ls(e)?e:e.contextElement}function yc(e){const t=k1(e);if(!Si(t))return ua(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=H$(t);let s=(i?Dg(n.width):n.width)/r,a=(i?Dg(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const kQ=ua(0);function W$(e){const t=so(e);return!$1()||!t.visualViewport?kQ:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function MQ(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==so(e)?!1:t}function ml(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=k1(e);let s=ua(1);t&&(r?ls(r)&&(s=yc(r)):s=yc(e));const a=MQ(i,n,r)?W$(i):ua(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const h=so(i),g=r&&ls(r)?so(r):r;let v=h.frameElement;for(;v&&r&&g!==h;){const b=yc(v),w=v.getBoundingClientRect(),x=$o(v),_=w.left+(v.clientLeft+parseFloat(x.paddingLeft))*b.x,S=w.top+(v.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,f*=b.y,l+=_,c+=S,v=so(v).frameElement}}return $g({width:u,height:f,x:l,y:c})}function IQ(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Si(n),i=ds(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=ua(1);const l=ua(0);if((o||!o&&r!=="fixed")&&((da(n)!=="body"||zf(i))&&(s=Mm(n)),Si(n))){const c=ml(n);a=yc(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function NQ(e){return Array.from(e.getClientRects())}function U$(e){return ml(ds(e)).left+Mm(e).scrollLeft}function LQ(e){const t=ds(e),n=Mm(e),r=e.ownerDocument.body,o=no(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=no(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+U$(e);const a=-n.scrollTop;return $o(r).direction==="rtl"&&(s+=no(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function FQ(e,t){const n=so(e),r=ds(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=$1();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function jQ(e,t){const n=ml(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Si(e)?yc(e):ua(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function mP(e,t,n){let r;if(t==="viewport")r=FQ(e,n);else if(t==="document")r=LQ(ds(e));else if(ls(t))r=jQ(t,n);else{const o=W$(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return $g(r)}function q$(e,t){const n=Yc(e);return n===t||!ls(n)||km(n)?!1:$o(n).position==="fixed"||q$(n,t)}function zQ(e,t){const n=t.get(e);if(n)return n;let r=zd(e,[],!1).filter(a=>ls(a)&&da(a)!=="body"),o=null;const i=$o(e).position==="fixed";let s=i?Yc(e):e;for(;ls(s)&&!km(s);){const a=$o(s),l=A1(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||zf(s)&&!l&&q$(e,s))?r=r.filter(u=>u!==s):o=a,s=Yc(s)}return t.set(e,r),r}function BQ(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?zQ(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=mP(t,u,o);return c.top=no(f.top,c.top),c.right=ca(f.right,c.right),c.bottom=ca(f.bottom,c.bottom),c.left=no(f.left,c.left),c},mP(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function VQ(e){return H$(e)}function HQ(e,t,n){const r=Si(t),o=ds(t),i=n==="fixed",s=ml(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=ua(0);if(r||!r&&!i)if((da(t)!=="body"||zf(o))&&(a=Mm(t)),r){const c=ml(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=U$(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function vP(e,t){return!Si(e)||$o(e).position==="fixed"?null:t?t(e):e.offsetParent}function G$(e,t){const n=so(e);if(!Si(e))return n;let r=vP(e,t);for(;r&&AQ(r)&&$o(r).position==="static";)r=vP(r,t);return r&&(da(r)==="html"||da(r)==="body"&&$o(r).position==="static"&&!A1(r))?n:r||$Q(e)||n}const WQ=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||G$,i=this.getDimensions;return{reference:HQ(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function UQ(e){return $o(e).direction==="rtl"}const qQ={convertOffsetParentRelativeRectToViewportRelativeRect:IQ,getDocumentElement:ds,getClippingRect:BQ,getOffsetParent:G$,getElementRects:WQ,getClientRects:NQ,getDimensions:VQ,getScale:yc,isElement:ls,isRTL:UQ};function GQ(e,t){let n=null,r;const o=ds(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:f,height:h}=e.getBoundingClientRect();if(a||t(),!f||!h)return;const g=vp(u),v=vp(o.clientWidth-(c+f)),b=vp(o.clientHeight-(u+h)),w=vp(c),_={rootMargin:-g+"px "+-v+"px "+-b+"px "+-w+"px",threshold:no(0,ca(1,l))||1};let S=!0;function C(E){const P=E[0].intersectionRatio;if(P!==l){if(!S)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(C,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return s(!0),i}function YQ(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=k1(e),u=o||i?[...c?zd(c):[],...zd(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=c&&a?GQ(c,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(x=>{let[_]=x;_&&_.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{g&&g.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let v,b=l?ml(e):null;l&&w();function w(){const x=ml(e);b&&(x.x!==b.x||x.y!==b.y||x.width!==b.width||x.height!==b.height)&&n(),b=x,v=requestAnimationFrame(w)}return n(),()=>{u.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f&&f(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(v)}}const KQ=(e,t,n)=>{const r=new Map,o={platform:qQ,...n},i={...o.platform,_c:r};return SQ(e,t,{...o,platform:i})},XQ=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?fP({element:r.current,padding:o}).fn(n):{}:r?fP({element:r,padding:o}).fn(n):{}}}};var ig=typeof document<"u"?m.useLayoutEffect:m.useEffect;function kg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!kg(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!kg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Y$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bP(e,t){const n=Y$(e);return Math.round(t*n)/n}function yP(e){const t=H.useRef(e);return ig(()=>{t.current=e}),t}function QQ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=H.useState(r);kg(h,r)||g(r);const[v,b]=H.useState(null),[w,x]=H.useState(null),_=H.useCallback(Z=>{Z!=P.current&&(P.current=Z,b(Z))},[b]),S=H.useCallback(Z=>{Z!==A.current&&(A.current=Z,x(Z))},[x]),C=i||v,E=s||w,P=H.useRef(null),A=H.useRef(null),k=H.useRef(u),I=yP(l),$=yP(o),L=H.useCallback(()=>{if(!P.current||!A.current)return;const Z={placement:t,strategy:n,middleware:h};$.current&&(Z.platform=$.current),KQ(P.current,A.current,Z).then(G=>{const q={...G,isPositioned:!0};j.current&&!kg(k.current,q)&&(k.current=q,pw.flushSync(()=>{f(q)}))})},[h,t,n,$]);ig(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(Z=>({...Z,isPositioned:!1})))},[c]);const j=H.useRef(!1);ig(()=>(j.current=!0,()=>{j.current=!1}),[]),ig(()=>{if(C&&(P.current=C),E&&(A.current=E),C&&E){if(I.current)return I.current(C,E,L);L()}},[C,E,L,I]);const Q=H.useMemo(()=>({reference:P,floating:A,setReference:_,setFloating:S}),[_,S]),ee=H.useMemo(()=>({reference:C,floating:E}),[C,E]),B=H.useMemo(()=>{const Z={position:n,left:0,top:0};if(!ee.floating)return Z;const G=bP(ee.floating,u.x),q=bP(ee.floating,u.y);return a?{...Z,transform:"translate("+G+"px, "+q+"px)",...Y$(ee.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:q}},[n,a,ee.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:L,refs:Q,elements:ee,floatingStyles:B}),[u,L,Q,ee,B])}function Im(e){const[t,n]=m.useState(void 0);return ur(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const K$="Popper",[X$,Ti]=Zn(K$),[JQ,Q$]=X$(K$),ZQ=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(JQ,{scope:t,anchor:r,onAnchorChange:o},n)},eJ="PopperAnchor",tJ=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Q$(eJ,n),s=m.useRef(null),a=_t(t,s);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(Qe.div,he({},o,{ref:a}))}),J$="PopperContent",[nJ,dye]=X$(J$),rJ=m.forwardRef((e,t)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:h=0,align:g="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:w=!0,collisionBoundary:x=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:P,...A}=e,k=Q$(J$,u),[I,$]=m.useState(null),L=_t(t,Pe=>$(Pe)),[j,Q]=m.useState(null),ee=Im(j),B=(n=ee==null?void 0:ee.width)!==null&&n!==void 0?n:0,Z=(r=ee==null?void 0:ee.height)!==null&&r!==void 0?r:0,G=f+(g!=="center"?"-"+g:""),q=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},K=Array.isArray(x)?x:[x],T=K.length>0,V={padding:q,boundary:K.filter(oJ),altBoundary:T},{refs:X,floatingStyles:N,placement:ie,isPositioned:fe,middlewareData:ue}=QQ({strategy:"fixed",placement:G,whileElementsMounted:(...Pe)=>YQ(...Pe,{animationFrame:E==="always"}),elements:{reference:k.anchor},middleware:[OQ({mainAxis:h+Z,alignmentAxis:v}),w&&PQ({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?TQ():void 0,...V}),w&&CQ({...V}),DQ({...V,apply:({elements:Pe,rects:Te,availableWidth:Ue,availableHeight:Be})=>{const{width:Ie,height:Ke}=Te.reference,lt=Pe.floating.style;lt.setProperty("--radix-popper-available-width",`${Ue}px`),lt.setProperty("--radix-popper-available-height",`${Be}px`),lt.setProperty("--radix-popper-anchor-width",`${Ie}px`),lt.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),j&&XQ({element:j,padding:b}),iJ({arrowWidth:B,arrowHeight:Z}),C&&EQ({strategy:"referenceHidden",...V})]}),[pe,se]=Z$(ie),ne=Ln(P);ur(()=>{fe&&(ne==null||ne())},[fe,ne]);const le=(o=ue.arrow)===null||o===void 0?void 0:o.x,ye=(i=ue.arrow)===null||i===void 0?void 0:i.y,Y=((s=ue.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[be,_e]=m.useState();return ur(()=>{I&&_e(window.getComputedStyle(I).zIndex)},[I]),m.createElement("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:fe?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(a=ue.transformOrigin)===null||a===void 0?void 0:a.x,(l=ue.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(nJ,{scope:u,placedSide:pe,onArrowChange:Q,arrowX:le,arrowY:ye,shouldHideArrow:Y},m.createElement(Qe.div,he({"data-side":pe,"data-align":se},A,{ref:L,style:{...A.style,animation:fe?void 0:"none",opacity:(c=ue.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function oJ(e){return e!==null}const iJ=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,h=f?0:e.arrowWidth,g=f?0:e.arrowHeight,[v,b]=Z$(a),w={start:"0%",center:"50%",end:"100%"}[b],x=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+h/2,_=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+g/2;let S="",C="";return v==="bottom"?(S=f?w:`${x}px`,C=`${-g}px`):v==="top"?(S=f?w:`${x}px`,C=`${l.floating.height+g}px`):v==="right"?(S=`${-g}px`,C=f?w:`${_}px`):v==="left"&&(S=`${l.floating.width+g}px`,C=f?w:`${_}px`),{data:{x:S,y:C}}}});function Z$(e){const[t,n="center"]=e.split("-");return[t,n]}const Bf=ZQ,Vf=tJ,Hf=rJ,M1=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?Mo.createPortal(m.createElement(Qe.div,he({},o,{ref:t})),r):null}),sJ=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(aJ);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(wx,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(wx,he({},r,{ref:t}),n)});sJ.displayName="Slot";const wx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...lJ(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});wx.displayName="SlotClone";const ek=({children:e})=>m.createElement(m.Fragment,null,e);function aJ(e){return m.isValidElement(e)&&e.type===ek}function lJ(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const tk=m.forwardRef((e,t)=>m.createElement(Qe.span,he({},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}}))),cJ=tk,[Nm,fye]=Zn("Tooltip",[Ti]),I1=Ti(),uJ="TooltipProvider",dJ=700,_x="tooltip.open",[fJ,N1]=Nm(uJ),hJ=e=>{const{__scopeTooltip:t,delayDuration:n=dJ,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(fJ,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:o},i)},L1="Tooltip",[pJ,Lm]=Nm(L1),gJ=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=N1(L1,e.__scopeTooltip),c=I1(t),[u,f]=m.useState(null),h=Jo(),g=m.useRef(0),v=s??l.disableHoverableContent,b=a??l.delayDuration,w=m.useRef(!1),[x=!1,_]=wr({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(_x))):l.onClose(),i==null||i(A)}}),S=m.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),C=m.useCallback(()=>{window.clearTimeout(g.current),w.current=!1,_(!0)},[_]),E=m.useCallback(()=>{window.clearTimeout(g.current),_(!1)},[_]),P=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{w.current=!0,_(!0)},b)},[b,_]);return m.useEffect(()=>()=>window.clearTimeout(g.current),[]),m.createElement(Bf,c,m.createElement(pJ,{scope:t,contentId:h,open:x,stateAttribute:S,trigger:u,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?P():C()},[l.isOpenDelayed,P,C]),onTriggerLeave:m.useCallback(()=>{v?E():window.clearTimeout(g.current)},[E,v]),onOpen:C,onClose:E,disableHoverableContent:v},n))},xP="TooltipTrigger",nk=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Lm(xP,n),i=N1(xP,n),s=I1(n),a=m.useRef(null),l=_t(t,a,o.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(Vf,he({asChild:!0},s),m.createElement(Qe.button,he({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:Me(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Me(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Me(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Me(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Me(e.onBlur,o.onClose),onClick:Me(e.onClick,o.onClose)})))}),mJ="TooltipPortal",[hye,vJ]=Nm(mJ,{forceMount:void 0}),Bd="TooltipContent",bJ=m.forwardRef((e,t)=>{const n=vJ(Bd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Lm(Bd,e.__scopeTooltip);return m.createElement(er,{present:r||s.open},s.disableHoverableContent?m.createElement(rk,he({side:o},i,{ref:t})):m.createElement(yJ,he({side:o},i,{ref:t})))}),yJ=m.forwardRef((e,t)=>{const n=Lm(Bd,e.__scopeTooltip),r=N1(Bd,e.__scopeTooltip),o=m.useRef(null),i=_t(t,o),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,h=m.useCallback(()=>{a(null),f(!1)},[f]),g=m.useCallback((v,b)=>{const w=v.currentTarget,x={x:v.clientX,y:v.clientY},_=wJ(x,w.getBoundingClientRect()),S=_J(x,_),C=SJ(b.getBoundingClientRect()),E=EJ([...S,...C]);a(E),f(!0)},[f]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(l&&u){const v=w=>g(w,u),b=w=>g(w,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",b)}}},[l,u,g,h]),m.useEffect(()=>{if(s){const v=b=>{const w=b.target,x={x:b.clientX,y:b.clientY},_=(l==null?void 0:l.contains(w))||(u==null?void 0:u.contains(w)),S=!CJ(x,s);_?h():S&&(h(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,s,c,h]),m.createElement(rk,he({},e,{ref:i}))}),[xJ,pye]=Nm(L1,{isInside:!1}),rk=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Lm(Bd,n),c=I1(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(_x,u),()=>document.removeEventListener(_x,u)),[u]),m.useEffect(()=>{if(l.trigger){const f=h=>{const g=h.target;g!=null&&g.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u},m.createElement(Hf,he({"data-state":l.stateAttribute},c,a,{ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),m.createElement(ek,null,r),m.createElement(xJ,{scope:n,isInside:!0},m.createElement(cJ,{id:l.contentId,role:"tooltip"},o||r))))});function wJ(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function _J(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 SJ(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function CJ(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function EJ(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),RJ(t)}function RJ(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const OJ=hJ,PJ=gJ,TJ=nk,ok=bJ,DJ=OJ,ik=PJ,sk=TJ,F1=H.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(ok,{ref:r,sideOffset:t,className:Ce("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}));F1.displayName=ok.displayName;function ll({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const c=t;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&i==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&i==="en-IN"?(s=1e5,a="L"):e>=1e6?(s=1e6,a="M"):e>=1e3&&(s=1e3,a="K"));const u=e/s,f={maximumFractionDigits:c,minimumFractionDigits:c};if(o){f.style="currency",f.currency=o;try{new Intl.NumberFormat(i,f).format(0)}catch{f.currency="USD"}}try{new Intl.NumberFormat(i,f).format(0)}catch{l="en-US"}let g=new Intl.NumberFormat(l,f).format(u);return n&&(g+=a),g}function ak(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function lk({card:e}){var w,x,_,S,C,E,P,A,k,I,$,L,j,Q,ee,B,Z,G,q,K,T,V,X,N;const t=ke(ie=>ie.actions.setCardTitle),n=ke(ie=>ie.actions.setCardDescription),r=ke(ie=>ie.isVisualEditing),o=br(ie=>ie.card),i=br(ie=>ie.actions.setCard);br(ie=>ie.actions.setNumberFormat);const s=ke(ie=>ie.selectedSheetId),a=e.data,l=(x=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:x.colorRanges,{metricKeys:c}=ar(a||[]),u=(_=a==null?void 0:a[0])==null?void 0:_[c==null?void 0:c[0]],f=(S=a==null?void 0:a[0])==null?void 0:S[c==null?void 0:c[1]],h=!!e.data&&e.data.length>0;function g(ie){r?i({...o,title:ie}):t(s,e.id,ie)}function v(ie){r?i({...o,description:ie}):n(s,e.id,ie)}const b=f&&f-u!==0?(u-f)/f:null;return O.jsxs("div",{className:"kpi-card flex grow flex-col overflow-scroll",children:[O.jsxs(lm,{className:"grow pb-3",children:[O.jsx(is,{text:r?o.title:e.title,onSave:g,children:O.jsx("div",{className:"flex items-center gap-2",children:O.jsx(Af,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),h&&O.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[O.jsx("p",{style:{color:ak(u,l)},className:"text-3xl font-semibold",children:ll({number:u,decimalPlaces:((E=(C=e.preferences)==null?void 0:C.formatNumber)==null?void 0:E.decimalPlaces)||0,useSuffix:!!((A=(P=e.preferences)==null?void 0:P.formatNumber)!=null&&A.suffix),customSuffix:((I=(k=e.preferences)==null?void 0:k.formatNumber)==null?void 0:I.suffix)||"",locale:((L=($=e.preferences)==null?void 0:$.formatNumber)==null?void 0:L.locale)||"",currency:((Q=(j=e.preferences)==null?void 0:j.formatNumber)==null?void 0:Q.currency)||""})}),f&&O.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",ll({number:f,decimalPlaces:((B=(ee=e.preferences)==null?void 0:ee.formatNumber)==null?void 0:B.decimalPlaces)||0,useSuffix:!!((G=(Z=e.preferences)==null?void 0:Z.formatNumber)!=null&&G.suffix),customSuffix:((K=(q=e.preferences)==null?void 0:q.formatNumber)==null?void 0:K.suffix)||"",locale:((V=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:V.locale)||"",currency:((N=(X=e.preferences)==null?void 0:X.formatNumber)==null?void 0:N.currency)||""})]})]})]}),b&&O.jsxs(cm,{className:"grow items-start gap-1 pb-4 text-sm",children:[O.jsx(AJ,{children:b}),O.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[b>0?"up ":"down ",O.jsx(is,{text:e.description||"",onSave:v,children:e.description})]})]})]})}function AJ({children:e}){const t=e>0?O.jsx(C1,{className:"h-4 w-4"}):O.jsx(S1,{className:"h-4 w-4"}),n=`${Math.abs(e*100).toFixed(0)}%`;return O.jsxs("div",{className:Ce("flex items-center",{"text-green-600":e>0,"text-destructive":e<0}),children:[t,O.jsx("span",{className:"ml-[1px]",children:n})]})}var Kc=1e3,Xc=Kc*60,Qc=Xc*60,vl=Qc*24,$J=vl*7,kJ=vl*365.25,MJ=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return IJ(e);if(n==="number"&&isFinite(e))return t.long?LJ(e):NJ(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function IJ(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*kJ;case"weeks":case"week":case"w":return n*$J;case"days":case"day":case"d":return n*vl;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Qc;case"minutes":case"minute":case"mins":case"min":case"m":return n*Xc;case"seconds":case"second":case"secs":case"sec":case"s":return n*Kc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function NJ(e){var t=Math.abs(e);return t>=vl?Math.round(e/vl)+"d":t>=Qc?Math.round(e/Qc)+"h":t>=Xc?Math.round(e/Xc)+"m":t>=Kc?Math.round(e/Kc)+"s":e+"ms"}function LJ(e){var t=Math.abs(e);return t>=vl?bp(e,t,vl,"day"):t>=Qc?bp(e,t,Qc,"hour"):t>=Xc?bp(e,t,Xc,"minute"):t>=Kc?bp(e,t,Kc,"second"):e+" ms"}function bp(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const FJ=nu(MJ);function ck({children:e}){const{setIsSessionExpired:t}=co(),n=new eB({queryCache:new bD({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return O.jsx(oB,{client:n,children:e})}const au=m.forwardRef(({children:e,className:t,...n},r)=>O.jsx("div",{className:Ce("semaphor-scope",t),ref:r,...n,children:e})),jJ={id:"",authToken:void 0},uk=m.createContext(jJ),dk=({children:e,dashboardProps:t})=>O.jsx(ck,{children:O.jsx(uk.Provider,{value:t,children:O.jsx(au,{style:{height:"100%"},children:e})})});function ma(){const e=m.useContext(uk);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function zJ(e){ke(l=>l.bookmarkKey),ke(l=>l.selectedSheetId);const t=ke(l=>l.dashboard.baseQueries);ke(l=>l.actions.getCardSheet),ke(l=>l.actions.getSelectedFrame());const{authToken:n}=ma(),r=ke(l=>l.authToken),o=ke(l=>l.filterValues),i=FJ((e==null?void 0:e.refreshInterval)||"0"),s=Q2(e.sql,t);return Df({queryKey:[e.id,s,JSON.stringify(o)],queryFn:()=>Of("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:s,python:e.python===uD?"":e.python,active_filters:o}),refetchInterval:i,enabled:!!e.connectionId})}function Ia({data:e,cfg:t,customCfg:n,preferences:r}){const{dimensionKeys:o,metricKeys:i}=ar(e),s=HX(i,e,r),a=og(s,n),l=o[0],c=mx(e,l);j1(r,t),fk(r);const u=hk(t,r),f=qo((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions),h=qo(u,f),g=qo(h,(n==null?void 0:n.options)||{});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:a},options:g}}function j1(e,t){var o,i,s;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((s=e==null?void 0:e.chartOptions)==null?void 0:s.indexAxis)==="x"?"y":"x":n}function fk(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 hk(e,t){var i,s,a,l,c,u,f,h,g,v,b,w;const n=j1(t,e),r=fk(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.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 _,S,C,E;return ll({number:Number(x),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}},[r]:{...(g=(h=(f=e==null?void 0:e.options)==null?void 0:f.scales)==null?void 0:h[r])==null?void 0:g.ticks,callback:null}},plugins:{...(v=e==null?void 0:e.options)==null?void 0:v.plugins,datalabels:{...(w=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:w.datalabels,formatter:function(x){var _,S,C,E;return ll({number:Number(x),decimalPlaces:((_=t==null?void 0:t.numberAxisFormat)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((S=t==null?void 0:t.numberAxisFormat)!=null&&S.suffix),customSuffix:"",locale:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.locale)||"",currency:((E=t==null?void 0:t.numberAxisFormat)==null?void 0:E.currency)||""})}}}}}function BJ(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function VJ(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}}}}}function HJ(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function WJ(e,t=!1){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}}}}}function UJ(e,t){var r,o,i,s;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(o=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:o.x,display:!0,stacked:!0},y:{...(s=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:s.y,display:!0,stacked:t==="stackedBar"}}}}}function qJ(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function GJ(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:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function YJ(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function KJ(e){const n=new Function("getDatalabelColor",e)(E0);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}function z1({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s}){var a,l,c;if(t==="bar"){const u=HJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const u=BJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pyramid"){const u=VJ(n),{dimensionKeys:f,metricKeys:h}=ar(e),g=Tg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:h[0]}),v=Ia({data:g,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s}),b="x2";return{...v,data:{...v.data,datasets:v.data.datasets.map((x,_)=>_===1?{...x,xAxisID:b}:x)},options:{...v.options,scales:{...(a=v==null?void 0:v.options)==null?void 0:a.scales,[b]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const u=UJ(n,t),{dimensionKeys:f,metricKeys:h}=ar(e),g=Tg({dataArray:e,groupKey:f[0],pivotKey:f[1],valueKey:h[0]});return Ia({data:g,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const u=qJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="range"){const u=WJ(n),f=qX(e),h=og(f,r),{plugins:g,options:v}=KJ((s==null?void 0:s.customVisualCode)||""),b=qo((u==null?void 0:u.options)||{},(n==null?void 0:n.options)||{}),w=qo(b,(s==null?void 0:s.chartOptions)||{}),x=qo(w,(r==null?void 0:r.options)||{}),_=qo(x,v),S=hk(n,s),C=qo(_,S),E={...C,plugins:{...C==null?void 0:C.plugins,datalabels:{...(l=C==null?void 0:C.plugins)==null?void 0:l.datalabels,formatter:($,L)=>$.map(Q=>{var ee,B,Z,G;return ll({number:Number(Q),decimalPlaces:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.decimalPlaces)||0,useSuffix:!!((B=s==null?void 0:s.numberAxisFormat)!=null&&B.suffix),customSuffix:"",locale:((Z=s==null?void 0:s.numberAxisFormat)==null?void 0:Z.locale)||"",currency:((G=s==null?void 0:s.numberAxisFormat)==null?void 0:G.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:P}=ar(e),A=P[0];return{type:"bar",data:{labels:[...new Set(mx(e,A))],datasets:h},options:E,plugins:[...g]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const u=GJ(t,n),{dimensionKeys:f,metricKeys:h}=ar(e),g=GX(h,e),v=og(g,r),b=f[0],w=mx(e,b),x=qo((u==null?void 0:u.options)||{},(r==null?void 0:r.options)||{}),_=qo(x,(s==null?void 0:s.chartOptions)||{}),S={..._,plugins:{..._.plugins,datalabels:{...(c=_.plugins)==null?void 0:c.datalabels,formatter:(P,A)=>{var k,I,$,L;return ll({number:Number(P),decimalPlaces:((k=s==null?void 0:s.numberAxisFormat)==null?void 0:k.decimalPlaces)||0,useSuffix:!!((I=s==null?void 0:s.numberAxisFormat)!=null&&I.suffix),customSuffix:"",locale:(($=s==null?void 0:s.numberAxisFormat)==null?void 0:$.locale)||"",currency:((L=s==null?void 0:s.numberAxisFormat)==null?void 0:L.currency)||""})}}}};return{type:t,data:{labels:w,datasets:v},options:S,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(P,A,k){var Z,G,q,K;const{ctx:I,data:$}=P;I.save();const L=P.getDatasetMeta(0).data[0].x,j=P.getDatasetMeta(0).data[0].y,Q=Bc(Pd());I.font="1.2rem Arial",I.fontWeight="bolder",I.fillStyle=Q,I.textAlign="center",I.textBaseline="middle";const ee=$.datasets[0].data.reduce((T,V)=>T+V,0),B=ll({number:Number(ee),decimalPlaces:((Z=s==null?void 0:s.numberAxisFormat)==null?void 0:Z.decimalPlaces)||0,useSuffix:!!((G=s==null?void 0:s.numberAxisFormat)!=null&&G.suffix),customSuffix:"",locale:((q=s==null?void 0:s.numberAxisFormat)==null?void 0:q.locale)||"",currency:((K=s==null?void 0:s.numberAxisFormat)==null?void 0:K.currency)||""});I.fillText(B,L,j)}}:""]}}if(t==="radar"){const u=YJ(n);return Ia({data:e,cfg:u,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:u}=ar(e);if(u.length<3){console.log("Bubble charts require 3 numeric columns");return}const f=UX(e),h=og(f,r),g={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:u[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:u[1]},beginAtZero:!0,ticks:{precision:0}}}},v=qo(g,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:h},options:v}}return Ia({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function XJ({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=ke.getState().theme;if(!o)return;const a=s==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&JJ(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&ZJ(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&QJ({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function QJ(e){var a,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:s}=e;i?(l=(a=t==null?void 0:t.data)==null?void 0:a.datasets)==null||l.forEach((f,h)=>{var g,v;typeof f.backgroundColor=="string"&&(f.backgroundColor=new Array(f.data.length).fill(f.backgroundColor),f.borderColor=new Array(f.data.length).fill(f.borderColor)),f.backgroundColor=(g=f==null?void 0:f.backgroundColor)==null?void 0:g.map((b,w)=>w===n&&h===r?b:s),f.borderColor=(v=f==null?void 0:f.borderColor)==null?void 0:v.map((b,w)=>w===n&&h===r?b:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((f,h)=>{var g,v,b,w,x,_;f.backgroundColor=new Array(f.data.length).fill((b=(v=(g=o==null?void 0:o.data)==null?void 0:g.datasets)==null?void 0:v[h])==null?void 0:b.backgroundColor),f.borderColor=new Array(f.data.length).fill((_=(x=(w=o==null?void 0:o.data)==null?void 0:w.datasets)==null?void 0:x[h])==null?void 0:_.borderColor)}),t==null||t.update()}function JJ(e,t,n,r,o){var i,s,a,l;console.log("clicked index",t),r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,f;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,g)=>g===t?h:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((h,g)=>g===t?h:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,h,g,v,b,w;c.backgroundColor=new Array(c.data.length).fill((g=(h=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:h[u])==null?void 0:g.backgroundColor),c.borderColor=new Array(c.data.length).fill((w=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:w.borderColor)}),e==null||e.update()}function ZJ(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,f;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((h,g)=>g===t?h:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((h,g)=>g===t?h:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,h,g,v,b,w,x,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(g=(h=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:h[u])==null?void 0:g.backgroundColor,c.borderColor=(w=(b=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:b[u])==null?void 0:w.borderColor),c.backgroundColor=(x=c==null?void 0:c.backgroundColor)==null?void 0:x.map((S,C)=>{var E;return(E=n.data.datasets[u].backgroundColor)==null?void 0:E[C]}),c.borderColor=(_=c==null?void 0:c.borderColor)==null?void 0:_.map((S,C)=>{var E;return(E=n.data.datasets[u].borderColor)==null?void 0:E[C]})}),e==null||e.update()}function eZ(e,t,n,r){var o,i;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=ar(e.data);if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const l=s[0],c=(o=e.data[n])==null?void 0:o[l];return[{columnName:l,columnValue:c,metric:a[t],value:r}]}if(["stackedBar","pyramid"].includes(e.type)){const l=Tg({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),c=s[0],u=(i=l[n])==null?void 0:i[c],f=s[1],{metricKeys:h}=ar(l),g=h[t];return[{columnName:c,columnValue:u,metric:a[0],value:r},{columnName:f,columnValue:g,metric:a[0],value:r}]}if(e.type==="bubble"||e.type==="scatter"){const l=s[0],c=r.label;return[{columnName:l,columnValue:c,metric1:a[0],value1:r.x,metric2:a[1],value2:r.y,metric3:a==null?void 0:a[2],value3:r==null?void 0:r.r}]}}catch(s){console.error("Error in getAdhocFilter",s)}}function tZ(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=co(),r=n(e),o=B1(r||t),i={...r,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[]};return{...o,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[],card:i}}function B1(e){var ee,B,Z,G;const{onChartElementClicked:t}=ma(),[n,r]=m.useState(0),o=((ee=e==null?void 0:e.preferences)==null?void 0:ee.filterOnClickColumnIndex)===void 0?0:(B=e.preferences)==null?void 0:B.filterOnClickColumnIndex,i=ke(q=>q.bookmarkKey);ke(q=>q.isVisualEditing);const s=ke(q=>q.filteringCards),a=ke(q=>q.selectedSheetId);ke(q=>q.selectedCardId),ke(q=>q.isDashboardEditing);const l=ke(q=>q.themeStyle),c=ke(q=>q.filterValues),u=m.useRef(c),f=(Z=e==null?void 0:e.preferences)==null?void 0:Z.onClickFilter,{addFrame:h,addFilteringCard:g,setFrameCardData:v,getCardFrame:b,addOrUpdateFilterValue:w,addOrUpdateFilterValues:x,removeFilterValue:_,removeFilteringCard:S}=co(),{data:C,isLoading:E,isFetching:P,isError:A,refetch:k}=zJ(e),I=s==null?void 0:s.find(q=>q.id===e.id),$=((G=b(e.id))==null?void 0:G.cards)||[],L=($==null?void 0:$.length)==1;let j;e.data&&e.data.length>0&&(j=z1({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences})),m.useEffect(()=>{!C||!C.records||I&&L||(console.log("I am firing"),v(a,e.id,(C==null?void 0:C.records)||[]))},[C,a,e.id,v,c]),m.useEffect(()=>{e.data&&(I&&L||r(n+1))},[JSON.stringify(e.data),e.type,e.cfg,e.customCfg,e.preferences,l]),m.useEffect(()=>{e.connectionId&&!I&&(u.current=c)},[c,i]);function Q(q,K,T,V){var ie,fe;let X=!1;if(!e.data)return;const N=eZ(e,K,T,V);if(console.log("fieldValues",N),t==null||t(e,N),!!(((ie=e==null?void 0:e.preferences)==null?void 0:ie.onClickFilter)??[]).length){if(I){const ue=e.id;_(ue),S(e)}else{if(X=!0,!N)return;const ue=[];N.forEach((pe,se)=>{const ne=f==null?void 0:f.find(ye=>ye.columnIndex===se);if(!ne)return;const le={filterId:e.id+"-"+pe.columnName,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:pe.columnName,expression:ne.expression,valueType:Td(N[ne.columnIndex].columnValue),operation:"=",values:[N[ne.columnIndex].columnValue]};ue.push(le)}),e.id,e==null||e.connectionId,e.lastSelectedTable,N[o].columnName,(fe=e.preferences)==null||fe.filterOnClickField,Td(N[o].columnValue),N[o].columnValue,x(ue),g(e)}XJ({chart:q,elementIndex:T,datasetIndex:K,cardType:e.type,cfg:j,apply:X})}}return{isError:A,isLoading:E,isFetching:P,data:C,visualKey:n,handleDatapointClick:Q,cfg:j}}var nZ=e=>{switch(e){case"success":return iZ;case"info":return aZ;case"warning":return sZ;case"error":return lZ;default:return null}},rZ=Array(12).fill(0),oZ=({visible:e})=>m.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},m.createElement("div",{className:"sonner-spinner"},rZ.map((t,n)=>m.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),iZ=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),sZ=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),aZ=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),lZ=m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},m.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),cZ=()=>{let[e,t]=m.useState(document.hidden);return m.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Sx=1,uZ=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;let{message:r,...o}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Sx++,s=this.toasts.find(l=>l.id===i),a=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...t,id:i,title:r}),{...l,...t,id:i,dismissible:a,title:r}):l):this.addToast({title:r,...o,dismissible:a,id:i}),i},this.dismiss=t=>(t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:t,dismiss:!0})),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let o=t instanceof Promise?t:t(),i=r!==void 0;return o.then(async s=>{if(fZ(s)&&!s.ok){i=!1;let a=typeof n.error=="function"?await n.error(`HTTP error! status: ${s.status}`):n.error,l=typeof n.description=="function"?await n.description(`HTTP error! status: ${s.status}`):n.description;this.create({id:r,type:"error",message:a,description:l})}else if(n.success!==void 0){i=!1;let a=typeof n.success=="function"?await n.success(s):n.success,l=typeof n.description=="function"?await n.description(s):n.description;this.create({id:r,type:"success",message:a,description:l})}}).catch(async s=>{if(n.error!==void 0){i=!1;let a=typeof n.error=="function"?await n.error(s):n.error,l=typeof n.description=="function"?await n.description(s):n.description;this.create({id:r,type:"error",message:a,description:l})}}).finally(()=>{var s;i&&(this.dismiss(r),r=void 0),(s=n.finally)==null||s.call(n)}),r},this.custom=(t,n)=>{let r=(n==null?void 0:n.id)||Sx++;return this.create({jsx:t(r),id:r,...n}),r},this.subscribers=[],this.toasts=[]}},Qr=new uZ,dZ=(e,t)=>{let n=(t==null?void 0:t.id)||Sx++;return Qr.addToast({title:e,...t,id:n}),n},fZ=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",hZ=dZ,pZ=()=>Qr.toasts,pk=Object.assign(hZ,{success:Qr.success,info:Qr.info,warning:Qr.warning,error:Qr.error,custom:Qr.custom,message:Qr.message,promise:Qr.promise,dismiss:Qr.dismiss,loading:Qr.loading},{getHistory:pZ});function gZ(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}gZ(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
254
|
+
`);function yp(e){return e.label!==void 0}var mZ=3,vZ="32px",bZ=4e3,yZ=356,xZ=14,wZ=20,_Z=200;function SZ(...e){return e.filter(Boolean).join(" ")}var CZ=e=>{var t,n,r,o,i,s,a,l,c,u;let{invert:f,toast:h,unstyled:g,interacting:v,setHeights:b,visibleToasts:w,heights:x,index:_,toasts:S,expanded:C,removeToast:E,defaultRichColors:P,closeButton:A,style:k,cancelButtonStyle:I,actionButtonStyle:$,className:L="",descriptionClassName:j="",duration:Q,position:ee,gap:B,loadingIcon:Z,expandByDefault:G,classNames:q,icons:K,closeButtonAriaLabel:T="Close toast",pauseWhenPageIsHidden:V,cn:X}=e,[N,ie]=m.useState(!1),[fe,ue]=m.useState(!1),[pe,se]=m.useState(!1),[ne,le]=m.useState(!1),[ye,Y]=m.useState(0),[be,_e]=m.useState(0),Pe=m.useRef(null),Te=m.useRef(null),Ue=_===0,Be=_+1<=w,Ie=h.type,Ke=h.dismissible!==!1,lt=h.className||"",It=h.descriptionClassName||"",At=m.useMemo(()=>x.findIndex(nt=>nt.toastId===h.id)||0,[x,h.id]),Ht=m.useMemo(()=>{var nt;return(nt=h.closeButton)!=null?nt:A},[h.closeButton,A]),de=m.useMemo(()=>h.duration||Q||bZ,[h.duration,Q]),Ee=m.useRef(0),Le=m.useRef(0),Ge=m.useRef(0),Ze=m.useRef(null),[Wt,Zt]=ee.split("-"),Kt=m.useMemo(()=>x.reduce((nt,ht,$t)=>$t>=At?nt:nt+ht.height,0),[x,At]),vn=cZ(),ln=h.invert||f,Lt=Ie==="loading";Le.current=m.useMemo(()=>At*B+Kt,[At,Kt]),m.useEffect(()=>{ie(!0)},[]),m.useLayoutEffect(()=>{if(!N)return;let nt=Te.current,ht=nt.style.height;nt.style.height="auto";let $t=nt.getBoundingClientRect().height;nt.style.height=ht,_e($t),b(Xt=>Xt.find(bt=>bt.toastId===h.id)?Xt.map(bt=>bt.toastId===h.id?{...bt,height:$t}:bt):[{toastId:h.id,height:$t,position:h.position},...Xt])},[N,h.title,h.description,b,h.id]);let tn=m.useCallback(()=>{ue(!0),Y(Le.current),b(nt=>nt.filter(ht=>ht.toastId!==h.id)),setTimeout(()=>{E(h)},_Z)},[h,E,b,Le]);m.useEffect(()=>{if(h.promise&&Ie==="loading"||h.duration===1/0||h.type==="loading")return;let nt,ht=de;return C||v||V&&vn?(()=>{if(Ge.current<Ee.current){let $t=new Date().getTime()-Ee.current;ht=ht-$t}Ge.current=new Date().getTime()})():ht!==1/0&&(Ee.current=new Date().getTime(),nt=setTimeout(()=>{var $t;($t=h.onAutoClose)==null||$t.call(h,h),tn()},ht)),()=>clearTimeout(nt)},[C,v,G,h,de,tn,h.promise,Ie,V,vn]),m.useEffect(()=>{let nt=Te.current;if(nt){let ht=nt.getBoundingClientRect().height;return _e(ht),b($t=>[{toastId:h.id,height:ht,position:h.position},...$t]),()=>b($t=>$t.filter(Xt=>Xt.toastId!==h.id))}},[b,h.id]),m.useEffect(()=>{h.delete&&tn()},[tn,h.delete]);function xn(){return K!=null&&K.loading?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},K.loading):Z?m.createElement("div",{className:"sonner-loader","data-visible":Ie==="loading"},Z):m.createElement(oZ,{visible:Ie==="loading"})}return m.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Te,className:X(L,lt,q==null?void 0:q.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,q==null?void 0:q.default,q==null?void 0:q[Ie],(n=h==null?void 0:h.classNames)==null?void 0:n[Ie]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:P,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":N,"data-promise":!!h.promise,"data-removed":fe,"data-visible":Be,"data-y-position":Wt,"data-x-position":Zt,"data-index":_,"data-front":Ue,"data-swiping":pe,"data-dismissible":Ke,"data-type":Ie,"data-invert":ln,"data-swipe-out":ne,"data-expanded":!!(C||G&&N),style:{"--index":_,"--toasts-before":_,"--z-index":S.length-_,"--offset":`${fe?ye:Le.current}px`,"--initial-height":G?"auto":`${be}px`,...k,...h.style},onPointerDown:nt=>{Lt||!Ke||(Pe.current=new Date,Y(Le.current),nt.target.setPointerCapture(nt.pointerId),nt.target.tagName!=="BUTTON"&&(se(!0),Ze.current={x:nt.clientX,y:nt.clientY}))},onPointerUp:()=>{var nt,ht,$t,Xt;if(ne||!Ke)return;Ze.current=null;let bt=Number(((nt=Te.current)==null?void 0:nt.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Rn=new Date().getTime()-((ht=Pe.current)==null?void 0:ht.getTime()),Lo=Math.abs(bt)/Rn;if(Math.abs(bt)>=wZ||Lo>.11){Y(Le.current),($t=h.onDismiss)==null||$t.call(h,h),tn(),le(!0);return}(Xt=Te.current)==null||Xt.style.setProperty("--swipe-amount","0px"),se(!1)},onPointerMove:nt=>{var ht;if(!Ze.current||!Ke)return;let $t=nt.clientY-Ze.current.y,Xt=nt.clientX-Ze.current.x,bt=(Wt==="top"?Math.min:Math.max)(0,$t),Rn=nt.pointerType==="touch"?10:2;Math.abs(bt)>Rn?(ht=Te.current)==null||ht.style.setProperty("--swipe-amount",`${$t}px`):Math.abs(Xt)>Rn&&(Ze.current=null)}},Ht&&!h.jsx?m.createElement("button",{"aria-label":T,"data-disabled":Lt,"data-close-button":!0,onClick:Lt||!Ke?()=>{}:()=>{var nt;tn(),(nt=h.onDismiss)==null||nt.call(h,h)},className:X(q==null?void 0:q.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},m.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||m.isValidElement(h.title)?h.jsx||h.title:m.createElement(m.Fragment,null,Ie||h.icon||h.promise?m.createElement("div",{"data-icon":"",className:X(q==null?void 0:q.icon,(i=h==null?void 0:h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||xn():null,h.type!=="loading"?h.icon||(K==null?void 0:K[Ie])||nZ(Ie):null):null,m.createElement("div",{"data-content":"",className:X(q==null?void 0:q.content,(s=h==null?void 0:h.classNames)==null?void 0:s.content)},m.createElement("div",{"data-title":"",className:X(q==null?void 0:q.title,(a=h==null?void 0:h.classNames)==null?void 0:a.title)},h.title),h.description?m.createElement("div",{"data-description":"",className:X(j,It,q==null?void 0:q.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},h.description):null),m.isValidElement(h.cancel)?h.cancel:h.cancel&&yp(h.cancel)?m.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||I,onClick:nt=>{var ht,$t;yp(h.cancel)&&Ke&&(($t=(ht=h.cancel).onClick)==null||$t.call(ht,nt),tn())},className:X(q==null?void 0:q.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,m.isValidElement(h.action)?h.action:h.action&&yp(h.action)?m.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||$,onClick:nt=>{var ht,$t;yp(h.action)&&(nt.defaultPrevented||(($t=(ht=h.action).onClick)==null||$t.call(ht,nt),tn()))},className:X(q==null?void 0:q.actionButton,(u=h==null?void 0:h.classNames)==null?void 0:u.actionButton)},h.action.label):null))};function wP(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var EZ=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:s,offset:a,theme:l="light",richColors:c,duration:u,style:f,visibleToasts:h=mZ,toastOptions:g,dir:v=wP(),gap:b=xZ,loadingIcon:w,icons:x,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S,cn:C=SZ}=e,[E,P]=m.useState([]),A=m.useMemo(()=>Array.from(new Set([n].concat(E.filter(V=>V.position).map(V=>V.position)))),[E,n]),[k,I]=m.useState([]),[$,L]=m.useState(!1),[j,Q]=m.useState(!1),[ee,B]=m.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=m.useRef(null),G=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=m.useRef(null),K=m.useRef(!1),T=m.useCallback(V=>{var X;(X=E.find(N=>N.id===V.id))!=null&&X.delete||Qr.dismiss(V.id),P(N=>N.filter(({id:ie})=>ie!==V.id))},[E]);return m.useEffect(()=>Qr.subscribe(V=>{if(V.dismiss){P(X=>X.map(N=>N.id===V.id?{...N,delete:!0}:N));return}setTimeout(()=>{Mo.flushSync(()=>{P(X=>{let N=X.findIndex(ie=>ie.id===V.id);return N!==-1?[...X.slice(0,N),{...X[N],...V},...X.slice(N+1)]:[V,...X]})})})}),[]),m.useEffect(()=>{if(l!=="system"){B(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:V})=>{B(V?"dark":"light")})},[l]),m.useEffect(()=>{E.length<=1&&L(!1)},[E]),m.useEffect(()=>{let V=X=>{var N,ie;r.every(fe=>X[fe]||X.code===fe)&&(L(!0),(N=Z.current)==null||N.focus()),X.code==="Escape"&&(document.activeElement===Z.current||(ie=Z.current)!=null&&ie.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[r]),m.useEffect(()=>{if(Z.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,K.current=!1)}},[Z.current]),E.length?m.createElement("section",{"aria-label":`${_} ${G}`,tabIndex:-1},A.map((V,X)=>{var N;let[ie,fe]=V.split("-");return m.createElement("ol",{key:V,dir:v==="auto"?wP():v,tabIndex:-1,ref:Z,className:s,"data-sonner-toaster":!0,"data-theme":ee,"data-y-position":ie,"data-x-position":fe,style:{"--front-toast-height":`${((N=k[0])==null?void 0:N.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||vZ,"--width":`${yZ}px`,"--gap":`${b}px`,...f},onBlur:ue=>{K.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(K.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||K.current||(K.current=!0,q.current=ue.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{j||L(!1)},onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||Q(!0)},onPointerUp:()=>Q(!1)},E.filter(ue=>!ue.position&&X===0||ue.position===V).map((ue,pe)=>{var se,ne;return m.createElement(CZ,{key:ue.id,icons:x,index:pe,toast:ue,defaultRichColors:c,duration:(se=g==null?void 0:g.duration)!=null?se:u,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:t,visibleToasts:h,closeButton:(ne=g==null?void 0:g.closeButton)!=null?ne:i,interacting:j,position:V,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:T,toasts:E.filter(le=>le.position==ue.position),heights:k.filter(le=>le.position==ue.position),setHeights:I,expandByDefault:o,gap:b,loadingIcon:w,expanded:$,pauseWhenPageIsHidden:S,cn:C})}))})):null};function RZ(e,t){const n=ke(u=>u.selectedSheetId),r=ke(u=>u.selectedFrameId),o=ke(u=>u.isDashboardEditing),i=ke(u=>u.isVisualEditing),{addFrame:s,getSelectedFrame:a,setSelectedFrameId:l}=ke(u=>u.actions);m.useEffect(()=>{const u=h=>{if(o&&((h.metaKey||h.ctrlKey)&&h.key==="c"&&(navigator.clipboard.writeText(JSON.stringify(a())),pk.success("Card copied to clipboard")),(h.ctrlKey||h.metaKey)&&h.key==="v")){console.log("Ctrl+V has been pressed");try{navigator.clipboard.readText().then(g=>{try{const v=JSON.parse(g);if(v&&v.id){v.id=la();const b=v.activeCardId;v.cards.forEach(w=>{const x=w.id;w.id=la(),x===b&&(v.activeCardId=w.id,w.title=`${w.title} (Copy)`)}),s(n,v),l(v.id)}}catch(v){console.error("Failed to parse clipboard contents: ",v)}})}catch(g){console.error("Failed to read clipboard contents: ",g)}}},f=t==null?void 0:t.current;return f==null||f.addEventListener("keydown",u),()=>{f==null||f.removeEventListener("keydown",u)}},[o,n,a,s,t,l]),m.useEffect(()=>{r===e.id&&o&&!i&&c()},[r,e.id,o,i]);function c(){const u=t==null?void 0:t.current;u==null||u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}let ay;const gk="HoverCard",[mk,mye]=Zn(gk,[Ti]),V1=Ti(),[OZ,H1]=mk(gk),PZ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=V1(t),c=m.useRef(0),u=m.useRef(0),f=m.useRef(!1),h=m.useRef(!1),[g=!1,v]=wr({prop:r,defaultProp:o,onChange:i}),b=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),w=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!h.current&&(u.current=window.setTimeout(()=>v(!1),a))},[a,v]),x=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(OZ,{scope:t,open:g,onOpenChange:v,onOpen:b,onClose:w,onDismiss:x,hasSelectionRef:f,isPointerDownOnContentRef:h},m.createElement(Bf,l,n))},TZ="HoverCardTrigger",DZ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=H1(TZ,n),i=V1(n);return m.createElement(Vf,he({asChild:!0},i),m.createElement(Qe.a,he({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:Me(e.onPointerEnter,Mg(o.onOpen)),onPointerLeave:Me(e.onPointerLeave,Mg(o.onClose)),onFocus:Me(e.onFocus,o.onOpen),onBlur:Me(e.onBlur,o.onClose),onTouchStart:Me(e.onTouchStart,s=>s.preventDefault())})))}),AZ="HoverCardPortal",[vye,$Z]=mk(AZ,{forceMount:void 0}),Cx="HoverCardContent",kZ=m.forwardRef((e,t)=>{const n=$Z(Cx,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=H1(Cx,e.__scopeHoverCard);return m.createElement(er,{present:r||i.open},m.createElement(MZ,he({"data-state":i.open?"open":"closed"},o,{onPointerEnter:Me(e.onPointerEnter,Mg(i.onOpen)),onPointerLeave:Me(e.onPointerLeave,Mg(i.onClose)),ref:t})))}),MZ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=H1(Cx,n),c=V1(n),u=m.useRef(null),f=_t(t,u),[h,g]=m.useState(!1);return m.useEffect(()=>{if(h){const v=document.body;return ay=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=ay,v.style.webkitUserSelect=ay}}},[h]),m.useEffect(()=>{if(u.current){const v=()=>{g(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var b;((b=document.getSelection())===null||b===void 0?void 0:b.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{u.current&&IZ(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Me(i,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Hf,he({},c,a,{onPointerDown:Me(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&g(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function Mg(e){return t=>t.pointerType==="touch"?void 0:e()}function IZ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const NZ=PZ,LZ=DZ,vk=kZ,W1=NZ,U1=LZ,Fm=H.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>O.jsx(vk,{ref:o,align:t,sideOffset:n,className:Ce("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}));Fm.displayName=vk.displayName;function FZ({card:e}){const{setCardInfo:t}=co();return O.jsxs(W1,{openDelay:0,children:[O.jsx(U1,{children:O.jsx(nQ,{className:"size-4 text-muted-foreground/40"})}),O.jsx(Fm,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:O.jsx(is,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:O.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}const q1=H.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>O.jsx("div",{style:n,className:Ce("relative w-full overflow-auto",t),children:O.jsx("table",{ref:o,className:Ce("w-full caption-bottom text-sm",e),...r})}));q1.displayName="Table";const G1=H.forwardRef(({className:e,...t},n)=>O.jsx("thead",{ref:n,className:Ce("[&_tr]:border-b",e),...t}));G1.displayName="TableHeader";const Y1=H.forwardRef(({className:e,...t},n)=>O.jsx("tbody",{ref:n,className:Ce("[&_tr:last-child]:border-0",e),...t}));Y1.displayName="TableBody";const jZ=H.forwardRef(({className:e,...t},n)=>O.jsx("tfoot",{ref:n,className:Ce("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));jZ.displayName="TableFooter";const yd=H.forwardRef(({className:e,...t},n)=>O.jsx("tr",{ref:n,className:Ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));yd.displayName="TableRow";const K1=H.forwardRef(({className:e,...t},n)=>O.jsx("th",{ref:n,className:Ce("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));K1.displayName="TableHead";const Ig=H.forwardRef(({className:e,...t},n)=>O.jsx("td",{ref:n,className:Ce("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ig.displayName="TableCell";const zZ=H.forwardRef(({className:e,...t},n)=>O.jsx("caption",{ref:n,className:Ce("mt-4 text-sm text-muted-foreground",e),...t}));zZ.displayName="TableCaption";/**
|
|
255
255
|
* table-core
|
|
256
256
|
*
|
|
257
257
|
* Copyright (c) TanStack
|
|
@@ -312,8 +312,8 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Y=ye(pe,le,ie,fe,ue+
|
|
|
312
312
|
`)},zk=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=H.useMemo(function(){return Qee(o)},[o]);return H.createElement(Jee,{styles:Zee(i,!t,o,n?"":"!important")})},kx=!1;if(typeof window<"u")try{var Ep=Object.defineProperty({},"passive",{get:function(){return kx=!0,!0}});window.addEventListener("test",Ep,Ep),window.removeEventListener("test",Ep,Ep)}catch{kx=!1}var ec=kx?{passive:!1}:!1,ete=function(e){return e.tagName==="TEXTAREA"},Bk=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ete(e)&&n[t]==="visible")},tte=function(e){return Bk(e,"overflowY")},nte=function(e){return Bk(e,"overflowX")},AP=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Vk(e,n);if(r){var o=Hk(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},rte=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ote=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Vk=function(e,t){return e==="v"?tte(t):nte(t)},Hk=function(e,t){return e==="v"?rte(t):ote(t)},ite=function(e,t){return e==="h"&&t==="rtl"?-1:1},ste=function(e,t,n,r,o){var i=ite(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,h=0;do{var g=Hk(e,a),v=g[0],b=g[1],w=g[2],x=b-w-i*v;(v||x)&&Vk(e,a)&&(f+=x,h+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&f===0||!o&&s>f)||!u&&(o&&h===0||!o&&-s>h))&&(c=!0),c},Rp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$P=function(e){return[e.deltaX,e.deltaY]},kP=function(e){return e&&"current"in e?e.current:e},ate=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lte=function(e){return`
|
|
313
313
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
314
314
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
315
|
-
`)},cte=0,tc=[];function ute(e){var t=H.useRef([]),n=H.useRef([0,0]),r=H.useRef(),o=H.useState(cte++)[0],i=H.useState(function(){return n_()})[0],s=H.useRef(e);H.useEffect(function(){s.current=e},[e]),H.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=Mk([e.lockRef.current],(e.shards||[]).map(kP),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=H.useCallback(function(b,w){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=Rp(b),_=n.current,S="deltaX"in b?b.deltaX:_[0]-x[0],C="deltaY"in b?b.deltaY:_[1]-x[1],E,P=b.target,A=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in b&&A==="h"&&P.type==="range")return!1;var k=AP(A,P);if(!k)return!0;if(k?E=A:(E=A==="v"?"h":"v",k=AP(A,P)),!k)return!1;if(!r.current&&"changedTouches"in b&&(S||C)&&(r.current=E),!E)return!0;var I=r.current||E;return ste(I,w,b,I==="h"?S:C,!0)},[]),l=H.useCallback(function(b){var w=b;if(!(!tc.length||tc[tc.length-1]!==i)){var x="deltaY"in w?$P(w):Rp(w),_=t.current.filter(function(E){return E.name===w.type&&E.target===w.target&&ate(E.delta,x)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(kP).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=S.length>0?a(w,S[0]):!s.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),c=H.useCallback(function(b,w,x,_){var S={name:b,delta:w,target:x,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=H.useCallback(function(b){n.current=Rp(b),r.current=void 0},[]),f=H.useCallback(function(b){c(b.type,$P(b),b.target,a(b,e.lockRef.current))},[]),h=H.useCallback(function(b){c(b.type,Rp(b),b.target,a(b,e.lockRef.current))},[]);H.useEffect(function(){return tc.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ec),document.addEventListener("touchmove",l,ec),document.addEventListener("touchstart",u,ec),function(){tc=tc.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,ec),document.removeEventListener("touchmove",l,ec),document.removeEventListener("touchstart",u,ec)}},[]);var g=e.removeScrollBar,v=e.inert;return H.createElement(H.Fragment,null,v?H.createElement(i,{styles:lte(o)}):null,g?H.createElement(zk,{gapMode:"margin"}):null)}const dte=Fk(jk,ute);var Wk=H.forwardRef(function(e,t){return H.createElement(Bm,lr({},e,{ref:t,sideCar:dte}))});Wk.classNames=Bm.classNames;const r_=Wk,fte=[" ","Enter","ArrowUp","ArrowDown"],hte=[" ","Enter"],Vm="Select",[Hm,Wm,pte]=um(Vm),[lu,bye]=Zn(Vm,[pte,Ti]),o_=Ti(),[gte,Rl]=lu(Vm),[mte,vte]=lu(Vm),bte=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:h,required:g}=e,v=o_(t),[b,w]=m.useState(null),[x,_]=m.useState(null),[S,C]=m.useState(!1),E=_l(c),[P=!1,A]=wr({prop:r,defaultProp:o,onChange:i}),[k,I]=wr({prop:s,defaultProp:a,onChange:l}),$=m.useRef(null),L=b?!!b.closest("form"):!0,[j,Q]=m.useState(new Set),ee=Array.from(j).map(B=>B.props.value).join(";");return m.createElement(Bf,v,m.createElement(gte,{required:g,scope:t,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Jo(),value:k,onValueChange:I,open:P,onOpenChange:A,dir:E,triggerPointerDownPosRef:$,disabled:h},m.createElement(Hm.Provider,{scope:t},m.createElement(mte,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(B=>{Q(Z=>new Set(Z).add(B))},[]),onNativeOptionRemove:m.useCallback(B=>{Q(Z=>{const G=new Set(Z);return G.delete(B),G})},[])},n)),L?m.createElement(Kk,{key:ee,"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:f,value:k,onChange:B=>I(B.target.value),disabled:h},k===void 0?m.createElement("option",{value:""}):null,Array.from(j)):null))},yte="SelectTrigger",xte=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=o_(n),s=Rl(yte,n),a=s.disabled||r,l=_t(t,s.onTriggerChange),c=Wm(n),[u,f,h]=Xk(v=>{const b=c().filter(_=>!_.disabled),w=b.find(_=>_.value===s.value),x=Qk(b,v,w);x!==void 0&&s.onValueChange(x.value)}),g=()=>{a||(s.onOpenChange(!0),h())};return m.createElement(Vf,he({asChild:!0},i),m.createElement(Qe.button,he({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":Yk(s.value)?"":void 0},o,{ref:l,onClick:Me(o.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Me(o.onPointerDown,v=>{const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(g(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Me(o.onKeyDown,v=>{const b=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(b&&v.key===" ")&&fte.includes(v.key)&&(g(),v.preventDefault())})})))}),wte="SelectValue",_te=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Rl(wte,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=_t(t,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),m.createElement(Qe.span,he({},a,{ref:f,style:{pointerEvents:"none"}}),Yk(l.value)?m.createElement(m.Fragment,null,s):i)}),Ste=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Qe.span,he({"aria-hidden":!0},o,{ref:t}),r||"▼")}),Cte=e=>m.createElement(M1,he({asChild:!0},e)),Jc="SelectContent",Ete=m.forwardRef((e,t)=>{const n=Rl(Jc,e.__scopeSelect),[r,o]=m.useState();if(ur(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Mo.createPortal(m.createElement(Uk,{scope:e.__scopeSelect},m.createElement(Hm.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(Rte,he({},e,{ref:t}))}),Ki=10,[Uk,Ol]=lu(Jc),Rte=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:w,...x}=e,_=Rl(Jc,n),[S,C]=m.useState(null),[E,P]=m.useState(null),A=_t(t,pe=>C(pe)),[k,I]=m.useState(null),[$,L]=m.useState(null),j=Wm(n),[Q,ee]=m.useState(!1),B=m.useRef(!1);m.useEffect(()=>{if(S)return zm(S)},[S]),Z1();const Z=m.useCallback(pe=>{const[se,...ne]=j().map(Y=>Y.ref.current),[le]=ne.slice(-1),ye=document.activeElement;for(const Y of pe)if(Y===ye||(Y==null||Y.scrollIntoView({block:"nearest"}),Y===se&&E&&(E.scrollTop=0),Y===le&&E&&(E.scrollTop=E.scrollHeight),Y==null||Y.focus(),document.activeElement!==ye))return},[j,E]),G=m.useCallback(()=>Z([k,S]),[Z,k,S]);m.useEffect(()=>{Q&&G()},[Q,G]);const{onOpenChange:q,triggerPointerDownPosRef:K}=_;m.useEffect(()=>{if(S){let pe={x:0,y:0};const se=le=>{var ye,Y,be,_e;pe={x:Math.abs(Math.round(le.pageX)-((ye=(Y=K.current)===null||Y===void 0?void 0:Y.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(le.pageY)-((be=(_e=K.current)===null||_e===void 0?void 0:_e.y)!==null&&be!==void 0?be:0))}},ne=le=>{pe.x<=10&&pe.y<=10?le.preventDefault():S.contains(le.target)||q(!1),document.removeEventListener("pointermove",se),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",ne,{capture:!0})}}},[S,q,K]),m.useEffect(()=>{const pe=()=>q(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[q]);const[T,V]=Xk(pe=>{const se=j().filter(ye=>!ye.disabled),ne=se.find(ye=>ye.ref.current===document.activeElement),le=Qk(se,pe,ne);le&&setTimeout(()=>le.ref.current.focus())}),X=m.useCallback((pe,se,ne)=>{const le=!B.current&&!ne;(_.value!==void 0&&_.value===se||le)&&(I(pe),le&&(B.current=!0))},[_.value]),N=m.useCallback(()=>S==null?void 0:S.focus(),[S]),ie=m.useCallback((pe,se,ne)=>{const le=!B.current&&!ne;(_.value!==void 0&&_.value===se||le)&&L(pe)},[_.value]),fe=r==="popper"?MP:Ote,ue=fe===MP?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:w}:{};return m.createElement(Uk,{scope:n,content:S,viewport:E,onViewportChange:P,itemRefCallback:X,selectedItem:k,onItemLeave:N,itemTextRefCallback:ie,focusSelectedItem:G,selectedItemText:$,position:r,isPositioned:Q,searchRef:T},m.createElement(r_,{as:$k,allowPinchZoom:!0},m.createElement(e_,{asChild:!0,trapped:_.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:Me(o,pe=>{var se;(se=_.trigger)===null||se===void 0||se.focus({preventScroll:!0}),pe.preventDefault()})},m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(fe,he({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:pe=>pe.preventDefault()},x,ue,{onPlaced:()=>ee(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Me(x.onKeyDown,pe=>{const se=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!se&&pe.key.length===1&&V(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let le=j().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const ye=pe.target,Y=le.indexOf(ye);le=le.slice(Y+1)}setTimeout(()=>Z(le)),pe.preventDefault()}})}))))))}),Ote=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Rl(Jc,n),s=Ol(Jc,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=_t(t,A=>u(A)),h=Wm(n),g=m.useRef(!1),v=m.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:x,focusSelectedItem:_}=s,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&b&&w&&x){const A=i.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),$=x.getBoundingClientRect();if(i.dir!=="rtl"){const ye=$.left-k.left,Y=I.left-ye,be=A.left-Y,_e=A.width+be,Pe=Math.max(_e,k.width),Te=window.innerWidth-Ki,Ue=Ax(Y,[Ki,Te-Pe]);a.style.minWidth=_e+"px",a.style.left=Ue+"px"}else{const ye=k.right-$.right,Y=window.innerWidth-I.right-ye,be=window.innerWidth-A.right-Y,_e=A.width+be,Pe=Math.max(_e,k.width),Te=window.innerWidth-Ki,Ue=Ax(Y,[Ki,Te-Pe]);a.style.minWidth=_e+"px",a.style.right=Ue+"px"}const L=h(),j=window.innerHeight-Ki*2,Q=b.scrollHeight,ee=window.getComputedStyle(c),B=parseInt(ee.borderTopWidth,10),Z=parseInt(ee.paddingTop,10),G=parseInt(ee.borderBottomWidth,10),q=parseInt(ee.paddingBottom,10),K=B+Z+Q+q+G,T=Math.min(w.offsetHeight*5,K),V=window.getComputedStyle(b),X=parseInt(V.paddingTop,10),N=parseInt(V.paddingBottom,10),ie=A.top+A.height/2-Ki,fe=j-ie,ue=w.offsetHeight/2,pe=w.offsetTop+ue,se=B+Z+pe,ne=K-se;if(se<=ie){const ye=w===L[L.length-1].ref.current;a.style.bottom="0px";const Y=c.clientHeight-b.offsetTop-b.offsetHeight,be=Math.max(fe,ue+(ye?N:0)+Y+G),_e=se+be;a.style.height=_e+"px"}else{const ye=w===L[0].ref.current;a.style.top="0px";const be=Math.max(ie,B+b.offsetTop+(ye?X:0)+ue)+ne;a.style.height=be+"px",b.scrollTop=se-ie+b.offsetTop}a.style.margin=`${Ki}px 0`,a.style.minHeight=T+"px",a.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[h,i.trigger,i.valueNode,a,c,b,w,x,i.dir,r]);ur(()=>S(),[S]);const[C,E]=m.useState();ur(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const P=m.useCallback(A=>{A&&v.current===!0&&(S(),_==null||_(),v.current=!1)},[S,_]);return m.createElement(Pte,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:P},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C}},m.createElement(Qe.div,he({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),MP=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ki,...i}=e,s=o_(n);return m.createElement(Hf,he({},s,i,{ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[Pte,i_]=lu(Jc,{}),IP="SelectViewport",Tte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ol(IP,n),i=i_(IP,n),s=_t(t,o.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(Hm.Slot,{scope:n},m.createElement(Qe.div,he({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Me(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&u){const h=Math.abs(a.current-c.scrollTop);if(h>0){const g=window.innerHeight-Ki*2,v=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),w=Math.max(v,b);if(w<g){const x=w+h,_=Math.min(g,x),S=x-_;u.style.height=_+"px",u.style.bottom==="0px"&&(c.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),Dte="SelectGroup",[Ate,$te]=lu(Dte),kte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Jo();return m.createElement(Ate,{scope:n,id:o},m.createElement(Qe.div,he({role:"group","aria-labelledby":o},r,{ref:t})))}),Mte="SelectLabel",Ite=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=$te(Mte,n);return m.createElement(Qe.div,he({id:o.id},r,{ref:t}))}),Mx="SelectItem",[Nte,qk]=lu(Mx),Lte=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Rl(Mx,n),l=Ol(Mx,n),c=a.value===r,[u,f]=m.useState(i??""),[h,g]=m.useState(!1),v=_t(t,x=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,x,r,o)}),b=Jo(),w=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.createElement(Nte,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:m.useCallback(x=>{f(_=>{var S;return _||((S=x==null?void 0:x.textContent)!==null&&S!==void 0?S:"").trim()})},[])},m.createElement(Hm.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(Qe.div,he({role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:v,onFocus:Me(s.onFocus,()=>g(!0)),onBlur:Me(s.onBlur,()=>g(!1)),onPointerUp:Me(s.onPointerUp,w),onPointerMove:Me(s.onPointerMove,x=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(s.onPointerLeave,x=>{if(x.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:Me(s.onKeyDown,x=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&x.key===" "||(hte.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})}))))}),Op="SelectItemText",Fte=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Rl(Op,n),a=Ol(Op,n),l=qk(Op,n),c=vte(Op,n),[u,f]=m.useState(null),h=_t(t,x=>f(x),l.onItemTextChange,x=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.call(a,x,l.value,l.disabled)}),g=u==null?void 0:u.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},g),[l.disabled,l.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=c;return ur(()=>(b(v),()=>w(v)),[b,w,v]),m.createElement(m.Fragment,null,m.createElement(Qe.span,he({id:l.textId},i,{ref:h})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Mo.createPortal(i.children,s.valueNode):null)}),jte="SelectItemIndicator",zte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qk(jte,n).isSelected?m.createElement(Qe.span,he({"aria-hidden":!0},r,{ref:t})):null}),NP="SelectScrollUpButton",Bte=m.forwardRef((e,t)=>{const n=Ol(NP,e.__scopeSelect),r=i_(NP,e.__scopeSelect),[o,i]=m.useState(!1),s=_t(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;i(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(Gk,he({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),LP="SelectScrollDownButton",Vte=m.forwardRef((e,t)=>{const n=Ol(LP,e.__scopeSelect),r=i_(LP,e.__scopeSelect),[o,i]=m.useState(!1),s=_t(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)<c;i(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(Gk,he({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),Gk=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ol("SelectScrollButton",n),s=m.useRef(null),a=Wm(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),ur(()=>{var c;const u=a().find(f=>f.ref.current===document.activeElement);u==null||(c=u.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(Qe.div,he({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:Me(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Me(o.onPointerMove,()=>{var c;(c=i.onItemLeave)===null||c===void 0||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Me(o.onPointerLeave,()=>{l()})}))}),Hte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Qe.div,he({"aria-hidden":!0},r,{ref:t}))});function Yk(e){return e===""||e===void 0}const Kk=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=_t(t,o),s=jm(n);return m.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(tk,{asChild:!0},m.createElement("select",he({},r,{ref:i,defaultValue:n})))});Kk.displayName="BubbleSelect";function Xk(e){const t=Ln(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Qk(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Wte(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Wte(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Ute=bte,Jk=xte,qte=_te,Gte=Ste,Yte=Cte,Zk=Ete,Kte=Tte,Xte=kte,eM=Ite,tM=Lte,Qte=Fte,Jte=zte,nM=Bte,rM=Vte,oM=Hte,zs=Ute,dc=Xte,Bs=qte,Qi=H.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(Jk,{ref:r,className:Ce("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,O.jsx(Gte,{asChild:!0,children:O.jsx(Am,{className:"h-4 w-4 opacity-50"})})]}));Qi.displayName=Jk.displayName;const iM=H.forwardRef(({className:e,...t},n)=>O.jsx(nM,{ref:n,className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(JX,{className:"h-4 w-4"})}));iM.displayName=nM.displayName;const sM=H.forwardRef(({className:e,...t},n)=>O.jsx(rM,{ref:n,className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(Am,{className:"h-4 w-4"})}));sM.displayName=rM.displayName;const Ji=H.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>O.jsx(Yte,{children:O.jsx(au,{children:O.jsxs(Zk,{ref:o,className:Ce("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:[O.jsx(iM,{}),O.jsx(Kte,{className:Ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),O.jsx(sM,{})]})})}));Ji.displayName=Zk.displayName;const Va=H.forwardRef(({className:e,...t},n)=>O.jsx(eM,{ref:n,className:Ce("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Va.displayName=eM.displayName;const Hn=H.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(tM,{ref:r,className:Ce("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(Jte,{children:O.jsx(Ff,{className:"h-4 w-4"})})}),O.jsx(Qte,{children:t})]}));Hn.displayName=tM.displayName;const Lg=H.forwardRef(({className:e,...t},n)=>O.jsx(oM,{ref:n,className:Ce("-mx-1 my-1 h-px bg-muted",e),...t}));Lg.displayName=oM.displayName;function Zte(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ene(...e){return t=>e.forEach(n=>Zte(n,t))}var Um=H.forwardRef((e,t)=>{const{children:n,...r}=e,o=H.Children.toArray(n),i=o.find(tne);if(i){const s=i.props.children,a=o.map(l=>l===i?H.Children.count(s)>1?H.Children.only(null):H.isValidElement(s)?s.props.children:null:l);return O.jsx(Ix,{...r,ref:t,children:H.isValidElement(s)?H.cloneElement(s,void 0,a):null})}return O.jsx(Ix,{...r,ref:t,children:n})});Um.displayName="Slot";var Ix=H.forwardRef((e,t)=>{const{children:n,...r}=e;if(H.isValidElement(n)){const o=rne(n);return H.cloneElement(n,{...nne(r,n.props),ref:t?ene(t,o):o})}return H.Children.count(n)>1?H.Children.only(null):null});Ix.displayName="SlotClone";var aM=({children:e})=>O.jsx(O.Fragment,{children:e});function tne(e){return H.isValidElement(e)&&e.type===aM}function nne(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function rne(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const FP=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,jP=ug,s_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return jP(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],f=i==null?void 0:i[c];if(u===null)return null;const h=FP(u)||FP(f);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...g}=u;return Object.entries(g).every(v=>{let[b,w]=v;return Array.isArray(w)?w.includes({...i,...a}[b]):{...i,...a}[b]===w})?[...c,f,h]:c},[]);return jP(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Vd=s_("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"}}),xr=H.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Um:"button";return O.jsx(s,{className:Ce(Vd({variant:t,size:n,className:e})),ref:i,...o})});xr.displayName="Button";const one=m.forwardRef((e,t)=>m.createElement(Qe.label,he({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),lM=one,ine=s_("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wn=H.forwardRef(({className:e,...t},n)=>O.jsx(lM,{ref:n,className:Ce(ine(),e),...t}));Wn.displayName=lM.displayName;const cM=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(ane);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Nx,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Nx,he({},r,{ref:t}),n)});cM.displayName="Slot";const Nx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...lne(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Nx.displayName="SlotClone";const sne=({children:e})=>m.createElement(m.Fragment,null,e);function ane(e){return m.isValidElement(e)&&e.type===sne}function lne(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const uM="Popover",[dM,yye]=Zn(uM,[Ti]),a_=Ti(),[cne,cu]=dM(uM),une=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=a_(t),l=m.useRef(null),[c,u]=m.useState(!1),[f=!1,h]=wr({prop:r,defaultProp:o,onChange:i});return m.createElement(Bf,a,m.createElement(cne,{scope:t,contentId:Jo(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(g=>!g),[h]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},dne="PopoverTrigger",fne=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cu(dne,n),i=a_(n),s=_t(t,o.triggerRef),a=m.createElement(Qe.button,he({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":pM(o.open)},r,{ref:s,onClick:Me(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(Vf,he({asChild:!0},i),a)}),fM="PopoverPortal",[hne,pne]=dM(fM,{forceMount:void 0}),gne=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=cu(fM,t);return m.createElement(hne,{scope:t,forceMount:n},m.createElement(er,{present:n||i.open},m.createElement(M1,{asChild:!0,container:o},r)))},Hd="PopoverContent",mne=m.forwardRef((e,t)=>{const n=pne(Hd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=cu(Hd,e.__scopePopover);return m.createElement(er,{present:r||i.open},i.modal?m.createElement(vne,he({},o,{ref:t})):m.createElement(bne,he({},o,{ref:t})))}),vne=m.forwardRef((e,t)=>{const n=cu(Hd,e.__scopePopover),r=m.useRef(null),o=_t(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return zm(s)},[]),m.createElement(r_,{as:cM,allowPinchZoom:!0},m.createElement(hM,he({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Me(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Me(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),bne=m.forwardRef((e,t)=>{const n=cu(Hd,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(hM,he({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),hM=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,h=cu(Hd,n),g=a_(n);return Z1(),m.createElement(e_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1)},m.createElement(Hf,he({"data-state":pM(h.open),role:"dialog",id:h.contentId},g,f,{ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function pM(e){return e?"open":"closed"}const yne=une,xne=fne,wne=gne,gM=mne,qm=yne,Gm=xne,Wf=H.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>O.jsx(wne,{children:O.jsx(au,{children:O.jsx(gM,{ref:o,align:t,sideOffset:n,className:Ce("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})}));Wf.displayName=gM.displayName;function _ne(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}const xc=H.forwardRef(({className:e,type:t,...n},r)=>O.jsx("input",{type:t,className:Ce("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}));xc.displayName="Input";function mM({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function o(s){const a=[...e];a.splice(s,1),t(a)}function i(){t([...e,n])}return O.jsxs("div",{className:"space-y-3",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Wn,{children:"Color Range"}),O.jsx(xr,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:O.jsx(R1,{className:"size-3"})})]}),e.map((s,a)=>O.jsxs("div",{className:"flex items-center gap-2 px-2",children:[O.jsx(xc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:Ce(`h-7 ${Kp}`)}),O.jsx("span",{children:"-"}),O.jsx(xc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:Ce(`h-7 ${Kp}`)}),O.jsx(xc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:Ce(`h-7 min-w-14 p-0 ${Kp}`),type:"color",list:"presetColors"}),O.jsxs("datalist",{id:"presetColors",children:[O.jsx("option",{children:Bt.green[600]}),O.jsx("option",{children:Bt.red[500]}),O.jsx("option",{children:Bt.yellow[400]}),O.jsx("option",{children:Bt.orange[500]})]}),O.jsx(xr,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:O.jsx($m,{className:"size-3"})})]},a))]})}const Sne=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=wr({prop:n,onChange:o,defaultProp:r});return m.createElement(Qe.button,he({type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:Me(e.onClick,()=>{e.disabled||a(!s)})}))}),vM=Sne,Cne=s_("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"}}),l_=H.forwardRef(({className:e,variant:t,size:n,...r},o)=>O.jsx(vM,{ref:o,className:Ce(Cne({variant:t,size:n,className:e})),...r}));l_.displayName=vM.displayName;function Ene(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function Rne(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function One(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function Pne(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function Tne(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function Dne(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function Ane(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function $ne({columnIndex:e,columnName:t}){const[n,r]=m.useState(!1),o=br(I=>{var $;return($=I.card)==null?void 0:$.preferences}),[i,s]=m.useState(Ene(o,e)),[a,l]=m.useState(Dne(o,e)),[c,u]=m.useState(Rne(o,e)),[f,h]=m.useState(One(o,e)),[g,v]=m.useState(Pne(o,e)),[b,w]=m.useState(Tne(o,e).toString()),[x,_]=m.useState(Ane(o,e));m.useState("");const S=br(I=>I.actions.setCardPreferences);function C(){const I=[...new Set(S0.map($=>$.currency))];return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),O.jsxs(zs,{value:c,onValueChange:$=>u($),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Locale"}),S0.map($=>O.jsx(Hn,{value:$.locale,children:$.locale},$.locale))]})})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),O.jsxs(zs,{value:g||"none",onValueChange:$=>v($==="none"?void 0:$),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Currency"}),O.jsx(Hn,{value:"none",children:"None"}),I.map($=>O.jsx(Hn,{value:$,children:$},$))]})})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),O.jsxs(zs,{value:b,onValueChange:$=>w($),children:[O.jsx(Qi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:["0","1","2","3","4"].map($=>O.jsx(Hn,{value:$,children:$},$))})]}),!g&&O.jsx(l_,{onPressedChange:$=>_($),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:O.jsx(rQ,{className:"size-3"})})]})})}function E(){return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),O.jsxs(zs,{defaultValue:"en-US",value:c,onValueChange:I=>u(I),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:Az.map(I=>O.jsxs(dc,{children:[O.jsx(Va,{children:I.label}),I.locales.map($=>O.jsx(Hn,{value:$.code,children:$.name},$.code))]},I.label))})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Format"}),O.jsxs(zs,{defaultValue:"short-date-time",value:f,onValueChange:I=>{console.log("format",I),h(I)},children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{className:"",id:"type",children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Option"}),O.jsx(Hn,{value:"full-date-time",children:"Full Date-Time"}),O.jsx(Hn,{value:"short-date-time",children:"Short Date-Time"}),O.jsx(Hn,{value:"hours-date-time",children:"24-Hour Date-Time"}),O.jsx(Hn,{value:"short-date",children:"Short Date"}),O.jsx(Hn,{value:"long-date",children:"Long Date"})]})})]})]})})}function P(){S({...o,columnSettings:[]})}function A(){var I;S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter($=>$.columnIdx!==e))||[]]})}function k(){var I,$,L;if(i==="date"){const j=_ne(c,f),Q={columnIdx:e,type:i,options:j};S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(ee=>ee.columnIdx!==e))||[],Q]})}else if(i==="number"){let j;g?j={locale:c,currency:g,options:{style:"currency",currency:g,minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0}:j={locale:c,currency:void 0,options:{style:x?"percent":"decimal",minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0};const Q={columnIdx:e,type:i,options:j};S({...o,columnSettings:[...(($=o==null?void 0:o.columnSettings)==null?void 0:$.filter(ee=>ee.columnIdx!==e))||[],Q]})}else S({...o,columnSettings:[...((L=o==null?void 0:o.columnSettings)==null?void 0:L.filter(j=>j.columnIdx!==e))||[]]})}return O.jsxs(qm,{onOpenChange:I=>r(I),children:[O.jsx(Gm,{asChild:!0,children:O.jsx(O1,{className:"size-3.5 cursor-pointer text-muted"})}),O.jsx(Wf,{align:"center",className:"max-w-70",children:O.jsxs("div",{className:"grid gap-4",children:[O.jsxs("div",{className:"space-y-2",children:[O.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),O.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),O.jsxs("div",{className:"grid gap-2",children:[O.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[O.jsx(Wn,{htmlFor:"scale",children:"Type"}),O.jsxs(zs,{value:i||"none",onValueChange:I=>s(I),children:[O.jsx(Qi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{id:"type",children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Option"}),O.jsx(Hn,{value:"number",children:"Number"}),O.jsx(Hn,{value:"date",children:"Date"}),O.jsx(Hn,{value:"none",children:"None"})]})})]})]}),i==="number"&&C(),i==="date"&&E(),i==="number"&&O.jsxs(O.Fragment,{children:[O.jsx(Lg,{}),O.jsx(mM,{colorRanges:a,setColorRanges:l})]}),O.jsx(Lg,{}),O.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[O.jsx(xr,{onClick:P,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),O.jsx(xr,{onClick:A,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),O.jsx(xr,{onClick:k,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function kne(e){const t=new Date(e);return!isNaN(t.getTime())}function bM({data:e,card:t}){var C,E,P,A;const[n,r]=m.useState([]),{keys:o}=ar(e),i=$e(k=>k.filteringCards),s=$e(k=>k.themeStyle),a=$e(k=>k.isVisualEditing),l=i==null?void 0:i.find(k=>k.id===t.id),c=(C=t==null?void 0:t.preferences)==null?void 0:C.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:f,removeFilterValue:h,removeFilteringCard:g}=co(),v=t==null?void 0:t.preferences;function b(k,I){if((I==null?void 0:I.type)==="date"&&kne(k)){const{locale:$,options:L}=I.options,j=new Date(k);return new Date(j.getTime()).toLocaleDateString($,L)}if((I==null?void 0:I.type)==="number"){const{locale:$,currency:L,options:j}=I.options;return L?new Intl.NumberFormat($,{style:"currency",currency:L,...j}).format(k):new Intl.NumberFormat($,j).format(k)}return k}const w=o.map((k,I)=>({accessorKey:k,header:({column:$})=>{const L=$.getIsSorted();return O.jsxs("div",{className:"flex items-center justify-between gap-2",children:[O.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>$.toggleSorting($.getIsSorted()==="asc"),children:[k,L==="asc"?O.jsx(C1,{className:"ml-2 h-5 w-5"}):L==="desc"?O.jsx(S1,{className:"ml-2 h-5 w-5"}):null]}),a&&O.jsx($ne,{columnName:$.id,columnIndex:I})]})},cell:({cell:$})=>{var B,Z;const L=$.getValue(),j=(B=v==null?void 0:v.columnSettings)==null?void 0:B.find(G=>G.columnIdx===I),Q=b(L,j),ee=ak(L,(Z=j==null?void 0:j.options)==null?void 0:Z.colorRanges);return O.jsx("div",{className:"px-2 py-1",style:{backgroundColor:ee},children:Q})}})),x=Dk({data:e,columns:w,getCoreRowModel:Ok(),getPaginationRowModel:Tk(),onSortingChange:r,getSortedRowModel:Pk(),manualPagination:!0,state:{sorting:n}}),_=x.getSelectedRowModel().rows;m.useEffect(()=>{if(_.length===0){if(l){const k=t.id;h(k),g(t)}return}if(c){const{dimensionKeys:k}=ar(e),I=c.map($=>{const L=k==null?void 0:k[$.columnIndex],j=_.map(ee=>ee.getValue(L));return{filterId:t.id+"-"+L,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:L,expression:$.expression,valueType:Td(j[0]===void 0?"":j[0]),operation:"in",values:j}});u(I),f(t)}},[f,u,t,e,l,c,h,g,_]);function S(k){k.toggleSelected()}return O.jsxs(q1,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(E=s==null?void 0:s.chart)==null?void 0:E.options.borderRadius,borderTopLeftRadius:(P=s==null?void 0:s.chart)==null?void 0:P.options.borderRadius},onMouseDown:k=>k.stopPropagation(),children:[O.jsx(G1,{children:x.getHeaderGroups().map(k=>O.jsx(yd,{children:k.headers.map((I,$)=>{var L,j,Q,ee,B,Z,G;return O.jsx(K1,{style:{backgroundColor:(Q=(j=(L=s==null?void 0:s.chart)==null?void 0:L.dataset)==null?void 0:j.backgroundColor)==null?void 0:Q[0],color:Bc((Z=(B=(ee=s==null?void 0:s.chart)==null?void 0:ee.dataset)==null?void 0:B.backgroundColor)==null?void 0:Z[0])},className:Ce("sticky -top-[1px] z-50 h-9 bg-muted-foreground px-2 text-background",{"border-x":$>0&&$<k.headers.length-1,"border-l":$===1&&k.headers.length==2},(G=s==null?void 0:s.table)==null?void 0:G.tableHeaderColor),children:I.isPlaceholder?null:Dx(I.column.columnDef.header,I.getContext())},I.id)})},k.id))}),O.jsx(Y1,{children:(A=x.getRowModel().rows)!=null&&A.length?x.getRowModel().rows.map((k,I)=>O.jsx(yd,{onClick:()=>S(k),className:Ce("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":k.getIsSelected()&&"selected",children:k.getVisibleCells().map(($,L)=>{var j;return O.jsx(Ig,{onClick:Q=>{var B;const ee=((B=window==null?void 0:window.getSelection())==null?void 0:B.toString())||"";(ee==null?void 0:ee.length)>0&&Q.stopPropagation()},className:Ce("p-0",{"border-x":L>0&&L<w.length-1||L===1&&w.length==2,"border-l":L==0,"border-r":L===w.length-1,"border-b":I===((j=x.getRowModel().rows)==null?void 0:j.length)-1}),children:Dx($.column.columnDef.cell,$.getContext())},$.id)})},k.id)):O.jsx(yd,{children:O.jsx(Ig,{colSpan:w.length,className:"p-1 text-center",children:"No results."})})})]})}/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:yM,setPrototypeOf:zP,isFrozen:Mne,getPrototypeOf:Ine,getOwnPropertyDescriptor:Nne}=Object;let{freeze:_r,seal:ko,create:xM}=Object,{apply:Lx,construct:Fx}=typeof Reflect<"u"&&Reflect;_r||(_r=function(t){return t});ko||(ko=function(t){return t});Lx||(Lx=function(t,n,r){return t.apply(n,r)});Fx||(Fx=function(t,n){return new t(...n)});const Pp=fo(Array.prototype.forEach),BP=fo(Array.prototype.pop),Hu=fo(Array.prototype.push),sg=fo(String.prototype.toLowerCase),wy=fo(String.prototype.toString),VP=fo(String.prototype.match),Wu=fo(String.prototype.replace),Lne=fo(String.prototype.indexOf),Fne=fo(String.prototype.trim),Uo=fo(Object.prototype.hasOwnProperty),gr=fo(RegExp.prototype.test),Uu=jne(TypeError);function fo(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Lx(e,t,r)}}function jne(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fx(e,n)}}function Tt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sg;zP&&zP(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(Mne(t)||(t[r]=i),o=i)}e[o]=!0}return e}function zne(e){for(let t=0;t<e.length;t++)Uo(e,t)||(e[t]=null);return e}function za(e){const t=xM(null);for(const[n,r]of yM(e))Uo(e,n)&&(Array.isArray(r)?t[n]=zne(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=za(r):t[n]=r);return t}function qu(e,t){for(;e!==null;){const r=Nne(e,t);if(r){if(r.get)return fo(r.get);if(typeof r.value=="function")return fo(r.value)}e=Ine(e)}function n(){return null}return n}const HP=_r(["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"]),_y=_r(["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"]),Sy=_r(["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"]),Bne=_r(["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"]),Cy=_r(["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"]),Vne=_r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),WP=_r(["#text"]),UP=_r(["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"]),Ey=_r(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),qP=_r(["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"]),Tp=_r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Hne=ko(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Wne=ko(/<%[\w\W]*|[\w\W]*%>/gm),Une=ko(/\${[\w\W]*}/gm),qne=ko(/^data-[\-\w.\u00B7-\uFFFF]/),Gne=ko(/^aria-[\-\w]+$/),wM=ko(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yne=ko(/^(?:\w+script|data):/i),Kne=ko(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_M=ko(/^html$/i),Xne=ko(/^[a-z][.\w]*(-[.\w]+)+$/i);var GP=Object.freeze({__proto__:null,MUSTACHE_EXPR:Hne,ERB_EXPR:Wne,TMPLIT_EXPR:Une,DATA_ATTR:qne,ARIA_ATTR:Gne,IS_ALLOWED_URI:wM,IS_SCRIPT_OR_DATA:Yne,ATTR_WHITESPACE:Kne,DOCTYPE_NAME:_M,CUSTOM_ELEMENT:Xne});const Gu={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qne=function(){return typeof window>"u"?null:window},Jne=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function SM(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qne();const t=Ae=>SM(Ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==Gu.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:g}=e,v=l.prototype,b=qu(v,"cloneNode"),w=qu(v,"remove"),x=qu(v,"nextSibling"),_=qu(v,"childNodes"),S=qu(v,"parentNode");if(typeof s=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let C,E="";const{implementation:P,createNodeIterator:A,createDocumentFragment:k,getElementsByTagName:I}=n,{importNode:$}=r;let L={};t.isSupported=typeof yM=="function"&&typeof S=="function"&&P&&P.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:j,ERB_EXPR:Q,TMPLIT_EXPR:ee,DATA_ATTR:B,ARIA_ATTR:Z,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:K}=GP;let{IS_ALLOWED_URI:T}=GP,V=null;const X=Tt({},[...HP,..._y,...Sy,...Cy,...WP]);let N=null;const ie=Tt({},[...UP,...Ey,...qP,...Tp]);let fe=Object.seal(xM(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}})),ue=null,pe=null,se=!0,ne=!0,le=!1,ye=!0,Y=!1,be=!0,_e=!1,Pe=!1,Te=!1,Ue=!1,Be=!1,Ie=!1,Ke=!0,lt=!1;const It="user-content-";let At=!0,Ht=!1,de={},Ee=null;const Le=Tt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Ze=Tt({},["audio","video","img","source","image","track"]);let Wt=null;const Zt=Tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",vn="http://www.w3.org/2000/svg",ln="http://www.w3.org/1999/xhtml";let Lt=ln,tn=!1,xn=null;const nt=Tt({},[Kt,vn,ln],wy);let ht=null;const $t=["application/xhtml+xml","text/html"],Xt="text/html";let bt=null,Rn=null;const Lo=n.createElement("form"),ms=function(U){return U instanceof RegExp||U instanceof Function},Fo=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Rn&&Rn===U)){if((!U||typeof U!="object")&&(U={}),U=za(U),ht=$t.indexOf(U.PARSER_MEDIA_TYPE)===-1?Xt:U.PARSER_MEDIA_TYPE,bt=ht==="application/xhtml+xml"?wy:sg,V=Uo(U,"ALLOWED_TAGS")?Tt({},U.ALLOWED_TAGS,bt):X,N=Uo(U,"ALLOWED_ATTR")?Tt({},U.ALLOWED_ATTR,bt):ie,xn=Uo(U,"ALLOWED_NAMESPACES")?Tt({},U.ALLOWED_NAMESPACES,wy):nt,Wt=Uo(U,"ADD_URI_SAFE_ATTR")?Tt(za(Zt),U.ADD_URI_SAFE_ATTR,bt):Zt,Ge=Uo(U,"ADD_DATA_URI_TAGS")?Tt(za(Ze),U.ADD_DATA_URI_TAGS,bt):Ze,Ee=Uo(U,"FORBID_CONTENTS")?Tt({},U.FORBID_CONTENTS,bt):Le,ue=Uo(U,"FORBID_TAGS")?Tt({},U.FORBID_TAGS,bt):{},pe=Uo(U,"FORBID_ATTR")?Tt({},U.FORBID_ATTR,bt):{},de=Uo(U,"USE_PROFILES")?U.USE_PROFILES:!1,se=U.ALLOW_ARIA_ATTR!==!1,ne=U.ALLOW_DATA_ATTR!==!1,le=U.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=U.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=U.SAFE_FOR_TEMPLATES||!1,be=U.SAFE_FOR_XML!==!1,_e=U.WHOLE_DOCUMENT||!1,Ue=U.RETURN_DOM||!1,Be=U.RETURN_DOM_FRAGMENT||!1,Ie=U.RETURN_TRUSTED_TYPE||!1,Te=U.FORCE_BODY||!1,Ke=U.SANITIZE_DOM!==!1,lt=U.SANITIZE_NAMED_PROPS||!1,At=U.KEEP_CONTENT!==!1,Ht=U.IN_PLACE||!1,T=U.ALLOWED_URI_REGEXP||wM,Lt=U.NAMESPACE||ln,fe=U.CUSTOM_ELEMENT_HANDLING||{},U.CUSTOM_ELEMENT_HANDLING&&ms(U.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(fe.tagNameCheck=U.CUSTOM_ELEMENT_HANDLING.tagNameCheck),U.CUSTOM_ELEMENT_HANDLING&&ms(U.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(fe.attributeNameCheck=U.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),U.CUSTOM_ELEMENT_HANDLING&&typeof U.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=U.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(ne=!1),Be&&(Ue=!0),de&&(V=Tt({},WP),N=[],de.html===!0&&(Tt(V,HP),Tt(N,UP)),de.svg===!0&&(Tt(V,_y),Tt(N,Ey),Tt(N,Tp)),de.svgFilters===!0&&(Tt(V,Sy),Tt(N,Ey),Tt(N,Tp)),de.mathMl===!0&&(Tt(V,Cy),Tt(N,qP),Tt(N,Tp))),U.ADD_TAGS&&(V===X&&(V=za(V)),Tt(V,U.ADD_TAGS,bt)),U.ADD_ATTR&&(N===ie&&(N=za(N)),Tt(N,U.ADD_ATTR,bt)),U.ADD_URI_SAFE_ATTR&&Tt(Wt,U.ADD_URI_SAFE_ATTR,bt),U.FORBID_CONTENTS&&(Ee===Le&&(Ee=za(Ee)),Tt(Ee,U.FORBID_CONTENTS,bt)),At&&(V["#text"]=!0),_e&&Tt(V,["html","head","body"]),V.table&&(Tt(V,["tbody"]),delete ue.tbody),U.TRUSTED_TYPES_POLICY){if(typeof U.TRUSTED_TYPES_POLICY.createHTML!="function")throw Uu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof U.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Uu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=U.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=Jne(g,o)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));_r&&_r(U),Rn=U}},Ai=Tt({},["mi","mo","mn","ms","mtext"]),ni=Tt({},["foreignobject","annotation-xml"]),$i=Tt({},["title","style","font","a","script"]),vs=Tt({},[..._y,...Sy,...Bne]),ri=Tt({},[...Cy,...Vne]),ki=function(U){let me=S(U);(!me||!me.tagName)&&(me={namespaceURI:Lt,tagName:"template"});const ke=sg(U.tagName),st=sg(me.tagName);return xn[U.namespaceURI]?U.namespaceURI===vn?me.namespaceURI===ln?ke==="svg":me.namespaceURI===Kt?ke==="svg"&&(st==="annotation-xml"||Ai[st]):!!vs[ke]:U.namespaceURI===Kt?me.namespaceURI===ln?ke==="math":me.namespaceURI===vn?ke==="math"&&ni[st]:!!ri[ke]:U.namespaceURI===ln?me.namespaceURI===vn&&!ni[st]||me.namespaceURI===Kt&&!Ai[st]?!1:!ri[ke]&&($i[ke]||!vs[ke]):!!(ht==="application/xhtml+xml"&&xn[U.namespaceURI]):!1},jn=function(U){Hu(t.removed,{element:U});try{S(U).removeChild(U)}catch{w(U)}},oi=function(U,me){try{Hu(t.removed,{attribute:me.getAttributeNode(U),from:me})}catch{Hu(t.removed,{attribute:null,from:me})}if(me.removeAttribute(U),U==="is"&&!N[U])if(Ue||Be)try{jn(me)}catch{}else try{me.setAttribute(U,"")}catch{}},bs=function(U){let me=null,ke=null;if(Te)U="<remove></remove>"+U;else{const ft=VP(U,/^[\r\n\t ]+/);ke=ft&&ft[0]}ht==="application/xhtml+xml"&&Lt===ln&&(U='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+U+"</body></html>");const st=C?C.createHTML(U):U;if(Lt===ln)try{me=new h().parseFromString(st,ht)}catch{}if(!me||!me.documentElement){me=P.createDocument(Lt,"template",null);try{me.documentElement.innerHTML=tn?E:st}catch{}}const bn=me.body||me.documentElement;return U&&ke&&bn.insertBefore(n.createTextNode(ke),bn.childNodes[0]||null),Lt===ln?I.call(me,_e?"html":"body")[0]:_e?me.documentElement:bn},ys=function(U){return A.call(U.ownerDocument||U,U,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},D=function(U){return U instanceof f&&(typeof U.nodeName!="string"||typeof U.textContent!="string"||typeof U.removeChild!="function"||!(U.attributes instanceof u)||typeof U.removeAttribute!="function"||typeof U.setAttribute!="function"||typeof U.namespaceURI!="string"||typeof U.insertBefore!="function"||typeof U.hasChildNodes!="function")},te=function(U){return typeof a=="function"&&U instanceof a},ce=function(U,me,ke){L[U]&&Pp(L[U],st=>{st.call(t,me,ke,Rn)})},Oe=function(U){let me=null;if(ce("beforeSanitizeElements",U,null),D(U))return jn(U),!0;const ke=bt(U.nodeName);if(ce("uponSanitizeElement",U,{tagName:ke,allowedTags:V}),U.hasChildNodes()&&!te(U.firstElementChild)&&gr(/<[/\w]/g,U.innerHTML)&&gr(/<[/\w]/g,U.textContent)||U.nodeType===Gu.progressingInstruction||be&&U.nodeType===Gu.comment&&gr(/<[/\w]/g,U.data))return jn(U),!0;if(!V[ke]||ue[ke]){if(!ue[ke]&&qe(ke)&&(fe.tagNameCheck instanceof RegExp&&gr(fe.tagNameCheck,ke)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(ke)))return!1;if(At&&!Ee[ke]){const st=S(U)||U.parentNode,bn=_(U)||U.childNodes;if(bn&&st){const ft=bn.length;for(let tr=ft-1;tr>=0;--tr){const go=b(bn[tr],!0);go.__removalCount=(U.__removalCount||0)+1,st.insertBefore(go,x(U))}}}return jn(U),!0}return U instanceof l&&!ki(U)||(ke==="noscript"||ke==="noembed"||ke==="noframes")&&gr(/<\/no(script|embed|frames)/i,U.innerHTML)?(jn(U),!0):(Y&&U.nodeType===Gu.text&&(me=U.textContent,Pp([j,Q,ee],st=>{me=Wu(me,st," ")}),U.textContent!==me&&(Hu(t.removed,{element:U.cloneNode()}),U.textContent=me)),ce("afterSanitizeElements",U,null),!1)},He=function(U,me,ke){if(Ke&&(me==="id"||me==="name")&&(ke in n||ke in Lo))return!1;if(!(ne&&!pe[me]&&gr(B,me))){if(!(se&&gr(Z,me))){if(!N[me]||pe[me]){if(!(qe(U)&&(fe.tagNameCheck instanceof RegExp&&gr(fe.tagNameCheck,U)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(U))&&(fe.attributeNameCheck instanceof RegExp&&gr(fe.attributeNameCheck,me)||fe.attributeNameCheck instanceof Function&&fe.attributeNameCheck(me))||me==="is"&&fe.allowCustomizedBuiltInElements&&(fe.tagNameCheck instanceof RegExp&&gr(fe.tagNameCheck,ke)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(ke))))return!1}else if(!Wt[me]){if(!gr(T,Wu(ke,q,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&U!=="script"&&Lne(ke,"data:")===0&&Ge[U])){if(!(le&&!gr(G,Wu(ke,q,"")))){if(ke)return!1}}}}}}return!0},qe=function(U){return U!=="annotation-xml"&&VP(U,K)},ze=function(U){ce("beforeSanitizeAttributes",U,null);const{attributes:me}=U;if(!me)return;const ke={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:N};let st=me.length;for(;st--;){const bn=me[st],{name:ft,namespaceURI:tr,value:go}=bn,ya=bt(ft);let zn=ft==="value"?go:Fne(go);if(ke.attrName=ya,ke.attrValue=zn,ke.keepAttr=!0,ke.forceKeepAttr=void 0,ce("uponSanitizeAttribute",U,ke),zn=ke.attrValue,be&&gr(/((--!?|])>)|<\/(style|title)/i,zn)){oi(ft,U);continue}if(ke.forceKeepAttr||(oi(ft,U),!ke.keepAttr))continue;if(!ye&&gr(/\/>/i,zn)){oi(ft,U);continue}Y&&Pp([j,Q,ee],pu=>{zn=Wu(zn,pu," ")});const hu=bt(U.nodeName);if(He(hu,ya,zn)){if(lt&&(ya==="id"||ya==="name")&&(oi(ft,U),zn=It+zn),C&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!tr)switch(g.getAttributeType(hu,ya)){case"TrustedHTML":{zn=C.createHTML(zn);break}case"TrustedScriptURL":{zn=C.createScriptURL(zn);break}}try{tr?U.setAttributeNS(tr,ft,zn):U.setAttribute(ft,zn),D(U)?jn(U):BP(t.removed)}catch{}}}ce("afterSanitizeAttributes",U,null)},Fe=function Ae(U){let me=null;const ke=ys(U);for(ce("beforeSanitizeShadowDOM",U,null);me=ke.nextNode();)ce("uponSanitizeShadowNode",me,null),!Oe(me)&&(me.content instanceof i&&Ae(me.content),ze(me));ce("afterSanitizeShadowDOM",U,null)};return t.sanitize=function(Ae){let U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,ke=null,st=null,bn=null;if(tn=!Ae,tn&&(Ae="<!-->"),typeof Ae!="string"&&!te(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw Uu("dirty is not a string, aborting")}else throw Uu("toString is not a function");if(!t.isSupported)return Ae;if(Pe||Fo(U),t.removed=[],typeof Ae=="string"&&(Ht=!1),Ht){if(Ae.nodeName){const go=bt(Ae.nodeName);if(!V[go]||ue[go])throw Uu("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof a)me=bs("<!---->"),ke=me.ownerDocument.importNode(Ae,!0),ke.nodeType===Gu.element&&ke.nodeName==="BODY"||ke.nodeName==="HTML"?me=ke:me.appendChild(ke);else{if(!Ue&&!Y&&!_e&&Ae.indexOf("<")===-1)return C&&Ie?C.createHTML(Ae):Ae;if(me=bs(Ae),!me)return Ue?null:Ie?E:""}me&&Te&&jn(me.firstChild);const ft=ys(Ht?Ae:me);for(;st=ft.nextNode();)Oe(st)||(st.content instanceof i&&Fe(st.content),ze(st));if(Ht)return Ae;if(Ue){if(Be)for(bn=k.call(me.ownerDocument);me.firstChild;)bn.appendChild(me.firstChild);else bn=me;return(N.shadowroot||N.shadowrootmode)&&(bn=$.call(r,bn,!0)),bn}let tr=_e?me.outerHTML:me.innerHTML;return _e&&V["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&gr(_M,me.ownerDocument.doctype.name)&&(tr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
|
|
316
|
-
`+tr),Y&&Pp([j,Q,ee],go=>{tr=Wu(tr,go," ")}),C&&Ie?C.createHTML(tr):tr},t.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fo(Ae),Pe=!0},t.clearConfig=function(){Rn=null,Pe=!1},t.isValidAttribute=function(Ae,U,me){Rn||Fo({});const
|
|
315
|
+
`)},cte=0,tc=[];function ute(e){var t=H.useRef([]),n=H.useRef([0,0]),r=H.useRef(),o=H.useState(cte++)[0],i=H.useState(function(){return n_()})[0],s=H.useRef(e);H.useEffect(function(){s.current=e},[e]),H.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=Mk([e.lockRef.current],(e.shards||[]).map(kP),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=H.useCallback(function(b,w){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=Rp(b),_=n.current,S="deltaX"in b?b.deltaX:_[0]-x[0],C="deltaY"in b?b.deltaY:_[1]-x[1],E,P=b.target,A=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in b&&A==="h"&&P.type==="range")return!1;var k=AP(A,P);if(!k)return!0;if(k?E=A:(E=A==="v"?"h":"v",k=AP(A,P)),!k)return!1;if(!r.current&&"changedTouches"in b&&(S||C)&&(r.current=E),!E)return!0;var I=r.current||E;return ste(I,w,b,I==="h"?S:C,!0)},[]),l=H.useCallback(function(b){var w=b;if(!(!tc.length||tc[tc.length-1]!==i)){var x="deltaY"in w?$P(w):Rp(w),_=t.current.filter(function(E){return E.name===w.type&&E.target===w.target&&ate(E.delta,x)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(kP).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=S.length>0?a(w,S[0]):!s.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),c=H.useCallback(function(b,w,x,_){var S={name:b,delta:w,target:x,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=H.useCallback(function(b){n.current=Rp(b),r.current=void 0},[]),f=H.useCallback(function(b){c(b.type,$P(b),b.target,a(b,e.lockRef.current))},[]),h=H.useCallback(function(b){c(b.type,Rp(b),b.target,a(b,e.lockRef.current))},[]);H.useEffect(function(){return tc.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ec),document.addEventListener("touchmove",l,ec),document.addEventListener("touchstart",u,ec),function(){tc=tc.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,ec),document.removeEventListener("touchmove",l,ec),document.removeEventListener("touchstart",u,ec)}},[]);var g=e.removeScrollBar,v=e.inert;return H.createElement(H.Fragment,null,v?H.createElement(i,{styles:lte(o)}):null,g?H.createElement(zk,{gapMode:"margin"}):null)}const dte=Fk(jk,ute);var Wk=H.forwardRef(function(e,t){return H.createElement(Bm,lr({},e,{ref:t,sideCar:dte}))});Wk.classNames=Bm.classNames;const r_=Wk,fte=[" ","Enter","ArrowUp","ArrowDown"],hte=[" ","Enter"],Vm="Select",[Hm,Wm,pte]=um(Vm),[lu,bye]=Zn(Vm,[pte,Ti]),o_=Ti(),[gte,Rl]=lu(Vm),[mte,vte]=lu(Vm),bte=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:h,required:g}=e,v=o_(t),[b,w]=m.useState(null),[x,_]=m.useState(null),[S,C]=m.useState(!1),E=_l(c),[P=!1,A]=wr({prop:r,defaultProp:o,onChange:i}),[k,I]=wr({prop:s,defaultProp:a,onChange:l}),$=m.useRef(null),L=b?!!b.closest("form"):!0,[j,Q]=m.useState(new Set),ee=Array.from(j).map(B=>B.props.value).join(";");return m.createElement(Bf,v,m.createElement(gte,{required:g,scope:t,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Jo(),value:k,onValueChange:I,open:P,onOpenChange:A,dir:E,triggerPointerDownPosRef:$,disabled:h},m.createElement(Hm.Provider,{scope:t},m.createElement(mte,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(B=>{Q(Z=>new Set(Z).add(B))},[]),onNativeOptionRemove:m.useCallback(B=>{Q(Z=>{const G=new Set(Z);return G.delete(B),G})},[])},n)),L?m.createElement(Kk,{key:ee,"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:f,value:k,onChange:B=>I(B.target.value),disabled:h},k===void 0?m.createElement("option",{value:""}):null,Array.from(j)):null))},yte="SelectTrigger",xte=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=o_(n),s=Rl(yte,n),a=s.disabled||r,l=_t(t,s.onTriggerChange),c=Wm(n),[u,f,h]=Xk(v=>{const b=c().filter(_=>!_.disabled),w=b.find(_=>_.value===s.value),x=Qk(b,v,w);x!==void 0&&s.onValueChange(x.value)}),g=()=>{a||(s.onOpenChange(!0),h())};return m.createElement(Vf,he({asChild:!0},i),m.createElement(Qe.button,he({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":Yk(s.value)?"":void 0},o,{ref:l,onClick:Me(o.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Me(o.onPointerDown,v=>{const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(g(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Me(o.onKeyDown,v=>{const b=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(b&&v.key===" ")&&fte.includes(v.key)&&(g(),v.preventDefault())})})))}),wte="SelectValue",_te=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Rl(wte,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=_t(t,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),m.createElement(Qe.span,he({},a,{ref:f,style:{pointerEvents:"none"}}),Yk(l.value)?m.createElement(m.Fragment,null,s):i)}),Ste=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Qe.span,he({"aria-hidden":!0},o,{ref:t}),r||"▼")}),Cte=e=>m.createElement(M1,he({asChild:!0},e)),Jc="SelectContent",Ete=m.forwardRef((e,t)=>{const n=Rl(Jc,e.__scopeSelect),[r,o]=m.useState();if(ur(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Mo.createPortal(m.createElement(Uk,{scope:e.__scopeSelect},m.createElement(Hm.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(Rte,he({},e,{ref:t}))}),Ki=10,[Uk,Ol]=lu(Jc),Rte=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:w,...x}=e,_=Rl(Jc,n),[S,C]=m.useState(null),[E,P]=m.useState(null),A=_t(t,pe=>C(pe)),[k,I]=m.useState(null),[$,L]=m.useState(null),j=Wm(n),[Q,ee]=m.useState(!1),B=m.useRef(!1);m.useEffect(()=>{if(S)return zm(S)},[S]),Z1();const Z=m.useCallback(pe=>{const[se,...ne]=j().map(Y=>Y.ref.current),[le]=ne.slice(-1),ye=document.activeElement;for(const Y of pe)if(Y===ye||(Y==null||Y.scrollIntoView({block:"nearest"}),Y===se&&E&&(E.scrollTop=0),Y===le&&E&&(E.scrollTop=E.scrollHeight),Y==null||Y.focus(),document.activeElement!==ye))return},[j,E]),G=m.useCallback(()=>Z([k,S]),[Z,k,S]);m.useEffect(()=>{Q&&G()},[Q,G]);const{onOpenChange:q,triggerPointerDownPosRef:K}=_;m.useEffect(()=>{if(S){let pe={x:0,y:0};const se=le=>{var ye,Y,be,_e;pe={x:Math.abs(Math.round(le.pageX)-((ye=(Y=K.current)===null||Y===void 0?void 0:Y.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(le.pageY)-((be=(_e=K.current)===null||_e===void 0?void 0:_e.y)!==null&&be!==void 0?be:0))}},ne=le=>{pe.x<=10&&pe.y<=10?le.preventDefault():S.contains(le.target)||q(!1),document.removeEventListener("pointermove",se),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",ne,{capture:!0})}}},[S,q,K]),m.useEffect(()=>{const pe=()=>q(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[q]);const[T,V]=Xk(pe=>{const se=j().filter(ye=>!ye.disabled),ne=se.find(ye=>ye.ref.current===document.activeElement),le=Qk(se,pe,ne);le&&setTimeout(()=>le.ref.current.focus())}),X=m.useCallback((pe,se,ne)=>{const le=!B.current&&!ne;(_.value!==void 0&&_.value===se||le)&&(I(pe),le&&(B.current=!0))},[_.value]),N=m.useCallback(()=>S==null?void 0:S.focus(),[S]),ie=m.useCallback((pe,se,ne)=>{const le=!B.current&&!ne;(_.value!==void 0&&_.value===se||le)&&L(pe)},[_.value]),fe=r==="popper"?MP:Ote,ue=fe===MP?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:w}:{};return m.createElement(Uk,{scope:n,content:S,viewport:E,onViewportChange:P,itemRefCallback:X,selectedItem:k,onItemLeave:N,itemTextRefCallback:ie,focusSelectedItem:G,selectedItemText:$,position:r,isPositioned:Q,searchRef:T},m.createElement(r_,{as:$k,allowPinchZoom:!0},m.createElement(e_,{asChild:!0,trapped:_.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:Me(o,pe=>{var se;(se=_.trigger)===null||se===void 0||se.focus({preventScroll:!0}),pe.preventDefault()})},m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(fe,he({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:pe=>pe.preventDefault()},x,ue,{onPlaced:()=>ee(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Me(x.onKeyDown,pe=>{const se=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!se&&pe.key.length===1&&V(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let le=j().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const ye=pe.target,Y=le.indexOf(ye);le=le.slice(Y+1)}setTimeout(()=>Z(le)),pe.preventDefault()}})}))))))}),Ote=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Rl(Jc,n),s=Ol(Jc,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=_t(t,A=>u(A)),h=Wm(n),g=m.useRef(!1),v=m.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:x,focusSelectedItem:_}=s,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&b&&w&&x){const A=i.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),$=x.getBoundingClientRect();if(i.dir!=="rtl"){const ye=$.left-k.left,Y=I.left-ye,be=A.left-Y,_e=A.width+be,Pe=Math.max(_e,k.width),Te=window.innerWidth-Ki,Ue=Ax(Y,[Ki,Te-Pe]);a.style.minWidth=_e+"px",a.style.left=Ue+"px"}else{const ye=k.right-$.right,Y=window.innerWidth-I.right-ye,be=window.innerWidth-A.right-Y,_e=A.width+be,Pe=Math.max(_e,k.width),Te=window.innerWidth-Ki,Ue=Ax(Y,[Ki,Te-Pe]);a.style.minWidth=_e+"px",a.style.right=Ue+"px"}const L=h(),j=window.innerHeight-Ki*2,Q=b.scrollHeight,ee=window.getComputedStyle(c),B=parseInt(ee.borderTopWidth,10),Z=parseInt(ee.paddingTop,10),G=parseInt(ee.borderBottomWidth,10),q=parseInt(ee.paddingBottom,10),K=B+Z+Q+q+G,T=Math.min(w.offsetHeight*5,K),V=window.getComputedStyle(b),X=parseInt(V.paddingTop,10),N=parseInt(V.paddingBottom,10),ie=A.top+A.height/2-Ki,fe=j-ie,ue=w.offsetHeight/2,pe=w.offsetTop+ue,se=B+Z+pe,ne=K-se;if(se<=ie){const ye=w===L[L.length-1].ref.current;a.style.bottom="0px";const Y=c.clientHeight-b.offsetTop-b.offsetHeight,be=Math.max(fe,ue+(ye?N:0)+Y+G),_e=se+be;a.style.height=_e+"px"}else{const ye=w===L[0].ref.current;a.style.top="0px";const be=Math.max(ie,B+b.offsetTop+(ye?X:0)+ue)+ne;a.style.height=be+"px",b.scrollTop=se-ie+b.offsetTop}a.style.margin=`${Ki}px 0`,a.style.minHeight=T+"px",a.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[h,i.trigger,i.valueNode,a,c,b,w,x,i.dir,r]);ur(()=>S(),[S]);const[C,E]=m.useState();ur(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const P=m.useCallback(A=>{A&&v.current===!0&&(S(),_==null||_(),v.current=!1)},[S,_]);return m.createElement(Pte,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:P},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C}},m.createElement(Qe.div,he({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),MP=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ki,...i}=e,s=o_(n);return m.createElement(Hf,he({},s,i,{ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[Pte,i_]=lu(Jc,{}),IP="SelectViewport",Tte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ol(IP,n),i=i_(IP,n),s=_t(t,o.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(Hm.Slot,{scope:n},m.createElement(Qe.div,he({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Me(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&u){const h=Math.abs(a.current-c.scrollTop);if(h>0){const g=window.innerHeight-Ki*2,v=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),w=Math.max(v,b);if(w<g){const x=w+h,_=Math.min(g,x),S=x-_;u.style.height=_+"px",u.style.bottom==="0px"&&(c.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),Dte="SelectGroup",[Ate,$te]=lu(Dte),kte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Jo();return m.createElement(Ate,{scope:n,id:o},m.createElement(Qe.div,he({role:"group","aria-labelledby":o},r,{ref:t})))}),Mte="SelectLabel",Ite=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=$te(Mte,n);return m.createElement(Qe.div,he({id:o.id},r,{ref:t}))}),Mx="SelectItem",[Nte,qk]=lu(Mx),Lte=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Rl(Mx,n),l=Ol(Mx,n),c=a.value===r,[u,f]=m.useState(i??""),[h,g]=m.useState(!1),v=_t(t,x=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,x,r,o)}),b=Jo(),w=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.createElement(Nte,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:m.useCallback(x=>{f(_=>{var S;return _||((S=x==null?void 0:x.textContent)!==null&&S!==void 0?S:"").trim()})},[])},m.createElement(Hm.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(Qe.div,he({role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:v,onFocus:Me(s.onFocus,()=>g(!0)),onBlur:Me(s.onBlur,()=>g(!1)),onPointerUp:Me(s.onPointerUp,w),onPointerMove:Me(s.onPointerMove,x=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(s.onPointerLeave,x=>{if(x.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:Me(s.onKeyDown,x=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&x.key===" "||(hte.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})}))))}),Op="SelectItemText",Fte=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Rl(Op,n),a=Ol(Op,n),l=qk(Op,n),c=vte(Op,n),[u,f]=m.useState(null),h=_t(t,x=>f(x),l.onItemTextChange,x=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.call(a,x,l.value,l.disabled)}),g=u==null?void 0:u.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},g),[l.disabled,l.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=c;return ur(()=>(b(v),()=>w(v)),[b,w,v]),m.createElement(m.Fragment,null,m.createElement(Qe.span,he({id:l.textId},i,{ref:h})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Mo.createPortal(i.children,s.valueNode):null)}),jte="SelectItemIndicator",zte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qk(jte,n).isSelected?m.createElement(Qe.span,he({"aria-hidden":!0},r,{ref:t})):null}),NP="SelectScrollUpButton",Bte=m.forwardRef((e,t)=>{const n=Ol(NP,e.__scopeSelect),r=i_(NP,e.__scopeSelect),[o,i]=m.useState(!1),s=_t(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;i(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(Gk,he({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),LP="SelectScrollDownButton",Vte=m.forwardRef((e,t)=>{const n=Ol(LP,e.__scopeSelect),r=i_(LP,e.__scopeSelect),[o,i]=m.useState(!1),s=_t(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)<c;i(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(Gk,he({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),Gk=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ol("SelectScrollButton",n),s=m.useRef(null),a=Wm(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),ur(()=>{var c;const u=a().find(f=>f.ref.current===document.activeElement);u==null||(c=u.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(Qe.div,he({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:Me(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Me(o.onPointerMove,()=>{var c;(c=i.onItemLeave)===null||c===void 0||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Me(o.onPointerLeave,()=>{l()})}))}),Hte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Qe.div,he({"aria-hidden":!0},r,{ref:t}))});function Yk(e){return e===""||e===void 0}const Kk=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=_t(t,o),s=jm(n);return m.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(tk,{asChild:!0},m.createElement("select",he({},r,{ref:i,defaultValue:n})))});Kk.displayName="BubbleSelect";function Xk(e){const t=Ln(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Qk(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Wte(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Wte(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Ute=bte,Jk=xte,qte=_te,Gte=Ste,Yte=Cte,Zk=Ete,Kte=Tte,Xte=kte,eM=Ite,tM=Lte,Qte=Fte,Jte=zte,nM=Bte,rM=Vte,oM=Hte,zs=Ute,dc=Xte,Bs=qte,Qi=H.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(Jk,{ref:r,className:Ce("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,O.jsx(Gte,{asChild:!0,children:O.jsx(Am,{className:"h-4 w-4 opacity-50"})})]}));Qi.displayName=Jk.displayName;const iM=H.forwardRef(({className:e,...t},n)=>O.jsx(nM,{ref:n,className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(JX,{className:"h-4 w-4"})}));iM.displayName=nM.displayName;const sM=H.forwardRef(({className:e,...t},n)=>O.jsx(rM,{ref:n,className:Ce("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(Am,{className:"h-4 w-4"})}));sM.displayName=rM.displayName;const Ji=H.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>O.jsx(Yte,{children:O.jsx(au,{children:O.jsxs(Zk,{ref:o,className:Ce("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:[O.jsx(iM,{}),O.jsx(Kte,{className:Ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),O.jsx(sM,{})]})})}));Ji.displayName=Zk.displayName;const Va=H.forwardRef(({className:e,...t},n)=>O.jsx(eM,{ref:n,className:Ce("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Va.displayName=eM.displayName;const Hn=H.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(tM,{ref:r,className:Ce("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(Jte,{children:O.jsx(Ff,{className:"h-4 w-4"})})}),O.jsx(Qte,{children:t})]}));Hn.displayName=tM.displayName;const Lg=H.forwardRef(({className:e,...t},n)=>O.jsx(oM,{ref:n,className:Ce("-mx-1 my-1 h-px bg-muted",e),...t}));Lg.displayName=oM.displayName;function Zte(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ene(...e){return t=>e.forEach(n=>Zte(n,t))}var Um=H.forwardRef((e,t)=>{const{children:n,...r}=e,o=H.Children.toArray(n),i=o.find(tne);if(i){const s=i.props.children,a=o.map(l=>l===i?H.Children.count(s)>1?H.Children.only(null):H.isValidElement(s)?s.props.children:null:l);return O.jsx(Ix,{...r,ref:t,children:H.isValidElement(s)?H.cloneElement(s,void 0,a):null})}return O.jsx(Ix,{...r,ref:t,children:n})});Um.displayName="Slot";var Ix=H.forwardRef((e,t)=>{const{children:n,...r}=e;if(H.isValidElement(n)){const o=rne(n);return H.cloneElement(n,{...nne(r,n.props),ref:t?ene(t,o):o})}return H.Children.count(n)>1?H.Children.only(null):null});Ix.displayName="SlotClone";var aM=({children:e})=>O.jsx(O.Fragment,{children:e});function tne(e){return H.isValidElement(e)&&e.type===aM}function nne(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function rne(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const FP=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,jP=ug,s_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return jP(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],f=i==null?void 0:i[c];if(u===null)return null;const h=FP(u)||FP(f);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...g}=u;return Object.entries(g).every(v=>{let[b,w]=v;return Array.isArray(w)?w.includes({...i,...a}[b]):{...i,...a}[b]===w})?[...c,f,h]:c},[]);return jP(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Vd=s_("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"}}),xr=H.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Um:"button";return O.jsx(s,{className:Ce(Vd({variant:t,size:n,className:e})),ref:i,...o})});xr.displayName="Button";const one=m.forwardRef((e,t)=>m.createElement(Qe.label,he({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),lM=one,ine=s_("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wn=H.forwardRef(({className:e,...t},n)=>O.jsx(lM,{ref:n,className:Ce(ine(),e),...t}));Wn.displayName=lM.displayName;const cM=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(ane);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Nx,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Nx,he({},r,{ref:t}),n)});cM.displayName="Slot";const Nx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...lne(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Nx.displayName="SlotClone";const sne=({children:e})=>m.createElement(m.Fragment,null,e);function ane(e){return m.isValidElement(e)&&e.type===sne}function lne(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const uM="Popover",[dM,yye]=Zn(uM,[Ti]),a_=Ti(),[cne,cu]=dM(uM),une=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=a_(t),l=m.useRef(null),[c,u]=m.useState(!1),[f=!1,h]=wr({prop:r,defaultProp:o,onChange:i});return m.createElement(Bf,a,m.createElement(cne,{scope:t,contentId:Jo(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(g=>!g),[h]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},dne="PopoverTrigger",fne=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cu(dne,n),i=a_(n),s=_t(t,o.triggerRef),a=m.createElement(Qe.button,he({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":pM(o.open)},r,{ref:s,onClick:Me(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(Vf,he({asChild:!0},i),a)}),fM="PopoverPortal",[hne,pne]=dM(fM,{forceMount:void 0}),gne=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=cu(fM,t);return m.createElement(hne,{scope:t,forceMount:n},m.createElement(er,{present:n||i.open},m.createElement(M1,{asChild:!0,container:o},r)))},Hd="PopoverContent",mne=m.forwardRef((e,t)=>{const n=pne(Hd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=cu(Hd,e.__scopePopover);return m.createElement(er,{present:r||i.open},i.modal?m.createElement(vne,he({},o,{ref:t})):m.createElement(bne,he({},o,{ref:t})))}),vne=m.forwardRef((e,t)=>{const n=cu(Hd,e.__scopePopover),r=m.useRef(null),o=_t(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return zm(s)},[]),m.createElement(r_,{as:cM,allowPinchZoom:!0},m.createElement(hM,he({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Me(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Me(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),bne=m.forwardRef((e,t)=>{const n=cu(Hd,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(hM,he({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),hM=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,h=cu(Hd,n),g=a_(n);return Z1(),m.createElement(e_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1)},m.createElement(Hf,he({"data-state":pM(h.open),role:"dialog",id:h.contentId},g,f,{ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function pM(e){return e?"open":"closed"}const yne=une,xne=fne,wne=gne,gM=mne,qm=yne,Gm=xne,Wf=H.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>O.jsx(wne,{children:O.jsx(au,{children:O.jsx(gM,{ref:o,align:t,sideOffset:n,className:Ce("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})}));Wf.displayName=gM.displayName;function _ne(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}const xc=H.forwardRef(({className:e,type:t,...n},r)=>O.jsx("input",{type:t,className:Ce("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}));xc.displayName="Input";function mM({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function o(s){const a=[...e];a.splice(s,1),t(a)}function i(){t([...e,n])}return O.jsxs("div",{className:"space-y-3",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Wn,{children:"Color Range"}),O.jsx(xr,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:O.jsx(R1,{className:"size-3"})})]}),e.map((s,a)=>O.jsxs("div",{className:"flex items-center gap-2 px-2",children:[O.jsx(xc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:Ce(`h-7 ${Kp}`)}),O.jsx("span",{children:"-"}),O.jsx(xc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:Ce(`h-7 ${Kp}`)}),O.jsx(xc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:Ce(`h-7 min-w-14 p-0 ${Kp}`),type:"color",list:"presetColors"}),O.jsxs("datalist",{id:"presetColors",children:[O.jsx("option",{children:Bt.green[600]}),O.jsx("option",{children:Bt.red[500]}),O.jsx("option",{children:Bt.yellow[400]}),O.jsx("option",{children:Bt.orange[500]})]}),O.jsx(xr,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:O.jsx($m,{className:"size-3"})})]},a))]})}const Sne=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=wr({prop:n,onChange:o,defaultProp:r});return m.createElement(Qe.button,he({type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:Me(e.onClick,()=>{e.disabled||a(!s)})}))}),vM=Sne,Cne=s_("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"}}),l_=H.forwardRef(({className:e,variant:t,size:n,...r},o)=>O.jsx(vM,{ref:o,className:Ce(Cne({variant:t,size:n,className:e})),...r}));l_.displayName=vM.displayName;function Ene(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function Rne(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function One(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function Pne(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function Tne(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function Dne(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function Ane(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function $ne({columnIndex:e,columnName:t}){const[n,r]=m.useState(!1),o=br(I=>{var $;return($=I.card)==null?void 0:$.preferences}),[i,s]=m.useState(Ene(o,e)),[a,l]=m.useState(Dne(o,e)),[c,u]=m.useState(Rne(o,e)),[f,h]=m.useState(One(o,e)),[g,v]=m.useState(Pne(o,e)),[b,w]=m.useState(Tne(o,e).toString()),[x,_]=m.useState(Ane(o,e));m.useState("");const S=br(I=>I.actions.setCardPreferences);function C(){const I=[...new Set(S0.map($=>$.currency))];return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),O.jsxs(zs,{value:c,onValueChange:$=>u($),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Locale"}),S0.map($=>O.jsx(Hn,{value:$.locale,children:$.locale},$.locale))]})})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),O.jsxs(zs,{value:g||"none",onValueChange:$=>v($==="none"?void 0:$),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Currency"}),O.jsx(Hn,{value:"none",children:"None"}),I.map($=>O.jsx(Hn,{value:$,children:$},$))]})})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),O.jsxs(zs,{value:b,onValueChange:$=>w($),children:[O.jsx(Qi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:["0","1","2","3","4"].map($=>O.jsx(Hn,{value:$,children:$},$))})]}),!g&&O.jsx(l_,{onPressedChange:$=>_($),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:O.jsx(rQ,{className:"size-3"})})]})})}function E(){return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),O.jsxs(zs,{defaultValue:"en-US",value:c,onValueChange:I=>u(I),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:Az.map(I=>O.jsxs(dc,{children:[O.jsx(Va,{children:I.label}),I.locales.map($=>O.jsx(Hn,{value:$.code,children:$.name},$.code))]},I.label))})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Format"}),O.jsxs(zs,{defaultValue:"short-date-time",value:f,onValueChange:I=>{console.log("format",I),h(I)},children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{className:"",id:"type",children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Option"}),O.jsx(Hn,{value:"full-date-time",children:"Full Date-Time"}),O.jsx(Hn,{value:"short-date-time",children:"Short Date-Time"}),O.jsx(Hn,{value:"hours-date-time",children:"24-Hour Date-Time"}),O.jsx(Hn,{value:"short-date",children:"Short Date"}),O.jsx(Hn,{value:"long-date",children:"Long Date"})]})})]})]})})}function P(){S({...o,columnSettings:[]})}function A(){var I;S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter($=>$.columnIdx!==e))||[]]})}function k(){var I,$,L;if(i==="date"){const j=_ne(c,f),Q={columnIdx:e,type:i,options:j};S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(ee=>ee.columnIdx!==e))||[],Q]})}else if(i==="number"){let j;g?j={locale:c,currency:g,options:{style:"currency",currency:g,minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0}:j={locale:c,currency:void 0,options:{style:x?"percent":"decimal",minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0};const Q={columnIdx:e,type:i,options:j};S({...o,columnSettings:[...(($=o==null?void 0:o.columnSettings)==null?void 0:$.filter(ee=>ee.columnIdx!==e))||[],Q]})}else S({...o,columnSettings:[...((L=o==null?void 0:o.columnSettings)==null?void 0:L.filter(j=>j.columnIdx!==e))||[]]})}return O.jsxs(qm,{onOpenChange:I=>r(I),children:[O.jsx(Gm,{asChild:!0,children:O.jsx(O1,{className:"size-3.5 cursor-pointer text-muted"})}),O.jsx(Wf,{align:"center",className:"max-w-70",children:O.jsxs("div",{className:"grid gap-4",children:[O.jsxs("div",{className:"space-y-2",children:[O.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),O.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),O.jsxs("div",{className:"grid gap-2",children:[O.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[O.jsx(Wn,{htmlFor:"scale",children:"Type"}),O.jsxs(zs,{value:i||"none",onValueChange:I=>s(I),children:[O.jsx(Qi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{id:"type",children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Option"}),O.jsx(Hn,{value:"number",children:"Number"}),O.jsx(Hn,{value:"date",children:"Date"}),O.jsx(Hn,{value:"none",children:"None"})]})})]})]}),i==="number"&&C(),i==="date"&&E(),i==="number"&&O.jsxs(O.Fragment,{children:[O.jsx(Lg,{}),O.jsx(mM,{colorRanges:a,setColorRanges:l})]}),O.jsx(Lg,{}),O.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[O.jsx(xr,{onClick:P,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),O.jsx(xr,{onClick:A,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),O.jsx(xr,{onClick:k,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function kne(e){const t=new Date(e);return!isNaN(t.getTime())}function bM({data:e,card:t}){var C,E,P,A;const[n,r]=m.useState([]),{keys:o}=ar(e),i=ke(k=>k.filteringCards),s=ke(k=>k.themeStyle),a=ke(k=>k.isVisualEditing),l=i==null?void 0:i.find(k=>k.id===t.id),c=(C=t==null?void 0:t.preferences)==null?void 0:C.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:f,removeFilterValue:h,removeFilteringCard:g}=co(),v=t==null?void 0:t.preferences;function b(k,I){if((I==null?void 0:I.type)==="date"&&kne(k)){const{locale:$,options:L}=I.options,j=new Date(k);return new Date(j.getTime()).toLocaleDateString($,L)}if((I==null?void 0:I.type)==="number"){const{locale:$,currency:L,options:j}=I.options;return L?new Intl.NumberFormat($,{style:"currency",currency:L,...j}).format(k):new Intl.NumberFormat($,j).format(k)}return k}const w=o.map((k,I)=>({accessorKey:k,header:({column:$})=>{const L=$.getIsSorted();return O.jsxs("div",{className:"flex items-center justify-between gap-2",children:[O.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>$.toggleSorting($.getIsSorted()==="asc"),children:[k,L==="asc"?O.jsx(C1,{className:"ml-2 h-5 w-5"}):L==="desc"?O.jsx(S1,{className:"ml-2 h-5 w-5"}):null]}),a&&O.jsx($ne,{columnName:$.id,columnIndex:I})]})},cell:({cell:$})=>{var B,Z;const L=$.getValue(),j=(B=v==null?void 0:v.columnSettings)==null?void 0:B.find(G=>G.columnIdx===I),Q=b(L,j),ee=ak(L,(Z=j==null?void 0:j.options)==null?void 0:Z.colorRanges);return O.jsx("div",{className:"px-2 py-1",style:{backgroundColor:ee},children:Q})}})),x=Dk({data:e,columns:w,getCoreRowModel:Ok(),getPaginationRowModel:Tk(),onSortingChange:r,getSortedRowModel:Pk(),manualPagination:!0,state:{sorting:n}}),_=x.getSelectedRowModel().rows;m.useEffect(()=>{if(_.length===0){if(l){const k=t.id;h(k),g(t)}return}if(c){const{dimensionKeys:k}=ar(e),I=c.map($=>{const L=k==null?void 0:k[$.columnIndex],j=_.map(ee=>ee.getValue(L));return{filterId:t.id+"-"+L,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:L,expression:$.expression,valueType:Td(j[0]===void 0?"":j[0]),operation:"in",values:j}});u(I),f(t)}},[f,u,t,e,l,c,h,g,_]);function S(k){k.toggleSelected()}return O.jsxs(q1,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(E=s==null?void 0:s.chart)==null?void 0:E.options.borderRadius,borderTopLeftRadius:(P=s==null?void 0:s.chart)==null?void 0:P.options.borderRadius},onMouseDown:k=>k.stopPropagation(),children:[O.jsx(G1,{children:x.getHeaderGroups().map(k=>O.jsx(yd,{children:k.headers.map((I,$)=>{var L,j,Q,ee,B,Z,G;return O.jsx(K1,{style:{backgroundColor:(Q=(j=(L=s==null?void 0:s.chart)==null?void 0:L.dataset)==null?void 0:j.backgroundColor)==null?void 0:Q[0],color:Bc((Z=(B=(ee=s==null?void 0:s.chart)==null?void 0:ee.dataset)==null?void 0:B.backgroundColor)==null?void 0:Z[0])},className:Ce("sticky -top-[1px] z-50 h-9 bg-muted-foreground px-2 text-background",{"border-x":$>0&&$<k.headers.length-1,"border-l":$===1&&k.headers.length==2},(G=s==null?void 0:s.table)==null?void 0:G.tableHeaderColor),children:I.isPlaceholder?null:Dx(I.column.columnDef.header,I.getContext())},I.id)})},k.id))}),O.jsx(Y1,{children:(A=x.getRowModel().rows)!=null&&A.length?x.getRowModel().rows.map((k,I)=>O.jsx(yd,{onClick:()=>S(k),className:Ce("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":k.getIsSelected()&&"selected",children:k.getVisibleCells().map(($,L)=>{var j;return O.jsx(Ig,{onClick:Q=>{var B;const ee=((B=window==null?void 0:window.getSelection())==null?void 0:B.toString())||"";(ee==null?void 0:ee.length)>0&&Q.stopPropagation()},className:Ce("p-0",{"border-x":L>0&&L<w.length-1||L===1&&w.length==2,"border-l":L==0,"border-r":L===w.length-1,"border-b":I===((j=x.getRowModel().rows)==null?void 0:j.length)-1}),children:Dx($.column.columnDef.cell,$.getContext())},$.id)})},k.id)):O.jsx(yd,{children:O.jsx(Ig,{colSpan:w.length,className:"p-1 text-center",children:"No results."})})})]})}/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:yM,setPrototypeOf:zP,isFrozen:Mne,getPrototypeOf:Ine,getOwnPropertyDescriptor:Nne}=Object;let{freeze:_r,seal:ko,create:xM}=Object,{apply:Lx,construct:Fx}=typeof Reflect<"u"&&Reflect;_r||(_r=function(t){return t});ko||(ko=function(t){return t});Lx||(Lx=function(t,n,r){return t.apply(n,r)});Fx||(Fx=function(t,n){return new t(...n)});const Pp=fo(Array.prototype.forEach),BP=fo(Array.prototype.pop),Hu=fo(Array.prototype.push),sg=fo(String.prototype.toLowerCase),wy=fo(String.prototype.toString),VP=fo(String.prototype.match),Wu=fo(String.prototype.replace),Lne=fo(String.prototype.indexOf),Fne=fo(String.prototype.trim),Uo=fo(Object.prototype.hasOwnProperty),gr=fo(RegExp.prototype.test),Uu=jne(TypeError);function fo(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Lx(e,t,r)}}function jne(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fx(e,n)}}function Tt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sg;zP&&zP(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(Mne(t)||(t[r]=i),o=i)}e[o]=!0}return e}function zne(e){for(let t=0;t<e.length;t++)Uo(e,t)||(e[t]=null);return e}function za(e){const t=xM(null);for(const[n,r]of yM(e))Uo(e,n)&&(Array.isArray(r)?t[n]=zne(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=za(r):t[n]=r);return t}function qu(e,t){for(;e!==null;){const r=Nne(e,t);if(r){if(r.get)return fo(r.get);if(typeof r.value=="function")return fo(r.value)}e=Ine(e)}function n(){return null}return n}const HP=_r(["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"]),_y=_r(["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"]),Sy=_r(["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"]),Bne=_r(["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"]),Cy=_r(["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"]),Vne=_r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),WP=_r(["#text"]),UP=_r(["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"]),Ey=_r(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),qP=_r(["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"]),Tp=_r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Hne=ko(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Wne=ko(/<%[\w\W]*|[\w\W]*%>/gm),Une=ko(/\${[\w\W]*}/gm),qne=ko(/^data-[\-\w.\u00B7-\uFFFF]/),Gne=ko(/^aria-[\-\w]+$/),wM=ko(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yne=ko(/^(?:\w+script|data):/i),Kne=ko(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_M=ko(/^html$/i),Xne=ko(/^[a-z][.\w]*(-[.\w]+)+$/i);var GP=Object.freeze({__proto__:null,MUSTACHE_EXPR:Hne,ERB_EXPR:Wne,TMPLIT_EXPR:Une,DATA_ATTR:qne,ARIA_ATTR:Gne,IS_ALLOWED_URI:wM,IS_SCRIPT_OR_DATA:Yne,ATTR_WHITESPACE:Kne,DOCTYPE_NAME:_M,CUSTOM_ELEMENT:Xne});const Gu={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qne=function(){return typeof window>"u"?null:window},Jne=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function SM(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qne();const t=Ae=>SM(Ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==Gu.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:g}=e,v=l.prototype,b=qu(v,"cloneNode"),w=qu(v,"remove"),x=qu(v,"nextSibling"),_=qu(v,"childNodes"),S=qu(v,"parentNode");if(typeof s=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let C,E="";const{implementation:P,createNodeIterator:A,createDocumentFragment:k,getElementsByTagName:I}=n,{importNode:$}=r;let L={};t.isSupported=typeof yM=="function"&&typeof S=="function"&&P&&P.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:j,ERB_EXPR:Q,TMPLIT_EXPR:ee,DATA_ATTR:B,ARIA_ATTR:Z,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:K}=GP;let{IS_ALLOWED_URI:T}=GP,V=null;const X=Tt({},[...HP,..._y,...Sy,...Cy,...WP]);let N=null;const ie=Tt({},[...UP,...Ey,...qP,...Tp]);let fe=Object.seal(xM(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}})),ue=null,pe=null,se=!0,ne=!0,le=!1,ye=!0,Y=!1,be=!0,_e=!1,Pe=!1,Te=!1,Ue=!1,Be=!1,Ie=!1,Ke=!0,lt=!1;const It="user-content-";let At=!0,Ht=!1,de={},Ee=null;const Le=Tt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Ze=Tt({},["audio","video","img","source","image","track"]);let Wt=null;const Zt=Tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",vn="http://www.w3.org/2000/svg",ln="http://www.w3.org/1999/xhtml";let Lt=ln,tn=!1,xn=null;const nt=Tt({},[Kt,vn,ln],wy);let ht=null;const $t=["application/xhtml+xml","text/html"],Xt="text/html";let bt=null,Rn=null;const Lo=n.createElement("form"),ms=function(U){return U instanceof RegExp||U instanceof Function},Fo=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Rn&&Rn===U)){if((!U||typeof U!="object")&&(U={}),U=za(U),ht=$t.indexOf(U.PARSER_MEDIA_TYPE)===-1?Xt:U.PARSER_MEDIA_TYPE,bt=ht==="application/xhtml+xml"?wy:sg,V=Uo(U,"ALLOWED_TAGS")?Tt({},U.ALLOWED_TAGS,bt):X,N=Uo(U,"ALLOWED_ATTR")?Tt({},U.ALLOWED_ATTR,bt):ie,xn=Uo(U,"ALLOWED_NAMESPACES")?Tt({},U.ALLOWED_NAMESPACES,wy):nt,Wt=Uo(U,"ADD_URI_SAFE_ATTR")?Tt(za(Zt),U.ADD_URI_SAFE_ATTR,bt):Zt,Ge=Uo(U,"ADD_DATA_URI_TAGS")?Tt(za(Ze),U.ADD_DATA_URI_TAGS,bt):Ze,Ee=Uo(U,"FORBID_CONTENTS")?Tt({},U.FORBID_CONTENTS,bt):Le,ue=Uo(U,"FORBID_TAGS")?Tt({},U.FORBID_TAGS,bt):{},pe=Uo(U,"FORBID_ATTR")?Tt({},U.FORBID_ATTR,bt):{},de=Uo(U,"USE_PROFILES")?U.USE_PROFILES:!1,se=U.ALLOW_ARIA_ATTR!==!1,ne=U.ALLOW_DATA_ATTR!==!1,le=U.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=U.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=U.SAFE_FOR_TEMPLATES||!1,be=U.SAFE_FOR_XML!==!1,_e=U.WHOLE_DOCUMENT||!1,Ue=U.RETURN_DOM||!1,Be=U.RETURN_DOM_FRAGMENT||!1,Ie=U.RETURN_TRUSTED_TYPE||!1,Te=U.FORCE_BODY||!1,Ke=U.SANITIZE_DOM!==!1,lt=U.SANITIZE_NAMED_PROPS||!1,At=U.KEEP_CONTENT!==!1,Ht=U.IN_PLACE||!1,T=U.ALLOWED_URI_REGEXP||wM,Lt=U.NAMESPACE||ln,fe=U.CUSTOM_ELEMENT_HANDLING||{},U.CUSTOM_ELEMENT_HANDLING&&ms(U.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(fe.tagNameCheck=U.CUSTOM_ELEMENT_HANDLING.tagNameCheck),U.CUSTOM_ELEMENT_HANDLING&&ms(U.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(fe.attributeNameCheck=U.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),U.CUSTOM_ELEMENT_HANDLING&&typeof U.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=U.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(ne=!1),Be&&(Ue=!0),de&&(V=Tt({},WP),N=[],de.html===!0&&(Tt(V,HP),Tt(N,UP)),de.svg===!0&&(Tt(V,_y),Tt(N,Ey),Tt(N,Tp)),de.svgFilters===!0&&(Tt(V,Sy),Tt(N,Ey),Tt(N,Tp)),de.mathMl===!0&&(Tt(V,Cy),Tt(N,qP),Tt(N,Tp))),U.ADD_TAGS&&(V===X&&(V=za(V)),Tt(V,U.ADD_TAGS,bt)),U.ADD_ATTR&&(N===ie&&(N=za(N)),Tt(N,U.ADD_ATTR,bt)),U.ADD_URI_SAFE_ATTR&&Tt(Wt,U.ADD_URI_SAFE_ATTR,bt),U.FORBID_CONTENTS&&(Ee===Le&&(Ee=za(Ee)),Tt(Ee,U.FORBID_CONTENTS,bt)),At&&(V["#text"]=!0),_e&&Tt(V,["html","head","body"]),V.table&&(Tt(V,["tbody"]),delete ue.tbody),U.TRUSTED_TYPES_POLICY){if(typeof U.TRUSTED_TYPES_POLICY.createHTML!="function")throw Uu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof U.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Uu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=U.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=Jne(g,o)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));_r&&_r(U),Rn=U}},Ai=Tt({},["mi","mo","mn","ms","mtext"]),ni=Tt({},["foreignobject","annotation-xml"]),$i=Tt({},["title","style","font","a","script"]),vs=Tt({},[..._y,...Sy,...Bne]),ri=Tt({},[...Cy,...Vne]),ki=function(U){let me=S(U);(!me||!me.tagName)&&(me={namespaceURI:Lt,tagName:"template"});const $e=sg(U.tagName),st=sg(me.tagName);return xn[U.namespaceURI]?U.namespaceURI===vn?me.namespaceURI===ln?$e==="svg":me.namespaceURI===Kt?$e==="svg"&&(st==="annotation-xml"||Ai[st]):!!vs[$e]:U.namespaceURI===Kt?me.namespaceURI===ln?$e==="math":me.namespaceURI===vn?$e==="math"&&ni[st]:!!ri[$e]:U.namespaceURI===ln?me.namespaceURI===vn&&!ni[st]||me.namespaceURI===Kt&&!Ai[st]?!1:!ri[$e]&&($i[$e]||!vs[$e]):!!(ht==="application/xhtml+xml"&&xn[U.namespaceURI]):!1},jn=function(U){Hu(t.removed,{element:U});try{S(U).removeChild(U)}catch{w(U)}},oi=function(U,me){try{Hu(t.removed,{attribute:me.getAttributeNode(U),from:me})}catch{Hu(t.removed,{attribute:null,from:me})}if(me.removeAttribute(U),U==="is"&&!N[U])if(Ue||Be)try{jn(me)}catch{}else try{me.setAttribute(U,"")}catch{}},bs=function(U){let me=null,$e=null;if(Te)U="<remove></remove>"+U;else{const ft=VP(U,/^[\r\n\t ]+/);$e=ft&&ft[0]}ht==="application/xhtml+xml"&&Lt===ln&&(U='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+U+"</body></html>");const st=C?C.createHTML(U):U;if(Lt===ln)try{me=new h().parseFromString(st,ht)}catch{}if(!me||!me.documentElement){me=P.createDocument(Lt,"template",null);try{me.documentElement.innerHTML=tn?E:st}catch{}}const bn=me.body||me.documentElement;return U&&$e&&bn.insertBefore(n.createTextNode($e),bn.childNodes[0]||null),Lt===ln?I.call(me,_e?"html":"body")[0]:_e?me.documentElement:bn},ys=function(U){return A.call(U.ownerDocument||U,U,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},D=function(U){return U instanceof f&&(typeof U.nodeName!="string"||typeof U.textContent!="string"||typeof U.removeChild!="function"||!(U.attributes instanceof u)||typeof U.removeAttribute!="function"||typeof U.setAttribute!="function"||typeof U.namespaceURI!="string"||typeof U.insertBefore!="function"||typeof U.hasChildNodes!="function")},te=function(U){return typeof a=="function"&&U instanceof a},ce=function(U,me,$e){L[U]&&Pp(L[U],st=>{st.call(t,me,$e,Rn)})},Oe=function(U){let me=null;if(ce("beforeSanitizeElements",U,null),D(U))return jn(U),!0;const $e=bt(U.nodeName);if(ce("uponSanitizeElement",U,{tagName:$e,allowedTags:V}),U.hasChildNodes()&&!te(U.firstElementChild)&&gr(/<[/\w]/g,U.innerHTML)&&gr(/<[/\w]/g,U.textContent)||U.nodeType===Gu.progressingInstruction||be&&U.nodeType===Gu.comment&&gr(/<[/\w]/g,U.data))return jn(U),!0;if(!V[$e]||ue[$e]){if(!ue[$e]&&qe($e)&&(fe.tagNameCheck instanceof RegExp&&gr(fe.tagNameCheck,$e)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck($e)))return!1;if(At&&!Ee[$e]){const st=S(U)||U.parentNode,bn=_(U)||U.childNodes;if(bn&&st){const ft=bn.length;for(let tr=ft-1;tr>=0;--tr){const go=b(bn[tr],!0);go.__removalCount=(U.__removalCount||0)+1,st.insertBefore(go,x(U))}}}return jn(U),!0}return U instanceof l&&!ki(U)||($e==="noscript"||$e==="noembed"||$e==="noframes")&&gr(/<\/no(script|embed|frames)/i,U.innerHTML)?(jn(U),!0):(Y&&U.nodeType===Gu.text&&(me=U.textContent,Pp([j,Q,ee],st=>{me=Wu(me,st," ")}),U.textContent!==me&&(Hu(t.removed,{element:U.cloneNode()}),U.textContent=me)),ce("afterSanitizeElements",U,null),!1)},He=function(U,me,$e){if(Ke&&(me==="id"||me==="name")&&($e in n||$e in Lo))return!1;if(!(ne&&!pe[me]&&gr(B,me))){if(!(se&&gr(Z,me))){if(!N[me]||pe[me]){if(!(qe(U)&&(fe.tagNameCheck instanceof RegExp&&gr(fe.tagNameCheck,U)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(U))&&(fe.attributeNameCheck instanceof RegExp&&gr(fe.attributeNameCheck,me)||fe.attributeNameCheck instanceof Function&&fe.attributeNameCheck(me))||me==="is"&&fe.allowCustomizedBuiltInElements&&(fe.tagNameCheck instanceof RegExp&&gr(fe.tagNameCheck,$e)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck($e))))return!1}else if(!Wt[me]){if(!gr(T,Wu($e,q,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&U!=="script"&&Lne($e,"data:")===0&&Ge[U])){if(!(le&&!gr(G,Wu($e,q,"")))){if($e)return!1}}}}}}return!0},qe=function(U){return U!=="annotation-xml"&&VP(U,K)},ze=function(U){ce("beforeSanitizeAttributes",U,null);const{attributes:me}=U;if(!me)return;const $e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:N};let st=me.length;for(;st--;){const bn=me[st],{name:ft,namespaceURI:tr,value:go}=bn,ya=bt(ft);let zn=ft==="value"?go:Fne(go);if($e.attrName=ya,$e.attrValue=zn,$e.keepAttr=!0,$e.forceKeepAttr=void 0,ce("uponSanitizeAttribute",U,$e),zn=$e.attrValue,be&&gr(/((--!?|])>)|<\/(style|title)/i,zn)){oi(ft,U);continue}if($e.forceKeepAttr||(oi(ft,U),!$e.keepAttr))continue;if(!ye&&gr(/\/>/i,zn)){oi(ft,U);continue}Y&&Pp([j,Q,ee],pu=>{zn=Wu(zn,pu," ")});const hu=bt(U.nodeName);if(He(hu,ya,zn)){if(lt&&(ya==="id"||ya==="name")&&(oi(ft,U),zn=It+zn),C&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!tr)switch(g.getAttributeType(hu,ya)){case"TrustedHTML":{zn=C.createHTML(zn);break}case"TrustedScriptURL":{zn=C.createScriptURL(zn);break}}try{tr?U.setAttributeNS(tr,ft,zn):U.setAttribute(ft,zn),D(U)?jn(U):BP(t.removed)}catch{}}}ce("afterSanitizeAttributes",U,null)},Fe=function Ae(U){let me=null;const $e=ys(U);for(ce("beforeSanitizeShadowDOM",U,null);me=$e.nextNode();)ce("uponSanitizeShadowNode",me,null),!Oe(me)&&(me.content instanceof i&&Ae(me.content),ze(me));ce("afterSanitizeShadowDOM",U,null)};return t.sanitize=function(Ae){let U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,$e=null,st=null,bn=null;if(tn=!Ae,tn&&(Ae="<!-->"),typeof Ae!="string"&&!te(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw Uu("dirty is not a string, aborting")}else throw Uu("toString is not a function");if(!t.isSupported)return Ae;if(Pe||Fo(U),t.removed=[],typeof Ae=="string"&&(Ht=!1),Ht){if(Ae.nodeName){const go=bt(Ae.nodeName);if(!V[go]||ue[go])throw Uu("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof a)me=bs("<!---->"),$e=me.ownerDocument.importNode(Ae,!0),$e.nodeType===Gu.element&&$e.nodeName==="BODY"||$e.nodeName==="HTML"?me=$e:me.appendChild($e);else{if(!Ue&&!Y&&!_e&&Ae.indexOf("<")===-1)return C&&Ie?C.createHTML(Ae):Ae;if(me=bs(Ae),!me)return Ue?null:Ie?E:""}me&&Te&&jn(me.firstChild);const ft=ys(Ht?Ae:me);for(;st=ft.nextNode();)Oe(st)||(st.content instanceof i&&Fe(st.content),ze(st));if(Ht)return Ae;if(Ue){if(Be)for(bn=k.call(me.ownerDocument);me.firstChild;)bn.appendChild(me.firstChild);else bn=me;return(N.shadowroot||N.shadowrootmode)&&(bn=$.call(r,bn,!0)),bn}let tr=_e?me.outerHTML:me.innerHTML;return _e&&V["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&gr(_M,me.ownerDocument.doctype.name)&&(tr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
|
|
316
|
+
`+tr),Y&&Pp([j,Q,ee],go=>{tr=Wu(tr,go," ")}),C&&Ie?C.createHTML(tr):tr},t.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fo(Ae),Pe=!0},t.clearConfig=function(){Rn=null,Pe=!1},t.isValidAttribute=function(Ae,U,me){Rn||Fo({});const $e=bt(Ae),st=bt(U);return He($e,st,me)},t.addHook=function(Ae,U){typeof U=="function"&&(L[Ae]=L[Ae]||[],Hu(L[Ae],U))},t.removeHook=function(Ae){if(L[Ae])return BP(L[Ae])},t.removeHooks=function(Ae){L[Ae]&&(L[Ae]=[])},t.removeAllHooks=function(){L={}},t}var YP=SM();function CM({card:e,isLoading:t}){var f,h;const n=(e==null?void 0:e.data)||[],{keys:r}=ar(n),o=ke(g=>g.selectedSheetId),i=ke(g=>g.isVisualEditing),s=(h=(f=e==null?void 0:e.preferences)==null?void 0:f.textVisualOptions)==null?void 0:h.isDynamicText,{setCardDescription:a}=co(),{setCard:l}=Dm();function c(){var w;if(t)return O.jsx(am,{className:"h-7 animate-pulse bg-muted"});const g=(w=n==null?void 0:n[0])==null?void 0:w[r[0]],v=YP.sanitize(g),b=O.jsx("div",{dangerouslySetInnerHTML:{__html:v}});return O.jsx("div",{className:"hover:cursor-text",onMouseDown:x=>x.stopPropagation(),children:b})}function u(){return O.jsx("div",{onMouseDown:g=>g.stopPropagation(),children:O.jsx(is,{type:"textarea",className:"w-full",text:(e==null?void 0:e.description)||"Double click to add description",onSave:g=>{i===!1&&a(o,e.id,g),i===!0&&l({...e,description:g})},children:O.jsx("div",{dangerouslySetInnerHTML:{__html:YP.sanitize((e==null?void 0:e.description)||"")}})})})}return O.jsxs("div",{className:"break-words p-6",children:[!s&&u(),s===!0&&c()]})}function Zne({frame:e,footer:t,className:n,...r}){var B,Z,G,q;const{customCards:o}=ma(),i=m.useRef(null),s=ke(K=>K.themeStyle),a=ke(K=>K.selectedSheetId),l=ke(K=>K.selectedFrameId),c=ke(K=>K.isDashboardEditing);ke(K=>K.filterValues);const{updateFrame:u}=co(),f=e.cards.find(K=>K.id===e.activeCardId);RZ(e,i);const{isError:h,isLoading:g,isFetching:v,cfg:b,visualKey:w,handleDatapointClick:x}=B1(f),{setCardTitle:_,setCardDescription:S,setSelectedFrameId:C}=co(),{setSelectedConnectionId:E,setSelectedDatabaseName:P,setSelectedSchemaName:A,setSelectedTableName:k}=Dm();function I(K){K.stopPropagation(),C(e.id),f!=null&&f.connectionId&&E(f==null?void 0:f.connectionId),f!=null&&f.lastSelectedDatabase&&P(f==null?void 0:f.lastSelectedDatabase),f!=null&&f.lastSelectedSchema&&A(f==null?void 0:f.lastSelectedSchema),f!=null&&f.lastSelectedTable&&k(f==null?void 0:f.lastSelectedTable)}function $(){if(o&&o.length>0){const K=o.find(T=>T.cardId===f.id);if(K&&K.replaceDefault){const T=K.content;if(T)return O.jsx(T,{card:f})}}return f.type==="kpi"?O.jsx(lk,{isLoading:g||v,card:f}):f.type==="text"?O.jsx(CM,{isLoading:g||v,card:f}):ee}function L(){if(h)return O.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(f.type==="table"&&f.data&&f.data.length>0)return O.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:O.jsx(bM,{card:f,data:f.data})});if(o&&o.length>0){const K=o.find(T=>T.cardId===f.id);if(K&&K.content){const T=K.content;return O.jsx(T,{card:f})}}if(b)return O.jsx(_1,{cfg:b,onDatapointClick:x},w)}function j(){if(o&&o.length>0){const K=o.find(T=>T.cardId===f.id);if(K&&K.footer){const T=K.footer;if(T)return O.jsx(T,{card:f})}}return t||null}if(!f.id)return null;function Q(){var K,T;return O.jsx(kw,{value:e.activeCardId,className:"flex justify-end",onValueChange:V=>{const X={...e,activeCardId:V};u(a,X)},children:O.jsx(dm,{style:{borderRadius:(T=(K=s==null?void 0:s.chart)==null?void 0:K.options)==null?void 0:T.borderRadius},className:"flex-end",children:e.cards.map(V=>{var X,N;return O.jsx(fm,{style:{borderRadius:(N=(X=s==null?void 0:s.chart)==null?void 0:X.options)==null?void 0:N.borderRadius},value:V.id,children:V.tabTitle||V.title},V.id)})})})}const ee=O.jsxs(O.Fragment,{children:[O.jsx(lm,{className:"pb-4",children:O.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[O.jsxs("div",{children:[O.jsxs("div",{role:"carc-title-container",className:"flex items-center gap-2",children:[O.jsx(is,{text:f.title,onSave:K=>_(a,f.id,K),children:O.jsx(Af,{className:Ce("text-base",{}),children:f.title})}),(c||f.info)&&O.jsx(FZ,{card:f}),f.refreshInterval&&O.jsxs(ik,{children:[O.jsx(sk,{className:"pr-1",children:O.jsx("div",{className:Ce("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":g||v})})}),O.jsx(F1,{side:"right",align:"center",children:O.jsx("p",{className:"text-xs",children:`Realtime (${f==null?void 0:f.refreshInterval})`})})]})]}),O.jsx("div",{role:"card-description-container",children:O.jsx(is,{text:(f==null?void 0:f.description)||"",onSave:K=>S(a,f.id,K),children:O.jsxs(Ow,{className:Ce("",{}),children:[" ",f.description]})})})]}),e.cards.length>1&&Q()]})}),O.jsx(cm,{className:"relative flex grow flex-col",children:L()}),O.jsx(Pw,{children:j()})]});return O.jsxs(Rw,{tabIndex:-1,ref:i,role:"card-frame",onClick:I,style:{borderRadius:(Z=(B=s==null?void 0:s.chart)==null?void 0:B.options)==null?void 0:Z.borderRadius,fontFamily:(q=(G=s==null?void 0:s.chart)==null?void 0:G.font)==null?void 0:q.family},className:Ce("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":l===e.id&&c,"animate-pulse":g},s==null?void 0:s.dashboardCard,n,"semaphor-card-frame"),...r,children:[O.jsx(lQ,{frame:e}),$()]})}const c_=H.forwardRef(({className:e,...t},n)=>O.jsx("textarea",{className:Ce("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}));c_.displayName="Textarea";const jx="horizontal",ere=["horizontal","vertical"],EM=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=jx,...o}=e,i=RM(r)?r:jx,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.createElement(Qe.div,he({"data-orientation":i},a,o,{ref:t}))});EM.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!RM(r)?new Error(tre(o,n)):null}};function tre(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
|
|
317
317
|
- horizontal
|
|
318
318
|
- vertical
|
|
319
319
|
|
|
@@ -328,14 +328,14 @@ Defaulting to \`${jx}\`.`}function RM(e){return ere.includes(e)}const OM=EM,Ym=H
|
|
|
328
328
|
*/var eT;function Toe(){return eT||(eT=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),v=Symbol.iterator,b="@@iterator";function w(D){if(D===null||typeof D!="object")return null;var te=v&&D[v]||D[b];return typeof te=="function"?te:null}var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(D){{for(var te=arguments.length,ce=new Array(te>1?te-1:0),Oe=1;Oe<te;Oe++)ce[Oe-1]=arguments[Oe];S("error",D,ce)}}function S(D,te,ce){{var Oe=x.ReactDebugCurrentFrame,He=Oe.getStackAddendum();He!==""&&(te+="%s",ce=ce.concat([He]));var qe=ce.map(function(ze){return String(ze)});qe.unshift("Warning: "+te),Function.prototype.apply.call(console[D],console,qe)}}var C=!1,E=!1,P=!1,A=!1,k=!1,I;I=Symbol.for("react.module.reference");function $(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===i||k||D===o||D===c||D===u||A||D===g||C||E||P||typeof D=="object"&&D!==null&&(D.$$typeof===h||D.$$typeof===f||D.$$typeof===s||D.$$typeof===a||D.$$typeof===l||D.$$typeof===I||D.getModuleId!==void 0))}function L(D,te,ce){var Oe=D.displayName;if(Oe)return Oe;var He=te.displayName||te.name||"";return He!==""?ce+"("+He+")":ce}function j(D){return D.displayName||"Context"}function Q(D){if(D==null)return null;if(typeof D.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof D=="object")switch(D.$$typeof){case a:var te=D;return j(te)+".Consumer";case s:var ce=D;return j(ce._context)+".Provider";case l:return L(D,D.render,"ForwardRef");case f:var Oe=D.displayName||null;return Oe!==null?Oe:Q(D.type)||"Memo";case h:{var He=D,qe=He._payload,ze=He._init;try{return Q(ze(qe))}catch{return null}}}return null}var ee=Object.assign,B=0,Z,G,q,K,T,V,X;function N(){}N.__reactDisabledLog=!0;function ie(){{if(B===0){Z=console.log,G=console.info,q=console.warn,K=console.error,T=console.group,V=console.groupCollapsed,X=console.groupEnd;var D={configurable:!0,enumerable:!0,value:N,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}B++}}function fe(){{if(B--,B===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ee({},D,{value:Z}),info:ee({},D,{value:G}),warn:ee({},D,{value:q}),error:ee({},D,{value:K}),group:ee({},D,{value:T}),groupCollapsed:ee({},D,{value:V}),groupEnd:ee({},D,{value:X})})}B<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=x.ReactCurrentDispatcher,pe;function se(D,te,ce){{if(pe===void 0)try{throw Error()}catch(He){var Oe=He.stack.trim().match(/\n( *(at )?)/);pe=Oe&&Oe[1]||""}return`
|
|
329
329
|
`+pe+D}}var ne=!1,le;{var ye=typeof WeakMap=="function"?WeakMap:Map;le=new ye}function Y(D,te){if(!D||ne)return"";{var ce=le.get(D);if(ce!==void 0)return ce}var Oe;ne=!0;var He=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var qe;qe=ue.current,ue.current=null,ie();try{if(te){var ze=function(){throw Error()};if(Object.defineProperty(ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ze,[])}catch(ft){Oe=ft}Reflect.construct(D,[],ze)}else{try{ze.call()}catch(ft){Oe=ft}D.call(ze.prototype)}}else{try{throw Error()}catch(ft){Oe=ft}D()}}catch(ft){if(ft&&Oe&&typeof ft.stack=="string"){for(var Fe=ft.stack.split(`
|
|
330
330
|
`),Ae=Oe.stack.split(`
|
|
331
|
-
`),U=Fe.length-1,me=Ae.length-1;U>=1&&me>=0&&Fe[U]!==Ae[me];)me--;for(;U>=1&&me>=0;U--,me--)if(Fe[U]!==Ae[me]){if(U!==1||me!==1)do if(U--,me--,me<0||Fe[U]!==Ae[me]){var
|
|
332
|
-
`+Fe[U].replace(" at new "," at ");return D.displayName
|
|
331
|
+
`),U=Fe.length-1,me=Ae.length-1;U>=1&&me>=0&&Fe[U]!==Ae[me];)me--;for(;U>=1&&me>=0;U--,me--)if(Fe[U]!==Ae[me]){if(U!==1||me!==1)do if(U--,me--,me<0||Fe[U]!==Ae[me]){var $e=`
|
|
332
|
+
`+Fe[U].replace(" at new "," at ");return D.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",D.displayName)),typeof D=="function"&&le.set(D,$e),$e}while(U>=1&&me>=0);break}}}finally{ne=!1,ue.current=qe,fe(),Error.prepareStackTrace=He}var st=D?D.displayName||D.name:"",bn=st?se(st):"";return typeof D=="function"&&le.set(D,bn),bn}function be(D,te,ce){return Y(D,!1)}function _e(D){var te=D.prototype;return!!(te&&te.isReactComponent)}function Pe(D,te,ce){if(D==null)return"";if(typeof D=="function")return Y(D,_e(D));if(typeof D=="string")return se(D);switch(D){case c:return se("Suspense");case u:return se("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case l:return be(D.render);case f:return Pe(D.type,te,ce);case h:{var Oe=D,He=Oe._payload,qe=Oe._init;try{return Pe(qe(He),te,ce)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Ue={},Be=x.ReactDebugCurrentFrame;function Ie(D){if(D){var te=D._owner,ce=Pe(D.type,D._source,te?te.type:null);Be.setExtraStackFrame(ce)}else Be.setExtraStackFrame(null)}function Ke(D,te,ce,Oe,He){{var qe=Function.call.bind(Te);for(var ze in D)if(qe(D,ze)){var Fe=void 0;try{if(typeof D[ze]!="function"){var Ae=Error((Oe||"React class")+": "+ce+" type `"+ze+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[ze]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ae.name="Invariant Violation",Ae}Fe=D[ze](te,ze,Oe,ce,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(U){Fe=U}Fe&&!(Fe instanceof Error)&&(Ie(He),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Oe||"React class",ce,ze,typeof Fe),Ie(null)),Fe instanceof Error&&!(Fe.message in Ue)&&(Ue[Fe.message]=!0,Ie(He),_("Failed %s type: %s",ce,Fe.message),Ie(null))}}}var lt=Array.isArray;function It(D){return lt(D)}function At(D){{var te=typeof Symbol=="function"&&Symbol.toStringTag,ce=te&&D[Symbol.toStringTag]||D.constructor.name||"Object";return ce}}function Ht(D){try{return de(D),!1}catch{return!0}}function de(D){return""+D}function Ee(D){if(Ht(D))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",At(D)),de(D)}var Le=x.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},Ze,Wt,Zt;Zt={};function Kt(D){if(Te.call(D,"ref")){var te=Object.getOwnPropertyDescriptor(D,"ref").get;if(te&&te.isReactWarning)return!1}return D.ref!==void 0}function vn(D){if(Te.call(D,"key")){var te=Object.getOwnPropertyDescriptor(D,"key").get;if(te&&te.isReactWarning)return!1}return D.key!==void 0}function ln(D,te){if(typeof D.ref=="string"&&Le.current&&te&&Le.current.stateNode!==te){var ce=Q(Le.current.type);Zt[ce]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Q(Le.current.type),D.ref),Zt[ce]=!0)}}function Lt(D,te){{var ce=function(){Ze||(Ze=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",te))};ce.isReactWarning=!0,Object.defineProperty(D,"key",{get:ce,configurable:!0})}}function tn(D,te){{var ce=function(){Wt||(Wt=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",te))};ce.isReactWarning=!0,Object.defineProperty(D,"ref",{get:ce,configurable:!0})}}var xn=function(D,te,ce,Oe,He,qe,ze){var Fe={$$typeof:t,type:D,key:te,ref:ce,props:ze,_owner:qe};return Fe._store={},Object.defineProperty(Fe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Fe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.defineProperty(Fe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:He}),Object.freeze&&(Object.freeze(Fe.props),Object.freeze(Fe)),Fe};function nt(D,te,ce,Oe,He){{var qe,ze={},Fe=null,Ae=null;ce!==void 0&&(Ee(ce),Fe=""+ce),vn(te)&&(Ee(te.key),Fe=""+te.key),Kt(te)&&(Ae=te.ref,ln(te,He));for(qe in te)Te.call(te,qe)&&!Ge.hasOwnProperty(qe)&&(ze[qe]=te[qe]);if(D&&D.defaultProps){var U=D.defaultProps;for(qe in U)ze[qe]===void 0&&(ze[qe]=U[qe])}if(Fe||Ae){var me=typeof D=="function"?D.displayName||D.name||"Unknown":D;Fe&&Lt(ze,me),Ae&&tn(ze,me)}return xn(D,Fe,Ae,He,Oe,Le.current,ze)}}var ht=x.ReactCurrentOwner,$t=x.ReactDebugCurrentFrame;function Xt(D){if(D){var te=D._owner,ce=Pe(D.type,D._source,te?te.type:null);$t.setExtraStackFrame(ce)}else $t.setExtraStackFrame(null)}var bt;bt=!1;function Rn(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Lo(){{if(ht.current){var D=Q(ht.current.type);if(D)return`
|
|
333
333
|
|
|
334
334
|
Check the render method of \``+D+"`."}return""}}function ms(D){{if(D!==void 0){var te=D.fileName.replace(/^.*[\\\/]/,""),ce=D.lineNumber;return`
|
|
335
335
|
|
|
336
336
|
Check your code at `+te+":"+ce+"."}return""}}var Fo={};function Ai(D){{var te=Lo();if(!te){var ce=typeof D=="string"?D:D.displayName||D.name;ce&&(te=`
|
|
337
337
|
|
|
338
|
-
Check the top-level render call using <`+ce+">.")}return te}}function ni(D,te){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var ce=Ai(te);if(Fo[ce])return;Fo[ce]=!0;var Oe="";D&&D._owner&&D._owner!==ht.current&&(Oe=" It was passed a child from "+Q(D._owner.type)+"."),Xt(D),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ce,Oe),Xt(null)}}function $i(D,te){{if(typeof D!="object")return;if(It(D))for(var ce=0;ce<D.length;ce++){var Oe=D[ce];Rn(Oe)&&ni(Oe,te)}else if(Rn(D))D._store&&(D._store.validated=!0);else if(D){var He=w(D);if(typeof He=="function"&&He!==D.entries)for(var qe=He.call(D),ze;!(ze=qe.next()).done;)Rn(ze.value)&&ni(ze.value,te)}}}function vs(D){{var te=D.type;if(te==null||typeof te=="string")return;var ce;if(typeof te=="function")ce=te.propTypes;else if(typeof te=="object"&&(te.$$typeof===l||te.$$typeof===f))ce=te.propTypes;else return;if(ce){var Oe=Q(te);Ke(ce,D.props,"prop",Oe,D)}else if(te.PropTypes!==void 0&&!bt){bt=!0;var He=Q(te);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof te.getDefaultProps=="function"&&!te.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ri(D){{for(var te=Object.keys(D.props),ce=0;ce<te.length;ce++){var Oe=te[ce];if(Oe!=="children"&&Oe!=="key"){Xt(D),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),Xt(null);break}}D.ref!==null&&(Xt(D),_("Invalid attribute `ref` supplied to `React.Fragment`."),Xt(null))}}function ki(D,te,ce,Oe,He,qe){{var ze=$(D);if(!ze){var Fe="";(D===void 0||typeof D=="object"&&D!==null&&Object.keys(D).length===0)&&(Fe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ae=ms(He);Ae?Fe+=Ae:Fe+=Lo();var U;D===null?U="null":It(D)?U="array":D!==void 0&&D.$$typeof===t?(U="<"+(Q(D.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):U=typeof D,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",U,Fe)}var me=nt(D,te,ce,He,qe);if(me==null)return me;if(ze){var
|
|
338
|
+
Check the top-level render call using <`+ce+">.")}return te}}function ni(D,te){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var ce=Ai(te);if(Fo[ce])return;Fo[ce]=!0;var Oe="";D&&D._owner&&D._owner!==ht.current&&(Oe=" It was passed a child from "+Q(D._owner.type)+"."),Xt(D),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ce,Oe),Xt(null)}}function $i(D,te){{if(typeof D!="object")return;if(It(D))for(var ce=0;ce<D.length;ce++){var Oe=D[ce];Rn(Oe)&&ni(Oe,te)}else if(Rn(D))D._store&&(D._store.validated=!0);else if(D){var He=w(D);if(typeof He=="function"&&He!==D.entries)for(var qe=He.call(D),ze;!(ze=qe.next()).done;)Rn(ze.value)&&ni(ze.value,te)}}}function vs(D){{var te=D.type;if(te==null||typeof te=="string")return;var ce;if(typeof te=="function")ce=te.propTypes;else if(typeof te=="object"&&(te.$$typeof===l||te.$$typeof===f))ce=te.propTypes;else return;if(ce){var Oe=Q(te);Ke(ce,D.props,"prop",Oe,D)}else if(te.PropTypes!==void 0&&!bt){bt=!0;var He=Q(te);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof te.getDefaultProps=="function"&&!te.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ri(D){{for(var te=Object.keys(D.props),ce=0;ce<te.length;ce++){var Oe=te[ce];if(Oe!=="children"&&Oe!=="key"){Xt(D),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),Xt(null);break}}D.ref!==null&&(Xt(D),_("Invalid attribute `ref` supplied to `React.Fragment`."),Xt(null))}}function ki(D,te,ce,Oe,He,qe){{var ze=$(D);if(!ze){var Fe="";(D===void 0||typeof D=="object"&&D!==null&&Object.keys(D).length===0)&&(Fe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ae=ms(He);Ae?Fe+=Ae:Fe+=Lo();var U;D===null?U="null":It(D)?U="array":D!==void 0&&D.$$typeof===t?(U="<"+(Q(D.type)||"Unknown")+" />",Fe=" Did you accidentally export a JSX literal instead of a component?"):U=typeof D,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",U,Fe)}var me=nt(D,te,ce,He,qe);if(me==null)return me;if(ze){var $e=te.children;if($e!==void 0)if(Oe)if(It($e)){for(var st=0;st<$e.length;st++)$i($e[st],D);Object.freeze&&Object.freeze($e)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else $i($e,D)}return D===r?ri(me):vs(me),me}}function jn(D,te,ce){return ki(D,te,ce,!0)}function oi(D,te,ce){return ki(D,te,ce,!1)}var bs=oi,ys=jn;Xu.Fragment=r,Xu.jsx=bs,Xu.jsxs=ys}()),Xu}var Qu={};/**
|
|
339
339
|
* @license React
|
|
340
340
|
* react-jsx-runtime.production.min.js
|
|
341
341
|
*
|
|
@@ -343,7 +343,7 @@ Check the top-level render call using <`+ce+">.")}return te}}function ni(D,te){{
|
|
|
343
343
|
*
|
|
344
344
|
* This source code is licensed under the MIT license found in the
|
|
345
345
|
* LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/var tT;function Doe(){if(tT)return Qu;tT=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},h=null,g=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(g=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:h,ref:g,props:f,_owner:o.current}}return Qu.Fragment=n,Qu.jsx=s,Qu.jsxs=s,Qu}process.env.NODE_ENV==="production"?Vx.exports=Doe():Vx.exports=Toe();var Se=Vx.exports;function qf(e){return e.mode==="multiple"}function Gf(e){return e.mode==="range"}function Km(e){return e.mode==="single"}var Aoe={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 $oe(e,t){return xi(e,"LLLL y",t)}function koe(e,t){return xi(e,"d",t)}function Moe(e,t){return xi(e,"LLLL",t)}function Ioe(e){return"".concat(e)}function Noe(e,t){return xi(e,"cccccc",t)}function Loe(e,t){return xi(e,"yyyy",t)}var Foe=Object.freeze({__proto__:null,formatCaption:$oe,formatDay:koe,formatMonthCaption:Moe,formatWeekNumber:Ioe,formatWeekdayName:Noe,formatYearCaption:Loe}),joe=function(e,t,n){return xi(e,"do MMMM (EEEE)",n)},zoe=function(){return"Month: "},Boe=function(){return"Go to next month"},Voe=function(){return"Go to previous month"},Hoe=function(e,t){return xi(e,"cccc",t)},Woe=function(e){return"Week n. ".concat(e)},Uoe=function(){return"Year: "},qoe=Object.freeze({__proto__:null,labelDay:joe,labelMonthDropdown:zoe,labelNext:Boe,labelPrevious:Voe,labelWeekNumber:Woe,labelWeekday:Hoe,labelYearDropdown:Uoe});function Goe(){var e="buttons",t=Aoe,n=jM,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:Foe,labels:qoe,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function Yoe(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=Lr(r):t&&(i=new Date(t,0,1)),o?s=h_(o):n&&(s=new Date(n,11,31)),{fromDate:i?Zc(i):void 0,toDate:s?Zc(s):void 0}}var qM=m.createContext(void 0);function Koe(e){var t,n=e.initialProps,r=Goe(),o=Yoe(n),i=o.fromDate,s=o.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!i||!s)&&(a="buttons");var l;(Km(n)||qf(n)||Gf(n))&&(l=n.onSelect);var c=rt(rt(rt({},r),n),{captionLayout:a,classNames:rt(rt({},r.classNames),n.classNames),components:rt({},n.components),formatters:rt(rt({},r.formatters),n.formatters),fromDate:i,labels:rt(rt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:rt(rt({},r.modifiers),n.modifiers),modifiersClassNames:rt(rt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:rt(rt({},r.styles),n.styles),toDate:s});return Se.jsx(qM.Provider,{value:c,children:e.children})}function an(){var e=m.useContext(qM);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function GM(e){var t=an(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return Se.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function Xoe(e){return Se.jsx("svg",rt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:Se.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 YM(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,c=an(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Xoe;return Se.jsxs("div",{className:a,style:l,children:[Se.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),Se.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),Se.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,Se.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function Qoe(e){var t,n=an(),r=n.fromDate,o=n.toDate,i=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return Se.jsx(Se.Fragment,{});if(!o)return Se.jsx(Se.Fragment,{});var f=[];if(Ooe(r,o))for(var h=Lr(r),g=r.getMonth();g<=o.getMonth();g++)f.push(Py(h,g));else for(var h=Lr(new Date),g=0;g<=11;g++)f.push(Py(h,g));var v=function(w){var x=Number(w.target.value),_=Py(Lr(e.displayMonth),x);e.onChange(_)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:YM;return Se.jsx(b,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(w){return Se.jsx("option",{value:w.getMonth(),children:a(w,{locale:s})},w.getMonth())})})}function Joe(e){var t,n=e.displayMonth,r=an(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,h=[];if(!o)return Se.jsx(Se.Fragment,{});if(!i)return Se.jsx(Se.Fragment,{});for(var g=o.getFullYear(),v=i.getFullYear(),b=g;b<=v;b++)h.push(ZP(LM(new Date),b));var w=function(_){var S=ZP(Lr(n),Number(_.target.value));e.onChange(S)},x=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:YM;return Se.jsx(x,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:w,value:n.getFullYear(),caption:u(n,{locale:s}),children:h.map(function(_){return Se.jsx("option",{value:_.getFullYear(),children:u(_,{locale:s})},_.getFullYear())})})}function Zoe(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function eie(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(i&&Wd(i,o)<0){var c=-1*(l-1);o=Zo(i,c)}return s&&Wd(o,s)<0&&(o=s),Lr(o)}function tie(){var e=an(),t=eie(e),n=Zoe(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=Lr(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function nie(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=Lr(e),i=Lr(Zo(o,r)),s=Wd(i,o),a=[],l=0;l<s;l++){var c=Zo(o,l);a.push(c)}return n&&(a=a.reverse()),a}function rie(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=Lr(e);if(!n)return Zo(a,s);var l=Wd(n,e);if(!(l<i))return Zo(a,s)}}function oie(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=Lr(e);if(!n)return Zo(a,-s);var l=Wd(a,n);if(!(l<=0))return Zo(a,-s)}}var KM=m.createContext(void 0);function iie(e){var t=an(),n=tie(),r=n[0],o=n[1],i=nie(r,t),s=rie(r,t),a=oie(r,t),l=function(f){return i.some(function(h){return g_(f,h)})},c=function(f,h){l(f)||(h&&WM(f,h)?o(Zo(f,1+t.numberOfMonths*-1)):o(f))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return Se.jsx(KM.Provider,{value:u,children:e.children})}function Yf(){var e=m.useContext(KM);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function nT(e){var t,n=an(),r=n.classNames,o=n.styles,i=n.components,s=Yf().goToMonth,a=function(u){s(Zo(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:GM,c=Se.jsx(l,{id:e.id,displayMonth:e.displayMonth});return Se.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[Se.jsx("div",{className:r.vhidden,children:c}),Se.jsx(Qoe,{onChange:a,displayMonth:e.displayMonth}),Se.jsx(Joe,{onChange:a,displayMonth:e.displayMonth})]})}function sie(e){return Se.jsx("svg",rt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Se.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 aie(e){return Se.jsx("svg",rt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Se.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 zg=m.forwardRef(function(e,t){var n=an(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=rt(rt({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),Se.jsx("button",rt({},e,{ref:t,type:"button",className:s,style:a}))});function lie(e){var t,n,r=an(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return Se.jsx(Se.Fragment,{});var h=c(e.previousMonth,{locale:i}),g=[s.nav_button,s.nav_button_previous].join(" "),v=u(e.nextMonth,{locale:i}),b=[s.nav_button,s.nav_button_next].join(" "),w=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:aie,x=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:sie;return Se.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&Se.jsx(zg,{name:"previous-month","aria-label":h,className:g,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?Se.jsx(w,{className:s.nav_icon,style:a.nav_icon}):Se.jsx(x,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&Se.jsx(zg,{name:"next-month","aria-label":v,className:b,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?Se.jsx(x,{className:s.nav_icon,style:a.nav_icon}):Se.jsx(w,{className:s.nav_icon,style:a.nav_icon})})]})}function rT(e){var t=an().numberOfMonths,n=Yf(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(v){return g_(e.displayMonth,v)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),f=t>1&&(c||!l),h=function(){r&&i(r)},g=function(){o&&i(o)};return Se.jsx(lie,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:f,nextMonth:o,previousMonth:r,onPreviousClick:h,onNextClick:g})}function cie(e){var t,n=an(),r=n.classNames,o=n.disableNavigation,i=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:GM,c;return o?c=Se.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=Se.jsx(nT,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=Se.jsxs(Se.Fragment,{children:[Se.jsx(nT,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),Se.jsx(rT,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=Se.jsxs(Se.Fragment,{children:[Se.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Se.jsx(rT,{displayMonth:e.displayMonth,id:e.id})]}),Se.jsx("div",{className:r.caption,style:i.caption,children:c})}function uie(e){var t=an(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?Se.jsx("tfoot",{className:o,style:r.tfoot,children:Se.jsx("tr",{children:Se.jsx("td",{colSpan:8,children:n})})}):Se.jsx(Se.Fragment,{})}function die(e,t,n){for(var r=n?bl(new Date):Ci(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=yr(r,i);o.push(s)}return o}function fie(){var e=an(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=die(o,i,s);return Se.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&Se.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,f){return Se.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:a(u,{locale:o})},f)})]})}function hie(){var e,t=an(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:fie;return Se.jsx("thead",{style:r.head,className:n.head,children:Se.jsx(i,{})})}function pie(e){var t=an(),n=t.locale,r=t.formatters.formatDay;return Se.jsx(Se.Fragment,{children:r(e.date,{locale:n})})}var m_=m.createContext(void 0);function gie(e){if(!qf(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return Se.jsx(m_.Provider,{value:t,children:e.children})}return Se.jsx(mie,{initialProps:e.initialProps,children:e.children})}function mie(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,u,f){var h,g;(h=t.onDayClick)===null||h===void 0||h.call(t,c,u,f);var v=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!v){var b=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!b){var w=r?UM([],r,!0):[];if(u.selected){var x=w.findIndex(function(_){return Nr(c,_)});w.splice(x,1)}else w.push(c);(g=t.onSelect)===null||g===void 0||g.call(t,w,c,u,f)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=i&&r.length>i-1,f=r.some(function(h){return Nr(h,c)});return!!(u&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return Se.jsx(m_.Provider,{value:l,children:n})}function v_(){var e=m.useContext(m_);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function vie(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?Nr(o,e)&&Nr(r,e)?void 0:Nr(o,e)?{from:o,to:void 0}:Nr(r,e)?void 0:Bx(r,e)?{from:e,to:o}:{from:r,to:e}:o?Bx(e,o)?{from:o,to:e}:{from:e,to:o}:r?WM(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var b_=m.createContext(void 0);function bie(e){if(!Gf(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return Se.jsx(b_.Provider,{value:t,children:e.children})}return Se.jsx(yie,{initialProps:e.initialProps,children:e.children})}function yie(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,s=o.to,a=t.min,l=t.max,c=function(g,v,b){var w,x;(w=t.onDayClick)===null||w===void 0||w.call(t,g,v,b);var _=vie(g,r);(x=t.onSelect)===null||x===void 0||x.call(t,_,g,v,b)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],Nr(i,s)||(u.range_middle=[{after:i,before:s}])):u.range_end=[i]):s&&(u.range_start=[s],u.range_end=[s]),a&&(i&&!s&&u.disabled.push({after:Oy(i,a-1),before:yr(i,a-1)}),i&&s&&u.disabled.push({after:i,before:yr(i,a-1)}),!i&&s&&u.disabled.push({after:Oy(s,a-1),before:yr(s,a-1)})),l){if(i&&!s&&(u.disabled.push({before:yr(i,-l+1)}),u.disabled.push({after:yr(i,l-1)})),i&&s){var f=bi(s,i)+1,h=l-f;u.disabled.push({before:Oy(i,h)}),u.disabled.push({after:yr(s,h)})}!i&&s&&(u.disabled.push({before:yr(s,-l+1)}),u.disabled.push({after:yr(s,l-1)}))}return Se.jsx(b_.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function y_(){var e=m.useContext(b_);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function ag(e){return Array.isArray(e)?UM([],e,!0):e!==void 0?[e]:[]}function xie(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=ag(o)}),t}var ei;(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"})(ei||(ei={}));var wie=ei.Selected,Ui=ei.Disabled,_ie=ei.Hidden,Sie=ei.Today,Ty=ei.RangeEnd,Dy=ei.RangeMiddle,Ay=ei.RangeStart,Cie=ei.Outside;function Eie(e,t,n){var r,o=(r={},r[wie]=ag(e.selected),r[Ui]=ag(e.disabled),r[_ie]=ag(e.hidden),r[Sie]=[e.today],r[Ty]=[],r[Dy]=[],r[Ay]=[],r[Cie]=[],r);return e.fromDate&&o[Ui].push({before:e.fromDate}),e.toDate&&o[Ui].push({after:e.toDate}),qf(e)?o[Ui]=o[Ui].concat(t.modifiers[Ui]):Gf(e)&&(o[Ui]=o[Ui].concat(n.modifiers[Ui]),o[Ay]=n.modifiers[Ay],o[Dy]=n.modifiers[Dy],o[Ty]=n.modifiers[Ty]),o}var XM=m.createContext(void 0);function Rie(e){var t=an(),n=v_(),r=y_(),o=Eie(t,n,r),i=xie(t.modifiers),s=rt(rt({},o),i);return Se.jsx(XM.Provider,{value:s,children:e.children})}function QM(){var e=m.useContext(XM);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Oie(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Pie(e){return!!(e&&typeof e=="object"&&"from"in e)}function Tie(e){return!!(e&&typeof e=="object"&&"after"in e)}function Die(e){return!!(e&&typeof e=="object"&&"before"in e)}function Aie(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function $ie(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=bi(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=bi(e,r)>=0&&bi(o,e)>=0;return s}return o?Nr(o,e):r?Nr(r,e):!1}function kie(e){return f_(e)}function Mie(e){return Array.isArray(e)&&e.every(f_)}function Iie(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(kie(n))return Nr(e,n);if(Mie(n))return n.includes(e);if(Pie(n))return $ie(e,n);if(Aie(n))return n.dayOfWeek.includes(e.getDay());if(Oie(n)){var r=bi(n.before,e),o=bi(n.after,e),i=r>0,s=o<0,a=Bx(n.before,n.after);return a?s&&i:i||s}return Tie(n)?bi(e,n.after)>0:Die(n)?bi(n.before,e)>0:typeof n=="function"?n(e):!1})}function x_(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return Iie(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!g_(e,n)&&(o.outside=!0),o}function Nie(e,t){for(var n=Lr(e[0]),r=h_(e[e.length-1]),o,i,s=n;s<=r;){var a=x_(s,t),l=!a.disabled&&!a.hidden;if(!l){s=yr(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=yr(s,1)}return i||o}var Lie=365;function JM(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,f=o.locale,h={day:yr,week:zx,month:Zo,year:Sre,startOfWeek:function(w){return o.ISOWeek?bl(w):Ci(w,{locale:f,weekStartsOn:l})},endOfWeek:function(w){return o.ISOWeek?FM(w):p_(w,{locale:f,weekStartsOn:l})}},g=h[n](e,r==="after"?1:-1);r==="before"&&c?g=Cre([c,g]):r==="after"&&u&&(g=Ere([u,g]));var v=!0;if(i){var b=x_(g,i);v=!b.disabled&&!b.hidden}return v?g:a.count>Lie?a.lastFocused:JM(g,{moveBy:n,direction:r,context:o,modifiers:i,retry:rt(rt({},a),{count:a.count+1})})}var ZM=m.createContext(void 0);function Fie(e){var t=Yf(),n=QM(),r=m.useState(),o=r[0],i=r[1],s=m.useState(),a=s[0],l=s[1],c=Nie(t.displayMonths,n),u=o??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(o),i(void 0)},h=function(w){i(w)},g=an(),v=function(w,x){if(o){var _=JM(o,{moveBy:w,direction:x,context:g,modifiers:n});Nr(o,_)||(t.goToDate(_,o),h(_))}},b={focusedDay:o,focusTarget:u,blur:f,focus:h,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return Se.jsx(ZM.Provider,{value:b,children:e.children})}function w_(){var e=m.useContext(ZM);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function jie(e,t){var n=QM(),r=x_(e,n,t);return r}var __=m.createContext(void 0);function zie(e){if(!Km(e.initialProps)){var t={selected:void 0};return Se.jsx(__.Provider,{value:t,children:e.children})}return Se.jsx(Bie,{initialProps:e.initialProps,children:e.children})}function Bie(e){var t=e.initialProps,n=e.children,r=function(i,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,s,a)},o={selected:t.selected,onDayClick:r};return Se.jsx(__.Provider,{value:o,children:n})}function eI(){var e=m.useContext(__);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Vie(e,t){var n=an(),r=eI(),o=v_(),i=y_(),s=w_(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,f=s.blur,h=s.focus,g=s.focusMonthBefore,v=s.focusMonthAfter,b=s.focusYearBefore,w=s.focusYearAfter,x=s.focusStartOfWeek,_=s.focusEndOfWeek,S=function(G){var q,K,T,V;Km(n)?(q=r.onDayClick)===null||q===void 0||q.call(r,e,t,G):qf(n)?(K=o.onDayClick)===null||K===void 0||K.call(o,e,t,G):Gf(n)?(T=i.onDayClick)===null||T===void 0||T.call(i,e,t,G):(V=n.onDayClick)===null||V===void 0||V.call(n,e,t,G)},C=function(G){var q;h(e),(q=n.onDayFocus)===null||q===void 0||q.call(n,e,t,G)},E=function(G){var q;f(),(q=n.onDayBlur)===null||q===void 0||q.call(n,e,t,G)},P=function(G){var q;(q=n.onDayMouseEnter)===null||q===void 0||q.call(n,e,t,G)},A=function(G){var q;(q=n.onDayMouseLeave)===null||q===void 0||q.call(n,e,t,G)},k=function(G){var q;(q=n.onDayPointerEnter)===null||q===void 0||q.call(n,e,t,G)},I=function(G){var q;(q=n.onDayPointerLeave)===null||q===void 0||q.call(n,e,t,G)},$=function(G){var q;(q=n.onDayTouchCancel)===null||q===void 0||q.call(n,e,t,G)},L=function(G){var q;(q=n.onDayTouchEnd)===null||q===void 0||q.call(n,e,t,G)},j=function(G){var q;(q=n.onDayTouchMove)===null||q===void 0||q.call(n,e,t,G)},Q=function(G){var q;(q=n.onDayTouchStart)===null||q===void 0||q.call(n,e,t,G)},ee=function(G){var q;(q=n.onDayKeyUp)===null||q===void 0||q.call(n,e,t,G)},B=function(G){var q;switch(G.key){case"ArrowLeft":G.preventDefault(),G.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":G.preventDefault(),G.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":G.preventDefault(),G.stopPropagation(),c();break;case"ArrowUp":G.preventDefault(),G.stopPropagation(),u();break;case"PageUp":G.preventDefault(),G.stopPropagation(),G.shiftKey?b():g();break;case"PageDown":G.preventDefault(),G.stopPropagation(),G.shiftKey?w():v();break;case"Home":G.preventDefault(),G.stopPropagation(),x();break;case"End":G.preventDefault(),G.stopPropagation(),_();break}(q=n.onDayKeyDown)===null||q===void 0||q.call(n,e,t,G)},Z={onClick:S,onFocus:C,onBlur:E,onKeyDown:B,onKeyUp:ee,onMouseEnter:P,onMouseLeave:A,onPointerEnter:k,onPointerLeave:I,onTouchCancel:$,onTouchEnd:L,onTouchMove:j,onTouchStart:Q};return Z}function Hie(){var e=an(),t=eI(),n=v_(),r=y_(),o=Km(e)?t.selected:qf(e)?n.selected:Gf(e)?r.selected:void 0;return o}function Wie(e){return Object.values(ei).includes(e)}function Uie(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var o=e.modifiersClassNames[r];if(o)n.push(o);else if(Wie(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function qie(e,t){var n=rt({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=rt(rt({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function Gie(e,t,n){var r,o,i,s=an(),a=w_(),l=jie(e,t),c=Vie(e,l),u=Hie(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var P;l.outside||a.focusedDay&&f&&Nr(a.focusedDay,e)&&((P=n.current)===null||P===void 0||P.focus())},[a.focusedDay,e,n,f,l.outside]);var h=Uie(s,l).join(" "),g=qie(s,l),v=!!(l.outside&&!s.showOutsideDays||l.hidden),b=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:pie,w=Se.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),x={style:g,className:h,children:w,role:"gridcell"},_=a.focusTarget&&Nr(a.focusTarget,e)&&!l.outside,S=a.focusedDay&&Nr(a.focusedDay,e),C=rt(rt(rt({},x),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=S||_?0:-1,r)),c),E={isButton:f,isHidden:v,activeModifiers:l,selectedDays:u,buttonProps:C,divProps:x};return E}function Yie(e){var t=m.useRef(null),n=Gie(e.date,e.displayMonth,t);return n.isHidden?Se.jsx("div",{role:"gridcell"}):n.isButton?Se.jsx(zg,rt({name:"day",ref:t},n.buttonProps)):Se.jsx("div",rt({},n.divProps))}function Kie(e){var t=e.number,n=e.dates,r=an(),o=r.onWeekNumberClick,i=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!o)return Se.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var f=l(Number(t),{locale:a}),h=function(g){o(t,n,g)};return Se.jsx(zg,{name:"week-number","aria-label":f,className:s.weeknumber,style:i.weeknumber,onClick:h,children:u})}function Xie(e){var t,n,r=an(),o=r.styles,i=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:Yie,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:Kie,u;return s&&(u=Se.jsx("td",{className:i.cell,style:o.cell,children:Se.jsx(c,{number:e.weekNumber,dates:e.dates})})),Se.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(f){return Se.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:Se.jsx(l,{displayMonth:e.displayMonth,date:f})},Coe(f))})]})}function oT(e,t,n){for(var r=n!=null&&n.ISOWeek?FM(t):p_(t,n),o=n!=null&&n.ISOWeek?bl(e):Ci(e,n),i=bi(r,o),s=[],a=0;a<=i;a++)s.push(yr(o,a));var l=s.reduce(function(c,u){var f=n!=null&&n.ISOWeek?zM(u):VM(u,n),h=c.find(function(g){return g.weekNumber===f});return h?(h.dates.push(u),c):(c.push({weekNumber:f,dates:[u]}),c)},[]);return l}function Qie(e,t){var n=oT(Lr(e),h_(e),t);if(t!=null&&t.useFixedWeeks){var r=Roe(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=zx(i,6-r),a=oT(zx(i,1),s,t);n.push.apply(n,a)}}return n}function Jie(e){var t,n,r,o=an(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,f=o.weekStartsOn,h=o.firstWeekContainsDate,g=o.ISOWeek,v=Qie(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:g,locale:i,weekStartsOn:f,firstWeekContainsDate:h}),b=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:hie,w=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:Xie,x=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:uie;return Se.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&Se.jsx(b,{}),Se.jsx("tbody",{className:s.tbody,style:a.tbody,children:v.map(function(_){return Se.jsx(w,{displayMonth:e.displayMonth,dates:_.dates,weekNumber:_.weekNumber},_.weekNumber)})}),Se.jsx(x,{displayMonth:e.displayMonth})]})}function Zie(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var ese=Zie()?m.useLayoutEffect:m.useEffect,$y=!1,tse=0;function iT(){return"react-day-picker-".concat(++tse)}function nse(e){var t,n=e??($y?iT():null),r=m.useState(n),o=r[0],i=r[1];return ese(function(){o===null&&i(iT())},[]),m.useEffect(function(){$y===!1&&($y=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function rse(e){var t,n,r=an(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=Yf().displayMonths,c=nse(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[i.month],h=s.month,g=e.displayIndex===0,v=e.displayIndex===l.length-1,b=!g&&!v;o==="rtl"&&(t=[g,v],v=t[0],g=t[1]),g&&(f.push(i.caption_start),h=rt(rt({},h),s.caption_start)),v&&(f.push(i.caption_end),h=rt(rt({},h),s.caption_end)),b&&(f.push(i.caption_between),h=rt(rt({},h),s.caption_between));var w=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:cie;return Se.jsxs("div",{className:f.join(" "),style:h,children:[Se.jsx(w,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Se.jsx(Jie,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function ose(e){var t=an(),n=t.classNames,r=t.styles;return Se.jsx("div",{className:n.months,style:r.months,children:e.children})}function ise(e){var t,n,r=e.initialProps,o=an(),i=w_(),s=Yf(),a=m.useState(!1),l=a[0],c=a[1];m.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var f=rt(rt({},o.styles.root),o.style),h=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,b){var w;return rt(rt({},v),(w={},w[b]=r[b],w))},{}),g=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:ose;return Se.jsx("div",rt({className:u.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:Se.jsx(g,{children:s.displayMonths.map(function(v,b){return Se.jsx(rse,{displayIndex:b,displayMonth:v},b)})})}))}function sse(e){var t=e.children,n=Poe(e,["children"]);return Se.jsx(Koe,{initialProps:n,children:Se.jsx(iie,{children:Se.jsx(zie,{initialProps:n,children:Se.jsx(gie,{initialProps:n,children:Se.jsx(bie,{initialProps:n,children:Se.jsx(Rie,{children:Se.jsx(Fie,{children:t})})})})})})})}function ase(e){return Se.jsx(sse,rt({},e,{children:Se.jsx(ise,{initialProps:e})}))}function tI({className:e,classNames:t,showOutsideDays:n=!0,...r}){return O.jsx(ase,{showOutsideDays:n,className:Ce("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:Ce(Vd({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:Ce(Vd({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...o})=>O.jsx(N$,{...o,className:"h-4 w-4"}),IconRight:({...o})=>O.jsx(E1,{...o,className:"h-4 w-4"})},...r})}tI.displayName="Calendar";function lse({filter:e,className:t}){const[n,r]=m.useState(!1),[o,i]=m.useState(),[s,a]=m.useState(),l=$e(S=>S.filterValues),{authToken:c}=ma(),u=$e(S=>S.actions.addOrUpdateFilterValue),f=$e(S=>S.actions.removeFilterValue),{data:h,isLoading:g,isFetching:v,isError:b,refetch:w}=Df({queryKey:[e.sql],queryFn:()=>Of("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId});m.useEffect(()=>{var S;if(((S=h==null?void 0:h.records)==null?void 0:S.length)>0){const C=h.records[0];if(!C.min||!C.max)return;i({from:new Date(C.min),to:new Date(C.max)}),a({from:new Date(C.min),to:new Date(C.max)})}},[h]),m.useEffect(()=>{if(l&&!l.find(C=>C.filterId===e.id)){i(s);return}},[l,e.id,s]);function x(){f(e.id),i(s),r(!1)}function _(){if(!o)return;console.log(o);const S=[o==null?void 0:o.from,o==null?void 0:o.to];console.log(S);const C={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:hg(e),name:e.column,operation:"between",values:S};u(C),r(!1)}return g?O.jsx("div",{children:O.jsx(am,{className:"h-8 w-full bg-foreground/10"})}):b?O.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):h?O.jsx("div",{className:Ce("grid gap-2",t),children:O.jsxs(qm,{open:n,onOpenChange:r,children:[O.jsx(Gm,{asChild:!0,children:O.jsxs(xr,{size:"sm",id:"date",variant:"outline",className:Ce("h-[34px] w-full justify-start rounded-sm text-left font-normal",!o&&"text-muted-foreground"),children:[O.jsx(I$,{className:"mr-2 h-4 w-4"}),o!=null&&o.from?o.to?O.jsxs(O.Fragment,{children:[xi(o.from,"LLL dd, y")," -"," ",xi(o.to,"LLL dd, y")]}):xi(o.from,"LLL dd, y"):O.jsx("span",{children:"Pick a date"})]})}),O.jsxs(Wf,{className:"w-auto p-0",align:"start",children:[O.jsx(tI,{initialFocus:!0,mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:i,numberOfMonths:2}),O.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[O.jsx(xr,{size:"sm",variant:"outline",onClick:_,children:"Apply"}),O.jsx(xr,{size:"sm",variant:"outline",onClick:x,children:"Clear"})]})]})]})}):O.jsxs(Wn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}/**
|
|
346
|
+
*/var tT;function Doe(){if(tT)return Qu;tT=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},h=null,g=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(g=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:h,ref:g,props:f,_owner:o.current}}return Qu.Fragment=n,Qu.jsx=s,Qu.jsxs=s,Qu}process.env.NODE_ENV==="production"?Vx.exports=Doe():Vx.exports=Toe();var Se=Vx.exports;function qf(e){return e.mode==="multiple"}function Gf(e){return e.mode==="range"}function Km(e){return e.mode==="single"}var Aoe={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 $oe(e,t){return xi(e,"LLLL y",t)}function koe(e,t){return xi(e,"d",t)}function Moe(e,t){return xi(e,"LLLL",t)}function Ioe(e){return"".concat(e)}function Noe(e,t){return xi(e,"cccccc",t)}function Loe(e,t){return xi(e,"yyyy",t)}var Foe=Object.freeze({__proto__:null,formatCaption:$oe,formatDay:koe,formatMonthCaption:Moe,formatWeekNumber:Ioe,formatWeekdayName:Noe,formatYearCaption:Loe}),joe=function(e,t,n){return xi(e,"do MMMM (EEEE)",n)},zoe=function(){return"Month: "},Boe=function(){return"Go to next month"},Voe=function(){return"Go to previous month"},Hoe=function(e,t){return xi(e,"cccc",t)},Woe=function(e){return"Week n. ".concat(e)},Uoe=function(){return"Year: "},qoe=Object.freeze({__proto__:null,labelDay:joe,labelMonthDropdown:zoe,labelNext:Boe,labelPrevious:Voe,labelWeekNumber:Woe,labelWeekday:Hoe,labelYearDropdown:Uoe});function Goe(){var e="buttons",t=Aoe,n=jM,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:Foe,labels:qoe,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function Yoe(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=Lr(r):t&&(i=new Date(t,0,1)),o?s=h_(o):n&&(s=new Date(n,11,31)),{fromDate:i?Zc(i):void 0,toDate:s?Zc(s):void 0}}var qM=m.createContext(void 0);function Koe(e){var t,n=e.initialProps,r=Goe(),o=Yoe(n),i=o.fromDate,s=o.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!i||!s)&&(a="buttons");var l;(Km(n)||qf(n)||Gf(n))&&(l=n.onSelect);var c=rt(rt(rt({},r),n),{captionLayout:a,classNames:rt(rt({},r.classNames),n.classNames),components:rt({},n.components),formatters:rt(rt({},r.formatters),n.formatters),fromDate:i,labels:rt(rt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:rt(rt({},r.modifiers),n.modifiers),modifiersClassNames:rt(rt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:rt(rt({},r.styles),n.styles),toDate:s});return Se.jsx(qM.Provider,{value:c,children:e.children})}function an(){var e=m.useContext(qM);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function GM(e){var t=an(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return Se.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function Xoe(e){return Se.jsx("svg",rt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:Se.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 YM(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,c=an(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Xoe;return Se.jsxs("div",{className:a,style:l,children:[Se.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),Se.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),Se.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,Se.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function Qoe(e){var t,n=an(),r=n.fromDate,o=n.toDate,i=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return Se.jsx(Se.Fragment,{});if(!o)return Se.jsx(Se.Fragment,{});var f=[];if(Ooe(r,o))for(var h=Lr(r),g=r.getMonth();g<=o.getMonth();g++)f.push(Py(h,g));else for(var h=Lr(new Date),g=0;g<=11;g++)f.push(Py(h,g));var v=function(w){var x=Number(w.target.value),_=Py(Lr(e.displayMonth),x);e.onChange(_)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:YM;return Se.jsx(b,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(w){return Se.jsx("option",{value:w.getMonth(),children:a(w,{locale:s})},w.getMonth())})})}function Joe(e){var t,n=e.displayMonth,r=an(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,h=[];if(!o)return Se.jsx(Se.Fragment,{});if(!i)return Se.jsx(Se.Fragment,{});for(var g=o.getFullYear(),v=i.getFullYear(),b=g;b<=v;b++)h.push(ZP(LM(new Date),b));var w=function(_){var S=ZP(Lr(n),Number(_.target.value));e.onChange(S)},x=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:YM;return Se.jsx(x,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:w,value:n.getFullYear(),caption:u(n,{locale:s}),children:h.map(function(_){return Se.jsx("option",{value:_.getFullYear(),children:u(_,{locale:s})},_.getFullYear())})})}function Zoe(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function eie(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(i&&Wd(i,o)<0){var c=-1*(l-1);o=Zo(i,c)}return s&&Wd(o,s)<0&&(o=s),Lr(o)}function tie(){var e=an(),t=eie(e),n=Zoe(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=Lr(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function nie(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=Lr(e),i=Lr(Zo(o,r)),s=Wd(i,o),a=[],l=0;l<s;l++){var c=Zo(o,l);a.push(c)}return n&&(a=a.reverse()),a}function rie(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=Lr(e);if(!n)return Zo(a,s);var l=Wd(n,e);if(!(l<i))return Zo(a,s)}}function oie(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=Lr(e);if(!n)return Zo(a,-s);var l=Wd(a,n);if(!(l<=0))return Zo(a,-s)}}var KM=m.createContext(void 0);function iie(e){var t=an(),n=tie(),r=n[0],o=n[1],i=nie(r,t),s=rie(r,t),a=oie(r,t),l=function(f){return i.some(function(h){return g_(f,h)})},c=function(f,h){l(f)||(h&&WM(f,h)?o(Zo(f,1+t.numberOfMonths*-1)):o(f))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return Se.jsx(KM.Provider,{value:u,children:e.children})}function Yf(){var e=m.useContext(KM);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function nT(e){var t,n=an(),r=n.classNames,o=n.styles,i=n.components,s=Yf().goToMonth,a=function(u){s(Zo(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:GM,c=Se.jsx(l,{id:e.id,displayMonth:e.displayMonth});return Se.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[Se.jsx("div",{className:r.vhidden,children:c}),Se.jsx(Qoe,{onChange:a,displayMonth:e.displayMonth}),Se.jsx(Joe,{onChange:a,displayMonth:e.displayMonth})]})}function sie(e){return Se.jsx("svg",rt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Se.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 aie(e){return Se.jsx("svg",rt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Se.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 zg=m.forwardRef(function(e,t){var n=an(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=rt(rt({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),Se.jsx("button",rt({},e,{ref:t,type:"button",className:s,style:a}))});function lie(e){var t,n,r=an(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return Se.jsx(Se.Fragment,{});var h=c(e.previousMonth,{locale:i}),g=[s.nav_button,s.nav_button_previous].join(" "),v=u(e.nextMonth,{locale:i}),b=[s.nav_button,s.nav_button_next].join(" "),w=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:aie,x=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:sie;return Se.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&Se.jsx(zg,{name:"previous-month","aria-label":h,className:g,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?Se.jsx(w,{className:s.nav_icon,style:a.nav_icon}):Se.jsx(x,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&Se.jsx(zg,{name:"next-month","aria-label":v,className:b,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?Se.jsx(x,{className:s.nav_icon,style:a.nav_icon}):Se.jsx(w,{className:s.nav_icon,style:a.nav_icon})})]})}function rT(e){var t=an().numberOfMonths,n=Yf(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(v){return g_(e.displayMonth,v)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),f=t>1&&(c||!l),h=function(){r&&i(r)},g=function(){o&&i(o)};return Se.jsx(lie,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:f,nextMonth:o,previousMonth:r,onPreviousClick:h,onNextClick:g})}function cie(e){var t,n=an(),r=n.classNames,o=n.disableNavigation,i=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:GM,c;return o?c=Se.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=Se.jsx(nT,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=Se.jsxs(Se.Fragment,{children:[Se.jsx(nT,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),Se.jsx(rT,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=Se.jsxs(Se.Fragment,{children:[Se.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Se.jsx(rT,{displayMonth:e.displayMonth,id:e.id})]}),Se.jsx("div",{className:r.caption,style:i.caption,children:c})}function uie(e){var t=an(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?Se.jsx("tfoot",{className:o,style:r.tfoot,children:Se.jsx("tr",{children:Se.jsx("td",{colSpan:8,children:n})})}):Se.jsx(Se.Fragment,{})}function die(e,t,n){for(var r=n?bl(new Date):Ci(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=yr(r,i);o.push(s)}return o}function fie(){var e=an(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=die(o,i,s);return Se.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&Se.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,f){return Se.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:a(u,{locale:o})},f)})]})}function hie(){var e,t=an(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:fie;return Se.jsx("thead",{style:r.head,className:n.head,children:Se.jsx(i,{})})}function pie(e){var t=an(),n=t.locale,r=t.formatters.formatDay;return Se.jsx(Se.Fragment,{children:r(e.date,{locale:n})})}var m_=m.createContext(void 0);function gie(e){if(!qf(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return Se.jsx(m_.Provider,{value:t,children:e.children})}return Se.jsx(mie,{initialProps:e.initialProps,children:e.children})}function mie(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,u,f){var h,g;(h=t.onDayClick)===null||h===void 0||h.call(t,c,u,f);var v=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!v){var b=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!b){var w=r?UM([],r,!0):[];if(u.selected){var x=w.findIndex(function(_){return Nr(c,_)});w.splice(x,1)}else w.push(c);(g=t.onSelect)===null||g===void 0||g.call(t,w,c,u,f)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=i&&r.length>i-1,f=r.some(function(h){return Nr(h,c)});return!!(u&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return Se.jsx(m_.Provider,{value:l,children:n})}function v_(){var e=m.useContext(m_);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function vie(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?Nr(o,e)&&Nr(r,e)?void 0:Nr(o,e)?{from:o,to:void 0}:Nr(r,e)?void 0:Bx(r,e)?{from:e,to:o}:{from:r,to:e}:o?Bx(e,o)?{from:o,to:e}:{from:e,to:o}:r?WM(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var b_=m.createContext(void 0);function bie(e){if(!Gf(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return Se.jsx(b_.Provider,{value:t,children:e.children})}return Se.jsx(yie,{initialProps:e.initialProps,children:e.children})}function yie(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,s=o.to,a=t.min,l=t.max,c=function(g,v,b){var w,x;(w=t.onDayClick)===null||w===void 0||w.call(t,g,v,b);var _=vie(g,r);(x=t.onSelect)===null||x===void 0||x.call(t,_,g,v,b)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],Nr(i,s)||(u.range_middle=[{after:i,before:s}])):u.range_end=[i]):s&&(u.range_start=[s],u.range_end=[s]),a&&(i&&!s&&u.disabled.push({after:Oy(i,a-1),before:yr(i,a-1)}),i&&s&&u.disabled.push({after:i,before:yr(i,a-1)}),!i&&s&&u.disabled.push({after:Oy(s,a-1),before:yr(s,a-1)})),l){if(i&&!s&&(u.disabled.push({before:yr(i,-l+1)}),u.disabled.push({after:yr(i,l-1)})),i&&s){var f=bi(s,i)+1,h=l-f;u.disabled.push({before:Oy(i,h)}),u.disabled.push({after:yr(s,h)})}!i&&s&&(u.disabled.push({before:yr(s,-l+1)}),u.disabled.push({after:yr(s,l-1)}))}return Se.jsx(b_.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function y_(){var e=m.useContext(b_);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function ag(e){return Array.isArray(e)?UM([],e,!0):e!==void 0?[e]:[]}function xie(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=ag(o)}),t}var ei;(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"})(ei||(ei={}));var wie=ei.Selected,Ui=ei.Disabled,_ie=ei.Hidden,Sie=ei.Today,Ty=ei.RangeEnd,Dy=ei.RangeMiddle,Ay=ei.RangeStart,Cie=ei.Outside;function Eie(e,t,n){var r,o=(r={},r[wie]=ag(e.selected),r[Ui]=ag(e.disabled),r[_ie]=ag(e.hidden),r[Sie]=[e.today],r[Ty]=[],r[Dy]=[],r[Ay]=[],r[Cie]=[],r);return e.fromDate&&o[Ui].push({before:e.fromDate}),e.toDate&&o[Ui].push({after:e.toDate}),qf(e)?o[Ui]=o[Ui].concat(t.modifiers[Ui]):Gf(e)&&(o[Ui]=o[Ui].concat(n.modifiers[Ui]),o[Ay]=n.modifiers[Ay],o[Dy]=n.modifiers[Dy],o[Ty]=n.modifiers[Ty]),o}var XM=m.createContext(void 0);function Rie(e){var t=an(),n=v_(),r=y_(),o=Eie(t,n,r),i=xie(t.modifiers),s=rt(rt({},o),i);return Se.jsx(XM.Provider,{value:s,children:e.children})}function QM(){var e=m.useContext(XM);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Oie(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Pie(e){return!!(e&&typeof e=="object"&&"from"in e)}function Tie(e){return!!(e&&typeof e=="object"&&"after"in e)}function Die(e){return!!(e&&typeof e=="object"&&"before"in e)}function Aie(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function $ie(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=bi(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=bi(e,r)>=0&&bi(o,e)>=0;return s}return o?Nr(o,e):r?Nr(r,e):!1}function kie(e){return f_(e)}function Mie(e){return Array.isArray(e)&&e.every(f_)}function Iie(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(kie(n))return Nr(e,n);if(Mie(n))return n.includes(e);if(Pie(n))return $ie(e,n);if(Aie(n))return n.dayOfWeek.includes(e.getDay());if(Oie(n)){var r=bi(n.before,e),o=bi(n.after,e),i=r>0,s=o<0,a=Bx(n.before,n.after);return a?s&&i:i||s}return Tie(n)?bi(e,n.after)>0:Die(n)?bi(n.before,e)>0:typeof n=="function"?n(e):!1})}function x_(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return Iie(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!g_(e,n)&&(o.outside=!0),o}function Nie(e,t){for(var n=Lr(e[0]),r=h_(e[e.length-1]),o,i,s=n;s<=r;){var a=x_(s,t),l=!a.disabled&&!a.hidden;if(!l){s=yr(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=yr(s,1)}return i||o}var Lie=365;function JM(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,f=o.locale,h={day:yr,week:zx,month:Zo,year:Sre,startOfWeek:function(w){return o.ISOWeek?bl(w):Ci(w,{locale:f,weekStartsOn:l})},endOfWeek:function(w){return o.ISOWeek?FM(w):p_(w,{locale:f,weekStartsOn:l})}},g=h[n](e,r==="after"?1:-1);r==="before"&&c?g=Cre([c,g]):r==="after"&&u&&(g=Ere([u,g]));var v=!0;if(i){var b=x_(g,i);v=!b.disabled&&!b.hidden}return v?g:a.count>Lie?a.lastFocused:JM(g,{moveBy:n,direction:r,context:o,modifiers:i,retry:rt(rt({},a),{count:a.count+1})})}var ZM=m.createContext(void 0);function Fie(e){var t=Yf(),n=QM(),r=m.useState(),o=r[0],i=r[1],s=m.useState(),a=s[0],l=s[1],c=Nie(t.displayMonths,n),u=o??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(o),i(void 0)},h=function(w){i(w)},g=an(),v=function(w,x){if(o){var _=JM(o,{moveBy:w,direction:x,context:g,modifiers:n});Nr(o,_)||(t.goToDate(_,o),h(_))}},b={focusedDay:o,focusTarget:u,blur:f,focus:h,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return Se.jsx(ZM.Provider,{value:b,children:e.children})}function w_(){var e=m.useContext(ZM);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function jie(e,t){var n=QM(),r=x_(e,n,t);return r}var __=m.createContext(void 0);function zie(e){if(!Km(e.initialProps)){var t={selected:void 0};return Se.jsx(__.Provider,{value:t,children:e.children})}return Se.jsx(Bie,{initialProps:e.initialProps,children:e.children})}function Bie(e){var t=e.initialProps,n=e.children,r=function(i,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,s,a)},o={selected:t.selected,onDayClick:r};return Se.jsx(__.Provider,{value:o,children:n})}function eI(){var e=m.useContext(__);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Vie(e,t){var n=an(),r=eI(),o=v_(),i=y_(),s=w_(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,f=s.blur,h=s.focus,g=s.focusMonthBefore,v=s.focusMonthAfter,b=s.focusYearBefore,w=s.focusYearAfter,x=s.focusStartOfWeek,_=s.focusEndOfWeek,S=function(G){var q,K,T,V;Km(n)?(q=r.onDayClick)===null||q===void 0||q.call(r,e,t,G):qf(n)?(K=o.onDayClick)===null||K===void 0||K.call(o,e,t,G):Gf(n)?(T=i.onDayClick)===null||T===void 0||T.call(i,e,t,G):(V=n.onDayClick)===null||V===void 0||V.call(n,e,t,G)},C=function(G){var q;h(e),(q=n.onDayFocus)===null||q===void 0||q.call(n,e,t,G)},E=function(G){var q;f(),(q=n.onDayBlur)===null||q===void 0||q.call(n,e,t,G)},P=function(G){var q;(q=n.onDayMouseEnter)===null||q===void 0||q.call(n,e,t,G)},A=function(G){var q;(q=n.onDayMouseLeave)===null||q===void 0||q.call(n,e,t,G)},k=function(G){var q;(q=n.onDayPointerEnter)===null||q===void 0||q.call(n,e,t,G)},I=function(G){var q;(q=n.onDayPointerLeave)===null||q===void 0||q.call(n,e,t,G)},$=function(G){var q;(q=n.onDayTouchCancel)===null||q===void 0||q.call(n,e,t,G)},L=function(G){var q;(q=n.onDayTouchEnd)===null||q===void 0||q.call(n,e,t,G)},j=function(G){var q;(q=n.onDayTouchMove)===null||q===void 0||q.call(n,e,t,G)},Q=function(G){var q;(q=n.onDayTouchStart)===null||q===void 0||q.call(n,e,t,G)},ee=function(G){var q;(q=n.onDayKeyUp)===null||q===void 0||q.call(n,e,t,G)},B=function(G){var q;switch(G.key){case"ArrowLeft":G.preventDefault(),G.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":G.preventDefault(),G.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":G.preventDefault(),G.stopPropagation(),c();break;case"ArrowUp":G.preventDefault(),G.stopPropagation(),u();break;case"PageUp":G.preventDefault(),G.stopPropagation(),G.shiftKey?b():g();break;case"PageDown":G.preventDefault(),G.stopPropagation(),G.shiftKey?w():v();break;case"Home":G.preventDefault(),G.stopPropagation(),x();break;case"End":G.preventDefault(),G.stopPropagation(),_();break}(q=n.onDayKeyDown)===null||q===void 0||q.call(n,e,t,G)},Z={onClick:S,onFocus:C,onBlur:E,onKeyDown:B,onKeyUp:ee,onMouseEnter:P,onMouseLeave:A,onPointerEnter:k,onPointerLeave:I,onTouchCancel:$,onTouchEnd:L,onTouchMove:j,onTouchStart:Q};return Z}function Hie(){var e=an(),t=eI(),n=v_(),r=y_(),o=Km(e)?t.selected:qf(e)?n.selected:Gf(e)?r.selected:void 0;return o}function Wie(e){return Object.values(ei).includes(e)}function Uie(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var o=e.modifiersClassNames[r];if(o)n.push(o);else if(Wie(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function qie(e,t){var n=rt({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=rt(rt({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function Gie(e,t,n){var r,o,i,s=an(),a=w_(),l=jie(e,t),c=Vie(e,l),u=Hie(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var P;l.outside||a.focusedDay&&f&&Nr(a.focusedDay,e)&&((P=n.current)===null||P===void 0||P.focus())},[a.focusedDay,e,n,f,l.outside]);var h=Uie(s,l).join(" "),g=qie(s,l),v=!!(l.outside&&!s.showOutsideDays||l.hidden),b=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:pie,w=Se.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),x={style:g,className:h,children:w,role:"gridcell"},_=a.focusTarget&&Nr(a.focusTarget,e)&&!l.outside,S=a.focusedDay&&Nr(a.focusedDay,e),C=rt(rt(rt({},x),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=S||_?0:-1,r)),c),E={isButton:f,isHidden:v,activeModifiers:l,selectedDays:u,buttonProps:C,divProps:x};return E}function Yie(e){var t=m.useRef(null),n=Gie(e.date,e.displayMonth,t);return n.isHidden?Se.jsx("div",{role:"gridcell"}):n.isButton?Se.jsx(zg,rt({name:"day",ref:t},n.buttonProps)):Se.jsx("div",rt({},n.divProps))}function Kie(e){var t=e.number,n=e.dates,r=an(),o=r.onWeekNumberClick,i=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!o)return Se.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var f=l(Number(t),{locale:a}),h=function(g){o(t,n,g)};return Se.jsx(zg,{name:"week-number","aria-label":f,className:s.weeknumber,style:i.weeknumber,onClick:h,children:u})}function Xie(e){var t,n,r=an(),o=r.styles,i=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:Yie,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:Kie,u;return s&&(u=Se.jsx("td",{className:i.cell,style:o.cell,children:Se.jsx(c,{number:e.weekNumber,dates:e.dates})})),Se.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(f){return Se.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:Se.jsx(l,{displayMonth:e.displayMonth,date:f})},Coe(f))})]})}function oT(e,t,n){for(var r=n!=null&&n.ISOWeek?FM(t):p_(t,n),o=n!=null&&n.ISOWeek?bl(e):Ci(e,n),i=bi(r,o),s=[],a=0;a<=i;a++)s.push(yr(o,a));var l=s.reduce(function(c,u){var f=n!=null&&n.ISOWeek?zM(u):VM(u,n),h=c.find(function(g){return g.weekNumber===f});return h?(h.dates.push(u),c):(c.push({weekNumber:f,dates:[u]}),c)},[]);return l}function Qie(e,t){var n=oT(Lr(e),h_(e),t);if(t!=null&&t.useFixedWeeks){var r=Roe(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=zx(i,6-r),a=oT(zx(i,1),s,t);n.push.apply(n,a)}}return n}function Jie(e){var t,n,r,o=an(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,f=o.weekStartsOn,h=o.firstWeekContainsDate,g=o.ISOWeek,v=Qie(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:g,locale:i,weekStartsOn:f,firstWeekContainsDate:h}),b=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:hie,w=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:Xie,x=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:uie;return Se.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&Se.jsx(b,{}),Se.jsx("tbody",{className:s.tbody,style:a.tbody,children:v.map(function(_){return Se.jsx(w,{displayMonth:e.displayMonth,dates:_.dates,weekNumber:_.weekNumber},_.weekNumber)})}),Se.jsx(x,{displayMonth:e.displayMonth})]})}function Zie(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var ese=Zie()?m.useLayoutEffect:m.useEffect,$y=!1,tse=0;function iT(){return"react-day-picker-".concat(++tse)}function nse(e){var t,n=e??($y?iT():null),r=m.useState(n),o=r[0],i=r[1];return ese(function(){o===null&&i(iT())},[]),m.useEffect(function(){$y===!1&&($y=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function rse(e){var t,n,r=an(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=Yf().displayMonths,c=nse(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[i.month],h=s.month,g=e.displayIndex===0,v=e.displayIndex===l.length-1,b=!g&&!v;o==="rtl"&&(t=[g,v],v=t[0],g=t[1]),g&&(f.push(i.caption_start),h=rt(rt({},h),s.caption_start)),v&&(f.push(i.caption_end),h=rt(rt({},h),s.caption_end)),b&&(f.push(i.caption_between),h=rt(rt({},h),s.caption_between));var w=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:cie;return Se.jsxs("div",{className:f.join(" "),style:h,children:[Se.jsx(w,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Se.jsx(Jie,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function ose(e){var t=an(),n=t.classNames,r=t.styles;return Se.jsx("div",{className:n.months,style:r.months,children:e.children})}function ise(e){var t,n,r=e.initialProps,o=an(),i=w_(),s=Yf(),a=m.useState(!1),l=a[0],c=a[1];m.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var f=rt(rt({},o.styles.root),o.style),h=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,b){var w;return rt(rt({},v),(w={},w[b]=r[b],w))},{}),g=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:ose;return Se.jsx("div",rt({className:u.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:Se.jsx(g,{children:s.displayMonths.map(function(v,b){return Se.jsx(rse,{displayIndex:b,displayMonth:v},b)})})}))}function sse(e){var t=e.children,n=Poe(e,["children"]);return Se.jsx(Koe,{initialProps:n,children:Se.jsx(iie,{children:Se.jsx(zie,{initialProps:n,children:Se.jsx(gie,{initialProps:n,children:Se.jsx(bie,{initialProps:n,children:Se.jsx(Rie,{children:Se.jsx(Fie,{children:t})})})})})})})}function ase(e){return Se.jsx(sse,rt({},e,{children:Se.jsx(ise,{initialProps:e})}))}function tI({className:e,classNames:t,showOutsideDays:n=!0,...r}){return O.jsx(ase,{showOutsideDays:n,className:Ce("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:Ce(Vd({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:Ce(Vd({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...o})=>O.jsx(N$,{...o,className:"h-4 w-4"}),IconRight:({...o})=>O.jsx(E1,{...o,className:"h-4 w-4"})},...r})}tI.displayName="Calendar";function lse({filter:e,className:t}){const[n,r]=m.useState(!1),[o,i]=m.useState(),[s,a]=m.useState(),l=ke(S=>S.filterValues),{authToken:c}=ma(),u=ke(S=>S.actions.addOrUpdateFilterValue),f=ke(S=>S.actions.removeFilterValue),{data:h,isLoading:g,isFetching:v,isError:b,refetch:w}=Df({queryKey:[e.sql],queryFn:()=>Of("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId});m.useEffect(()=>{var S;if(((S=h==null?void 0:h.records)==null?void 0:S.length)>0){const C=h.records[0];if(!C.min||!C.max)return;i({from:new Date(C.min),to:new Date(C.max)}),a({from:new Date(C.min),to:new Date(C.max)})}},[h]),m.useEffect(()=>{if(l&&!l.find(C=>C.filterId===e.id)){i(s);return}},[l,e.id,s]);function x(){f(e.id),i(s),r(!1)}function _(){if(!o)return;console.log(o);const S=[o==null?void 0:o.from,o==null?void 0:o.to];console.log(S);const C={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:hg(e),name:e.column,operation:"between",values:S};u(C),r(!1)}return g?O.jsx("div",{children:O.jsx(am,{className:"h-8 w-full bg-foreground/10"})}):b?O.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):h?O.jsx("div",{className:Ce("grid gap-2",t),children:O.jsxs(qm,{open:n,onOpenChange:r,children:[O.jsx(Gm,{asChild:!0,children:O.jsxs(xr,{size:"sm",id:"date",variant:"outline",className:Ce("h-[34px] w-full justify-start rounded-sm text-left font-normal",!o&&"text-muted-foreground"),children:[O.jsx(I$,{className:"mr-2 h-4 w-4"}),o!=null&&o.from?o.to?O.jsxs(O.Fragment,{children:[xi(o.from,"LLL dd, y")," -"," ",xi(o.to,"LLL dd, y")]}):xi(o.from,"LLL dd, y"):O.jsx("span",{children:"Pick a date"})]})}),O.jsxs(Wf,{className:"w-auto p-0",align:"start",children:[O.jsx(tI,{initialFocus:!0,mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:i,numberOfMonths:2}),O.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[O.jsx(xr,{size:"sm",variant:"outline",onClick:_,children:"Apply"}),O.jsx(xr,{size:"sm",variant:"outline",onClick:x,children:"Clear"})]})]})]})}):O.jsxs(Wn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}/**
|
|
347
347
|
* react-virtual
|
|
348
348
|
*
|
|
349
349
|
* Copyright (c) TanStack
|
|
@@ -394,7 +394,7 @@ Check the top-level render call using <`+ce+">.")}return te}}function ni(D,te){{
|
|
|
394
394
|
*/var bse=typeof document<"u"?H.useLayoutEffect:H.useEffect;function yse(e){var t=H.useReducer(function(){return{}},{})[1],n=Bg({},e,{onChange:function(s,a){a?Mo.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=H.useState(function(){return new mse(n)}),o=r[0];return o.setOptions(n),H.useEffect(function(){return o._didMount()},[]),bse(function(){return o._willUpdate()}),o}function xse(e){return yse(Bg({observeElementRect:fse,observeElementOffset:hse,scrollToFn:gse},e))}var wse=Object.defineProperty,_se=(e,t,n)=>t in e?wse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,My=(e,t,n)=>(_se(e,typeof t!="symbol"?t+"":t,n),n);let Sse=class{constructor(){My(this,"current",this.detect()),My(this,"handoffState","pending"),My(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"}},cl=new Sse,Fn=(e,t)=>{cl.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function wi(e){let t=m.useRef(e);return Fn(()=>{t.current=e},[e]),t}function S_(e,t){let[n,r]=m.useState(e),o=wi(e);return Fn(()=>r(o.current),[o,r,...t]),n}let Et=function(e){let t=wi(e);return m.useCallback((...n)=>t.current(...n),[t])};function Cse(e,t,n){let[r,o]=m.useState(n),i=e!==void 0,s=m.useRef(i),a=m.useRef(!1),l=m.useRef(!1);return i&&!s.current&&!a.current?(a.current=!0,s.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&s.current&&!l.current&&(l.current=!0,s.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,Et(c=>(i||o(c),t==null?void 0:t(c)))]}function Ese(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function yl(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Ese(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=yl();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Kf(){let[e]=m.useState(yl);return m.useEffect(()=>()=>e.dispose(),[e]),e}function Rse(){let e=typeof document>"u";return"useSyncExternalStore"in H?(t=>t.useSyncExternalStore)(H)(()=>()=>{},()=>!1,()=>!e):!1}function C_(){let e=Rse(),[t,n]=H.useState(cl.isHandoffComplete);return t&&cl.isHandoffComplete===!1&&n(!1),H.useEffect(()=>{t!==!0&&n(!0)},[t]),H.useEffect(()=>cl.handoff(),[]),e?!1:t}var sT;let Xf=(sT=m.useId)!=null?sT:function(){let e=C_(),[t,n]=m.useState(e?()=>cl.nextId():null);return Fn(()=>{t===null&&n(cl.nextId())},[t]),t!=null?""+t:void 0};function Qn(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Qn),r}function E_(e){return cl.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let aT=["[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 Ose=(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))(Ose||{}),Pse=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Pse||{}),Tse=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Tse||{}),rI=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(rI||{});function Dse(e,t=0){var n;return e===((n=E_(e))==null?void 0:n.body)?!1:Qn(t,{0(){return e.matches(aT)},1(){let r=e;for(;r!==null;){if(r.matches(aT))return!0;r=r.parentElement}return!1}})}var Ase=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Ase||{});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 $se(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function kse(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Mse(){return/Android/gi.test(window.navigator.userAgent)}function oI(){return kse()||Mse()}function Dp(e,t,n){let r=wi(t);m.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,n),()=>document.removeEventListener(e,o,n)},[e,n])}function Ise(e,t,n){let r=wi(t);m.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,n),()=>window.removeEventListener(e,o,n)},[e,n])}function Nse(e,t,n=!0){let r=m.useRef(!1);m.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function o(s,a){if(!r.current||s.defaultPrevented)return;let l=a(s);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let c=function u(f){return typeof f=="function"?u(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let u of c){if(u===null)continue;let f=u instanceof HTMLElement?u:u.current;if(f!=null&&f.contains(l)||s.composed&&s.composedPath().includes(f))return}return!Dse(l,rI.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let i=m.useRef(null);Dp("pointerdown",s=>{var a,l;r.current&&(i.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Dp("mousedown",s=>{var a,l;r.current&&(i.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Dp("click",s=>{oI()||i.current&&(o(s,()=>i.current),i.current=null)},!0),Dp("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),Ise("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Lse(...e){return m.useMemo(()=>E_(...e),[...e])}function lT(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Fse(e,t){let[n,r]=m.useState(()=>lT(e));return Fn(()=>{r(lT(e))},[e.type,e.as]),Fn(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let jse=Symbol();function Pl(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=Et(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[jse]))?void 0:n}function cT(e){return[e.screenX,e.screenY]}function zse(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=cT(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=cT(t)}}}function Bse({container:e,accept:t,walk:n,enabled:r=!0}){let o=m.useRef(t),i=m.useRef(n);m.useEffect(()=>{o.current=t,i.current=n},[t,n]),Fn(()=>{if(!e||!r)return;let s=E_(e);if(!s)return;let a=o.current,l=i.current,c=Object.assign(f=>a(f),{acceptNode:a}),u=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[e,r,o,i])}function uT(e,t){let n=m.useRef([]),r=Et(e);m.useEffect(()=>{let o=[...n.current];for(let[i,s]of t.entries())if(n.current[i]!==s){let a=r(t,o);return n.current=t,a}},[r,...t])}function Hg(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Wg=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Wg||{}),ta=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ta||{});function fs({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??Vse;let l=iI(t,e);if(i)return Ap(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...f}=l;if(u)return Ap(f,n,r,s,a)}if(c&1){let{unmount:u=!0,...f}=l;return Qn(u?0:1,{0(){return null},1(){return Ap({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Ap(l,n,r,s,a)}function Ap(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=Iy(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let f={};if(t){let h=!1,g=[];for(let[v,b]of Object.entries(t))typeof b=="boolean"&&(h=!0),b===!0&&g.push(v);h&&(f["data-headlessui-state"]=g.join(" "))}if(i===m.Fragment&&Object.keys(Hx(l)).length>0){if(!m.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(b=>` - ${b}`).join(`
|
|
395
395
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(b=>` - ${b}`).join(`
|
|
396
396
|
`)].join(`
|
|
397
|
-
`));let h=u.props,g=typeof(h==null?void 0:h.className)=="function"?(...b)=>Hg(h==null?void 0:h.className(...b),l.className):Hg(h==null?void 0:h.className,l.className),v=g?{className:g}:{};return m.cloneElement(u,Object.assign({},iI(u.props,Hx(Iy(l,["ref"]))),f,c,{ref:o(u.ref,c.ref)},v))}return m.createElement(i,Object.assign({},Iy(l,["ref"]),i!==m.Fragment&&c,i!==m.Fragment&&f),u)}function Vse(...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 iI(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function Di(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Hx(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Iy(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Hse="div";var sI=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(sI||{});function Wse(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return fs({ourProps:i,theirProps:o,slot:{},defaultTag:Hse,name:"Hidden"})}let Use=Di(Wse),R_=m.createContext(null);R_.displayName="OpenClosedContext";var ro=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ro||{});function O_(){return m.useContext(R_)}function aI({value:e,children:t}){return m.createElement(R_.Provider,{value:e},t)}function qse(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Ha=[];qse(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Ha[0]!==t.target&&(Ha.unshift(t.target),Ha=Ha.filter(n=>n!=null&&n.isConnected),Ha.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 Gse(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&&Yse(n)?!1:r}function Yse(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function Kse(e){throw new Error("Unexpected object: "+e)}var Nn=(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))(Nn||{});function dT(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:Kse(e)}}function lI(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))uI(n,cI(t,r),o);return n}function cI(e,t){return e?e+"["+t+"]":t}function uI(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())uI(e,cI(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):lI(n,t,e)}var Jr=(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))(Jr||{}),Xse=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Xse||{}),Qse=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Qse||{}),Jse=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Jse||{}),Zse=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(Zse||{});function Ny(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):$se(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let eae={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,r,o,i,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((o=e.dataRef.current)!=null&&o.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let u=t.focus===Nn.Specific?t.idx:dT(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var h,g;return(g=(h=e.activeOptionIndex)!=null?h:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?g:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===u&&e.activationTrigger===f?e:{...e,activeOptionIndex:u,activationTrigger:f}}let a=Ny(e);if(a.activeOptionIndex===null){let u=a.options.findIndex(f=>!f.dataRef.current.disabled);u!==-1&&(a.activeOptionIndex=u)}let l=t.focus===Nn.Specific?t.idx:dT(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),c=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===c?e:{...e,...a,activeOptionIndex:l,activationTrigger:c}},3:(e,t)=>{var n,r,o;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,s=Ny(e,l=>(l.push(i),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let a={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(o=>o.id!==t.id)};let r=Ny(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?r=o:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},P_=m.createContext(null);P_.displayName="ComboboxActionsContext";function Qf(e){let t=m.useContext(P_);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Qf),n}return t}let dI=m.createContext(null);function tae(e){var t;let n=Tl("VirtualProvider"),[r,o]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[n.optionsRef.current]),i=xse({scrollPaddingStart:r,scrollPaddingEnd:o,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=m.useState(0);return Fn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(dI.Provider,{value:i},m.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&i.scrollToIndex(n.activeOptionIndex)}}},i.getVirtualItems().map(l=>{var c;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((c=e.children)==null?void 0:c.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":n.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let T_=m.createContext(null);T_.displayName="ComboboxDataContext";function Tl(e){let t=m.useContext(T_);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Tl),n}return t}function nae(e,t){return Qn(t.type,eae,e,t)}let rae=m.Fragment;function oae(e,t){let{value:n,defaultValue:r,onChange:o,form:i,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:f=!1,immediate:h=!1,virtual:g=null,...v}=e,b=!1,w=null,[x=f?[]:void 0,_]=Cse(n,o,r),[S,C]=m.useReducer(nae,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),E=m.useRef(!1),P=m.useRef({static:!1,hold:!1}),A=m.useRef(null),k=m.useRef(null),I=m.useRef(null),$=m.useRef(null),L=Et(typeof a=="string"?(ne,le)=>{let ye=a;return(ne==null?void 0:ne[ye])===(le==null?void 0:le[ye])}:a??((ne,le)=>ne===le)),j=Et(ne=>S.options.findIndex(le=>L(le.dataRef.current.value,ne))),Q=m.useCallback(ne=>Qn(B.mode,{1:()=>x.some(le=>L(le,ne)),0:()=>L(x,ne)}),[x]),ee=Et(ne=>S.activeOptionIndex===j(ne)),B=m.useMemo(()=>({...S,immediate:b,optionsPropsRef:P,labelRef:A,inputRef:k,buttonRef:I,optionsRef:$,value:x,defaultValue:r,disabled:l,mode:f?1:0,virtual:S.virtual,get activeOptionIndex(){if(E.current&&S.activeOptionIndex===null&&S.options.length>0){let ne=S.options.findIndex(le=>!le.dataRef.current.disabled);if(ne!==-1)return ne}return S.activeOptionIndex},calculateIndex:j,compare:L,isSelected:Q,isActive:ee,nullable:u,__demoMode:c}),[x,r,l,f,u,c,S,w]);Fn(()=>{},[w,void 0]),Fn(()=>{S.dataRef.current=B},[B]),Nse([B.buttonRef,B.inputRef,B.optionsRef],()=>fe.closeCombobox(),B.comboboxState===0);let Z=m.useMemo(()=>{var ne,le,ye;return{open:B.comboboxState===0,disabled:l,activeIndex:B.activeOptionIndex,activeOption:B.activeOptionIndex===null?null:B.virtual?B.virtual.options[(ne=B.activeOptionIndex)!=null?ne:0]:(ye=(le=B.options[B.activeOptionIndex])==null?void 0:le.dataRef.current.value)!=null?ye:null,value:x}},[B,l,x]),G=Et(()=>{if(B.activeOptionIndex!==null){if(B.virtual)N(B.virtual.options[B.activeOptionIndex]);else{let{dataRef:ne}=B.options[B.activeOptionIndex];N(ne.current.value)}fe.goToOption(Nn.Specific,B.activeOptionIndex)}}),q=Et(()=>{C({type:0}),E.current=!0}),K=Et(()=>{C({type:1}),E.current=!1}),T=Et((ne,le,ye)=>(E.current=!1,ne===Nn.Specific?C({type:2,focus:Nn.Specific,idx:le,trigger:ye}):C({type:2,focus:ne,trigger:ye}))),V=Et((ne,le)=>(C({type:3,payload:{id:ne,dataRef:le}}),()=>{B.isActive(le.current.value)&&(E.current=!0),C({type:4,id:ne})})),X=Et(ne=>(C({type:5,id:ne}),()=>C({type:5,id:null}))),N=Et(ne=>Qn(B.mode,{0(){return _==null?void 0:_(ne)},1(){let le=B.value.slice(),ye=le.findIndex(Y=>L(Y,ne));return ye===-1?le.push(ne):le.splice(ye,1),_==null?void 0:_(le)}})),ie=Et(ne=>{C({type:6,trigger:ne})}),fe=m.useMemo(()=>({onChange:N,registerOption:V,registerLabel:X,goToOption:T,closeCombobox:K,openCombobox:q,setActivationTrigger:ie,selectActiveOption:G}),[]),ue=t===null?{}:{ref:t},pe=m.useRef(null),se=Kf();return m.useEffect(()=>{pe.current&&r!==void 0&&se.addEventListener(pe.current,"reset",()=>{_==null||_(r)})},[pe,_]),m.createElement(P_.Provider,{value:fe},m.createElement(T_.Provider,{value:B},m.createElement(aI,{value:Qn(B.comboboxState,{0:ro.Open,1:ro.Closed})},s!=null&&x!=null&&lI({[s]:x}).map(([ne,le],ye)=>m.createElement(Use,{features:sI.Hidden,ref:ye===0?Y=>{var be;pe.current=(be=Y==null?void 0:Y.closest("form"))!=null?be:null}:void 0,...Hx({key:ne,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:ne,value:le})})),fs({ourProps:ue,theirProps:v,slot:Z,defaultTag:rae,name:"Combobox"}))))}let iae="input";function sae(e,t){var n,r,o,i,s;let a=Xf(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:u,type:f="text",...h}=e,g=Tl("Combobox.Input"),v=Qf("Combobox.Input"),b=Pl(g.inputRef,t),w=Lse(g.inputRef),x=m.useRef(!1),_=Kf(),S=Et(()=>{v.onChange(null),g.optionsRef.current&&(g.optionsRef.current.scrollTop=0),v.goToOption(Nn.Nothing)}),C=function(){var B;return typeof u=="function"&&g.value!==void 0?(B=u(g.value))!=null?B:"":typeof g.value=="string"?g.value:""}();uT(([B,Z],[G,q])=>{if(x.current)return;let K=g.inputRef.current;K&&((q===0&&Z===1||B!==G)&&(K.value=B),requestAnimationFrame(()=>{if(x.current||!K||(w==null?void 0:w.activeElement)!==K)return;let{selectionStart:T,selectionEnd:V}=K;Math.abs((V??0)-(T??0))===0&&T===0&&K.setSelectionRange(K.value.length,K.value.length)}))},[C,g.comboboxState,w]),uT(([B],[Z])=>{if(B===0&&Z===1){if(x.current)return;let G=g.inputRef.current;if(!G)return;let q=G.value,{selectionStart:K,selectionEnd:T,selectionDirection:V}=G;G.value="",G.value=q,V!==null?G.setSelectionRange(K,T,V):G.setSelectionRange(K,T)}},[g.comboboxState]);let E=m.useRef(!1),P=Et(()=>{E.current=!0}),A=Et(()=>{_.nextFrame(()=>{E.current=!1})}),k=Et(B=>{switch(x.current=!0,B.key){case Jr.Enter:if(x.current=!1,g.comboboxState!==0||E.current)return;if(B.preventDefault(),B.stopPropagation(),g.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),g.mode===0&&v.closeCombobox();break;case Jr.ArrowDown:return x.current=!1,B.preventDefault(),B.stopPropagation(),Qn(g.comboboxState,{0:()=>v.goToOption(Nn.Next),1:()=>v.openCombobox()});case Jr.ArrowUp:return x.current=!1,B.preventDefault(),B.stopPropagation(),Qn(g.comboboxState,{0:()=>v.goToOption(Nn.Previous),1:()=>{v.openCombobox(),_.nextFrame(()=>{g.value||v.goToOption(Nn.Last)})}});case Jr.Home:if(B.shiftKey)break;return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.First);case Jr.PageUp:return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.First);case Jr.End:if(B.shiftKey)break;return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.Last);case Jr.PageDown:return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.Last);case Jr.Escape:return x.current=!1,g.comboboxState!==0?void 0:(B.preventDefault(),g.optionsRef.current&&!g.optionsPropsRef.current.static&&B.stopPropagation(),g.nullable&&g.mode===0&&g.value===null&&S(),v.closeCombobox());case Jr.Tab:if(x.current=!1,g.comboboxState!==0)return;g.mode===0&&g.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),I=Et(B=>{c==null||c(B),g.nullable&&g.mode===0&&B.target.value===""&&S(),v.openCombobox()}),$=Et(B=>{var Z,G,q;let K=(Z=B.relatedTarget)!=null?Z:Ha.find(T=>T!==B.currentTarget);if(x.current=!1,!((G=g.optionsRef.current)!=null&&G.contains(K))&&!((q=g.buttonRef.current)!=null&&q.contains(K))&&g.comboboxState===0)return B.preventDefault(),g.mode===0&&(g.nullable&&g.value===null?S():g.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),L=Et(B=>{var Z,G,q;let K=(Z=B.relatedTarget)!=null?Z:Ha.find(T=>T!==B.currentTarget);(G=g.buttonRef.current)!=null&&G.contains(K)||(q=g.optionsRef.current)!=null&&q.contains(K)||g.disabled||g.immediate&&g.comboboxState!==0&&(v.openCombobox(),_.nextFrame(()=>{v.setActivationTrigger(1)}))}),j=S_(()=>{if(g.labelId)return[g.labelId].join(" ")},[g.labelId]),Q=m.useMemo(()=>({open:g.comboboxState===0,disabled:g.disabled}),[g]),ee={ref:b,id:l,role:"combobox",type:f,"aria-controls":(n=g.optionsRef.current)==null?void 0:n.id,"aria-expanded":g.comboboxState===0,"aria-activedescendant":g.activeOptionIndex===null?void 0:g.virtual?(r=g.options.find(B=>{var Z;return!((Z=g.virtual)!=null&&Z.disabled(B.dataRef.current.value))&&g.compare(B.dataRef.current.value,g.virtual.options[g.activeOptionIndex])}))==null?void 0:r.id:(o=g.options[g.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":j,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:g.defaultValue!==void 0?u==null?void 0:u(g.defaultValue):null)!=null?s:g.defaultValue,disabled:g.disabled,onCompositionStart:P,onCompositionEnd:A,onKeyDown:k,onChange:I,onFocus:L,onBlur:$};return fs({ourProps:ee,theirProps:h,slot:Q,defaultTag:iae,name:"Combobox.Input"})}let aae="button";function lae(e,t){var n;let r=Tl("Combobox.Button"),o=Qf("Combobox.Button"),i=Pl(r.buttonRef,t),s=Xf(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=Kf(),u=Et(b=>{switch(b.key){case Jr.ArrowDown:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&o.openCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case Jr.ArrowUp:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),c.nextFrame(()=>{r.value||o.goToOption(Nn.Last)})),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case Jr.Escape:return r.comboboxState!==0?void 0:(b.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&b.stopPropagation(),o.closeCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})}));default:return}}),f=Et(b=>{if(Gse(b.currentTarget))return b.preventDefault();r.comboboxState===0?o.closeCombobox():(b.preventDefault(),o.openCombobox()),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})})}),h=S_(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),g=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:i,id:a,type:Fse(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsRef.current)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":h,disabled:r.disabled,onClick:f,onKeyDown:u};return fs({ourProps:v,theirProps:l,slot:g,defaultTag:aae,name:"Combobox.Button"})}let cae="label";function uae(e,t){let n=Xf(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=Tl("Combobox.Label"),s=Qf("Combobox.Label"),a=Pl(i.labelRef,t);Fn(()=>s.registerLabel(r),[r]);let l=Et(()=>{var u;return(u=i.inputRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return fs({ourProps:{ref:a,id:r,onClick:l},theirProps:o,slot:c,defaultTag:cae,name:"Combobox.Label"})}let dae="ul",fae=Wg.RenderStrategy|Wg.Static;function hae(e,t){let n=Xf(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=Tl("Combobox.Options"),a=Pl(s.optionsRef,t),l=O_(),c=l!==null?(l&ro.Open)===ro.Open:s.comboboxState===0;Fn(()=>{var g;s.optionsPropsRef.current.static=(g=e.static)!=null?g:!1},[s.optionsPropsRef,e.static]),Fn(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),Bse({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(g){return g.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:g.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(g){g.setAttribute("role","none")}});let u=S_(()=>{var g,v;return(v=s.labelId)!=null?v:(g=s.buttonRef.current)==null?void 0:g.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),h={"aria-labelledby":u,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(i,{children:m.createElement(tae,null,i.children)}),fs({ourProps:h,theirProps:i,slot:f,defaultTag:dae,features:fae,visible:c,name:"Combobox.Options"})}let pae="li";function gae(e,t){var n;let r=Xf(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,c=Tl("Combobox.Option"),u=Qf("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===o,h=c.isSelected(s),g=m.useRef(null),v=wi({disabled:i,value:s,domRef:g,order:a}),b=m.useContext(dI),w=Pl(t,g,b?b.measureElement:null),x=Et(()=>u.onChange(s));Fn(()=>u.registerOption(o,v),[v,o]);let _=m.useRef(!(c.virtual||c.__demoMode));Fn(()=>{if(!c.virtual||!c.__demoMode)return;let $=yl();return $.requestAnimationFrame(()=>{_.current=!0}),$.dispose},[c.virtual,c.__demoMode]),Fn(()=>{if(!_.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let $=yl();return $.requestAnimationFrame(()=>{var L,j;(j=(L=g.current)==null?void 0:L.scrollIntoView)==null||j.call(L,{block:"nearest"})}),$.dispose},[g,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let S=Et($=>{var L;if(i||(L=c.virtual)!=null&&L.disabled(s))return $.preventDefault();x(),oI()||requestAnimationFrame(()=>{var j;return(j=c.inputRef.current)==null?void 0:j.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),C=Et(()=>{var $;if(i||($=c.virtual)!=null&&$.disabled(s))return u.goToOption(Nn.Nothing);let L=c.calculateIndex(s);u.goToOption(Nn.Specific,L)}),E=zse(),P=Et($=>E.update($)),A=Et($=>{var L;if(!E.wasMoved($)||i||(L=c.virtual)!=null&&L.disabled(s)||f)return;let j=c.calculateIndex(s);u.goToOption(Nn.Specific,j,0)}),k=Et($=>{var L;E.wasMoved($)&&(i||(L=c.virtual)!=null&&L.disabled(s)||f&&(c.optionsPropsRef.current.hold||u.goToOption(Nn.Nothing)))}),I=m.useMemo(()=>({active:f,selected:h,disabled:i}),[f,h,i]);return fs({ourProps:{id:o,ref:w,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:S,onFocus:C,onPointerEnter:P,onMouseEnter:P,onPointerMove:A,onMouseMove:A,onPointerLeave:k,onMouseLeave:k},theirProps:l,slot:I,defaultTag:pae,name:"Combobox.Option"})}let mae=Di(oae),vae=Di(lae),bae=Di(sae),yae=Di(uae),xae=Di(hae),wae=Di(gae),oc=Object.assign(mae,{Input:bae,Button:vae,Label:yae,Options:xae,Option:wae});function D_(){let e=m.useRef(!1);return Fn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function _ae(e=0){let[t,n]=m.useState(e),r=D_(),o=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),i=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}function Sae(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Ly(e,...t){e&&t.length>0&&e.classList.add(...t)}function Fy(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Cae(e,t){let n=yl();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,s]=[r,o].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,f)=>f-u);return c}),a=i+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function Eae(e,t,n,r){let o=n?"enter":"leave",i=yl(),s=r!==void 0?Sae(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Qn(o,{enter:()=>t.enter,leave:()=>t.leave}),l=Qn(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Qn(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Fy(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Ly(e,...t.base,...a,...c),i.nextFrame(()=>{Fy(e,...t.base,...a,...c),Ly(e,...t.base,...a,...l),Cae(e,()=>(Fy(e,...t.base,...a),Ly(e,...t.base,...t.entered),s()))}),i.dispose}function Rae({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=D_(),a=Kf(),l=wi(n);Fn(()=>{e&&(l.current="enter")},[e]),Fn(()=>{let c=yl();a.add(c.dispose);let u=t.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),o.current(l.current),c.add(Eae(u,r.current,l.current==="enter",()=>{c.dispose(),i.current(l.current)})),c.dispose},[n])}function Ms(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Xm=m.createContext(null);Xm.displayName="TransitionContext";var Oae=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Oae||{});function Pae(){let e=m.useContext(Xm);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Tae(){let e=m.useContext(Qm);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Qm=m.createContext(null);Qm.displayName="NestingContext";function Jm(e){return"children"in e?Jm(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function fI(e,t){let n=wi(e),r=m.useRef([]),o=D_(),i=Kf(),s=Et((g,v=ta.Hidden)=>{let b=r.current.findIndex(({el:w})=>w===g);b!==-1&&(Qn(v,{[ta.Unmount](){r.current.splice(b,1)},[ta.Hidden](){r.current[b].state="hidden"}}),i.microTask(()=>{var w;!Jm(r)&&o.current&&((w=n.current)==null||w.call(n))}))}),a=Et(g=>{let v=r.current.find(({el:b})=>b===g);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:g,state:"visible"}),()=>s(g,ta.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),u=m.useRef({enter:[],leave:[],idle:[]}),f=Et((g,v,b)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([w])=>w!==g)),t==null||t.chains.current[v].push([g,new Promise(w=>{l.current.push(w)})]),t==null||t.chains.current[v].push([g,new Promise(w=>{Promise.all(u.current[v].map(([x,_])=>_)).then(()=>w())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(v)):b(v)}),h=Et((g,v,b)=>{Promise.all(u.current[v].splice(0).map(([w,x])=>x)).then(()=>{var w;(w=l.current.shift())==null||w()}).then(()=>b(v))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:h,wait:c,chains:u}),[a,s,r,f,h,u,c])}function Dae(){}let Aae=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function fT(e){var t;let n={};for(let r of Aae)n[r]=(t=e[r])!=null?t:Dae;return n}function $ae(e){let t=m.useRef(fT(e));return m.useEffect(()=>{t.current=fT(e)},[e]),t}let kae="div",hI=Wg.RenderStrategy;function Mae(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:f,leave:h,leaveFrom:g,leaveTo:v,...b}=e,w=m.useRef(null),x=Pl(w,t),_=(n=b.unmount)==null||n?ta.Unmount:ta.Hidden,{show:S,appear:C,initial:E}=Pae(),[P,A]=m.useState(S?"visible":"hidden"),k=Tae(),{register:I,unregister:$}=k;m.useEffect(()=>I(w),[I,w]),m.useEffect(()=>{if(_===ta.Hidden&&w.current){if(S&&P!=="visible"){A("visible");return}return Qn(P,{hidden:()=>$(w),visible:()=>I(w)})}},[P,w,I,$,S,_]);let L=wi({base:Ms(b.className),enter:Ms(l),enterFrom:Ms(c),enterTo:Ms(u),entered:Ms(f),leave:Ms(h),leaveFrom:Ms(g),leaveTo:Ms(v)}),j=$ae({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),Q=C_();m.useEffect(()=>{if(Q&&P==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,P,Q]);let ee=E&&!C,B=C&&S&&E,Z=!Q||ee?"idle":S?"enter":"leave",G=_ae(0),q=Et(ie=>Qn(ie,{enter:()=>{G.addFlag(ro.Opening),j.current.beforeEnter()},leave:()=>{G.addFlag(ro.Closing),j.current.beforeLeave()},idle:()=>{}})),K=Et(ie=>Qn(ie,{enter:()=>{G.removeFlag(ro.Opening),j.current.afterEnter()},leave:()=>{G.removeFlag(ro.Closing),j.current.afterLeave()},idle:()=>{}})),T=fI(()=>{A("hidden"),$(w)},k),V=m.useRef(!1);Rae({immediate:B,container:w,classes:L,direction:Z,onStart:wi(ie=>{V.current=!0,T.onStart(w,ie,q)}),onStop:wi(ie=>{V.current=!1,T.onStop(w,ie,K),ie==="leave"&&!Jm(T)&&(A("hidden"),$(w))})});let X=b,N={ref:x};return B?X={...X,className:Hg(b.className,...L.current.enter,...L.current.enterFrom)}:V.current&&(X.className=Hg(b.className,(r=w.current)==null?void 0:r.className),X.className===""&&delete X.className),m.createElement(Qm.Provider,{value:T},m.createElement(aI,{value:Qn(P,{visible:ro.Open,hidden:ro.Closed})|G.flags},fs({ourProps:N,theirProps:X,defaultTag:kae,features:hI,visible:P==="visible",name:"Transition.Child"})))}function Iae(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=Pl(s,t);C_();let l=O_();if(n===void 0&&l!==null&&(n=(l&ro.Open)===ro.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=m.useState(n?"visible":"hidden"),f=fI(()=>{u("hidden")}),[h,g]=m.useState(!0),v=m.useRef([n]);Fn(()=>{h!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),g(!1))},[v,n]);let b=m.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);m.useEffect(()=>{if(n)u("visible");else if(!Jm(f))u("hidden");else{let S=s.current;if(!S)return;let C=S.getBoundingClientRect();C.x===0&&C.y===0&&C.width===0&&C.height===0&&u("hidden")}},[n,f]);let w={unmount:o},x=Et(()=>{var S;h&&g(!1),(S=e.beforeEnter)==null||S.call(e)}),_=Et(()=>{var S;h&&g(!1),(S=e.beforeLeave)==null||S.call(e)});return m.createElement(Qm.Provider,{value:f},m.createElement(Xm.Provider,{value:b},fs({ourProps:{...w,as:m.Fragment,children:m.createElement(pI,{ref:a,...w,...i,beforeEnter:x,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:hI,visible:c==="visible",name:"Transition"})))}function Nae(e,t){let n=m.useContext(Xm)!==null,r=O_()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(Wx,{ref:t,...e}):m.createElement(pI,{ref:t,...e}))}let Wx=Di(Iae),pI=Di(Mae),Lae=Di(Nae),Fae=Object.assign(Wx,{Child:Lae,Root:Wx});function jae(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[o,i]=e.split(r);return{operation:r,value:i.trim()}}else return null}function zae(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,o=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return Pf.includes(e)?o:r}function Bae({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null),{authToken:l}=ma(),c=$e($=>$.filterValues),u=$e($=>$.selectedSheetId),f=$e($=>$.actions.addOrUpdateFilterValue),h=$e($=>$.actions.removeFilterValue),g=C(c),{data:v,isLoading:b,isFetching:w,isError:x,refetch:_}=Df({queryKey:["filter",e.id,e.sql,JSON.stringify(g)],queryFn:()=>Of("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:g}),enabled:!!e.sql&&!!e.connectionId}),S=m.useMemo(()=>{var $;return($=v==null?void 0:v.records)==null?void 0:$.map(L=>{let j=e.column.split(".").slice(-1)[0].replace(/"/g,"");return L[j]===void 0&&(j=j.toLowerCase()),{id:L[j],value:L[j]}})},[v,e.column]);m.useEffect(()=>{if(c){const $=c.find(L=>L.filterId===e.id);if(!$){n([]);return}if($.operation==="in"){const L=S==null?void 0:S.filter(j=>$.values.includes(j.value));L&&n(L)}else o(`${$.operation} ${$.values[0]}`)}},[v,u]),m.useEffect(()=>{if(c&&!c.find(L=>L.filterId===e.id)){n([]);return}},[c,e.id]);function C($){return $?$.filter(L=>{const Q=L.name.split(".");if(Q.slice(0,Q.length-1).join(".")===e.table&&L.name!==e.column)return!0}):[]}function E($){const L=jae($[0].toString());if(!(L!=null&&L.value)||!(L!=null&&L.operation))return;const j={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:hg(e),name:e.column,operation:L.operation,values:[Number(L.value)]};f(j)}function P($){if(Array.isArray($)||($=[$]),console.log("onComboBoxChange",$),$.length===1&&S.find(j=>j.value===$[0].value)===void 0){E($);return}if(n($),$.length===0){h(e.id);return}const L={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:hg(e),operation:e.operation,values:$.map(j=>j.value)};f(L)}function A(){var $;o(""),h(e.id),console.log(e.id),($=a.current)==null||$.click()}if(b)return O.jsx("div",{children:O.jsx(am,{className:"h-8 w-full bg-foreground/10"})});if(x)return O.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let k=[];Vc.includes(e.dataType)?k=S:k=i===""?S:S==null?void 0:S.filter($=>$.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,"")));const I=e.type==="single";return O.jsx("div",{className:"w-full",children:O.jsx(oc,{value:t,multiple:!I,onChange:P,children:O.jsxs("div",{className:"relative",children:[O.jsxs("div",{className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[O.jsx(oc.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:$=>$.map(j=>j.value).join(", ")||r,onChange:$=>{o($.target.value),s($.target.value)}}),O.jsx(oc.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:O.jsx(bX,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),O.jsx(Fae,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:O.jsxs(oc.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm",children:[Vc.includes(e.dataType)&&O.jsxs(oc.Option,{value:r,className:"flex items-center justify-between gap-2 px-3 py-2",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx("span",{className:"font-thin",children:"#"}),O.jsx("span",{children:r})]}),r&&O.jsx(xr,{variant:"link",className:"h-4 w-3 cursor-pointer text-foreground/50 hover:text-foreground/100",onClick:$=>{$.stopPropagation(),A()},children:"Clear"})]},"custom"),(k==null?void 0:k.length)===0&&i!==""?O.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):k==null?void 0:k.map($=>O.jsx(oc.Option,{className:({active:L})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${L?"bg-muted":"text-foreground-900"}`,value:$,children:({selected:L,active:j})=>O.jsxs("div",{className:"",children:[O.jsx("span",{className:`block ${L?"font-medium":"font-normal"}`,children:typeof $.value=="boolean"?$.value?"True":"False":$.value}),L?O.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:O.jsx(A$,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},$.value))]})})]})})})}const Vae=IR.WidthProvider(IR.Responsive);function Hae(){var P,A;const e=$e(k=>k.isDashboardEditing);$e(k=>k.currentBreakpoint);const t=$e(k=>k.themeStyle),n=$e(k=>k.selectedSheetId),r=(P=$e(k=>{var I,$;return($=(I=k.dashboard)==null?void 0:I.sheets)==null?void 0:$.filter(L=>L.id===n)}))==null?void 0:P[0].layouts,o=$e(k=>k.dashboard.filters),i=$e(k=>{var I,$,L;return(L=($=(I=k.dashboard)==null?void 0:I.sheets)==null?void 0:$.find(j=>j.id===n))==null?void 0:L.frames}),{getSelectedSheet:s,getSelectedSheetLayout:a,getSelectedSheetLayouts:l,setSheetLayout:c,setSheetLayouts:u,setCurrentBreakpoint:f,removeFilter:h,updateFilter:g,removeFilterValue:v}=$e(k=>k.actions),b=s(),w=m.useCallback(k=>{f(k)},[]),x=m.useCallback((k,I)=>{b!=null&&b.id&&u(b.id,I)},[b==null?void 0:b.id,u]);if(!n)return null;const _=(k,I)=>O.jsx(gI,{className:"after:content-none",ref:I,handleAxis:k}),S=k=>Pf.includes(k.dataType)?O.jsx(lse,{filter:k}):O.jsx(Bae,{filter:k});function C(){return o==null?void 0:o.map(k=>{var I,$,L,j;return O.jsxs("div",{style:{borderRadius:($=(I=t==null?void 0:t.chart)==null?void 0:I.options)==null?void 0:$.borderRadius,fontFamily:(j=(L=t==null?void 0:t.chart)==null?void 0:L.font)==null?void 0:j.family},className:Ce("z-50 flex w-full flex-col rounded-md border bg-background px-3 py-2"),children:[O.jsx(is,{className:"my-1",text:k.title||k.column,onSave:Q=>g({...k,title:Q}),children:O.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[O.jsxs("div",{className:"flex grow items-center gap-2",children:[O.jsx(Wn,{className:"inline-block text-sm",children:k.title}),e&&O.jsx(bre,{filter:k})]}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx("div",{onClick:()=>v(k.id),className:"invisible cursor-pointer text-xs text-muted-foreground hover:text-foreground hover:underline group-hover:visible",children:O.jsx(eQ,{className:"size-3.5"})}),e&&O.jsx(iQ,{onClick:()=>{v(k.id),h(k.id)},className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})]})]})}),S(k)]},k.id)})}function E(){return i==null?void 0:i.map(k=>O.jsx("div",{role:"dashboard-frame-container",className:Ce("group overflow-hidden",t==null?void 0:t.dashboardCardContainer),children:O.jsx(Zne,{frame:k})},k.id))}return O.jsx(O.Fragment,{children:O.jsxs(Vae,{margin:[10,10],isDraggable:e,resizeHandles:e?["sw","nw","ne","se","e","w"]:[],className:Ce((A=t==null?void 0:t.gridLayout)==null?void 0:A.className),layouts:r,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:w,onLayoutChange:x,resizeHandle:_,children:[C(),E()]})})}const gI=m.forwardRef(({className:e,handleAxis:t,...n},r)=>($e(o=>o.themeStyle),O.jsx("div",{ref:r,className:Ce(`react-resizable-handle z-10 react-resizable-handle-${t} absolute border-foreground/40`,{"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0":t==="nw","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne","border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw","border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0 group-hover:border-t-0":t==="e","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0 group-hover:border-t-0":t==="w"},e),...n})));gI.displayName="ResizeHandle";let Wae=(e,t=21)=>(n=t)=>{let r="",o=n;for(;o--;)r+=e[Math.random()*e.length|0];return r};var uu={exports:{}};const Uae=typeof Buffer<"u",hT=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,pT=/"(?: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 mI(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),Uae&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));const r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;const o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if(o==="ignore"&&i==="ignore")return r;if(o!=="ignore"&&i!=="ignore"){if(hT.test(e)===!1&&pT.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(hT.test(e)===!1)return r}else if(pT.test(e)===!1)return r;return vI(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function vI(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const i=o;o=[];for(const s of i){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(const a in s){const l=s[a];l&&typeof l=="object"&&o.push(l)}}}return e}function A_(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return mI(e,t,n)}finally{Error.stackTraceLimit=r}}function qae(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return mI(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}uu.exports=A_;uu.exports.default=A_;uu.exports.parse=A_;uu.exports.safeParse=qae;uu.exports.scan=vI;var Gae=uu.exports;const gT=nu(Gae);var bI=Wae("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);function Yae(e){const t=["ROOT"];let n=-1,r=null;function o(l,c,u){switch(l){case'"':{n=c,t.pop(),t.push(u),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,r=c,t.pop(),t.push(u),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(u),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(u),t.push("INSIDE_ARRAY_START");break}}}function i(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":o(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const f=e.substring(r,l+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l)):n=l;break}}}let a=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const u=e.substring(r,e.length);"true".startsWith(u)?a+="true".slice(u.length):"false".startsWith(u)?a+="false".slice(u.length):"null".startsWith(u)&&(a+="null".slice(u.length))}}return a}function Kae(e){if(e!=null)try{return gT.parse(e)}catch{try{const n=Yae(e);return gT.parse(n)}catch{}}}var Ud={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},qd={code:"1",name:"function_call",parse:e=>{if(e==null||typeof e!="object"||!("function_call"in e)||typeof e.function_call!="object"||e.function_call==null||!("name"in e.function_call)||!("arguments"in e.function_call)||typeof e.function_call.name!="string"||typeof e.function_call.arguments!="string")throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},Gd={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},Yd={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Kd={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}}},Xd={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}}}},Qd={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}}},Jd={code:"7",name:"tool_calls",parse:e=>{if(e==null||typeof e!="object"||!("tool_calls"in e)||typeof e.tool_calls!="object"||e.tool_calls==null||!Array.isArray(e.tool_calls)||e.tool_calls.some(t=>t==null||typeof t!="object"||!("id"in t)||typeof t.id!="string"||!("type"in t)||typeof t.type!="string"||!("function"in t)||t.function==null||typeof t.function!="object"||!("arguments"in t.function)||typeof t.function.name!="string"||typeof t.function.arguments!="string"))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},Zd={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}}},ef={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}}},tf={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}}},nf={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}}},rf={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}}},of={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string"||!("usage"in e)||e.usage==null||typeof e.usage!="object"||!("promptTokens"in e.usage)||!("completionTokens"in e.usage))throw new Error('"finish_message" parts expect an object with a "finishReason" and "usage" property.');return typeof e.usage.promptTokens!="number"&&(e.usage.promptTokens=Number.NaN),typeof e.usage.completionTokens!="number"&&(e.usage.completionTokens=Number.NaN),{type:"finish_message",value:e}}},Xae=[Ud,qd,Gd,Yd,Kd,Xd,Qd,Jd,Zd,ef,tf,nf,rf,of],Qae={[Ud.code]:Ud,[qd.code]:qd,[Gd.code]:Gd,[Yd.code]:Yd,[Kd.code]:Kd,[Xd.code]:Xd,[Qd.code]:Qd,[Jd.code]:Jd,[Zd.code]:Zd,[ef.code]:ef,[tf.code]:tf,[nf.code]:nf,[rf.code]:rf,[of.code]:of};Ud.name+"",Ud.code,qd.name+"",qd.code,Gd.name+"",Gd.code,Yd.name+"",Yd.code,Kd.name+"",Kd.code,Xd.name+"",Xd.code,Qd.name+"",Qd.code,Jd.name+"",Jd.code,Zd.name+"",Zd.code,ef.name+"",ef.code,tf.name+"",tf.code,nf.name+"",nf.code,rf.name+"",rf.code,of.name+"",of.code;var Jae=Xae.map(e=>e.code),yI=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(!Jae.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return Qae[r].parse(i)},Zae=10;function ele(e,t){const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function*tle(e,{isAborted:t}={}){const n=new TextDecoder,r=[];let o=0;for(;;){const{value:i}=await e.read();if(i&&(r.push(i),o+=i.length,i[i.length-1]!==Zae))continue;if(r.length===0)break;const s=ele(r,o);o=0;const a=n.decode(s,{stream:!0}).split(`
|
|
397
|
+
`));let h=u.props,g=typeof(h==null?void 0:h.className)=="function"?(...b)=>Hg(h==null?void 0:h.className(...b),l.className):Hg(h==null?void 0:h.className,l.className),v=g?{className:g}:{};return m.cloneElement(u,Object.assign({},iI(u.props,Hx(Iy(l,["ref"]))),f,c,{ref:o(u.ref,c.ref)},v))}return m.createElement(i,Object.assign({},Iy(l,["ref"]),i!==m.Fragment&&c,i!==m.Fragment&&f),u)}function Vse(...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 iI(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function Di(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Hx(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Iy(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Hse="div";var sI=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(sI||{});function Wse(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return fs({ourProps:i,theirProps:o,slot:{},defaultTag:Hse,name:"Hidden"})}let Use=Di(Wse),R_=m.createContext(null);R_.displayName="OpenClosedContext";var ro=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ro||{});function O_(){return m.useContext(R_)}function aI({value:e,children:t}){return m.createElement(R_.Provider,{value:e},t)}function qse(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Ha=[];qse(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Ha[0]!==t.target&&(Ha.unshift(t.target),Ha=Ha.filter(n=>n!=null&&n.isConnected),Ha.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 Gse(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&&Yse(n)?!1:r}function Yse(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function Kse(e){throw new Error("Unexpected object: "+e)}var Nn=(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))(Nn||{});function dT(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:Kse(e)}}function lI(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))uI(n,cI(t,r),o);return n}function cI(e,t){return e?e+"["+t+"]":t}function uI(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())uI(e,cI(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):lI(n,t,e)}var Jr=(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))(Jr||{}),Xse=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Xse||{}),Qse=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Qse||{}),Jse=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Jse||{}),Zse=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(Zse||{});function Ny(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):$se(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let eae={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,r,o,i,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((o=e.dataRef.current)!=null&&o.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let u=t.focus===Nn.Specific?t.idx:dT(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var h,g;return(g=(h=e.activeOptionIndex)!=null?h:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?g:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===u&&e.activationTrigger===f?e:{...e,activeOptionIndex:u,activationTrigger:f}}let a=Ny(e);if(a.activeOptionIndex===null){let u=a.options.findIndex(f=>!f.dataRef.current.disabled);u!==-1&&(a.activeOptionIndex=u)}let l=t.focus===Nn.Specific?t.idx:dT(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),c=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===c?e:{...e,...a,activeOptionIndex:l,activationTrigger:c}},3:(e,t)=>{var n,r,o;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,s=Ny(e,l=>(l.push(i),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let a={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(o=>o.id!==t.id)};let r=Ny(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?r=o:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},P_=m.createContext(null);P_.displayName="ComboboxActionsContext";function Qf(e){let t=m.useContext(P_);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Qf),n}return t}let dI=m.createContext(null);function tae(e){var t;let n=Tl("VirtualProvider"),[r,o]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[n.optionsRef.current]),i=xse({scrollPaddingStart:r,scrollPaddingEnd:o,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=m.useState(0);return Fn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(dI.Provider,{value:i},m.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&i.scrollToIndex(n.activeOptionIndex)}}},i.getVirtualItems().map(l=>{var c;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((c=e.children)==null?void 0:c.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":n.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let T_=m.createContext(null);T_.displayName="ComboboxDataContext";function Tl(e){let t=m.useContext(T_);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Tl),n}return t}function nae(e,t){return Qn(t.type,eae,e,t)}let rae=m.Fragment;function oae(e,t){let{value:n,defaultValue:r,onChange:o,form:i,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:f=!1,immediate:h=!1,virtual:g=null,...v}=e,b=!1,w=null,[x=f?[]:void 0,_]=Cse(n,o,r),[S,C]=m.useReducer(nae,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),E=m.useRef(!1),P=m.useRef({static:!1,hold:!1}),A=m.useRef(null),k=m.useRef(null),I=m.useRef(null),$=m.useRef(null),L=Et(typeof a=="string"?(ne,le)=>{let ye=a;return(ne==null?void 0:ne[ye])===(le==null?void 0:le[ye])}:a??((ne,le)=>ne===le)),j=Et(ne=>S.options.findIndex(le=>L(le.dataRef.current.value,ne))),Q=m.useCallback(ne=>Qn(B.mode,{1:()=>x.some(le=>L(le,ne)),0:()=>L(x,ne)}),[x]),ee=Et(ne=>S.activeOptionIndex===j(ne)),B=m.useMemo(()=>({...S,immediate:b,optionsPropsRef:P,labelRef:A,inputRef:k,buttonRef:I,optionsRef:$,value:x,defaultValue:r,disabled:l,mode:f?1:0,virtual:S.virtual,get activeOptionIndex(){if(E.current&&S.activeOptionIndex===null&&S.options.length>0){let ne=S.options.findIndex(le=>!le.dataRef.current.disabled);if(ne!==-1)return ne}return S.activeOptionIndex},calculateIndex:j,compare:L,isSelected:Q,isActive:ee,nullable:u,__demoMode:c}),[x,r,l,f,u,c,S,w]);Fn(()=>{},[w,void 0]),Fn(()=>{S.dataRef.current=B},[B]),Nse([B.buttonRef,B.inputRef,B.optionsRef],()=>fe.closeCombobox(),B.comboboxState===0);let Z=m.useMemo(()=>{var ne,le,ye;return{open:B.comboboxState===0,disabled:l,activeIndex:B.activeOptionIndex,activeOption:B.activeOptionIndex===null?null:B.virtual?B.virtual.options[(ne=B.activeOptionIndex)!=null?ne:0]:(ye=(le=B.options[B.activeOptionIndex])==null?void 0:le.dataRef.current.value)!=null?ye:null,value:x}},[B,l,x]),G=Et(()=>{if(B.activeOptionIndex!==null){if(B.virtual)N(B.virtual.options[B.activeOptionIndex]);else{let{dataRef:ne}=B.options[B.activeOptionIndex];N(ne.current.value)}fe.goToOption(Nn.Specific,B.activeOptionIndex)}}),q=Et(()=>{C({type:0}),E.current=!0}),K=Et(()=>{C({type:1}),E.current=!1}),T=Et((ne,le,ye)=>(E.current=!1,ne===Nn.Specific?C({type:2,focus:Nn.Specific,idx:le,trigger:ye}):C({type:2,focus:ne,trigger:ye}))),V=Et((ne,le)=>(C({type:3,payload:{id:ne,dataRef:le}}),()=>{B.isActive(le.current.value)&&(E.current=!0),C({type:4,id:ne})})),X=Et(ne=>(C({type:5,id:ne}),()=>C({type:5,id:null}))),N=Et(ne=>Qn(B.mode,{0(){return _==null?void 0:_(ne)},1(){let le=B.value.slice(),ye=le.findIndex(Y=>L(Y,ne));return ye===-1?le.push(ne):le.splice(ye,1),_==null?void 0:_(le)}})),ie=Et(ne=>{C({type:6,trigger:ne})}),fe=m.useMemo(()=>({onChange:N,registerOption:V,registerLabel:X,goToOption:T,closeCombobox:K,openCombobox:q,setActivationTrigger:ie,selectActiveOption:G}),[]),ue=t===null?{}:{ref:t},pe=m.useRef(null),se=Kf();return m.useEffect(()=>{pe.current&&r!==void 0&&se.addEventListener(pe.current,"reset",()=>{_==null||_(r)})},[pe,_]),m.createElement(P_.Provider,{value:fe},m.createElement(T_.Provider,{value:B},m.createElement(aI,{value:Qn(B.comboboxState,{0:ro.Open,1:ro.Closed})},s!=null&&x!=null&&lI({[s]:x}).map(([ne,le],ye)=>m.createElement(Use,{features:sI.Hidden,ref:ye===0?Y=>{var be;pe.current=(be=Y==null?void 0:Y.closest("form"))!=null?be:null}:void 0,...Hx({key:ne,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:ne,value:le})})),fs({ourProps:ue,theirProps:v,slot:Z,defaultTag:rae,name:"Combobox"}))))}let iae="input";function sae(e,t){var n,r,o,i,s;let a=Xf(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:u,type:f="text",...h}=e,g=Tl("Combobox.Input"),v=Qf("Combobox.Input"),b=Pl(g.inputRef,t),w=Lse(g.inputRef),x=m.useRef(!1),_=Kf(),S=Et(()=>{v.onChange(null),g.optionsRef.current&&(g.optionsRef.current.scrollTop=0),v.goToOption(Nn.Nothing)}),C=function(){var B;return typeof u=="function"&&g.value!==void 0?(B=u(g.value))!=null?B:"":typeof g.value=="string"?g.value:""}();uT(([B,Z],[G,q])=>{if(x.current)return;let K=g.inputRef.current;K&&((q===0&&Z===1||B!==G)&&(K.value=B),requestAnimationFrame(()=>{if(x.current||!K||(w==null?void 0:w.activeElement)!==K)return;let{selectionStart:T,selectionEnd:V}=K;Math.abs((V??0)-(T??0))===0&&T===0&&K.setSelectionRange(K.value.length,K.value.length)}))},[C,g.comboboxState,w]),uT(([B],[Z])=>{if(B===0&&Z===1){if(x.current)return;let G=g.inputRef.current;if(!G)return;let q=G.value,{selectionStart:K,selectionEnd:T,selectionDirection:V}=G;G.value="",G.value=q,V!==null?G.setSelectionRange(K,T,V):G.setSelectionRange(K,T)}},[g.comboboxState]);let E=m.useRef(!1),P=Et(()=>{E.current=!0}),A=Et(()=>{_.nextFrame(()=>{E.current=!1})}),k=Et(B=>{switch(x.current=!0,B.key){case Jr.Enter:if(x.current=!1,g.comboboxState!==0||E.current)return;if(B.preventDefault(),B.stopPropagation(),g.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),g.mode===0&&v.closeCombobox();break;case Jr.ArrowDown:return x.current=!1,B.preventDefault(),B.stopPropagation(),Qn(g.comboboxState,{0:()=>v.goToOption(Nn.Next),1:()=>v.openCombobox()});case Jr.ArrowUp:return x.current=!1,B.preventDefault(),B.stopPropagation(),Qn(g.comboboxState,{0:()=>v.goToOption(Nn.Previous),1:()=>{v.openCombobox(),_.nextFrame(()=>{g.value||v.goToOption(Nn.Last)})}});case Jr.Home:if(B.shiftKey)break;return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.First);case Jr.PageUp:return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.First);case Jr.End:if(B.shiftKey)break;return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.Last);case Jr.PageDown:return x.current=!1,B.preventDefault(),B.stopPropagation(),v.goToOption(Nn.Last);case Jr.Escape:return x.current=!1,g.comboboxState!==0?void 0:(B.preventDefault(),g.optionsRef.current&&!g.optionsPropsRef.current.static&&B.stopPropagation(),g.nullable&&g.mode===0&&g.value===null&&S(),v.closeCombobox());case Jr.Tab:if(x.current=!1,g.comboboxState!==0)return;g.mode===0&&g.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),I=Et(B=>{c==null||c(B),g.nullable&&g.mode===0&&B.target.value===""&&S(),v.openCombobox()}),$=Et(B=>{var Z,G,q;let K=(Z=B.relatedTarget)!=null?Z:Ha.find(T=>T!==B.currentTarget);if(x.current=!1,!((G=g.optionsRef.current)!=null&&G.contains(K))&&!((q=g.buttonRef.current)!=null&&q.contains(K))&&g.comboboxState===0)return B.preventDefault(),g.mode===0&&(g.nullable&&g.value===null?S():g.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),L=Et(B=>{var Z,G,q;let K=(Z=B.relatedTarget)!=null?Z:Ha.find(T=>T!==B.currentTarget);(G=g.buttonRef.current)!=null&&G.contains(K)||(q=g.optionsRef.current)!=null&&q.contains(K)||g.disabled||g.immediate&&g.comboboxState!==0&&(v.openCombobox(),_.nextFrame(()=>{v.setActivationTrigger(1)}))}),j=S_(()=>{if(g.labelId)return[g.labelId].join(" ")},[g.labelId]),Q=m.useMemo(()=>({open:g.comboboxState===0,disabled:g.disabled}),[g]),ee={ref:b,id:l,role:"combobox",type:f,"aria-controls":(n=g.optionsRef.current)==null?void 0:n.id,"aria-expanded":g.comboboxState===0,"aria-activedescendant":g.activeOptionIndex===null?void 0:g.virtual?(r=g.options.find(B=>{var Z;return!((Z=g.virtual)!=null&&Z.disabled(B.dataRef.current.value))&&g.compare(B.dataRef.current.value,g.virtual.options[g.activeOptionIndex])}))==null?void 0:r.id:(o=g.options[g.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":j,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:g.defaultValue!==void 0?u==null?void 0:u(g.defaultValue):null)!=null?s:g.defaultValue,disabled:g.disabled,onCompositionStart:P,onCompositionEnd:A,onKeyDown:k,onChange:I,onFocus:L,onBlur:$};return fs({ourProps:ee,theirProps:h,slot:Q,defaultTag:iae,name:"Combobox.Input"})}let aae="button";function lae(e,t){var n;let r=Tl("Combobox.Button"),o=Qf("Combobox.Button"),i=Pl(r.buttonRef,t),s=Xf(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=Kf(),u=Et(b=>{switch(b.key){case Jr.ArrowDown:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&o.openCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case Jr.ArrowUp:return b.preventDefault(),b.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),c.nextFrame(()=>{r.value||o.goToOption(Nn.Last)})),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})});case Jr.Escape:return r.comboboxState!==0?void 0:(b.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&b.stopPropagation(),o.closeCombobox(),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})}));default:return}}),f=Et(b=>{if(Gse(b.currentTarget))return b.preventDefault();r.comboboxState===0?o.closeCombobox():(b.preventDefault(),o.openCombobox()),c.nextFrame(()=>{var w;return(w=r.inputRef.current)==null?void 0:w.focus({preventScroll:!0})})}),h=S_(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),g=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:i,id:a,type:Fse(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsRef.current)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":h,disabled:r.disabled,onClick:f,onKeyDown:u};return fs({ourProps:v,theirProps:l,slot:g,defaultTag:aae,name:"Combobox.Button"})}let cae="label";function uae(e,t){let n=Xf(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=Tl("Combobox.Label"),s=Qf("Combobox.Label"),a=Pl(i.labelRef,t);Fn(()=>s.registerLabel(r),[r]);let l=Et(()=>{var u;return(u=i.inputRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return fs({ourProps:{ref:a,id:r,onClick:l},theirProps:o,slot:c,defaultTag:cae,name:"Combobox.Label"})}let dae="ul",fae=Wg.RenderStrategy|Wg.Static;function hae(e,t){let n=Xf(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=Tl("Combobox.Options"),a=Pl(s.optionsRef,t),l=O_(),c=l!==null?(l&ro.Open)===ro.Open:s.comboboxState===0;Fn(()=>{var g;s.optionsPropsRef.current.static=(g=e.static)!=null?g:!1},[s.optionsPropsRef,e.static]),Fn(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),Bse({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(g){return g.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:g.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(g){g.setAttribute("role","none")}});let u=S_(()=>{var g,v;return(v=s.labelId)!=null?v:(g=s.buttonRef.current)==null?void 0:g.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),h={"aria-labelledby":u,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(i,{children:m.createElement(tae,null,i.children)}),fs({ourProps:h,theirProps:i,slot:f,defaultTag:dae,features:fae,visible:c,name:"Combobox.Options"})}let pae="li";function gae(e,t){var n;let r=Xf(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,c=Tl("Combobox.Option"),u=Qf("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===o,h=c.isSelected(s),g=m.useRef(null),v=wi({disabled:i,value:s,domRef:g,order:a}),b=m.useContext(dI),w=Pl(t,g,b?b.measureElement:null),x=Et(()=>u.onChange(s));Fn(()=>u.registerOption(o,v),[v,o]);let _=m.useRef(!(c.virtual||c.__demoMode));Fn(()=>{if(!c.virtual||!c.__demoMode)return;let $=yl();return $.requestAnimationFrame(()=>{_.current=!0}),$.dispose},[c.virtual,c.__demoMode]),Fn(()=>{if(!_.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let $=yl();return $.requestAnimationFrame(()=>{var L,j;(j=(L=g.current)==null?void 0:L.scrollIntoView)==null||j.call(L,{block:"nearest"})}),$.dispose},[g,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let S=Et($=>{var L;if(i||(L=c.virtual)!=null&&L.disabled(s))return $.preventDefault();x(),oI()||requestAnimationFrame(()=>{var j;return(j=c.inputRef.current)==null?void 0:j.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),C=Et(()=>{var $;if(i||($=c.virtual)!=null&&$.disabled(s))return u.goToOption(Nn.Nothing);let L=c.calculateIndex(s);u.goToOption(Nn.Specific,L)}),E=zse(),P=Et($=>E.update($)),A=Et($=>{var L;if(!E.wasMoved($)||i||(L=c.virtual)!=null&&L.disabled(s)||f)return;let j=c.calculateIndex(s);u.goToOption(Nn.Specific,j,0)}),k=Et($=>{var L;E.wasMoved($)&&(i||(L=c.virtual)!=null&&L.disabled(s)||f&&(c.optionsPropsRef.current.hold||u.goToOption(Nn.Nothing)))}),I=m.useMemo(()=>({active:f,selected:h,disabled:i}),[f,h,i]);return fs({ourProps:{id:o,ref:w,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:S,onFocus:C,onPointerEnter:P,onMouseEnter:P,onPointerMove:A,onMouseMove:A,onPointerLeave:k,onMouseLeave:k},theirProps:l,slot:I,defaultTag:pae,name:"Combobox.Option"})}let mae=Di(oae),vae=Di(lae),bae=Di(sae),yae=Di(uae),xae=Di(hae),wae=Di(gae),oc=Object.assign(mae,{Input:bae,Button:vae,Label:yae,Options:xae,Option:wae});function D_(){let e=m.useRef(!1);return Fn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function _ae(e=0){let[t,n]=m.useState(e),r=D_(),o=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),i=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}function Sae(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Ly(e,...t){e&&t.length>0&&e.classList.add(...t)}function Fy(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Cae(e,t){let n=yl();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,s]=[r,o].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,f)=>f-u);return c}),a=i+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function Eae(e,t,n,r){let o=n?"enter":"leave",i=yl(),s=r!==void 0?Sae(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Qn(o,{enter:()=>t.enter,leave:()=>t.leave}),l=Qn(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Qn(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Fy(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Ly(e,...t.base,...a,...c),i.nextFrame(()=>{Fy(e,...t.base,...a,...c),Ly(e,...t.base,...a,...l),Cae(e,()=>(Fy(e,...t.base,...a),Ly(e,...t.base,...t.entered),s()))}),i.dispose}function Rae({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=D_(),a=Kf(),l=wi(n);Fn(()=>{e&&(l.current="enter")},[e]),Fn(()=>{let c=yl();a.add(c.dispose);let u=t.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),o.current(l.current),c.add(Eae(u,r.current,l.current==="enter",()=>{c.dispose(),i.current(l.current)})),c.dispose},[n])}function Ms(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Xm=m.createContext(null);Xm.displayName="TransitionContext";var Oae=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Oae||{});function Pae(){let e=m.useContext(Xm);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Tae(){let e=m.useContext(Qm);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Qm=m.createContext(null);Qm.displayName="NestingContext";function Jm(e){return"children"in e?Jm(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function fI(e,t){let n=wi(e),r=m.useRef([]),o=D_(),i=Kf(),s=Et((g,v=ta.Hidden)=>{let b=r.current.findIndex(({el:w})=>w===g);b!==-1&&(Qn(v,{[ta.Unmount](){r.current.splice(b,1)},[ta.Hidden](){r.current[b].state="hidden"}}),i.microTask(()=>{var w;!Jm(r)&&o.current&&((w=n.current)==null||w.call(n))}))}),a=Et(g=>{let v=r.current.find(({el:b})=>b===g);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:g,state:"visible"}),()=>s(g,ta.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),u=m.useRef({enter:[],leave:[],idle:[]}),f=Et((g,v,b)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([w])=>w!==g)),t==null||t.chains.current[v].push([g,new Promise(w=>{l.current.push(w)})]),t==null||t.chains.current[v].push([g,new Promise(w=>{Promise.all(u.current[v].map(([x,_])=>_)).then(()=>w())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(v)):b(v)}),h=Et((g,v,b)=>{Promise.all(u.current[v].splice(0).map(([w,x])=>x)).then(()=>{var w;(w=l.current.shift())==null||w()}).then(()=>b(v))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:h,wait:c,chains:u}),[a,s,r,f,h,u,c])}function Dae(){}let Aae=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function fT(e){var t;let n={};for(let r of Aae)n[r]=(t=e[r])!=null?t:Dae;return n}function $ae(e){let t=m.useRef(fT(e));return m.useEffect(()=>{t.current=fT(e)},[e]),t}let kae="div",hI=Wg.RenderStrategy;function Mae(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:f,leave:h,leaveFrom:g,leaveTo:v,...b}=e,w=m.useRef(null),x=Pl(w,t),_=(n=b.unmount)==null||n?ta.Unmount:ta.Hidden,{show:S,appear:C,initial:E}=Pae(),[P,A]=m.useState(S?"visible":"hidden"),k=Tae(),{register:I,unregister:$}=k;m.useEffect(()=>I(w),[I,w]),m.useEffect(()=>{if(_===ta.Hidden&&w.current){if(S&&P!=="visible"){A("visible");return}return Qn(P,{hidden:()=>$(w),visible:()=>I(w)})}},[P,w,I,$,S,_]);let L=wi({base:Ms(b.className),enter:Ms(l),enterFrom:Ms(c),enterTo:Ms(u),entered:Ms(f),leave:Ms(h),leaveFrom:Ms(g),leaveTo:Ms(v)}),j=$ae({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),Q=C_();m.useEffect(()=>{if(Q&&P==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,P,Q]);let ee=E&&!C,B=C&&S&&E,Z=!Q||ee?"idle":S?"enter":"leave",G=_ae(0),q=Et(ie=>Qn(ie,{enter:()=>{G.addFlag(ro.Opening),j.current.beforeEnter()},leave:()=>{G.addFlag(ro.Closing),j.current.beforeLeave()},idle:()=>{}})),K=Et(ie=>Qn(ie,{enter:()=>{G.removeFlag(ro.Opening),j.current.afterEnter()},leave:()=>{G.removeFlag(ro.Closing),j.current.afterLeave()},idle:()=>{}})),T=fI(()=>{A("hidden"),$(w)},k),V=m.useRef(!1);Rae({immediate:B,container:w,classes:L,direction:Z,onStart:wi(ie=>{V.current=!0,T.onStart(w,ie,q)}),onStop:wi(ie=>{V.current=!1,T.onStop(w,ie,K),ie==="leave"&&!Jm(T)&&(A("hidden"),$(w))})});let X=b,N={ref:x};return B?X={...X,className:Hg(b.className,...L.current.enter,...L.current.enterFrom)}:V.current&&(X.className=Hg(b.className,(r=w.current)==null?void 0:r.className),X.className===""&&delete X.className),m.createElement(Qm.Provider,{value:T},m.createElement(aI,{value:Qn(P,{visible:ro.Open,hidden:ro.Closed})|G.flags},fs({ourProps:N,theirProps:X,defaultTag:kae,features:hI,visible:P==="visible",name:"Transition.Child"})))}function Iae(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=Pl(s,t);C_();let l=O_();if(n===void 0&&l!==null&&(n=(l&ro.Open)===ro.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=m.useState(n?"visible":"hidden"),f=fI(()=>{u("hidden")}),[h,g]=m.useState(!0),v=m.useRef([n]);Fn(()=>{h!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),g(!1))},[v,n]);let b=m.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);m.useEffect(()=>{if(n)u("visible");else if(!Jm(f))u("hidden");else{let S=s.current;if(!S)return;let C=S.getBoundingClientRect();C.x===0&&C.y===0&&C.width===0&&C.height===0&&u("hidden")}},[n,f]);let w={unmount:o},x=Et(()=>{var S;h&&g(!1),(S=e.beforeEnter)==null||S.call(e)}),_=Et(()=>{var S;h&&g(!1),(S=e.beforeLeave)==null||S.call(e)});return m.createElement(Qm.Provider,{value:f},m.createElement(Xm.Provider,{value:b},fs({ourProps:{...w,as:m.Fragment,children:m.createElement(pI,{ref:a,...w,...i,beforeEnter:x,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:hI,visible:c==="visible",name:"Transition"})))}function Nae(e,t){let n=m.useContext(Xm)!==null,r=O_()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(Wx,{ref:t,...e}):m.createElement(pI,{ref:t,...e}))}let Wx=Di(Iae),pI=Di(Mae),Lae=Di(Nae),Fae=Object.assign(Wx,{Child:Lae,Root:Wx});function jae(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[o,i]=e.split(r);return{operation:r,value:i.trim()}}else return null}function zae(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,o=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return Pf.includes(e)?o:r}function Bae({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null),{authToken:l}=ma(),c=ke($=>$.filterValues),u=ke($=>$.selectedSheetId),f=ke($=>$.actions.addOrUpdateFilterValue),h=ke($=>$.actions.removeFilterValue),g=C(c),{data:v,isLoading:b,isFetching:w,isError:x,refetch:_}=Df({queryKey:["filter",e.id,e.sql,JSON.stringify(g)],queryFn:()=>Of("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:g}),enabled:!!e.sql&&!!e.connectionId}),S=m.useMemo(()=>{var $;return($=v==null?void 0:v.records)==null?void 0:$.map(L=>{let j=e.column.split(".").slice(-1)[0].replace(/"/g,"");return L[j]===void 0&&(j=j.toLowerCase()),{id:L[j],value:L[j]}})},[v,e.column]);m.useEffect(()=>{if(c){const $=c.find(L=>L.filterId===e.id);if(!$){n([]);return}if($.operation==="in"){const L=S==null?void 0:S.filter(j=>$.values.includes(j.value));L&&n(L)}else o(`${$.operation} ${$.values[0]}`)}},[v,u]),m.useEffect(()=>{if(c&&!c.find(L=>L.filterId===e.id)){n([]);return}},[c,e.id]);function C($){return $?$.filter(L=>{const Q=L.name.split(".");if(Q.slice(0,Q.length-1).join(".")===e.table&&L.name!==e.column)return!0}):[]}function E($){const L=jae($[0].toString());if(!(L!=null&&L.value)||!(L!=null&&L.operation))return;const j={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:hg(e),name:e.column,operation:L.operation,values:[Number(L.value)]};f(j)}function P($){if(Array.isArray($)||($=[$]),console.log("onComboBoxChange",$),$.length===1&&S.find(j=>j.value===$[0].value)===void 0){E($);return}if(n($),$.length===0){h(e.id);return}const L={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:hg(e),operation:e.operation,values:$.map(j=>j.value)};f(L)}function A(){var $;o(""),h(e.id),console.log(e.id),($=a.current)==null||$.click()}if(b)return O.jsx("div",{children:O.jsx(am,{className:"h-8 w-full bg-foreground/10"})});if(x)return O.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let k=[];Vc.includes(e.dataType)?k=S:k=i===""?S:S==null?void 0:S.filter($=>$.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,"")));const I=e.type==="single";return O.jsx("div",{className:"w-full",children:O.jsx(oc,{value:t,multiple:!I,onChange:P,children:O.jsxs("div",{className:"relative",children:[O.jsxs("div",{className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[O.jsx(oc.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:$=>$.map(j=>j.value).join(", ")||r,onChange:$=>{o($.target.value),s($.target.value)}}),O.jsx(oc.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:O.jsx(bX,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),O.jsx(Fae,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:O.jsxs(oc.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm",children:[Vc.includes(e.dataType)&&O.jsxs(oc.Option,{value:r,className:"flex items-center justify-between gap-2 px-3 py-2",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx("span",{className:"font-thin",children:"#"}),O.jsx("span",{children:r})]}),r&&O.jsx(xr,{variant:"link",className:"h-4 w-3 cursor-pointer text-foreground/50 hover:text-foreground/100",onClick:$=>{$.stopPropagation(),A()},children:"Clear"})]},"custom"),(k==null?void 0:k.length)===0&&i!==""?O.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):k==null?void 0:k.map($=>O.jsx(oc.Option,{className:({active:L})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${L?"bg-muted":"text-foreground-900"}`,value:$,children:({selected:L,active:j})=>O.jsxs("div",{className:"",children:[O.jsx("span",{className:`block ${L?"font-medium":"font-normal"}`,children:typeof $.value=="boolean"?$.value?"True":"False":$.value}),L?O.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:O.jsx(A$,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},$.value))]})})]})})})}const Vae=IR.WidthProvider(IR.Responsive);function Hae(){var P,A;const e=ke(k=>k.isDashboardEditing);ke(k=>k.currentBreakpoint);const t=ke(k=>k.themeStyle),n=ke(k=>k.selectedSheetId),r=(P=ke(k=>{var I,$;return($=(I=k.dashboard)==null?void 0:I.sheets)==null?void 0:$.filter(L=>L.id===n)}))==null?void 0:P[0].layouts,o=ke(k=>k.dashboard.filters),i=ke(k=>{var I,$,L;return(L=($=(I=k.dashboard)==null?void 0:I.sheets)==null?void 0:$.find(j=>j.id===n))==null?void 0:L.frames}),{getSelectedSheet:s,getSelectedSheetLayout:a,getSelectedSheetLayouts:l,setSheetLayout:c,setSheetLayouts:u,setCurrentBreakpoint:f,removeFilter:h,updateFilter:g,removeFilterValue:v}=ke(k=>k.actions),b=s(),w=m.useCallback(k=>{f(k)},[]),x=m.useCallback((k,I)=>{b!=null&&b.id&&u(b.id,I)},[b==null?void 0:b.id,u]);if(!n)return null;const _=(k,I)=>O.jsx(gI,{className:"after:content-none",ref:I,handleAxis:k}),S=k=>Pf.includes(k.dataType)?O.jsx(lse,{filter:k}):O.jsx(Bae,{filter:k});function C(){return o==null?void 0:o.map(k=>{var I,$,L,j;return O.jsxs("div",{style:{borderRadius:($=(I=t==null?void 0:t.chart)==null?void 0:I.options)==null?void 0:$.borderRadius,fontFamily:(j=(L=t==null?void 0:t.chart)==null?void 0:L.font)==null?void 0:j.family},className:Ce("z-50 flex w-full flex-col rounded-md border bg-background px-3 py-2"),children:[O.jsx(is,{className:"my-1",text:k.title||k.column,onSave:Q=>g({...k,title:Q}),children:O.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[O.jsxs("div",{className:"flex grow items-center gap-2",children:[O.jsx(Wn,{className:"inline-block text-sm",children:k.title}),e&&O.jsx(bre,{filter:k})]}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx("div",{onClick:()=>v(k.id),className:"invisible cursor-pointer text-xs text-muted-foreground hover:text-foreground hover:underline group-hover:visible",children:O.jsx(eQ,{className:"size-3.5"})}),e&&O.jsx(iQ,{onClick:()=>{v(k.id),h(k.id)},className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})]})]})}),S(k)]},k.id)})}function E(){return i==null?void 0:i.map(k=>O.jsx("div",{role:"dashboard-frame-container",className:Ce("group overflow-hidden",t==null?void 0:t.dashboardCardContainer),children:O.jsx(Zne,{frame:k})},k.id))}return O.jsx(O.Fragment,{children:O.jsxs(Vae,{margin:[10,10],isDraggable:e,resizeHandles:e?["sw","nw","ne","se","e","w"]:[],className:Ce((A=t==null?void 0:t.gridLayout)==null?void 0:A.className),layouts:r,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:w,onLayoutChange:x,resizeHandle:_,children:[C(),E()]})})}const gI=m.forwardRef(({className:e,handleAxis:t,...n},r)=>(ke(o=>o.themeStyle),O.jsx("div",{ref:r,className:Ce(`react-resizable-handle z-10 react-resizable-handle-${t} absolute border-foreground/40`,{"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0":t==="nw","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne","border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw","border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0 group-hover:border-t-0":t==="e","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0 group-hover:border-t-0":t==="w"},e),...n})));gI.displayName="ResizeHandle";let Wae=(e,t=21)=>(n=t)=>{let r="",o=n;for(;o--;)r+=e[Math.random()*e.length|0];return r};var uu={exports:{}};const Uae=typeof Buffer<"u",hT=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,pT=/"(?: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 mI(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),Uae&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));const r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;const o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if(o==="ignore"&&i==="ignore")return r;if(o!=="ignore"&&i!=="ignore"){if(hT.test(e)===!1&&pT.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(hT.test(e)===!1)return r}else if(pT.test(e)===!1)return r;return vI(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function vI(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const i=o;o=[];for(const s of i){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(const a in s){const l=s[a];l&&typeof l=="object"&&o.push(l)}}}return e}function A_(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return mI(e,t,n)}finally{Error.stackTraceLimit=r}}function qae(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return mI(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}uu.exports=A_;uu.exports.default=A_;uu.exports.parse=A_;uu.exports.safeParse=qae;uu.exports.scan=vI;var Gae=uu.exports;const gT=nu(Gae);var bI=Wae("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);function Yae(e){const t=["ROOT"];let n=-1,r=null;function o(l,c,u){switch(l){case'"':{n=c,t.pop(),t.push(u),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,r=c,t.pop(),t.push(u),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(u),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(u),t.push("INSIDE_ARRAY_START");break}}}function i(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":o(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const f=e.substring(r,l+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l)):n=l;break}}}let a=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const u=e.substring(r,e.length);"true".startsWith(u)?a+="true".slice(u.length):"false".startsWith(u)?a+="false".slice(u.length):"null".startsWith(u)&&(a+="null".slice(u.length))}}return a}function Kae(e){if(e!=null)try{return gT.parse(e)}catch{try{const n=Yae(e);return gT.parse(n)}catch{}}}var Ud={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},qd={code:"1",name:"function_call",parse:e=>{if(e==null||typeof e!="object"||!("function_call"in e)||typeof e.function_call!="object"||e.function_call==null||!("name"in e.function_call)||!("arguments"in e.function_call)||typeof e.function_call.name!="string"||typeof e.function_call.arguments!="string")throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},Gd={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},Yd={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Kd={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}}},Xd={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}}}},Qd={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}}},Jd={code:"7",name:"tool_calls",parse:e=>{if(e==null||typeof e!="object"||!("tool_calls"in e)||typeof e.tool_calls!="object"||e.tool_calls==null||!Array.isArray(e.tool_calls)||e.tool_calls.some(t=>t==null||typeof t!="object"||!("id"in t)||typeof t.id!="string"||!("type"in t)||typeof t.type!="string"||!("function"in t)||t.function==null||typeof t.function!="object"||!("arguments"in t.function)||typeof t.function.name!="string"||typeof t.function.arguments!="string"))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},Zd={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}}},ef={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}}},tf={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}}},nf={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}}},rf={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}}},of={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string"||!("usage"in e)||e.usage==null||typeof e.usage!="object"||!("promptTokens"in e.usage)||!("completionTokens"in e.usage))throw new Error('"finish_message" parts expect an object with a "finishReason" and "usage" property.');return typeof e.usage.promptTokens!="number"&&(e.usage.promptTokens=Number.NaN),typeof e.usage.completionTokens!="number"&&(e.usage.completionTokens=Number.NaN),{type:"finish_message",value:e}}},Xae=[Ud,qd,Gd,Yd,Kd,Xd,Qd,Jd,Zd,ef,tf,nf,rf,of],Qae={[Ud.code]:Ud,[qd.code]:qd,[Gd.code]:Gd,[Yd.code]:Yd,[Kd.code]:Kd,[Xd.code]:Xd,[Qd.code]:Qd,[Jd.code]:Jd,[Zd.code]:Zd,[ef.code]:ef,[tf.code]:tf,[nf.code]:nf,[rf.code]:rf,[of.code]:of};Ud.name+"",Ud.code,qd.name+"",qd.code,Gd.name+"",Gd.code,Yd.name+"",Yd.code,Kd.name+"",Kd.code,Xd.name+"",Xd.code,Qd.name+"",Qd.code,Jd.name+"",Jd.code,Zd.name+"",Zd.code,ef.name+"",ef.code,tf.name+"",tf.code,nf.name+"",nf.code,rf.name+"",rf.code,of.name+"",of.code;var Jae=Xae.map(e=>e.code),yI=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(!Jae.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return Qae[r].parse(i)},Zae=10;function ele(e,t){const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function*tle(e,{isAborted:t}={}){const n=new TextDecoder,r=[];let o=0;for(;;){const{value:i}=await e.read();if(i&&(r.push(i),o+=i.length,i[i.length-1]!==Zae))continue;if(r.length===0)break;const s=ele(r,o);o=0;const a=n.decode(s,{stream:!0}).split(`
|
|
398
398
|
`).filter(l=>l!=="").map(yI);for(const l of a)yield l;if(t!=null&&t()){e.cancel();break}}}function $p(e,t){return!e||!t||!t.length?e:{...e,annotations:[...t]}}async function nle({reader:e,abortControllerRef:t,update:n,onToolCall:r,onFinish:o,generateId:i=bI,getCurrentDate:s=()=>new Date}){var a;const l=s(),c={data:[]};let u;const f={};let h={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},g="unknown";for await(const{type:v,value:b}of tle(e,{isAborted:()=>(t==null?void 0:t.current)===null})){if(v==="text"&&(c.text?c.text={...c.text,content:(c.text.content||"")+b}:c.text={id:i(),role:"assistant",content:b,createdAt:l}),v==="finish_message"){const{completionTokens:C,promptTokens:E}=b.usage;g=b.finishReason,h={completionTokens:C,promptTokens:E,totalTokens:C+E}}if(v==="tool_call_streaming_start")c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),f[b.toolCallId]={text:"",toolName:b.toolName,prefixMapIndex:c.text.toolInvocations.length},c.text.toolInvocations.push({state:"partial-call",toolCallId:b.toolCallId,toolName:b.toolName,args:void 0});else if(v==="tool_call_delta"){const C=f[b.toolCallId];C.text+=b.argsTextDelta,c.text.toolInvocations[C.prefixMapIndex]={state:"partial-call",toolCallId:b.toolCallId,toolName:C.toolName,args:Kae(C.text)},c.text.internalUpdateId=i()}else if(v==="tool_call"){if(f[b.toolCallId]!=null?c.text.toolInvocations[f[b.toolCallId].prefixMapIndex]={state:"call",...b}:(c.text==null&&(c.text={id:i(),role:"assistant",content:"",createdAt:l}),c.text.toolInvocations==null&&(c.text.toolInvocations=[]),c.text.toolInvocations.push({state:"call",...b})),c.text.internalUpdateId=i(),r){const C=await r({toolCall:b});C!=null&&(c.text.toolInvocations[c.text.toolInvocations.length-1]={state:"result",...b,result:C})}}else if(v==="tool_result"){const C=(a=c.text)==null?void 0:a.toolInvocations;if(C==null)throw new Error("tool_result must be preceded by a tool_call");const E=C.findIndex(P=>P.toolCallId===b.toolCallId);if(E===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");C[E]={...C[E],state:"result",...b}}let w=null;v==="function_call"&&(c.function_call={id:i(),role:"assistant",content:"",function_call:b.function_call,name:b.function_call.name,createdAt:l},w=c.function_call);let x=null;v==="tool_calls"&&(c.tool_calls={id:i(),role:"assistant",content:"",tool_calls:b.tool_calls,createdAt:l},x=c.tool_calls),v==="data"&&c.data.push(...b);let _=c.text;v==="message_annotations"&&(u?u.push(...b):u=[...b],w=$p(c.function_call,u),x=$p(c.tool_calls,u),_=$p(c.text,u)),u!=null&&u.length&&["text","function_call","tool_calls"].forEach(E=>{c[E]&&(c[E].annotations=[...u])});const S=[w,x,_].filter(Boolean).map(C=>({...$p(C,u)}));n(S,[...c.data])}return o==null||o({prefixMap:c,finishReason:g,usage:h}),{messages:[c.text,c.function_call,c.tool_calls].filter(Boolean),data:c.data}}var rle=()=>fetch;async function ole({api:e,body:t,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:f,fetch:h=rle()}){var g,v;const b=await h(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(g=i==null?void 0:i())==null?void 0:g.signal,credentials:r}).catch(x=>{throw s(),x});if(a)try{await a(b)}catch(x){throw x}if(!b.ok)throw s(),new Error((v=await b.text())!=null?v:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");const w=b.body.getReader();switch(n){case"text":{const x=ile(),_={id:f(),createdAt:new Date,role:"assistant",content:""};for(;;){const{done:S,value:C}=await w.read();if(S)break;if(_.content+=x(C),l([{..._}],[]),(i==null?void 0:i())===null){w.cancel();break}}return c==null||c(_,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"}),{messages:[_],data:[]}}case"data":return await nle({reader:w,abortControllerRef:i!=null?{current:i()}:void 0,update:l,onToolCall:u,onFinish({prefixMap:x,finishReason:_,usage:S}){c&&x.text!=null&&c(x.text,{usage:S,finishReason:_})},generateId:f});default:{const x=n;throw new Error(`Unknown stream protocol: ${x}`)}}}function ile(e){const t=new TextDecoder;return e?function(n){return t.decode(n,{stream:!0}).split(`
|
|
399
399
|
`).filter(o=>o!=="").map(yI).filter(Boolean)}:function(n){return n?t.decode(n,{stream:!0}):""}}async function sle({getStreamedResponse:e,experimental_onFunctionCall:t,experimental_onToolCall:n,updateChatRequest:r,getCurrentMessages:o}){for(;;){const i=await e();if("messages"in i){let s=!1;for(const a of i.messages)if(!((a.function_call===void 0||typeof a.function_call=="string")&&(a.tool_calls===void 0||typeof a.tool_calls=="string"))){if(s=!0,t){const l=a.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0){s=!1;break}r(c)}if(n){const l=a.tool_calls;if(!Array.isArray(l)||l.some(u=>typeof u!="object")){console.warn("experimental_onToolCall should not be defined when using tools");continue}const c=await n(o(),l);if(c===void 0){s=!1;break}r(c)}}if(!s)break}else{let s=function(l){for(const c of l.messages){if(c.tool_calls!==void 0)for(const u of c.tool_calls)typeof u=="object"&&u.function.arguments&&typeof u.function.arguments!="string"&&(u.function.arguments=JSON.stringify(u.function.arguments));c.function_call!==void 0&&typeof c.function_call=="object"&&c.function_call.arguments&&typeof c.function_call.arguments!="string"&&(c.function_call.arguments=JSON.stringify(c.function_call.arguments))}};const a=i;if((a.function_call===void 0||typeof a.function_call=="string")&&(a.tool_calls===void 0||typeof a.tool_calls=="string"))break;if(t){const l=a.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0)break;s(c),r(c)}if(n){const l=a.tool_calls;if(typeof l!="object"){console.warn("experimental_onToolCall should not be defined when using functions");continue}const c=await n(o(),l);if(c===void 0)break;s(c),r(c)}}}}var ale=vw();const na=()=>{},kr=na(),jy=Object,Ft=e=>e===kr,mi=e=>typeof e=="function",ha=(e,t)=>({...e,...t}),lle=e=>mi(e.then),kp=new WeakMap;let cle=0;const sf=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(jy(e)===e&&!r&&n!=RegExp){if(o=kp.get(e),o)return o;if(o=++cle+"~",kp.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=sf(e[i])+",";kp.set(e,o)}if(n==jy){o="#";const s=jy.keys(e).sort();for(;!Ft(i=s.pop());)Ft(e[i])||(o+=i+":"+sf(e[i])+",");kp.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Zi=new WeakMap,zy={},Mp={},$_="undefined",Zm=typeof window!=$_,Ux=typeof document!=$_,ule=()=>Zm&&typeof window.requestAnimationFrame!=$_,xI=(e,t)=>{const n=Zi.get(e);return[()=>!Ft(t)&&e.get(t)||zy,r=>{if(!Ft(t)){const o=e.get(t);t in Mp||(Mp[t]=o),n[5](t,ha(o,r),o||zy)}},n[6],()=>!Ft(t)&&t in Mp?Mp[t]:!Ft(t)&&e.get(t)||zy]};let qx=!0;const dle=()=>qx,[Gx,Yx]=Zm&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[na,na],fle=()=>{const e=Ux&&document.visibilityState;return Ft(e)||e!=="hidden"},hle=e=>(Ux&&document.addEventListener("visibilitychange",e),Gx("focus",e),()=>{Ux&&document.removeEventListener("visibilitychange",e),Yx("focus",e)}),ple=e=>{const t=()=>{qx=!0,e()},n=()=>{qx=!1};return Gx("online",t),Gx("offline",n),()=>{Yx("online",t),Yx("offline",n)}},gle={isOnline:dle,isVisible:fle},mle={initFocus:hle,initReconnect:ple},mT=!m.useId,af=!Zm||"Deno"in window,vle=e=>ule()?window.requestAnimationFrame(e):setTimeout(e,1),By=af?m.useEffect:m.useLayoutEffect,Vy=typeof navigator<"u"&&navigator.connection,vT=!af&&Vy&&(["slow-2g","2g"].includes(Vy.effectiveType)||Vy.saveData),k_=e=>{if(mi(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?sf(e):"",[e,t]};let ble=0;const Kx=()=>++ble,wI=0,_I=1,SI=2,yle=3;var Ju={__proto__:null,ERROR_REVALIDATE_EVENT:yle,FOCUS_EVENT:wI,MUTATE_EVENT:SI,RECONNECT_EVENT:_I};async function CI(...e){const[t,n,r,o]=e,i=ha({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const c=h=>typeof a=="function"?a(h):a!==!1,u=i.throwOnError;if(mi(n)){const h=n,g=[],v=t.keys();for(const b of v)!/^\$(inf|sub)\$/.test(b)&&h(t.get(b)._k)&&g.push(b);return Promise.all(g.map(f))}return f(n);async function f(h){const[g]=k_(h);if(!g)return;const[v,b]=xI(t,g),[w,x,_,S]=Zi.get(t),C=()=>{const Q=w[g];return(mi(i.revalidate)?i.revalidate(v().data,h):i.revalidate!==!1)&&(delete _[g],delete S[g],Q&&Q[0])?Q[0](SI).then(()=>v().data):v().data};if(e.length<3)return C();let E=r,P;const A=Kx();x[g]=[A,0];const k=!Ft(l),I=v(),$=I.data,L=I._c,j=Ft(L)?$:L;if(k&&(l=mi(l)?l(j,$):l,b({data:l,_c:j})),mi(E))try{E=E(j)}catch(Q){P=Q}if(E&&lle(E))if(E=await E.catch(Q=>{P=Q}),A!==x[g][0]){if(P)throw P;return E}else P&&k&&c(P)&&(s=!0,b({data:j,_c:kr}));if(s&&!P)if(mi(s)){const Q=s(E,j);b({data:Q,error:kr,_c:kr})}else b({data:E,error:kr,_c:kr});if(x[g][1]=Kx(),Promise.resolve(C()).then(()=>{b({_c:kr})}),P){if(u)throw P;return}return E}}const bT=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},xle=(e,t)=>{if(!Zi.has(e)){const n=ha(mle,t),r={},o=CI.bind(kr,e);let i=na;const s={},a=(u,f)=>{const h=s[u]||[];return s[u]=h,h.push(f),()=>h.splice(h.indexOf(f),1)},l=(u,f,h)=>{e.set(u,f);const g=s[u];if(g)for(const v of g)v(f,h)},c=()=>{if(!Zi.has(e)&&(Zi.set(e,[r,{},{},{},o,l,a]),!af)){const u=n.initFocus(setTimeout.bind(kr,bT.bind(kr,r,wI))),f=n.initReconnect(setTimeout.bind(kr,bT.bind(kr,r,_I)));i=()=>{u&&u(),f&&f(),Zi.delete(e)}}};return c(),[e,o,c,i]}return[e,Zi.get(e)[4]]},wle=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Ft(i)&&s>i||setTimeout(r,a,o)},_le=(e,t)=>sf(e)==sf(t),[EI,Sle]=xle(new Map),Cle=ha({onLoadingSlow:na,onSuccess:na,onError:na,onErrorRetry:wle,onDiscarded:na,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:vT?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:vT?5e3:3e3,compare:_le,isPaused:()=>!1,cache:EI,mutate:Sle,fallback:{}},gle),Ele=(e,t)=>{const n=ha(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=ha(o,s))}return n},Rle=m.createContext({}),Ole="$inf$",RI=Zm&&window.__SWR_DEVTOOLS_USE__,Ple=RI?window.__SWR_DEVTOOLS_USE__:[],Tle=()=>{RI&&(window.__SWR_DEVTOOLS_REACT__=m)},Dle=e=>mi(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Ale=()=>ha(Cle,m.useContext(Rle)),$le=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=k_(t),[,,,a]=Zi.get(EI);if(s.startsWith(Ole))return n(...i);const l=a[s];return Ft(l)?n(...i):(delete a[s],l)}),r),kle=Ple.concat($le),Mle=e=>function(...n){const r=Ale(),[o,i,s]=Dle(n),a=Ele(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(kle);for(let f=u.length;f--;)l=u[f](l);return l(o,i||a.fetcher||null,a)},Ile=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};Tle();const yT=m.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),Hy={dedupe:!0},Nle=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:f,keepPreviousData:h}=n,[g,v,b,w]=Zi.get(r),[x,_]=k_(e),S=m.useRef(!1),C=m.useRef(!1),E=m.useRef(x),P=m.useRef(t),A=m.useRef(n),k=()=>A.current,I=()=>k().isVisible()&&k().isOnline(),[$,L,j,Q]=xI(r,x),ee=m.useRef({}).current,B=Ft(s)?n.fallback[x]:s,Z=(Y,be)=>{for(const _e in ee){const Pe=_e;if(Pe==="data"){if(!o(Y[Pe],be[Pe])&&(!Ft(Y[Pe])||!o(fe,be[Pe])))return!1}else if(be[Pe]!==Y[Pe])return!1}return!0},G=m.useMemo(()=>{const Y=!x||!t?!1:Ft(a)?k().isPaused()||i?!1:Ft(l)?!0:l:a,be=Ie=>{const Ke=ha(Ie);return delete Ke._k,Y?{isValidating:!0,isLoading:!0,...Ke}:Ke},_e=$(),Pe=Q(),Te=be(_e),Ue=_e===Pe?Te:be(Pe);let Be=Te;return[()=>{const Ie=be($());return Z(Ie,Be)?(Be.data=Ie.data,Be.isLoading=Ie.isLoading,Be.isValidating=Ie.isValidating,Be.error=Ie.error,Be):(Be=Ie,Ie)},()=>Ue]},[r,x]),q=ale.useSyncExternalStore(m.useCallback(Y=>j(x,(be,_e)=>{Z(_e,be)||Y()}),[r,x]),G[0],G[1]),K=!S.current,T=g[x]&&g[x].length>0,V=q.data,X=Ft(V)?B:V,N=q.error,ie=m.useRef(X),fe=h?Ft(V)?ie.current:V:X,ue=T&&!Ft(N)?!1:K&&!Ft(a)?a:k().isPaused()?!1:i?Ft(X)?!1:l:Ft(X)||l,pe=!!(x&&t&&K&&ue),se=Ft(q.isValidating)?pe:q.isValidating,ne=Ft(q.isLoading)?pe:q.isLoading,le=m.useCallback(async Y=>{const be=P.current;if(!x||!be||C.current||k().isPaused())return!1;let _e,Pe,Te=!0;const Ue=Y||{},Be=!b[x]||!Ue.dedupe,Ie=()=>mT?!C.current&&x===E.current&&S.current:x===E.current,Ke={isValidating:!1,isLoading:!1},lt=()=>{L(Ke)},It=()=>{const Ht=b[x];Ht&&Ht[1]===Pe&&delete b[x]},At={isValidating:!0};Ft($().data)&&(At.isLoading=!0);try{if(Be&&(L(At),n.loadingTimeout&&Ft($().data)&&setTimeout(()=>{Te&&Ie()&&k().onLoadingSlow(x,n)},n.loadingTimeout),b[x]=[be(_),Kx()]),[_e,Pe]=b[x],_e=await _e,Be&&setTimeout(It,n.dedupingInterval),!b[x]||b[x][1]!==Pe)return Be&&Ie()&&k().onDiscarded(x),!1;Ke.error=kr;const Ht=v[x];if(!Ft(Ht)&&(Pe<=Ht[0]||Pe<=Ht[1]||Ht[1]===0))return lt(),Be&&Ie()&&k().onDiscarded(x),!1;const de=$().data;Ke.data=o(de,_e)?de:_e,Be&&Ie()&&k().onSuccess(_e,x,n)}catch(Ht){It();const de=k(),{shouldRetryOnError:Ee}=de;de.isPaused()||(Ke.error=Ht,Be&&Ie()&&(de.onError(Ht,x,de),(Ee===!0||mi(Ee)&&Ee(Ht))&&(!k().revalidateOnFocus||!k().revalidateOnReconnect||I())&&de.onErrorRetry(Ht,x,de,Le=>{const Ge=g[x];Ge&&Ge[0]&&Ge[0](Ju.ERROR_REVALIDATE_EVENT,Le)},{retryCount:(Ue.retryCount||0)+1,dedupe:!0})))}return Te=!1,lt(),!0},[x,r]),ye=m.useCallback((...Y)=>CI(r,E.current,...Y),[]);if(By(()=>{P.current=t,A.current=n,Ft(V)||(ie.current=V)}),By(()=>{if(!x)return;const Y=le.bind(kr,Hy);let be=0;const Pe=Ile(x,g,(Te,Ue={})=>{if(Te==Ju.FOCUS_EVENT){const Be=Date.now();k().revalidateOnFocus&&Be>be&&I()&&(be=Be+k().focusThrottleInterval,Y())}else if(Te==Ju.RECONNECT_EVENT)k().revalidateOnReconnect&&I()&&Y();else{if(Te==Ju.MUTATE_EVENT)return le();if(Te==Ju.ERROR_REVALIDATE_EVENT)return le(Ue)}});return C.current=!1,E.current=x,S.current=!0,L({_k:_}),ue&&(Ft(X)||af?Y():vle(Y)),()=>{C.current=!0,Pe()}},[x]),By(()=>{let Y;function be(){const Pe=mi(c)?c($().data):c;Pe&&Y!==-1&&(Y=setTimeout(_e,Pe))}function _e(){!$().error&&(u||k().isVisible())&&(f||k().isOnline())?le(Hy).then(be):be()}return be(),()=>{Y&&(clearTimeout(Y),Y=-1)}},[c,u,f,x]),m.useDebugValue(fe),i&&Ft(X)&&x){if(!mT&&af)throw new Error("Fallback data is required when using suspense in SSR.");P.current=t,A.current=n,C.current=!1;const Y=w[x];if(!Ft(Y)){const be=ye(Y);yT(be)}if(Ft(N)){const be=le(Hy);Ft(fe)||(be.status="fulfilled",be.value=!0),yT(be)}else throw N}return{mutate:ye,get data(){return ee.data=!0,fe},get error(){return ee.error=!0,N},get isValidating(){return ee.isValidating=!0,se},get isLoading(){return ee.isLoading=!0,ne}}},Ip=Mle(Nle);var Lle=async(e,t,n,r,o,i,s,a,l,c,u,f,h,g,v,b,w)=>{var x;const _=s.current;n(t.messages,!1);const S=g?t.messages:t.messages.map(({role:C,content:E,experimental_attachments:P,name:A,data:k,annotations:I,toolInvocations:$,function_call:L,tool_calls:j,tool_call_id:Q})=>({role:C,content:E,...P!==void 0&&{experimental_attachments:P},...A!==void 0&&{name:A},...k!==void 0&&{data:k},...I!==void 0&&{annotations:I},...$!==void 0&&{toolInvocations:$},tool_call_id:Q,...L!==void 0&&{function_call:L},...j!==void 0&&{tool_calls:j}}));return await ole({api:e,body:(x=v==null?void 0:v({messages:t.messages,requestData:t.data,requestBody:t.body}))!=null?x:{messages:S,data:t.data,...i.current.body,...t.body,...t.functions!==void 0&&{functions:t.functions},...t.function_call!==void 0&&{function_call:t.function_call},...t.tools!==void 0&&{tools:t.tools},...t.tool_choice!==void 0&&{tool_choice:t.tool_choice}},streamProtocol:c,credentials:i.current.credentials,headers:{...i.current.headers,...t.headers},abortController:()=>a.current,restoreMessagesOnFailure(){w||n(_,!1)},onResponse:f,onUpdate(C,E){n([...t.messages,...C],!1),r([...o||[],...E||[]],!1)},onToolCall:h,onFinish:u,generateId:l,fetch:b})};function Fle({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,experimental_onFunctionCall:i,experimental_onToolCall:s,onToolCall:a,experimental_prepareRequestBody:l,experimental_maxAutomaticRoundtrips:c=0,maxAutomaticRoundtrips:u=c,maxToolRoundtrips:f=u,streamMode:h,streamProtocol:g,onResponse:v,onFinish:b,onError:w,credentials:x,headers:_,body:S,generateId:C=bI,fetch:E,keepLastMessageOnError:P=!1}={}){h&&(g??(g=h==="text"?"text":void 0));const A=m.useId(),k=t??A,I=typeof e=="string"?[e,k]:k,[$]=m.useState([]),{data:L,mutate:j}=Ip([I,"messages"],null,{fallbackData:n??$}),{data:Q=!1,mutate:ee}=Ip([I,"loading"],null),{data:B,mutate:Z}=Ip([I,"streamData"],null),{data:G=void 0,mutate:q}=Ip([I,"error"],null),K=m.useRef(L||[]);m.useEffect(()=>{K.current=L||[]},[L]);const T=m.useRef(null),V=m.useRef({credentials:x,headers:_,body:S});m.useEffect(()=>{V.current={credentials:x,headers:_,body:S}},[x,_,S]);const X=m.useCallback(async Y=>{const be=K.current.length;try{ee(!0),q(void 0);const Te=new AbortController;T.current=Te,await sle({getStreamedResponse:()=>Lle(e,Y,j,Z,B,V,K,T,C,g,b,v,a,o,l,E,P),experimental_onFunctionCall:i,experimental_onToolCall:s,updateChatRequest:Ue=>{Y=Ue},getCurrentMessages:()=>K.current}),T.current=null}catch(Te){if(Te.name==="AbortError")return T.current=null,null;w&&Te instanceof Error&&w(Te),q(Te)}finally{ee(!1)}const _e=K.current,Pe=_e[_e.length-1];_e.length>be&&Pe!=null&&f>0&&xT(Pe)&&jle(_e)<=f&&await X({messages:_e})},[j,ee,e,V,v,b,w,q,Z,B,g,o,i,s,l,a,f,K,T,C,E,P]),N=m.useCallback(async(Y,{options:be,functions:_e,function_call:Pe,tools:Te,tool_choice:Ue,data:Be,headers:Ie,body:Ke}={})=>{Y.id||(Y.id=C());const lt={headers:Ie??(be==null?void 0:be.headers),body:Ke??(be==null?void 0:be.body)},It={messages:K.current.concat(Y),options:lt,headers:lt.headers,body:lt.body,data:Be,..._e!==void 0&&{functions:_e},...Pe!==void 0&&{function_call:Pe},...Te!==void 0&&{tools:Te},...Ue!==void 0&&{tool_choice:Ue}};return X(It)},[X,C]),ie=m.useCallback(async({options:Y,functions:be,function_call:_e,tools:Pe,tool_choice:Te,data:Ue,headers:Be,body:Ie}={})=>{if(K.current.length===0)return null;const Ke={headers:Be??(Y==null?void 0:Y.headers),body:Ie??(Y==null?void 0:Y.body)};if(K.current[K.current.length-1].role==="assistant"){const At={messages:K.current.slice(0,-1),options:Ke,headers:Ke.headers,body:Ke.body,data:Ue,...be!==void 0&&{functions:be},..._e!==void 0&&{function_call:_e},...Pe!==void 0&&{tools:Pe},...Te!==void 0&&{tool_choice:Te}};return X(At)}const It={messages:K.current,options:Ke,headers:Ke.headers,body:Ke.body,data:Ue,...be!==void 0&&{functions:be},..._e!==void 0&&{function_call:_e},...Pe!==void 0&&{tools:Pe},...Te!==void 0&&{tool_choice:Te}};return X(It)},[X]),fe=m.useCallback(()=>{T.current&&(T.current.abort(),T.current=null)},[]),ue=m.useCallback(Y=>{typeof Y=="function"&&(Y=Y(K.current)),j(Y,!1),K.current=Y},[j]),[pe,se]=m.useState(r),ne=m.useCallback(async(Y,be={},_e)=>{var Pe,Te,Ue,Be,Ie;if((Pe=Y==null?void 0:Y.preventDefault)==null||Pe.call(Y),!pe&&!be.allowEmptySubmit)return;_e&&(V.current={...V.current,..._e});const Ke=[],lt=be.experimental_attachments;if(lt)if(lt instanceof FileList)for(const de of Array.from(lt)){const{name:Ee,type:Le}=de,Ge=await new Promise((Ze,Wt)=>{const Zt=new FileReader;Zt.onload=Kt=>{var vn;Ze((vn=Kt.target)==null?void 0:vn.result)},Zt.onerror=Kt=>Wt(Kt),Zt.readAsDataURL(de)});Ke.push({name:Ee,contentType:Le,url:Ge})}else if(Array.isArray(lt))for(const de of lt){const{name:Ee,url:Le,contentType:Ge}=de;Ke.push({name:Ee,contentType:Ge,url:Le})}else throw new Error("Invalid attachments type");const It={headers:(Ue=be.headers)!=null?Ue:(Te=be.options)==null?void 0:Te.headers,body:(Ie=be.body)!=null?Ie:(Be=be.options)==null?void 0:Be.body},Ht={messages:!pe&&be.allowEmptySubmit?K.current:K.current.concat({id:C(),createdAt:new Date,role:"user",content:pe,experimental_attachments:Ke.length>0?Ke:void 0}),options:It,headers:It.headers,body:It.body,data:be.data};X(Ht),se("")},[pe,C,X]),le=Y=>{se(Y.target.value)},ye=({toolCallId:Y,result:be})=>{const _e=K.current.map((Te,Ue,Be)=>Ue===Be.length-1&&Te.role==="assistant"&&Te.toolInvocations?{...Te,toolInvocations:Te.toolInvocations.map(Ie=>Ie.toolCallId===Y?{...Ie,result:be}:Ie)}:Te);j(_e,!1);const Pe=_e[_e.length-1];xT(Pe)&&X({messages:_e})};return{messages:L||[],error:G,append:N,reload:ie,stop:fe,setMessages:ue,input:pe,setInput:se,handleInputChange:le,handleSubmit:ne,isLoading:Q,data:B,addToolResult:ye,experimental_addToolResult:ye}}function xT(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function jle(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}function zle(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const OI="ScrollArea",[PI,_ye]=Zn(OI),[Ble,Io]=PI(OI),TI=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=m.useState(null),[c,u]=m.useState(null),[f,h]=m.useState(null),[g,v]=m.useState(null),[b,w]=m.useState(null),[x,_]=m.useState(0),[S,C]=m.useState(0),[E,P]=m.useState(!1),[A,k]=m.useState(!1),I=_t(t,L=>l(L)),$=_l(o);return m.createElement(Ble,{scope:n,type:r,dir:$,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:f,onContentChange:h,scrollbarX:g,onScrollbarXChange:v,scrollbarXEnabled:E,onScrollbarXEnabledChange:P,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:A,onScrollbarYEnabledChange:k,onCornerWidthChange:_,onCornerHeightChange:C},m.createElement(Qe.div,he({dir:$},s,{ref:I,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})))}),Vle="ScrollAreaViewport",Hle=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=Io(Vle,n),s=m.useRef(null),a=_t(t,s,i.onViewportChange);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(Qe.div,he({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),m.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),hs="ScrollAreaScrollbar",DI=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Io(hs,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return m.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?m.createElement(Wle,he({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(Ule,he({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(AI,he({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(M_,he({},r,{ref:t})):null}),Wle=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Io(hs,e.__scopeScrollArea),[i,s]=m.useState(!1);return m.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),m.createElement(er,{present:n||i},m.createElement(AI,he({"data-state":i?"visible":"hidden"},r,{ref:t})))}),Ule=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Io(hs,e.__scopeScrollArea),i=e.orientation==="horizontal",s=tv(()=>l("SCROLL_END"),100),[a,l]=zle("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),m.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let f=c[u];const h=()=>{const g=c[u];f!==g&&(l("SCROLL"),s()),f=g};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[o.viewport,i,l,s]),m.createElement(er,{present:n||a!=="hidden"},m.createElement(M_,he({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Me(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Me(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),AI=m.forwardRef((e,t)=>{const n=Io(hs,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=m.useState(!1),a=e.orientation==="horizontal",l=tv(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return eu(n.viewport,l),eu(n.content,l),m.createElement(er,{present:r||i},m.createElement(M_,he({"data-state":i?"visible":"hidden"},o,{ref:t})))}),M_=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=Io(hs,e.__scopeScrollArea),i=m.useRef(null),s=m.useRef(0),[a,l]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=II(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:h=>s.current=h};function f(h,g){return Zle(h,s.current,a,g)}return n==="horizontal"?m.createElement(qle,he({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollLeft,g=wT(h,a,o.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=f(h,o.dir))}})):n==="vertical"?m.createElement(Gle,he({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const h=o.viewport.scrollTop,g=wT(h,a);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=f(h))}})):null}),qle=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Io(hs,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=_t(t,l,i.onScrollbarXChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(kI,he({"data-orientation":"horizontal"},o,{ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ev(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(i.viewport){const h=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(h),LI(h,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Ug(s.paddingLeft),paddingEnd:Ug(s.paddingRight)}})}}))}),Gle=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Io(hs,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=_t(t,l,i.onScrollbarYChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(kI,he({"data-orientation":"vertical"},o,{ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ev(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(i.viewport){const h=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(h),LI(h,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Ug(s.paddingTop),paddingEnd:Ug(s.paddingBottom)}})}}))}),[Yle,$I]=PI(hs),kI=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:f,...h}=e,g=Io(hs,n),[v,b]=m.useState(null),w=_t(t,I=>b(I)),x=m.useRef(null),_=m.useRef(""),S=g.viewport,C=r.content-r.viewport,E=Ln(u),P=Ln(l),A=tv(f,10);function k(I){if(x.current){const $=I.clientX-x.current.left,L=I.clientY-x.current.top;c({x:$,y:L})}}return m.useEffect(()=>{const I=$=>{const L=$.target;(v==null?void 0:v.contains(L))&&E($,C)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[S,v,C,E]),m.useEffect(P,[r,P]),eu(v,A),eu(g.content,A),m.createElement(Yle,{scope:n,scrollbar:v,hasThumb:o,onThumbChange:Ln(i),onThumbPointerUp:Ln(s),onThumbPositionChange:P,onThumbPointerDown:Ln(a)},m.createElement(Qe.div,he({},h,{ref:w,style:{position:"absolute",...h.style},onPointerDown:Me(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),x.current=v.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),k(I))}),onPointerMove:Me(e.onPointerMove,k),onPointerUp:Me(e.onPointerUp,I=>{const $=I.target;$.hasPointerCapture(I.pointerId)&&$.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),x.current=null})})))}),Xx="ScrollAreaThumb",Kle=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=$I(Xx,e.__scopeScrollArea);return m.createElement(er,{present:n||o.hasThumb},m.createElement(Xle,he({ref:t},r)))}),Xle=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=Io(Xx,n),s=$I(Xx,n),{onThumbPositionChange:a}=s,l=_t(t,f=>s.onThumbChange(f)),c=m.useRef(),u=tv(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const f=i.viewport;if(f){const h=()=>{if(u(),!c.current){const g=ece(f,a);c.current=g,a()}};return a(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[i.viewport,u,a]),m.createElement(Qe.div,he({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Me(e.onPointerDownCapture,f=>{const g=f.target.getBoundingClientRect(),v=f.clientX-g.left,b=f.clientY-g.top;s.onThumbPointerDown({x:v,y:b})}),onPointerUp:Me(e.onPointerUp,s.onThumbPointerUp)}))}),MI="ScrollAreaCorner",Qle=m.forwardRef((e,t)=>{const n=Io(MI,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(Jle,he({},e,{ref:t})):null}),Jle=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Io(MI,n),[i,s]=m.useState(0),[a,l]=m.useState(0),c=!!(i&&a);return eu(o.scrollbarX,()=>{var u;const f=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(f),l(f)}),eu(o.scrollbarY,()=>{var u;const f=((u=o.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;o.onCornerWidthChange(f),s(f)}),c?m.createElement(Qe.div,he({},r,{ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Ug(e){return e?parseInt(e,10):0}function II(e,t){const n=e/t;return isNaN(n)?0:n}function ev(e){const t=II(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Zle(e,t,n,r="ltr"){const o=ev(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,f=r==="ltr"?[0,u]:[u*-1,0];return NI([l,c],f)(e)}function wT(e,t,n="ltr"){const r=ev(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Ax(e,l);return NI([0,s],[0,a])(c)}function NI(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 LI(e,t){return e>0&&e<t}const ece=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function tv(e,t){const n=Ln(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function eu(e,t){const n=Ln(t);ur(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const FI=TI,tce=Hle,nce=Qle,I_=H.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(FI,{ref:r,className:Ce("relative overflow-hidden",e),...n,children:[O.jsx(tce,{className:"h-full w-full rounded-[inherit]",children:t}),O.jsx(nv,{}),O.jsx(nce,{})]}));I_.displayName=FI.displayName;const nv=H.forwardRef(({className:e,orientation:t="vertical",...n},r)=>O.jsx(DI,{ref:r,orientation:t,className:Ce("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:O.jsx(Kle,{className:"relative flex-1 rounded-full bg-border"})}));nv.displayName=DI.displayName;const jI="Switch",[rce,Sye]=Zn(jI),[oce,ice]=rce(jI),sce=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,h]=m.useState(null),g=_t(t,_=>h(_)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[w=!1,x]=wr({prop:o,defaultProp:i,onChange:c});return m.createElement(oce,{scope:n,checked:w,disabled:a},m.createElement(Qe.button,he({type:"button",role:"switch","aria-checked":w,"aria-required":s,"data-state":zI(w),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:g,onClick:Me(e.onClick,_=>{x(S=>!S),b&&(v.current=_.isPropagationStopped(),v.current||_.stopPropagation())})})),b&&m.createElement(cce,{control:f,bubbles:!v.current,name:r,value:l,checked:w,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),ace="SwitchThumb",lce=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=ice(ace,n);return m.createElement(Qe.span,he({"data-state":zI(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),cce=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=jm(n),a=Im(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",he({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function zI(e){return e?"checked":"unchecked"}const rv=sce,BI=lce,VI=H.forwardRef(({className:e,...t},n)=>O.jsx(rv,{className:Ce("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:O.jsx(BI,{className:Ce("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")})}));VI.displayName=rv.displayName;const uce=H.forwardRef(({className:e,...t},n)=>O.jsx(rv,{className:Ce("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:O.jsx(BI,{className:Ce("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")})}));uce.displayName=rv.displayName;function dce(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const fce=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hce=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pce={};function _T(e,t){return((t||pce).jsx?hce:fce).test(e)}const gce=/[ \t\n\f\r]/g;function mce(e){return typeof e=="object"?e.type==="text"?ST(e.value):!1:ST(e)}function ST(e){return e.replace(gce,"")===""}class Jf{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Jf.prototype.property={};Jf.prototype.normal={};Jf.prototype.space=null;function HI(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new Jf(n,r,t)}function Qx(e){return e.toLowerCase()}class No{constructor(t,n){this.property=t,this.attribute=n}}No.prototype.space=null;No.prototype.boolean=!1;No.prototype.booleanish=!1;No.prototype.overloadedBoolean=!1;No.prototype.number=!1;No.prototype.commaSeparated=!1;No.prototype.spaceSeparated=!1;No.prototype.commaOrSpaceSeparated=!1;No.prototype.mustUseProperty=!1;No.prototype.defined=!1;let vce=0;const mt=Dl(),An=Dl(),WI=Dl(),De=Dl(),on=Dl(),wc=Dl(),Gr=Dl();function Dl(){return 2**++vce}const Jx=Object.freeze(Object.defineProperty({__proto__:null,boolean:mt,booleanish:An,commaOrSpaceSeparated:Gr,commaSeparated:wc,number:De,overloadedBoolean:WI,spaceSeparated:on},Symbol.toStringTag,{value:"Module"})),Wy=Object.keys(Jx);class N_ extends No{constructor(t,n,r,o){let i=-1;if(super(t,n),CT(this,"space",o),typeof r=="number")for(;++i<Wy.length;){const s=Wy[i];CT(this,Wy[i],(r&Jx[s])===Jx[s])}}}N_.prototype.defined=!0;function CT(e,t,n){n&&(e[t]=n)}const bce={}.hasOwnProperty;function du(e){const t={},n={};let r;for(r in e.properties)if(bce.call(e.properties,r)){const o=e.properties[r],i=new N_(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Qx(r)]=r,n[Qx(i.attribute)]=r}return new Jf(t,n,e.space)}const UI=du({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}}),qI=du({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function GI(e,t){return t in e?e[t]:t}function YI(e,t){return GI(e,t.toLowerCase())}const KI=du({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:YI,properties:{xmlns:null,xmlnsXLink:null}}),XI=du({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:An,ariaAutoComplete:null,ariaBusy:An,ariaChecked:An,ariaColCount:De,ariaColIndex:De,ariaColSpan:De,ariaControls:on,ariaCurrent:null,ariaDescribedBy:on,ariaDetails:null,ariaDisabled:An,ariaDropEffect:on,ariaErrorMessage:null,ariaExpanded:An,ariaFlowTo:on,ariaGrabbed:An,ariaHasPopup:null,ariaHidden:An,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:on,ariaLevel:De,ariaLive:null,ariaModal:An,ariaMultiLine:An,ariaMultiSelectable:An,ariaOrientation:null,ariaOwns:on,ariaPlaceholder:null,ariaPosInSet:De,ariaPressed:An,ariaReadOnly:An,ariaRelevant:null,ariaRequired:An,ariaRoleDescription:on,ariaRowCount:De,ariaRowIndex:De,ariaRowSpan:De,ariaSelected:An,ariaSetSize:De,ariaSort:null,ariaValueMax:De,ariaValueMin:De,ariaValueNow:De,ariaValueText:null,role:null}}),yce=du({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:YI,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:wc,acceptCharset:on,accessKey:on,action:null,allow:null,allowFullScreen:mt,allowPaymentRequest:mt,allowUserMedia:mt,alt:null,as:null,async:mt,autoCapitalize:null,autoComplete:on,autoFocus:mt,autoPlay:mt,blocking:on,capture:null,charSet:null,checked:mt,cite:null,className:on,cols:De,colSpan:null,content:null,contentEditable:An,controls:mt,controlsList:on,coords:De|wc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mt,defer:mt,dir:null,dirName:null,disabled:mt,download:WI,draggable:An,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:mt,formTarget:null,headers:on,height:De,hidden:mt,high:De,href:null,hrefLang:null,htmlFor:on,httpEquiv:on,id:null,imageSizes:null,imageSrcSet:null,inert:mt,inputMode:null,integrity:null,is:null,isMap:mt,itemId:null,itemProp:on,itemRef:on,itemScope:mt,itemType:on,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:mt,low:De,manifest:null,max:null,maxLength:De,media:null,method:null,min:null,minLength:De,multiple:mt,muted:mt,name:null,nonce:null,noModule:mt,noValidate:mt,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:mt,optimum:De,pattern:null,ping:on,placeholder:null,playsInline:mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:mt,referrerPolicy:null,rel:on,required:mt,reversed:mt,rows:De,rowSpan:De,sandbox:on,scope:null,scoped:mt,seamless:mt,selected:mt,shadowRootDelegatesFocus:mt,shadowRootMode:null,shape:null,size:De,sizes:null,slot:null,span:De,spellCheck:An,src:null,srcDoc:null,srcLang:null,srcSet:null,start:De,step:null,style:null,tabIndex:De,target:null,title:null,translate:null,type:null,typeMustMatch:mt,useMap:null,value:An,width:De,wrap:null,align:null,aLink:null,archive:on,axis:null,background:null,bgColor:null,border:De,borderColor:null,bottomMargin:De,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:mt,declare:mt,event:null,face:null,frame:null,frameBorder:null,hSpace:De,leftMargin:De,link:null,longDesc:null,lowSrc:null,marginHeight:De,marginWidth:De,noResize:mt,noHref:mt,noShade:mt,noWrap:mt,object:null,profile:null,prompt:null,rev:null,rightMargin:De,rules:null,scheme:null,scrolling:An,standby:null,summary:null,text:null,topMargin:De,valueType:null,version:null,vAlign:null,vLink:null,vSpace:De,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:mt,disableRemotePlayback:mt,prefix:null,property:null,results:De,security:null,unselectable:null}}),xce=du({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:GI,properties:{about:Gr,accentHeight:De,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:De,amplitude:De,arabicForm:null,ascent:De,attributeName:null,attributeType:null,azimuth:De,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:De,by:null,calcMode:null,capHeight:De,className:on,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:De,diffuseConstant:De,direction:null,display:null,dur:null,divisor:De,dominantBaseline:null,download:mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:De,enableBackground:null,end:null,event:null,exponent:De,externalResourcesRequired:null,fill:null,fillOpacity:De,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:wc,g2:wc,glyphName:wc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:De,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:De,horizOriginX:De,horizOriginY:De,id:null,ideographic:De,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:De,k:De,k1:De,k2:De,k3:De,k4:De,kernelMatrix:Gr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:De,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:De,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:De,overlineThickness:De,paintOrder:null,panose1:null,path:null,pathLength:De,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:on,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:De,pointsAtY:De,pointsAtZ:De,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gr,rev:Gr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gr,requiredFeatures:Gr,requiredFonts:Gr,requiredFormats:Gr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:De,specularExponent:De,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:De,strikethroughThickness:De,string:null,stroke:null,strokeDashArray:Gr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:De,strokeOpacity:De,strokeWidth:null,style:null,surfaceScale:De,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gr,tabIndex:De,tableValues:null,target:null,targetX:De,targetY:De,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:De,underlineThickness:De,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:De,values:null,vAlphabetic:De,vMathematical:De,vectorEffect:null,vHanging:De,vIdeographic:De,version:null,vertAdvY:De,vertOriginX:De,vertOriginY:De,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:De,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),wce=/^data[-\w.:]+$/i,ET=/-[a-z]/g,_ce=/[A-Z]/g;function Sce(e,t){const n=Qx(t);let r=t,o=No;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&wce.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ET,Ece);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ET.test(i)){let s=i.replace(_ce,Cce);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=N_}return new o(r,t)}function Cce(e){return"-"+e.toLowerCase()}function Ece(e){return e.charAt(1).toUpperCase()}const Rce={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"},Oce=HI([qI,UI,KI,XI,yce],"html"),L_=HI([qI,UI,KI,XI,xce],"svg");function Pce(e){return e.join(" ").trim()}var QI={},RT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Tce=/\n/g,Dce=/^\s*/,Ace=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$ce=/^:\s*/,kce=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Mce=/^[;\s]*/,Ice=/^\s+|\s+$/g,Nce=`
|
|
400
400
|
`,OT="/",PT="*",Wa="",Lce="comment",Fce="declaration",jce=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(v){var b=v.match(Tce);b&&(n+=b.length);var w=v.lastIndexOf(Nce);r=~w?v.length-w:r+v.length}function i(){var v={line:n,column:r};return function(b){return b.position=new s(v),c(),b}}function s(v){this.start=v,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(v){var b=new Error(t.source+":"+n+":"+r+": "+v);if(b.reason=v,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(v){var b=v.exec(e);if(b){var w=b[0];return o(w),e=e.slice(w.length),b}}function c(){l(Dce)}function u(v){var b;for(v=v||[];b=f();)b!==!1&&v.push(b);return v}function f(){var v=i();if(!(OT!=e.charAt(0)||PT!=e.charAt(1))){for(var b=2;Wa!=e.charAt(b)&&(PT!=e.charAt(b)||OT!=e.charAt(b+1));)++b;if(b+=2,Wa===e.charAt(b-1))return a("End of comment missing");var w=e.slice(2,b-2);return r+=2,o(w),e=e.slice(b),r+=2,v({type:Lce,comment:w})}}function h(){var v=i(),b=l(Ace);if(b){if(f(),!l($ce))return a("property missing ':'");var w=l(kce),x=v({type:Fce,property:TT(b[0].replace(RT,Wa)),value:w?TT(w[0].replace(RT,Wa)):Wa});return l(Mce),x}}function g(){var v=[];u(v);for(var b;b=h();)b!==!1&&(v.push(b),u(v));return v}return c(),g()};function TT(e){return e?e.replace(Ice,Wa):Wa}var zce=Vs&&Vs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(QI,"__esModule",{value:!0});var Bce=zce(jce);function Vce(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Bce.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var s=i.property,a=i.value;o?t(s,a,i):a&&(n=n||{},n[s]=a)}}),n}var DT=QI.default=Vce;const Hce=DT.default||DT,JI=ZI("end"),F_=ZI("start");function ZI(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 Wce(e){const t=F_(e),n=JI(e);if(t&&n)return{start:t,end:n}}function _d(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?AT(e.position):"start"in e||"end"in e?AT(e):"line"in e||"column"in e?Zx(e):""}function Zx(e){return $T(e&&e.line)+":"+$T(e&&e.column)}function AT(e){return Zx(e&&e.start)+"-"+Zx(e&&e.end)}function $T(e){return e&&typeof e=="number"?e:1}class dr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=a?a.line:void 0,this.name=_d(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}dr.prototype.file="";dr.prototype.name="";dr.prototype.reason="";dr.prototype.message="";dr.prototype.stack="";dr.prototype.column=void 0;dr.prototype.line=void 0;dr.prototype.ancestors=void 0;dr.prototype.cause=void 0;dr.prototype.fatal=void 0;dr.prototype.place=void 0;dr.prototype.ruleId=void 0;dr.prototype.source=void 0;const j_={}.hasOwnProperty,Uce=new Map,qce=/[A-Z]/g,Gce=/-([a-z])/g,Yce=new Set(["table","tbody","thead","tfoot","tr"]),Kce=new Set(["td","th"]),eN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Xce(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=oue(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=rue(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?L_:Oce,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=tN(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function tN(e,t,n){if(t.type==="element")return Qce(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Jce(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eue(e,t,n);if(t.type==="mdxjsEsm")return Zce(e,t);if(t.type==="root")return tue(e,t,n);if(t.type==="text")return nue(e,t)}function Qce(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=L_,e.schema=o),e.ancestors.push(t);const i=rN(e,t.tagName,!1),s=iue(e,t);let a=B_(e,t);return Yce.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!mce(l):!0})),nN(e,s,i,t),z_(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Jce(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)}lf(e,t.position)}function Zce(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lf(e,t.position)}function eue(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=L_,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:rN(e,t.name,!0),s=sue(e,t),a=B_(e,t);return nN(e,s,i,t),z_(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function tue(e,t,n){const r={};return z_(r,B_(e,t)),e.create(t,e.Fragment,r,n)}function nue(e,t){return t.value}function nN(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function z_(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function rue(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function oue(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=F_(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function iue(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&j_.call(t.properties,o)){const i=aue(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Kce.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function sue(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else lf(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else lf(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function B_(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Uce;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=tN(e,i,s);a!==void 0&&n.push(a)}return n}function aue(e,t,n){const r=Sce(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?dce(n):Pce(n)),r.property==="style"){let o=typeof n=="object"?n:lue(e,String(n));return e.stylePropertyNameCase==="css"&&(o=cue(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?Rce[r.property]||r.property:r.attribute,n]}}function lue(e,t){const n={};try{Hce(t,r)}catch(o){if(!e.ignoreInvalidStyle){const i=o,s=new dr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=eN+"#cannot-parse-style-attribute",s}}return n;function r(o,i){let s=o;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(Gce,due)),n[s]=i}}function rN(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=_T(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=_T(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return j_.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);lf(e)}function lf(e,t){const n=new dr("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=eN+"#cannot-handle-mdx-estrees-without-createevaluater",n}function cue(e){const t={};let n;for(n in e)j_.call(e,n)&&(t[uue(n)]=e[n]);return t}function uue(e){let t=e.replace(qce,fue);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function due(e,t){return t.toUpperCase()}function fue(e){return"-"+e.toLowerCase()}const Uy={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"]},hue={};function pue(e,t){const n=t||hue,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return oN(e,r,o)}function oN(e,t,n){if(gue(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 kT(e.children,t,n)}return Array.isArray(e)?kT(e,t,n):""}function kT(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=oN(e[o],t,n);return r.join("")}function gue(e){return!!(e&&typeof e=="object")}const MT=document.createElement("i");function V_(e){const t="&"+e+";";MT.innerHTML=t;const n=MT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ei(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function Do(e,t){return e.length>0?(Ei(e,e.length,0,t),e):t}const IT={}.hasOwnProperty;function mue(e){const t={};let n=-1;for(;++n<e.length;)vue(t,e[n]);return t}function vue(e,t){let n;for(n in t){const o=(IT.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){IT.call(o,s)||(o[s]=[]);const a=i[s];bue(o[s],Array.isArray(a)?a:a?[a]:[])}}}function bue(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ei(e,0,0,r)}function iN(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 _c(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yue=va(new RegExp("\\p{P}","u")),vi=va(/[A-Za-z]/),oo=va(/[\dA-Za-z]/),xue=va(/[#-'*+\--9=?A-Z^-~]/);function ew(e){return e!==null&&(e<32||e===127)}const tw=va(/\d/),wue=va(/[\dA-Fa-f]/),sN=va(/[!-/:-@[-`{-~]/);function ot(e){return e!==null&&e<-2}function Fr(e){return e!==null&&(e<0||e===32)}function Vt(e){return e===-2||e===-1||e===32}function _ue(e){return sN(e)||yue(e)}const Sue=va(/\s/);function va(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function fu(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&oo(e.charCodeAt(n+1))&&oo(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function sn(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Vt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Vt(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const Cue={tokenize:Eue};function Eue(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),sn(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ot(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const Rue={tokenize:Oue},NT={tokenize:Pue};function Oue(e){const t=this,n=[];let r=0,o,i,s;return a;function a(S){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,l,c)(S)}return c(S)}function l(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&_();const C=t.events.length;let E=C,P;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){P=t.events[E][1].end;break}x(r);let A=C;for(;A<t.events.length;)t.events[A][1].end=Object.assign({},P),A++;return Ei(t.events,E+1,0,t.events.slice(C)),t.events.length=A,c(S)}return a(S)}function c(S){if(r===n.length){if(!o)return h(S);if(o.currentConstruct&&o.currentConstruct.concrete)return v(S);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(NT,u,f)(S)}function u(S){return o&&_(),x(r),h(S)}function f(S){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,v(S)}function h(S){return t.containerState={},e.attempt(NT,g,v)(S)}function g(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function v(S){if(S===null){o&&_(),x(0),e.consume(S);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:o}),b(S)}function b(S){if(S===null){w(e.exit("chunkFlow"),!0),x(0),e.consume(S);return}return ot(S)?(e.consume(S),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(S),b)}function w(S,C){const E=t.sliceStream(S);if(C&&E.push(null),S.previous=i,i&&(i.next=S),i=S,o.defineSkip(S.start),o.write(E),t.parser.lazy[S.start.line]){let P=o.events.length;for(;P--;)if(o.events[P][1].start.offset<s&&(!o.events[P][1].end||o.events[P][1].end.offset>s))return;const A=t.events.length;let k=A,I,$;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(I){$=t.events[k][1].end;break}I=!0}for(x(r),P=A;P<t.events.length;)t.events[P][1].end=Object.assign({},$),P++;Ei(t.events,k+1,0,t.events.slice(A)),t.events.length=P}}function x(S){let C=n.length;for(;C-- >S;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=S}function _(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Pue(e,t,n){return sn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function LT(e){if(e===null||Fr(e)||Sue(e))return 1;if(_ue(e))return 2}function H_(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const nw={name:"attention",tokenize:Due,resolveAll:Tue};function Tue(e,t){let n=-1,r,o,i,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);FT(f,-l),FT(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Do(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Do(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=Do(c,H_(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Do(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Do(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Ei(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 Due(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=LT(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=LT(l),f=!u||u===2&&o||n.includes(l),h=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(o||!h)),c._close=!!(i===42?h:h&&(u||!f)),t(l)}}function FT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Aue={name:"autolink",tokenize:$ue};function $ue(e,t,n){let r=0;return o;function o(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(g){return vi(g)?(e.consume(g),s):c(g)}function s(g){return g===43||g===45||g===46||oo(g)?(r=1,a(g)):c(g)}function a(g){return g===58?(e.consume(g),r=0,l):(g===43||g===45||g===46||oo(g))&&r++<32?(e.consume(g),a):(r=0,c(g))}function l(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||ew(g)?n(g):(e.consume(g),l)}function c(g){return g===64?(e.consume(g),u):xue(g)?(e.consume(g),c):n(g)}function u(g){return oo(g)?f(g):n(g)}function f(g){return g===46?(e.consume(g),r=0,u):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):h(g)}function h(g){if((g===45||oo(g))&&r++<63){const v=g===45?h:f;return e.consume(g),v}return n(g)}}const ov={tokenize:kue,partial:!0};function kue(e,t,n){return r;function r(i){return Vt(i)?sn(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||ot(i)?t(i):n(i)}}const aN={name:"blockQuote",tokenize:Mue,continuation:{tokenize:Iue},exit:Nue};function Mue(e,t,n){const r=this;return o;function o(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return Vt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Iue(e,t,n){const r=this;return o;function o(s){return Vt(s)?sn(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(aN,t,n)(s)}}function Nue(e){e.exit("blockQuote")}const lN={name:"characterEscape",tokenize:Lue};function Lue(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return sN(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const cN={name:"characterReference",tokenize:Fue};function Fue(e,t,n){const r=this;let o=0,i,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=oo,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=wue,u):(e.enter("characterReferenceValue"),i=7,s=tw,u(f))}function u(f){if(f===59&&o){const h=e.exit("characterReferenceValue");return s===oo&&!V_(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&o++<i?(e.consume(f),u):n(f)}}const jT={tokenize:zue,partial:!0},zT={name:"codeFenced",tokenize:jue,concrete:!0};function jue(e,t,n){const r=this,o={tokenize:E,partial:!0};let i=0,s=0,a;return l;function l(P){return c(P)}function c(P){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(P)}function u(P){return P===a?(s++,e.consume(P),u):s<3?n(P):(e.exit("codeFencedFenceSequence"),Vt(P)?sn(e,f,"whitespace")(P):f(P))}function f(P){return P===null||ot(P)?(e.exit("codeFencedFence"),r.interrupt?t(P):e.check(jT,b,C)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(P))}function h(P){return P===null||ot(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(P)):Vt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),sn(e,g,"whitespace")(P)):P===96&&P===a?n(P):(e.consume(P),h)}function g(P){return P===null||ot(P)?f(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(P))}function v(P){return P===null||ot(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(P)):P===96&&P===a?n(P):(e.consume(P),v)}function b(P){return e.attempt(o,C,w)(P)}function w(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),x}function x(P){return i>0&&Vt(P)?sn(e,_,"linePrefix",i+1)(P):_(P)}function _(P){return P===null||ot(P)?e.check(jT,b,C)(P):(e.enter("codeFlowValue"),S(P))}function S(P){return P===null||ot(P)?(e.exit("codeFlowValue"),_(P)):(e.consume(P),S)}function C(P){return e.exit("codeFenced"),t(P)}function E(P,A,k){let I=0;return $;function $(B){return P.enter("lineEnding"),P.consume(B),P.exit("lineEnding"),L}function L(B){return P.enter("codeFencedFence"),Vt(B)?sn(P,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):j(B)}function j(B){return B===a?(P.enter("codeFencedFenceSequence"),Q(B)):k(B)}function Q(B){return B===a?(I++,P.consume(B),Q):I>=s?(P.exit("codeFencedFenceSequence"),Vt(B)?sn(P,ee,"whitespace")(B):ee(B)):k(B)}function ee(B){return B===null||ot(B)?(P.exit("codeFencedFence"),A(B)):k(B)}}}function zue(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const qy={name:"codeIndented",tokenize:Vue},Bue={tokenize:Hue,partial:!0};function Vue(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),sn(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):ot(c)?e.attempt(Bue,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||ot(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function Hue(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):ot(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):sn(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ot(s)?o(s):n(s)}}const Wue={name:"codeText",tokenize:Gue,resolve:Uue,previous:que};function Uue(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function que(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Gue(e,t,n){let r=0,o,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),o=0,u(f)):ot(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||ot(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}function uN(e){const t={};let n=-1,r,o,i,s,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Yue(e,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--&&(s=e[i],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(o&&(e[o][1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);o&&(r[1].end=Object.assign({},e[o][1].start),a=e.slice(o,n),a.unshift(r),Ei(e,o,n-o+1,a))}}return!c}function Yue(e,t){const n=e[t][1],r=e[t][2];let o=t-1;const i=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let u,f,h=-1,g=n,v=0,b=0;const w=[b];for(;g;){for(;e[++o][1]!==g;);i.push(o),g._tokenizer||(u=r.sliceStream(g),g.next||u.push(null),f&&s.defineSkip(g.start),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=g,g=g.next}for(g=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(b=h+1,w.push(b),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(s.events=[],g?(g._tokenizer=void 0,g.previous=void 0):w.pop(),h=w.length;h--;){const x=a.slice(w[h],w[h+1]),_=i.pop();l.unshift([_,_+x.length-1]),Ei(e,_,2,x)}for(h=-1;++h<l.length;)c[v+l[h][0]]=v+l[h][1],v+=l[h][1]-l[h][0]-1;return c}const Kue={tokenize:Jue,resolve:Que},Xue={tokenize:Zue,partial:!0};function Que(e){return uN(e),e}function Jue(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):ot(a)?e.check(Xue,s,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function Zue(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),sn(e,i,"linePrefix")}function i(s){if(s===null||ot(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 dN(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(x){return x===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(x),e.exit(i),h):x===null||x===32||x===41||ew(x)?n(x):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(x))}function h(x){return x===62?(e.enter(i),e.consume(x),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===62?(e.exit("chunkString"),e.exit(a),h(x)):x===null||x===60||ot(x)?n(x):(e.consume(x),x===92?v:g)}function v(x){return x===60||x===62||x===92?(e.consume(x),g):g(x)}function b(x){return!u&&(x===null||x===41||Fr(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||ew(x)?n(x):(e.consume(x),x===92?w:b)}function w(x){return x===40||x===41||x===92?(e.consume(x),b):b(x)}}function fN(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(g){return e.enter(r),e.enter(o),e.consume(g),e.exit(o),e.enter(i),u}function u(g){return a>999||g===null||g===91||g===93&&!l||g===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(g):g===93?(e.exit(i),e.enter(o),e.consume(g),e.exit(o),e.exit(r),t):ot(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||ot(g)||a++>999?(e.exit("chunkString"),u(g)):(e.consume(g),l||(l=!Vt(g)),g===92?h:f)}function h(g){return g===91||g===92||g===93?(e.consume(g),a++,f):f(g)}}function hN(e,t,n,r,o,i){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(o),e.consume(h),e.exit(o),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):(e.enter(i),c(h))}function c(h){return h===s?(e.exit(i),l(s)):h===null?n(h):ot(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),sn(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||ot(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:u)}function f(h){return h===s||h===92?(e.consume(h),u):u(h)}}function Sd(e,t){let n;return r;function r(o){return ot(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Vt(o)?sn(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const ede={name:"definition",tokenize:nde},tde={tokenize:rde,partial:!0};function nde(e,t,n){const r=this;let o;return i;function i(g){return e.enter("definition"),s(g)}function s(g){return fN.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function a(g){return o=_c(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),l):n(g)}function l(g){return Fr(g)?Sd(e,c)(g):c(g)}function c(g){return dN(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function u(g){return e.attempt(tde,f,f)(g)}function f(g){return Vt(g)?sn(e,h,"whitespace")(g):h(g)}function h(g){return g===null||ot(g)?(e.exit("definition"),r.parser.defined.push(o),t(g)):n(g)}}function rde(e,t,n){return r;function r(a){return Fr(a)?Sd(e,o)(a):n(a)}function o(a){return hN(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Vt(a)?sn(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ot(a)?t(a):n(a)}}const ode={name:"hardBreakEscape",tokenize:ide};function ide(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return ot(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const sde={name:"headingAtx",tokenize:lde,resolve:ade};function ade(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ei(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function lde(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||Fr(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ot(u)?(e.exit("atxHeading"),t(u)):Vt(u)?sn(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||Fr(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const cde=["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"],BT=["pre","script","style","textarea"],ude={name:"htmlFlow",tokenize:pde,resolveTo:hde,concrete:!0},dde={tokenize:mde,partial:!0},fde={tokenize:gde,partial:!0};function hde(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 pde(e,t,n){const r=this;let o,i,s,a,l;return c;function c(N){return u(N)}function u(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),i=!0,b):N===63?(e.consume(N),o=3,r.interrupt?t:T):vi(N)?(e.consume(N),s=String.fromCharCode(N),w):n(N)}function h(N){return N===45?(e.consume(N),o=2,g):N===91?(e.consume(N),o=5,a=0,v):vi(N)?(e.consume(N),o=4,r.interrupt?t:T):n(N)}function g(N){return N===45?(e.consume(N),r.interrupt?t:T):n(N)}function v(N){const ie="CDATA[";return N===ie.charCodeAt(a++)?(e.consume(N),a===ie.length?r.interrupt?t:j:v):n(N)}function b(N){return vi(N)?(e.consume(N),s=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||Fr(N)){const ie=N===47,fe=s.toLowerCase();return!ie&&!i&&BT.includes(fe)?(o=1,r.interrupt?t(N):j(N)):cde.includes(s.toLowerCase())?(o=6,ie?(e.consume(N),x):r.interrupt?t(N):j(N)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?_(N):S(N))}return N===45||oo(N)?(e.consume(N),s+=String.fromCharCode(N),w):n(N)}function x(N){return N===62?(e.consume(N),r.interrupt?t:j):n(N)}function _(N){return Vt(N)?(e.consume(N),_):$(N)}function S(N){return N===47?(e.consume(N),$):N===58||N===95||vi(N)?(e.consume(N),C):Vt(N)?(e.consume(N),S):$(N)}function C(N){return N===45||N===46||N===58||N===95||oo(N)?(e.consume(N),C):E(N)}function E(N){return N===61?(e.consume(N),P):Vt(N)?(e.consume(N),E):S(N)}function P(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,A):Vt(N)?(e.consume(N),P):k(N)}function A(N){return N===l?(e.consume(N),l=null,I):N===null||ot(N)?n(N):(e.consume(N),A)}function k(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Fr(N)?E(N):(e.consume(N),k)}function I(N){return N===47||N===62||Vt(N)?S(N):n(N)}function $(N){return N===62?(e.consume(N),L):n(N)}function L(N){return N===null||ot(N)?j(N):Vt(N)?(e.consume(N),L):n(N)}function j(N){return N===45&&o===2?(e.consume(N),Z):N===60&&o===1?(e.consume(N),G):N===62&&o===4?(e.consume(N),V):N===63&&o===3?(e.consume(N),T):N===93&&o===5?(e.consume(N),K):ot(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(dde,X,Q)(N)):N===null||ot(N)?(e.exit("htmlFlowData"),Q(N)):(e.consume(N),j)}function Q(N){return e.check(fde,ee,X)(N)}function ee(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),B}function B(N){return N===null||ot(N)?Q(N):(e.enter("htmlFlowData"),j(N))}function Z(N){return N===45?(e.consume(N),T):j(N)}function G(N){return N===47?(e.consume(N),s="",q):j(N)}function q(N){if(N===62){const ie=s.toLowerCase();return BT.includes(ie)?(e.consume(N),V):j(N)}return vi(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),q):j(N)}function K(N){return N===93?(e.consume(N),T):j(N)}function T(N){return N===62?(e.consume(N),V):N===45&&o===2?(e.consume(N),T):j(N)}function V(N){return N===null||ot(N)?(e.exit("htmlFlowData"),X(N)):(e.consume(N),V)}function X(N){return e.exit("htmlFlow"),t(N)}}function gde(e,t,n){const r=this;return o;function o(s){return ot(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function mde(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(ov,t,n)}}const vde={name:"htmlText",tokenize:bde};function bde(e,t,n){const r=this;let o,i,s;return a;function a(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),l}function l(T){return T===33?(e.consume(T),c):T===47?(e.consume(T),E):T===63?(e.consume(T),S):vi(T)?(e.consume(T),k):n(T)}function c(T){return T===45?(e.consume(T),u):T===91?(e.consume(T),i=0,v):vi(T)?(e.consume(T),_):n(T)}function u(T){return T===45?(e.consume(T),g):n(T)}function f(T){return T===null?n(T):T===45?(e.consume(T),h):ot(T)?(s=f,G(T)):(e.consume(T),f)}function h(T){return T===45?(e.consume(T),g):f(T)}function g(T){return T===62?Z(T):T===45?h(T):f(T)}function v(T){const V="CDATA[";return T===V.charCodeAt(i++)?(e.consume(T),i===V.length?b:v):n(T)}function b(T){return T===null?n(T):T===93?(e.consume(T),w):ot(T)?(s=b,G(T)):(e.consume(T),b)}function w(T){return T===93?(e.consume(T),x):b(T)}function x(T){return T===62?Z(T):T===93?(e.consume(T),x):b(T)}function _(T){return T===null||T===62?Z(T):ot(T)?(s=_,G(T)):(e.consume(T),_)}function S(T){return T===null?n(T):T===63?(e.consume(T),C):ot(T)?(s=S,G(T)):(e.consume(T),S)}function C(T){return T===62?Z(T):S(T)}function E(T){return vi(T)?(e.consume(T),P):n(T)}function P(T){return T===45||oo(T)?(e.consume(T),P):A(T)}function A(T){return ot(T)?(s=A,G(T)):Vt(T)?(e.consume(T),A):Z(T)}function k(T){return T===45||oo(T)?(e.consume(T),k):T===47||T===62||Fr(T)?I(T):n(T)}function I(T){return T===47?(e.consume(T),Z):T===58||T===95||vi(T)?(e.consume(T),$):ot(T)?(s=I,G(T)):Vt(T)?(e.consume(T),I):Z(T)}function $(T){return T===45||T===46||T===58||T===95||oo(T)?(e.consume(T),$):L(T)}function L(T){return T===61?(e.consume(T),j):ot(T)?(s=L,G(T)):Vt(T)?(e.consume(T),L):I(T)}function j(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),o=T,Q):ot(T)?(s=j,G(T)):Vt(T)?(e.consume(T),j):(e.consume(T),ee)}function Q(T){return T===o?(e.consume(T),o=void 0,B):T===null?n(T):ot(T)?(s=Q,G(T)):(e.consume(T),Q)}function ee(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Fr(T)?I(T):(e.consume(T),ee)}function B(T){return T===47||T===62||Fr(T)?I(T):n(T)}function Z(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function G(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),q}function q(T){return Vt(T)?sn(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):K(T)}function K(T){return e.enter("htmlTextData"),s(T)}}const W_={name:"labelEnd",tokenize:Cde,resolveTo:Sde,resolveAll:_de},yde={tokenize:Ede},xde={tokenize:Rde},wde={tokenize:Ode};function _de(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function Sde(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[s][1].end)},u={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=Do(a,e.slice(i+1,i+r+3)),a=Do(a,[["enter",u,t]]),a=Do(a,H_(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=Do(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=Do(a,e.slice(s+1)),a=Do(a,[["exit",l,t]]),Ei(e,i,e.length,a),e}function Cde(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(h){return i?i._inactive?f(h):(s=r.parser.defined.includes(_c(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(yde,u,s?u:f)(h):h===91?e.attempt(xde,u,s?c:f)(h):s?u(h):f(h)}function c(h){return e.attempt(wde,u,f)(h)}function u(h){return t(h)}function f(h){return i._balanced=!0,n(h)}}function Ede(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return Fr(f)?Sd(e,i)(f):i(f)}function i(f){return f===41?u(f):dN(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Fr(f)?Sd(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?hN(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Fr(f)?Sd(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Rde(e,t,n){const r=this;return o;function o(a){return fN.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(_c(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Ode(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const Pde={name:"labelStartImage",tokenize:Tde,resolveAll:W_.resolveAll};function Tde(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Dde={name:"labelStartLink",tokenize:Ade,resolveAll:W_.resolveAll};function Ade(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Gy={name:"lineEnding",tokenize:$de};function $de(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),sn(e,t,"linePrefix")}}const lg={name:"thematicBreak",tokenize:kde};function kde(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ot(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Vt(c)?sn(e,a,"whitespace")(c):a(c))}}const Dr={name:"list",tokenize:Nde,continuation:{tokenize:Lde},exit:jde},Mde={tokenize:zde,partial:!0},Ide={tokenize:Fde,partial:!0};function Nde(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(g){const v=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:tw(g)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(lg,n,c)(g):c(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(g)}return n(g)}function l(g){return tw(g)&&++s<10?(e.consume(g),l):(!r.interrupt||s<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):n(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(ov,r.interrupt?n:u,e.attempt(Mde,h,f))}function u(g){return r.containerState.initialBlankLine=!0,i++,h(g)}function f(g){return Vt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),h):n(g)}function h(g){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function Lde(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ov,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,sn(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Vt(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(Ide,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,sn(e,e.attempt(Dr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Fde(e,t,n){const r=this;return sn(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function jde(e){e.exit(this.containerState.type)}function zde(e,t,n){const r=this;return sn(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Vt(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const VT={name:"setextUnderline",tokenize:Vde,resolveTo:Bde};function Bde(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function Vde(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Vt(c)?sn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ot(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Hde={tokenize:Wde};function Wde(e){const t=this,n=e.attempt(ov,r,e.attempt(this.parser.constructs.flowInitial,o,sn(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Kue,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Ude={resolveAll:gN()},qde=pN("string"),Gde=pN("text");function pN(e){return{tokenize:t,resolveAll:gN(e==="text"?Yde:void 0)};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=o[u];let h=-1;if(f)for(;++h<f.length;){const g=f[h];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function gN(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function Yde(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+i,_bufferIndex:i?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function Kde(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},i=[];let s=[],a=[];const l={consume:_,enter:S,exit:C,attempt:A(E),check:A(P),interrupt:A(P,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:g,sliceSerialize:h,now:v,defineSkip:b,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(L){return s=Do(s,L),w(),s[s.length-1]!==null?[]:(k(t,0),c.events=H_(i,c.events,c),c.events)}function h(L,j){return Qde(g(L),j)}function g(L){return Xde(s,L)}function v(){const{line:L,column:j,offset:Q,_index:ee,_bufferIndex:B}=r;return{line:L,column:j,offset:Q,_index:ee,_bufferIndex:B}}function b(L){o[L.line]=L.column,$()}function w(){let L;for(;r._index<s.length;){const j=s[r._index];if(typeof j=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<j.length;)x(j.charCodeAt(r._bufferIndex));else x(j)}}function x(L){u=u(L)}function _(L){ot(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,$()):L!==-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=L}function S(L,j){const Q=j||{};return Q.type=L,Q.start=v(),c.events.push(["enter",Q,c]),a.push(Q),Q}function C(L){const j=a.pop();return j.end=v(),c.events.push(["exit",j,c]),j}function E(L,j){k(L,j.from)}function P(L,j){j.restore()}function A(L,j){return Q;function Q(ee,B,Z){let G,q,K,T;return Array.isArray(ee)?X(ee):"tokenize"in ee?X([ee]):V(ee);function V(ue){return pe;function pe(se){const ne=se!==null&&ue[se],le=se!==null&&ue.null,ye=[...Array.isArray(ne)?ne:ne?[ne]:[],...Array.isArray(le)?le:le?[le]:[]];return X(ye)(se)}}function X(ue){return G=ue,q=0,ue.length===0?Z:N(ue[q])}function N(ue){return pe;function pe(se){return T=I(),K=ue,ue.partial||(c.currentConstruct=ue),ue.name&&c.parser.constructs.disable.null.includes(ue.name)?fe():ue.tokenize.call(j?Object.assign(Object.create(c),j):c,l,ie,fe)(se)}}function ie(ue){return L(K,T),B}function fe(ue){return T.restore(),++q<G.length?N(G[q]):Z}}}function k(L,j){L.resolveAll&&!i.includes(L)&&i.push(L),L.resolve&&Ei(c.events,j,c.events.length-j,L.resolve(c.events.slice(j),c)),L.resolveTo&&(c.events=L.resolveTo(c.events,c))}function I(){const L=v(),j=c.previous,Q=c.currentConstruct,ee=c.events.length,B=Array.from(a);return{restore:Z,from:ee};function Z(){r=L,c.previous=j,c.currentConstruct=Q,c.events.length=ee,a=B,$()}}function $(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function Xde(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function Qde(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
@@ -409,7 +409,7 @@ Check the top-level render call using <`+ce+">.")}return te}}function ni(D,te){{
|
|
|
409
409
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
410
410
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
411
411
|
`}),n}function JT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ZT(e,t){const n=ahe(e,t),r=n.one(e,void 0),o=Xfe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
|
|
412
|
-
`},o),i}function fhe(e,t){return e&&"run"in e?async function(n,r){const o=ZT(n,{file:r,...t});await e.run(o,r)}:function(n,r){return ZT(n,{file:r,...t||e})}}function e2(e){if(e)throw e}var cg=Object.prototype.hasOwnProperty,RN=Object.prototype.toString,t2=Object.defineProperty,n2=Object.getOwnPropertyDescriptor,r2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):RN.call(t)==="[object Array]"},o2=function(t){if(!t||RN.call(t)!=="[object Object]")return!1;var n=cg.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&cg.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||cg.call(t,o)},i2=function(t,n){t2&&n.name==="__proto__"?t2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},s2=function(t,n){if(n==="__proto__")if(cg.call(t,n)){if(n2)return n2(t,n).value}else return;return t[n]},hhe=function e(){var t,n,r,o,i,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=s2(a,n),o=s2(t,n),a!==o&&(u&&o&&(o2(o)||(i=r2(o)))?(i?(i=!1,s=r&&r2(r)?r:[]):s=r&&o2(r)?r:{},i2(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&i2(a,{name:n,newValue:o}));return a};const Yy=nu(hhe);function ow(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 phe(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let f=-1;if(l){s(l);return}for(;++f<o.length;)(c[f]===null||c[f]===void 0)&&(c[f]=o[f]);o=c,u?ghe(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function ghe(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l instanceof Promise?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const di={basename:mhe,dirname:vhe,extname:bhe,join:yhe,sep:"/"};function mhe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Zf(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function vhe(e){if(Zf(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 bhe(e){Zf(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function yhe(...e){let t=-1,n;for(;++t<e.length;)Zf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":xhe(n)}function xhe(e){Zf(e);const t=e.codePointAt(0)===47;let n=whe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function whe(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function Zf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _he={cwd:She};function She(){return"/"}function iw(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Che(e){if(typeof e=="string")e=new URL(e);else if(!iw(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 Ehe(e)}function Ehe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Ky=["history","path","basename","stem","extname","dirname"];class ON{constructor(t){let n;t?iw(t)?n={path:t}:typeof t=="string"||Rhe(t)?n={value:t}:n=t:n={},this.cwd=_he.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ky.length;){const i=Ky[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)Ky.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?di.basename(this.path):void 0}set basename(t){Qy(t,"basename"),Xy(t,"basename"),this.path=di.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?di.dirname(this.path):void 0}set dirname(t){a2(this.basename,"dirname"),this.path=di.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?di.extname(this.path):void 0}set extname(t){if(Xy(t,"extname"),a2(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=di.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){iw(t)&&(t=Che(t)),Qy(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?di.basename(this.path,this.extname):void 0}set stem(t){Qy(t,"stem"),Xy(t,"stem"),this.path=di.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new dr(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Xy(e,t){if(e&&e.includes(di.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+di.sep+"`")}function Qy(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function a2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Rhe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ohe=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};Object.setPrototypeOf(i,r);const s=Object.getOwnPropertyNames(o);for(const a of s){const l=Object.getOwnPropertyDescriptor(o,a);l&&Object.defineProperty(i,a,l)}return i},Phe={}.hasOwnProperty;class K_ extends Ohe{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=phe()}copy(){const t=new K_;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Yy(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(e0("data",this.frozen),this.namespace[t]=n,this):Phe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(e0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Fp(t),r=this.parser||this.Parser;return Jy("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Jy("process",this.parser||this.Parser),Zy("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Fp(t),l=r.parse(a);r.run(l,a,function(u,f,h){if(u||!f||!h)return c(u);const g=f,v=r.stringify(g,h);Ahe(v)?h.value=v:h.result=v,c(u,h)});function c(u,f){u||!f?s(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Jy("processSync",this.parser||this.Parser),Zy("processSync",this.compiler||this.Compiler),this.process(t,o),c2("processSync","process",n),r;function o(i,s){n=!0,e2(i),r=s}}run(t,n,r){l2(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Fp(n);o.run(t,l,c);function c(u,f,h){const g=f||t;u?a(u):s?s(g):r(void 0,g,h)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),c2("runSync","run",r),o;function i(s,a){e2(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Fp(n),o=this.compiler||this.Compiler;return Zy("stringify",o),l2(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(e0("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=Yy(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[g,...v]=u;const b=r[h][1];ow(b)&&ow(g)&&(g=Yy(!0,b,g)),r[h]=[c,g,...v]}}}}const The=new K_().freeze();function Jy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Zy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function e0(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 l2(e){if(!ow(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function c2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Fp(e){return Dhe(e)?e:new ON(e)}function Dhe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ahe(e){return typeof e=="string"||$he(e)}function $he(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const khe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",u2=[],d2={allowDangerousHtml:!0},Mhe=/^(https?|ircs?|mailto|xmpp)$/i,Ihe=[{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 PN(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||u2,l=e.remarkPlugins||u2,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...d2}:d2,u=e.skipHtml,f=e.unwrapDisallowed,h=e.urlTransform||Nhe,g=The().use(vfe).use(l).use(fhe,c).use(a),v=new ON;typeof r=="string"&&(v.value=r);for(const _ of Ihe)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+khe+_.id,void 0);const b=g.parse(v);let w=g.runSync(b,v);return o&&(w={type:"element",tagName:"div",properties:{className:o},children:w.type==="root"?w.children:[w]}),EN(w,x),Xce(w,{Fragment:O.Fragment,components:i,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0});function x(_,S,C){if(_.type==="raw"&&C&&typeof S=="number")return u?C.children.splice(S,1):C.children[S]={type:"text",value:_.value},S;if(_.type==="element"){let E;for(E in Uy)if(Object.hasOwn(Uy,E)&&Object.hasOwn(_.properties,E)){const P=_.properties[E],A=Uy[E];(A===null||A.includes(_.tagName))&&(_.properties[E]=h(String(P||""),E,_))}}if(_.type==="element"){let E=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!E&&n&&typeof S=="number"&&(E=!n(_,S,C)),E&&C&&typeof S=="number")return f&&_.children?C.children.splice(S,1,..._.children):C.children.splice(S,1),S}}}function Nhe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t<0||o>-1&&t>o||n>-1&&t>n||r>-1&&t>r||Mhe.test(e.slice(0,t))?e:""}function Lhe(){const e=m.useRef(null),[t,n]=m.useState(""),[r,o]=m.useState(!1),i=$e(I=>I.dashboard.aiScopeTables);Dm();const s=$e(I=>I.selectedSheetId),{addFrame:a,setSelectedFrameId:l,setIsDashboardEditing:c}=co(),{authToken:u}=ma(),f=wD(),{messages:h,input:g,handleInputChange:v,handleSubmit:b,addToolResult:w,stop:x,isLoading:_}=Fle({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},maxToolRoundtrips:5,async onToolCall({toolCall:I}){if(C(I.toolName),I.toolName==="getLocation"){const $=["New York","Los Angeles","Chicago","San Francisco"];return $[Math.floor(Math.random()*$.length)]}if(I.toolName==="getTables")return JSON.stringify(i||[]);if(I.toolName==="getData"){console.log(I.args);const $=I.args;if(!($!=null&&$.sql)||!($!=null&&$.connectionId))return"Please provide sql, connectionId and table";const L=await f.fetchQuery({queryKey:["chat",$.connectionId,$.sql],queryFn:()=>Of("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:$.connectionId,sql:$.sql})});return n("Summarizing"),JSON.stringify(L)}},onFinish(I,$){console.log("onFinish",I,$),I.content&&n("")}}),S=()=>{var I;(I=e.current)==null||I.scrollIntoView({behavior:"smooth"})};m.useEffect(()=>{S()},[h]);function C(I){I==="getTables"&&n("Initializing"),I==="getSchemas"&&n("Analyzing"),I==="getData"&&n("Fetching")}function E(I){const $=I.toolInvocations||[];return $.length===0||$.find(j=>j.toolName==="getData"&&"result"in j)?!0:r}function P(I){return I==null?void 0:I.map($=>{var j;const L=$.role==="user";return E($)?O.jsxs("div",{className:Ce("relative rounded-md bg-background px-4 py-4 text-sm text-foreground/80",{"bg-muted":L}),children:[O.jsx("div",{className:"space-y-2",children:O.jsxs("div",{className:"flex shrink-0 items-start gap-3",children:[O.jsx("div",{className:"text-muted-foreground",children:L?O.jsx(sQ,{className:"size-5 shrink-0"}):O.jsx(vx,{className:"size-5 shrink-0"})}),O.jsx("div",{children:O.jsx(PN,{components:Fhe,children:$.content})})]})}),(j=$.toolInvocations)==null?void 0:j.map(Q=>{const ee=Q.toolCallId;return"result"in Q?O.jsx("div",{children:A(Q)},ee):O.jsxs("div",{children:["Calling ",Q.toolName,"..."]},ee)})]},$.id):null})}function A(I){if("result"in I){let $;try{const L=JSON.parse(I.result);if($=O.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(L,null,2)}),I.toolName==="getData"){const j=z1({cardType:I.args.chartType,data:L.records});return O.jsxs("div",{className:"space-y-2",children:[r&&O.jsxs("div",{children:[O.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${I.toolName}: `,$]}),O.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[O.jsx(xr,{onClick:()=>{const Q=I.args.chartTitle,ee=I.args.connectionId;k({sql:I.args.sql,data:L.records,cardType:I.args.chartType,cardCfg:j,cardTitle:Q,connectionId:ee})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),j&&O.jsx(_1,{cfg:j})]})]})}}catch{$=O.jsx("span",{children:I.result})}return O.jsxs("div",{children:[O.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${I.toolName}: `,$]})}return`Calling ${I.toolName}...`}function k({sql:I,data:$,cardCfg:L,cardTitle:j,connectionId:Q,cardType:ee}){if(!s)return;const B={id:la(),title:j||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:ee==="horizontalBar"?"y":"x"}},type:L.type,cfg:L,sql:I,data:$,connectionId:Q},Z={id:la(),cards:[B],activeCardId:B.id};c(!0),a(s,Z,"start"),l(Z.id)}return O.jsxs("div",{role:"chat-box",className:"flex h-full grow flex-col justify-between break-words rounded-md bg-muted/30 px-6 py-8",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx(Wn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),O.jsxs(W1,{openDelay:700,children:[O.jsx(U1,{children:O.jsx(oQ,{className:"size-4 text-muted-foreground"})}),O.jsx(Fm,{className:"w-70",children:O.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[O.jsx(vx,{className:"size-5"}),O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-sm",children:i&&(i==null?void 0:i.length)>0?"I can analyze following datasets":"No datasets in scope"}),O.jsx("div",{className:"space-y-2 pt-2",children:i==null?void 0:i.map((I,$)=>O.jsxs("div",{className:"flex gap-2 text-xs",children:[O.jsx(F$,{className:"size-4 opacity-70"}),O.jsx("span",{children:I.tableName})]},$))})]})]})})]}),!1]}),O.jsx(Ym,{className:"my-4"}),O.jsx("div",{className:"",children:O.jsxs("form",{className:"mb-1 flex w-full grow items-center justify-between gap-2 rounded-md",onSubmit:b,children:[O.jsxs("div",{className:"flex w-full items-center justify-between rounded-md border bg-background",children:[O.jsx(xc,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:g,disabled:_,placeholder:"What can I help you with?",onChange:v}),O.jsx("button",{className:"mr-3",children:O.jsx(k$,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),_&&O.jsx(xr,{size:"sm",className:"rounded-full",onClick:()=>x(),children:O.jsx(NX,{className:"size-2.5 bg-background"})})]})}),O.jsxs(I_,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end",children:[O.jsxs("div",{className:"flex items-center text-xs text-foreground/90",children:[_&&t!==""&&O.jsx(SX,{className:"size-10 animate-pulse"}),t]}),O.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:P(h)}),O.jsx(nv,{orientation:"vertical"})]})]})}const Fhe={li:({node:e,...t})=>O.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t}),pre:({node:e,...t})=>O.jsx("pre",{className:"word my-2 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-xs text-foreground/80",...t})},{createElement:tu,createContext:jhe,createRef:Cye,forwardRef:TN,useCallback:Yr,useContext:DN,useEffect:ul,useImperativeHandle:AN,useLayoutEffect:zhe,useMemo:Bhe,useRef:Ao,useState:Kg}=H,f2=H.useId,av=jhe(null);av.displayName="PanelGroupContext";const cf=zhe,Vhe=typeof f2=="function"?f2:()=>null;let Hhe=0;function X_(e=null){const t=Vhe(),n=Ao(e||t||null);return n.current===null&&(n.current=""+Hhe++),e??n.current}function $N({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:h,style:g,tagName:v="div",...b}){const w=DN(av);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:_,getPanelSize:S,getPanelStyle:C,groupId:E,isPanelCollapsed:P,registerPanel:A,resizePanel:k,unregisterPanel:I}=w,$=X_(s),L=Ao({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:$,idIsFromProps:s!==void 0,order:h});Ao({didLogMissingDefaultSizeWarning:!1}),cf(()=>{const{callbacks:Q,constraints:ee}=L.current;L.current.id=$,L.current.idIsFromProps=s!==void 0,L.current.order=h,Q.onCollapse=c,Q.onExpand=u,Q.onResize=f,ee.collapsedSize=n,ee.collapsible=r,ee.defaultSize=o,ee.maxSize=a,ee.minSize=l}),cf(()=>{const Q=L.current;return A(Q),()=>{I(Q)}},[h,$,A,I]),AN(i,()=>({collapse:()=>{x(L.current)},expand:()=>{_(L.current)},getId(){return $},getSize(){return S(L.current)},isCollapsed(){return P(L.current)},isExpanded(){return!P(L.current)},resize:Q=>{k(L.current,Q)}}),[x,_,S,P,$,k]);const j=C(L.current,o);return tu(v,{...b,children:e,className:t,style:{...j,...g},"data-panel":"","data-panel-id":$,"data-panel-group-id":E,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const kN=TN((e,t)=>tu($N,{...e,forwardedRef:t}));$N.displayName="Panel";kN.displayName="forwardRef(Panel)";function vt(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const MN=10;function uf(e,t,n=MN){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Zr(e,t,n){return uf(e,t,n)===0}function gc({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];vt(r!=null);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(uf(n,a)<0)if(i){const l=(o+a)/2;uf(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(MN)),n}function ad({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(Zr(e,0))return t;const i=[...t],[s,a]=r;vt(s!=null),vt(a!=null);let l=0;if(o==="keyboard"){{const u=e<0?a:s,f=n[u];if(vt(f),f.collapsible){const h=t[u];vt(h!=null);const g=n[u];vt(g);const{collapsedSize:v=0,minSize:b=0}=g;if(Zr(h,v)){const w=b-h;uf(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}{const u=e<0?s:a,f=n[u];vt(f);const{collapsible:h}=f;if(h){const g=t[u];vt(g!=null);const v=n[u];vt(v);const{collapsedSize:b=0,minSize:w=0}=v;if(Zr(g,w)){const x=g-b;uf(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const u=e<0?1:-1;let f=e<0?a:s,h=0;for(;;){const v=t[f];vt(v!=null);const w=gc({panelConstraints:n,panelIndex:f,size:100})-v;if(h+=w,f+=u,f<0||f>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-g:g}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const h=Math.abs(e)-Math.abs(l),g=t[f];vt(g!=null);const v=g-h,b=gc({panelConstraints:n,panelIndex:f,size:v});if(!Zr(g,b)&&(l+=g-b,i[f]=b,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Zr(l,0))return t;{const u=e<0?a:s,f=t[u];vt(f!=null);const h=f+l,g=gc({panelConstraints:n,panelIndex:u,size:h});if(i[u]=g,!Zr(g,h)){let v=h-g,w=e<0?a:s;for(;w>=0&&w<n.length;){const x=i[w];vt(x!=null);const _=x+v,S=gc({panelConstraints:n,panelIndex:w,size:_});if(Zr(x,S)||(v-=S-x,i[w]=S),Zr(v,0))break;e>0?w--:w++}}}const c=i.reduce((u,f)=>f+u,0);return Zr(c,100)?i:t}function Whe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];vt(a!=null),t.forEach((f,h)=>{const{constraints:g}=f,{maxSize:v=100,minSize:b=0}=g;h===a?(r=b,o=v):(i+=b,s+=v)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function df(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function IN(e,t){const r=df(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function NN(e,t){const n=IN(e,t);return n!=null?[n,n+1]:[-1,-1]}function LN(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function lv(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Uhe(e,t,n){var r,o,i,s;const a=lv(t),l=df(e),c=a?l.indexOf(a):-1,u=(r=(o=n[c])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,f=(i=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null;return[u,f]}function qhe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){Ao({didWarnAboutMissingResizeHandle:!1}),cf(()=>{const s=df(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:c,valueNow:u}=Whe({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const h=o[a];vt(h),f.setAttribute("aria-controls",h.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,o]),ul(()=>{const s=t.current;vt(s);const{panelDataArray:a}=s,l=LN(n);vt(l!=null,`No group found for id "${n}"`);const c=df(n);vt(c);const u=c.map(f=>{const h=f.getAttribute("data-panel-resize-handle-id");vt(h);const[g,v]=Uhe(n,h,a);if(g==null||v==null)return()=>{};const b=w=>{if(!w.defaultPrevented)switch(w.key){case"Enter":{w.preventDefault();const x=a.findIndex(_=>_.id===g);if(x>=0){const _=a[x];vt(_);const S=r[x],{collapsedSize:C=0,collapsible:E,minSize:P=0}=_.constraints;if(S!=null&&E){const A=ad({delta:Zr(S,C)?P-C:C-S,layout:r,panelConstraints:a.map(k=>k.constraints),pivotIndices:NN(n,h),trigger:"keyboard"});r!==A&&i(A)}}break}}};return f.addEventListener("keydown",b),()=>{f.removeEventListener("keydown",b)}});return()=>{u.forEach(f=>f())}},[e,t,n,r,o,i])}function h2(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 FN(e){return e.type==="keydown"}function jN(e){return e.type.startsWith("mouse")}function zN(e){return e.type.startsWith("touch")}function BN(e,t){const n=e==="horizontal";if(jN(t))return n?t.clientX:t.clientY;if(zN(t)){const r=t.touches[0];return vt(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function Ghe(e,t,n,r){const o=n==="horizontal",i=lv(t);vt(i);const s=i.getAttribute("data-panel-group-id");vt(s);let{initialCursorPosition:a}=r;const l=BN(n,e),c=LN(s);vt(c);const u=c.getBoundingClientRect(),f=o?u.width:u.height;return(l-a)/f*100}function Yhe(e,t,n,r,o){if(FN(e)){const i=n==="horizontal";let s=0;e.shiftKey?s=100:o!=null?s=o:s=10;let a=0;switch(e.key){case"ArrowDown":a=i?0:s;break;case"ArrowLeft":a=i?-s:0;break;case"ArrowRight":a=i?s:0;break;case"ArrowUp":a=i?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:Ghe(e,t,n,r)}function Khe({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const s=n[i];vt(s);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];vt(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function sc(e,t,n){t.forEach((r,o)=>{const i=e[o];vt(i);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:h,onExpand:g,onResize:v}=s;v&&v(r,f),u&&(h||g)&&(g&&(f==null||f===c)&&r!==c&&g(),h&&(f==null||f!==c)&&r===c&&h())}})}function jp(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Xhe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let sw=null,Ka=null;function VN(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function Qhe(){Ka!==null&&(document.head.removeChild(Ka),sw=null,Ka=null)}function t0(e){if(sw===e)return;sw=e;const t=VN(e);Ka===null&&(Ka=document.createElement("style"),document.head.appendChild(Ka)),Ka.innerHTML=`*{cursor: ${t}!important;}`}function Jhe(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function p2(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 HN(e){return`react-resizable-panels:${e}`}function WN(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function UN(e,t){try{const n=HN(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Zhe(e,t,n){var r,o;const i=(r=UN(e,n))!==null&&r!==void 0?r:{},s=WN(t);return(o=i[s])!==null&&o!==void 0?o:null}function epe(e,t,n,r,o){var i;const s=HN(e),a=WN(t),l=(i=UN(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function g2({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,s)=>i+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Zr(r,100))for(let i=0;i<t.length;i++){const s=n[i];vt(s!=null);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];vt(s!=null);const a=gc({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!Zr(o,0))for(let i=0;i<t.length;i++){const s=n[i];vt(s!=null);const a=s+o,l=gc({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,Zr(o,0)))break}return n}const tpe=100,ld={getItem:e=>(p2(ld),ld.getItem(e)),setItem:(e,t)=>{p2(ld),ld.setItem(e,t)}},m2={};function qN({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=ld,style:c,tagName:u="div",...f}){const h=X_(i),[g,v]=Kg(null),[b,w]=Kg([]),x=Ao({}),_=Ao(new Map),S=Ao(0),C=Ao({autoSaveId:e,direction:r,dragState:g,id:h,keyboardResizeBy:a,onLayout:s,storage:l}),E=Ao({layout:b,panelDataArray:[],panelDataArrayChanged:!1});Ao({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),AN(o,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:T}=E.current;return T},setLayout:T=>{const{onLayout:V}=C.current,{layout:X,panelDataArray:N}=E.current,ie=g2({layout:T,panelConstraints:N.map(fe=>fe.constraints)});h2(X,ie)||(w(ie),E.current.layout=ie,V&&V(ie),sc(N,ie,x.current))}}),[]),cf(()=>{C.current.autoSaveId=e,C.current.direction=r,C.current.dragState=g,C.current.id=h,C.current.onLayout=s,C.current.storage=l}),qhe({committedValuesRef:C,eagerValuesRef:E,groupId:h,layout:b,panelDataArray:E.current.panelDataArray,setLayout:w}),ul(()=>{const{panelDataArray:T}=E.current;if(e){if(b.length===0||b.length!==T.length)return;let V=m2[e];V==null&&(V=Jhe(epe,tpe),m2[e]=V);const X=[...T],N=new Map(_.current);V(e,X,N,b,l)}},[e,b,l]),ul(()=>{});const P=Yr(T=>{const{onLayout:V}=C.current,{layout:X,panelDataArray:N}=E.current;if(T.constraints.collapsible){const ie=N.map(se=>se.constraints),{collapsedSize:fe=0,panelSize:ue,pivotIndices:pe}=ac(N,T,X);if(vt(ue!=null),ue!==fe){_.current.set(T.id,ue);const ne=fc(N,T)===N.length-1?ue-fe:fe-ue,le=ad({delta:ne,layout:X,panelConstraints:ie,pivotIndices:pe,trigger:"imperative-api"});jp(X,le)||(w(le),E.current.layout=le,V&&V(le),sc(N,le,x.current))}}},[]),A=Yr(T=>{const{onLayout:V}=C.current,{layout:X,panelDataArray:N}=E.current;if(T.constraints.collapsible){const ie=N.map(ne=>ne.constraints),{collapsedSize:fe=0,panelSize:ue,minSize:pe=0,pivotIndices:se}=ac(N,T,X);if(ue===fe){const ne=_.current.get(T.id),le=ne!=null&&ne>=pe?ne:pe,Y=fc(N,T)===N.length-1?ue-le:le-ue,be=ad({delta:Y,layout:X,panelConstraints:ie,pivotIndices:se,trigger:"imperative-api"});jp(X,be)||(w(be),E.current.layout=be,V&&V(be),sc(N,be,x.current))}}},[]),k=Yr(T=>{const{layout:V,panelDataArray:X}=E.current,{panelSize:N}=ac(X,T,V);return vt(N!=null),N},[]),I=Yr((T,V)=>{const{panelDataArray:X}=E.current,N=fc(X,T);return Xhe({defaultSize:V,dragState:g,layout:b,panelData:X,panelIndex:N})},[g,b]),$=Yr(T=>{const{layout:V,panelDataArray:X}=E.current,{collapsedSize:N=0,collapsible:ie,panelSize:fe}=ac(X,T,V);return ie===!0&&fe===N},[]),L=Yr(T=>{const{layout:V,panelDataArray:X}=E.current,{collapsedSize:N=0,collapsible:ie,panelSize:fe}=ac(X,T,V);return vt(fe!=null),!ie||fe>N},[]),j=Yr(T=>{const{panelDataArray:V}=E.current;V.push(T),V.sort((X,N)=>{const ie=X.order,fe=N.order;return ie==null&&fe==null?0:ie==null?-1:fe==null?1:ie-fe}),E.current.panelDataArrayChanged=!0},[]);cf(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:T,onLayout:V,storage:X}=C.current,{layout:N,panelDataArray:ie}=E.current;let fe=null;if(T){const pe=Zhe(T,ie,X);pe&&(_.current=new Map(Object.entries(pe.expandToSizes)),fe=pe.layout)}fe==null&&(fe=Khe({panelDataArray:ie}));const ue=g2({layout:fe,panelConstraints:ie.map(pe=>pe.constraints)});h2(N,ue)||(w(ue),E.current.layout=ue,V&&V(ue),sc(ie,ue,x.current))}});const Q=Yr(T=>function(X){X.preventDefault();const{direction:N,dragState:ie,id:fe,keyboardResizeBy:ue,onLayout:pe}=C.current,{layout:se,panelDataArray:ne}=E.current,{initialLayout:le}=ie??{},ye=NN(fe,T);let Y=Yhe(X,T,N,ie,ue);if(Y===0)return;const be=N==="horizontal";document.dir==="rtl"&&be&&(Y=-Y);const _e=ne.map(Ue=>Ue.constraints),Pe=ad({delta:Y,layout:le??se,panelConstraints:_e,pivotIndices:ye,trigger:FN(X)?"keyboard":"mouse-or-touch"}),Te=!jp(se,Pe);(jN(X)||zN(X))&&S.current!=Y&&(S.current=Y,t0(Te?be?"horizontal":"vertical":be?Y<0?"horizontal-min":"horizontal-max":Y<0?"vertical-min":"vertical-max")),Te&&(w(Pe),E.current.layout=Pe,pe&&pe(Pe),sc(ne,Pe,x.current))},[]),ee=Yr((T,V)=>{const{onLayout:X}=C.current,{layout:N,panelDataArray:ie}=E.current,fe=ie.map(ye=>ye.constraints),{panelSize:ue,pivotIndices:pe}=ac(ie,T,N);vt(ue!=null);const ne=fc(ie,T)===ie.length-1?ue-V:V-ue,le=ad({delta:ne,layout:N,panelConstraints:fe,pivotIndices:pe,trigger:"imperative-api"});jp(N,le)||(w(le),E.current.layout=le,X&&X(le),sc(ie,le,x.current))},[]),B=Yr((T,V)=>{const{direction:X}=C.current,{layout:N}=E.current,ie=lv(T);vt(ie);const fe=BN(X,V);v({dragHandleId:T,dragHandleRect:ie.getBoundingClientRect(),initialCursorPosition:fe,initialLayout:N})},[]),Z=Yr(()=>{Qhe(),v(null)},[]),G=Yr(T=>{const{panelDataArray:V}=E.current,X=fc(V,T);X>=0&&(V.splice(X,1),delete x.current[T.id],E.current.panelDataArrayChanged=!0)},[]),q=Bhe(()=>({collapsePanel:P,direction:r,dragState:g,expandPanel:A,getPanelSize:k,getPanelStyle:I,groupId:h,isPanelCollapsed:$,isPanelExpanded:L,registerPanel:j,registerResizeHandle:Q,resizePanel:ee,startDragging:B,stopDragging:Z,unregisterPanel:G}),[P,g,r,A,k,I,h,$,L,j,Q,ee,B,Z,G]),K={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return tu(av.Provider,{value:q},tu(u,{...f,children:t,className:n,style:{...K,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h}))}const GN=TN((e,t)=>tu(qN,{...e,forwardedRef:t}));qN.displayName="PanelGroup";GN.displayName="forwardRef(PanelGroup)";function fc(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function ac(e,t,n){const r=e.map(c=>c.constraints),o=fc(e,t),i=r[o],a=o===e.length-1?[o-1,o]:[o,o+1],l=n[o];return{...i,panelSize:l,pivotIndices:a}}function npe({disabled:e,handleId:t,resizeHandler:n}){ul(()=>{if(e||n==null)return;const r=lv(t);if(r==null)return;const o=i=>{if(!i.defaultPrevented)switch(i.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{i.preventDefault(),n(i);break}case"F6":{i.preventDefault();const s=r.getAttribute("data-panel-group-id");vt(s);const a=df(s),l=IN(s,t);vt(l!==null);const c=i.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function Q_({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:s=0,tagName:a="div",...l}){const c=Ao(null),u=Ao({onDragging:o});ul(()=>{u.current.onDragging=o});const f=DN(av);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:h,dragState:g,groupId:v,registerResizeHandle:b,startDragging:w,stopDragging:x}=f,_=X_(r),S=(g==null?void 0:g.dragHandleId)===_,[C,E]=Kg(!1),[P,A]=Kg(null),k=Yr(()=>{const $=c.current;vt($),$.blur(),x();const{onDragging:L}=u.current;L&&L(!1)},[x]);ul(()=>{if(n)A(null);else{const $=b(_);A(()=>$)}},[n,_,b]),ul(()=>{if(n||P==null||!S)return;const $=ee=>{P(ee)},L=ee=>{P(ee)},j=c.current;vt(j);const Q=j.ownerDocument;return Q.body.addEventListener("contextmenu",k),Q.body.addEventListener("mousemove",$),Q.body.addEventListener("touchmove",$),Q.body.addEventListener("mouseleave",L),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),()=>{Q.body.removeEventListener("contextmenu",k),Q.body.removeEventListener("mousemove",$),Q.body.removeEventListener("touchmove",$),Q.body.removeEventListener("mouseleave",L),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k)}},[h,n,S,P,k]),npe({disabled:n,handleId:_,resizeHandler:P});const I={cursor:VN(h),touchAction:"none",userSelect:"none"};return tu(a,{...l,children:e,className:t,onBlur:()=>E(!1),onFocus:()=>E(!0),onMouseDown:$=>{w(_,$.nativeEvent);const L=u.current;vt(L);const{onDragging:j}=L;j&&j(!0)},onMouseUp:k,onTouchCancel:k,onTouchEnd:k,onTouchStart:$=>{w(_,$.nativeEvent);const L=u.current;vt(L);const{onDragging:j}=L;j&&j(!0)},ref:c,role:"separator",style:{...I,...i},tabIndex:s,"data-panel-group-direction":h,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":S?"pointer":C?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}Q_.displayName="PanelResizeHandle";const YN=({className:e,...t})=>O.jsx(GN,{className:Ce("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),aw=kN,rpe=({withHandle:e,className:t,...n})=>O.jsx(Q_,{className:Ce("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&&O.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:O.jsx(tQ,{className:"h-2.5 w-2.5"})})}),ope=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>O.jsx(Q_,{className:Ce("relative flex w-px items-start justify-end bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",{"justify-start":r},t),...o,children:e&&O.jsx("div",{className:Ce("z-50 flex items-center justify-start",{"border-l":r}),children:O.jsx(xr,{variant:"secondary",className:Ce("h-7 p-1",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-2 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?O.jsx(E1,{className:"size-4"}):O.jsx(N$,{className:"size-4"})})})});function ipe(e,t=[]){let n=[];function r(i,s){const a=H.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:g,...v}=f,b=(h==null?void 0:h[e][l])||a,w=H.useMemo(()=>v,Object.values(v));return O.jsx(b.Provider,{value:w,children:g})}function u(f,h){const g=(h==null?void 0:h[e][l])||a,v=H.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>H.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return H.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,spe(o,...t)]}function spe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return H.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ape(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function lpe(...e){return t=>e.forEach(n=>ape(n,t))}function KN(...e){return H.useCallback(lpe(...e),e)}function oa(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function cpe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function upe(...e){return t=>e.forEach(n=>cpe(n,t))}function Al(...e){return H.useCallback(upe(...e),e)}function dpe(e,t){const n=H.createContext(t);function r(i){const{children:s,...a}=i,l=H.useMemo(()=>a,Object.values(a));return O.jsx(n.Provider,{value:l,children:s})}function o(i){const s=H.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,o]}function fpe(e,t=[]){let n=[];function r(i,s){const a=H.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:g,...v}=f,b=(h==null?void 0:h[e][l])||a,w=H.useMemo(()=>v,Object.values(v));return O.jsx(b.Provider,{value:w,children:g})}function u(f,h){const g=(h==null?void 0:h[e][l])||a,v=H.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>H.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return H.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,hpe(o,...t)]}function hpe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return H.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Xg=globalThis!=null&&globalThis.document?H.useLayoutEffect:()=>{},ppe=H.useId||(()=>{}),gpe=0;function n0(e){const[t,n]=H.useState(ppe());return Xg(()=>{e||n(r=>r??String(gpe++))},[e]),e||(t?`radix-${t}`:"")}function xl(e){const t=H.useRef(e);return H.useEffect(()=>{t.current=e}),H.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function mpe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=vpe({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=xl(n),l=H.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function vpe({defaultProp:e,onChange:t}){const n=H.useState(e),[r]=n,o=H.useRef(r),i=xl(t);return H.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var bpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ps=bpe.reduce((e,t)=>{const n=H.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Um:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ype(e,t){e&&pw.flushSync(()=>e.dispatchEvent(t))}function xpe(e,t=globalThis==null?void 0:globalThis.document){const n=xl(e);H.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var wpe="DismissableLayer",lw="dismissableLayer.update",_pe="dismissableLayer.pointerDownOutside",Spe="dismissableLayer.focusOutside",v2,XN=H.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),QN=H.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=H.useContext(XN),[u,f]=H.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=H.useState({}),v=Al(t,A=>f(A)),b=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(w),_=u?b.indexOf(u):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,C=_>=x,E=Rpe(A=>{const k=A.target,I=[...c.branches].some($=>$.contains(k));!C||I||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},h),P=Ope(A=>{const k=A.target;[...c.branches].some($=>$.contains(k))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},h);return xpe(A=>{_===c.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},h),H.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(v2=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),b2(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=v2)}},[u,h,n,c]),H.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),b2())},[u,c]),H.useEffect(()=>{const A=()=>g({});return document.addEventListener(lw,A),()=>document.removeEventListener(lw,A)},[]),O.jsx(ps.div,{...l,ref:v,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:oa(e.onFocusCapture,P.onFocusCapture),onBlurCapture:oa(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:oa(e.onPointerDownCapture,E.onPointerDownCapture)})});QN.displayName=wpe;var Cpe="DismissableLayerBranch",Epe=H.forwardRef((e,t)=>{const n=H.useContext(XN),r=H.useRef(null),o=Al(t,r);return H.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),O.jsx(ps.div,{...e,ref:o})});Epe.displayName=Cpe;function Rpe(e,t=globalThis==null?void 0:globalThis.document){const n=xl(e),r=H.useRef(!1),o=H.useRef(()=>{});return H.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){JN(_pe,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ope(e,t=globalThis==null?void 0:globalThis.document){const n=xl(e),r=H.useRef(!1);return H.useEffect(()=>{const o=i=>{i.target&&!r.current&&JN(Spe,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function b2(){const e=new CustomEvent(lw);document.dispatchEvent(e)}function JN(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ype(o,i):o.dispatchEvent(i)}var r0="focusScope.autoFocusOnMount",o0="focusScope.autoFocusOnUnmount",y2={bubbles:!1,cancelable:!0},Ppe="FocusScope",ZN=H.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=H.useState(null),c=xl(o),u=xl(i),f=H.useRef(null),h=Al(t,b=>l(b)),g=H.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;H.useEffect(()=>{if(r){let b=function(S){if(g.paused||!a)return;const C=S.target;a.contains(C)?f.current=C:js(f.current,{select:!0})},w=function(S){if(g.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||js(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&js(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const _=new MutationObserver(x);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),_.disconnect()}}},[r,a,g.paused]),H.useEffect(()=>{if(a){w2.add(g);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(r0,y2);a.addEventListener(r0,c),a.dispatchEvent(x),x.defaultPrevented||(Tpe(Mpe(e5(a)),{select:!0}),document.activeElement===b&&js(a))}return()=>{a.removeEventListener(r0,c),setTimeout(()=>{const x=new CustomEvent(o0,y2);a.addEventListener(o0,u),a.dispatchEvent(x),x.defaultPrevented||js(b??document.body,{select:!0}),a.removeEventListener(o0,u),w2.remove(g)},0)}}},[a,c,u,g]);const v=H.useCallback(b=>{if(!n&&!r||g.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(w&&x){const _=b.currentTarget,[S,C]=Dpe(_);S&&C?!b.shiftKey&&x===C?(b.preventDefault(),n&&js(S,{select:!0})):b.shiftKey&&x===S&&(b.preventDefault(),n&&js(C,{select:!0})):x===_&&b.preventDefault()}},[n,r,g.paused]);return O.jsx(ps.div,{tabIndex:-1,...s,ref:h,onKeyDown:v})});ZN.displayName=Ppe;function Tpe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(js(r,{select:t}),document.activeElement!==n)return}function Dpe(e){const t=e5(e),n=x2(t,e),r=x2(t.reverse(),e);return[n,r]}function e5(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function x2(e,t){for(const n of e)if(!Ape(n,{upTo:t}))return n}function Ape(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 $pe(e){return e instanceof HTMLInputElement&&"select"in e}function js(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&$pe(e)&&t&&e.select()}}var w2=kpe();function kpe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_2(e,t),e.unshift(t)},remove(t){var n;e=_2(e,t),(n=e[0])==null||n.resume()}}}function _2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Mpe(e){return e.filter(t=>t.tagName!=="A")}var Ipe="Portal",t5=H.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=H.useState(!1);Xg(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Mo.createPortal(O.jsx(ps.div,{...r,ref:t}),s):null});t5.displayName=Ipe;function Npe(e,t){return H.useReducer((n,r)=>t[n][r]??n,e)}var cv=e=>{const{present:t,children:n}=e,r=Lpe(t),o=typeof n=="function"?n({present:r.isPresent}):H.Children.only(n),i=Al(r.ref,Fpe(o));return typeof n=="function"||r.isPresent?H.cloneElement(o,{ref:i}):null};cv.displayName="Presence";function Lpe(e){const[t,n]=H.useState(),r=H.useRef({}),o=H.useRef(e),i=H.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Npe(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return H.useEffect(()=>{const c=zp(r.current);i.current=a==="mounted"?c:"none"},[a]),Xg(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,g=zp(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Xg(()=>{if(t){const c=f=>{const g=zp(r.current).includes(f.animationName);f.target===t&&g&&pw.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=zp(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:H.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function zp(e){return(e==null?void 0:e.animationName)||"none"}function Fpe(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var i0=0;function jpe(){H.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??S2()),document.body.insertAdjacentElement("beforeend",e[1]??S2()),i0++,()=>{i0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),i0--}},[])}function S2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var n5=Nk(),s0=function(){},uv=H.forwardRef(function(e,t){var n=H.useRef(null),r=H.useState({onScrollCapture:s0,onWheelCapture:s0,onTouchMoveCapture:s0}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,h=e.sideCar,g=e.noIsolation,v=e.inert,b=e.allowPinchZoom,w=e.as,x=w===void 0?"div":w,_=e.gapMode,S=t_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,E=Ik([n,t]),P=lr(lr({},S),o);return H.createElement(H.Fragment,null,u&&H.createElement(C,{sideCar:n5,removeScrollBar:c,shards:f,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:_}),s?H.cloneElement(H.Children.only(a),lr(lr({},P),{ref:E})):H.createElement(x,lr({},P,{className:l,ref:E}),a))});uv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};uv.classNames={fullWidth:wd,zeroRight:xd};var cw=!1;if(typeof window<"u")try{var Bp=Object.defineProperty({},"passive",{get:function(){return cw=!0,!0}});window.addEventListener("test",Bp,Bp),window.removeEventListener("test",Bp,Bp)}catch{cw=!1}var lc=cw?{passive:!1}:!1,zpe=function(e){return e.tagName==="TEXTAREA"},r5=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zpe(e)&&n[t]==="visible")},Bpe=function(e){return r5(e,"overflowY")},Vpe=function(e){return r5(e,"overflowX")},C2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=o5(e,r);if(o){var i=i5(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Hpe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Wpe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},o5=function(e,t){return e==="v"?Bpe(t):Vpe(t)},i5=function(e,t){return e==="v"?Hpe(t):Wpe(t)},Upe=function(e,t){return e==="h"&&t==="rtl"?-1:1},qpe=function(e,t,n,r,o){var i=Upe(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,h=0;do{var g=i5(e,a),v=g[0],b=g[1],w=g[2],x=b-w-i*v;(v||x)&&o5(e,a)&&(f+=x,h+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&Math.abs(f)<1||!o&&s>f)||!u&&(o&&Math.abs(h)<1||!o&&-s>h))&&(c=!0),c},Vp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},E2=function(e){return[e.deltaX,e.deltaY]},R2=function(e){return e&&"current"in e?e.current:e},Gpe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ype=function(e){return`
|
|
412
|
+
`},o),i}function fhe(e,t){return e&&"run"in e?async function(n,r){const o=ZT(n,{file:r,...t});await e.run(o,r)}:function(n,r){return ZT(n,{file:r,...t||e})}}function e2(e){if(e)throw e}var cg=Object.prototype.hasOwnProperty,RN=Object.prototype.toString,t2=Object.defineProperty,n2=Object.getOwnPropertyDescriptor,r2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):RN.call(t)==="[object Array]"},o2=function(t){if(!t||RN.call(t)!=="[object Object]")return!1;var n=cg.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&cg.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||cg.call(t,o)},i2=function(t,n){t2&&n.name==="__proto__"?t2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},s2=function(t,n){if(n==="__proto__")if(cg.call(t,n)){if(n2)return n2(t,n).value}else return;return t[n]},hhe=function e(){var t,n,r,o,i,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=s2(a,n),o=s2(t,n),a!==o&&(u&&o&&(o2(o)||(i=r2(o)))?(i?(i=!1,s=r&&r2(r)?r:[]):s=r&&o2(r)?r:{},i2(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&i2(a,{name:n,newValue:o}));return a};const Yy=nu(hhe);function ow(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 phe(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let f=-1;if(l){s(l);return}for(;++f<o.length;)(c[f]===null||c[f]===void 0)&&(c[f]=o[f]);o=c,u?ghe(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function ghe(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l instanceof Promise?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const di={basename:mhe,dirname:vhe,extname:bhe,join:yhe,sep:"/"};function mhe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Zf(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function vhe(e){if(Zf(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 bhe(e){Zf(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function yhe(...e){let t=-1,n;for(;++t<e.length;)Zf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":xhe(n)}function xhe(e){Zf(e);const t=e.codePointAt(0)===47;let n=whe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function whe(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function Zf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _he={cwd:She};function She(){return"/"}function iw(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Che(e){if(typeof e=="string")e=new URL(e);else if(!iw(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 Ehe(e)}function Ehe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Ky=["history","path","basename","stem","extname","dirname"];class ON{constructor(t){let n;t?iw(t)?n={path:t}:typeof t=="string"||Rhe(t)?n={value:t}:n=t:n={},this.cwd=_he.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ky.length;){const i=Ky[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)Ky.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?di.basename(this.path):void 0}set basename(t){Qy(t,"basename"),Xy(t,"basename"),this.path=di.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?di.dirname(this.path):void 0}set dirname(t){a2(this.basename,"dirname"),this.path=di.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?di.extname(this.path):void 0}set extname(t){if(Xy(t,"extname"),a2(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=di.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){iw(t)&&(t=Che(t)),Qy(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?di.basename(this.path,this.extname):void 0}set stem(t){Qy(t,"stem"),Xy(t,"stem"),this.path=di.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new dr(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Xy(e,t){if(e&&e.includes(di.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+di.sep+"`")}function Qy(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function a2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Rhe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ohe=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};Object.setPrototypeOf(i,r);const s=Object.getOwnPropertyNames(o);for(const a of s){const l=Object.getOwnPropertyDescriptor(o,a);l&&Object.defineProperty(i,a,l)}return i},Phe={}.hasOwnProperty;class K_ extends Ohe{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=phe()}copy(){const t=new K_;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Yy(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(e0("data",this.frozen),this.namespace[t]=n,this):Phe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(e0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Fp(t),r=this.parser||this.Parser;return Jy("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Jy("process",this.parser||this.Parser),Zy("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Fp(t),l=r.parse(a);r.run(l,a,function(u,f,h){if(u||!f||!h)return c(u);const g=f,v=r.stringify(g,h);Ahe(v)?h.value=v:h.result=v,c(u,h)});function c(u,f){u||!f?s(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Jy("processSync",this.parser||this.Parser),Zy("processSync",this.compiler||this.Compiler),this.process(t,o),c2("processSync","process",n),r;function o(i,s){n=!0,e2(i),r=s}}run(t,n,r){l2(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Fp(n);o.run(t,l,c);function c(u,f,h){const g=f||t;u?a(u):s?s(g):r(void 0,g,h)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),c2("runSync","run",r),o;function i(s,a){e2(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Fp(n),o=this.compiler||this.Compiler;return Zy("stringify",o),l2(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(e0("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=Yy(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===c){h=f;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[g,...v]=u;const b=r[h][1];ow(b)&&ow(g)&&(g=Yy(!0,b,g)),r[h]=[c,g,...v]}}}}const The=new K_().freeze();function Jy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Zy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function e0(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 l2(e){if(!ow(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function c2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Fp(e){return Dhe(e)?e:new ON(e)}function Dhe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ahe(e){return typeof e=="string"||$he(e)}function $he(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const khe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",u2=[],d2={allowDangerousHtml:!0},Mhe=/^(https?|ircs?|mailto|xmpp)$/i,Ihe=[{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 PN(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||u2,l=e.remarkPlugins||u2,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...d2}:d2,u=e.skipHtml,f=e.unwrapDisallowed,h=e.urlTransform||Nhe,g=The().use(vfe).use(l).use(fhe,c).use(a),v=new ON;typeof r=="string"&&(v.value=r);for(const _ of Ihe)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+khe+_.id,void 0);const b=g.parse(v);let w=g.runSync(b,v);return o&&(w={type:"element",tagName:"div",properties:{className:o},children:w.type==="root"?w.children:[w]}),EN(w,x),Xce(w,{Fragment:O.Fragment,components:i,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0});function x(_,S,C){if(_.type==="raw"&&C&&typeof S=="number")return u?C.children.splice(S,1):C.children[S]={type:"text",value:_.value},S;if(_.type==="element"){let E;for(E in Uy)if(Object.hasOwn(Uy,E)&&Object.hasOwn(_.properties,E)){const P=_.properties[E],A=Uy[E];(A===null||A.includes(_.tagName))&&(_.properties[E]=h(String(P||""),E,_))}}if(_.type==="element"){let E=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!E&&n&&typeof S=="number"&&(E=!n(_,S,C)),E&&C&&typeof S=="number")return f&&_.children?C.children.splice(S,1,..._.children):C.children.splice(S,1),S}}}function Nhe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t<0||o>-1&&t>o||n>-1&&t>n||r>-1&&t>r||Mhe.test(e.slice(0,t))?e:""}function Lhe(){const e=m.useRef(null),[t,n]=m.useState(""),[r,o]=m.useState(!1),i=ke(I=>I.dashboard.aiScopeTables);Dm();const s=ke(I=>I.selectedSheetId),{addFrame:a,setSelectedFrameId:l,setIsDashboardEditing:c}=co(),{authToken:u}=ma(),f=wD(),{messages:h,input:g,handleInputChange:v,handleSubmit:b,addToolResult:w,stop:x,isLoading:_}=Fle({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},maxToolRoundtrips:5,async onToolCall({toolCall:I}){if(C(I.toolName),I.toolName==="getLocation"){const $=["New York","Los Angeles","Chicago","San Francisco"];return $[Math.floor(Math.random()*$.length)]}if(I.toolName==="getTables")return JSON.stringify(i||[]);if(I.toolName==="getData"){console.log(I.args);const $=I.args;if(!($!=null&&$.sql)||!($!=null&&$.connectionId))return"Please provide sql, connectionId and table";const L=await f.fetchQuery({queryKey:["chat",$.connectionId,$.sql],queryFn:()=>Of("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:$.connectionId,sql:$.sql})});return n("Summarizing"),JSON.stringify(L)}},onFinish(I,$){console.log("onFinish",I,$),I.content&&n("")}}),S=()=>{var I;(I=e.current)==null||I.scrollIntoView({behavior:"smooth"})};m.useEffect(()=>{S()},[h]);function C(I){I==="getTables"&&n("Initializing"),I==="getSchemas"&&n("Analyzing"),I==="getData"&&n("Fetching")}function E(I){const $=I.toolInvocations||[];return $.length===0||$.find(j=>j.toolName==="getData"&&"result"in j)?!0:r}function P(I){return I==null?void 0:I.map($=>{var j;const L=$.role==="user";return E($)?O.jsxs("div",{className:Ce("relative rounded-md bg-background px-4 py-4 text-sm text-foreground/80",{"bg-muted":L}),children:[O.jsx("div",{className:"space-y-2",children:O.jsxs("div",{className:"flex shrink-0 items-start gap-3",children:[O.jsx("div",{className:"text-muted-foreground",children:L?O.jsx(sQ,{className:"size-5 shrink-0"}):O.jsx(vx,{className:"size-5 shrink-0"})}),O.jsx("div",{children:O.jsx(PN,{components:Fhe,children:$.content})})]})}),(j=$.toolInvocations)==null?void 0:j.map(Q=>{const ee=Q.toolCallId;return"result"in Q?O.jsx("div",{children:A(Q)},ee):O.jsxs("div",{children:["Calling ",Q.toolName,"..."]},ee)})]},$.id):null})}function A(I){if("result"in I){let $;try{const L=JSON.parse(I.result);if($=O.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(L,null,2)}),I.toolName==="getData"){const j=z1({cardType:I.args.chartType,data:L.records});return O.jsxs("div",{className:"space-y-2",children:[r&&O.jsxs("div",{children:[O.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${I.toolName}: `,$]}),O.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[O.jsx(xr,{onClick:()=>{const Q=I.args.chartTitle,ee=I.args.connectionId;k({sql:I.args.sql,data:L.records,cardType:I.args.chartType,cardCfg:j,cardTitle:Q,connectionId:ee})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),j&&O.jsx(_1,{cfg:j})]})]})}}catch{$=O.jsx("span",{children:I.result})}return O.jsxs("div",{children:[O.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${I.toolName}: `,$]})}return`Calling ${I.toolName}...`}function k({sql:I,data:$,cardCfg:L,cardTitle:j,connectionId:Q,cardType:ee}){if(!s)return;const B={id:la(),title:j||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:ee==="horizontalBar"?"y":"x"}},type:L.type,cfg:L,sql:I,data:$,connectionId:Q},Z={id:la(),cards:[B],activeCardId:B.id};c(!0),a(s,Z,"start"),l(Z.id)}return O.jsxs("div",{role:"chat-box",className:"flex h-full grow flex-col justify-between break-words rounded-md bg-muted/30 px-6 py-8",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx(Wn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),O.jsxs(W1,{openDelay:700,children:[O.jsx(U1,{children:O.jsx(oQ,{className:"size-4 text-muted-foreground"})}),O.jsx(Fm,{className:"w-70",children:O.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[O.jsx(vx,{className:"size-5"}),O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-sm",children:i&&(i==null?void 0:i.length)>0?"I can analyze following datasets":"No datasets in scope"}),O.jsx("div",{className:"space-y-2 pt-2",children:i==null?void 0:i.map((I,$)=>O.jsxs("div",{className:"flex gap-2 text-xs",children:[O.jsx(F$,{className:"size-4 opacity-70"}),O.jsx("span",{children:I.tableName})]},$))})]})]})})]}),!1]}),O.jsx(Ym,{className:"my-4"}),O.jsx("div",{className:"",children:O.jsxs("form",{className:"mb-1 flex w-full grow items-center justify-between gap-2 rounded-md",onSubmit:b,children:[O.jsxs("div",{className:"flex w-full items-center justify-between rounded-md border bg-background",children:[O.jsx(xc,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:g,disabled:_,placeholder:"What can I help you with?",onChange:v}),O.jsx("button",{className:"mr-3",children:O.jsx(k$,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),_&&O.jsx(xr,{size:"sm",className:"rounded-full",onClick:()=>x(),children:O.jsx(NX,{className:"size-2.5 bg-background"})})]})}),O.jsxs(I_,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end",children:[O.jsxs("div",{className:"flex items-center text-xs text-foreground/90",children:[_&&t!==""&&O.jsx(SX,{className:"size-10 animate-pulse"}),t]}),O.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:P(h)}),O.jsx(nv,{orientation:"vertical"})]})]})}const Fhe={li:({node:e,...t})=>O.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t}),pre:({node:e,...t})=>O.jsx("pre",{className:"word my-2 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-xs text-foreground/80",...t})},{createElement:tu,createContext:jhe,createRef:Cye,forwardRef:TN,useCallback:Yr,useContext:DN,useEffect:ul,useImperativeHandle:AN,useLayoutEffect:zhe,useMemo:Bhe,useRef:Ao,useState:Kg}=H,f2=H.useId,av=jhe(null);av.displayName="PanelGroupContext";const cf=zhe,Vhe=typeof f2=="function"?f2:()=>null;let Hhe=0;function X_(e=null){const t=Vhe(),n=Ao(e||t||null);return n.current===null&&(n.current=""+Hhe++),e??n.current}function $N({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:h,style:g,tagName:v="div",...b}){const w=DN(av);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:_,getPanelSize:S,getPanelStyle:C,groupId:E,isPanelCollapsed:P,registerPanel:A,resizePanel:k,unregisterPanel:I}=w,$=X_(s),L=Ao({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:$,idIsFromProps:s!==void 0,order:h});Ao({didLogMissingDefaultSizeWarning:!1}),cf(()=>{const{callbacks:Q,constraints:ee}=L.current;L.current.id=$,L.current.idIsFromProps=s!==void 0,L.current.order=h,Q.onCollapse=c,Q.onExpand=u,Q.onResize=f,ee.collapsedSize=n,ee.collapsible=r,ee.defaultSize=o,ee.maxSize=a,ee.minSize=l}),cf(()=>{const Q=L.current;return A(Q),()=>{I(Q)}},[h,$,A,I]),AN(i,()=>({collapse:()=>{x(L.current)},expand:()=>{_(L.current)},getId(){return $},getSize(){return S(L.current)},isCollapsed(){return P(L.current)},isExpanded(){return!P(L.current)},resize:Q=>{k(L.current,Q)}}),[x,_,S,P,$,k]);const j=C(L.current,o);return tu(v,{...b,children:e,className:t,style:{...j,...g},"data-panel":"","data-panel-id":$,"data-panel-group-id":E,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const kN=TN((e,t)=>tu($N,{...e,forwardedRef:t}));$N.displayName="Panel";kN.displayName="forwardRef(Panel)";function vt(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const MN=10;function uf(e,t,n=MN){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Zr(e,t,n){return uf(e,t,n)===0}function gc({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];vt(r!=null);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(uf(n,a)<0)if(i){const l=(o+a)/2;uf(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(MN)),n}function ad({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(Zr(e,0))return t;const i=[...t],[s,a]=r;vt(s!=null),vt(a!=null);let l=0;if(o==="keyboard"){{const u=e<0?a:s,f=n[u];if(vt(f),f.collapsible){const h=t[u];vt(h!=null);const g=n[u];vt(g);const{collapsedSize:v=0,minSize:b=0}=g;if(Zr(h,v)){const w=b-h;uf(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}{const u=e<0?s:a,f=n[u];vt(f);const{collapsible:h}=f;if(h){const g=t[u];vt(g!=null);const v=n[u];vt(v);const{collapsedSize:b=0,minSize:w=0}=v;if(Zr(g,w)){const x=g-b;uf(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const u=e<0?1:-1;let f=e<0?a:s,h=0;for(;;){const v=t[f];vt(v!=null);const w=gc({panelConstraints:n,panelIndex:f,size:100})-v;if(h+=w,f+=u,f<0||f>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-g:g}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const h=Math.abs(e)-Math.abs(l),g=t[f];vt(g!=null);const v=g-h,b=gc({panelConstraints:n,panelIndex:f,size:v});if(!Zr(g,b)&&(l+=g-b,i[f]=b,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Zr(l,0))return t;{const u=e<0?a:s,f=t[u];vt(f!=null);const h=f+l,g=gc({panelConstraints:n,panelIndex:u,size:h});if(i[u]=g,!Zr(g,h)){let v=h-g,w=e<0?a:s;for(;w>=0&&w<n.length;){const x=i[w];vt(x!=null);const _=x+v,S=gc({panelConstraints:n,panelIndex:w,size:_});if(Zr(x,S)||(v-=S-x,i[w]=S),Zr(v,0))break;e>0?w--:w++}}}const c=i.reduce((u,f)=>f+u,0);return Zr(c,100)?i:t}function Whe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];vt(a!=null),t.forEach((f,h)=>{const{constraints:g}=f,{maxSize:v=100,minSize:b=0}=g;h===a?(r=b,o=v):(i+=b,s+=v)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function df(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function IN(e,t){const r=df(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function NN(e,t){const n=IN(e,t);return n!=null?[n,n+1]:[-1,-1]}function LN(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function lv(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Uhe(e,t,n){var r,o,i,s;const a=lv(t),l=df(e),c=a?l.indexOf(a):-1,u=(r=(o=n[c])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,f=(i=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null;return[u,f]}function qhe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){Ao({didWarnAboutMissingResizeHandle:!1}),cf(()=>{const s=df(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:c,valueNow:u}=Whe({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const h=o[a];vt(h),f.setAttribute("aria-controls",h.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,o]),ul(()=>{const s=t.current;vt(s);const{panelDataArray:a}=s,l=LN(n);vt(l!=null,`No group found for id "${n}"`);const c=df(n);vt(c);const u=c.map(f=>{const h=f.getAttribute("data-panel-resize-handle-id");vt(h);const[g,v]=Uhe(n,h,a);if(g==null||v==null)return()=>{};const b=w=>{if(!w.defaultPrevented)switch(w.key){case"Enter":{w.preventDefault();const x=a.findIndex(_=>_.id===g);if(x>=0){const _=a[x];vt(_);const S=r[x],{collapsedSize:C=0,collapsible:E,minSize:P=0}=_.constraints;if(S!=null&&E){const A=ad({delta:Zr(S,C)?P-C:C-S,layout:r,panelConstraints:a.map(k=>k.constraints),pivotIndices:NN(n,h),trigger:"keyboard"});r!==A&&i(A)}}break}}};return f.addEventListener("keydown",b),()=>{f.removeEventListener("keydown",b)}});return()=>{u.forEach(f=>f())}},[e,t,n,r,o,i])}function h2(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 FN(e){return e.type==="keydown"}function jN(e){return e.type.startsWith("mouse")}function zN(e){return e.type.startsWith("touch")}function BN(e,t){const n=e==="horizontal";if(jN(t))return n?t.clientX:t.clientY;if(zN(t)){const r=t.touches[0];return vt(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function Ghe(e,t,n,r){const o=n==="horizontal",i=lv(t);vt(i);const s=i.getAttribute("data-panel-group-id");vt(s);let{initialCursorPosition:a}=r;const l=BN(n,e),c=LN(s);vt(c);const u=c.getBoundingClientRect(),f=o?u.width:u.height;return(l-a)/f*100}function Yhe(e,t,n,r,o){if(FN(e)){const i=n==="horizontal";let s=0;e.shiftKey?s=100:o!=null?s=o:s=10;let a=0;switch(e.key){case"ArrowDown":a=i?0:s;break;case"ArrowLeft":a=i?-s:0;break;case"ArrowRight":a=i?s:0;break;case"ArrowUp":a=i?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:Ghe(e,t,n,r)}function Khe({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const s=n[i];vt(s);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];vt(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function sc(e,t,n){t.forEach((r,o)=>{const i=e[o];vt(i);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:h,onExpand:g,onResize:v}=s;v&&v(r,f),u&&(h||g)&&(g&&(f==null||f===c)&&r!==c&&g(),h&&(f==null||f!==c)&&r===c&&h())}})}function jp(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Xhe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let sw=null,Ka=null;function VN(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function Qhe(){Ka!==null&&(document.head.removeChild(Ka),sw=null,Ka=null)}function t0(e){if(sw===e)return;sw=e;const t=VN(e);Ka===null&&(Ka=document.createElement("style"),document.head.appendChild(Ka)),Ka.innerHTML=`*{cursor: ${t}!important;}`}function Jhe(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function p2(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 HN(e){return`react-resizable-panels:${e}`}function WN(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function UN(e,t){try{const n=HN(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Zhe(e,t,n){var r,o;const i=(r=UN(e,n))!==null&&r!==void 0?r:{},s=WN(t);return(o=i[s])!==null&&o!==void 0?o:null}function epe(e,t,n,r,o){var i;const s=HN(e),a=WN(t),l=(i=UN(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function g2({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,s)=>i+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Zr(r,100))for(let i=0;i<t.length;i++){const s=n[i];vt(s!=null);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];vt(s!=null);const a=gc({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!Zr(o,0))for(let i=0;i<t.length;i++){const s=n[i];vt(s!=null);const a=s+o,l=gc({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,Zr(o,0)))break}return n}const tpe=100,ld={getItem:e=>(p2(ld),ld.getItem(e)),setItem:(e,t)=>{p2(ld),ld.setItem(e,t)}},m2={};function qN({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=ld,style:c,tagName:u="div",...f}){const h=X_(i),[g,v]=Kg(null),[b,w]=Kg([]),x=Ao({}),_=Ao(new Map),S=Ao(0),C=Ao({autoSaveId:e,direction:r,dragState:g,id:h,keyboardResizeBy:a,onLayout:s,storage:l}),E=Ao({layout:b,panelDataArray:[],panelDataArrayChanged:!1});Ao({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),AN(o,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:T}=E.current;return T},setLayout:T=>{const{onLayout:V}=C.current,{layout:X,panelDataArray:N}=E.current,ie=g2({layout:T,panelConstraints:N.map(fe=>fe.constraints)});h2(X,ie)||(w(ie),E.current.layout=ie,V&&V(ie),sc(N,ie,x.current))}}),[]),cf(()=>{C.current.autoSaveId=e,C.current.direction=r,C.current.dragState=g,C.current.id=h,C.current.onLayout=s,C.current.storage=l}),qhe({committedValuesRef:C,eagerValuesRef:E,groupId:h,layout:b,panelDataArray:E.current.panelDataArray,setLayout:w}),ul(()=>{const{panelDataArray:T}=E.current;if(e){if(b.length===0||b.length!==T.length)return;let V=m2[e];V==null&&(V=Jhe(epe,tpe),m2[e]=V);const X=[...T],N=new Map(_.current);V(e,X,N,b,l)}},[e,b,l]),ul(()=>{});const P=Yr(T=>{const{onLayout:V}=C.current,{layout:X,panelDataArray:N}=E.current;if(T.constraints.collapsible){const ie=N.map(se=>se.constraints),{collapsedSize:fe=0,panelSize:ue,pivotIndices:pe}=ac(N,T,X);if(vt(ue!=null),ue!==fe){_.current.set(T.id,ue);const ne=fc(N,T)===N.length-1?ue-fe:fe-ue,le=ad({delta:ne,layout:X,panelConstraints:ie,pivotIndices:pe,trigger:"imperative-api"});jp(X,le)||(w(le),E.current.layout=le,V&&V(le),sc(N,le,x.current))}}},[]),A=Yr(T=>{const{onLayout:V}=C.current,{layout:X,panelDataArray:N}=E.current;if(T.constraints.collapsible){const ie=N.map(ne=>ne.constraints),{collapsedSize:fe=0,panelSize:ue,minSize:pe=0,pivotIndices:se}=ac(N,T,X);if(ue===fe){const ne=_.current.get(T.id),le=ne!=null&&ne>=pe?ne:pe,Y=fc(N,T)===N.length-1?ue-le:le-ue,be=ad({delta:Y,layout:X,panelConstraints:ie,pivotIndices:se,trigger:"imperative-api"});jp(X,be)||(w(be),E.current.layout=be,V&&V(be),sc(N,be,x.current))}}},[]),k=Yr(T=>{const{layout:V,panelDataArray:X}=E.current,{panelSize:N}=ac(X,T,V);return vt(N!=null),N},[]),I=Yr((T,V)=>{const{panelDataArray:X}=E.current,N=fc(X,T);return Xhe({defaultSize:V,dragState:g,layout:b,panelData:X,panelIndex:N})},[g,b]),$=Yr(T=>{const{layout:V,panelDataArray:X}=E.current,{collapsedSize:N=0,collapsible:ie,panelSize:fe}=ac(X,T,V);return ie===!0&&fe===N},[]),L=Yr(T=>{const{layout:V,panelDataArray:X}=E.current,{collapsedSize:N=0,collapsible:ie,panelSize:fe}=ac(X,T,V);return vt(fe!=null),!ie||fe>N},[]),j=Yr(T=>{const{panelDataArray:V}=E.current;V.push(T),V.sort((X,N)=>{const ie=X.order,fe=N.order;return ie==null&&fe==null?0:ie==null?-1:fe==null?1:ie-fe}),E.current.panelDataArrayChanged=!0},[]);cf(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:T,onLayout:V,storage:X}=C.current,{layout:N,panelDataArray:ie}=E.current;let fe=null;if(T){const pe=Zhe(T,ie,X);pe&&(_.current=new Map(Object.entries(pe.expandToSizes)),fe=pe.layout)}fe==null&&(fe=Khe({panelDataArray:ie}));const ue=g2({layout:fe,panelConstraints:ie.map(pe=>pe.constraints)});h2(N,ue)||(w(ue),E.current.layout=ue,V&&V(ue),sc(ie,ue,x.current))}});const Q=Yr(T=>function(X){X.preventDefault();const{direction:N,dragState:ie,id:fe,keyboardResizeBy:ue,onLayout:pe}=C.current,{layout:se,panelDataArray:ne}=E.current,{initialLayout:le}=ie??{},ye=NN(fe,T);let Y=Yhe(X,T,N,ie,ue);if(Y===0)return;const be=N==="horizontal";document.dir==="rtl"&&be&&(Y=-Y);const _e=ne.map(Ue=>Ue.constraints),Pe=ad({delta:Y,layout:le??se,panelConstraints:_e,pivotIndices:ye,trigger:FN(X)?"keyboard":"mouse-or-touch"}),Te=!jp(se,Pe);(jN(X)||zN(X))&&S.current!=Y&&(S.current=Y,t0(Te?be?"horizontal":"vertical":be?Y<0?"horizontal-min":"horizontal-max":Y<0?"vertical-min":"vertical-max")),Te&&(w(Pe),E.current.layout=Pe,pe&&pe(Pe),sc(ne,Pe,x.current))},[]),ee=Yr((T,V)=>{const{onLayout:X}=C.current,{layout:N,panelDataArray:ie}=E.current,fe=ie.map(ye=>ye.constraints),{panelSize:ue,pivotIndices:pe}=ac(ie,T,N);vt(ue!=null);const ne=fc(ie,T)===ie.length-1?ue-V:V-ue,le=ad({delta:ne,layout:N,panelConstraints:fe,pivotIndices:pe,trigger:"imperative-api"});jp(N,le)||(w(le),E.current.layout=le,X&&X(le),sc(ie,le,x.current))},[]),B=Yr((T,V)=>{const{direction:X}=C.current,{layout:N}=E.current,ie=lv(T);vt(ie);const fe=BN(X,V);v({dragHandleId:T,dragHandleRect:ie.getBoundingClientRect(),initialCursorPosition:fe,initialLayout:N})},[]),Z=Yr(()=>{Qhe(),v(null)},[]),G=Yr(T=>{const{panelDataArray:V}=E.current,X=fc(V,T);X>=0&&(V.splice(X,1),delete x.current[T.id],E.current.panelDataArrayChanged=!0)},[]),q=Bhe(()=>({collapsePanel:P,direction:r,dragState:g,expandPanel:A,getPanelSize:k,getPanelStyle:I,groupId:h,isPanelCollapsed:$,isPanelExpanded:L,registerPanel:j,registerResizeHandle:Q,resizePanel:ee,startDragging:B,stopDragging:Z,unregisterPanel:G}),[P,g,r,A,k,I,h,$,L,j,Q,ee,B,Z,G]),K={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return tu(av.Provider,{value:q},tu(u,{...f,children:t,className:n,style:{...K,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h}))}const GN=TN((e,t)=>tu(qN,{...e,forwardedRef:t}));qN.displayName="PanelGroup";GN.displayName="forwardRef(PanelGroup)";function fc(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function ac(e,t,n){const r=e.map(c=>c.constraints),o=fc(e,t),i=r[o],a=o===e.length-1?[o-1,o]:[o,o+1],l=n[o];return{...i,panelSize:l,pivotIndices:a}}function npe({disabled:e,handleId:t,resizeHandler:n}){ul(()=>{if(e||n==null)return;const r=lv(t);if(r==null)return;const o=i=>{if(!i.defaultPrevented)switch(i.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{i.preventDefault(),n(i);break}case"F6":{i.preventDefault();const s=r.getAttribute("data-panel-group-id");vt(s);const a=df(s),l=IN(s,t);vt(l!==null);const c=i.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function Q_({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:s=0,tagName:a="div",...l}){const c=Ao(null),u=Ao({onDragging:o});ul(()=>{u.current.onDragging=o});const f=DN(av);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:h,dragState:g,groupId:v,registerResizeHandle:b,startDragging:w,stopDragging:x}=f,_=X_(r),S=(g==null?void 0:g.dragHandleId)===_,[C,E]=Kg(!1),[P,A]=Kg(null),k=Yr(()=>{const $=c.current;vt($),$.blur(),x();const{onDragging:L}=u.current;L&&L(!1)},[x]);ul(()=>{if(n)A(null);else{const $=b(_);A(()=>$)}},[n,_,b]),ul(()=>{if(n||P==null||!S)return;const $=ee=>{P(ee)},L=ee=>{P(ee)},j=c.current;vt(j);const Q=j.ownerDocument;return Q.body.addEventListener("contextmenu",k),Q.body.addEventListener("mousemove",$),Q.body.addEventListener("touchmove",$),Q.body.addEventListener("mouseleave",L),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),()=>{Q.body.removeEventListener("contextmenu",k),Q.body.removeEventListener("mousemove",$),Q.body.removeEventListener("touchmove",$),Q.body.removeEventListener("mouseleave",L),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k)}},[h,n,S,P,k]),npe({disabled:n,handleId:_,resizeHandler:P});const I={cursor:VN(h),touchAction:"none",userSelect:"none"};return tu(a,{...l,children:e,className:t,onBlur:()=>E(!1),onFocus:()=>E(!0),onMouseDown:$=>{w(_,$.nativeEvent);const L=u.current;vt(L);const{onDragging:j}=L;j&&j(!0)},onMouseUp:k,onTouchCancel:k,onTouchEnd:k,onTouchStart:$=>{w(_,$.nativeEvent);const L=u.current;vt(L);const{onDragging:j}=L;j&&j(!0)},ref:c,role:"separator",style:{...I,...i},tabIndex:s,"data-panel-group-direction":h,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":S?"pointer":C?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}Q_.displayName="PanelResizeHandle";const YN=({className:e,...t})=>O.jsx(GN,{className:Ce("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),aw=kN,rpe=({withHandle:e,className:t,...n})=>O.jsx(Q_,{className:Ce("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&&O.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:O.jsx(tQ,{className:"h-2.5 w-2.5"})})}),ope=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>O.jsx(Q_,{className:Ce("relative flex w-px items-start justify-end bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",{"justify-start":r},t),...o,children:e&&O.jsx("div",{className:Ce("z-50 flex items-center justify-start",{"border-l":r}),children:O.jsx(xr,{variant:"secondary",className:Ce("h-7 p-1",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-2 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?O.jsx(E1,{className:"size-4"}):O.jsx(N$,{className:"size-4"})})})});function ipe(e,t=[]){let n=[];function r(i,s){const a=H.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:g,...v}=f,b=(h==null?void 0:h[e][l])||a,w=H.useMemo(()=>v,Object.values(v));return O.jsx(b.Provider,{value:w,children:g})}function u(f,h){const g=(h==null?void 0:h[e][l])||a,v=H.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>H.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return H.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,spe(o,...t)]}function spe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return H.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ape(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function lpe(...e){return t=>e.forEach(n=>ape(n,t))}function KN(...e){return H.useCallback(lpe(...e),e)}function oa(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function cpe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function upe(...e){return t=>e.forEach(n=>cpe(n,t))}function Al(...e){return H.useCallback(upe(...e),e)}function dpe(e,t){const n=H.createContext(t);function r(i){const{children:s,...a}=i,l=H.useMemo(()=>a,Object.values(a));return O.jsx(n.Provider,{value:l,children:s})}function o(i){const s=H.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,o]}function fpe(e,t=[]){let n=[];function r(i,s){const a=H.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:g,...v}=f,b=(h==null?void 0:h[e][l])||a,w=H.useMemo(()=>v,Object.values(v));return O.jsx(b.Provider,{value:w,children:g})}function u(f,h){const g=(h==null?void 0:h[e][l])||a,v=H.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>H.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return H.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,hpe(o,...t)]}function hpe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return H.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Xg=globalThis!=null&&globalThis.document?H.useLayoutEffect:()=>{},ppe=H.useId||(()=>{}),gpe=0;function n0(e){const[t,n]=H.useState(ppe());return Xg(()=>{e||n(r=>r??String(gpe++))},[e]),e||(t?`radix-${t}`:"")}function xl(e){const t=H.useRef(e);return H.useEffect(()=>{t.current=e}),H.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function mpe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=vpe({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=xl(n),l=H.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function vpe({defaultProp:e,onChange:t}){const n=H.useState(e),[r]=n,o=H.useRef(r),i=xl(t);return H.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var bpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ps=bpe.reduce((e,t)=>{const n=H.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Um:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ype(e,t){e&&pw.flushSync(()=>e.dispatchEvent(t))}function xpe(e,t=globalThis==null?void 0:globalThis.document){const n=xl(e);H.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var wpe="DismissableLayer",lw="dismissableLayer.update",_pe="dismissableLayer.pointerDownOutside",Spe="dismissableLayer.focusOutside",v2,XN=H.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),QN=H.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=H.useContext(XN),[u,f]=H.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=H.useState({}),v=Al(t,A=>f(A)),b=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(w),_=u?b.indexOf(u):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,C=_>=x,E=Rpe(A=>{const k=A.target,I=[...c.branches].some($=>$.contains(k));!C||I||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},h),P=Ope(A=>{const k=A.target;[...c.branches].some($=>$.contains(k))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},h);return xpe(A=>{_===c.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},h),H.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(v2=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),b2(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=v2)}},[u,h,n,c]),H.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),b2())},[u,c]),H.useEffect(()=>{const A=()=>g({});return document.addEventListener(lw,A),()=>document.removeEventListener(lw,A)},[]),O.jsx(ps.div,{...l,ref:v,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:oa(e.onFocusCapture,P.onFocusCapture),onBlurCapture:oa(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:oa(e.onPointerDownCapture,E.onPointerDownCapture)})});QN.displayName=wpe;var Cpe="DismissableLayerBranch",Epe=H.forwardRef((e,t)=>{const n=H.useContext(XN),r=H.useRef(null),o=Al(t,r);return H.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),O.jsx(ps.div,{...e,ref:o})});Epe.displayName=Cpe;function Rpe(e,t=globalThis==null?void 0:globalThis.document){const n=xl(e),r=H.useRef(!1),o=H.useRef(()=>{});return H.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){JN(_pe,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ope(e,t=globalThis==null?void 0:globalThis.document){const n=xl(e),r=H.useRef(!1);return H.useEffect(()=>{const o=i=>{i.target&&!r.current&&JN(Spe,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function b2(){const e=new CustomEvent(lw);document.dispatchEvent(e)}function JN(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ype(o,i):o.dispatchEvent(i)}var r0="focusScope.autoFocusOnMount",o0="focusScope.autoFocusOnUnmount",y2={bubbles:!1,cancelable:!0},Ppe="FocusScope",ZN=H.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=H.useState(null),c=xl(o),u=xl(i),f=H.useRef(null),h=Al(t,b=>l(b)),g=H.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;H.useEffect(()=>{if(r){let b=function(S){if(g.paused||!a)return;const C=S.target;a.contains(C)?f.current=C:js(f.current,{select:!0})},w=function(S){if(g.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||js(f.current,{select:!0}))},x=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&js(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const _=new MutationObserver(x);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),_.disconnect()}}},[r,a,g.paused]),H.useEffect(()=>{if(a){w2.add(g);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(r0,y2);a.addEventListener(r0,c),a.dispatchEvent(x),x.defaultPrevented||(Tpe(Mpe(e5(a)),{select:!0}),document.activeElement===b&&js(a))}return()=>{a.removeEventListener(r0,c),setTimeout(()=>{const x=new CustomEvent(o0,y2);a.addEventListener(o0,u),a.dispatchEvent(x),x.defaultPrevented||js(b??document.body,{select:!0}),a.removeEventListener(o0,u),w2.remove(g)},0)}}},[a,c,u,g]);const v=H.useCallback(b=>{if(!n&&!r||g.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(w&&x){const _=b.currentTarget,[S,C]=Dpe(_);S&&C?!b.shiftKey&&x===C?(b.preventDefault(),n&&js(S,{select:!0})):b.shiftKey&&x===S&&(b.preventDefault(),n&&js(C,{select:!0})):x===_&&b.preventDefault()}},[n,r,g.paused]);return O.jsx(ps.div,{tabIndex:-1,...s,ref:h,onKeyDown:v})});ZN.displayName=Ppe;function Tpe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(js(r,{select:t}),document.activeElement!==n)return}function Dpe(e){const t=e5(e),n=x2(t,e),r=x2(t.reverse(),e);return[n,r]}function e5(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function x2(e,t){for(const n of e)if(!Ape(n,{upTo:t}))return n}function Ape(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 $pe(e){return e instanceof HTMLInputElement&&"select"in e}function js(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&$pe(e)&&t&&e.select()}}var w2=kpe();function kpe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_2(e,t),e.unshift(t)},remove(t){var n;e=_2(e,t),(n=e[0])==null||n.resume()}}}function _2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Mpe(e){return e.filter(t=>t.tagName!=="A")}var Ipe="Portal",t5=H.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=H.useState(!1);Xg(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Mo.createPortal(O.jsx(ps.div,{...r,ref:t}),s):null});t5.displayName=Ipe;function Npe(e,t){return H.useReducer((n,r)=>t[n][r]??n,e)}var cv=e=>{const{present:t,children:n}=e,r=Lpe(t),o=typeof n=="function"?n({present:r.isPresent}):H.Children.only(n),i=Al(r.ref,Fpe(o));return typeof n=="function"||r.isPresent?H.cloneElement(o,{ref:i}):null};cv.displayName="Presence";function Lpe(e){const[t,n]=H.useState(),r=H.useRef({}),o=H.useRef(e),i=H.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Npe(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return H.useEffect(()=>{const c=zp(r.current);i.current=a==="mounted"?c:"none"},[a]),Xg(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,g=zp(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Xg(()=>{if(t){const c=f=>{const g=zp(r.current).includes(f.animationName);f.target===t&&g&&pw.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=zp(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:H.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function zp(e){return(e==null?void 0:e.animationName)||"none"}function Fpe(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var i0=0;function jpe(){H.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??S2()),document.body.insertAdjacentElement("beforeend",e[1]??S2()),i0++,()=>{i0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),i0--}},[])}function S2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var n5=Nk(),s0=function(){},uv=H.forwardRef(function(e,t){var n=H.useRef(null),r=H.useState({onScrollCapture:s0,onWheelCapture:s0,onTouchMoveCapture:s0}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,h=e.sideCar,g=e.noIsolation,v=e.inert,b=e.allowPinchZoom,w=e.as,x=w===void 0?"div":w,_=e.gapMode,S=t_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,E=Ik([n,t]),P=lr(lr({},S),o);return H.createElement(H.Fragment,null,u&&H.createElement(C,{sideCar:n5,removeScrollBar:c,shards:f,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:_}),s?H.cloneElement(H.Children.only(a),lr(lr({},P),{ref:E})):H.createElement(x,lr({},P,{className:l,ref:E}),a))});uv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};uv.classNames={fullWidth:wd,zeroRight:xd};var cw=!1;if(typeof window<"u")try{var Bp=Object.defineProperty({},"passive",{get:function(){return cw=!0,!0}});window.addEventListener("test",Bp,Bp),window.removeEventListener("test",Bp,Bp)}catch{cw=!1}var lc=cw?{passive:!1}:!1,zpe=function(e){return e.tagName==="TEXTAREA"},r5=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zpe(e)&&n[t]==="visible")},Bpe=function(e){return r5(e,"overflowY")},Vpe=function(e){return r5(e,"overflowX")},C2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=o5(e,r);if(o){var i=i5(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Hpe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Wpe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},o5=function(e,t){return e==="v"?Bpe(t):Vpe(t)},i5=function(e,t){return e==="v"?Hpe(t):Wpe(t)},Upe=function(e,t){return e==="h"&&t==="rtl"?-1:1},qpe=function(e,t,n,r,o){var i=Upe(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,h=0;do{var g=i5(e,a),v=g[0],b=g[1],w=g[2],x=b-w-i*v;(v||x)&&o5(e,a)&&(f+=x,h+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&Math.abs(f)<1||!o&&s>f)||!u&&(o&&Math.abs(h)<1||!o&&-s>h))&&(c=!0),c},Vp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},E2=function(e){return[e.deltaX,e.deltaY]},R2=function(e){return e&&"current"in e?e.current:e},Gpe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ype=function(e){return`
|
|
413
413
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
414
414
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
415
415
|
`)},Kpe=0,cc=[];function Xpe(e){var t=H.useRef([]),n=H.useRef([0,0]),r=H.useRef(),o=H.useState(Kpe++)[0],i=H.useState(n_)[0],s=H.useRef(e);H.useEffect(function(){s.current=e},[e]),H.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=Mk([e.lockRef.current],(e.shards||[]).map(R2),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=H.useCallback(function(b,w){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=Vp(b),_=n.current,S="deltaX"in b?b.deltaX:_[0]-x[0],C="deltaY"in b?b.deltaY:_[1]-x[1],E,P=b.target,A=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in b&&A==="h"&&P.type==="range")return!1;var k=C2(A,P);if(!k)return!0;if(k?E=A:(E=A==="v"?"h":"v",k=C2(A,P)),!k)return!1;if(!r.current&&"changedTouches"in b&&(S||C)&&(r.current=E),!E)return!0;var I=r.current||E;return qpe(I,w,b,I==="h"?S:C,!0)},[]),l=H.useCallback(function(b){var w=b;if(!(!cc.length||cc[cc.length-1]!==i)){var x="deltaY"in w?E2(w):Vp(w),_=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&Gpe(E.delta,x)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(R2).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=S.length>0?a(w,S[0]):!s.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),c=H.useCallback(function(b,w,x,_){var S={name:b,delta:w,target:x,should:_,shadowParent:Qpe(x)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=H.useCallback(function(b){n.current=Vp(b),r.current=void 0},[]),f=H.useCallback(function(b){c(b.type,E2(b),b.target,a(b,e.lockRef.current))},[]),h=H.useCallback(function(b){c(b.type,Vp(b),b.target,a(b,e.lockRef.current))},[]);H.useEffect(function(){return cc.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,lc),document.addEventListener("touchmove",l,lc),document.addEventListener("touchstart",u,lc),function(){cc=cc.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,lc),document.removeEventListener("touchmove",l,lc),document.removeEventListener("touchstart",u,lc)}},[]);var g=e.removeScrollBar,v=e.inert;return H.createElement(H.Fragment,null,v?H.createElement(i,{styles:Ype(o)}):null,g?H.createElement(zk,{gapMode:e.gapMode}):null)}function Qpe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Jpe=Fk(n5,Xpe);var s5=H.forwardRef(function(e,t){return H.createElement(uv,lr({},e,{ref:t,sideCar:Jpe}))});s5.classNames=uv.classNames;const Zpe=s5;var J_="Dialog",[a5,l5]=fpe(J_),[ege,ti]=a5(J_),c5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=H.useRef(null),l=H.useRef(null),[c=!1,u]=mpe({prop:r,defaultProp:o,onChange:i});return O.jsx(ege,{scope:t,triggerRef:a,contentRef:l,contentId:n0(),titleId:n0(),descriptionId:n0(),open:c,onOpenChange:u,onOpenToggle:H.useCallback(()=>u(f=>!f),[u]),modal:s,children:n})};c5.displayName=J_;var u5="DialogTrigger",d5=H.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ti(u5,n),i=Al(t,o.triggerRef);return O.jsx(ps.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":tS(o.open),...r,ref:i,onClick:oa(e.onClick,o.onOpenToggle)})});d5.displayName=u5;var Z_="DialogPortal",[tge,f5]=a5(Z_,{forceMount:void 0}),h5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=ti(Z_,t);return O.jsx(tge,{scope:t,forceMount:n,children:H.Children.map(r,s=>O.jsx(cv,{present:n||i.open,children:O.jsx(t5,{asChild:!0,container:o,children:s})}))})};h5.displayName=Z_;var Qg="DialogOverlay",p5=H.forwardRef((e,t)=>{const n=f5(Qg,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ti(Qg,e.__scopeDialog);return i.modal?O.jsx(cv,{present:r||i.open,children:O.jsx(nge,{...o,ref:t})}):null});p5.displayName=Qg;var nge=H.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ti(Qg,n);return O.jsx(Zpe,{as:Um,allowPinchZoom:!0,shards:[o.contentRef],children:O.jsx(ps.div,{"data-state":tS(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),wl="DialogContent",g5=H.forwardRef((e,t)=>{const n=f5(wl,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ti(wl,e.__scopeDialog);return O.jsx(cv,{present:r||i.open,children:i.modal?O.jsx(rge,{...o,ref:t}):O.jsx(oge,{...o,ref:t})})});g5.displayName=wl;var rge=H.forwardRef((e,t)=>{const n=ti(wl,e.__scopeDialog),r=H.useRef(null),o=Al(t,n.contentRef,r);return H.useEffect(()=>{const i=r.current;if(i)return zm(i)},[]),O.jsx(m5,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oa(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:oa(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:oa(e.onFocusOutside,i=>i.preventDefault())})}),oge=H.forwardRef((e,t)=>{const n=ti(wl,e.__scopeDialog),r=H.useRef(!1),o=H.useRef(!1);return O.jsx(m5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),m5=H.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=ti(wl,n),l=H.useRef(null),c=Al(t,l);return jpe(),O.jsxs(O.Fragment,{children:[O.jsx(ZN,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:O.jsx(QN,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":tS(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),O.jsxs(O.Fragment,{children:[O.jsx(sge,{titleId:a.titleId}),O.jsx(lge,{contentRef:l,descriptionId:a.descriptionId})]})]})}),eS="DialogTitle",v5=H.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ti(eS,n);return O.jsx(ps.h2,{id:o.titleId,...r,ref:t})});v5.displayName=eS;var b5="DialogDescription",y5=H.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ti(b5,n);return O.jsx(ps.p,{id:o.descriptionId,...r,ref:t})});y5.displayName=b5;var x5="DialogClose",w5=H.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ti(x5,n);return O.jsx(ps.button,{type:"button",...r,ref:t,onClick:oa(e.onClick,()=>o.onOpenChange(!1))})});w5.displayName=x5;function tS(e){return e?"open":"closed"}var _5="DialogTitleWarning",[ige,S5]=dpe(_5,{contentName:wl,titleName:eS,docsSlug:"dialog"}),sge=({titleId:e})=>{const t=S5(_5),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
@@ -422,7 +422,7 @@ You can add a description to the \`${Sc}\` by passing a \`${M5}\` component as a
|
|
|
422
422
|
|
|
423
423
|
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 \`${Sc}\`. 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.
|
|
424
424
|
|
|
425
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return H.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},yge=P5,xge=T5,j5=D5,z5=A5,B5=N5,V5=F5,H5=k5,W5=I5;const wge=yge,_ge=xge,U5=H.forwardRef(({className:e,...t},n)=>O.jsx(j5,{className:Ce("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}));U5.displayName=j5.displayName;const q5=H.forwardRef(({className:e,...t},n)=>O.jsx(_ge,{children:O.jsxs(au,{children:[O.jsx(U5,{}),O.jsx(z5,{ref:n,className:Ce("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})]})}));q5.displayName=z5.displayName;const G5=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});G5.displayName="AlertDialogHeader";const Y5=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Y5.displayName="AlertDialogFooter";const K5=H.forwardRef(({className:e,...t},n)=>O.jsx(H5,{ref:n,className:Ce("text-lg font-semibold",e),...t}));K5.displayName=H5.displayName;const X5=H.forwardRef(({className:e,...t},n)=>O.jsx(W5,{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));X5.displayName=W5.displayName;const Q5=H.forwardRef(({className:e,...t},n)=>O.jsx(B5,{ref:n,className:Ce(Vd(),e),...t}));Q5.displayName=B5.displayName;const J5=H.forwardRef(({className:e,...t},n)=>O.jsx(V5,{ref:n,className:Ce(Vd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));J5.displayName=V5.displayName;function Sge({open:e,setOpen:t}){const n=$e(i=>i.selectedSheetId),{deleteSheet:r}=co();function o(){n&&(r(n),t(!1))}return O.jsx(wge,{open:e,onOpenChange:t,children:O.jsxs(q5,{children:[O.jsxs(G5,{children:[O.jsx(K5,{children:"Delete Sheet"}),O.jsx(X5,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),O.jsxs(Y5,{children:[O.jsx(J5,{children:"Cancel"}),O.jsx(Q5,{onClick:o,children:"Delete"})]})]})})}function Z5(){var b,w;const[e,t]=m.useState(!1),n=$e(x=>{var _;return(_=x.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=ma(),o=m.useRef(null),[i,s]=m.useState(!1),a=$e(x=>x.isDashboardEditing),l=$e(x=>x.themeStyle);$e(x=>x.isVisualEditing);const c=$e(x=>x.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:f,addSheet:h}=co();if(!n)return null;function g(x){var _,S;x?((_=o.current)==null||_.resize(35),s(!0)):(s(!1),(S=o.current)==null||S.resize(0))}function v(){const x={id:la(),title:"New Sheet"};h(x)}return O.jsxs(kw,{role:"dashboard-tabs-container",className:Ce("relative flex grow flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:x=>{u(x)},value:c||n[0].id,children:[O.jsx("div",{children:(n.length>1||a)&&O.jsxs(dm,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(x=>{var _,S;return O.jsx(is,{text:x.title,onSave:C=>f(x.id,C),children:O.jsxs(fm,{style:{borderRadius:(S=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:S.borderRadius},onClick:()=>u(x.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:x.id,children:[x.title,a&&c===x.id&&n.length>1&&O.jsx($m,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},x.id)}),a&&O.jsx("div",{style:{borderRadius:(w=(b=l==null?void 0:l.chart)==null?void 0:b.options)==null?void 0:w.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:v,children:O.jsx(R1,{className:"size-3"})})]})}),O.jsxs(YN,{className:"grow",direction:"horizontal",children:[O.jsx(aw,{children:O.jsx("div",{style:{},children:n==null?void 0:n.map(x=>O.jsx(Mw,{className:Ce("mt-0",{"bg-muted":(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)}),value:x.id,children:O.jsx(Hae,{})},x.id))})}),r===!0&&O.jsxs(O.Fragment,{children:[O.jsx(ope,{open:i,onTabClick:g,withHandle:!0}),O.jsx(aw,{onResize:x=>{x<1?s(!1):i||s(!0)},defaultSize:0,ref:o,children:O.jsx(Lhe,{})})]})]}),O.jsx(Sge,{open:e,setOpen:t})]})}function eL({children:e}){return O.jsx(bB,{defaultTheme:"system",storageKey:"vite-ui-theme",children:O.jsx(DJ,{delayDuration:0,children:e})})}function tL(e){return O.jsx(dk,{dashboardProps:e,children:O.jsx(eL,{children:O.jsx(RD,{...e,children:O.jsx(Z5,{})})})})}const nL=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Ege);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(uw,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(uw,he({},r,{ref:t}),n)});nL.displayName="Slot";const uw=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Rge(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});uw.displayName="SlotClone";const Cge=({children:e})=>m.createElement(m.Fragment,null,e);function Ege(e){return m.isValidElement(e)&&e.type===Cge}function Rge(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const dw=["Enter"," "],Oge=["ArrowDown","PageUp","Home"],rL=["ArrowUp","PageDown","End"],Pge=[...Oge,...rL],Tge={ltr:[...dw,"ArrowRight"],rtl:[...dw,"ArrowLeft"]},Dge={ltr:["ArrowLeft"],rtl:["ArrowRight"]},dv="Menu",[ff,Age,$ge]=um(dv),[$l,oL]=Zn(dv,[$ge,Ti,ou]),aS=Ti(),iL=ou(),[kge,kl]=$l(dv),[Mge,eh]=$l(dv),Ige=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=aS(t),[l,c]=m.useState(null),u=m.useRef(!1),f=Ln(i),h=_l(o);return m.useEffect(()=>{const g=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Bf,a,m.createElement(kge,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(Mge,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:h,modal:s},r)))},sL=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=aS(n);return m.createElement(Vf,he({},o,r,{ref:t}))}),aL="MenuPortal",[Nge,lL]=$l(aL,{forceMount:void 0}),Lge=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=kl(aL,t);return m.createElement(Nge,{scope:t,forceMount:n},m.createElement(er,{present:n||i.open},m.createElement(M1,{asChild:!0,container:o},r)))},Qo="MenuContent",[Fge,lS]=$l(Qo),jge=m.forwardRef((e,t)=>{const n=lL(Qo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Qo,e.__scopeMenu),s=eh(Qo,e.__scopeMenu);return m.createElement(ff.Provider,{scope:e.__scopeMenu},m.createElement(er,{present:r||i.open},m.createElement(ff.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(zge,he({},o,{ref:t})):m.createElement(Bge,he({},o,{ref:t})))))}),zge=m.forwardRef((e,t)=>{const n=kl(Qo,e.__scopeMenu),r=m.useRef(null),o=_t(t,r);return m.useEffect(()=>{const i=r.current;if(i)return zm(i)},[]),m.createElement(cS,he({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),Bge=m.forwardRef((e,t)=>{const n=kl(Qo,e.__scopeMenu);return m.createElement(cS,he({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),cS=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:g,disableOutsideScroll:v,...b}=e,w=kl(Qo,n),x=eh(Qo,n),_=aS(n),S=iL(n),C=Age(n),[E,P]=m.useState(null),A=m.useRef(null),k=_t(t,A,w.onContentChange),I=m.useRef(0),$=m.useRef(""),L=m.useRef(0),j=m.useRef(null),Q=m.useRef("right"),ee=m.useRef(0),B=v?r_:m.Fragment,Z=v?{as:nL,allowPinchZoom:!0}:void 0,G=K=>{var T,V;const X=$.current+K,N=C().filter(ne=>!ne.disabled),ie=document.activeElement,fe=(T=N.find(ne=>ne.ref.current===ie))===null||T===void 0?void 0:T.textValue,ue=N.map(ne=>ne.textValue),pe=sme(ue,X,fe),se=(V=N.find(ne=>ne.textValue===pe))===null||V===void 0?void 0:V.ref.current;(function ne(le){$.current=le,window.clearTimeout(I.current),le!==""&&(I.current=window.setTimeout(()=>ne(""),1e3))})(X),se&&setTimeout(()=>se.focus())};m.useEffect(()=>()=>window.clearTimeout(I.current),[]),Z1();const q=m.useCallback(K=>{var T,V;return Q.current===((T=j.current)===null||T===void 0?void 0:T.side)&&lme(K,(V=j.current)===null||V===void 0?void 0:V.area)},[]);return m.createElement(Fge,{scope:n,searchRef:$,onItemEnter:m.useCallback(K=>{q(K)&&K.preventDefault()},[q]),onItemLeave:m.useCallback(K=>{var T;q(K)||((T=A.current)===null||T===void 0||T.focus(),P(null))},[q]),onTriggerLeave:m.useCallback(K=>{q(K)&&K.preventDefault()},[q]),pointerGraceTimerRef:L,onPointerGraceIntentChange:m.useCallback(K=>{j.current=K},[])},m.createElement(B,Z,m.createElement(e_,{asChild:!0,trapped:o,onMountAutoFocus:Me(i,K=>{var T;K.preventDefault(),(T=A.current)===null||T===void 0||T.focus()}),onUnmountAutoFocus:s},m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:g},m.createElement(Dw,he({asChild:!0},S,{dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:P,onEntryFocus:Me(l,K=>{x.isUsingKeyboardRef.current||K.preventDefault()})}),m.createElement(Hf,he({role:"menu","aria-orientation":"vertical","data-state":hL(w.open),"data-radix-menu-content":"",dir:x.dir},_,b,{ref:k,style:{outline:"none",...b.style},onKeyDown:Me(b.onKeyDown,K=>{const V=K.target.closest("[data-radix-menu-content]")===K.currentTarget,X=K.ctrlKey||K.altKey||K.metaKey,N=K.key.length===1;V&&(K.key==="Tab"&&K.preventDefault(),!X&&N&&G(K.key));const ie=A.current;if(K.target!==ie||!Pge.includes(K.key))return;K.preventDefault();const ue=C().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);rL.includes(K.key)&&ue.reverse(),ome(ue)}),onBlur:Me(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(I.current),$.current="")}),onPointerMove:Me(e.onPointerMove,hf(K=>{const T=K.target,V=ee.current!==K.clientX;if(K.currentTarget.contains(T)&&V){const X=K.clientX>ee.current?"right":"left";Q.current=X,ee.current=K.clientX}}))})))))))}),Vge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({role:"group"},r,{ref:t}))}),Hge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({},r,{ref:t}))}),fw="MenuItem",O2="menu.itemSelect",uS=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=eh(fw,e.__scopeMenu),a=lS(fw,e.__scopeMenu),l=_t(t,i),c=m.useRef(!1),u=()=>{const f=i.current;if(!n&&f){const h=new CustomEvent(O2,{bubbles:!0,cancelable:!0});f.addEventListener(O2,g=>r==null?void 0:r(g),{once:!0}),PD(f,h),h.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(cL,he({},o,{ref:l,disabled:n,onClick:Me(e.onClick,u),onPointerDown:f=>{var h;(h=e.onPointerDown)===null||h===void 0||h.call(e,f),c.current=!0},onPointerUp:Me(e.onPointerUp,f=>{var h;c.current||(h=f.currentTarget)===null||h===void 0||h.click()}),onKeyDown:Me(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||dw.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),cL=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=lS(fw,n),a=iL(n),l=m.useRef(null),c=_t(t,l),[u,f]=m.useState(!1),[h,g]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var b;g(((b=v.textContent)!==null&&b!==void 0?b:"").trim())}},[i.children]),m.createElement(ff.ItemSlot,{scope:n,disabled:r,textValue:o??h},m.createElement(Aw,he({asChild:!0},a,{focusable:!r}),m.createElement(Qe.div,he({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:Me(e.onPointerMove,hf(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Me(e.onPointerLeave,hf(v=>s.onItemLeave(v))),onFocus:Me(e.onFocus,()=>f(!0)),onBlur:Me(e.onBlur,()=>f(!1))}))))}),Wge=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(dL,{scope:e.__scopeMenu,checked:n},m.createElement(uS,he({role:"menuitemcheckbox","aria-checked":Jg(n)?"mixed":n},o,{ref:t,"data-state":dS(n),onSelect:Me(o.onSelect,()=>r==null?void 0:r(Jg(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),Uge="MenuRadioGroup",[qge,Gge]=$l(Uge,{value:void 0,onValueChange:()=>{}}),Yge=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Ln(r);return m.createElement(qge,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(Vge,he({},o,{ref:t})))}),Kge="MenuRadioItem",Xge=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=Gge(Kge,e.__scopeMenu),i=n===o.value;return m.createElement(dL,{scope:e.__scopeMenu,checked:i},m.createElement(uS,he({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":dS(i),onSelect:Me(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),uL="MenuItemIndicator",[dL,Qge]=$l(uL,{checked:!1}),Jge=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Qge(uL,n);return m.createElement(er,{present:r||Jg(i.checked)||i.checked===!0},m.createElement(Qe.span,he({},o,{ref:t,"data-state":dS(i.checked)})))}),Zge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),eme="MenuSub",[Rye,fL]=$l(eme),Hp="MenuSubTrigger",tme=m.forwardRef((e,t)=>{const n=kl(Hp,e.__scopeMenu),r=eh(Hp,e.__scopeMenu),o=fL(Hp,e.__scopeMenu),i=lS(Hp,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(sL,he({asChild:!0},c),m.createElement(cL,he({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":hL(n.open)},e,{ref:cs(t,o.onTriggerChange),onClick:f=>{var h;(h=e.onClick)===null||h===void 0||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Me(e.onPointerMove,hf(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Me(e.onPointerLeave,hf(f=>{var h;u();const g=(h=n.content)===null||h===void 0?void 0:h.getBoundingClientRect();if(g){var v;const b=(v=n.content)===null||v===void 0?void 0:v.dataset.side,w=b==="right",x=w?-5:5,_=g[w?"left":"right"],S=g[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:_,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:_,y:g.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Me(e.onKeyDown,f=>{const h=i.searchRef.current!=="";if(!(e.disabled||h&&f.key===" ")&&Tge[r.dir].includes(f.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),f.preventDefault()}})})))}),nme="MenuSubContent",rme=m.forwardRef((e,t)=>{const n=lL(Qo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Qo,e.__scopeMenu),s=eh(Qo,e.__scopeMenu),a=fL(nme,e.__scopeMenu),l=m.useRef(null),c=_t(t,l);return m.createElement(ff.Provider,{scope:e.__scopeMenu},m.createElement(er,{present:r||i.open},m.createElement(ff.Slot,{scope:e.__scopeMenu},m.createElement(cS,he({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Me(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Me(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Me(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),h=Dge[s.dir].includes(u.key);if(f&&h){var g;i.onOpenChange(!1),(g=a.trigger)===null||g===void 0||g.focus(),u.preventDefault()}})})))))});function hL(e){return e?"open":"closed"}function Jg(e){return e==="indeterminate"}function dS(e){return Jg(e)?"indeterminate":e?"checked":"unchecked"}function ome(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ime(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function sme(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=ime(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function ame(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function lme(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ame(n,t)}function hf(e){return t=>t.pointerType==="mouse"?e(t):void 0}const cme=Ige,ume=sL,dme=Lge,fme=jge,hme=Hge,pme=uS,gme=Wge,mme=Yge,vme=Xge,bme=Jge,yme=Zge,xme=tme,wme=rme,pL="DropdownMenu",[_me,Oye]=Zn(pL,[oL]),po=oL(),[Sme,gL]=_me(pL),Cme=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=po(t),c=m.useRef(null),[u=!1,f]=wr({prop:o,defaultProp:i,onChange:s});return m.createElement(Sme,{scope:t,triggerId:Jo(),triggerRef:c,contentId:Jo(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:a},m.createElement(cme,he({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},Eme="DropdownMenuTrigger",Rme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=gL(Eme,n),s=po(n);return m.createElement(ume,he({asChild:!0},s),m.createElement(Qe.button,he({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:cs(t,i.triggerRef),onPointerDown:Me(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Me(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),Ome=e=>{const{__scopeDropdownMenu:t,...n}=e,r=po(t);return m.createElement(dme,he({},r,n))},Pme="DropdownMenuContent",Tme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=gL(Pme,n),i=po(n),s=m.useRef(!1);return m.createElement(fme,he({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:Me(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Me(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Dme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(hme,he({},o,r,{ref:t}))}),Ame=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(pme,he({},o,r,{ref:t}))}),$me=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(gme,he({},o,r,{ref:t}))}),kme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(mme,he({},o,r,{ref:t}))}),Mme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(vme,he({},o,r,{ref:t}))}),Ime=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(bme,he({},o,r,{ref:t}))}),Nme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(yme,he({},o,r,{ref:t}))}),Lme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(xme,he({},o,r,{ref:t}))}),Fme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(wme,he({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),jme=Cme,zme=Rme,Bme=Ome,mL=Tme,vL=Dme,bL=Ame,yL=$me,Vme=kme,xL=Mme,wL=Ime,_L=Nme,SL=Lme,CL=Fme,Hme=jme,Wme=zme,Ume=Vme,qme=H.forwardRef(({className:e,inset:t,children:n,...r},o)=>O.jsxs(SL,{ref:o,className:Ce("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,O.jsx(E1,{className:"ml-auto h-4 w-4"})]}));qme.displayName=SL.displayName;const Gme=H.forwardRef(({className:e,...t},n)=>O.jsx(CL,{ref:n,className:Ce("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}));Gme.displayName=CL.displayName;const EL=H.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(Bme,{children:O.jsx(au,{children:O.jsx(mL,{ref:r,sideOffset:t,className:Ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})}));EL.displayName=mL.displayName;const Yme=H.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(bL,{ref:r,className:Ce("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}));Yme.displayName=bL.displayName;const Kme=H.forwardRef(({className:e,children:t,checked:n,...r},o)=>O.jsxs(yL,{ref:o,className:Ce("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(wL,{children:O.jsx(Ff,{className:"h-4 w-4"})})}),t]}));Kme.displayName=yL.displayName;const RL=H.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(xL,{ref:r,className:Ce("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(wL,{children:O.jsx(L$,{className:"h-2 w-2 fill-current"})})}),t]}));RL.displayName=xL.displayName;const OL=H.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(vL,{ref:r,className:Ce("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));OL.displayName=vL.displayName;const PL=H.forwardRef(({className:e,...t},n)=>O.jsx(_L,{ref:n,className:Ce("-mx-1 my-1 h-px bg-muted",e),...t}));PL.displayName=_L.displayName;function Xme(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,frames:(r=n.frames)==null?void 0:r.map(o=>{var i;return{...o,cards:(i=o.cards)==null?void 0:i.map(s=>TL(s))}})}})}}function TL(e){var t,n,r,o;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(o=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:o.map(i=>({...i,data:[]}))}},customCfg:Qme(e.customCfg),data:[]}}function Qme(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function DL(e){return`semaphor:bookmark:${e}`}const Jme=C5,Zme=E5,eve=R5,AL=H.forwardRef(({className:e,...t},n)=>O.jsx(nS,{ref:n,className:Ce("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}));AL.displayName=nS.displayName;const $L=H.forwardRef(({className:e,children:t,...n},r)=>O.jsx(eve,{children:O.jsxs(au,{children:[O.jsx(AL,{}),O.jsxs(rS,{ref:r,className:Ce("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,O.jsxs(sS,{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:[O.jsx($m,{className:"h-4 w-4"}),O.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));$L.displayName=rS.displayName;const kL=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});kL.displayName="DialogHeader";const ML=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ML.displayName="DialogFooter";const IL=H.forwardRef(({className:e,...t},n)=>O.jsx(oS,{ref:n,className:Ce("text-lg font-semibold leading-none tracking-tight",e),...t}));IL.displayName=oS.displayName;const NL=H.forwardRef(({className:e,...t},n)=>O.jsx(iS,{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));NL.displayName=iS.displayName;const LL="Checkbox",[tve,Pye]=Zn(LL),[nve,rve]=tve(LL),ove=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,h]=m.useState(null),g=_t(t,S=>h(S)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[w=!1,x]=wr({prop:o,defaultProp:i,onChange:c}),_=m.useRef(w);return m.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const C=()=>x(_.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[f,x]),m.createElement(nve,{scope:n,state:w,disabled:a},m.createElement(Qe.button,he({type:"button",role:"checkbox","aria-checked":dl(w)?"mixed":w,"aria-required":s,"data-state":FL(w),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:g,onKeyDown:Me(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Me(e.onClick,S=>{x(C=>dl(C)?!0:!C),b&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),b&&m.createElement(ave,{control:f,bubbles:!v.current,name:r,value:l,checked:w,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),ive="CheckboxIndicator",sve=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=rve(ive,n);return m.createElement(er,{present:r||dl(i.state)||i.state===!0},m.createElement(Qe.span,he({"data-state":FL(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),ave=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=jm(n),a=Im(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});l.indeterminate=dl(n),f.call(l,dl(n)?!1:n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",he({type:"checkbox","aria-hidden":!0,defaultChecked:dl(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function dl(e){return e==="indeterminate"}function FL(e){return dl(e)?"indeterminate":e?"checked":"unchecked"}const jL=ove,lve=sve,zL=H.forwardRef(({className:e,...t},n)=>O.jsx(jL,{ref:n,className:Ce("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:O.jsx(lve,{className:Ce("flex items-center justify-center text-current"),children:O.jsx(Ff,{className:"h-4 w-4"})})}));zL.displayName=jL.displayName;const BL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{role:"editor-panel",ref:n,className:Ce("flex grow h-full",e),...t}));BL.displayName="EditorPanel";const VL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce(" flex flex-col space-y-2 w-[270px]",e),...t}));VL.displayName="EditorAside";const HL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce(" grow",e),...t}));HL.displayName="EditorMain";function cve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function T2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P2(Object(n),!0).forEach(function(r){cve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uve(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function dve(e,t){if(e==null)return{};var n=uve(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fve(e,t){return hve(e)||pve(e,t)||gve(e,t)||mve()}function hve(e){if(Array.isArray(e))return e}function pve(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function gve(e,t){if(e){if(typeof e=="string")return D2(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 D2(e,t)}}function D2(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 mve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
425
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return H.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},yge=P5,xge=T5,j5=D5,z5=A5,B5=N5,V5=F5,H5=k5,W5=I5;const wge=yge,_ge=xge,U5=H.forwardRef(({className:e,...t},n)=>O.jsx(j5,{className:Ce("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}));U5.displayName=j5.displayName;const q5=H.forwardRef(({className:e,...t},n)=>O.jsx(_ge,{children:O.jsxs(au,{children:[O.jsx(U5,{}),O.jsx(z5,{ref:n,className:Ce("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})]})}));q5.displayName=z5.displayName;const G5=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});G5.displayName="AlertDialogHeader";const Y5=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Y5.displayName="AlertDialogFooter";const K5=H.forwardRef(({className:e,...t},n)=>O.jsx(H5,{ref:n,className:Ce("text-lg font-semibold",e),...t}));K5.displayName=H5.displayName;const X5=H.forwardRef(({className:e,...t},n)=>O.jsx(W5,{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));X5.displayName=W5.displayName;const Q5=H.forwardRef(({className:e,...t},n)=>O.jsx(B5,{ref:n,className:Ce(Vd(),e),...t}));Q5.displayName=B5.displayName;const J5=H.forwardRef(({className:e,...t},n)=>O.jsx(V5,{ref:n,className:Ce(Vd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));J5.displayName=V5.displayName;function Sge({open:e,setOpen:t}){const n=ke(i=>i.selectedSheetId),{deleteSheet:r}=co();function o(){n&&(r(n),t(!1))}return O.jsx(wge,{open:e,onOpenChange:t,children:O.jsxs(q5,{children:[O.jsxs(G5,{children:[O.jsx(K5,{children:"Delete Sheet"}),O.jsx(X5,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),O.jsxs(Y5,{children:[O.jsx(J5,{children:"Cancel"}),O.jsx(Q5,{onClick:o,children:"Delete"})]})]})})}function Z5(){var b,w;const[e,t]=m.useState(!1),n=ke(x=>{var _;return(_=x.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=ma(),o=m.useRef(null),[i,s]=m.useState(!1),a=ke(x=>x.isDashboardEditing),l=ke(x=>x.themeStyle);ke(x=>x.isVisualEditing);const c=ke(x=>x.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:f,addSheet:h}=co();if(!n)return null;function g(x){var _,S;x?((_=o.current)==null||_.resize(35),s(!0)):(s(!1),(S=o.current)==null||S.resize(0))}function v(){const x={id:la(),title:"New Sheet"};h(x)}return O.jsxs(kw,{role:"dashboard-tabs-container",className:Ce("relative flex grow flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:x=>{u(x)},value:c||n[0].id,children:[O.jsx("div",{children:(n.length>1||a)&&O.jsxs(dm,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(x=>{var _,S;return O.jsx(is,{text:x.title,onSave:C=>f(x.id,C),children:O.jsxs(fm,{style:{borderRadius:(S=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:S.borderRadius},onClick:()=>u(x.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:x.id,children:[x.title,a&&c===x.id&&n.length>1&&O.jsx($m,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},x.id)}),a&&O.jsx("div",{style:{borderRadius:(w=(b=l==null?void 0:l.chart)==null?void 0:b.options)==null?void 0:w.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:v,children:O.jsx(R1,{className:"size-3"})})]})}),O.jsxs(YN,{className:"grow",direction:"horizontal",children:[O.jsx(aw,{children:O.jsx("div",{style:{},children:n==null?void 0:n.map(x=>O.jsx(Mw,{className:Ce("mt-0",{"bg-muted":(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)}),value:x.id,children:O.jsx(Hae,{})},x.id))})}),r===!0&&O.jsxs(O.Fragment,{children:[O.jsx(ope,{open:i,onTabClick:g,withHandle:!0}),O.jsx(aw,{onResize:x=>{x<1?s(!1):i||s(!0)},defaultSize:0,ref:o,children:O.jsx(Lhe,{})})]})]}),O.jsx(Sge,{open:e,setOpen:t})]})}function eL({children:e}){return O.jsx(bB,{defaultTheme:"system",storageKey:"vite-ui-theme",children:O.jsx(DJ,{delayDuration:0,children:e})})}function tL(e){return O.jsx(dk,{dashboardProps:e,children:O.jsx(eL,{children:O.jsx(RD,{...e,children:O.jsx(Z5,{})})})})}const nL=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Ege);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(uw,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(uw,he({},r,{ref:t}),n)});nL.displayName="Slot";const uw=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Rge(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});uw.displayName="SlotClone";const Cge=({children:e})=>m.createElement(m.Fragment,null,e);function Ege(e){return m.isValidElement(e)&&e.type===Cge}function Rge(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const dw=["Enter"," "],Oge=["ArrowDown","PageUp","Home"],rL=["ArrowUp","PageDown","End"],Pge=[...Oge,...rL],Tge={ltr:[...dw,"ArrowRight"],rtl:[...dw,"ArrowLeft"]},Dge={ltr:["ArrowLeft"],rtl:["ArrowRight"]},dv="Menu",[ff,Age,$ge]=um(dv),[$l,oL]=Zn(dv,[$ge,Ti,ou]),aS=Ti(),iL=ou(),[kge,kl]=$l(dv),[Mge,eh]=$l(dv),Ige=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=aS(t),[l,c]=m.useState(null),u=m.useRef(!1),f=Ln(i),h=_l(o);return m.useEffect(()=>{const g=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Bf,a,m.createElement(kge,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(Mge,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:h,modal:s},r)))},sL=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=aS(n);return m.createElement(Vf,he({},o,r,{ref:t}))}),aL="MenuPortal",[Nge,lL]=$l(aL,{forceMount:void 0}),Lge=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=kl(aL,t);return m.createElement(Nge,{scope:t,forceMount:n},m.createElement(er,{present:n||i.open},m.createElement(M1,{asChild:!0,container:o},r)))},Qo="MenuContent",[Fge,lS]=$l(Qo),jge=m.forwardRef((e,t)=>{const n=lL(Qo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Qo,e.__scopeMenu),s=eh(Qo,e.__scopeMenu);return m.createElement(ff.Provider,{scope:e.__scopeMenu},m.createElement(er,{present:r||i.open},m.createElement(ff.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(zge,he({},o,{ref:t})):m.createElement(Bge,he({},o,{ref:t})))))}),zge=m.forwardRef((e,t)=>{const n=kl(Qo,e.__scopeMenu),r=m.useRef(null),o=_t(t,r);return m.useEffect(()=>{const i=r.current;if(i)return zm(i)},[]),m.createElement(cS,he({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),Bge=m.forwardRef((e,t)=>{const n=kl(Qo,e.__scopeMenu);return m.createElement(cS,he({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),cS=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:g,disableOutsideScroll:v,...b}=e,w=kl(Qo,n),x=eh(Qo,n),_=aS(n),S=iL(n),C=Age(n),[E,P]=m.useState(null),A=m.useRef(null),k=_t(t,A,w.onContentChange),I=m.useRef(0),$=m.useRef(""),L=m.useRef(0),j=m.useRef(null),Q=m.useRef("right"),ee=m.useRef(0),B=v?r_:m.Fragment,Z=v?{as:nL,allowPinchZoom:!0}:void 0,G=K=>{var T,V;const X=$.current+K,N=C().filter(ne=>!ne.disabled),ie=document.activeElement,fe=(T=N.find(ne=>ne.ref.current===ie))===null||T===void 0?void 0:T.textValue,ue=N.map(ne=>ne.textValue),pe=sme(ue,X,fe),se=(V=N.find(ne=>ne.textValue===pe))===null||V===void 0?void 0:V.ref.current;(function ne(le){$.current=le,window.clearTimeout(I.current),le!==""&&(I.current=window.setTimeout(()=>ne(""),1e3))})(X),se&&setTimeout(()=>se.focus())};m.useEffect(()=>()=>window.clearTimeout(I.current),[]),Z1();const q=m.useCallback(K=>{var T,V;return Q.current===((T=j.current)===null||T===void 0?void 0:T.side)&&lme(K,(V=j.current)===null||V===void 0?void 0:V.area)},[]);return m.createElement(Fge,{scope:n,searchRef:$,onItemEnter:m.useCallback(K=>{q(K)&&K.preventDefault()},[q]),onItemLeave:m.useCallback(K=>{var T;q(K)||((T=A.current)===null||T===void 0||T.focus(),P(null))},[q]),onTriggerLeave:m.useCallback(K=>{q(K)&&K.preventDefault()},[q]),pointerGraceTimerRef:L,onPointerGraceIntentChange:m.useCallback(K=>{j.current=K},[])},m.createElement(B,Z,m.createElement(e_,{asChild:!0,trapped:o,onMountAutoFocus:Me(i,K=>{var T;K.preventDefault(),(T=A.current)===null||T===void 0||T.focus()}),onUnmountAutoFocus:s},m.createElement(jf,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:g},m.createElement(Dw,he({asChild:!0},S,{dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:P,onEntryFocus:Me(l,K=>{x.isUsingKeyboardRef.current||K.preventDefault()})}),m.createElement(Hf,he({role:"menu","aria-orientation":"vertical","data-state":hL(w.open),"data-radix-menu-content":"",dir:x.dir},_,b,{ref:k,style:{outline:"none",...b.style},onKeyDown:Me(b.onKeyDown,K=>{const V=K.target.closest("[data-radix-menu-content]")===K.currentTarget,X=K.ctrlKey||K.altKey||K.metaKey,N=K.key.length===1;V&&(K.key==="Tab"&&K.preventDefault(),!X&&N&&G(K.key));const ie=A.current;if(K.target!==ie||!Pge.includes(K.key))return;K.preventDefault();const ue=C().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);rL.includes(K.key)&&ue.reverse(),ome(ue)}),onBlur:Me(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(I.current),$.current="")}),onPointerMove:Me(e.onPointerMove,hf(K=>{const T=K.target,V=ee.current!==K.clientX;if(K.currentTarget.contains(T)&&V){const X=K.clientX>ee.current?"right":"left";Q.current=X,ee.current=K.clientX}}))})))))))}),Vge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({role:"group"},r,{ref:t}))}),Hge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({},r,{ref:t}))}),fw="MenuItem",O2="menu.itemSelect",uS=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=eh(fw,e.__scopeMenu),a=lS(fw,e.__scopeMenu),l=_t(t,i),c=m.useRef(!1),u=()=>{const f=i.current;if(!n&&f){const h=new CustomEvent(O2,{bubbles:!0,cancelable:!0});f.addEventListener(O2,g=>r==null?void 0:r(g),{once:!0}),PD(f,h),h.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(cL,he({},o,{ref:l,disabled:n,onClick:Me(e.onClick,u),onPointerDown:f=>{var h;(h=e.onPointerDown)===null||h===void 0||h.call(e,f),c.current=!0},onPointerUp:Me(e.onPointerUp,f=>{var h;c.current||(h=f.currentTarget)===null||h===void 0||h.click()}),onKeyDown:Me(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||dw.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),cL=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=lS(fw,n),a=iL(n),l=m.useRef(null),c=_t(t,l),[u,f]=m.useState(!1),[h,g]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var b;g(((b=v.textContent)!==null&&b!==void 0?b:"").trim())}},[i.children]),m.createElement(ff.ItemSlot,{scope:n,disabled:r,textValue:o??h},m.createElement(Aw,he({asChild:!0},a,{focusable:!r}),m.createElement(Qe.div,he({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:Me(e.onPointerMove,hf(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Me(e.onPointerLeave,hf(v=>s.onItemLeave(v))),onFocus:Me(e.onFocus,()=>f(!0)),onBlur:Me(e.onBlur,()=>f(!1))}))))}),Wge=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(dL,{scope:e.__scopeMenu,checked:n},m.createElement(uS,he({role:"menuitemcheckbox","aria-checked":Jg(n)?"mixed":n},o,{ref:t,"data-state":dS(n),onSelect:Me(o.onSelect,()=>r==null?void 0:r(Jg(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),Uge="MenuRadioGroup",[qge,Gge]=$l(Uge,{value:void 0,onValueChange:()=>{}}),Yge=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Ln(r);return m.createElement(qge,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(Vge,he({},o,{ref:t})))}),Kge="MenuRadioItem",Xge=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=Gge(Kge,e.__scopeMenu),i=n===o.value;return m.createElement(dL,{scope:e.__scopeMenu,checked:i},m.createElement(uS,he({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":dS(i),onSelect:Me(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),uL="MenuItemIndicator",[dL,Qge]=$l(uL,{checked:!1}),Jge=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Qge(uL,n);return m.createElement(er,{present:r||Jg(i.checked)||i.checked===!0},m.createElement(Qe.span,he({},o,{ref:t,"data-state":dS(i.checked)})))}),Zge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),eme="MenuSub",[Rye,fL]=$l(eme),Hp="MenuSubTrigger",tme=m.forwardRef((e,t)=>{const n=kl(Hp,e.__scopeMenu),r=eh(Hp,e.__scopeMenu),o=fL(Hp,e.__scopeMenu),i=lS(Hp,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(sL,he({asChild:!0},c),m.createElement(cL,he({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":hL(n.open)},e,{ref:cs(t,o.onTriggerChange),onClick:f=>{var h;(h=e.onClick)===null||h===void 0||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Me(e.onPointerMove,hf(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Me(e.onPointerLeave,hf(f=>{var h;u();const g=(h=n.content)===null||h===void 0?void 0:h.getBoundingClientRect();if(g){var v;const b=(v=n.content)===null||v===void 0?void 0:v.dataset.side,w=b==="right",x=w?-5:5,_=g[w?"left":"right"],S=g[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:_,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:_,y:g.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Me(e.onKeyDown,f=>{const h=i.searchRef.current!=="";if(!(e.disabled||h&&f.key===" ")&&Tge[r.dir].includes(f.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),f.preventDefault()}})})))}),nme="MenuSubContent",rme=m.forwardRef((e,t)=>{const n=lL(Qo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Qo,e.__scopeMenu),s=eh(Qo,e.__scopeMenu),a=fL(nme,e.__scopeMenu),l=m.useRef(null),c=_t(t,l);return m.createElement(ff.Provider,{scope:e.__scopeMenu},m.createElement(er,{present:r||i.open},m.createElement(ff.Slot,{scope:e.__scopeMenu},m.createElement(cS,he({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Me(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Me(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Me(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),h=Dge[s.dir].includes(u.key);if(f&&h){var g;i.onOpenChange(!1),(g=a.trigger)===null||g===void 0||g.focus(),u.preventDefault()}})})))))});function hL(e){return e?"open":"closed"}function Jg(e){return e==="indeterminate"}function dS(e){return Jg(e)?"indeterminate":e?"checked":"unchecked"}function ome(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ime(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function sme(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=ime(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function ame(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function lme(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ame(n,t)}function hf(e){return t=>t.pointerType==="mouse"?e(t):void 0}const cme=Ige,ume=sL,dme=Lge,fme=jge,hme=Hge,pme=uS,gme=Wge,mme=Yge,vme=Xge,bme=Jge,yme=Zge,xme=tme,wme=rme,pL="DropdownMenu",[_me,Oye]=Zn(pL,[oL]),po=oL(),[Sme,gL]=_me(pL),Cme=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=po(t),c=m.useRef(null),[u=!1,f]=wr({prop:o,defaultProp:i,onChange:s});return m.createElement(Sme,{scope:t,triggerId:Jo(),triggerRef:c,contentId:Jo(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:a},m.createElement(cme,he({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},Eme="DropdownMenuTrigger",Rme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=gL(Eme,n),s=po(n);return m.createElement(ume,he({asChild:!0},s),m.createElement(Qe.button,he({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:cs(t,i.triggerRef),onPointerDown:Me(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Me(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),Ome=e=>{const{__scopeDropdownMenu:t,...n}=e,r=po(t);return m.createElement(dme,he({},r,n))},Pme="DropdownMenuContent",Tme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=gL(Pme,n),i=po(n),s=m.useRef(!1);return m.createElement(fme,he({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:Me(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Me(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Dme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(hme,he({},o,r,{ref:t}))}),Ame=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(pme,he({},o,r,{ref:t}))}),$me=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(gme,he({},o,r,{ref:t}))}),kme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(mme,he({},o,r,{ref:t}))}),Mme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(vme,he({},o,r,{ref:t}))}),Ime=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(bme,he({},o,r,{ref:t}))}),Nme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(yme,he({},o,r,{ref:t}))}),Lme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(xme,he({},o,r,{ref:t}))}),Fme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=po(n);return m.createElement(wme,he({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),jme=Cme,zme=Rme,Bme=Ome,mL=Tme,vL=Dme,bL=Ame,yL=$me,Vme=kme,xL=Mme,wL=Ime,_L=Nme,SL=Lme,CL=Fme,Hme=jme,Wme=zme,Ume=Vme,qme=H.forwardRef(({className:e,inset:t,children:n,...r},o)=>O.jsxs(SL,{ref:o,className:Ce("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,O.jsx(E1,{className:"ml-auto h-4 w-4"})]}));qme.displayName=SL.displayName;const Gme=H.forwardRef(({className:e,...t},n)=>O.jsx(CL,{ref:n,className:Ce("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}));Gme.displayName=CL.displayName;const EL=H.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(Bme,{children:O.jsx(au,{children:O.jsx(mL,{ref:r,sideOffset:t,className:Ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})}));EL.displayName=mL.displayName;const Yme=H.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(bL,{ref:r,className:Ce("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}));Yme.displayName=bL.displayName;const Kme=H.forwardRef(({className:e,children:t,checked:n,...r},o)=>O.jsxs(yL,{ref:o,className:Ce("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(wL,{children:O.jsx(Ff,{className:"h-4 w-4"})})}),t]}));Kme.displayName=yL.displayName;const RL=H.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(xL,{ref:r,className:Ce("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(wL,{children:O.jsx(L$,{className:"h-2 w-2 fill-current"})})}),t]}));RL.displayName=xL.displayName;const OL=H.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(vL,{ref:r,className:Ce("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));OL.displayName=vL.displayName;const PL=H.forwardRef(({className:e,...t},n)=>O.jsx(_L,{ref:n,className:Ce("-mx-1 my-1 h-px bg-muted",e),...t}));PL.displayName=_L.displayName;function Xme(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,frames:(r=n.frames)==null?void 0:r.map(o=>{var i;return{...o,cards:(i=o.cards)==null?void 0:i.map(s=>TL(s))}})}})}}function TL(e){var t,n,r,o;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(o=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:o.map(i=>({...i,data:[]}))}},customCfg:Qme(e.customCfg),data:[]}}function Qme(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function DL(e){return`semaphor:bookmark:${e}`}const Jme=C5,Zme=E5,eve=R5,AL=H.forwardRef(({className:e,...t},n)=>O.jsx(nS,{ref:n,className:Ce("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}));AL.displayName=nS.displayName;const $L=H.forwardRef(({className:e,children:t,...n},r)=>O.jsx(eve,{children:O.jsxs(au,{children:[O.jsx(AL,{}),O.jsxs(rS,{ref:r,className:Ce("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,O.jsxs(sS,{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:[O.jsx($m,{className:"h-4 w-4"}),O.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));$L.displayName=rS.displayName;const kL=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});kL.displayName="DialogHeader";const ML=({className:e,...t})=>O.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ML.displayName="DialogFooter";const IL=H.forwardRef(({className:e,...t},n)=>O.jsx(oS,{ref:n,className:Ce("text-lg font-semibold leading-none tracking-tight",e),...t}));IL.displayName=oS.displayName;const NL=H.forwardRef(({className:e,...t},n)=>O.jsx(iS,{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));NL.displayName=iS.displayName;const LL="Checkbox",[tve,Pye]=Zn(LL),[nve,rve]=tve(LL),ove=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,h]=m.useState(null),g=_t(t,S=>h(S)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[w=!1,x]=wr({prop:o,defaultProp:i,onChange:c}),_=m.useRef(w);return m.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const C=()=>x(_.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[f,x]),m.createElement(nve,{scope:n,state:w,disabled:a},m.createElement(Qe.button,he({type:"button",role:"checkbox","aria-checked":dl(w)?"mixed":w,"aria-required":s,"data-state":FL(w),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:g,onKeyDown:Me(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Me(e.onClick,S=>{x(C=>dl(C)?!0:!C),b&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),b&&m.createElement(ave,{control:f,bubbles:!v.current,name:r,value:l,checked:w,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),ive="CheckboxIndicator",sve=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=rve(ive,n);return m.createElement(er,{present:r||dl(i.state)||i.state===!0},m.createElement(Qe.span,he({"data-state":FL(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),ave=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=jm(n),a=Im(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});l.indeterminate=dl(n),f.call(l,dl(n)?!1:n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",he({type:"checkbox","aria-hidden":!0,defaultChecked:dl(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function dl(e){return e==="indeterminate"}function FL(e){return dl(e)?"indeterminate":e?"checked":"unchecked"}const jL=ove,lve=sve,zL=H.forwardRef(({className:e,...t},n)=>O.jsx(jL,{ref:n,className:Ce("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:O.jsx(lve,{className:Ce("flex items-center justify-center text-current"),children:O.jsx(Ff,{className:"h-4 w-4"})})}));zL.displayName=jL.displayName;const BL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{role:"editor-panel",ref:n,className:Ce("flex grow h-full",e),...t}));BL.displayName="EditorPanel";const VL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce(" flex flex-col space-y-2 w-[270px]",e),...t}));VL.displayName="EditorAside";const HL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ce(" grow",e),...t}));HL.displayName="EditorMain";function cve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function T2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P2(Object(n),!0).forEach(function(r){cve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uve(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function dve(e,t){if(e==null)return{};var n=uve(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fve(e,t){return hve(e)||pve(e,t)||gve(e,t)||mve()}function hve(e){if(Array.isArray(e))return e}function pve(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function gve(e,t){if(e){if(typeof e=="string")return D2(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 D2(e,t)}}function D2(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 mve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
426
426
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function $2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A2(Object(n),!0).forEach(function(r){vve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bve(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,i){return i(o)},r)}}function cd(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function Zg(e){return{}.toString.call(e).includes("Object")}function yve(e){return!Object.keys(e).length}function pf(e){return typeof e=="function"}function xve(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wve(e,t){return Zg(t)||ia("changeType"),Object.keys(t).some(function(n){return!xve(e,n)})&&ia("changeField"),t}function _ve(e){pf(e)||ia("selectorType")}function Sve(e){pf(e)||Zg(e)||ia("handlerType"),Zg(e)&&Object.values(e).some(function(t){return!pf(t)})&&ia("handlersType")}function Cve(e){e||ia("initialIsRequired"),Zg(e)||ia("initialType"),yve(e)&&ia("initialContent")}function Eve(e,t){throw new Error(e[t]||e.default)}var Rve={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"},ia=cd(Eve)(Rve),Wp={changes:wve,selector:_ve,handler:Sve,initial:Cve};function Ove(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Wp.initial(e),Wp.handler(t);var n={current:e},r=cd(Dve)(n,t),o=cd(Tve)(n),i=cd(Wp.changes)(e),s=cd(Pve)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return Wp.selector(c),c(n.current)}function l(c){bve(r,o,i,s)(c)}return[a,l]}function Pve(e,t){return pf(t)?t(e.current):t}function Tve(e,t){return e.current=$2($2({},e.current),t),t}function Dve(e,t,n){return pf(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var Ave={create:Ove},$ve={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function kve(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function Mve(e){return{}.toString.call(e).includes("Object")}function Ive(e){return e||k2("configIsRequired"),Mve(e)||k2("configType"),e.urls?(Nve(),{paths:{vs:e.urls.monacoBase}}):e}function Nve(){console.warn(WL.deprecation)}function Lve(e,t){throw new Error(e[t]||e.default)}var WL={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!
|
|
427
427
|
You are using deprecated way of configuration.
|
|
428
428
|
|
|
@@ -432,4 +432,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
432
432
|
monaco.config({ paths: { vs: '...' } })
|
|
433
433
|
|
|
434
434
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
435
|
-
`},k2=kve(Lve)(WL),Fve={config:Ive},jve=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,s){return s(i)},o)}};function UL(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],UL(e[n],t[n]))}),T2(T2({},e),t)}var zve={type:"cancelation",msg:"operation is manually canceled"};function a0(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(zve):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var Bve=Ave.create({config:$ve,isInitialized:!1,resolve:null,reject:null,monaco:null}),qL=fve(Bve,2),th=qL[0],fv=qL[1];function Vve(e){var t=Fve.config(e),n=t.monaco,r=dve(t,["monaco"]);fv(function(o){return{config:UL(o.config,r),monaco:n}})}function Hve(){var e=th(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(fv({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),a0(l0);if(window.monaco&&window.monaco.editor)return GL(window.monaco),e.resolve(window.monaco),a0(l0);jve(Wve,qve)(Gve)}return a0(l0)}function Wve(e){return document.body.appendChild(e)}function Uve(e){var t=document.createElement("script");return e&&(t.src=e),t}function qve(e){var t=th(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=Uve("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Gve(){var e=th(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){GL(n),e.resolve(n)},function(n){e.reject(n)})}function GL(e){th().monaco||fv({monaco:e})}function Yve(){return th(function(e){var t=e.monaco;return t})}var l0=new Promise(function(e,t){return fv({resolve:e,reject:t})}),YL={config:Vve,init:Hve,__getMonacoInstance:Yve},Kve={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},c0=Kve,Xve={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Qve=Xve;function Jve({children:e}){return m.createElement("div",{style:Qve.container},e)}var Zve=Jve,ebe=Zve;function tbe({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...c0.wrapper,width:e,height:t},...s},!n&&m.createElement(ebe,null,r),m.createElement("div",{ref:o,style:{...c0.fullWidth,...!n&&c0.hide},className:i}))}var nbe=tbe,KL=m.memo(nbe);function rbe(e){m.useEffect(e,[])}var XL=rbe;function obe(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var to=obe;function Cd(){}function mc(e,t,n,r){return ibe(e,r)||sbe(e,t,n,r)}function ibe(e,t){return e.editor.getModel(QL(e,t))}function sbe(e,t,n,r){return e.editor.createModel(t,n,r?QL(e,r):void 0)}function QL(e,t){return e.Uri.parse(t)}function abe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:f={},height:h="100%",width:g="100%",className:v,wrapperProps:b={},beforeMount:w=Cd,onMount:x=Cd}){let[_,S]=m.useState(!1),[C,E]=m.useState(!0),P=m.useRef(null),A=m.useRef(null),k=m.useRef(null),I=m.useRef(x),$=m.useRef(w),L=m.useRef(!1);XL(()=>{let B=YL.init();return B.then(Z=>(A.current=Z)&&E(!1)).catch(Z=>(Z==null?void 0:Z.type)!=="cancelation"&&console.error("Monaco initialization: error:",Z)),()=>P.current?ee():B.cancel()}),to(()=>{if(P.current&&A.current){let B=P.current.getOriginalEditor(),Z=mc(A.current,e||"",r||n||"text",i||"");Z!==B.getModel()&&B.setModel(Z)}},[i],_),to(()=>{if(P.current&&A.current){let B=P.current.getModifiedEditor(),Z=mc(A.current,t||"",o||n||"text",s||"");Z!==B.getModel()&&B.setModel(Z)}},[s],_),to(()=>{let B=P.current.getModifiedEditor();B.getOption(A.current.editor.EditorOption.readOnly)?B.setValue(t||""):t!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[t],_),to(()=>{var B,Z;(Z=(B=P.current)==null?void 0:B.getModel())==null||Z.original.setValue(e||"")},[e],_),to(()=>{let{original:B,modified:Z}=P.current.getModel();A.current.editor.setModelLanguage(B,r||n||"text"),A.current.editor.setModelLanguage(Z,o||n||"text")},[n,r,o],_),to(()=>{var B;(B=A.current)==null||B.editor.setTheme(c)},[c],_),to(()=>{var B;(B=P.current)==null||B.updateOptions(f)},[f],_);let j=m.useCallback(()=>{var G;if(!A.current)return;$.current(A.current);let B=mc(A.current,e||"",r||n||"text",i||""),Z=mc(A.current,t||"",o||n||"text",s||"");(G=P.current)==null||G.setModel({original:B,modified:Z})},[n,t,o,e,r,i,s]),Q=m.useCallback(()=>{var B;!L.current&&k.current&&(P.current=A.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...f}),j(),(B=A.current)==null||B.editor.setTheme(c),S(!0),L.current=!0)},[f,c,j]);m.useEffect(()=>{_&&I.current(P.current,A.current)},[_]),m.useEffect(()=>{!C&&!_&&Q()},[C,_,Q]);function ee(){var Z,G,q,K;let B=(Z=P.current)==null?void 0:Z.getModel();a||((G=B==null?void 0:B.original)==null||G.dispose()),l||((q=B==null?void 0:B.modified)==null||q.dispose()),(K=P.current)==null||K.dispose()}return m.createElement(KL,{width:g,height:h,isEditorReady:_,loading:u,_ref:k,className:v,wrapperProps:b})}var lbe=abe;m.memo(lbe);function cbe(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var ube=cbe,Up=new Map;function dbe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:f=!0,keepCurrentModel:h=!1,width:g="100%",height:v="100%",className:b,wrapperProps:w={},beforeMount:x=Cd,onMount:_=Cd,onChange:S,onValidate:C=Cd}){let[E,P]=m.useState(!1),[A,k]=m.useState(!0),I=m.useRef(null),$=m.useRef(null),L=m.useRef(null),j=m.useRef(_),Q=m.useRef(x),ee=m.useRef(),B=m.useRef(r),Z=ube(i),G=m.useRef(!1),q=m.useRef(!1);XL(()=>{let V=YL.init();return V.then(X=>(I.current=X)&&k(!1)).catch(X=>(X==null?void 0:X.type)!=="cancelation"&&console.error("Monaco initialization: error:",X)),()=>$.current?T():V.cancel()}),to(()=>{var X,N,ie,fe;let V=mc(I.current,e||r||"",t||o||"",i||n||"");V!==((X=$.current)==null?void 0:X.getModel())&&(f&&Up.set(Z,(N=$.current)==null?void 0:N.saveViewState()),(ie=$.current)==null||ie.setModel(V),f&&((fe=$.current)==null||fe.restoreViewState(Up.get(i))))},[i],E),to(()=>{var V;(V=$.current)==null||V.updateOptions(c)},[c],E),to(()=>{!$.current||r===void 0||($.current.getOption(I.current.editor.EditorOption.readOnly)?$.current.setValue(r):r!==$.current.getValue()&&(q.current=!0,$.current.executeEdits("",[{range:$.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),$.current.pushUndoStop(),q.current=!1))},[r],E),to(()=>{var X,N;let V=(X=$.current)==null?void 0:X.getModel();V&&o&&((N=I.current)==null||N.editor.setModelLanguage(V,o))},[o],E),to(()=>{var V;a!==void 0&&((V=$.current)==null||V.revealLine(a))},[a],E),to(()=>{var V;(V=I.current)==null||V.editor.setTheme(s)},[s],E);let K=m.useCallback(()=>{var V;if(!(!L.current||!I.current)&&!G.current){Q.current(I.current);let X=i||n,N=mc(I.current,r||e||"",t||o||"",X||"");$.current=(V=I.current)==null?void 0:V.editor.create(L.current,{model:N,automaticLayout:!0,...c},u),f&&$.current.restoreViewState(Up.get(X)),I.current.editor.setTheme(s),a!==void 0&&$.current.revealLine(a),P(!0),G.current=!0}},[e,t,n,r,o,i,c,u,f,s,a]);m.useEffect(()=>{E&&j.current($.current,I.current)},[E]),m.useEffect(()=>{!A&&!E&&K()},[A,E,K]),B.current=r,m.useEffect(()=>{var V,X;E&&S&&((V=ee.current)==null||V.dispose(),ee.current=(X=$.current)==null?void 0:X.onDidChangeModelContent(N=>{q.current||S($.current.getValue(),N)}))},[E,S]),m.useEffect(()=>{if(E){let V=I.current.editor.onDidChangeMarkers(X=>{var ie;let N=(ie=$.current.getModel())==null?void 0:ie.uri;if(N&&X.find(fe=>fe.path===N.path)){let fe=I.current.editor.getModelMarkers({resource:N});C==null||C(fe)}});return()=>{V==null||V.dispose()}}return()=>{}},[E,C]);function T(){var V,X;(V=ee.current)==null||V.dispose(),h?f&&Up.set(i,$.current.saveViewState()):(X=$.current.getModel())==null||X.dispose(),$.current.dispose()}return m.createElement(KL,{width:g,height:v,isEditorReady:E,loading:l,_ref:L,className:b,wrapperProps:w})}var fbe=dbe,JL=m.memo(fbe),hbe=JL;const ZL="Collapsible",[pbe,eF]=Zn(ZL),[gbe,fS]=pbe(ZL),mbe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=wr({prop:r,defaultProp:o,onChange:s});return m.createElement(gbe,{scope:n,disabled:i,contentId:Jo(),open:l,onOpenToggle:m.useCallback(()=>c(u=>!u),[c])},m.createElement(Qe.div,he({"data-state":hS(l),"data-disabled":i?"":void 0},a,{ref:t})))}),vbe="CollapsibleTrigger",bbe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=fS(vbe,n);return m.createElement(Qe.button,he({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":hS(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:Me(e.onClick,o.onOpenToggle)}))}),tF="CollapsibleContent",ybe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=fS(tF,e.__scopeCollapsible);return m.createElement(er,{present:n||o.open},({present:i})=>m.createElement(xbe,he({},r,{ref:t,present:i})))}),xbe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=fS(tF,n),[a,l]=m.useState(r),c=m.useRef(null),u=_t(t,c),f=m.useRef(0),h=f.current,g=m.useRef(0),v=g.current,b=s.open||a,w=m.useRef(b),x=m.useRef();return m.useEffect(()=>{const _=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(_)},[]),ur(()=>{const _=c.current;if(_){x.current=x.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const S=_.getBoundingClientRect();f.current=S.height,g.current=S.width,w.current||(_.style.transitionDuration=x.current.transitionDuration,_.style.animationName=x.current.animationName),l(r)}},[s.open,r]),m.createElement(Qe.div,he({"data-state":hS(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b},i,{ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),b&&o)});function hS(e){return e?"open":"closed"}const wbe=mbe,_be=bbe,Sbe=ybe,ba="Accordion",Cbe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[pS,Ebe,Rbe]=um(ba),[hv,Tye]=Zn(ba,[Rbe,eF]),gS=eF(),nF=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(pS.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(Dbe,he({},i,{ref:t})):m.createElement(Tbe,he({},o,{ref:t})))});nF.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[rF,Obe]=hv(ba),[oF,Pbe]=hv(ba,{collapsible:!1}),Tbe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=wr({prop:n,defaultProp:r,onChange:o});return m.createElement(rF,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(oF,{scope:e.__scopeAccordion,collapsible:i},m.createElement(iF,he({},s,{ref:t}))))}),Dbe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=wr({prop:n,defaultProp:r,onChange:o}),l=m.useCallback(u=>a((f=[])=>[...f,u]),[a]),c=m.useCallback(u=>a((f=[])=>f.filter(h=>h!==u)),[a]);return m.createElement(rF,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(oF,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(iF,he({},i,{ref:t}))))}),[Abe,pv]=hv(ba),iF=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=m.useRef(null),l=_t(a,t),c=Ebe(n),f=_l(o)==="ltr",h=Me(e.onKeyDown,g=>{var v;if(!Cbe.includes(g.key))return;const b=g.target,w=c().filter(I=>{var $;return!(($=I.ref.current)!==null&&$!==void 0&&$.disabled)}),x=w.findIndex(I=>I.ref.current===b),_=w.length;if(x===-1)return;g.preventDefault();let S=x;const C=0,E=_-1,P=()=>{S=x+1,S>E&&(S=C)},A=()=>{S=x-1,S<C&&(S=E)};switch(g.key){case"Home":S=C;break;case"End":S=E;break;case"ArrowRight":i==="horizontal"&&(f?P():A());break;case"ArrowDown":i==="vertical"&&P();break;case"ArrowLeft":i==="horizontal"&&(f?A():P());break;case"ArrowUp":i==="vertical"&&A();break}const k=S%_;(v=w[k].ref.current)===null||v===void 0||v.focus()});return m.createElement(Abe,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(pS.Slot,{scope:n},m.createElement(Qe.div,he({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:h}))))}),hw="AccordionItem",[$be,mS]=hv(hw),kbe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=pv(hw,n),s=Obe(hw,n),a=gS(n),l=Jo(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return m.createElement($be,{scope:n,open:c,disabled:u,triggerId:l},m.createElement(wbe,he({"data-orientation":i.orientation,"data-state":sF(c)},a,o,{ref:t,disabled:u,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),Mbe="AccordionHeader",Ibe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=pv(ba,n),i=mS(Mbe,n);return m.createElement(Qe.h3,he({"data-orientation":o.orientation,"data-state":sF(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),M2="AccordionTrigger",Nbe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=pv(ba,n),i=mS(M2,n),s=Pbe(M2,n),a=gS(n);return m.createElement(pS.ItemSlot,{scope:n},m.createElement(_be,he({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),Lbe="AccordionContent",Fbe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=pv(ba,n),i=mS(Lbe,n),s=gS(n);return m.createElement(Sbe,he({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function sF(e){return e?"open":"closed"}const jbe=nF,zbe=kbe,Bbe=Ibe,aF=Nbe,lF=Fbe,Vbe=jbe,cF=H.forwardRef(({className:e,...t},n)=>O.jsx(zbe,{ref:n,className:Ce("border-b",e),...t}));cF.displayName="AccordionItem";const uF=H.forwardRef(({className:e,children:t,...n},r)=>O.jsx(Bbe,{className:"flex",children:O.jsxs(aF,{ref:r,className:Ce("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,O.jsx(Am,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));uF.displayName=aF.displayName;const dF=H.forwardRef(({className:e,children:t,...n},r)=>O.jsx(lF,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:O.jsx("div",{className:Ce("pb-4 pt-0",e),children:t})}));dF.displayName=lF.displayName;var Hbe=Object.defineProperty,Wbe=(e,t,n)=>t in e?Hbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qp=(e,t,n)=>(Wbe(e,typeof t!="symbol"?t+"":t,n),n);const Ube={stringify:e=>e,parse:e=>e},qbe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},Gbe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},Ybe={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},Kbe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},u0={string:Ube,number:qbe,boolean:Gbe,function:Ybe,json:Kbe},d0=Symbol.for("r2wc.render"),Gp=Symbol.for("r2wc.connected"),Na=Symbol.for("r2wc.context"),Ns=Symbol.for("r2wc.props");function Xbe(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(f=>f!=="container"),a={},l={},c={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const h=Qbe(f);l[f]=h,c[h]=f}class u extends HTMLElement{constructor(){super(),qp(this,r,!0),qp(this,o),qp(this,i,{}),qp(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Ns].container=this.container;for(const h of s){const g=l[h],v=this.getAttribute(g),b=a[h],w=u0[b];v&&w!=null&&w.parse&&(this[Ns][h]=w.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[Gp]=!0,this[d0]()}disconnectedCallback(){this[Gp]=!1,this[Na]&&n.unmount(this[Na]),delete this[Na]}attributeChangedCallback(h,g,v){const b=c[h],w=a[b],x=u0[w];b in a&&x!=null&&x.parse&&(this[Ns][b]=x.parse(v,this),this[d0]())}[(r=Gp,o=Na,i=Ns,d0)](){this[Gp]&&(this[Na]?n.update(this[Na],this[Ns]):this[Na]=n.mount(this.container,e,this[Ns]))}}for(const f of s){const h=l[f],g=a[f];Object.defineProperty(u.prototype,f,{enumerable:!0,configurable:!0,get(){return this[Ns][f]},set(v){this[Ns][f]=v;const b=u0[g];if(b!=null&&b.stringify){const w=b.stringify(v);this.getAttribute(h)!==w&&this.setAttribute(h,w)}}})}return u}function Qbe(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Jbe(e,t,n){const r=_0(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function Zbe({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function eye({root:e}){e.unmount()}function tye(e,t={}){return Xbe(e,t,{mount:Jbe,update:Zbe,unmount:eye})}const nye={id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean"},rye=tye(tL,{props:nye});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=TI;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=nk;exports.Accordion=Vbe;exports.AccordionContent=dF;exports.AccordionItem=cF;exports.AccordionTrigger=uF;exports.BOOLEAN_DATA_TYPES=_w;exports.Bot=vx;exports.Button=xr;exports.Calendar=I$;exports.Card=Rw;exports.CardContent=cm;exports.CardDescription=Ow;exports.CardFooter=Pw;exports.CardHeader=lm;exports.CardTitle=Af;exports.ChartJsVisual=_1;exports.Check=Ff;exports.CheckIcon=A$;exports.Checkbox=zL;exports.ChevronDown=Am;exports.ClipboardCopyIcon=xX;exports.ColorFormat=mM;exports.Cross2Icon=$$;exports.DATAMODEL_NAMESPCACE=dD;exports.DATE_DATA_TYPES=Pf;exports.Dashboard=tL;exports.DashboardPanel=RD;exports.DashboardTabs=Z5;exports.DashboardWC=rye;exports.Dialog=Jme;exports.DialogContent=$L;exports.DialogDescription=NL;exports.DialogFooter=ML;exports.DialogHeader=kL;exports.DialogTitle=IL;exports.DialogTrigger=Zme;exports.DropdownMenu=Hme;exports.DropdownMenuContent=EL;exports.DropdownMenuLabel=OL;exports.DropdownMenuRadioGroup=Ume;exports.DropdownMenuRadioItem=RL;exports.DropdownMenuSeparator=PL;exports.DropdownMenuTrigger=Wme;exports.Editable=is;exports.EditorAside=VL;exports.EditorMain=HL;exports.EditorPanel=BL;exports.Ft=hbe;exports.HoverCard=W1;exports.HoverCardContent=Fm;exports.HoverCardTrigger=U1;exports.InfoCircledIcon=TX;exports.Input=xc;exports.Jt=pk;exports.KPICard=lk;exports.LOCALE_CURRENCY_PAIRS=S0;exports.Label=Wn;exports.Markdown=PN;exports.NUMBER_DATA_TYPES=Vc;exports.PYTHON_DEFAULT_CODE=uD;exports.PaperPlaneIcon=k$;exports.PlayIcon=$X;exports.Plus=R1;exports.Popover=qm;exports.PopoverContent=Wf;exports.PopoverTrigger=Gm;exports.RadioGroup=u_;exports.RadioGroupItem=Fg;exports.ResizableHandle=rpe;exports.ResizablePanel=aw;exports.ResizablePanelGroup=YN;exports.ScrollArea=I_;exports.ScrollBar=nv;exports.Select=zs;exports.SelectContent=Ji;exports.SelectGroup=dc;exports.SelectItem=Hn;exports.SelectLabel=Va;exports.SelectSeparator=Lg;exports.SelectTrigger=Qi;exports.SelectValue=Bs;exports.SemaphorContextProvider=dk;exports.SemaphorQueryClient=ck;exports.Separator=Ym;exports.Settings=O1;exports.SliderIcon=MX;exports.Switch=VI;exports.TEXT_DATA_TYPES=im;exports.Table=F$;exports.Table$1=q1;exports.TableBody=Y1;exports.TableCell=Ig;exports.TableHead=K1;exports.TableHeader=G1;exports.TableRow=yd;exports.TableVisual=bM;exports.Tabs=kw;exports.TabsContent=Mw;exports.TabsList=dm;exports.TabsTrigger=fm;exports.Te=EZ;exports.TextCard=CM;exports.Textarea=c_;exports.Toggle=l_;exports.Tooltip=ik;exports.TooltipContent=F1;exports.TooltipTrigger=sk;exports.TriangleDownIcon=S1;exports.TriangleUpIcon=C1;exports.UXProvider=eL;exports.X=$m;exports._=ol;exports.cleanCard=TL;exports.cn=Ce;exports.copyToClipboard=nz;exports.createChartConfig=z1;exports.createLucideIcon=Dn;exports.createSqlGenConfig=kz;exports.de=JL;exports.flexRender=Dx;exports.fmt=Sw;exports.getBookmarkKey=DL;exports.getCanvasBackgroundColor=Pd;exports.getColumnDataType=Mz;exports.getContrastColor=Bc;exports.getCoreRowModel=Ok;exports.getDashbaordStateWithoutData=Xme;exports.getDefaultFilterSql=zae;exports.getFilterValueType=hg;exports.getKeys=ar;exports.getNumberAxis=j1;exports.getPaginationRowModel=Tk;exports.getQualifiedTableName=fD;exports.getRequest=tz;exports.getSortedRowModel=Pk;exports.getSql=$z;exports.isColumnInSqlGen=Iz;exports.jsxRuntimeExports=O;exports.pivotData=Tg;exports.postRequest=Of;exports.resolveBaseQuery=Q2;exports.resolveDataType=Td;exports.titleCase=oz;exports.useCard=tZ;exports.useDashboardActions=co;exports.useDashboardCard=B1;exports.useDashboardStore=$e;exports.useEditorActions=Dm;exports.useEditorStore=br;exports.useQuery=Df;exports.useReactTable=Dk;exports.useSemaphorContext=ma;exports.useTheme=CD;exports.v4=la;
|
|
435
|
+
`},k2=kve(Lve)(WL),Fve={config:Ive},jve=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,s){return s(i)},o)}};function UL(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],UL(e[n],t[n]))}),T2(T2({},e),t)}var zve={type:"cancelation",msg:"operation is manually canceled"};function a0(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(zve):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var Bve=Ave.create({config:$ve,isInitialized:!1,resolve:null,reject:null,monaco:null}),qL=fve(Bve,2),th=qL[0],fv=qL[1];function Vve(e){var t=Fve.config(e),n=t.monaco,r=dve(t,["monaco"]);fv(function(o){return{config:UL(o.config,r),monaco:n}})}function Hve(){var e=th(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(fv({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),a0(l0);if(window.monaco&&window.monaco.editor)return GL(window.monaco),e.resolve(window.monaco),a0(l0);jve(Wve,qve)(Gve)}return a0(l0)}function Wve(e){return document.body.appendChild(e)}function Uve(e){var t=document.createElement("script");return e&&(t.src=e),t}function qve(e){var t=th(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=Uve("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Gve(){var e=th(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){GL(n),e.resolve(n)},function(n){e.reject(n)})}function GL(e){th().monaco||fv({monaco:e})}function Yve(){return th(function(e){var t=e.monaco;return t})}var l0=new Promise(function(e,t){return fv({resolve:e,reject:t})}),YL={config:Vve,init:Hve,__getMonacoInstance:Yve},Kve={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},c0=Kve,Xve={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Qve=Xve;function Jve({children:e}){return m.createElement("div",{style:Qve.container},e)}var Zve=Jve,ebe=Zve;function tbe({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...c0.wrapper,width:e,height:t},...s},!n&&m.createElement(ebe,null,r),m.createElement("div",{ref:o,style:{...c0.fullWidth,...!n&&c0.hide},className:i}))}var nbe=tbe,KL=m.memo(nbe);function rbe(e){m.useEffect(e,[])}var XL=rbe;function obe(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var to=obe;function Cd(){}function mc(e,t,n,r){return ibe(e,r)||sbe(e,t,n,r)}function ibe(e,t){return e.editor.getModel(QL(e,t))}function sbe(e,t,n,r){return e.editor.createModel(t,n,r?QL(e,r):void 0)}function QL(e,t){return e.Uri.parse(t)}function abe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:f={},height:h="100%",width:g="100%",className:v,wrapperProps:b={},beforeMount:w=Cd,onMount:x=Cd}){let[_,S]=m.useState(!1),[C,E]=m.useState(!0),P=m.useRef(null),A=m.useRef(null),k=m.useRef(null),I=m.useRef(x),$=m.useRef(w),L=m.useRef(!1);XL(()=>{let B=YL.init();return B.then(Z=>(A.current=Z)&&E(!1)).catch(Z=>(Z==null?void 0:Z.type)!=="cancelation"&&console.error("Monaco initialization: error:",Z)),()=>P.current?ee():B.cancel()}),to(()=>{if(P.current&&A.current){let B=P.current.getOriginalEditor(),Z=mc(A.current,e||"",r||n||"text",i||"");Z!==B.getModel()&&B.setModel(Z)}},[i],_),to(()=>{if(P.current&&A.current){let B=P.current.getModifiedEditor(),Z=mc(A.current,t||"",o||n||"text",s||"");Z!==B.getModel()&&B.setModel(Z)}},[s],_),to(()=>{let B=P.current.getModifiedEditor();B.getOption(A.current.editor.EditorOption.readOnly)?B.setValue(t||""):t!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[t],_),to(()=>{var B,Z;(Z=(B=P.current)==null?void 0:B.getModel())==null||Z.original.setValue(e||"")},[e],_),to(()=>{let{original:B,modified:Z}=P.current.getModel();A.current.editor.setModelLanguage(B,r||n||"text"),A.current.editor.setModelLanguage(Z,o||n||"text")},[n,r,o],_),to(()=>{var B;(B=A.current)==null||B.editor.setTheme(c)},[c],_),to(()=>{var B;(B=P.current)==null||B.updateOptions(f)},[f],_);let j=m.useCallback(()=>{var G;if(!A.current)return;$.current(A.current);let B=mc(A.current,e||"",r||n||"text",i||""),Z=mc(A.current,t||"",o||n||"text",s||"");(G=P.current)==null||G.setModel({original:B,modified:Z})},[n,t,o,e,r,i,s]),Q=m.useCallback(()=>{var B;!L.current&&k.current&&(P.current=A.current.editor.createDiffEditor(k.current,{automaticLayout:!0,...f}),j(),(B=A.current)==null||B.editor.setTheme(c),S(!0),L.current=!0)},[f,c,j]);m.useEffect(()=>{_&&I.current(P.current,A.current)},[_]),m.useEffect(()=>{!C&&!_&&Q()},[C,_,Q]);function ee(){var Z,G,q,K;let B=(Z=P.current)==null?void 0:Z.getModel();a||((G=B==null?void 0:B.original)==null||G.dispose()),l||((q=B==null?void 0:B.modified)==null||q.dispose()),(K=P.current)==null||K.dispose()}return m.createElement(KL,{width:g,height:h,isEditorReady:_,loading:u,_ref:k,className:v,wrapperProps:b})}var lbe=abe;m.memo(lbe);function cbe(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var ube=cbe,Up=new Map;function dbe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:f=!0,keepCurrentModel:h=!1,width:g="100%",height:v="100%",className:b,wrapperProps:w={},beforeMount:x=Cd,onMount:_=Cd,onChange:S,onValidate:C=Cd}){let[E,P]=m.useState(!1),[A,k]=m.useState(!0),I=m.useRef(null),$=m.useRef(null),L=m.useRef(null),j=m.useRef(_),Q=m.useRef(x),ee=m.useRef(),B=m.useRef(r),Z=ube(i),G=m.useRef(!1),q=m.useRef(!1);XL(()=>{let V=YL.init();return V.then(X=>(I.current=X)&&k(!1)).catch(X=>(X==null?void 0:X.type)!=="cancelation"&&console.error("Monaco initialization: error:",X)),()=>$.current?T():V.cancel()}),to(()=>{var X,N,ie,fe;let V=mc(I.current,e||r||"",t||o||"",i||n||"");V!==((X=$.current)==null?void 0:X.getModel())&&(f&&Up.set(Z,(N=$.current)==null?void 0:N.saveViewState()),(ie=$.current)==null||ie.setModel(V),f&&((fe=$.current)==null||fe.restoreViewState(Up.get(i))))},[i],E),to(()=>{var V;(V=$.current)==null||V.updateOptions(c)},[c],E),to(()=>{!$.current||r===void 0||($.current.getOption(I.current.editor.EditorOption.readOnly)?$.current.setValue(r):r!==$.current.getValue()&&(q.current=!0,$.current.executeEdits("",[{range:$.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),$.current.pushUndoStop(),q.current=!1))},[r],E),to(()=>{var X,N;let V=(X=$.current)==null?void 0:X.getModel();V&&o&&((N=I.current)==null||N.editor.setModelLanguage(V,o))},[o],E),to(()=>{var V;a!==void 0&&((V=$.current)==null||V.revealLine(a))},[a],E),to(()=>{var V;(V=I.current)==null||V.editor.setTheme(s)},[s],E);let K=m.useCallback(()=>{var V;if(!(!L.current||!I.current)&&!G.current){Q.current(I.current);let X=i||n,N=mc(I.current,r||e||"",t||o||"",X||"");$.current=(V=I.current)==null?void 0:V.editor.create(L.current,{model:N,automaticLayout:!0,...c},u),f&&$.current.restoreViewState(Up.get(X)),I.current.editor.setTheme(s),a!==void 0&&$.current.revealLine(a),P(!0),G.current=!0}},[e,t,n,r,o,i,c,u,f,s,a]);m.useEffect(()=>{E&&j.current($.current,I.current)},[E]),m.useEffect(()=>{!A&&!E&&K()},[A,E,K]),B.current=r,m.useEffect(()=>{var V,X;E&&S&&((V=ee.current)==null||V.dispose(),ee.current=(X=$.current)==null?void 0:X.onDidChangeModelContent(N=>{q.current||S($.current.getValue(),N)}))},[E,S]),m.useEffect(()=>{if(E){let V=I.current.editor.onDidChangeMarkers(X=>{var ie;let N=(ie=$.current.getModel())==null?void 0:ie.uri;if(N&&X.find(fe=>fe.path===N.path)){let fe=I.current.editor.getModelMarkers({resource:N});C==null||C(fe)}});return()=>{V==null||V.dispose()}}return()=>{}},[E,C]);function T(){var V,X;(V=ee.current)==null||V.dispose(),h?f&&Up.set(i,$.current.saveViewState()):(X=$.current.getModel())==null||X.dispose(),$.current.dispose()}return m.createElement(KL,{width:g,height:v,isEditorReady:E,loading:l,_ref:L,className:b,wrapperProps:w})}var fbe=dbe,JL=m.memo(fbe),hbe=JL;const ZL="Collapsible",[pbe,eF]=Zn(ZL),[gbe,fS]=pbe(ZL),mbe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=wr({prop:r,defaultProp:o,onChange:s});return m.createElement(gbe,{scope:n,disabled:i,contentId:Jo(),open:l,onOpenToggle:m.useCallback(()=>c(u=>!u),[c])},m.createElement(Qe.div,he({"data-state":hS(l),"data-disabled":i?"":void 0},a,{ref:t})))}),vbe="CollapsibleTrigger",bbe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=fS(vbe,n);return m.createElement(Qe.button,he({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":hS(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:Me(e.onClick,o.onOpenToggle)}))}),tF="CollapsibleContent",ybe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=fS(tF,e.__scopeCollapsible);return m.createElement(er,{present:n||o.open},({present:i})=>m.createElement(xbe,he({},r,{ref:t,present:i})))}),xbe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=fS(tF,n),[a,l]=m.useState(r),c=m.useRef(null),u=_t(t,c),f=m.useRef(0),h=f.current,g=m.useRef(0),v=g.current,b=s.open||a,w=m.useRef(b),x=m.useRef();return m.useEffect(()=>{const _=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(_)},[]),ur(()=>{const _=c.current;if(_){x.current=x.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const S=_.getBoundingClientRect();f.current=S.height,g.current=S.width,w.current||(_.style.transitionDuration=x.current.transitionDuration,_.style.animationName=x.current.animationName),l(r)}},[s.open,r]),m.createElement(Qe.div,he({"data-state":hS(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b},i,{ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),b&&o)});function hS(e){return e?"open":"closed"}const wbe=mbe,_be=bbe,Sbe=ybe,ba="Accordion",Cbe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[pS,Ebe,Rbe]=um(ba),[hv,Tye]=Zn(ba,[Rbe,eF]),gS=eF(),nF=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(pS.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(Dbe,he({},i,{ref:t})):m.createElement(Tbe,he({},o,{ref:t})))});nF.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[rF,Obe]=hv(ba),[oF,Pbe]=hv(ba,{collapsible:!1}),Tbe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=wr({prop:n,defaultProp:r,onChange:o});return m.createElement(rF,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(oF,{scope:e.__scopeAccordion,collapsible:i},m.createElement(iF,he({},s,{ref:t}))))}),Dbe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=wr({prop:n,defaultProp:r,onChange:o}),l=m.useCallback(u=>a((f=[])=>[...f,u]),[a]),c=m.useCallback(u=>a((f=[])=>f.filter(h=>h!==u)),[a]);return m.createElement(rF,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(oF,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(iF,he({},i,{ref:t}))))}),[Abe,pv]=hv(ba),iF=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=m.useRef(null),l=_t(a,t),c=Ebe(n),f=_l(o)==="ltr",h=Me(e.onKeyDown,g=>{var v;if(!Cbe.includes(g.key))return;const b=g.target,w=c().filter(I=>{var $;return!(($=I.ref.current)!==null&&$!==void 0&&$.disabled)}),x=w.findIndex(I=>I.ref.current===b),_=w.length;if(x===-1)return;g.preventDefault();let S=x;const C=0,E=_-1,P=()=>{S=x+1,S>E&&(S=C)},A=()=>{S=x-1,S<C&&(S=E)};switch(g.key){case"Home":S=C;break;case"End":S=E;break;case"ArrowRight":i==="horizontal"&&(f?P():A());break;case"ArrowDown":i==="vertical"&&P();break;case"ArrowLeft":i==="horizontal"&&(f?A():P());break;case"ArrowUp":i==="vertical"&&A();break}const k=S%_;(v=w[k].ref.current)===null||v===void 0||v.focus()});return m.createElement(Abe,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(pS.Slot,{scope:n},m.createElement(Qe.div,he({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:h}))))}),hw="AccordionItem",[$be,mS]=hv(hw),kbe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=pv(hw,n),s=Obe(hw,n),a=gS(n),l=Jo(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return m.createElement($be,{scope:n,open:c,disabled:u,triggerId:l},m.createElement(wbe,he({"data-orientation":i.orientation,"data-state":sF(c)},a,o,{ref:t,disabled:u,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),Mbe="AccordionHeader",Ibe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=pv(ba,n),i=mS(Mbe,n);return m.createElement(Qe.h3,he({"data-orientation":o.orientation,"data-state":sF(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),M2="AccordionTrigger",Nbe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=pv(ba,n),i=mS(M2,n),s=Pbe(M2,n),a=gS(n);return m.createElement(pS.ItemSlot,{scope:n},m.createElement(_be,he({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),Lbe="AccordionContent",Fbe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=pv(ba,n),i=mS(Lbe,n),s=gS(n);return m.createElement(Sbe,he({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function sF(e){return e?"open":"closed"}const jbe=nF,zbe=kbe,Bbe=Ibe,aF=Nbe,lF=Fbe,Vbe=jbe,cF=H.forwardRef(({className:e,...t},n)=>O.jsx(zbe,{ref:n,className:Ce("border-b",e),...t}));cF.displayName="AccordionItem";const uF=H.forwardRef(({className:e,children:t,...n},r)=>O.jsx(Bbe,{className:"flex",children:O.jsxs(aF,{ref:r,className:Ce("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,O.jsx(Am,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));uF.displayName=aF.displayName;const dF=H.forwardRef(({className:e,children:t,...n},r)=>O.jsx(lF,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:O.jsx("div",{className:Ce("pb-4 pt-0",e),children:t})}));dF.displayName=lF.displayName;var Hbe=Object.defineProperty,Wbe=(e,t,n)=>t in e?Hbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qp=(e,t,n)=>(Wbe(e,typeof t!="symbol"?t+"":t,n),n);const Ube={stringify:e=>e,parse:e=>e},qbe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},Gbe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},Ybe={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},Kbe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},u0={string:Ube,number:qbe,boolean:Gbe,function:Ybe,json:Kbe},d0=Symbol.for("r2wc.render"),Gp=Symbol.for("r2wc.connected"),Na=Symbol.for("r2wc.context"),Ns=Symbol.for("r2wc.props");function Xbe(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(f=>f!=="container"),a={},l={},c={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const h=Qbe(f);l[f]=h,c[h]=f}class u extends HTMLElement{constructor(){super(),qp(this,r,!0),qp(this,o),qp(this,i,{}),qp(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Ns].container=this.container;for(const h of s){const g=l[h],v=this.getAttribute(g),b=a[h],w=u0[b];v&&w!=null&&w.parse&&(this[Ns][h]=w.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[Gp]=!0,this[d0]()}disconnectedCallback(){this[Gp]=!1,this[Na]&&n.unmount(this[Na]),delete this[Na]}attributeChangedCallback(h,g,v){const b=c[h],w=a[b],x=u0[w];b in a&&x!=null&&x.parse&&(this[Ns][b]=x.parse(v,this),this[d0]())}[(r=Gp,o=Na,i=Ns,d0)](){this[Gp]&&(this[Na]?n.update(this[Na],this[Ns]):this[Na]=n.mount(this.container,e,this[Ns]))}}for(const f of s){const h=l[f],g=a[f];Object.defineProperty(u.prototype,f,{enumerable:!0,configurable:!0,get(){return this[Ns][f]},set(v){this[Ns][f]=v;const b=u0[g];if(b!=null&&b.stringify){const w=b.stringify(v);this.getAttribute(h)!==w&&this.setAttribute(h,w)}}})}return u}function Qbe(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Jbe(e,t,n){const r=_0(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function Zbe({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function eye({root:e}){e.unmount()}function tye(e,t={}){return Xbe(e,t,{mount:Jbe,update:Zbe,unmount:eye})}const nye={id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean"},rye=tye(tL,{props:nye});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=TI;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=nk;exports.Accordion=Vbe;exports.AccordionContent=dF;exports.AccordionItem=cF;exports.AccordionTrigger=uF;exports.BOOLEAN_DATA_TYPES=_w;exports.Bot=vx;exports.Button=xr;exports.Calendar=I$;exports.Card=Rw;exports.CardContent=cm;exports.CardDescription=Ow;exports.CardFooter=Pw;exports.CardHeader=lm;exports.CardTitle=Af;exports.ChartJsVisual=_1;exports.Check=Ff;exports.CheckIcon=A$;exports.Checkbox=zL;exports.ChevronDown=Am;exports.ClipboardCopyIcon=xX;exports.ColorFormat=mM;exports.Cross2Icon=$$;exports.DATAMODEL_NAMESPCACE=dD;exports.DATE_DATA_TYPES=Pf;exports.Dashboard=tL;exports.DashboardPanel=RD;exports.DashboardTabs=Z5;exports.DashboardWC=rye;exports.Dialog=Jme;exports.DialogContent=$L;exports.DialogDescription=NL;exports.DialogFooter=ML;exports.DialogHeader=kL;exports.DialogTitle=IL;exports.DialogTrigger=Zme;exports.DropdownMenu=Hme;exports.DropdownMenuContent=EL;exports.DropdownMenuLabel=OL;exports.DropdownMenuRadioGroup=Ume;exports.DropdownMenuRadioItem=RL;exports.DropdownMenuSeparator=PL;exports.DropdownMenuTrigger=Wme;exports.Editable=is;exports.EditorAside=VL;exports.EditorMain=HL;exports.EditorPanel=BL;exports.Ft=hbe;exports.HoverCard=W1;exports.HoverCardContent=Fm;exports.HoverCardTrigger=U1;exports.InfoCircledIcon=TX;exports.Input=xc;exports.Jt=pk;exports.KPICard=lk;exports.LOCALE_CURRENCY_PAIRS=S0;exports.Label=Wn;exports.Markdown=PN;exports.NUMBER_DATA_TYPES=Vc;exports.PYTHON_DEFAULT_CODE=uD;exports.PaperPlaneIcon=k$;exports.PlayIcon=$X;exports.Plus=R1;exports.Popover=qm;exports.PopoverContent=Wf;exports.PopoverTrigger=Gm;exports.RadioGroup=u_;exports.RadioGroupItem=Fg;exports.ResizableHandle=rpe;exports.ResizablePanel=aw;exports.ResizablePanelGroup=YN;exports.ScrollArea=I_;exports.ScrollBar=nv;exports.Select=zs;exports.SelectContent=Ji;exports.SelectGroup=dc;exports.SelectItem=Hn;exports.SelectLabel=Va;exports.SelectSeparator=Lg;exports.SelectTrigger=Qi;exports.SelectValue=Bs;exports.SemaphorContextProvider=dk;exports.SemaphorQueryClient=ck;exports.Separator=Ym;exports.Settings=O1;exports.SliderIcon=MX;exports.Switch=VI;exports.TEXT_DATA_TYPES=im;exports.Table=F$;exports.Table$1=q1;exports.TableBody=Y1;exports.TableCell=Ig;exports.TableHead=K1;exports.TableHeader=G1;exports.TableRow=yd;exports.TableVisual=bM;exports.Tabs=kw;exports.TabsContent=Mw;exports.TabsList=dm;exports.TabsTrigger=fm;exports.Te=EZ;exports.TextCard=CM;exports.Textarea=c_;exports.Toggle=l_;exports.Tooltip=ik;exports.TooltipContent=F1;exports.TooltipTrigger=sk;exports.TriangleDownIcon=S1;exports.TriangleUpIcon=C1;exports.UXProvider=eL;exports.X=$m;exports._=ol;exports.cleanCard=TL;exports.cn=Ce;exports.copyToClipboard=nz;exports.createChartConfig=z1;exports.createLucideIcon=Dn;exports.createSqlGenConfig=kz;exports.de=JL;exports.flexRender=Dx;exports.fmt=Sw;exports.getBookmarkKey=DL;exports.getCanvasBackgroundColor=Pd;exports.getColumnDataType=Mz;exports.getContrastColor=Bc;exports.getCoreRowModel=Ok;exports.getDashbaordStateWithoutData=Xme;exports.getDefaultFilterSql=zae;exports.getFilterValueType=hg;exports.getKeys=ar;exports.getNumberAxis=j1;exports.getPaginationRowModel=Tk;exports.getQualifiedTableName=fD;exports.getRequest=tz;exports.getSortedRowModel=Pk;exports.getSql=$z;exports.isColumnInSqlGen=Iz;exports.jsxRuntimeExports=O;exports.pivotData=Tg;exports.postRequest=Of;exports.resolveBaseQuery=Q2;exports.resolveDataType=Td;exports.titleCase=oz;exports.useCard=tZ;exports.useDashboardActions=co;exports.useDashboardCard=B1;exports.useDashboardStore=ke;exports.useEditorActions=Dm;exports.useEditorStore=br;exports.useQuery=Df;exports.useReactTable=Dk;exports.useSemaphorContext=ma;exports.useTheme=CD;exports.v4=la;
|